Skip to content

Commit 6f9eeeb

Browse files
committed
feat: yarn replaced with pnpm
Refs: RATY-319
1 parent 7ac61ae commit 6f9eeeb

9 files changed

Lines changed: 9509 additions & 7458 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ on:
99

1010
jobs:
1111
common:
12-
uses: City-of-Helsinki/.github/.github/workflows/ci-node.yml@main
12+
uses: City-of-Helsinki/.github/.github/workflows/ci-pnpm-node.yml@feat/RATY-319-pnpm-node-workflow
1313
secrets: inherit
1414
with:
1515
node-version: 22.x
16-
extra-commands: yarn update-runtime-env
16+
extra-commands: pnpm update-runtime-env

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ bower_components
4141

4242
/assets/js/tracker
4343

44+
# yarn – ei enää käytössä
45+
yarn.lock
46+
.yarn/
47+
.yarnrc.yml
48+
4449
# tests
4550
report/
4651
/test-results/

.husky/commit-msg

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

4-
yarn commitlint --edit $1
4+
pnpm commitlint --edit $1

.husky/pre-commit

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

4-
yarn test --watch=false
4+
pnpm test --watch=false

Dockerfile

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
# ============================================================
22
# STAGE 1: Build the Static Assets
33
# ============================================================
4-
FROM helsinki.azurecr.io/ubi9/nodejs-22-yarn-builder-base AS staticbuilder
4+
FROM helsinki.azurecr.io/ubi9/nodejs-22-pnpm-builder-base AS staticbuilder
55

66
# 1. Install dependencies
7-
# Base already has /app as WORKDIR
8-
COPY --chown=default:root package.json yarn.lock ./
7+
# Install npm dependencies and build the bundle
8+
COPY --chown=default:root package.json pnpm-lock.yaml pnpm-workspace.yaml ./
99
COPY --chown=default:root ./scripts ./scripts
1010
COPY --chown=default:root ./public ./public
1111
COPY --chown=default:root ./cities ./cities
1212
COPY --chown=default:root ./assets ./assets
1313

14-
# 2. Run the install
15-
RUN yarn --frozen-lockfile --ignore-engines --ignore-scripts --network-concurrency 1 \
16-
&& yarn update-runtime-env \
17-
&& yarn cache clean --force
14+
# 2. Run the install and update-runtime-env script
15+
# corepack in the base image will automatically use the version of pnpm
16+
# defined in your package.json 'packageManager' field if present.
17+
RUN pnpm install --frozen-lockfile --ignore-scripts && pnpm store prune
18+
RUN pnpm update-runtime-env
1819

1920
# 3. Copy remaining source files
2021
COPY --chown=default:root index.html vite.config.mjs eslint.config.mjs .prettierrc .env* ./
2122
COPY --chown=default:root ./src ./src
2223

2324
# 4. Perform the build
2425
ARG REACT_APP_SENTRY_RELEASE
25-
26-
RUN yarn build
26+
RUN pnpm build
2727

2828

2929
# ============================================================

