fix(plugins): load imported ESM packages with CommonJS wrappers - #540
Merged
Merged
Conversation
Include the current plugin runtime and SDK baseline before rerunning the imported-package wrapper integration tests. Preserve the published branch history so the candidate can be pushed without rewriting commits.
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.
An imported Pi package with
"type": "module"currently makes the generated CommonJSmain.jswrapper fail withmodule is not defined in ES module scope. Generatemain.cjsand point the manifest at it so the wrapper loads without changing the package's module semantics.Fixes #506.
Regression coverage loads ESM, CommonJS and untyped packages through the real plugin-host child process, checks the skill/extension catalog and preserved package files, and verifies that re-importing creates a working new copy without rewriting an older import. Existing broken copies are not migrated automatically; remove the failed import and import its source again. The paired English/Chinese specs document this boundary.
Validation on macOS arm64 / Node 25.5.0, in a dedicated worktree:
4964d0245956f1f5098d95f78980dc01820d8ee3, based oncdc63d06b53eeaa5683ae3f7be804e86181eeda3.pnpm build:jspassed after merging current main into the published branch without rewriting history.pnpm docs:checkpassed again on the latest candidate (460 pages).Windows, the native picker, external npm installation and arbitrary third-party extension/model execution were not tested.