LearnNewsExamplesServices
Frontmatter
id19252
titleDistEsmWorkspaceBoot packs the working tree's ignored files since prepack composes .npmignore
stateClosed
labels
bugairegressionbuildtest
assigneesneo-opus-grace
createdAtSep 26, 2026, 12:15 PM
updatedAtSep 26, 2026, 2:23 PM
githubUrlhttps://github.com/neomjs/neo/issues/19252
authorneo-opus-grace
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtSep 26, 2026, 2:23 PM

DistEsmWorkspaceBoot packs the working tree's ignored files since prepack composes .npmignore

Closed Backlog/active-chunk-26 bugairegressionbuildtest
neo-opus-grace
neo-opus-grace commented on Sep 26, 2026, 12:15 PM

Context

test/playwright/e2e/core/DistEsmWorkspaceBoot.spec.mjs fails in a working tree since #19223 (merged 09-25). In #17844's census at dev a9abb6c1dc, its beforeAll dies at :140:

npm pack --json --ignore-scripts --loglevel=error --pack-destination …
npm error code ERR_OUT_OF_RANGE
npm error data is too long            (ssri fromData → Hash.update: the tarball outgrows one hash update)

CI stays green at the same head (run 36230911025, e2e-engine (1/3)), because a CI checkout holds almost nothing that git ignores.

The Problem

#19223 moved the .gitignore copy out of the committed .npmignore (177 → 40 lines) into prepack. --ignore-scripts skips prepack, so the spec's pack reads the header alone and packs everything the working tree holds and git ignores. After a full census that includes test/playwright/test-results/ (3.7 GiB), tmp/ (135 MiB) and .env. The tarball overflows, and when it doesn't, the spec boots a package a publish would never ship.

The Architectural Reality

#19223 added withComposedNpmIgnore(root, fn) (buildScripts/util/npmIgnoreComposition.mjs) for exactly this case, "a pack that passes --ignore-scripts", and migrated buildScripts/util/check-consumer-runtime-build.mjs:343. This spec is the one --ignore-scripts pack it did not migrate. Keeping --ignore-scripts is right: prepare runs the skills materializer, which a test must not run.

The Fix

Wrap the spec's execFileSync('npm', ['pack', …]) in withComposedNpmIgnore(engineRoot, () => …). Measured on the census tree: the wrapped pack is 5,805 entries and 26.8 MiB, with no test-results, no .env, and dist/parse5.mjs present, and .npmignore is restored afterwards.

Acceptance Criteria

  • AC-1: at the head, in a tree holding the census's test-results/, the spec's four arms pass (headless, --workers=1).
  • AC-2: red-first, the same tree at the head without the wrap fails beforeAll with ERR_OUT_OF_RANGE.
  • AC-3: git status shows .npmignore unchanged after the run.

Out of Scope

  • npmIgnoreComposition.mjs itself: it already has the seam.
  • The rest of #17844's census, refreshed on #17844.

Related

#17844 (the census that surfaced it) · #19222 / #19223 (the composition) · #17931 / #18718 (the spec)

Origin Session ID: 81d1894c-d8fd-4192-8350-42e32eb0101e Retrieval Hint: "DistEsmWorkspaceBoot npm pack ignore-scripts withComposedNpmIgnore ERR_OUT_OF_RANGE data is too long"

tobiu referenced in commit b50feac - "test(e2e): DistEsmWorkspaceBoot composes .npmignore around its script-less pack (#19252) (#19253) on Sep 26, 2026, 2:23 PM
tobiu closed this issue on Sep 26, 2026, 2:23 PM