feat(chord): split the worker base at dynamic imports; workers/child entry

buildWorkerBase bundles with esbuild code splitting into one private directory: the entry
and its static chunks load at each fork, a lazily imported module and the packages it
imports only when imported. @earendil-works/chord/workers/child exports the worker's side
(workerMain, processLock) without esbuild.
This commit is contained in:
Mario Zechner 2026-11-05 01:27:21 +01:00
parent da95cd79c6
commit 7ac1a9e3a0
16 changed files with 203 additions and 65 deletions

View file

@ -17,6 +17,7 @@
"@earendil-works/chord/telemetry-sqlite": ["./packages/chord/src/telemetry-sqlite/index.ts"],
"@earendil-works/chord/http": ["./packages/chord/src/node/http/index.ts"],
"@earendil-works/chord/workers": ["./packages/chord/src/node/workers/index.ts"],
"@earendil-works/chord/workers/child": ["./packages/chord/src/node/workers/child.ts"],
"@earendil-works/chord/plugins": ["./packages/chord/src/node/plugins/index.ts"],
"@earendil-works/chord/plugins/runtime": ["./packages/chord/src/node/plugins/runtime.ts"],
"@earendil-works/chord/app": ["./packages/chord/src/node/app/index.ts"],