Skip to content

Commit 56ba5c4

Browse files
committed
chore: change pnpm as main package manager
1 parent bb800f0 commit 56ba5c4

File tree

12 files changed

+1840
-2171
lines changed

12 files changed

+1840
-2171
lines changed

.github/workflows/ci.yml

Lines changed: 30 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -42,27 +42,28 @@ jobs:
4242
- name: Checkout codes
4343
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
4444

45+
- name: Install pnpm
46+
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
47+
4548
- name: Setup deno
4649
uses: denoland/setup-deno@v1
4750
with:
4851
deno-version: v1.x
4952

5053
- name: Setup bun
51-
uses: oven-sh/setup-bun@v1
52-
53-
- name: Enable corepack
54-
run: corepack enable
54+
uses: oven-sh/setup-bun@735343b667d3e6f658f44d0eca948eb6282f2b76 # v2.0.2
5555

5656
- name: Setup node
5757
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
5858
with:
5959
node-version: ${{ matrix.node }}
60+
cache: pnpm
6061

6162
- name: Install dependencies
62-
run: bun install
63+
run: pnpm install --frozen-lockfile
6364

6465
- name: Build codes
65-
run: npm run build
66+
run: pnpm run build
6667

6768
test:
6869
name: Test
@@ -77,32 +78,33 @@ jobs:
7778
- name: Checkout codes
7879
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
7980

81+
- name: Install pnpm
82+
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
83+
8084
- name: Setup deno
8185
uses: denoland/setup-deno@v1
8286
with:
8387
deno-version: v1.x
8488

8589
- name: Setup bun
86-
uses: oven-sh/setup-bun@v1
90+
uses: oven-sh/setup-bun@735343b667d3e6f658f44d0eca948eb6282f2b76 # v2.0.2
8791

8892
- name: Setup node
89-
uses: actions/setup-node@v4
93+
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
9094
with:
9195
node-version: ${{ matrix.node }}
92-
93-
- name: Enable corepack
94-
run: corepack enable
96+
cache: pnpm
9597

9698
- name: Install dependencies
97-
run: bun install
99+
run: pnpm install --frozen-lockfile
98100

99101
# NOTE: avoid https://github.com/intlify/utils/actions/runs/6573605958/job/17857030689?pr=31#step:8:48
100102
# vitest-environment-miniflare tries to load dist/index.cjs and work with vitest...
101103
- name: Build codes
102-
run: npm run build
104+
run: pnpm run build
103105

104106
- name: Test
105-
run: npm test
107+
run: pnpm run test
106108

107109
e2e:
108110
name: E2E
@@ -117,54 +119,28 @@ jobs:
117119
- name: Checkout codes
118120
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
119121

122+
- name: Install pnpm
123+
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
124+
120125
- name: Setup deno
121126
uses: denoland/setup-deno@v1
122127
with:
123128
deno-version: v1.x
124129

125130
- name: Setup bun
126-
uses: oven-sh/setup-bun@v1
131+
uses: oven-sh/setup-bun@735343b667d3e6f658f44d0eca948eb6282f2b76 # v2.0.2
127132

128133
- name: Setup node
129134
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
130135
with:
131136
node-version: ${{ matrix.node }}
132-
133-
- name: Enable corepack
134-
run: corepack enable
137+
cache: pnpm
135138

136139
- name: Install dependencies
137-
run: bun install
140+
run: pnpm install --frozen-lockfile
138141

139142
- name: Build codes
140-
run: npm run build
141-
142-
# https://github.com/vitejs/vite/blob/main/.github/workflows/ci.yml#L91
143-
# Install playwright's binary under custom directory to cache
144-
- name: (non-windows) Set Playwright path and Get playwright version
145-
if: runner.os != 'Windows'
146-
run: |
147-
echo "PLAYWRIGHT_BROWSERS_PATH=$HOME/.cache/playwright-bin" >> $GITHUB_ENV
148-
PLAYWRIGHT_VERSION="$(bun run ./scripts/playwright-version.ts)"
149-
echo "PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION" >> $GITHUB_ENV
150-
- name: (windows) Set Playwright path and Get playwright version
151-
if: runner.os == 'Windows'
152-
run: |
153-
echo "PLAYWRIGHT_BROWSERS_PATH=$HOME\.cache\playwright-bin" >> $env:GITHUB_ENV
154-
PLAYWRIGHT_VERSION="$(bun run ./scripts/playwright-version.ts)"
155-
echo "PLAYWRIGHT_VERSION=$env:PLAYWRIGHT_VERSION" >> $env:GITHUB_ENV
156-
157-
- name: Cache Playwright's binary
158-
uses: actions/cache@v4
159-
with:
160-
key: ${{ runner.os }}-playwright-bin-v1-${{ env.PLAYWRIGHT_VERSION }}
161-
path: ${{ env.PLAYWRIGHT_BROWSERS_PATH }}
162-
restore-keys: |
163-
${{ runner.os }}-playwright-bin-v1-
164-
165-
- name: Install Playwright
166-
# does not need to explicitly set chromium after https://github.com/microsoft/playwright/issues/14862 is solved
167-
run: bun x playwright install chromium
143+
run: pnpm run build
168144

