Skip to content

fix: point package main to dist entry#4

Open
xianzuyang9-blip wants to merge 1 commit into
Tencent:mainfrom
xianzuyang9-blip:codex/fix-package-main-dist
Open

fix: point package main to dist entry#4
xianzuyang9-blip wants to merge 1 commit into
Tencent:mainfrom
xianzuyang9-blip:codex/fix-package-main-dist

Conversation

@xianzuyang9-blip

Copy link
Copy Markdown

Fixes #3.

The npm package only publishes dist via the files allowlist and the CLI bin already points at dist/index.js, but main still points at a missing root index.js. Clean consumers that import the package root therefore resolve a file that is not included in the tarball.

This updates main to dist/index.js so package-root imports resolve to the bundled entrypoint that is actually published.

Verification:

  • Reproduced before the change: packed package installed into a clean consumer, then import('cls-mcp-server') failed with ERR_MODULE_NOT_FOUND for node_modules/cls-mcp-server/index.js.
  • Verified after the change: packed package metadata has main: dist/index.js, dist/index.js exists in the installed package, and import('cls-mcp-server') resolves successfully.
  • Ran npm test: 5 files / 89 tests passed.

Note: this Windows environment uses Node 24, while the package declares node >=18 <=22, so npm prints an engine warning. The existing npm run build script also invokes Unix chmod; webpack still emitted dist/index.js, but I kept this PR scoped to the package entrypoint bug.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

package main points to missing index.js

1 participant