fix(core): rewrite rolldown types in vite types#392
Conversation
There was a problem hiding this comment.
Pull request overview
This PR enhances the type rewriting logic to handle single-quoted imports in addition to double-quoted imports for both vite and rolldown packages. The changes ensure that all import statement variations are correctly transformed during the build process.
- Adds support for single-quoted import statements in the type file rewriting logic
- Extends both vite and rolldown import replacements to handle single quotes
- Applies the rewriting logic to type files that were previously just copied
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 03251b9705
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
dba1eeb to
2c6e10a
Compare
VP-136 missing `Rollup.RollupError` type after vite+ migration
vite8 code: https://github.com/fengmk2/vite-plugin-vue/blob/vite-v8/playground/vitestSetup.ts#L302 vite+ code: https://github.com/fengmk2/vite-plugin-vue/blob/vite-plus-migration-e2e/playground/vitestSetup.ts#L302 VP-138 Cannot find module '@rolldown/pluginutils/filter'
https://github.com/fengmk2/laravel-vite-plugin/actions/runs/20736671158/job/59535190220?pr=2 The replacement code at https://github.com/voidzero-dev/vite-plus/blob/main/packages/core/build.ts#L227 should match the subdirectories. Similarly, we also need to take a look at the replacement of |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
a02e607 to
9c346ba
Compare
9c346ba to
1e1bfe1
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 5 changed files in this pull request and generated 9 comments.
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
1e1bfe1 to
f1dd24a
Compare
Merge activity
|

Note
Introduces an AST-driven rewriting flow for module specifiers to ensure correct import paths in emitted JS and type declaration files.
build-support/rewrite-module-specifiers.tsusing@ast-grep/napiwith pluggable rules (vite and rolldown) and support for TS/TSX/DTSbuild.tsnow appliesrewriteModuleSpecifierswhen copying:.d.tsandtypesfiles; replacesviteandrolldownimports to package-local paths.mjs/.js/.d.ts/.d.mts), including optionalRELEASE_BUILDbinding path tweakpkgJson.name/vite@ast-grep/napito devDependencies and updates lockfile.github/scripts/upgrade-deps.mjsWritten by Cursor Bugbot for commit f1dd24a. This will update automatically on new commits. Configure here.