From 00822c7e2bd592bd844edb75fc6b4b3f13d8f5c1 Mon Sep 17 00:00:00 2001 From: Ruth-2424 Date: Fri, 16 Oct 2026 00:01:52 -0400 Subject: [PATCH 1/2] fix(package): pack dist/src and src only, not the compiled test suite 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 91e70eda, 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. #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 #397 Co-Authored-By: Claude Opus 5.5 --- changelog.d/package-files.fixed.md | 6 ++++++ changelog.d/typescript-7.changed.md | 17 ++++++++--------- package.json | 3 +-- 3 files changed, 15 insertions(+), 11 deletions(-) create mode 100644 changelog.d/package-files.fixed.md diff --git a/changelog.d/package-files.fixed.md b/changelog.d/package-files.fixed.md new file mode 100644 index 000000000..fba391c0a --- /dev/null +++ b/changelog.d/package-files.fixed.md @@ -0,0 +1,6 @@ +- The npm package no longer ships the compiled test suite or the + compiler's build record: `files` packs `dist/src` and `src`, so + `dist/test`, about half the published files, and + `dist/tsconfig.tsbuildinfo` stay out, and the package's contents no + longer depend on whether the tests ran before packing. The redundant + `discord.js` entry in `devDependencies` is gone (it is a dependency). diff --git a/changelog.d/typescript-7.changed.md b/changelog.d/typescript-7.changed.md index 9d2f89336..2b23ab91c 100644 --- a/changelog.d/typescript-7.changed.md +++ b/changelog.d/typescript-7.changed.md @@ -5,19 +5,18 @@ `mcpl/references`, `mcpl/tool-classes`, `mcpl/transport`, `mcpl/types`, `modules/workspace/types` and `tune-out/tools`) write string literal types with single quotes, as the source does; the types are the same; - - source maps: of the 108 `.js.map` files that change, 104 move only + - source maps: of the 42 `.js.map` files that change, 38 move only columns; in two a generated line maps to other source lines, and in two a generated line gains or loses its mapping, so a stack trace can land on a different column, and rarely on a different line or none. Of the - 56 `.d.ts.map` files that change, 49 map some declarations to other - source lines and 7 gain or lose a line's mapping, which can move where - go-to-definition lands; - - `dist/tsconfig.tsbuildinfo`, the compiler's build record, changes. + 54 `.d.ts.map` files that change, 48 map some declarations to other + source lines and 6 gain or lose a line's mapping, which can move where + go-to-definition lands. - `test/stop-with-work-in-flight.test.ts`, whose build ships in `dist/test`, - now parses `src` with `@babel/parser`, a new devDependency: the main entry - of TypeScript 7's package has no compiler API, and its `./unstable/*` - entries reach the native compiler over IPC. + `test/stop-with-work-in-flight.test.ts` now parses `src` with + `@babel/parser`, a new devDependency: the main entry of TypeScript 7's + package has no compiler API, and its `./unstable/*` entries reach the + native compiler over IPC. As with the same source built with 5.9.3, a consumer on TypeScript 7 with `skipLibCheck` off whose `types` leaves out `node` can get Node-name errors diff --git a/package.json b/package.json index 792024938..3991fd4f9 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ } }, "files": [ - "dist", + "dist/src", "src" ], "bin": { @@ -58,7 +58,6 @@ "@babel/parser": "^7.29.9", "@types/node": "^22.0.0", "@types/ws": "^8.5.13", - "discord.js": "^14.25.1", "tsx": "^4.21.0", "typescript": "^7.0.2" }, From 00795a60667466eeb71b67e2c26e5aeed5e9b5c3 Mon Sep 17 00:00:00 2001 From: Ruth-2424 Date: Sat, 17 Oct 2026 08:48:36 -0400 Subject: [PATCH 2/2] changelog: leave the TypeScript 7 fragment as main has it The 0.22.2 release (#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 --- changelog.d/typescript-7.changed.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/changelog.d/typescript-7.changed.md b/changelog.d/typescript-7.changed.md index 2b23ab91c..9d2f89336 100644 --- a/changelog.d/typescript-7.changed.md +++ b/changelog.d/typescript-7.changed.md @@ -5,18 +5,19 @@ `mcpl/references`, `mcpl/tool-classes`, `mcpl/transport`, `mcpl/types`, `modules/workspace/types` and `tune-out/tools`) write string literal types with single quotes, as the source does; the types are the same; - - source maps: of the 42 `.js.map` files that change, 38 move only + - source maps: of the 108 `.js.map` files that change, 104 move only columns; in two a generated line maps to other source lines, and in two a generated line gains or loses its mapping, so a stack trace can land on a different column, and rarely on a different line or none. Of the - 54 `.d.ts.map` files that change, 48 map some declarations to other - source lines and 6 gain or lose a line's mapping, which can move where - go-to-definition lands. + 56 `.d.ts.map` files that change, 49 map some declarations to other + source lines and 7 gain or lose a line's mapping, which can move where + go-to-definition lands; + - `dist/tsconfig.tsbuildinfo`, the compiler's build record, changes. - `test/stop-with-work-in-flight.test.ts` now parses `src` with - `@babel/parser`, a new devDependency: the main entry of TypeScript 7's - package has no compiler API, and its `./unstable/*` entries reach the - native compiler over IPC. + `test/stop-with-work-in-flight.test.ts`, whose build ships in `dist/test`, + now parses `src` with `@babel/parser`, a new devDependency: the main entry + of TypeScript 7's package has no compiler API, and its `./unstable/*` + entries reach the native compiler over IPC. As with the same source built with 5.9.3, a consumer on TypeScript 7 with `skipLibCheck` off whose `types` leaves out `node` can get Node-name errors