fix(publish): keep manifest fields in the isolated build's deno.json#92
Merged
Conversation
The dnt isolation step replaced the package copy's deno.json with a bare import map, so cli/src/cli.ts's JSON import of ../deno.json lost its version property and the cli@0.3.0 publish failed type checking (TS2339). The isolated deno.json now carries name/version/exports alongside the rewritten imports. Verified: cli builds with full type check against the published 0.3.0 siblings, and the built bin reports 0.3.0 under Node.
|
Warning This PR changes release configuration (scripts/build-npm.ts) without touching PR #92: fix(publish): keep manifest fields in the isolated build's deno.json1 files, +13 / -1 Scope✅ PR scope looks good. Structural✅ No structural bloat detected. Slop✅ Slop indicators look low. Static Analysis✅ Oxlint found no issues. Correctness✅ Small PR — correctness review skipped. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
The
cli@0.3.0npm publish fails dnt's type check withTS2339: Property 'version' does not existatcli.ts:72. The CLI reads itsversion from
../deno.json(a JSON import), but the publish build copies thepackage into an isolated directory and replaced the copy's
deno.jsonwith abare
{ imports }map — erasingversionfrom the JSON module's type (andvalue). The other four packages published; only
cliimports its manifest.Approach
The isolated
deno.jsonnow carries the manifest'sname/version/exportsalongside the rewritten imports, so the JSON import keeps its shape while
sibling resolution still redirects to npm.
Verified:
deno run -A scripts/build-npm.ts cli 0.3.0reproduces the exactTS2339 before the fix and completes with full type checking after (against the
published 0.3.0 siblings); the built package's
bintarget runs under Node andreports
0.3.0. Lint/typecheck/tests green.spec-reviewed: no changes needed — §3's description of
scripts/build-npm.ts("builds one package with dnt") is unaffected by this internal fix.
Scope confirmation
New abstractions (if any)
None.
New dependencies (if any)
None.
New tests (if any)
None — verified by building against the live registry as described.