Skip to content

build: stop embedding source text in published source maps (sourcesContent: false across the tsup builds) and repair the cli package's dead sources references (build half of #15905 question 1) #16469

Description

@os-zhuang

Filed by the director seat under the #15905 ruling (decision batch #64, 2026-09-07): question 1 of the E3 standard ("is .js.map sourcesContent published?") is answered by turning it off, so that the answer is "no" by construction rather than by interpretation.

Measured today (from #15905, verified on the npm tarballs being distributed)

  • 55 of 57 publishable packages ship .js.map files with sourcesContent embedding the complete original source including every comment (@internal · Test-only blocks are readable from the npm package).
  • 72% of non-test source files, 23,242 TSDoc blocks and 87,281 line comments are distributed this way; maps are 49.3% of published bytes (@objectstack/spec: about half of 49 MB).
  • Nobody decided this: sourcemap: true is configured; embedding is esbuild's default. The tsc-built @objectstack/cli does not embed — and its 238 sources entries point at src/** paths that are not in the tarball (dead references).

Scope

  • Set sourcesContent: false once, at the shared tsup / esbuild configuration level (not 55 per-package edits), so every published map keeps mappings for stack-trace positioning but carries no source text.
  • Fix the cli package's maps: either include the referenced sources in files[] (probably not) or emit maps whose sources resolve — pick the one consistent with the rest of the fleet and say why.
  • Pin: a check: gate over dist/**/*.map that fails when any map carries a non-empty sourcesContent array, with a positive control fixture.
  • Changeset: patch across affected packages; the release note is written centrally (the changeset is this PR's input).

Not in scope

Acceptance

  • fresh build: zero maps with sourcesContent; gate red on a planted fixture
  • cli maps have no dead sources
  • published-size delta recorded on this card (before/after for spec and one small package)

Refs #15905, #14147 / #15395 (where the sourcesContent debate first surfaced).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions