feat(migration): add declare module rewriting support#357
Merged
Conversation
This was referenced Dec 22, 2025
Member
Author
fengmk2
force-pushed
the
rewrite-declare-module-namespace
branch
from
December 22, 2025 07:40
0a2377e to
986f687
Compare
fengmk2
marked this pull request as ready for review
December 22, 2025 07:43
fengmk2
force-pushed
the
12-16-feat_migration_rewrite_vitest_imports
branch
from
December 22, 2025 15:02
fda9731 to
b24cfe6
Compare
fengmk2
force-pushed
the
rewrite-declare-module-namespace
branch
from
December 22, 2025 15:02
986f687 to
1a4348e
Compare
fengmk2
force-pushed
the
12-16-feat_migration_rewrite_vitest_imports
branch
from
December 23, 2025 02:28
b24cfe6 to
e9087f3
Compare
fengmk2
force-pushed
the
rewrite-declare-module-namespace
branch
from
December 23, 2025 02:28
1a4348e to
cc93454
Compare
fengmk2
force-pushed
the
12-16-feat_migration_rewrite_vitest_imports
branch
from
December 23, 2025 08:24
e9087f3 to
b68fc5e
Compare
fengmk2
force-pushed
the
rewrite-declare-module-namespace
branch
from
December 23, 2025 08:24
cc93454 to
4da046c
Compare
fengmk2
force-pushed
the
12-16-feat_migration_rewrite_vitest_imports
branch
from
December 23, 2025 08:31
b68fc5e to
51df143
Compare
fengmk2
force-pushed
the
rewrite-declare-module-namespace
branch
3 times, most recently
from
December 23, 2025 11:53
f96eab7 to
f02d318
Compare
fengmk2
force-pushed
the
12-16-feat_migration_rewrite_vitest_imports
branch
from
December 23, 2025 11:53
51df143 to
be27764
Compare
fengmk2
force-pushed
the
rewrite-declare-module-namespace
branch
from
December 24, 2025 03:30
f02d318 to
c2be0e2
Compare
fengmk2
force-pushed
the
12-16-feat_migration_rewrite_vitest_imports
branch
from
December 24, 2025 03:30
be27764 to
6b51526
Compare
fengmk2
force-pushed
the
rewrite-declare-module-namespace
branch
from
December 24, 2025 04:38
c2be0e2 to
9d34b0d
Compare
fengmk2
force-pushed
the
12-16-feat_migration_rewrite_vitest_imports
branch
from
December 24, 2025 04:38
6b51526 to
08ece1b
Compare
fengmk2
force-pushed
the
12-16-feat_migration_rewrite_vitest_imports
branch
from
December 24, 2025 05:25
08ece1b to
eb5aeab
Compare
fengmk2
force-pushed
the
rewrite-declare-module-namespace
branch
from
December 24, 2025 05:25
9d34b0d to
ea8c676
Compare
fengmk2
force-pushed
the
12-16-feat_migration_rewrite_vitest_imports
branch
from
December 24, 2025 05:41
eb5aeab to
4653d5e
Compare
fengmk2
force-pushed
the
rewrite-declare-module-namespace
branch
from
December 24, 2025 05:42
ea8c676 to
a4b708d
Compare
fengmk2
force-pushed
the
12-16-feat_migration_rewrite_vitest_imports
branch
from
December 24, 2025 06:10
4653d5e to
a5ed6db
Compare
fengmk2
force-pushed
the
rewrite-declare-module-namespace
branch
from
December 24, 2025 06:10
a4b708d to
aac6031
Compare
fengmk2
force-pushed
the
12-16-feat_migration_rewrite_vitest_imports
branch
2 times, most recently
from
December 24, 2025 07:02
e7cebaf to
7ea4cc7
Compare
fengmk2
force-pushed
the
rewrite-declare-module-namespace
branch
from
December 24, 2025 07:02
aac6031 to
e3a2603
Compare
Member
|
cursor review |
fengmk2
changed the base branch from
12-16-feat_migration_rewrite_vitest_imports
to
graphite-base/357
December 24, 2025 07:22
Brooooooklyn
approved these changes
Dec 24, 2025
Add support for rewriting TypeScript `declare module` statements from vite/vitest to @voidzero-dev/vite-plus. This mirrors the existing import rewriting functionality but targets module declarations. Changes: - Add 6 new ast-grep rules for declare module statements - Update documentation to include declare module examples - Add 19 comprehensive tests covering all patterns - Support all variants: base modules, subpaths, and scoped packages The implementation uses ast-grep with `kind: module` to match declare module statements and rewrites module names using the same transformation logic as import statements. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
fengmk2
force-pushed
the
graphite-base/357
branch
from
December 24, 2025 07:23
7ea4cc7 to
b8bd487
Compare
fengmk2
force-pushed
the
rewrite-declare-module-namespace
branch
from
December 24, 2025 07:23
e3a2603 to
93ec15b
Compare
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.

Add support for rewriting TypeScript
declare modulestatements fromvite/vitest to @voidzero-dev/vite-plus. This mirrors the existing
import rewriting functionality but targets module declarations.
Changes:
The implementation uses ast-grep with
kind: moduleto matchdeclare module statements and rewrites module names using the same
transformation logic as import statements.
🤖 Generated with Claude Code
Co-Authored-By: Claude Opus 4.5 [email protected]
Note
Adds declare-module rewriting alongside existing import rewrites.
declare moduleforvite,vite/*,vitest,vitest/config,vitest/*, and@vitest/*variants; matches withkind: moduleand rewrites to the corresponding@voidzero-dev/vite-plustargetsimport_rewriter.rsrule set and docs to include declare-module cases; core rewrite pipeline unchangedmigration-from-vitest-config,migration-from-vitest-files, andmigration-rewrite-declare-modulewith updated expected outputs (rewritten module declarations and imports)Written by Cursor Bugbot for commit e3a2603. This will update automatically on new commits. Configure here.