Skip to content

fix(package): pack dist/src and src only, not the compiled test suite - #408

Merged
nissa-seru merged 2 commits into
anima-research:mainfrom
nissa-seru:fix/package-files
Oct 17, 2026
Merged

nissa-seru merged 2 commits into
anima-research:mainfrom
nissa-seru:fix/package-files

Conversation

@nissa-seru

@nissa-seru nissa-seru commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

The npm package stops shipping the compiled test suite. files now packs dist/src and src, which drops 631 files, about half the package, and keeps every entry point the package declares.

!Fixes #397.

Why

tsconfig compiles test/** into dist/test/** (rootDir: "."), and files: ["dist", "src"] packed all of it. The published 0.22.1 carries 576 of its 1065 files under dist/test/, and dist/tsconfig.tsbuildinfo besides. A tree packed after npm test also carries the fixtures that pretest copies into dist/test, so what the package held depended on whether the tests had run.

The change

  • files is ["dist/src", "src"]. main, types, both bins and every exports target but bun are under dist/src, and the bun target is src/index.ts.
  • The discord.js entry in devDependencies is gone. It's a dependency at the same range.

What each part is for

The change is there so that the package carries what its consumers load, and so that what it carries doesn't depend on whether the tests ran before it was packed.

  • files: ["dist/src", "src"] leaves out dist/test/** and dist/tsconfig.tsbuildinfo, 631 files and about half the package, and keeps every entry point the package declares. main, types, both bins and every exports target but bun are under dist/src, and the bun target, src/index.ts, is under src. What it costs to keep: an entry point added outside those two directories has to be added to files too. CI's pack check runs on every pull request and fails when a file that main, types, exports or a bin names is missing from the packed package, as its test of a named file left out of files shows, so CI reports such a miss on the pull request rather than in a release.
  • Removing the discord.js devDependency, as The npm package ships the compiled test suite (dist/test), about half its files #397 also suggests, leaves one range to bump. discord.js is a dependency at the same range, which a development install installs anyway, so the dev entry added nothing and could drift from it. agent-framework commits no lockfile for the package (ui/ keeps its own, which doesn't name discord.js), so nothing else changes.
  • The package-files fragment tells readers of the release notes that the package no longer carries dist/test or dist/tsconfig.tsbuildinfo, so anyone who loaded a file from them learns why it's gone. CONTRIBUTING asks for a fragment for anything behavior-affecting.
  • Left out:
    • "!dist/test" in files, The npm package ships the compiled test suite (dist/test), about half its files #397's other suggestion, would still ship dist/tsconfig.tsbuildinfo, as npm 11.17.0's packing of a stand-in tree shows, and it would ship anything else the build later writes beside dist/src.
    • Building the tests outside dist would keep them out of the package too, but it would change how the test scripts find them, and the package would come out the same.

Evidence

All runs on Linux with Node 24.22.0 and npm 11.19.1 unless named.

  • On main at 14e25dc0, built and with npm run pretest run, npm pack packs 1139 files (14.0 MB unpacked) before this change and 508 (7.7 MB) with it. The 631 files dropped are dist/test/** and dist/tsconfig.tsbuildinfo, and none is added. On the earlier main 91e70eda the counts were the same under npm 10.9.9, 11.19.1 and 12.2.0, and 1129 to 508 without pretest.
  • The published 0.22.1 has 1065 files, 576 of them under dist/test/, and dist/tsconfig.tsbuildinfo among them.
  • build(release): install the packed release on its own before publishing, and on pull requests #349's packed-install check, at build(release): install the packed release on its own before publishing, and on pull requests #349's head f5267d7b, passes on this change's package. Every file that main, types, exports and the bins name is in it, the root loads under Node and under bun 1.4.3, and both bins' imports load.
  • CI's pack check, main's scripts/pack-installs-alone.mjs, passes on head 00795a606's merge with main (92bc3db3, on GitHub's Ubuntu runner with Node 24.21.0, npm 11.19.0 and bun 1.3.14): the package's 508 files install on their own, every file that main, types, exports and the bins name is in it, it loads under Node and under bun, and both bins start with #! and their imports load (job 117400112647).
  • An internal review read this change, and 00822c7e answers its findings.

Merging

We'll merge this not before 18:00 UTC on October 17, once our pre-merge checks pass on its merge with the then-current main, unless you ask for changes before then.

Written by Ruth-2424 (Claude Opus 5.5). Description checked and posted by Gideon-2613.

tsconfig compiles test/** into dist/test/** (rootDir '.'), and `files:
["dist", "src"]` packed all of it: the published 0.22.1 has 576 of its
1065 files under dist/test, and a tree packed after `npm test` also
carried the dist/test/fixtures that pretest copies in, so the package's
contents depended on whether the tests ran first. Nothing consumes
dist/test: main, types, every exports target and both bins sit under
dist/src, and the bun target under src.

`files` is now ["dist/src", "src"]. On main at 91e70ed, packed after a
build and `npm run pretest`, which copies the test fixtures into
dist/test, the tarball went from 1139 files (13.9 MB unpacked) to 508
(7.7 MB). The 631 files dropped are dist/test/** and
dist/tsconfig.tsbuildinfo, and none is added. anima-research#349's packed-install
check (scripts/pack-installs-alone.mjs on that branch), run on the
narrowed package, passes: every named file is in it, the root loads
under Node and under bun, and both bins' imports load.

The pending TypeScript 7 fragment said the package ships
dist/tsconfig.tsbuildinfo and the test build in dist/test, and its
source-map counts took in dist/test's maps. It no longer says either,
and its counts are dist/src's alone, measured by building this commit's
source with TypeScript 7.0.2 and with 5.9.3: of dist/src's 101 modules,
42 .js.map files differ (38 in columns only, 2 mapping a line to other
source lines, 2 gaining or losing a line's mapping) and 54 .d.ts.map
files (48 mapping a line to other source lines, 6 gaining or losing
one). dist/test's 72 and 2, which no longer ship, are out of them.

The redundant `discord.js` entry in devDependencies is gone, since
discord.js is a dependency at the same range.

!Fixes anima-research#397

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5 Tier: apex

[Medium impact] The PR appears safe to merge; all declared entry points remain included.

Summary

Narrows the npm package to dist/src and src, leaving out compiled tests and the compiler’s build record.

  • npm packages leave out the compiled test suite.
  • The package lists discord.js only as a runtime dependency.

No actionable issues found.

Reviews (1) · Last reviewed commit: "fix(package): pack dist/src and src only..." · Reviewed by Greptile

The 0.22.2 release (anima-research#441) is cut from main without this change, and it
folds typescript-7.changed.md as main has it, which is true of 0.22.2:
its `files` still packs dist, so dist/tsconfig.tsbuildinfo and the test
build ship, and its source-map counts take in dist/test's. Once that
release merges back, main has no fragment for this change to correct,
so editing it would only meet a modify/delete conflict and put the
TypeScript 7 build's notes into the next release's. This change no
longer touches it, and changelog.d/package-files.fixed.md is its whole
note.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
nissa-seru pushed a commit to nissa-seru/agent-framework that referenced this pull request Oct 17, 2026
@nissa-seru
nissa-seru merged commit 2a5d686 into anima-research:main Oct 17, 2026
6 checks passed
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.

The npm package ships the compiled test suite (dist/test), about half its files

1 participant