From 3edb0c8815da706dad5c9a045af6e8c72b50dbc3 Mon Sep 17 00:00:00 2001 From: wan9chi Date: Wed, 1 Jul 2026 18:26:23 +0800 Subject: [PATCH 01/15] ci(docs): enable cached docs build task --- .github/workflows/deploy-docs-preview.yml | 3 +++ .github/workflows/deploy-docs.yml | 3 +++ docs/package.json | 3 ++- docs/vite.config.ts | 16 ++++++++++++++++ netlify.toml | 5 ++++- 5 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 docs/vite.config.ts diff --git a/.github/workflows/deploy-docs-preview.yml b/.github/workflows/deploy-docs-preview.yml index c5fd3fbaa2..895cf50c24 100644 --- a/.github/workflows/deploy-docs-preview.yml +++ b/.github/workflows/deploy-docs-preview.yml @@ -40,6 +40,9 @@ jobs: - run: vp run build working-directory: docs + - run: vp run build + working-directory: docs + - run: vpx void deploy --dir docs/.vitepress/dist env: VOID_TOKEN: ${{ secrets.VOID_TOKEN }} diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index 2d3d7f63d0..edacf95bca 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -40,6 +40,9 @@ jobs: - run: vp run build working-directory: docs + - run: vp run build + working-directory: docs + - run: vpx void deploy --dir docs/.vitepress/dist env: VOID_TOKEN: ${{ secrets.VOID_TOKEN }} diff --git a/docs/package.json b/docs/package.json index 0a04318a97..579714aa07 100644 --- a/docs/package.json +++ b/docs/package.json @@ -4,7 +4,8 @@ "type": "module", "scripts": { "dev": "vitepress dev", - "build": "cp ../packages/cli/install.sh ../packages/cli/install.ps1 public/ && vitepress build", + "build": "cp ../packages/cli/install.sh ../packages/cli/install.ps1 public/ && vp run build:site", + "build:netlify": "cp ../packages/cli/install.sh ../packages/cli/install.ps1 public/ && vitepress build", "preview": "vitepress preview", "update-trusted-stack-stats": "node .vitepress/theme/data/fetch-trusted-stack-stats.ts" }, diff --git a/docs/vite.config.ts b/docs/vite.config.ts new file mode 100644 index 0000000000..3c416b301b --- /dev/null +++ b/docs/vite.config.ts @@ -0,0 +1,16 @@ +export default { + run: { + tasks: { + 'build:site': { + command: 'vitepress build', + input: [ + { auto: true }, + '!.vitepress/.temp/**', + '!.vitepress/dist/**', + '!node_modules/.vite-temp/**', + ], + output: ['.vitepress/dist/**'], + }, + }, + }, +}; diff --git a/netlify.toml b/netlify.toml index 9b76ffa616..a18ddf78dc 100644 --- a/netlify.toml +++ b/netlify.toml @@ -1,8 +1,11 @@ [build] base = "docs/" -command = "pnpm build" +command = "pnpm build:netlify" publish = ".vitepress/dist" +[build.environment] +NODE_VERSION = "22.18.0" + # Windows installer redirect [[redirects]] from = "/vp-setup" From ea8ea9696bf4b8676a62d1a0364e8a96f1d69a82 Mon Sep 17 00:00:00 2001 From: wan9chi Date: Wed, 1 Jul 2026 20:53:00 +0800 Subject: [PATCH 02/15] build(netlify): remove Node version override --- netlify.toml | 3 --- 1 file changed, 3 deletions(-) diff --git a/netlify.toml b/netlify.toml index a18ddf78dc..988c5ab2dc 100644 --- a/netlify.toml +++ b/netlify.toml @@ -3,9 +3,6 @@ base = "docs/" command = "pnpm build:netlify" publish = ".vitepress/dist" -[build.environment] -NODE_VERSION = "22.18.0" - # Windows installer redirect [[redirects]] from = "/vp-setup" From d410ab0cd92b4bd78d0348339dac3259c2eaa143 Mon Sep 17 00:00:00 2001 From: wan9chi Date: Wed, 1 Jul 2026 21:47:14 +0800 Subject: [PATCH 03/15] build(docs): trim build cache inputs --- docs/vite.config.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/docs/vite.config.ts b/docs/vite.config.ts index 3c416b301b..f3e45a993b 100644 --- a/docs/vite.config.ts +++ b/docs/vite.config.ts @@ -3,12 +3,7 @@ export default { tasks: { 'build:site': { command: 'vitepress build', - input: [ - { auto: true }, - '!.vitepress/.temp/**', - '!.vitepress/dist/**', - '!node_modules/.vite-temp/**', - ], + input: [{ auto: true }, '!.vitepress/.temp/**', '!.vitepress/dist/**'], output: ['.vitepress/dist/**'], }, }, From 5fa8b84e61675c7ab07c1b840e0222084c18477f Mon Sep 17 00:00:00 2001 From: wan9chi Date: Wed, 1 Jul 2026 21:53:09 +0800 Subject: [PATCH 04/15] build(docs): restore Vite temp cache exclusion --- docs/vite.config.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/vite.config.ts b/docs/vite.config.ts index f3e45a993b..3c416b301b 100644 --- a/docs/vite.config.ts +++ b/docs/vite.config.ts @@ -3,7 +3,12 @@ export default { tasks: { 'build:site': { command: 'vitepress build', - input: [{ auto: true }, '!.vitepress/.temp/**', '!.vitepress/dist/**'], + input: [ + { auto: true }, + '!.vitepress/.temp/**', + '!.vitepress/dist/**', + '!node_modules/.vite-temp/**', + ], output: ['.vitepress/dist/**'], }, }, From 43c4292c1313a1f21291ea70e9e205048cadabc5 Mon Sep 17 00:00:00 2001 From: wan9chi Date: Wed, 1 Jul 2026 22:13:57 +0800 Subject: [PATCH 05/15] build(docs): rely on tracked build outputs --- docs/vite.config.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/vite.config.ts b/docs/vite.config.ts index 3c416b301b..02b2a0bb03 100644 --- a/docs/vite.config.ts +++ b/docs/vite.config.ts @@ -9,7 +9,6 @@ export default { '!.vitepress/dist/**', '!node_modules/.vite-temp/**', ], - output: ['.vitepress/dist/**'], }, }, }, From 4ed06e04a7cf07654b5672c89d5fb86832af8924 Mon Sep 17 00:00:00 2001 From: wan9chi Date: Wed, 1 Jul 2026 22:43:43 +0800 Subject: [PATCH 06/15] ci(docs): cache task builds in Actions --- .github/workflows/deploy-docs-preview.yml | 17 +++++++++++++++++ .github/workflows/deploy-docs.yml | 16 ++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/.github/workflows/deploy-docs-preview.yml b/.github/workflows/deploy-docs-preview.yml index 895cf50c24..2cf85d8aa7 100644 --- a/.github/workflows/deploy-docs-preview.yml +++ b/.github/workflows/deploy-docs-preview.yml @@ -37,12 +37,29 @@ jobs: working-directory: docs cache-dependency-path: docs/pnpm-lock.yaml + - name: Restore Vite Task cache + id: vite-task-cache + uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6 + with: + path: docs/node_modules/.vite/task-cache + key: vite-task-docs-${{ runner.os }}-${{ runner.arch }}-pr-${{ github.event.pull_request.number }}-${{ github.event.pull_request.head.sha }} + restore-keys: | + vite-task-docs-${{ runner.os }}-${{ runner.arch }}-pr-${{ github.event.pull_request.number }}- + vite-task-docs-${{ runner.os }}-${{ runner.arch }}-main- + - run: vp run build working-directory: docs - run: vp run build working-directory: docs + - name: Save Vite Task cache + if: success() && steps.vite-task-cache.outputs.cache-hit != 'true' + uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6 + with: + path: docs/node_modules/.vite/task-cache + key: ${{ steps.vite-task-cache.outputs.cache-primary-key }} + - run: vpx void deploy --dir docs/.vitepress/dist env: VOID_TOKEN: ${{ secrets.VOID_TOKEN }} diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index edacf95bca..42a0e5d67d 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -37,12 +37,28 @@ jobs: working-directory: docs cache-dependency-path: docs/pnpm-lock.yaml + - name: Restore Vite Task cache + id: vite-task-cache + uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6 + with: + path: docs/node_modules/.vite/task-cache + key: vite-task-docs-${{ runner.os }}-${{ runner.arch }}-main-${{ github.sha }} + restore-keys: | + vite-task-docs-${{ runner.os }}-${{ runner.arch }}-main- + - run: vp run build working-directory: docs - run: vp run build working-directory: docs + - name: Save Vite Task cache + if: success() && steps.vite-task-cache.outputs.cache-hit != 'true' + uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6 + with: + path: docs/node_modules/.vite/task-cache + key: ${{ steps.vite-task-cache.outputs.cache-primary-key }} + - run: vpx void deploy --dir docs/.vitepress/dist env: VOID_TOKEN: ${{ secrets.VOID_TOKEN }} From a0ffeef2c3c8d2b433fd013815c526348a50bafe Mon Sep 17 00:00:00 2001 From: wan9chi Date: Wed, 1 Jul 2026 22:46:36 +0800 Subject: [PATCH 07/15] ci(docs): run deploy build once --- .github/workflows/deploy-docs-preview.yml | 3 --- .github/workflows/deploy-docs.yml | 3 --- 2 files changed, 6 deletions(-) diff --git a/.github/workflows/deploy-docs-preview.yml b/.github/workflows/deploy-docs-preview.yml index 2cf85d8aa7..bdacaf9f6f 100644 --- a/.github/workflows/deploy-docs-preview.yml +++ b/.github/workflows/deploy-docs-preview.yml @@ -50,9 +50,6 @@ jobs: - run: vp run build working-directory: docs - - run: vp run build - working-directory: docs - - name: Save Vite Task cache if: success() && steps.vite-task-cache.outputs.cache-hit != 'true' uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6 diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index 42a0e5d67d..08262f8954 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -49,9 +49,6 @@ jobs: - run: vp run build working-directory: docs - - run: vp run build - working-directory: docs - - name: Save Vite Task cache if: success() && steps.vite-task-cache.outputs.cache-hit != 'true' uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6 From b5b5bd7c51215080a00551eaebdbea5b45d2613c Mon Sep 17 00:00:00 2001 From: wan9chi Date: Wed, 1 Jul 2026 22:50:23 +0800 Subject: [PATCH 08/15] build(docs): ignore Vite temp directory listing --- docs/vite.config.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/vite.config.ts b/docs/vite.config.ts index 02b2a0bb03..d8982d30d3 100644 --- a/docs/vite.config.ts +++ b/docs/vite.config.ts @@ -7,6 +7,8 @@ export default { { auto: true }, '!.vitepress/.temp/**', '!.vitepress/dist/**', + '!node_modules', + '!node_modules/.vite-temp', '!node_modules/.vite-temp/**', ], }, From a129dfd6199c77c5185d0ac2bc3c7e7e453936dc Mon Sep 17 00:00:00 2001 From: wan9chi Date: Wed, 1 Jul 2026 22:54:05 +0800 Subject: [PATCH 09/15] ci(docs): clarify task cache steps --- .github/workflows/deploy-docs-preview.yml | 4 ++-- .github/workflows/deploy-docs.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy-docs-preview.yml b/.github/workflows/deploy-docs-preview.yml index bdacaf9f6f..93a08b13af 100644 --- a/.github/workflows/deploy-docs-preview.yml +++ b/.github/workflows/deploy-docs-preview.yml @@ -37,7 +37,7 @@ jobs: working-directory: docs cache-dependency-path: docs/pnpm-lock.yaml - - name: Restore Vite Task cache + - name: Restore docs Vite Task cache id: vite-task-cache uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6 with: @@ -50,7 +50,7 @@ jobs: - run: vp run build working-directory: docs - - name: Save Vite Task cache + - name: Save docs Vite Task cache if: success() && steps.vite-task-cache.outputs.cache-hit != 'true' uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6 with: diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index 08262f8954..59767ddc66 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -37,7 +37,7 @@ jobs: working-directory: docs cache-dependency-path: docs/pnpm-lock.yaml - - name: Restore Vite Task cache + - name: Restore docs Vite Task cache id: vite-task-cache uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6 with: @@ -49,7 +49,7 @@ jobs: - run: vp run build working-directory: docs - - name: Save Vite Task cache + - name: Save docs Vite Task cache if: success() && steps.vite-task-cache.outputs.cache-hit != 'true' uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6 with: From 1b66ae63f5013a376283dbab338b4bb0e4b22aaa Mon Sep 17 00:00:00 2001 From: wan9chi Date: Wed, 1 Jul 2026 22:56:28 +0800 Subject: [PATCH 10/15] build(docs): restore build output tracking --- docs/vite.config.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/vite.config.ts b/docs/vite.config.ts index d8982d30d3..cbbe469371 100644 --- a/docs/vite.config.ts +++ b/docs/vite.config.ts @@ -11,6 +11,7 @@ export default { '!node_modules/.vite-temp', '!node_modules/.vite-temp/**', ], + output: ['.vitepress/dist/**'], }, }, }, From f89f484ee6e38aae4a5897ab2bcd7d9a40b6ec54 Mon Sep 17 00:00:00 2001 From: wan9chi Date: Wed, 1 Jul 2026 22:59:46 +0800 Subject: [PATCH 11/15] ci(docs): document task cache restore order --- .github/workflows/deploy-docs-preview.yml | 1 + .github/workflows/deploy-docs.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/deploy-docs-preview.yml b/.github/workflows/deploy-docs-preview.yml index 93a08b13af..f1943ff312 100644 --- a/.github/workflows/deploy-docs-preview.yml +++ b/.github/workflows/deploy-docs-preview.yml @@ -43,6 +43,7 @@ jobs: with: path: docs/node_modules/.vite/task-cache key: vite-task-docs-${{ runner.os }}-${{ runner.arch }}-pr-${{ github.event.pull_request.number }}-${{ github.event.pull_request.head.sha }} + # Prefer this PR's newest cache, then fall back to main for new PRs. restore-keys: | vite-task-docs-${{ runner.os }}-${{ runner.arch }}-pr-${{ github.event.pull_request.number }}- vite-task-docs-${{ runner.os }}-${{ runner.arch }}-main- diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index 59767ddc66..5fb616d325 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -43,6 +43,7 @@ jobs: with: path: docs/node_modules/.vite/task-cache key: vite-task-docs-${{ runner.os }}-${{ runner.arch }}-main-${{ github.sha }} + # Restore the latest main cache; Vite Task fingerprints decide reuse. restore-keys: | vite-task-docs-${{ runner.os }}-${{ runner.arch }}-main- From 83d4429f92c27e467ef794f07182e52fe9fd3852 Mon Sep 17 00:00:00 2001 From: wan9chi Date: Wed, 1 Jul 2026 23:37:00 +0800 Subject: [PATCH 12/15] build(docs): remove redundant Vite temp input --- docs/vite.config.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/vite.config.ts b/docs/vite.config.ts index cbbe469371..217728eb50 100644 --- a/docs/vite.config.ts +++ b/docs/vite.config.ts @@ -8,7 +8,6 @@ export default { '!.vitepress/.temp/**', '!.vitepress/dist/**', '!node_modules', - '!node_modules/.vite-temp', '!node_modules/.vite-temp/**', ], output: ['.vitepress/dist/**'], From 79ffad11ff0c5d6784459101a4034476340191cc Mon Sep 17 00:00:00 2001 From: wan9chi Date: Thu, 2 Jul 2026 08:54:19 +0800 Subject: [PATCH 13/15] ci(docs): use pkg.pr.new Vite+ for docs cache --- .github/workflows/deploy-docs-preview.yml | 2 ++ .github/workflows/deploy-docs.yml | 2 ++ docs/vite.config.ts | 1 - 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-docs-preview.yml b/.github/workflows/deploy-docs-preview.yml index f1943ff312..6f1c5a2d74 100644 --- a/.github/workflows/deploy-docs-preview.yml +++ b/.github/workflows/deploy-docs-preview.yml @@ -32,6 +32,8 @@ jobs: - uses: taiki-e/checkout-action@7d1e50e93dc4fb3bba58f85018fadf77898aee8b # v1.4.2 - uses: voidzero-dev/setup-vp@13e7afb99c66525824db54e107d667216e795d37 # main + env: + VP_PR_VERSION: 0fecc75a64a39bc5600ff6a1cee8baff378a8cc1 with: cache: true working-directory: docs diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index 5fb616d325..916ff3c460 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -32,6 +32,8 @@ jobs: - uses: taiki-e/checkout-action@7d1e50e93dc4fb3bba58f85018fadf77898aee8b # v1.4.2 - uses: voidzero-dev/setup-vp@13e7afb99c66525824db54e107d667216e795d37 # main + env: + VP_PR_VERSION: 0fecc75a64a39bc5600ff6a1cee8baff378a8cc1 with: cache: true working-directory: docs diff --git a/docs/vite.config.ts b/docs/vite.config.ts index 217728eb50..082343ebe0 100644 --- a/docs/vite.config.ts +++ b/docs/vite.config.ts @@ -10,7 +10,6 @@ export default { '!node_modules', '!node_modules/.vite-temp/**', ], - output: ['.vitepress/dist/**'], }, }, }, From 7b7f75f4d7f9556ba1b3c8f93298fad6822db809 Mon Sep 17 00:00:00 2001 From: wan9chi Date: Thu, 2 Jul 2026 09:18:13 +0800 Subject: [PATCH 14/15] build(docs): set explicit build output --- docs/vite.config.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/vite.config.ts b/docs/vite.config.ts index 082343ebe0..217728eb50 100644 --- a/docs/vite.config.ts +++ b/docs/vite.config.ts @@ -10,6 +10,7 @@ export default { '!node_modules', '!node_modules/.vite-temp/**', ], + output: ['.vitepress/dist/**'], }, }, }, From a8e3267f794353517beddd176a295fb29ba84a45 Mon Sep 17 00:00:00 2001 From: wan9chi Date: Thu, 2 Jul 2026 18:35:05 +0800 Subject: [PATCH 15/15] ci(docs): use released Vite+ for deploy builds --- .github/workflows/deploy-docs-preview.yml | 2 -- .github/workflows/deploy-docs.yml | 2 -- 2 files changed, 4 deletions(-) diff --git a/.github/workflows/deploy-docs-preview.yml b/.github/workflows/deploy-docs-preview.yml index 6f1c5a2d74..f1943ff312 100644 --- a/.github/workflows/deploy-docs-preview.yml +++ b/.github/workflows/deploy-docs-preview.yml @@ -32,8 +32,6 @@ jobs: - uses: taiki-e/checkout-action@7d1e50e93dc4fb3bba58f85018fadf77898aee8b # v1.4.2 - uses: voidzero-dev/setup-vp@13e7afb99c66525824db54e107d667216e795d37 # main - env: - VP_PR_VERSION: 0fecc75a64a39bc5600ff6a1cee8baff378a8cc1 with: cache: true working-directory: docs diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index 916ff3c460..5fb616d325 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -32,8 +32,6 @@ jobs: - uses: taiki-e/checkout-action@7d1e50e93dc4fb3bba58f85018fadf77898aee8b # v1.4.2 - uses: voidzero-dev/setup-vp@13e7afb99c66525824db54e107d667216e795d37 # main - env: - VP_PR_VERSION: 0fecc75a64a39bc5600ff6a1cee8baff378a8cc1 with: cache: true working-directory: docs