build(shared): declare type:module for Node/tsx runtimes (P0-B.2 prerequisite) #10
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/shared-type-module"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Adds
"type": "module"to@scrum4me/shared'spackage.json.Why (P0-B.2)
@sharedships ESM TypeScript source (module: ESNext,.js-extensioned relative imports) but itspackage.jsondeclared no module type. Bundler consumers — scrum4me-workers, scrum4me-web, and@shared's own vitest — were unaffected because they resolve TS through a bundler.scrum4me-mcp (P0-B.2) becomes the first direct Node consumer: it re-exports the product-doc closure from
@sharedand runs viatsx. Withouttype: "module", Node/tsx treats@shared's.tsfiles as CommonJS, and a named import from an ESM module fails at runtime:Declaring the package ESM (which it already is) fixes named-export resolution. Confirmed: with
type: "module", the full mcp product-doc closure loads at runtime via the production re-export chain (mcp/src/lib/* → @shared).Safety
npm run verifygreen: dep-purity gate +tsc --noEmit+ 101 vitest tests..jsextensions → Node-ESM compatible.@sharedsubmodule commit and are unaffected until they independently bump to include this commit.🤖 Generated with Claude Code