Skip to content

Commit 25c415e

Browse files
committed
Use pnpm instead of yarn
1 parent 4bec34f commit 25c415e

File tree

15 files changed

+14681
-520
lines changed

15 files changed

+14681
-520
lines changed

.github/workflows/chromatic.yml

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,25 @@ jobs:
2222
working-directory: packages/ui
2323
steps:
2424
- uses: actions/checkout@v4
25-
- uses: actions/setup-node@v4
25+
with:
26+
fetch-depth: 0
27+
- name: Install pnpm
28+
uses: pnpm/action-setup@v4
29+
- name: Install Node.js
30+
uses: actions/setup-node@v4
2631
with:
2732
node-version: 20
28-
cache: 'yarn'
29-
- name: Install dependencies on UI library
30-
run: yarn install --frozen-lockfile
33+
cache: 'pnpm'
34+
- name: Install dependencies
35+
run: pnpm install
3136
- name: Typecheck
32-
run: yarn typecheck
37+
run: pnpm typecheck
3338
- name: Lint CSS
34-
run: yarn lint:css
39+
run: pnpm lint:css
3540
- name: Lint JS
36-
run: yarn lint:js
41+
run: pnpm lint:js
3742
- name: build UI library
38-
run: yarn build
43+
run: pnpm build
3944
- uses: actions/upload-artifact@v4
4045
with:
4146
name: ui-build
@@ -48,16 +53,19 @@ jobs:
4853
- uses: actions/checkout@v4
4954
with:
5055
fetch-depth: 0
51-
- uses: actions/setup-node@v4
56+
- name: Install pnpm
57+
uses: pnpm/action-setup@v4
58+
- name: Install Node.js
59+
uses: actions/setup-node@v4
5260
with:
5361
node-version: 20
54-
cache: 'yarn'
62+
cache: 'pnpm'
63+
- name: Install dependencies
64+
run: pnpm install
5565
- uses: actions/download-artifact@v4
5666
with:
5767
name: ui-build
5868
path: packages/ui/dist
59-
- name: Install dependencies
60-
run: yarn install --frozen-lockfile
6169
- name: Run Chromatic
6270
uses: chromaui/action@v1
6371
with:
@@ -76,16 +84,20 @@ jobs:
7684
- uses: actions/checkout@v4
7785
with:
7886
fetch-depth: 0
79-
- uses: actions/setup-node@v4
87+
- name: Install pnpm
88+
uses: pnpm/action-setup@v4
89+
- name: Install Node.js
90+
uses: actions/setup-node@v4
8091
with:
8192
node-version: 20
93+
cache: 'pnpm'
8294
- uses: actions/download-artifact@v4
8395
with:
8496
name: ui-build
8597
path: packages/ui/dist
8698
- uses: bitovi/[email protected]
8799
with:
88-
install_command: yarn install
89-
build_command: yarn build-storybook
100+
install_command: pnpm install
101+
build_command: pnpm build-storybook
90102
path: packages/go-ui-storybook/storybook-static
91103
checkout: false

.github/workflows/ci.yml

Lines changed: 69 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -31,25 +31,27 @@ jobs:
3131
working-directory: packages/ui
3232
steps:
3333
- uses: actions/checkout@v4
34-
- uses: actions/setup-node@v4
34+
- name: Install pnpm
35+
uses: pnpm/action-setup@v4
36+
- name: Install Node.js
37+
uses: actions/setup-node@v4
3538
with:
3639
node-version: 20
37-
cache: 'yarn'
38-
39-
- name: Install dependencies on UI library
40-
run: yarn install --frozen-lockfile
40+
cache: 'pnpm'
41+
- name: Install dependencies
42+
run: pnpm install
4143

4244
- name: Typecheck
43-
run: yarn typecheck
45+
run: pnpm typecheck
4446

4547
- name: Lint CSS
46-
run: yarn lint:css
48+
run: pnpm lint:css
4749

4850
- name: Lint JS
49-
run: yarn lint:js
51+
run: pnpm lint:js
5052

5153
- name: Build
52-
run: yarn build
54+
run: pnpm build
5355