169145
- name: Run test
170146
run: ./scripts/e2e.sh
@@ -185,27 +161,28 @@ jobs:
185161
- name: Checkout codes
186162
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
187163

164+
- name: Install pnpm
165+
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
166+
188167
- name: Setup deno
189168
uses: denoland/setup-deno@v1
190169
with:
191170
deno-version: v1.x
192171

193172
- name: Setup bun
194-
uses: oven-sh/setup-bun@v1
173+
uses: oven-sh/setup-bun@735343b667d3e6f658f44d0eca948eb6282f2b76 # v2.0.2
195174

196175
- name: Setup node
197176
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
198177
with:
199178
node-version: ${{ matrix.node }}
200-
201-
- name: Enable corepack
202-
run: corepack enable
179+
cache: pnpm
203180

204181
- name: Install dependencies
205-
run: bun install
182+
run: pnpm install --frozen-lockfile
206183

207184
- name: Build
208-
run: npm run build
185+
run: pnpm run build
209186

210187
- name: Release Edge
211188
if: |

.github/workflows/release.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,25 +20,29 @@ jobs:
2020
with:
2121
ref: ${{ github.head_ref }}
2222

23+
- name: Install pnpm
24+
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
25+
2326
- name: Setup deno
2427
uses: denoland/setup-deno@v1
2528
with:
2629
deno-version: v1.x
2730

2831
- name: Setup bun
29-
uses: oven-sh/setup-bun@v1
32+
uses: oven-sh/setup-bun@735343b667d3e6f658f44d0eca948eb6282f2b76 # v2.0.2
3033

3134
- name: Setup Node
3235
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
3336
with:
3437
node-version: 20
35-
36-
- name: Enable corepack
37-
run: corepack enable
38+
cache: pnpm
3839

3940
- name: Update npm
4041
run: npm install -g npm@latest
4142

43+
- name: Install dependencies
44+
run: pnpm install --frozen-lockfile
45+
4246
- name: Extract version tag
4347
if: startsWith( github.ref, 'refs/tags/v' )
4448
uses: jungwinter/split@7f51d99e7cc1f147f6f99be75acf5e641930af88 # v2.1.0
@@ -55,9 +59,8 @@ jobs:
5559
- name: Generate changelog
5660
run: |
5761
git restore --source=HEAD --staged --worktree -- package.json bun.lockb
58-
bun install
59-
npm run build
60-
npm run changelog -- --tag=${{ steps.split.outputs._2 }}
62+
pnpm run build
63+
pnpm run changelog -- --tag=${{ steps.split.outputs._2 }}
6164
env:
6265
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6366

@@ -74,4 +77,4 @@ jobs:
7477
NPM_CONFIG_PROVENANCE: true
7578

7679
- name: Publish package for JSR
77-
run: npx jsr publish
80+
run: pnpx jsr publish

bun.lockb

-298 KB
Binary file not shown.

