fix(migrate): finish leftover Oxc config migration - #2654
Conversation
Existing Vite+ projects skip standalone Oxc config merging when migration is retried. Reuse the config merger during core finalization for the root and workspace packages, and report completed merges as migration work. Add regression coverage for retry behavior, inline config precedence, merge warnings, and formatting with migrated options.
Merge upstream main while preserving both leftover-config finalization paths and their migration result flags. Update result assertions and cover simultaneous Oxfmt and tsdown config migration with an idempotent retry. Validation: 436 migration tests passed across 11 files. Targeted formatting and diff checks passed. Targeted type checking reports the same seven prompt cancellation diagnostics as upstream main in the same environment.
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Nice work! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Verify that migration removes a leftover Oxfmt config while preserving conflicting inline options and formatting behavior. Check that a second migration is a no-op. Both Oxc snapshot cases pass. The new case fails its config-removal assertion with the pre-fix migration entry.
|
@SaKaNa-Y I plan to revert this PR for now. Ecosystem tests found regressions in freecut, delta-comic, pdfme, and sigle:
|
Revert #2654. `vp migrate` again preserves standalone Oxc configs in projects that already use Vite+. The added merge step deletes configs that imports or package scripts still use. It also copies JSON `extends` paths into incompatible inline config. Ecosystem tests reproduced these failures in [freecut](vite-plus-ecosystem-ci/freecut#9), [delta-comic](vite-plus-ecosystem-ci/delta-comic#9), [pdfme](vite-plus-ecosystem-ci/pdfme#7), and [sigle](vite-plus-ecosystem-ci/sigle#8). This revert restores an earlier limitation: interrupted migrations can leave Oxc configs unmerged. #2695 tracks the follow-up fix.
When an interrupted migration has already added
vite-plus, runningvp migrateagain can leave.oxfmtrc.jsonbehind and report that the project already uses Vite+. Formatting then uses defaults instead of the unmerged options.The existing-project finalization path skips standalone Oxc configs. Run the existing config merger for the root and workspace packages, and count completed merges as migration work. This covers Oxlint and Oxfmt JSON/JSONC configs, preserves existing inline config precedence, and retains configs that cannot be merged with a warning. A subsequent migration remains a no-op.
The branch incorporates upstream main at
b1c41b2a, including the leftover tsdown config fix from #2646. Both finalization paths and result flags are preserved. A regression test covers simultaneous Oxfmt and tsdown config migration and an unchanged retry.Verification
After resolving the upstream merge:
git diff --check: passed.b1c41b2ain the same environment produced identical diagnostics.Before the merge, the PR's recorded validation included a passing
migration_existing_oxc_configsPTY snapshot. It covers config removal, formatting with migrated options, an unchanged second migration, and no opt-out setup artifacts.Existing inline fmt snapshot coverage
Added
migration_existing_oxc_configs_inline_fmtin response to review. It checks formatting before and after migration with inlinesingleQuote: falseoverriding the standalonesingleQuote: true, whilesemi: falseverifies that formatting actually applies the inline options. It also verifies standalone config removal, unchanged inline configuration, and a no-op retry.migration_existing_oxc_configscases then passed in comparison mode (2 passed)..oxfmtrc.jsonstill existed.git diff --checkpassed. This update changes only test metadata and its recorded snapshot.