Repository navigation
feat(migrate): add post-bootstrap compile phase (tsc + optional vite build) - #112
Merged
Merged
Conversation
…build) Adds a new Phase 8 to the migration pipeline that actually compiles the migrated site after bootstrap completes. This is the gate that catches regressions which slip past the static `phase-verify` checks — the same class of bugs we hit in #105 (TS5097, rewriter leaving `.ts` in import paths) and the dead `src/lib/*` shims that broke `phase-cleanup`. ## Behavior - Default: runs `npx tsc --noEmit`. Failures are warnings — migration completes, but the user sees the truncated diagnostic output. - `--strict`: failures abort the migration with exit code 2 so CI can fail the pipeline. - `--with-build`: also runs `npx vite build` after typecheck. Slower (~30-90s) but catches runtime-only issues. - `--no-compile`: skips the phase entirely. - Auto-skipped when `node_modules/` is missing (bootstrap likely failed). ## Implementation - `scripts/migrate/phase-compile.ts` — exports `compile(ctx, opts)`. Returns `{ shouldFail }` so the caller decides exit codes; we don't `process.exit` ourselves which keeps it unit-testable. The command runner is injectable via `opts.runner` for tests. - `scripts/migrate.ts` — wires three new flags (`--strict`, `--with-build`, `--no-compile`) through to the phase. Updated `--help` output. - `scripts/migrate/phase-compile.test.ts` — 11 tests covering dry-run, missing node_modules, success path, failure paths, strict promotion, build flag gating, and the truncate helper. - `.agents/skills/deco-migrate-script/SKILL.md` — documents the new phase, flags, and CI usage pattern (`--strict --with-build`). ## Validation - `npx vitest run` → 132 tests pass (was 121, +11 new) - `npm run typecheck` → clean Co-authored-by: Cursor <[email protected]>
|
🎉 This PR is included in version 2.8.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
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.
Summary
Adds Phase 8 — Compile to the migration pipeline. After bootstrap finishes installing deps and running codegen, the script actually invokes the TypeScript compiler (and optionally a full Vite build) to catch regressions that slip past the static `phase-verify` checks.
This is the gate that would have caught past migration regressions:
Behavior
Auto-skipped when `node_modules/` is missing (bootstrap install likely failed) — printed as a warning so the user knows why.
Design notes
Files
Test plan
Recommended CI pattern
```bash
npx tsx node_modules/@decocms/start/scripts/migrate.ts --source ./site --strict --with-build
```
Pair with the existing `run-migration` skill for end-to-end test runs.
Made with Cursor
Summary by cubic
Adds Phase 8 — Compile to the migration pipeline. Runs
tsc --noEmitand optionalvite buildafter bootstrap to catch type and runtime regressions and provide a strict CI gate.New Features
vite buildfor runtime issues.--strict(fail with exit 2 on errors),--with-build(runvite build),--no-compile(skip phase). Auto-skips ifnode_modules/is missing..agents/skills/deco-migrate-script/SKILL.mdupdated; 11 tests added.Migration
npx tsx node_modules/@decocms/start/scripts/migrate.ts --source ./site --strict --with-build.Written for commit c09df31. Summary will update on new commits. Review in cubic