5456
- uses: actions/upload-artifact@v4
5557
with:
@@ -66,21 +68,23 @@ jobs:
6668
needs: [ui]
6769
steps:
6870
- uses: actions/checkout@v4
69-
- uses: actions/setup-node@v4
71+
- name: Install pnpm
72+
uses: pnpm/action-setup@v4
73+
- name: Install Node.js
74+
uses: actions/setup-node@v4
7075
with:
7176
node-version: 20
72-
cache: 'yarn'
77+
cache: 'pnpm'
78+
- name: Install dependencies
79+
run: pnpm install
7380

7481
- uses: actions/download-artifact@v4
7582
with:
7683
name: ui-build
7784
path: packages/ui/dist
7885

79-
- name: Install dependencies
80-
run: yarn install --frozen-lockfile
81-
8286
- name: Run test
83-
run: yarn test
87+
run: pnpm test
8488

8589
translation:
8690
continue-on-error: true
@@ -92,42 +96,46 @@ jobs:
9296
needs: [ui]
9397
steps:
9498
- uses: actions/checkout@v4
95-
- uses: actions/setup-node@v4
99+
- name: Install pnpm
100+
uses: pnpm/action-setup@v4
101+
- name: Install Node.js
102+
uses: actions/setup-node@v4
96103
with:
97104
node-version: 20
98-
cache: 'yarn'
105+
cache: 'pnpm'
106+
- name: Install dependencies
107+
run: pnpm install
99108

100109
- uses: actions/download-artifact@v4
101110
with:
102111
name: ui-build
103112
path: packages/ui/dist
104113

105-
- name: Install dependencies
106-
run: yarn install --frozen-lockfile
107-
108114
- name: Identify error with translation files
109-
run: yarn lint:translation
115+
run: pnpm lint:translation
110116

111117
unimported:
112118
name: Identify unused files
113119
runs-on: ubuntu-latest
114120
needs: [ui]
115121
steps:
116122
- uses: actions/checkout@v4
117-
- uses: actions/setup-node@v4
123+
- name: Install pnpm
124+
uses: pnpm/action-setup@v4
125+
- name: Install Node.js
126+
uses: actions/setup-node@v4
118127
with:
119128
node-version: 20
120-
cache: 'yarn'
121-
129+
cache: 'pnpm'
122130
- name: Install dependencies
123-
run: yarn initialize:type
124-
working-directory: app
131+
run: pnpm install
125132

126-
- name: Install dependencies
127-
run: yarn install --frozen-lockfile
133+
- name: Initialize types
134+
run: pnpm initialize:type
135+
working-directory: app
128136

129137
- name: Identify unused files
130-
run: yarn lint:unused
138+
run: pnpm lint:unused
131139

132140
lint:
133141
name: Lint JS
@@ -138,21 +146,23 @@ jobs:
138146
needs: [ui]
139147
steps:
140148
- uses: actions/checkout@v4
141-
- uses: actions/setup-node@v4
149+
- name: Install pnpm
150+
uses: pnpm/action-setup@v4
151+
- name: Install Node.js
152+
uses: actions/setup-node@v4
142153
with:
143154
node-version: 20
144-
cache: 'yarn'
155+
cache: 'pnpm'
156+
- name: Install dependencies
157+
run: pnpm install
145158

146159
- uses: actions/download-artifact@v4
147160
with:
148161
name: ui-build
149162
path: packages/ui/dist
150163

151-
- name: Install dependencies
152-
run: yarn install --frozen-lockfile
153-
154164
- name: Lint JS
155-
run: yarn lint:js
165+
run: pnpm lint:js
156166

157167
lint-css:
158168
name: Lint CSS
@@ -163,38 +173,42 @@ jobs:
163173
needs: [ui]
164174
steps:
165175
- uses: actions/checkout@v4
166-
- uses: actions/setup-node@v4
176+
- name: Install pnpm
177+
uses: pnpm/action-setup@v4
178+
- name: Install Node.js
179+
uses: actions/setup-node@v4
167180
with:
168181
node-version: 20
169-
cache: 'yarn'
182+
cache: 'pnpm'
183+
- name: Install dependencies
184+
run: pnpm install
170185

171186
- uses: actions/download-artifact@v4
172187
with:
173188
name: ui-build
174189
path: packages/ui/dist
175190

