fix(mcp): emit Node-resolvable ESM imports - #861
Merged
Conversation
|
I hit an error while handling your request (Model unavailable on AI Gateway free tier: Free tier users do not have access to this model. Upgrade to paid credits at https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai%3Fmodal%3Dtop-up for unrestricted…). Please try again, rephrase, or reach out if it keeps failing. Error id: 49c7bb74-20d3-4f19-b408-6b8c826f0909 |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 2b1e350. Configure here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

The published
@pascal-app/mcp@1.0.0exits under Node before transport setup because both MCP and its@pascal-app/corepeer emit extensionless relative ESM imports. For example, Node cannot resolvedist/bridge/node-shimsfrom the CLI entrypoint.This adds a shared post-build rewrite for emitted JavaScript in core and MCP, then gates the MCP workflow and both packages' publish hooks with real Node imports. It fixes the runtime half of #704; the cloud-to-local capture handoff remains tracked by #737.
Validation:
@pascal-app/corebuild + Node import smoke@pascal-app/mcpbuild + Node CLI/subpath import smokegit diff --checkNote
Medium Risk
Build-time rewriting of all published ESM output affects every consumer import path; mitigated by Node smoke tests in CI and publish hooks.
Overview
Fixes Node ESM resolution for published
@pascal-app/coreand@pascal-app/mcpby rewriting extensionless relative imports in emitteddist.jsand.d.tsaftertsc.Adds
scripts/fix-node-esm-imports.ts, wired into both packages’build(MCP also rewrites sibling../core/dist).smoke:nodechecks (nodeimport of core entry;pascal-mcp --helpfor MCP) run inprepublishOnlyand in mcp-ci after the MCP build. CHANGELOG notes thatpascal-mcpand subpath exports no longer depend on Bun’s extensionless import behavior.Reviewed by Cursor Bugbot for commit 6fbcc6e. Bugbot is set up for automated code reviews on this repo. Configure here.