Skip to content

fix(plugins): migrate generated imported main.js wrappers on load - #598

Merged
vastsa merged 1 commit into
mainfrom
fix/imported-wrapper-migrate
Sep 18, 2026
Merged

vastsa merged 1 commit into
mainfrom
fix/imported-wrapper-migrate

Conversation

@vastsa

@vastsa vastsa commented Sep 18, 2026

Copy link
Copy Markdown
Owner

Follow-up to #540 / #506.

New imports already generate main.cjs. Existing imported ESM packages still fail on load because their generated CommonJS main.js is treated as ESM. Loading an imported.* plugin now rewrites that generated no-op in place to main.cjs and updates the manifest.

Copied package.json files, grants, and activation scope are unchanged. A customized main.js is not rewritten. Re-import without removal still creates a separate plugin.

Test

node --test apps/desktop/test/imported-package-skills-runtime.test.mjs apps/desktop/test/agent-extensions.test.mjs — 25 passed.

Existing imported ESM packages still fail after the main.cjs generator
fix. Rewrite the generated no-op in place when the plugin loads, and
leave customized main.js and copied package files untouched.
Copilot AI lite review requested due to automatic review settings September 18, 2026 13:32

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@vastsa
vastsa merged commit c5fdba2 into main Sep 18, 2026
1 of 4 checks passed
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.

2 participants