Skip to content

Commit e5405b6

Browse files
committed
Configure Vite Task caching
1 parent 8c1984b commit e5405b6

8 files changed

Lines changed: 90 additions & 10 deletions

File tree

.github/workflows/ci.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,26 @@ jobs:
2626
node-version-file: .node-version
2727
cache: true
2828

29-
- run: vp check
29+
- name: Restore Vite Task cache
30+
id: vite-task-cache
31+
uses: actions/cache/restore@v6
32+
with:
33+
path: node_modules/.vite/task-cache
34+
key: vite-task-${{ runner.os }}-${{ runner.arch }}-${{ github.run_id }}-${{ github.run_attempt }}
35+
restore-keys: |
36+
vite-task-${{ runner.os }}-${{ runner.arch }}-
37+
38+
- run: vp run -w check
3039
# Storybook stories run as browser tests (Vitest + Playwright), so CI needs
3140
# the Chromium binary + its system deps. `pnpm` isn't on PATH under
3241
# setup-vp, so run the package binary via `vp exec` (see viteplus.dev/guide/ci).
3342
- run: vp exec --filter @makeplane/propel playwright install --with-deps chromium
3443
- run: vp run -r test
3544
- run: vp run -r build
45+
46+
- name: Save Vite Task cache
47+
if: success()
48+
uses: actions/cache/save@v6
49+
with:
50+
path: node_modules/.vite/task-cache
51+
key: ${{ steps.vite-task-cache.outputs.cache-primary-key }}

.github/workflows/storybook.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,24 @@ jobs:
3131
node-version-file: .node-version
3232
cache: true
3333

34+
- name: Restore Vite Task cache
35+
id: vite-task-cache
36+
uses: actions/cache/restore@v6
37+
with:
38+
path: node_modules/.vite/task-cache
39+
key: vite-task-${{ runner.os }}-${{ runner.arch }}-${{ github.run_id }}-${{ github.run_attempt }}
40+
restore-keys: |
41+
vite-task-${{ runner.os }}-${{ runner.arch }}-
42+
3443
- run: vp run -r build-storybook
3544

45+
- name: Save Vite Task cache
46+
if: success()
47+
uses: actions/cache/save@v6
48+
with:
49+
path: node_modules/.vite/task-cache
50+
key: ${{ steps.vite-task-cache.outputs.cache-primary-key }}
51+
3652
# PR → a versioned upload aliased to the PR number, which yields a stable
3753
# preview URL (pr-<n>-propel-storybook.<subdomain>.workers.dev) without
3854
# touching production. push + manual dispatch → production deploy.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"private": true,
55
"type": "module",
66
"scripts": {
7-
"ready": "vp check && vp run -r test && vp run -r build",
7+
"ready": "vp run -w check && vp run -r test && vp run -r build",
88
"prepare": "vp config",
99
"changeset": "changeset",
1010
"version-packages": "changeset version",

packages/propel/package.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,9 @@
5555
"provenance": true
5656
},
5757
"scripts": {
58-
"build": "node ./scripts/pack-retry.mjs",
59-
"check": "vp check",
6058
"dev": "vp pack --watch",
6159
"prepublishOnly": "vp run build",
62-
"test": "vp test",
63-
"storybook": "storybook dev -p 6006",
64-
"build-storybook": "storybook build"
60+
"storybook": "storybook dev -p 6006"
6561
},
6662
"dependencies": {
6763
"@base-ui/react": "catalog:",

packages/propel/vite.config.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,30 @@ export default defineConfig({
7575
},
7676
],
7777
},
78+
run: {
79+
tasks: {
80+
build: {
81+
command: "node ./scripts/pack-retry.mjs",
82+
input: [{ auto: true }, "!dist/**", "!node_modules/.vite-temp/**", "!storybook-static/**"],
83+
output: ["dist/**"],
84+
},
85+
"build-storybook": {
86+
command: "storybook build",
87+
input: [{ auto: true }, "!dist/**", "!node_modules/.vite-temp/**", "!storybook-static/**"],
88+
output: ["storybook-static/**"],
89+
},
90+
check: {
91+
command: "vp check",
92+
input: [{ auto: true }, "!dist/**", "!node_modules/.vite-temp/**", "!storybook-static/**"],
93+
output: [],
94+
},
95+
test: {
96+
command: "vp test",
97+
input: [{ auto: true }, "!dist/**", "!node_modules/.vite-temp/**", "!storybook-static/**"],
98+
output: [],
99+
},
100+
},
101+
},
78102
// Keep vite's dev/test server out of nested agent worktrees (`.claude/worktrees/<name>`,
79103
// full second checkouts living inside the workspace root). See the root `vite.config.ts`.
80104
server: { watch: { ignored: ["**/.claude/**"] } },

tools/oxlint-plugin-propel/package.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,7 @@
2323
"./package.json": "./package.json"
2424
},
2525
"scripts": {
26-
"build": "vp pack",
2726
"dev": "vp pack --watch",
28-
"test": "vp test",
29-
"check": "vp check",
3027
"prepublishOnly": "vp run build"
3128
},
3229
"dependencies": {

tools/oxlint-plugin-propel/vite.config.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,23 @@ export default defineConfig({
1414
},
1515
},
1616
fmt: {},
17+
run: {
18+
tasks: {
19+
build: {
20+
command: "vp pack",
21+
input: [{ auto: true }, "!dist/**", "!node_modules/.vite-temp/**"],
22+
output: ["dist/**"],
23+
},
24+
check: {
25+
command: "vp check",
26+
input: [{ auto: true }, "!dist/**", "!node_modules/.vite-temp/**"],
27+
output: [],
28+
},
29+
test: {
30+
command: "vp test",
31+
input: [{ auto: true }, "!dist/**", "!node_modules/.vite-temp/**"],
32+
output: [],
33+
},
34+
},
35+
},
1736
});

vite.config.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,17 @@ export default defineConfig({
5555
},
5656
run: {
5757
cache: true,
58+
tasks: {
59+
check: {
60+
command: "vp check",
61+
input: [
62+
{ auto: true },
63+
"!**/dist/**",
64+
"!**/node_modules/.vite-temp/**",
65+
"!**/storybook-static/**",
66+
],
67+
output: [],
68+
},
69+
},
5870
},
5971
});

0 commit comments

Comments
 (0)