Repository navigation
fix(package): pack dist/src and src only, not the compiled test suite - #408
Merged
Merged
Conversation
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>
[Medium impact] The PR appears safe to merge; all declared entry points remain included. SummaryNarrows the npm package to
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The npm package stops shipping the compiled test suite.
filesnow packsdist/srcandsrc, which drops 631 files, about half the package, and keeps every entry point the package declares.!Fixes #397.
Why
tsconfig compiles
test/**intodist/test/**(rootDir: "."), andfiles: ["dist", "src"]packed all of it. The published 0.22.1 carries 576 of its 1065 files underdist/test/, anddist/tsconfig.tsbuildinfobesides. A tree packed afternpm testalso carries the fixtures thatpretestcopies intodist/test, so what the package held depended on whether the tests had run.The change
filesis["dist/src", "src"].main,types, both bins and everyexportstarget butbunare underdist/src, and thebuntarget issrc/index.ts.discord.jsentry indevDependenciesis 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 outdist/test/**anddist/tsconfig.tsbuildinfo, 631 files and about half the package, and keeps every entry point the package declares.main,types, both bins and everyexportstarget butbunare underdist/src, and thebuntarget,src/index.ts, is undersrc. What it costs to keep: an entry point added outside those two directories has to be added tofilestoo. CI's pack check runs on every pull request and fails when a file thatmain,types,exportsor a bin names is missing from the packed package, as its test of a named file left out offilesshows, so CI reports such a miss on the pull request rather than in a release.discord.jsdevDependency, as The npm package ships the compiled test suite (dist/test), about half its files #397 also suggests, leaves one range to bump.discord.jsis 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 namediscord.js), so nothing else changes.package-filesfragment tells readers of the release notes that the package no longer carriesdist/testordist/tsconfig.tsbuildinfo, so anyone who loaded a file from them learns why it's gone. CONTRIBUTING asks for a fragment for anything behavior-affecting."!dist/test"infiles, The npm package ships the compiled test suite (dist/test), about half its files #397's other suggestion, would still shipdist/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 besidedist/src.distwould 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.
mainat14e25dc0, built and withnpm run pretestrun,npm packpacks 1139 files (14.0 MB unpacked) before this change and 508 (7.7 MB) with it. The 631 files dropped aredist/test/**anddist/tsconfig.tsbuildinfo, and none is added. On the earliermain91e70edathe counts were the same under npm 10.9.9, 11.19.1 and 12.2.0, and 1129 to 508 withoutpretest.dist/test/, anddist/tsconfig.tsbuildinfoamong them.f5267d7b, passes on this change's package. Every file thatmain,types,exportsand the bins name is in it, the root loads under Node and under bun 1.4.3, and both bins' imports load.main'sscripts/pack-installs-alone.mjs, passes on head00795a606's merge withmain(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 thatmain,types,exportsand the bins name is in it, it loads under Node and under bun, and both bins start with#!and their imports load (job 117400112647).00822c7eanswers 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.