Commit 7e71921
committed
build: bundle all non-native runtime deps into dist/cli.js
The previous build.mjs externalized 11 packages at bundle time, which
forced every downstream consumer to provide them at runtime via an
ancestor node_modules/. That worked for `npm i -g kanban` and monorepo
dev, but the Electron packaging context ships dist/ to a location with
no ancestor node_modules/, so the externals couldn't resolve there.
Drop the externals list to just `node-pty` (the only genuinely
non-bundlable package — it's a native addon with a compiled binding
and a spawn-helper binary on disk). esbuild inlines the other 10:
@sentry/node, proper-lockfile, tree-kill, ws, open, @trpc/client,
@trpc/server, @modelcontextprotocol/sdk, commander, zod.
Result: dist/cli.js is a single self-contained 16MB bundle with one
runtime-resolved external (node-pty). In the Electron packaging PR
downstream, node-pty gets rebuilt for Electron's ABI by
electron-builder's install-app-deps into
Resources/app.asar.unpacked/node_modules/, and cli.js resolves it via
standard ESM walk-up from its own location inside app.asar.unpacked/.
No dist/node_modules/ staging, no build-time `npm install`, no
duplicate node-pty, no version drift between what esbuild saw and
what the runtime resolves.
scripts/build.mjs drops from ~190 lines (including the staging code
the reviewer flagged as unusual) to ~60 lines of pure esbuild config.1 parent d8b1605 commit 7e71921
1 file changed
Lines changed: 6 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
17 | 9 | | |
18 | 10 | | |
19 | 11 | | |
| |||
0 commit comments