MoonshotAI / MoonshotAI/kimi-code
apps/vscode: VSIX packaging fails on main — bare "immer" import remains in extension.js
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 7.5k
- Forks
- 1.2k
- Avg merge
- 11h 53m
- Merged PRs (30d)
- 350
Description
Problem
pnpm -C apps/vscode run build && pnpm -C apps/vscode run package:platform fails on current main (checked at d1a46db9):
VSIX packaging failed: Bare runtime dependency "immer" remains in extension/dist/extension.js.
The built dist/extension.js keeps a top-level import { ... } from "immer", which scripts/vsix-verify.mjs rejects.
Cause
- #2909 added
immerimports topackages/agent-core-v2(e.g.src/state/state.ts,src/agent/contextMemory/loopEventFold.ts);agent-core-v2declaresimmeras a dependency. - #2916 switched the extension to the v2 engine, so
agent-core-v2is now bundled intoextension.js. apps/vscode/tsdown.config.tsexternalizespackage.jsondependencies by default and only force-bundles@moonshot-ai/*andzod, soimmerstays a bare import in the extension bundle.
Suggested fix
Add immer to alwaysBundle in apps/vscode/tsdown.config.ts:
alwaysBundle: [/^@moonshot-ai\//, "zod", "immer"],
With that one-line change, build + package:platform succeed locally (all platform targets verified).
Worth checking whether CI exercises package:platform on main — the 0.7.2 release presumably packaged from a state before this combination, so a release cut from current main may hit this.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in apps/vscode/tsdown.config.ts and inspect how alwaysBundle handles package dependencies; then run pnpm -C apps/vscode run build && pnpm -C apps/vscode run package:platform. Confirm that scripts/vsix-verify.mjs accepts every platform package and that extension/dist/extension.js no longer contains a bare immer import.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, vscode
- Domain
- build-system, devtools
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 92/100