Skip to content

build: ship explicit ESM/CJS artifacts, provider subpaths, and bundle budgets #115

Open

Description

@stackbilt-admin

Priority

P1 · impact H · effort S/M · risk M; validate published package before changing flags.

Evidence

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

  1. added
    enhancement
    on Oct 11, 2026
  2. stackbilt-admin commented on Oct 13, 2026

    @stackbilt-admin
    MemberAuthor

    Local implementation checkpoint — 2026-10-12

    This work is uncommitted/unpushed on main, based on 8a9eda6c058d63f0ec08332f6a408aaf409232cf, and is not merged or released. Keep this issue open pending review/integration. The local handoff is docs/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.map files 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 require succeeded 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions