Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,279 changes: 731 additions & 548 deletions Cargo.lock

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ dunce = "1.0.5"
fast-glob = "1.0.0"
flate2 = { version = "=1.1.5", features = ["zlib-rs"] }
form_urlencoded = "1.2.1"
fspy = { git = "ssh://git@github.com/voidzero-dev/vite-task.git", rev = "846885e5d3cd97e6a517b353a1b54b9da7bb2554" }
fspy = { git = "ssh://git@github.com/voidzero-dev/vite-task.git", rev = "261c5676b2085a31d5edf4c5f76c281992ca96f3" }
futures = "0.3.31"
futures-util = "0.3.31"
glob = "0.3.2"
Expand Down Expand Up @@ -181,14 +181,14 @@ vfs = "0.12.1"
vite_command = { path = "crates/vite_command" }
vite_error = { path = "crates/vite_error" }
vite_js_runtime = { path = "crates/vite_js_runtime" }
vite_glob = { git = "ssh://git@github.com/voidzero-dev/vite-task.git", rev = "846885e5d3cd97e6a517b353a1b54b9da7bb2554" }
vite_glob = { git = "ssh://git@github.com/voidzero-dev/vite-task.git", rev = "261c5676b2085a31d5edf4c5f76c281992ca96f3" }
vite_install = { path = "crates/vite_install" }
vite_migration = { path = "crates/vite_migration" }
vite_shared = { path = "crates/vite_shared" }
vite_path = { git = "ssh://git@github.com/voidzero-dev/vite-task.git", rev = "846885e5d3cd97e6a517b353a1b54b9da7bb2554" }
vite_str = { git = "ssh://git@github.com/voidzero-dev/vite-task.git", rev = "846885e5d3cd97e6a517b353a1b54b9da7bb2554" }
vite_task = { git = "ssh://git@github.com/voidzero-dev/vite-task.git", rev = "846885e5d3cd97e6a517b353a1b54b9da7bb2554" }
vite_workspace = { git = "ssh://git@github.com/voidzero-dev/vite-task.git", rev = "846885e5d3cd97e6a517b353a1b54b9da7bb2554" }
vite_path = { git = "ssh://git@github.com/voidzero-dev/vite-task.git", rev = "261c5676b2085a31d5edf4c5f76c281992ca96f3" }
vite_str = { git = "ssh://git@github.com/voidzero-dev/vite-task.git", rev = "261c5676b2085a31d5edf4c5f76c281992ca96f3" }
vite_task = { git = "ssh://git@github.com/voidzero-dev/vite-task.git", rev = "261c5676b2085a31d5edf4c5f76c281992ca96f3" }
vite_workspace = { git = "ssh://git@github.com/voidzero-dev/vite-task.git", rev = "261c5676b2085a31d5edf4c5f76c281992ca96f3" }
walkdir = "2.5.0"
wax = "0.6.0"
which = "8.0.0"
Expand Down
31 changes: 2 additions & 29 deletions packages/cli/snap-tests/auto-install-before-task/snap.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,11 @@
Already up to date

Done in <variable>ms using pnpm v<semver>

$ echo hello ⊘ cache disabled: built-in command
$ echo hello ⊘ cache disabled
hello


━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Vite+ Task Runner • Execution Summary
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Statistics: 1 tasks • 0 cache hits • 0 cache misses • 1 cache disabled
Performance: 0% cache hit rate

Task Details:
────────────────────────────────────────────────
[1] auto-install-before-task#hello: $ echo hello ✓
→ Cache disabled for built-in command
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

> vp run hello # second run - no pnpm install output (cache hit, silent)
$ echo hello ⊘ cache disabled: built-in command
$ echo hello ⊘ cache disabled
hello


━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Vite+ Task Runner • Execution Summary
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Statistics: 1 tasks • 0 cache hits • 0 cache misses • 1 cache disabled
Performance: 0% cache hit rate

Task Details:
────────────────────────────────────────────────
[1] auto-install-before-task#hello: $ echo hello ✓
→ Cache disabled for built-in command
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
41 changes: 2 additions & 39 deletions packages/cli/snap-tests/build-vite-env/snap.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,6 @@ dist/assets/index-BnIqjoTZ.js <variable> kB │ gzip: <variable> kB
✓ built in <variable>ms


