Skip to content

Commit 301fb52

Browse files
authored
chore: upgrade vite-plus and use setup-vite-plus-action for Node.js setup (#659)
## Summary - Upgrade vite-plus and related dependencies (qs, undici, @types/node, tshy) - Use `node-version` input in `setup-vite-plus-action` instead of separate `actions/setup-node` steps - Rename `vite` CLI to `vp` in all workflow commands - Remove redundant `corepack enable` step in `pkg.pr.new.yml` ## Test plan - [ ] CI passes on all matrix combinations (Node 20/22/24/25, ubuntu/macos/windows) - [ ] Typecheck job runs successfully - [ ] pkg-pr-new publish workflow runs successfully 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * CI workflows updated to streamline Node setup and pass Node versions through the unified setup step. * Build/test/lint scripts now route through the vp command runner for consistent execution. * Package scripts and lint-staged entries adjusted to use vp equivalents. * Bumped several dependencies and type packages to newer releases. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 482dfa8 commit 301fb52

File tree

4 files changed

+541
-333
lines changed

4 files changed

+541
-333
lines changed

.github/workflows/nodejs.yml

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,31 +17,27 @@ jobs:
1717
- name: Checkout repository
1818
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
1919

20-
- name: Set up Node.js
21-
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
22-
with:
23-
node-version: '24'
24-
2520
- name: Setup Vite+
2621
uses: voidzero-dev/setup-vite-plus-action@v1
2722
with:
23+
node-version: '24'
2824
cache: true
2925
run-install: true
3026

3127
- name: Run lint
32-
run: vite run lint
28+
run: vp run lint
3329

3430
- name: Check dedupe
35-
run: vite dedupe --check
31+
run: vp dedupe --check
3632

3733
- name: Run typecheck
38-
run: vite run typecheck
34+
run: vp run typecheck
3935

4036
- name: Run format check
41-
run: vite run fmtcheck
37+
run: vp run fmtcheck
4238

4339
- name: Run build check
44-
run: vite run build
40+
run: vp run build
4541

4642
test:
4743
strategy:
@@ -64,22 +60,18 @@ jobs:
6460
- name: Checkout repository
6561
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
6662

67-
- name: Set up Node.js
68-
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
69-
with:
70-
node-version: ${{ matrix.node }}
71-
7263
- name: Setup Vite+
7364
uses: voidzero-dev/setup-vite-plus-action@v1
7465
with:
66+
node-version: ${{ matrix.node }}
7567
cache: true
7668
run-install: true
7769

7870
- name: Run lint
79-
run: vite run lint
71+
run: vp run lint
8072

8173
- name: Run tests
82-
run: vite run ci
74+
run: vp run ci
8375

8476
- name: Code Coverage
8577
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5

.github/workflows/pkg.pr.new.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,14 @@ jobs:
1212
- name: Checkout code
1313
uses: actions/checkout@v6
1414

15-
- run: corepack enable
16-
- uses: actions/setup-node@v6
17-
with:
18-
node-version: 22
19-
2015
- name: Setup Vite+
2116
uses: voidzero-dev/setup-vite-plus-action@v1
2217
with:
18+
node-version: 22
2319
cache: true
2420
run-install: true
2521

2622
- name: Build
27-
run: vite run build
23+
run: vp run build
2824

29-
- run: vite dlx pkg-pr-new publish
25+
- run: vp dlx pkg-pr-new publish

package.json

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -45,39 +45,39 @@
4545
"tag": "latest"
4646
},
4747
"scripts": {
48-
"lint": "vite lint src test --type-aware --type-check",
48+
"lint": "vp lint src test --type-aware --type-check",
4949
"typecheck": "tsc --noEmit && tsgo --noEmit",
50-
"fmt": "vite fmt",
51-
"fmtcheck": "vite fmt --check",
52-
"prebuild": "vite run clean",
53-
"build": "vite run build:ts && vite run build:version",
50+
"fmt": "vp fmt",
51+
"fmtcheck": "vp fmt --check",
52+
"prebuild": "vp run clean",
53+
"build": "vp run build:ts && vp run build:version",
5454
"build:ts": "tsc --version && tshy && tshy-after",
5555
"build:version": "node ./scripts/replace_urllib_version.js",
5656
"build:cjs:test": "cd test/cjs && rm -rf node_modules && npm link ../.. && node index.js",
5757
"build:esm:test": "cd test/esm && rm -rf node_modules && npm link ../.. && node index.js",
5858
"build:mts:test": "cd test/mts && rm -rf node_modules && npm link ../.. && tsc",
59-
"build:test": "vite run build && vite run build:cjs:test && vite run build:esm:test && vite run build:mts:test && vite run test-tsc",
60-
"test-tsc": "vite run test-tsc:cjs:es2021 && vite run test-tsc:cjs && vite run test-tsc:esm",
61-
"test-tsc:cjs": "cd test/fixtures/ts && rm -rf node_modules && npm link ../../.. && vite run build",
62-
"test-tsc:cjs:es2021": "cd test/fixtures/ts-cjs-es2021 && rm -rf node_modules && npm link ../../.. && vite run build",
63-
"test-tsc:esm": "cd test/fixtures/ts-esm && rm -rf node_modules && npm link ../../.. && vite run build",
64-
"test": "vite run lint -- --fix && vite test run --reporter=dot",
65-
"bench": "vite test bench",
66-
"test-keepalive": "cross-env TEST_KEEPALIVE_COUNT=50 vite test run --reporter=dot --test-timeout 180000 keep-alive-header.test.ts",
59+
"build:test": "vp run build && vp run build:cjs:test && vp run build:esm:test && vp run build:mts:test && vp run test-tsc",
60+
"test-tsc": "vp run test-tsc:cjs:es2021 && vp run test-tsc:cjs && vp run test-tsc:esm",
61+
"test-tsc:cjs": "cd test/fixtures/ts && rm -rf node_modules && npm link ../../.. && vp run build",
62+
"test-tsc:cjs:es2021": "cd test/fixtures/ts-cjs-es2021 && rm -rf node_modules && npm link ../../.. && vp run build",
63+
"test-tsc:esm": "cd test/fixtures/ts-esm && rm -rf node_modules && npm link ../../.. && vp run build",
64+
"test": "vp run lint -- --fix && vp test run --reporter=dot",
65+
"bench": "vp test bench",
66+
"test-keepalive": "cross-env TEST_KEEPALIVE_COUNT=50 vp test run --reporter=dot --test-timeout 180000 keep-alive-header.test.ts",
6767
"test-node16": "node examples/httpclient.cjs && node examples/search_github.cjs && node examples/timing.cjs",
68-
"cov": "vite test run --reporter=dot --coverage",
69-
"ci": "vite run cov && vite run prepublishOnly && npm pack && attw --pack",
68+
"cov": "vp test run --reporter=dot --coverage",
69+
"ci": "vp run cov && vp run prepublishOnly && npm pack && attw --pack",
7070
"clean": "rm -rf dist && tsc -b --clean",
71-
"prepublishOnly": "vite run build",
71+
"prepublishOnly": "vp run build",
7272
"prepare": "husky"
7373
},
7474
"dependencies": {
7575
"form-data": "^4.0.5",
7676
"formstream": "^1.5.2",
7777
"mime-types": "^2.1.35",
78-
"qs": "^6.14.1",
78+
"qs": "^6.15.0",
7979
"type-fest": "^4.41.0",
80-
"undici": "^7.19.0",
80+
"undici": "^7.22.0",
8181
"ylru": "^2.0.0"
8282
},
8383
"devDependencies": {
@@ -86,7 +86,7 @@
8686
"@eggjs/tsconfig": "^2.0.0",
8787
"@types/busboy": "^1.5.4",
8888
"@types/mime-types": "^2.1.4",
89-
"@types/node": "^22.19.7",
89+
"@types/node": "^22.19.11",
9090
"@types/proxy": "^1.0.4",
9191
"@types/qs": "^6.14.0",
9292
"@types/selfsigned": "^2.1.0",
@@ -103,7 +103,7 @@
103103
"selfsigned": "^3.0.1",
104104
"string.prototype.towellformed": "^1.0.2",
105105
"tar-stream": "^2.2.0",
106-
"tshy": "^3.1.0",
106+
"tshy": "^3.3.2",
107107
"tshy-after": "^1.4.1",
108108
"typescript": "^5.9.3",
109109
"vite-plus": "latest",
@@ -115,8 +115,8 @@
115115
},
116116
"lint-staged": {
117117
"*": [
118-
"vite run lint --fix",
119-
"vite fmt --no-error-on-unmatched-pattern"
118+
"vp run lint --fix",
119+
"vp fmt --no-error-on-unmatched-pattern"
120120
]
121121
},
122122
"tshy": {

0 commit comments

Comments
 (0)