176-
- name: Install dependencies
177-
run: yarn install --frozen-lockfile
178-
179191
- name: Lint CSS
180-
run: yarn lint:css
192+
run: pnpm lint:css
181193

182194
# FIXME: Identify a way to generate schema before we run typecheck
183195
# typecheck:
184196
# name: Typecheck
185197
# runs-on: ubuntu-latest
186198
# steps:
187199
# - uses: actions/checkout@v4
188-
# - uses: actions/setup-node@v4
200+
# - name: Install pnpm
201+
# uses: pnpm/action-setup@v4
202+
# - name: Install Node.js
203+
# uses: actions/setup-node@v4
189204
# with:
190205
# node-version: 20
191-
# cache: 'yarn'
192-
206+
# cache: 'pnpm'
193207
# - name: Install dependencies
194-
# run: yarn install --frozen-lockfile
195-
208+
# run: pnpm install
209+
#
196210
# - name: Typecheck
197-
# run: yarn typecheck
211+
# run: pnpm typecheck
198212
build:
199213
name: Build GO Web App
200214
environment: 'test'
@@ -205,21 +219,23 @@ jobs:
205219
needs: [lint, lint-css, test, ui]
206220
steps:
207221
- uses: actions/checkout@v4
208-
- uses: actions/setup-node@v4
222+
- name: Install pnpm
223+
uses: pnpm/action-setup@v4
224+
- name: Install Node.js
225+
uses: actions/setup-node@v4
209226
with:
210227
node-version: 20
211-
cache: 'yarn'
228+
cache: 'pnpm'
229+
- name: Install dependencies
230+
run: pnpm install
212231

213232
- uses: actions/download-artifact@v4
214233
with:
215234
name: ui-build
216235
path: packages/ui/dist
217236

218-
- name: Install dependencies
219-
run: yarn install --frozen-lockfile
220-
221237
- name: Build
222-
run: yarn build
238+
run: pnpm build
223239

224240
validate_helm:
225241
name: Validate Helm

app/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ RUN apt-get update -y \
55
git bash g++ make \
66
&& rm -rf /var/lib/apt/lists/*
77

8+
RUN npm install -g pnpm
9+
810
WORKDIR /code
911

1012
RUN git config --global --add safe.directory /code

app/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,11 @@
110110
"tsx": "^4.7.2",
111111
"typescript": "^5.5.2",
112112
"vite": "^5.0.10",
113-
"vite-plugin-checker": "^0.6.2",
113+
"vite-plugin-checker": "^0.7.0",
114114
"vite-plugin-compression2": "^0.11.0",
115115
"vite-plugin-radar": "^0.9.2",
116116
"vite-plugin-svgr": "^4.2.0",
117-
"vite-plugin-webfont-dl": "^3.9.1",
117+
"vite-plugin-webfont-dl": "^3.9.4",
118118
"vite-tsconfig-paths": "^4.2.2",
119119
"vitest": "^1.2.2",
120120
"yargs": "^17.7.2"
File renamed without changes.
File renamed without changes.

app/vite.config.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,20 @@ export default defineConfig(({ mode }) => {
2626
'import.meta.env.APP_VERSION': JSON.stringify(env.npm_package_version),
2727
'import.meta.env.APP_PACKAGE_NAME': JSON.stringify(env.npm_package_name),
2828
'import.meta.env.APP_REPOSITORY_URL': JSON.stringify(pkg.repository.url.match(/https:\/\/github\.com\/[^ ]+/)?.[0].replace(/\.git$/, '')),
29+
// NOTE: To fix 'global is not defined' issue after migration from yarn to pnpm
30+
global: {},
2931
},
3032
plugins: [
3133
isProd ? checker({
3234
// typescript: true,
3335
eslint: {
36+
useFlatConfig: true,
3437
lintCommand: 'eslint ./src',
3538
},
36-
stylelint: {
37-
lintCommand: 'stylelint "./src/**/*.css"',
38-
},
39+
// TODO: Enable this once https://github.com/fi3ework/vite-plugin-checker/issues/260 is fixed
40+
// stylelint: {
41+
// lintCommand: 'stylelint "./src/**/*.css"',
42+
// },
3943
}) : undefined,
4044
svgr(),
4145
reactSwc(),

0 commit comments

Comments
 (0)