━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Vite+ Task Runner • Execution Summary
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Statistics: 1 tasks • 0 cache hits • 1 cache misses
Performance: 0% cache hit rate

Task Details:
────────────────────────────────────────────────
[1] build-vite-env-test#build: $ vp build ✓
→ Cache miss: no previous cache entry found
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

> VITE_MY_VAR=1 vp run build # should hit cache
$ vp build ✓ cache hit, replaying
vite+ v<semver> building client environment for production...
Expand All @@ -34,19 +21,8 @@ dist/assets/index-BnIqjoTZ.js <variable> kB │ gzip: <variable> kB

✓ built in <variable>ms


━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Vite+ Task Runner • Execution Summary
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Statistics: 1 tasks • 1 cache hits • 0 cache misses
Performance: 100% cache hit rate, <variable>ms saved in total

Task Details:
────────────────────────────────────────────────
[1] build-vite-env-test#build: $ vp build ✓
→ Cache hit - output replayed - <variable>ms saved
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
---
[vp run] cache hit, <variable>ms saved.

> VITE_MY_VAR=2 vp run build # env changed, should miss cache
$ vp build ✗ cache miss: envs changed, executing
Expand All @@ -59,16 +35,3 @@ dist/assets/index-BnIqjoTZ.js <variable> kB │ gzip: <variable> kB

✓ built in <variable>ms


━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Vite+ Task Runner • Execution Summary
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Statistics: 1 tasks • 0 cache hits • 1 cache misses
Performance: 0% cache hit rate

Task Details:
────────────────────────────────────────────────
[1] build-vite-env-test#build: $ vp build ✓
→ Cache miss: env VITE_MY_VAR value changed from '1' to '2'
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Expand Down
54 changes: 2 additions & 52 deletions packages/cli/snap-tests/cache-clean/snap.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,68 +2,18 @@
$ vp fmt


━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Vite+ Task Runner • Execution Summary
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Statistics: 1 tasks • 0 cache hits • 1 cache misses
Performance: 0% cache hit rate

Task Details:
────────────────────────────────────────────────
[1] hello: $ vp fmt ✓
→ Cache miss: no previous cache entry found
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

> vp run hello # hit the cache
$ vp fmt ✓ cache hit, replaying


━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Vite+ Task Runner • Execution Summary
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Statistics: 1 tasks • 1 cache hits • 0 cache misses
Performance: 100% cache hit rate, <variable>ms saved in total

Task Details:
────────────────────────────────────────────────
[1] hello: $ vp fmt ✓
→ Cache hit - output replayed - <variable>ms saved
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
---
[vp run] cache hit, <variable>ms saved.

> vp cache clean # clean the cache
> vp run hello # cache miss after clean
$ vp fmt


━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Vite+ Task Runner • Execution Summary
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Statistics: 1 tasks • 0 cache hits • 1 cache misses
Performance: 0% cache hit rate

Task Details:
────────────────────────────────────────────────
[1] hello: $ vp fmt ✓
→ Cache miss: no previous cache entry found
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

> cd subfolder && vp cache clean # cache can be located and cleaned from subfolder
> vp run hello # cache miss after clean
$ vp fmt


━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Vite+ Task Runner • Execution Summary
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Statistics: 1 tasks • 0 cache hits • 1 cache misses
Performance: 0% cache hit rate

Task Details:
────────────────────────────────────────────────
[1] hello: $ vp fmt ✓
→ Cache miss: no previous cache entry found
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
38 changes: 4 additions & 34 deletions packages/cli/snap-tests/cache-scripts-default/snap.txt
Original file line number Diff line number Diff line change
@@ -1,35 +1,5 @@
> vp run hello # cache should be disabled by default for package.json scripts
$ node hello.mjs ⊘ cache disabled: no cache config
hello from script
> vp run hello 2>&1 | grep 'cache disabled' # cache should be disabled by default for package.json scripts
$ node hello.mjs ⊘ cache disabled


━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Vite+ Task Runner • Execution Summary
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Statistics: 1 tasks • 0 cache hits • 0 cache misses • 1 cache disabled
Performance: 0% cache hit rate

