Skip to content

Commit 10a7174

Browse files
authored
feat: migrate yarn classic to pnpm HCRC-195 (#263)
* feat: migrate yarn classic to pnpm Refs: HCRC-195
1 parent dfd6608 commit 10a7174

14 files changed

Lines changed: 17819 additions & 13788 deletions

File tree

.github/workflows/CI.yml

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

1010
jobs:
1111
common:
12-
uses: City-of-Helsinki/.github/.github/workflows/ci-node.yml@main
13-
secrets: inherit
12+
uses: City-of-Helsinki/.github/.github/workflows/ci-pnpm-node.yml@main
13+
secrets:
14+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
1415
with:
15-
node-version: 22
16+
node-version: 24.x

.github/workflows/release-please.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,19 @@ jobs:
2727
build-stable:
2828
needs: release-please
2929
if: ${{ needs.release-please.outputs.release_created }}
30-
uses: City-of-Helsinki/.github/.github/workflows/ci-node.yml@main
30+
uses: City-of-Helsinki/.github/.github/workflows/ci-pnpm-node.yml@main
3131
secrets: inherit
3232
with:
33-
node-version: '22'
34-
upload_artifacts: true
35-
skip_sonar: true
36-
33+
node-version: '24'
34+
upload-artifacts: true
35+
skip-sonar: true
36+
3737
publish:
3838
needs: build-stable
3939
secrets: inherit
4040
uses: City-of-Helsinki/.github/.github/workflows/ci-npm-publish.yml@main
4141
with:
42-
node-version: '22'
42+
node-version: '24'
4343
use-ci-build: true
4444

4545
# 3. CANARY RELEASE FLOW (Runs on every push to main, EXCLUDING schedule)
@@ -48,12 +48,12 @@ jobs:
4848
build-canary:
4949
# This conditional ensures it runs ONLY when the workflow was triggered by a commit push.
5050
if: github.event_name == 'push'
51-
uses: City-of-Helsinki/.github/.github/workflows/ci-node.yml@main
51+
uses: City-of-Helsinki/.github/.github/workflows/ci-pnpm-node.yml@main
5252
secrets: inherit
5353
with:
54-
node-version: '22'
55-
upload_artifacts: true
56-
skip_sonar: true
54+
node-version: '24'
55+
upload-artifacts: true
56+
skip-sonar: true
5757

5858
publish-npm-canary:
5959
# This conditional is redundant but good practice; it will only run if its dependency runs.
@@ -62,6 +62,6 @@ jobs:
6262
secrets: inherit
6363
uses: City-of-Helsinki/.github/.github/workflows/ci-npm-publish.yml@main
6464
with:
65-
node-version: '22'
65+
node-version: '24'
6666
use-ci-build: true
6767
canary: true

.husky/pre-commit

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
yarn doctoc . -u
2-
yarn lint-staged --relative
1+
pnpm exec doctoc . -u
2+
pnpm exec lint-staged --relative

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v22.14.0
1+
v24.0.0

Dockerfile

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,32 @@
11
# ===============================================
2-
FROM registry.access.redhat.com/ubi9/nodejs-22 AS appbase
2+
FROM helsinki.azurecr.io/ubi9/nodejs-24-pnpm-builder-base AS appbase
33
# ===============================================
44

55
# Set environment
66
ARG PORT=3000
7-
ENV PORT $PORT
7+
ENV PORT=$PORT
88

99
WORKDIR /app
1010

11-
# Install yarn
12-
USER root
13-
RUN curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | tee /etc/yum.repos.d/yarn.repo && \
14-
yum -y install yarn
15-
16-
# Yarn version
17-
ENV YARN_VERSION 1.22.22
18-
RUN yarn policies set-version ${YARN_VERSION}
19-
20-
2111
# Set npm log verbosity level
22-
ENV NPM_CONFIG_LOGLEVEL warn
12+
ENV NPM_CONFIG_LOGLEVEL=warn
2313

2414
# Global npm dependencies in a non-root user directory
2515
ENV NPM_CONFIG_PREFIX=/app/.npm-global
2616
ENV PATH=$PATH:/app/.npm-global/bin
2717

2818
# Set NODE_ENV to development in the development container
2919
ARG NODE_ENV=development
30-
ENV NODE_ENV $NODE_ENV
20+
ENV NODE_ENV=$NODE_ENV
3121

32-
# Copy package.json and yarn.lock files
33-
COPY --chown=default:root package*.json *yarn* ./
22+
# Copy package.json and pnpm-lock.yaml files
23+
COPY --chown=default:root package*.json pnpm-lock.yaml ./
3424

3525
# Make scripts in dependencies available through path
36-
ENV PATH /app/node_modules/.bin:$PATH
26+
ENV PATH=/app/node_modules/.bin:$PATH
3727

3828
# Install dependencies including storybook addons
39-
RUN yarn && yarn cache clean
29+
RUN pnpm install --frozen-lockfile --ignore-scripts && pnpm store prune
4030

4131
# =============================
4232
FROM appbase AS development
@@ -46,29 +36,29 @@ FROM appbase AS development
4636
COPY --chown=default:root . .
4737

4838
# Start command for development
49-
CMD ["yarn", "dev:no-open"]
39+
CMD ["pnpm", "run", "dev:no-open"]
5040

5141
# =============================
5242
FROM appbase AS staticbuilder
5343
# =============================
5444

5545
# Set NODE_ENV to production for build
5646
ARG NODE_ENV=production
57-
ENV NODE_ENV $NODE_ENV
47+
ENV NODE_ENV=$NODE_ENV
5848

5949
# Copy all files, including .mdx stories
6050
COPY --chown=default:root . .
6151

6252
# Build Storybook
63-
RUN yarn build-storybook --loglevel error
53+
RUN pnpm run build-storybook --loglevel error
6454

6555
# =============================
6656
FROM appbase AS production
6757
# =============================
6858

6959
# Set NODE_ENV to production in the production container
7060
ARG NODE_ENV=production
71-
ENV NODE_ENV $NODE_ENV
61+
ENV NODE_ENV=$NODE_ENV
7262

7363
# Copy build folder
7464
COPY --from=staticbuilder --chown=default:root /app/storybook-static/ /app/storybook-static/

0 commit comments

Comments
 (0)