[Feature] Stop publishing .d.ts and .d.ts.map files for the CLI package (1,166 files, 1.2 MB)
Summary
tsconfig.json has declaration and declarationMap turned on, so every compiled file also ships a .d.ts and a .d.ts.map. The package is a CLI (bin plus main: dist/cli.js), has no types or exports field, and nothing in the repo reads these files. They only add files to install and unpack.
Steps to reproduce
pnpm run buildnpm pack --dry-run --json --ignore-scriptsand count entries ending in.d.tsand.d.ts.map.
Expected behaviour
The tarball contains only files the CLI needs at runtime.
Actual behaviour
tarball: 1.77 MB packed, 7.40 MB unpacked, 2,380 files
.js: 588 files 3.55 MB | .js.map: 578 files 2.59 MB
.d.ts: 588 files 0.75 MB | .d.ts.map: 578 files 0.42 MB
That is 1,166 declaration files, about half of all files in the package. A test build with tsc --declaration false --declarationMap false compiled without errors in 8 s and produced 0 declaration files.
Environment
- OS: Windows 11 (10.0.26300)
- Node: 22.22.3
- Nanocoder: 1.31.0 (main at be428fc7)
Suggested fix
tsconfig.json:15-16: setdeclarationanddeclarationMaptofalse.package.jsonbuild script: dropplugins/voice/dist/*.d.tsfrom thecpstep, since nothing reads it at runtime (type checks usesource/types/nanocoder-voice.d.ts).- Check that
pnpm run test:types,test:types:voice,test:types:vscodeandknipstill pass. Whether to keep the 578.js.mapfiles (2.6 MB) is a separate decision.
seems a intersting one assign this to me @addyCooks
Hii @addyCooks , I'd like to work on this issue. Could you please assign it to me?
Hey @Vishesh-Verma-07! I see you've already got a few issues assigned to you. Let's focus on getting PRs up for those first before taking on new ones.
@DarshanCodes09 Assigning this to you. This is a good first issue - should be straightforward config changes in tsconfig.json and package.json.
Make sure to verify the tests still pass after your changes!
Thanks for assigning me issue #1828, @addyCooks !!! Could you please review PR #1841?