package.json

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -69,29 +69,24 @@
6969
"prepare": "git config --local core.hooksPath .githooks",
7070
"changelog": "gh-changelogen --repo=intlify/utils",
7171
"release": "bumpp --commit \"release: v%s\" --all --push --tag",
72-
"version": "npx tsx scripts/bump-deno.ts",
73-
"fix": "run-p lint format",
72+
"version": "pnpx tsx scripts/bump-deno.ts",
73+
"fix": "pnpm run --stream --color \"/^(lint|format)$/\"",
7474
"lint": "deno lint",
7575
"format": "deno fmt",
76-
"build": "unbuild && bun run ./scripts/deno.ts",
77-
"test": "npm run test:typecheck && npm run test:unit",
76+
"build": "unbuild && pnpx tsx ./scripts/deno.ts",
77+
"test": "pnpm run test:typecheck && pnpm run test:unit",
7878
"test:unit": "NODE_OPTIONS=--experimental-vm-modules vitest run ./src",
7979
"test:typecheck": "vitest --typecheck --config ./vitest.type.config.ts --run",
80-
"test:coverage": "npm test -- --reporter verbose --coverage",
81-
"test:e2e": "run-s test:e2e:*",
82-
"test:e2e:browser": "cd playground/browser && node --test",
83-
"test:e2e:node": "cd playground/node && node --test",
84-
"test:e2e:deno": "cd playground/deno && deno task test",
85-
"test:e2e:bun": "cd playground/bun && npm run test",
86-
"setup": "run-s setup:*",
87-
"setup:browser": "cd playground/browser && bun install",
88-
"setup:node": "cd playground/node && bun install",
89-
"setup:deno": "cd playground/deno && deno cache --reload ./main.ts",
90-
"setup:bun": "cd playground/bun && bun install",
91-
"play:browser": "cd playground/browser && npm run dev",
92-
"play:node": "cd playground/node && npm run dev",
93-
"play:deno": "cd playground/deno && deno run --allow-net main.ts",
94-
"play:bun": "cd playground/bun && npm run dev"
80+
"test:coverage": "pnpm test -- --reporter verbose --coverage",
81+
"test:e2e": "pnpm run --color \"/^test:e2e:/\"",
82+
"test:e2e:browser": "pnpm run --filter example-browser test",
83+
"test:e2e:node": "pnpm run --filter example-node test",
84+
"test:e2e:deno": "pnpm run --filter example-deno test",
85+
"test:e2e:bun": "pnpm run --filter example-bun test",
86+
"play:browser": "pnpm run --filter example-browser dev",
87+
"play:node": "pnpm run --filter example-node dev",
88+
"play:deno": "pnpm run --filter example-deno dev",
89+
"play:bun": "pnpm run --filter example-bun dev"
9590
},
9691
"lint-staged": {
9792
"*.{js,ts,jsx,tsx,json,jsonc}": [
@@ -108,15 +103,13 @@
108103
"@types/supertest": "^2.0.12",
109104
"@vitest/coverage-v8": "^1.3.0",
110105
"bumpp": "^9.2.0",
111-
"bun-types": "latest",
112106
"cookie-es": "^1.0.0",
113107
"gh-changelogen": "^0.2.8",
114108
"h3": "^1.8.1",
115109
"hono": "^3.8.1",
116110
"jsonc-parser": "^3.2.1",
117111
"lint-staged": "^15.0.0",
118112
"miniflare": "^3.20231016.0",
119-
"npm-run-all2": "^6.0.0",
120113
"pkg-types": "^1.0.2",
121114
"playwright": "^1.38.1",
122115
"semver": "^7.6.0",
@@ -126,5 +119,5 @@
126119
"vitest": "^1.3.0",
127120
"vitest-environment-miniflare": "^2.14.1"
128121
},
129-
"packageManager": "pnpm@9.5.0+sha512.140036830124618d624a2187b50d04289d5a087f326c9edfc0ccd733d76c4f52c3a313d4fc148794a2a9d81553016004e6742e8cf850670268a7387fc220c903"
122+
"packageManager": "pnpm@10.20.0"
130123
}

playground/browser/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
"version": "0.0.0",
55
"type": "module",
66
"scripts": {
7-
"dev": "npx --no-install serve -l 3000",
7+
"dev": "pnpx serve -l 3000",
88
"test": "node --test"
99
},
1010
"devDependencies": {
1111
"serve": "^14.2.1",
1212
"serve-handler": "^6.1.5"
1313
},
1414
"dependencies": {
15-
"@intlify/utils": "npm:@intlify/utils-edge@latest"
15+
"@intlify/utils": "workspace:*"
1616
}
1717
}

playground/bun/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@
1414
"typescript": "^5.0.0"
1515
},
1616
"dependencies": {
17-
"@intlify/utils": "npm:@intlify/utils-edge@latest"
17+
"@intlify/utils": "workspace:*"
1818
}
1919
}

playground/deno/package.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"name": "example-deno",
3+
"private": true,
4+
"type": "module",
5+
"scripts": {
6+
"dev": "deno run --allow-net main.ts",
7+
"test": "deno task test"
8+
}
9+
}

playground/node/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
"private": true,
44
"type": "module",
55
"scripts": {
6-
"dev": "npx tsx index.ts",
6+
"dev": "pnpx tsx index.ts",
77
"test": "node --test"
88
},
99
"dependencies": {
10-
"@intlify/utils": "file:/Users/kazuya.kawaguchi/Projects/oss/intlify/utils/intlify-utils-0.10.0.tgz"
10+
"@intlify/utils": "workspace:*"
1111
},
1212
"peerDependencies": {
1313
"typescript": "^5.2.2"

0 commit comments

Comments
 (0)