Skip to content

feat: v2 migration files#1

Merged
thejackshelton merged 30 commits intomainfrom
feat/upgrade
Apr 4, 2026
Merged

feat: v2 migration files#1
thejackshelton merged 30 commits intomainfrom
feat/upgrade

Conversation

@thejackshelton
Copy link
Copy Markdown
Member

No description provided.

Two plans in Wave 1 (parallel): types + orchestrator (INFR-01, INFR-02),
binary-extensions pruning + import renames (INFR-03, RNME-01, RNME-02).
- Tests verify isBinaryPath returns true for images, fonts, archives, executables, audio, video
- Tests verify isBinaryPath returns false for source code extensions
- Tests verify BINARY_EXTENSIONS has 40-60 entries (sanity check)
- Tests verify no duplicate entries in set
- Currently fails: set has 197 entries (RED phase)
- Test 1: two non-overlapping transforms produce combined output
- Test 2: empty transforms array is a no-op
- Test 3: transform returning empty array does not modify file
- Test 4: replacements sorted descending by start before applying
- Test 5: overlapping replacements throw descriptive error
- Reduced from 197 entries down to 57 essential extensions
- Kept: images, fonts, archives, executables, audio, video, wasm, pdf, sqlite, db, plist
- Removed: documents, niche images, niche archives, niche executables, niche fonts
- Removed: niche audio/video, Java bytecode, Python compiled, 3D/game assets
- Removed: Flash, disk images, certificates, and other niche formats
- Added category comments for readability
- All 10 unit tests pass
- Tests verify QwikCityMockProvider renames to QwikRouterMockProvider (RNME-01)
- Tests verify QwikCityProps renames to QwikRouterProps (RNME-02)
- Tests verify combined renames work in single file
- Tests verify aliased imports preserve their alias
- Tests verify IMPORT_RENAME_ROUNDS Round 1 has exactly 5 entries
- Currently fails: Round 1 only has 3 entries (RED phase)
…ransforms orchestrator

- migrations/v2/types.ts: SourceReplacement interface and TransformFn type using ParseResult from oxc-parser
- migrations/v2/apply-transforms.ts: parse-once fan-out orchestrator with descending sort and collision detection
- Explicit overlap check throws descriptive error before magic-string collision occurs
- Added QwikCityMockProvider -> QwikRouterMockProvider rename (RNME-01)
- Added QwikCityProps -> QwikRouterProps rename (RNME-02)
- Both appended to existing Round 1 (library: @builder.io/qwik-city)
- Round 1 now has 5 entries total (3 existing + 2 new)
- All 7 unit tests pass including aliased import verification
… plan

- 13-02-SUMMARY.md: binary-extensions pruned to 57 entries; RNME-01/RNME-02 added to Round 1
- STATE.md: decisions recorded, session updated, progress recalculated
- ROADMAP.md: phase 13 marked complete (2/2 plans with summaries)
- REQUIREMENTS.md: INFR-03, RNME-01, RNME-02 marked complete
…ution, fixPackageType

- 11 behavior tests covering CONF-01, CONF-02, CONF-03
- Tests for rewrite, idempotency, missing file, JSONC comment preservation, trailing newline
…ckageType

- fixJsxImportSource: regex-based raw-string rewrite preserving JSONC comments
- fixModuleResolution: case-insensitive regex for Node/Node16 -> Bundler
- fixPackageType: JSON.parse/stringify adds type:module, trailing newline preserved
- All three idempotent and ENOENT-safe
- Import fixJsxImportSource, fixModuleResolution, fixPackageType from fix-config.ts
- Add Step 3b after Step 3 (package replacement) calling all three transforms
- Update JSDoc to document Step 3b in migration steps list
- 14-01-SUMMARY.md created
- STATE.md updated with decisions, metrics, session
- ROADMAP.md updated (phase 14 in progress)
- REQUIREMENTS.md: CONF-01, CONF-02, CONF-03 marked complete
…transform

- 7 test cases covering solo prop, multi-prop first/last, no-eagerness, single-arg, nested component$, multiple calls
- RED phase: all fail with module-not-found (implementation not yet created)
…agerness removal

- Recursive AST walker covers arbitrarily-nested calls (component$ depth 6+)
- Solo eagerness: removes entire first arg including trailing comma+space
- Multi-prop: reconstructs options object from remaining properties
- Guards skip single-arg form and options without eagerness prop
- 7/7 tests pass, tsc --noEmit clean
…V2Migration Step 2b

- Add imports: applyTransforms and removeEagernessTransform
- Insert Step 2b after import-rename loop, before Step 3
- Update JSDoc step listing to include 2b
- 71/71 tests pass, tsc --noEmit clean
- 14-02-SUMMARY.md with decisions, deviations, file list
- STATE.md: plan position advanced, 2 decisions recorded, metrics logged
- ROADMAP.md: phase 14 marked complete (2/2 plans)
- REQUIREMENTS.md: XFRM-02 marked complete
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 3, 2026

