LearnNewsExamplesConnect
Frontmatter
assigneesneo-fable-mnemosyne
createdAtNov 18, 2026, 7:35 AM
updatedAtNov 18, 2026, 5:32 PM
githubUrlhttps://github.com/neomjs/neo/issues/21313
authorneo-fable-mnemosyne
commentsCount1
parentIssue21213
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[x] 76 A new workspace no longer carries the engine''s test commands
blocking[]
closedAtNov 18, 2026, 5:32 PM

The npm package ships without the engine's spec files

Closed v14.0.0/archive-v14-0-0-chunk-4 enhancementdeveloper-experienceaibuild
neo-fable-mnemosyne
neo-fable-mnemosyne commented on Nov 18, 2026, 7:35 AM

Not offered as a first issue: it is bound to the Engine 14 window and lands in the same release as its generator half, neomjs/create-app#76.

Context

The first step of point 5 of #21213 ("the package ships less"). Every npm i neo.mjs writes the engine's own regression suite into the workspace.

Measured on 2026-11-18 at dev bdfc6a71ce with npm pack --dry-run --json, the report's files[] grouped by path. Compressed is the group as its own tar through gzip -9; by that instrument the whole package is 24.02 MiB.

Block Files Unpacked Compressed
The whole package 6,646 51.09 MiB 23.61 MiB (npm's figure)
*.spec.mjs 1,111 13.69 MiB 3.04 MiB
apps/portal 1,295 6.47 MiB 2.94 MiB
resources/examples 998 13.21 MiB 12.42 MiB
The package after this change, by the real pack 5,529 37.26 MiB 20.48 MiB (npm's figure)

File counts are of the committed tree. Until 2026-11-18T07:32Z this table said 6,650 and 5,533: the filer's working tree packs four seat-local files more, hidden from git only by .git/info/exclude and a global git ignore, which npm does not read; the review of the pull request counted the committed tree.

All 1,111 spec files lie under test/playwright/: unit 741, e2e 244, component 123, visual 2, clipboard 1. The rule also drops the six visual baselines, which Playwright keeps in folders named after the spec file (__screenshots__/<name>.spec.mjs/); the pack showed it, not the reading.

The Problem

The spec files are 17 % of the package's files and 27 % of its unpacked size, and one consumer outside this repository runs them: the four test commands the generator writes into a workspace. Those commands run the engine's Playwright configs out of node_modules/neo.mjs, and each config's testDir is the engine's own tree (playwright.config.unit.mjs:41, playwright.config.mjs:23, playwright.config.component.mjs:18, playwright.config.e2e.mjs:82). They run the engine's suite; a spec the workspace writes is outside every one of those directories.

Point 5 waits for a fresh workspace showing that test-unit works "with the Playwright configs and fixtures alone". That cannot be shown: a config alone has nothing to run, and Playwright then ends in Error: No tests found. with exit status 1 (run at bdfc6a71ce with a filter that matches no spec). So the generator stops writing the four commands in the same release (neomjs/create-app#76, where the fork and its rows are recorded), and this leaf's witness is the consumer build plus the modules that stay.

The Architectural Reality

  • package.json declares no files. The hand-written header of .npmignore decides what ships, and prepack appends a copy of .gitignore to it (buildScripts/util/npmIgnoreComposition.mjs).
  • buildScripts/util/check-package-contents.mjs runs the real pack and reds on FORBIDDEN_PREFIXES, two directory rules. Its spec pins that the rule set names directories only (test/playwright/unit/buildScripts/checkPackageContents.spec.mjs:145).
  • What stays under test/playwright/ is a consumed surface. Import statements that reach an installed engine, in .mjs files outside node_modules and dist of four sibling repositories (the Brain at f84726e1e0, the Institution at e8477f6f99 and two private workspaces at their dev): setup.mjs 100, fixtures.mjs 86, resolveFreePort.mjs 10, e2e/utils/workstationPopOut.mjs 6, e2e/utils/pngPixels.mjs 5. No imported path ends in .spec.mjs; the same matcher (neo\.mjs/test/… inside from, import( or resolve() found the 207 statements above, so it reaches the tree a spec import would sit in.
  • No packed module outside the spec files imports one: (from|import\()\s*['"][^'"]*\.spec\.mjs['"] over *.mjs except *.spec.mjs at bdfc6a71ce names no file, and the pattern matches a planted import line. Spec paths in src/ and buildScripts/ occur in comments.
  • Design authority: "The published Neo.mjs engine package contains its source files and build scripts, but not its generated /dist output or runtime dependencies." (learn/gettingstarted/Workspaces.md, line 16), and point 5 of #21213, selected in Discussion 21210.

The Fix

  1. .npmignore, authoritative header: one rule for the class, *.spec.mjs, with its reason and what stays.
  2. buildScripts/util/check-package-contents.mjs: the class becomes a rule the pack is judged by. A suffix rule joins the prefix rules in the same list and predicate, so a spec that ships from any folder fails the check with its reason. The module summary and the arm at line 145 of the spec then say "directories and one file class".
  3. checkPackageContents.spec.mjs: the arms named below.
  4. buildScripts/util/check-package-contents-baseline.json: the row for test/playwright/visual/__screenshots__/ goes with the baselines it covered, because the ratchet reads both ways.
  5. learn/gettingstarted/Workspaces.md: the sentence about the package's contents names the spec files and the modules that stay.

Contract Ledger

Target surface Source of authority Proposed behavior Fallback Docs Evidence
*.spec.mjs in the npm package #21213, point 5 not packed none: a clean cut at the major Workspaces.md, one line in the 14.0 notes the pack report
test/playwright/ configs, setup.mjs, fixtures.mjs, resolveFreePort.mjs, e2e/utils/*, e2e/globalSetup.mjs the imports counted above packed as today n/a unchanged the pack report lists them

Acceptance Criteria

  • npm run check-package-contents passes at the head, and its pack report holds no path ending in .spec.mjs. The pull request body states files, unpacked size and tarball size before and after.
  • Falsifier, shown in the pull request body and not committed: with the .npmignore rule removed, the same command exits non-zero and names the spec class with its reason.
  • Unit arms: a spec under test/playwright/unit/ and a spec outside test/ are found; test/playwright/setup.mjs, fixtures.mjs, a Playwright config and e2e/utils/pngPixels.mjs pass; every rule carries a reason.
  • The six visual baselines are not packed, and the image baseline holds no row for them.
  • The pack report still lists test/playwright/setup.mjs, fixtures.mjs, resolveFreePort.mjs, e2e/utils/workstationPopOut.mjs, e2e/utils/pngPixels.mjs and the Playwright configs.
  • Consumer Runtime Build is green on the pull request; its path filter includes .npmignore.
  • learn/gettingstarted/Workspaces.md says what the package holds of the test tree.
  • Post-merge, for the notes' owner (#21032): the 14.0 notes carry the upgrade line.

Out of Scope

  • apps/portal. The deployed site is built from the Portal inside the installed package (neomjs/pages, buildScripts/updateNeoVersion.mjs), and the consumer build check compiles it as its specimen. It can leave after the site takes the Portal from the release tag.
  • resources/examples, 52 % of the compressed package. It waits for the decision on copy-examples (#21213).
  • The 216 other files that stay under test/.
  • A files allowlist in package.json, set aside in #17240 as a ticket of its own.
  • The generator's commands and the scaffold's @playwright/test: neomjs/create-app#76 and #68 there.

Avoided Traps

  • A rule pinned to today's folder (/test/playwright/**/*.spec.mjs). A spec added elsewhere would ship; the class is the contract (the failure shape of #17240).
  • Dropping test/ whole. Five modules in it are imported from installed copies 207 times.
  • Reading the ignore rule instead of the pack. The guard exists because that failed twice (#17240, #17251).

Related

Live latest-open + closed sweep: checked latest 20 open + open and closed search ("npm package spec files", "tarball size package contents", "npmignore", "test-unit workspace", "package ships tests"; Out of Scope and Avoided Traps read on #19470, #17240, #20902 and #20667) at 2026-11-18T06:30Z; no equivalent or prior exclusion found. Backlog band: 74 open, red; the owning epic is #21213, and this is the leaf its point 5 names as unfiled. MC sweep: "a generated workspace's npm run test-unit runs the engine's own tests out of node_modules; the npm package ships the engine's spec files to every workspace", 6 results, no prior decision found. Own-assignment sweep: 5 open, none overlapping (#21213 is the parent). A2A sweep: latest 30 messages of all read states (05:11Z to 06:27Z), no claim on this scope. Structure map: N/A, no Agent OS placement.

Origin Session ID: 781e0e75-86b8-41b8-907d-6d433539c595 Retrieval Hint: "spec files leave the npm package; check-package-contents suffix rule; workspace test commands"