package.json

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,33 @@
33
"version": "1.19.5",
44
"license": "MIT",
55
"main": "index.js",
6+
"packageManager": "pnpm@10.28.2",
67
"engines": {
7-
"node": ">=22.13.1"
8+
"node": ">=22.13.1",
9+
"pnpm": ">=10.28.2"
810
},
9-
"packageManager": "yarn@1.22.22",
1011
"scripts": {
1112
"app:version": "echo \"$npm_package_version\"",
12-
"start": "if test $NODE_MAX_MEMORY_MIB ; then node --max-old-space-size=$NODE_MAX_MEMORY_MIB yarn update-runtime-env && vite ; else yarn update-runtime-env && vite ; fi",
13+
"start": "if test $NODE_MAX_MEMORY_MIB ; then node --max-old-space-size=$NODE_MAX_MEMORY_MIB pnpm update-runtime-env && vite ; else pnpm update-runtime-env && vite ; fi",
1314
"build": "vite build",
1415
"serve": "vite preview",
1516
"fetch-plugins": "node deploy/fetch_plugins.js",
1617
"lint": "eslint \"src/**/*.{js,jsx}\"",
1718
"lint:fix": "eslint \"src/**/*.{js,jsx}\" --fix",
1819
"lint:complexity": "eslint -c complexity.eslintrc.js --no-eslintrc src",
19-
"test": "NODE_ENV=test yarn update-runtime-env && vitest",
20-
"test:cov": "yarn test run --coverage --watch=false",
21-
"test:coverage": "yarn test run --coverage --watch=false",
20+
"test": "NODE_ENV=test pnpm update-runtime-env && vitest",
21+
"test:cov": "NODE_ENV=test pnpm update-runtime-env && vitest run --coverage --watch=false",
22+
"test:coverage": "NODE_ENV=test pnpm update-runtime-env && vitest run --coverage --watch=false",
2223
"test:e2e:install": "playwright install",
2324
"test:e2e:ci": "playwright test",
2425
"test:e2e:start": "playwright test",
2526
"test:e2e:record": "playwright codegen https://kerrokantasi.dev.hel.ninja/",
26-
"test:e2e:cov": "node scripts/create-baseline-coverage.mjs && nyc playwright test && yarn test:e2e:cov-report",
27-
"test:e2e:cov-report": "yarn merge-coverage-reports && yarn report-merged-coverage",
27+
"test:e2e:cov": "node scripts/create-baseline-coverage.mjs && nyc playwright test && pnpm run test:e2e:cov-report",
28+
"test:e2e:cov-report": "pnpm run merge-coverage-reports && pnpm run report-merged-coverage",
2829
"merge-coverage-reports": "istanbul-merge --out coverage-temp/coverage-merged.json coverage-temp/baseline-coverage.json coverage/coverage-final.json",
2930
"report-merged-coverage": "nyc report --report-dir=coverage --temp-dir=coverage-temp",
3031
"snyk-protect": "snyk protect",
31-
"postinstall": "if test \"$NODE_ENV\" != \"production\" ; then husky install ; fi && yarn update-runtime-env",
32+
"postinstall": "if test \"$NODE_ENV\" != \"production\" ; then husky install ; fi && pnpm update-runtime-env",
3233
"update-runtime-env": "esrun scripts/update-runtime-env.js"
3334
},
3435
"repository": {
@@ -82,6 +83,7 @@
8283
"html-react-parser": "^5.2.14",
8384
"i18next": "^25.2.0",
8485
"immutability-helper": "^3.1.1",
86+
"immutable": "^3.8.3",
8587
"intl": "^1.2.5",
8688
"leaflet": "^1.9.4",
8789
"leaflet-draw": "^1.0.4",
@@ -114,6 +116,7 @@
114116
"redux-actions": "^2.6.5",
115117
"redux-thunk": "^3.1.0",
116118
"remark-gfm": "^4.0.0",
119+
"reselect": "^5.1.1",
117120
"sass": "^1.89.0",
118121
"simple-git": "^3.32.3",
119122
"updeep": "^1.2.0",
@@ -139,17 +142,19 @@
139142
"redux-mock-store": "^1.5.4",
140143
"vitest-fetch-mock": "^0.4.5"
141144
},
142-
"resolutions": {
143-
"@draft-js-plugins/drag-n-drop/immutable": "3.8.3",
144-
"@draft-js-plugins/editor/immutable": "3.8.3",
145-
"@draft-js-plugins/focus/immutable": "3.8.3",
146-
"@draft-js-plugins/image/immutable": "3.8.3",
147-
"@draft-js-plugins/resizeable/immutable": "3.8.3",
148-
"draft-convert/immutable": "3.8.3",
149-
"draft-js-export-html/immutable": "3.8.3",
150-
"draft-js-utils/immutable": "3.8.3",
151-
"draft-js/immutable": "3.8.3",
152-
"**/@typescript-eslint/typescript-estree/minimatch": "9.0.7"
145+
"pnpm": {
146+
"overrides": {
147+
"@draft-js-plugins/drag-n-drop>immutable": "3.8.3",
148+
"@draft-js-plugins/editor>immutable": "3.8.3",
149+
"@draft-js-plugins/focus>immutable": "3.8.3",
150+
"@draft-js-plugins/image>immutable": "3.8.3",
151+
"@draft-js-plugins/resizeable>immutable": "3.8.3",
152+
"draft-convert>immutable": "3.8.3",
153+
"draft-js-export-html>immutable": "3.8.3",
154+
"draft-js-utils>immutable": "3.8.3",
155+
"draft-js>immutable": "3.8.3",
156+
"@typescript-eslint/typescript-estree>minimatch": "9.0.7"
157+
}
153158
},
154159
"snyk": true
155160
}

0 commit comments

Comments
 (0)