Loading...
Loading...
Compare original and translation side by side
bash scripts/build-manifest.sh @old/pkg/name
bash scripts/replace-imports.sh @old/pkg/name @new/pkg/name /tmp/migration-manifest.txtbash scripts/build-manifest.sh @old/pkg/name
bash scripts/replace-imports.sh @old/pkg/name @new/pkg/name /tmp/migration-manifest.txtgit log --oneline -20
grep -r "<new-import-path>" apps/ packages/ --include="*.ts" --include="*.svelte" -l | head -10git log --oneline -20
grep -r "<new-import-path>" apps/ packages/ --include="*.ts" --include="*.svelte" -l | head -10undefinedundefined
Group files by workspace for parallel execution planning:
- `apps/api/` — backend
- `apps/frontend/` — frontend + SvelteKit
- `packages/` — shared libraries
Print summary:
Ask the user to confirm before proceeding if total > 20 files or if the change touches `packages/server` or `packages/types` (shared across workspaces).
按工作区分组文件以规划并行执行:
- `apps/api/` — 后端
- `apps/frontend/` — 前端 + SvelteKit
- `packages/` — 共享库
打印摘要:
如果文件总数超过20个,或者更改涉及`packages/server`或`packages/types`(跨工作区共享),请在继续前征得用户确认。sed -iundefinedsed -iundefined
Note: macOS `sed` requires `sed -i ''` (empty string for in-place edit without backup).
注意:macOS的`sed`需要使用`sed -i ''`(空字符串表示无备份的原地编辑)。undefinedundefined
Fix any type errors introduced by the migration. Common causes:
- Import path changed but the exported symbol name also differs → check the actual export
- Package hasn't been built yet → `pnpm --filter @portal/server build`
- Circular dependency introduced → check with `pnpm run check:circular`
修复迁移引入的任何类型错误。常见原因:
- 导入路径已更改但导出符号名称也不同 → 检查实际导出
- 包尚未构建 → `pnpm --filter @portal/server build`
- 引入了循环依赖 → 使用`pnpm run check:circular`检查grep -r "<old-import-path>" apps/ packages/ --include="*.ts" --include="*.svelte" -lgrep -r "<old-import-path>" apps/ packages/ --include="*.ts" --include="*.svelte" -lnpx vitest run apps/api --reporter=dot
npx vitest run apps/frontend --reporter=dotnpx vitest run apps/api --reporter=dot
npx vitest run apps/frontend --reporter=dotrefactor(imports): migrate @portal/shared/server/auth → @portal/server/auth
Affects 23 files across apps/api, apps/frontend, packages/server.
All typechecks pass. Full test suite green.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>refactor(imports): migrate @portal/shared/server/auth → @portal/server/auth
Affects 23 files across apps/api, apps/frontend, packages/server.
All typechecks pass. Full test suite green.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>| Pattern | From (old) | To (new) |
|---|---|---|
| Package rename | | |
| Path restructure | | |
| Index consolidation | | |
| Framework alias | | |
| 模式 | 源(旧) | 目标(新) |
|---|---|---|
| 包重命名 | | |
| 路径重构 | | |
| 索引合并 | | |
| 框架别名 | | |
$ARGUMENTS"@old/pkg/utils → @new/pkg/utils""move packages/server/src/auth.ts to packages/server/src/auth/index.ts""rename @company/old-shared → @company/core"$ARGUMENTS"@old/pkg/utils → @new/pkg/utils""move packages/server/src/auth.ts to packages/server/src/auth/index.ts""rename @company/old-shared → @company/core"grep | xargs sedgrep | xargs sed