⚠️ No Changeset found

Latest commit: 0003a26

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

- 7 behaviors: known API rewrite, aliased import, unknown API TODO, mixed, no-op, multiple imports, call site renaming
- Create migrations/v2/transforms/walk.ts with shared walkNode export
- Update remove-eagerness.ts to import walkNode from shared utility
- Create migrateQwikLabsTransform: handles known API (usePreventNavigate->usePreventNavigate$), aliased imports, unknown APIs (TODO comment), mixed known+unknown, and call site renaming
- Fix test: remove JSX from call-site renaming test (oxc-parser requires jsx flag for JSX)
- All 7 migrate-qwik-labs tests + 7 remove-eagerness tests pass (14 total)
- SUMMARY.md: walkNode shared utility + migrateQwikLabsTransform for ECOS-01
- STATE.md: advanced to 31/32 plans (97%), decisions recorded
- ROADMAP.md: phase 15 progress updated (1/2 plans complete)
- REQUIREMENTS.md: ECOS-01 marked complete
…e$ transforms

- 7 tests for XFRM-01: async useComputed$ -> useAsync$ rewrite (callee, import, mixed, nested)
- 7 tests for XFRM-03: useResource$ -> useAsync$ rewrite (callee, import, TODO comment, multiple calls)
…s (XFRM-01, XFRM-03)

- migrateUseComputedAsyncTransform: rewrites async useComputed$ to useAsync$, leaves sync untouched, handles mixed usage with TODO comment
- migrateUseResourceTransform: rewrites useResource$ to useAsync$ with TODO comments about ResourceReturn -> AsyncSignal return type change
- Both transforms match @qwik.dev/core and @builder.io/qwik as import sources
- Both transforms work at any nesting depth via shared walkNode utility
- All 14 unit tests pass (7 per transform)
…p 2b

- Add imports for migrateQwikLabsTransform, migrateUseComputedAsyncTransform, migrateUseResourceTransform
- Update applyTransforms call in Step 2b to include all 4 transforms in logical order
- Full test suite: 92 tests pass, no regressions
- Add 15-02-SUMMARY.md: XFRM-01 + XFRM-03 complete, 14 tests pass, 4 transforms wired
- Update STATE.md: decisions, metrics, session
- Update ROADMAP.md: Phase 15 complete (2/2 plans)
- Mark REQUIREMENTS.md: XFRM-01, XFRM-03 complete
…ansform

- Add migrations/v2/transforms/migrate-qwik-city-provider.ts with:
  - makeQwikCityProviderTransform factory (Astro project detection via rootDir)
  - qwikCityProviderTransform internal TransformFn (exported for direct testing)
  - detectQwikRouterProject helper reads package.json once at factory call time
- Removes JSX opening/closing tags while preserving children via two SourceReplacements
- Injects const router = useQwikRouter() using first-char prepend trick
- Renames QwikCityProvider import specifier to useQwikRouter, or removes it if already present
- 7 unit tests covering all 4 XFRM-04 behaviors (standard rewrite, Astro skip, nested children, duplicate import removal)
…on.ts Step 2b

- Import makeQwikCityProviderTransform from migrate-qwik-city-provider.ts
- Instantiate factory with rootDir before the Step 2b applyTransforms loop
- Add qwikCityProviderTransform to the transforms array alongside existing transforms
- Full Vitest suite (99 tests, 14 files) passes with zero regressions
Remove QwikCityProvider→QwikRouterProvider from IMPORT_RENAME_ROUNDS
since Phase 16's structural transform handles QwikCityProvider entirely
(JSX removal + useQwikRouter injection + import mutation). The rename
entry was running in Step 2 before the transform in Step 2b, causing
the transform to never match (specifier already renamed).

Update transform to look for @builder.io/qwik-city import source
(the state at Step 2b time, before Step 3 package replacement).
…o-end

- Creates tests/unit/upgrade/pipeline-integration.spec.ts with 2 tests
- Test 1: combined fixture with all migratable patterns (XFRM-01/02/03/04,
  ECOS-01, CONF-01/02/03, RNME-01/02) verified to transform correctly
- Test 2: already-migrated fixture verifies idempotent no-op behavior
- Mocks resolveV2Versions and updateDependencies to avoid npm network calls
- Uses realpathSync to resolve macOS /var → /private/var symlink issue
- All 101 tests pass (15 test files total)
- Creates 17-01-SUMMARY.md with pipeline integration test results
- Updates STATE.md: progress 100%, decisions, session recorded
- Updates ROADMAP.md: Phase 17 marked Complete (1/1 plans done)
- Marks MTEST-01 and MTEST-02 requirements complete
These are local GSD workflow artifacts that should never have been
tracked. The .gitignore already excludes .planning/ — files were
force-added by earlier automation. They remain on disk locally.
@thejackshelton thejackshelton merged commit e59e92b into main Apr 4, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant