Repository navigation
Description
Priority
P1 · impact H · effort S/M · risk M; validate published package before changing flags.
Evidence
- tsconfig.json:4 emits ESNext JavaScript.
- package.json:29 exports the same dist/index.js for import and require, with no type: module declaration and no CJS artifact.
- package.json:60 advertises Node >=20.0.0; .github/workflows/ci.yml:17 tests latest 20/22 rather than the minimum supported patch.
- src/index.ts:103 has one large public barrel; src/factory.ts:366 statically references all six constructors.
- src/model-catalog.ts:1262 eagerly builds seven ranked recommendation arrays.
- src/providers/base.ts:520 recreates capability maps through adapter getModelCapabilities on cost calculation.
- scripts/worker-import-smoke.mjs:6 verifies a browser bundle graph, not cold-start time, per-provider size or execution in workerd.
- tsconfig.json:9 enables maps, but package files exclude source; existing chore: sourcemaps in dist/ point to missing src/ — include src/ in npm publish or use inlineSources #94 already tracks that.
Correct interpretation
Zero runtime dependencies is real, and Worker-safe import cleanup in v1.20.0 is worth keeping. A root client that references every adapter cannot be assumed to tree-shake to a single provider. ESM code routed through require relies on newer Node ESM interoperability; it is not an explicit CJS distribution and does not substantiate support for every Node 20 patch.
No bundle-size or cold-start number is asserted: the local installed esbuild binary is Linux-only on this Windows host, so the measurement could not run. Current source compilation/typecheck passes. Do not treat a broken local dependency installation as a repository defect.
Proposed work
Emit dist/esm and dist/cjs with appropriate package boundaries/extensions and declaration resolution. Add provider subpath exports and a minimal core entry. Audit modules before adding sideEffects: false; preserve intentional singleton initialization where an entry requires it.
Keep legacy root exports working. Add a caller-supplied/provider-registration path so the portable core need not import every vendor. Cache immutable capabilities and catalog indexes; lazily compute recommendations. Prioritize measured bundle savings over clever algorithms.
Acceptance
- Packed tarball imports/requires using actual declared minimum Node versions.
- Node import, Node require, TypeScript bundler/NodeNext and workerd import tests.
- Per-provider and full-client bundles measured raw/minified/gzip, recorded in CI artifacts.
- Explicit reproducible budget limits based on the baseline; no invented KB targets.
- No Node built-ins, WASM or runtime dependency in the Workers core path.
- Resolve chore: sourcemaps in dist/ point to missing src/ — include src/ in npm publish or use inlineSources #94 without a duplicate sourcemap implementation issue.
- Before/after workerd startup/first request benchmarks; separate network latency from library CPU.
Semver: additive subpaths/build correctness in minor or patch as appropriate; changing the support floor or removing deep imports/root exports needs a major. No new runtime build dependency: use existing TypeScript/esbuild dev tooling.
Activity
stackbilt-admin commentedon Oct 13, 2026
Local implementation checkpoint — 2026-10-12
This work is uncommitted/unpushed on
main, based on8a9eda6c058d63f0ec08332f6a408aaf409232cf, and is not merged or released. Keep this issue open pending review/integration. The local handoff isdocs/maintenance/issue-sweep.md; it will travel with the code.The related #94 sourcemap slice is implemented locally: JavaScript maps embed TypeScript source, and the package smoke script checks map contents. Final manual pack/unpack verification checked 33
.js.mapfiles and all new public exports/client methods.The local Windows Rollup/esbuild installation was repaired with
--ignore-scripts --no-save --package-lock=false; manifest/lockfile are unchanged. Test suite, typecheck and Worker bundle smoke now run on this host, superseding the earlier local-binary limitation for the current working tree.Not implemented: explicit ESM/CJS distribution, provider/core subpaths/registration, minimum Node/NodeNext/workerd matrix, measured size budgets or cold-start benchmarks. Packed
requiresucceeded on Node 24.19.0, while the existing module-type warning persists. Do not infer support for every Node 20 patch from that result.Validation for the combined local sweep: 605 tests pass across 27 files, TypeScript typecheck passes, Worker-targeted bundle/import smoke passes. Packed entrypoint exports/client methods and all 33 JavaScript sourcemaps were checked on Windows with Node 24.19.0/npm 11.17.0. No live/billable providers or workerd execution; this does not prove minimum Node-version compatibility.