Task Details:
────────────────────────────────────────────────
[1] cache-scripts-default-test#hello: $ node hello.mjs ✓
→ Cache disabled in task configuration
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

> vp run hello # second run should also show cache disabled
$ node hello.mjs ⊘ cache disabled: no cache config
hello from script


━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Vite+ Task Runner • Execution Summary
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Statistics: 1 tasks • 0 cache hits • 0 cache misses • 1 cache disabled
Performance: 0% cache hit rate

Task Details:
────────────────────────────────────────────────
[1] cache-scripts-default-test#hello: $ node hello.mjs ✓
→ Cache disabled in task configuration
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
> vp run hello 2>&1 | grep 'cache disabled' # second run should also show cache disabled
$ node hello.mjs ⊘ cache disabled
4 changes: 2 additions & 2 deletions packages/cli/snap-tests/cache-scripts-default/steps.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"VITE_DISABLE_AUTO_INSTALL": "1"
},
"commands": [
"vp run hello # cache should be disabled by default for package.json scripts",
"vp run hello # second run should also show cache disabled"
"vp run hello 2>&1 | grep 'cache disabled' # cache should be disabled by default for package.json scripts",
"vp run hello 2>&1 | grep 'cache disabled' # second run should also show cache disabled"
]
}
28 changes: 2 additions & 26 deletions packages/cli/snap-tests/cache-scripts-enabled/snap.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,9 @@ $ node hello.mjs
hello from script


━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Vite+ Task Runner • Execution Summary
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Statistics: 1 tasks • 0 cache hits • 1 cache misses
Performance: 0% cache hit rate

Task Details:
────────────────────────────────────────────────
[1] cache-scripts-enabled-test#hello: $ node hello.mjs ✓
→ Cache miss: no previous cache entry found
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

> vp run hello # second run should be cache hit
$ node hello.mjs ✓ cache hit, replaying
hello from script


━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Vite+ Task Runner • Execution Summary
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Statistics: 1 tasks • 1 cache hits • 0 cache misses
Performance: 100% cache hit rate, <variable>ms saved in total

Task Details:
────────────────────────────────────────────────
[1] cache-scripts-enabled-test#hello: $ node hello.mjs ✓
→ Cache hit - output replayed - <variable>ms saved
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
---
[vp run] cache hit, <variable>ms saved.
41 changes: 2 additions & 39 deletions packages/cli/snap-tests/change-passthrough-env-config/snap.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,52 +3,15 @@ $ node -p process.env.MY_ENV
1


━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Vite+ Task Runner • Execution Summary
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Statistics: 1 tasks • 0 cache hits • 1 cache misses
Performance: 0% cache hit rate

Task Details:
────────────────────────────────────────────────
[1] hello: $ node -p process.env.MY_ENV ✓
→ Cache miss: no previous cache entry found
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

> MY_ENV=2 vp run hello # MY_ENV is pass-through. should hit the cache created in step 1
$ node -p process.env.MY_ENV ✓ cache hit, replaying
1


━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Vite+ Task Runner • Execution Summary
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Statistics: 1 tasks • 1 cache hits • 0 cache misses
Performance: 100% cache hit rate, <variable>ms saved in total

Task Details:
────────────────────────────────────────────────
[1] hello: $ node -p process.env.MY_ENV ✓
→ Cache hit - output replayed - <variable>ms saved
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
---
[vp run] cache hit, <variable>ms saved.

> # add a new pass through env via VITE_TASK_PASS_THROUGH_ENVS
> VITE_TASK_PASS_THROUGH_ENVS=MY_ENV,MY_ENV2 MY_ENV=2 vp run hello # cache should be invalidated because passThroughEnvs config changed
$ node -p process.env.MY_ENV ✗ cache miss: pass-through env config changed, executing
2


━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Vite+ Task Runner • Execution Summary
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Statistics: 1 tasks • 0 cache hits • 1 cache misses
Performance: 0% cache hit rate

Task Details:
────────────────────────────────────────────────
[1] hello: $ node -p process.env.MY_ENV ✓
→ Cache miss: pass-through env 'MY_ENV2' added
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Loading
Loading