feat(migrate): add @choojs/migrate — the choo-migrate v7→v8 codemod

Regex-based on purpose: converts simple top-level CJS patterns to ESM,
remaps package specifiers to their @choojs homes, points retired nano*
packages at built-in replacements (choo-lazy-route → lazy()), and reports
everything it refuses to guess at instead of guessing. Validated against
choo's own v7 example app: migrated output runs on v8 unmodified.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014NgfSjHE11oFpoSnLVKLXd
This commit is contained in:
Bendik Aagaard Lynghaug
2026-09-08 18:57:51 +02:00
co-authored by Claude Fable 5
parent fd1d05cea0
commit c101ee464a
4 changed files with 268 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
{
"name": "@choojs/migrate",
"version": "8.0.0-dev",
"description": "Codemod: migrate choo v7 apps to @choojs v8 (ESM, new package names)",
"type": "module",
"bin": {
"choo-migrate": "./cli.js"
},
"exports": {
".": "./lib/transform.js"
},
"files": [
"cli.js",
"lib"
],
"engines": {
"node": ">=24"
},
"repository": "choojs/choo",
"keywords": [
"choo",
"codemod",
"migration"
],
"license": "MIT"
}