feat(migrate): move task cache settings under cache - #2814
Merged
wan9chi merged 4 commits intoSep 25, 2026
Merged
Conversation
wan9chi
added this pull request to stack #2815
September 25, 2026 04:29
Contributor
|
✅ Staging deployment successful! Preview: https://viteplus-staging.void.app/ |
Contributor
CLI artifact sizes (
|
| Artifact | Format | Base | PR | Change |
|---|---|---|---|---|
packages/cli/dist |
Directory total | 2.34 MiB | 2.35 MiB | +2.34 KiB (+0.10%) |
packages/core/dist |
Directory total | 3.95 MiB | 3.95 MiB | 0 B (0.00%) |
| Combined package dist | Directory total | 6.30 MiB | 6.30 MiB | +2.34 KiB (+0.04%) |
vp (Linux x64) |
Binary | 11.29 MiB | 11.29 MiB | 0 B (0.00%) |
vp (Linux x64) |
gzip -9 | 4.88 MiB | 4.88 MiB | 0 B (0.00%) |
| NAPI (Linux x64) | Binary | 32.19 MiB | 32.23 MiB | +36.00 KiB (+0.11%) |
| NAPI (Linux x64) | gzip -9 | 12.76 MiB | 12.77 MiB | +10.76 KiB (+0.08%) |
vp (macOS ARM64) |
Binary | 8.41 MiB | 8.41 MiB | 0 B (0.00%) |
vp (macOS ARM64) |
gzip -9 | 4.26 MiB | 4.26 MiB | 0 B (0.00%) |
| NAPI (macOS ARM64) | Binary | 39.80 MiB | 39.83 MiB | +32.30 KiB (+0.08%) |
| NAPI (macOS ARM64) | gzip -9 | 17.07 MiB | 17.08 MiB | +9.18 KiB (+0.05%) |
vp (Windows x64) |
Binary | 9.15 MiB | 9.15 MiB | 0 B (0.00%) |
vp (Windows x64) |
gzip -9 | 4.00 MiB | 4.00 MiB | +3 B (+0.00%) |
| NAPI (Windows x64) | Binary | 27.15 MiB | 27.17 MiB | +28.50 KiB (+0.10%) |
| NAPI (Windows x64) | gzip -9 | 10.87 MiB | 10.88 MiB | +12.48 KiB (+0.11%) |
| Trampoline (Windows x64) | Binary | 13.50 KiB | 13.50 KiB | 0 B (0.00%) |
| Trampoline (Windows x64) | gzip -9 | 7.09 KiB | 7.08 KiB | -2 B (-0.03%) |
| Installer (Windows x64) | Binary | 4.56 MiB | 4.56 MiB | 0 B (0.00%) |
| Installer (Windows x64) | gzip -9 | 2.13 MiB | 2.13 MiB | -2 B (-0.00%) |
wan9chi
force-pushed
the
feat/migrate-task-cache-fields
branch
from
September 25, 2026 05:42
60bf751 to
e54e1ec
Compare
wan9chi
marked this pull request as draft
September 25, 2026 05:57
fengmk2
approved these changes
Sep 25, 2026
- Keep moved settings as written instead of reindenting them; the post-migration formatter nests them inside `cache`. - Leave tasks with a comment before a moved setting's comma, or after the last setting in `cache`, for manual review instead of misplacing it. - Move a trailing `//` comment even when the setting has no comma. - Treat escaped keys as unknown so they cannot hide a conflict. - Recognize configs wrapped in `as` type assertions. - Report manual-review warnings on up-to-date projects without running the rest of the migration.
wan9chi
marked this pull request as ready for review
September 25, 2026 09:24
wan9chi
added a commit
that referenced
this pull request
Sep 25, 2026
Bumps vite-task from `790b152` to `7d69d65`. Changelog: voidzero-dev/vite-task@790b152...7d69d65#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4ed ## Changes from vite-task - **Changed** A task's cache settings now go inside `cache`, e.g. `cache: { env: ["NODE_ENV"], input: ["src/**"] }`. `cache: true` is the same as `cache: {}`. Top-level `env`, `untrackedEnv`, `input`, and `output` are rejected with an error that points to `vp migrate` ([voidzero-dev/vite-task#749](voidzero-dev/vite-task#749)). - **Fixed** On Windows, environment variable names used by `vp run` match regardless of ASCII letter case ([voidzero-dev/vite-task#747](voidzero-dev/vite-task#747)). - **Fixed** Cached tasks on macOS no longer intermittently fail with `oils I/O error (main): No such process` ([voidzero-dev/vite-task#703](voidzero-dev/vite-task#703)). ## Changes in this PR - `Session::init_with`, `ScriptCommand::envs`, and `SyntheticPlanRequest::envs` now key environment variables by `vt_casefold::EnvName`. The `vite-plus-cli` env maps use the same key type (`EnvMap`), so PATH lookup and env merging follow the platform rules. The hand-written case-insensitive PATH lookups are replaced by `vt::get_path_env`. - Adds `vt_casefold` as a workspace dependency, including the commented local `[patch]` entry. - Regenerates `packages/cli/src/run-config.ts`. - Moves top-level task cache fields under `cache` in CLI snapshot fixtures and a `vp_static_config` test. - Keeps `docs/vite.config.ts` in the old format. Docs deploys build it with the released `vp` from `setup-vp`, and that version rejects a `cache` object. #2814 pins that `vp` version for docs builds, so the first release with this vite-task doesn't break them. - Documents the `cache` object in `docs/config/run.md`. `env`, `untrackedEnv`, `input`, and `output` become `cache.env`, `cache.untrackedEnv`, `cache.input`, and `cache.output`. Updates the examples and links in the cache, run, and automatic data tracking guides and the READMEs. The docs describe only the `cache` object and don't mention the old top-level fields. `vp migrate` support for moving these fields comes in the next PR in this stack.
This was referenced Sep 25, 2026
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.
Stacked on #2813, which bumps vite-task to a version that rejects
env,untrackedEnv,input, andoutputat the top level of a task. Its error message tells users to runvp migrate; this PR makes that work.What
vp migratedoesIt moves those four settings into the task's
cacheobject in staticrun.tasksobjects invite.config.*, including configs wrapped insatisfiesoras. This runs on fresh migrations and on existing Vite+ projects without--full, for the workspace root and every workspace package.build: { command, env: [...] }build: { command, cache: { env: [...] } }build: { command, cache: true, input: [...] }build: { command, cache: { input: [...] } }build: { cache: { env: [...] }, output: [...] }build: { cache: { env: [...], output: [...] } }cacheobject takes the position of the first moved setting, or of an existingcache: true.cache. Like the pack config migration, the edit doesn't try to format the file itself.//comments after it on the same line, move with it./config/run#cachefor:cache;cache;cache: false, a shorthandcache, or any other non-literalcachevalue.vp migrateprints them and then "This project is already using Vite+!".The migration summary gets a
Task cache settings moved under `cache`line and counts the change as a config update.Implementation
crates/vp_migration/src/task_cache.rs: the AST rewrite and its unit tests. It returns the updated content and the tasks that need manual changes.packages/cli/binding/src/migration.rs: exposes it asmigrateTaskCacheConfig.packages/cli/src/migration:migrateTaskCacheConfigInViteConfigruns next to thelazyPluginswrapping in the standalone, monorepo, andrewriteMonorepoProjectpaths. On existing Vite+ projects it runs infinalizeCoreMigrationForExistingVitePlus, which reportstaskCacheConfigand returns the warnings intaskCacheWarnings.bin.tsadds them to the report only after the up-to-date check.migration_task_cache_fieldssnapshot fixture. It covers a migration followed by a second, unchanged run, and the manual-review warnings, including a rerun on the up-to-date project.docs/guide/migrate-rules.md.Docs builds
The docs site is built with the released
vpfromsetup-vp, not with this repo's build.docs/vite.config.tskeeps the old task format that1.0.0-rc.0accepts, because no format works with both that release and the new vite-task. Until nowsetup-vpinstalled the latest release, so the first release with the new vite-task would have broken docs deploys and previews. This PR pinsversion: 1.0.0-rc.0in.github/actions/deploy-docs/action.ymland.github/workflows/build-docs-fork-preview.yml.Follow-up after the release becomes npm
latest: remove both pins and move thebuild:sitesettings undercachein one PR. That PR'sstaging-deploycheck builds the docs with the new release and the converted config.