Skip to content

Commit 5ed1856

Browse files
committed
build: switch to pnpm
1 parent 17fd2ee commit 5ed1856

File tree

6 files changed

+9292
-8150
lines changed

6 files changed

+9292
-8150
lines changed

.github/workflows/main.yml

Lines changed: 35 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,32 @@ on:
1111

1212
jobs:
1313
validate:
14-
name: Validate Using Node 16
14+
name: Validate Using Latest Node LTS
1515
runs-on: ubuntu-latest
1616
container:
17-
image: cypress/browsers:node16.14.0-chrome99-ff97
17+
image: cypress/browsers:node18.6.0-chrome105-ff104
1818
options: --user 1001
1919
steps:
2020
- uses: actions/checkout@v3
21+
- uses: pnpm/action-setup@v2.2.4
22+
with:
23+
version: 7
24+
- uses: actions/setup-node@v3
25+
with:
26+
node-version: 18
27+
cache: pnpm
2128

2229
- name: Run Lint and Typecheck
23-
uses: cypress-io/github-action@v2
30+
uses: cypress-io/github-action@v5
2431
with:
2532
runTests: false
2633

27-
- run: yarn
28-
- run: yarn lint
29-
- run: yarn typecheck
30-
- run: yarn test --coverage
34+
- run: pnpm install --frozen-lockfile
35+
- run: pnpm lint
36+
- run: pnpm typecheck
37+
- run: pnpm test --coverage
3138
- run: npx codecov -t ${{ secrets.CODECOV_TOKEN }}
32-
- run: yarn build
39+
- run: pnpm build
3340

3441
- name: Save build folder
3542
uses: actions/upload-artifact@v3
@@ -42,12 +49,18 @@ jobs:
4249
name: Test Chrome
4350
runs-on: ubuntu-latest
4451
container:
45-
image: cypress/browsers:node16.14.0-chrome99-ff97
52+
image: cypress/browsers:node18.6.0-chrome105-ff104
4653
options: --user 1001
4754
needs: validate
4855
steps:
49-
- name: Checkout
50-
uses: actions/checkout@v3
56+
- uses: actions/checkout@v3
57+
- uses: pnpm/action-setup@v2.2.4
58+
with:
59+
version: 7
60+
- uses: actions/setup-node@v3
61+
with:
62+
node-version: 18
63+
cache: pnpm
5164

5265
- name: Download the build folders
5366
uses: actions/download-artifact@v3
@@ -58,7 +71,7 @@ jobs:
5871
- name: "UI Tests - Chrome"
5972
uses: cypress-io/github-action@v4
6073
with:
61-
start: yarn start
74+
start: pnpm start
6275
wait-on: "http://localhost:3000"
6376
wait-on-timeout: 120
6477
browser: chrome
@@ -91,12 +104,18 @@ jobs:
91104
name: Test Firefox
92105
runs-on: ubuntu-latest
93106
container:
94-
image: cypress/browsers:node16.14.0-chrome99-ff97
107+
image: cypress/browsers:node18.6.0-chrome105-ff104
95108
options: --user 1001
96109
needs: validate
97110
steps:
98-
- name: Checkout
99-
uses: actions/checkout@v3
111+
- uses: actions/checkout@v3
112+
- uses: pnpm/action-setup@v2.2.4
113+
with:
114+
version: 7
115+
- uses: actions/setup-node@v3
116+
with:
117+
node-version: 18
118+
cache: pnpm
100119

101120
- name: Download the build folders
102121
uses: actions/download-artifact@v3
@@ -107,7 +126,7 @@ jobs:
107126
- name: "UI Tests - Firefox"
108127
uses: cypress-io/github-action@v4
109128
with:
110-
start: yarn start
129+
start: pnpm start
111130
wait-on: "http://localhost:3000"
112131
wait-on-timeout: 120
113132
browser: firefox

.husky/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/sh
22
. "$(dirname "$0")/_/husky.sh"
33

4-
yarn lint-staged
4+
pnpm lint-staged

package.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
"scripts": {
1010
"prepare": "husky install",
1111
"prebuild": "npm-run-all -p lint typecheck api-docs create-env",
12-
"run-script": "ts-node -T -P tsconfig.node.json",
13-
"create-env": "yarn run-script scripts/createEnv.ts",
12+
"cli": "ts-node -P tsconfig.node.json --swc",
13+
"create-env": "pnpm run cli scripts/createEnv.ts",
1414
"format": "prettier --write \"**/*.{ts,tsx,scss,js,jsx,md,yml,json}\"",
15-
"api-docs": "yarn run-script scripts/typedoc.ts",
16-
"release": "yarn run-script scripts/release.ts",
15+
"api-docs": "pnpm run cli scripts/typedoc.ts",
16+
"release": "pnpm run cli scripts/release.ts",
1717
"lint": "eslint \"**/*.{js,jsx,ts,tsx}\"",
1818
"typecheck": "tsc -p tsconfig.check.json",
1919
"test": "jest",
@@ -22,6 +22,10 @@
2222
"start": "next start",
2323
"build": "next build"
2424
},
25+
"engines": {
26+
"pnpm": ">=7"
27+
},
28+
"engineStrict": true,
2529
"main": "./dist/index.cjs",
2630
"module": "./dist/index.ejs",
2731
"browser": "./dist/index.min.js",

0 commit comments

Comments
 (0)