Skip to content

fix(cli): skip lazyPlugins only while resolving config metadata#1939

Merged
fengmk2 merged 2 commits into
mainfrom
fix-lazyplugins-blacklist
Jun 25, 2026
Merged

fix(cli): skip lazyPlugins only while resolving config metadata#1939
fengmk2 merged 2 commits into
mainfrom
fix-lazyplugins-blacklist

Conversation

@fengmk2

@fengmk2 fengmk2 commented Jun 24, 2026

Copy link
Copy Markdown
Member

Problem

lazyPlugins decided whether to run the user's plugin factory from VP_COMMAND. That signal is:

  • overloadedvp run's task-discovery config read and a verbatim build child both see run;
  • unnormalized — the vp format alias is format, not fmt;
  • inherited by spawned children.

So a Vite build spawned under vp run (a verbatim node build.mjs task) or vp exec built without the user's plugins, while vp format wrongly loaded them. (Both were raised in review.)

Fix

Decide from the resolution intent instead of the command name. The metadata resolvers (resolveViteConfig, migrate's rolldown-compat check, and the oxlint/oxfmt subprocess) mark that the config is being loaded only to read a config block, and lazyPlugins skips the factory only while that marker is set.

The default is to load, so dev/build/test/preview and any spawned build keep their plugins, regardless of which command launched them. The marker is scoped to the resolution, so it never leaks to task children, and it's immune to aliases and not-yet-known commands.

VP_COMMAND had no other reader, so it's removed.

Adds snap tests for the two fixed cases (verbatim vp run build loads plugins; vp format skips them) plus updated unit tests and docs.

@fengmk2 fengmk2 self-assigned this Jun 24, 2026
@netlify

netlify Bot commented Jun 24, 2026

Copy link
Copy Markdown

Deploy Preview for viteplus-preview ready!

Name Link
🔨 Latest commit 4fe8e85
🔍 Latest deploy log https://app.netlify.com/projects/viteplus-preview/deploys/6a3c8892422e810008dad80c
😎 Deploy Preview https://deploy-preview-1939--viteplus-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions

github-actions Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

✅ Staging deployment successful!

Preview: https://viteplus-staging.void.app/
Commit: 4fe8e85

@fengmk2 fengmk2 added test: e2e Auto run e2e tests test: install-e2e run vite install e2e test test: create-e2e Run `vp create` e2e tests labels Jun 24, 2026
@fengmk2 fengmk2 force-pushed the fix-lazyplugins-blacklist branch from 1319bd1 to aca3722 Compare June 24, 2026 14:43
@fengmk2

This comment was marked as resolved.

@fengmk2 fengmk2 force-pushed the fix-lazyplugins-blacklist branch from aca3722 to a79255d Compare June 24, 2026 14:47
chatgpt-codex-connector[bot]

This comment was marked as resolved.

@fengmk2 fengmk2 force-pushed the fix-lazyplugins-blacklist branch from a79255d to e908163 Compare June 24, 2026 15:46
@fengmk2 fengmk2 changed the title fix(cli): lazyPlugins should skip a command blacklist, not a whitelist fix(cli): skip lazyPlugins only while resolving config metadata Jun 24, 2026
@fengmk2

This comment was marked as resolved.

@fengmk2 fengmk2 force-pushed the fix-lazyplugins-blacklist branch from e908163 to d794602 Compare June 24, 2026 15:50
chatgpt-codex-connector[bot]

This comment was marked as resolved.

@fengmk2 fengmk2 force-pushed the fix-lazyplugins-blacklist branch 2 times, most recently from a09b307 to 9b8126a Compare June 24, 2026 16:20
@fengmk2

This comment was marked as resolved.

@fengmk2

fengmk2 commented Jun 24, 2026

Copy link
Copy Markdown
Member Author

@codex review

lazyPlugins decided whether to run the user's plugin factory from
VP_COMMAND. That signal is overloaded (the `vp run` task-discovery read
and a verbatim build child both see `run`), unnormalized (the `vp format`
alias is `format`, not `fmt`), and inherited by spawned children. As a
result a Vite build spawned under `vp run` (a verbatim `node build.mjs`
task) or `vp exec` built without the user's plugins, while `vp format`
wrongly loaded them.

Decide from the resolution intent instead: the metadata resolvers
(resolveViteConfig, migrate's rolldown-compat check, and the oxlint/oxfmt
subprocess) mark that the config is being loaded only to read a config
block, and lazyPlugins skips the factory only while that marker is set.
The default is to load, so dev/build/test/preview and any spawned build
keep their plugins. VP_COMMAND had no other reader, so it is removed.
@fengmk2 fengmk2 force-pushed the fix-lazyplugins-blacklist branch from 9b8126a to ec0a6dd Compare June 25, 2026 00:28
@fengmk2

fengmk2 commented Jun 25, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: ec0a6ddf0f

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

@fengmk2 fengmk2 marked this pull request as ready for review June 25, 2026 01:08
@fengmk2 fengmk2 requested review from cpojer and sapphi-red June 25, 2026 01:09
@fengmk2 fengmk2 merged commit 181e81d into main Jun 25, 2026
93 checks passed
@fengmk2 fengmk2 deleted the fix-lazyplugins-blacklist branch June 25, 2026 02:17
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 test: install-e2e run vite install e2e test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants