Skip to content

fix(publish): keep manifest fields in the isolated build's deno.json#92

Merged
taras merged 1 commit into
mainfrom
fix/dnt-isolated-manifest
Jul 19, 2026
Merged

fix(publish): keep manifest fields in the isolated build's deno.json#92
taras merged 1 commit into
mainfrom
fix/dnt-isolated-manifest

Conversation

@taras

@taras taras commented Jul 19, 2026

Copy link
Copy Markdown
Owner

Motivation

The cli@0.3.0 npm publish fails dnt's type check with
TS2339: Property 'version' does not exist at cli.ts:72. The CLI reads its
version from ../deno.json (a JSON import), but the publish build copies the
package into an isolated directory and replaced the copy's deno.json with a
bare { imports } map — erasing version from the JSON module's type (and
value). The other four packages published; only cli imports its manifest.

Approach

The isolated deno.json now carries the manifest's name/version/exports
alongside 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.0 reproduces the exact
TS2339 before the fix and completes with full type checking after (against the
published 0.3.0 siblings); the built package's bin target runs under Node and
reports 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

  • All changed files relate to the stated purpose
  • No drive-by refactors or "while I'm here" cleanups
  • No formatting changes mixed with functional changes

New abstractions (if any)

None.

New dependencies (if any)

None.

New tests (if any)

None — verified by building against the live registry as described.

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.
@github-actions

Copy link
Copy Markdown

Warning

This PR changes release configuration (scripts/build-npm.ts) without touching
specs/release-process-spec.md. Review the spec and update it to match, or
state spec-reviewed: no changes needed in the PR description (AGENTS.md
rule 8).

PR #92: fix(publish): keep manifest fields in the isolated build's deno.json

1 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.

@taras
taras merged commit c7972ce into main Jul 19, 2026
7 checks passed
@taras
taras deleted the fix/dnt-isolated-manifest branch July 19, 2026 00:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant