Skip to content

fix(cli): recognize wrapped config objects during migration - #3372

Open
jong-kyung wants to merge 2 commits into
voidzero-dev:mainfrom
jong-kyung:fix/migration-config-wrappers
Open

jong-kyung wants to merge 2 commits into
voidzero-dev:mainfrom
jong-kyung:fix/migration-config-wrappers

Conversation

@jong-kyung

Copy link
Copy Markdown
Collaborator

Follow-up to #3325. Task cache migration and pack migration share a check for direct config objects. That check looked only at an object's immediate parent. As a result, a config wrapped in parentheses, as, satisfies, <T>, or ! was not recognized, and the same was true when the wrapper surrounded the defineConfig callback. Pack migration skipped these configs silently, and task cache migration reported them for manual migration.

// Pack options were left unchanged before this PR
export default defineConfig({ pack: { bundle: false } } as UserConfig);

The check now looks through these wrappers. It also uses the function boundaries from #3325, so a return inside a nested generator is no longer treated as the config. Other callers of the check, such as wrap_lazy_plugins, now handle wrapped configs too. This is why the migration_merge_wrapped_callback snapshot now uses lazyPlugins, which matches the unwrapped case.

The shared direct config check only looked at an object's immediate parent.
Pack migration therefore silently skipped configs such as
`defineConfig({ pack } as UserConfig)` or callbacks wrapped in parentheses or
type assertions, and task cache migration reported them for manual review.
Returns inside generators nested in a `defineConfig` callback were also
treated as the config.

Look through parentheses, `as`, `satisfies`, type assertions, and non-null
assertions around both the config object and the `defineConfig` callback, and
reuse the function boundary rules from the merge rules. Task cache and pack
config migration now share this check.
@jong-kyung jong-kyung self-assigned this Nov 6, 2026
@jong-kyung jong-kyung added test: e2e Auto run e2e tests test: create-e2e Run `vp create` e2e tests labels Nov 6, 2026
@jong-kyung

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-06T15:03:18.294093Z 1096a40 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: 12c52947d5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

@jong-kyung
jong-kyung marked this pull request as ready for review November 6, 2026 14:59
@jong-kyung
jong-kyung requested a review from fengmk2 November 6, 2026 15:15

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test: create-e2e Run `vp create` e2e tests test: e2e Auto run e2e tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant