Skip to content

feat: migrate yarn classic to pnpm HCRC-195#263

Merged
Riippi merged 10 commits into
mainfrom
feat/HCRC-195-pnpm
Jun 8, 2026
Merged

feat: migrate yarn classic to pnpm HCRC-195#263
Riippi merged 10 commits into
mainfrom
feat/HCRC-195-pnpm

Conversation

@Riippi

@Riippi Riippi commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Refs: HCRC-195

Description

HCRC-195:

Summary by CodeRabbit

  • Chores

    • Upgraded Node runtime to 24 and standardized pnpm across CI, Docker, scripts, and workflows
    • Updated CI/release steps and explicit SONAR token forwarding
    • Added workspace security rules and dependency overrides; bumped mock service worker version
  • Documentation

    • Updated README and publishing instructions to use pnpm
  • Style

    • Adjusted lint config and added a small inline lint suppression in a UI component

@Riippi Riippi marked this pull request as ready for review June 3, 2026 07:30
@Riippi Riippi requested a review from a team as a code owner June 3, 2026 07:30
Comment thread package.json
Comment thread package.json Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Migrates the repository’s tooling from Yarn Classic to pnpm, including Node version alignment, CI workflow updates, and documentation/script adjustments to support the new package manager across local dev and release flows.

Changes:

  • Switch package manager to pnpm (scripts, lockfile usage, workspace-level overrides) and update Node baseline to 24 in CI and local tooling.
  • Update Docker build to use a pnpm-capable base image and pnpm install flow.
  • Refresh developer documentation and small lint/type-system adjustments to accommodate tooling changes.

Reviewed changes

Copilot reviewed 12 out of 14 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
src/core/pageModules/CardsModule/Icon.tsx Adds an eslint disable directive for a new lint rule affecting the lazy icon component.
src/core/configProvider/defaultConfig.tsx Adjusts TS typing pattern for defaultConfig to use satisfies Config without as const.
README.md Updates install/dev commands and release documentation for pnpm; adjusts section headings/TOC.
public/mockServiceWorker.js Bumps MSW worker PACKAGE_VERSION.
pnpm-workspace.yaml Introduces pnpm configuration (overrides, supply-chain hardening, build allowlist).
package.json Declares pnpm as package manager, updates entry points to dist/, updates scripts and deps for pnpm/Node 24 tooling.
eslint.config.mjs Switches TS parser reference to typescript-eslint’s exported parser.
Dockerfile Moves from Yarn-based install to pnpm-based install using a pnpm builder base image.
.nvmrc Updates local Node version to v24.0.0.
.husky/pre-commit Switches pre-commit commands from yarn to pnpm exec.
.github/workflows/release-please.yml Updates reusable workflows to pnpm-based CI and Node 24.
.github/workflows/CI.yml Updates reusable workflow to pnpm-based CI and Node 24 with SONAR token wiring.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread public/mockServiceWorker.js
@Riippi

Riippi commented Jun 4, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 4, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Jun 4, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 91583b03-35ae-4c27-834a-f4492d24c5b8

📥 Commits

Reviewing files that changed from the base of the PR and between 793b452 and 91a24fb.

📒 Files selected for processing (1)
  • README.md
💤 Files with no reviewable changes (1)
  • README.md

📝 Walkthrough

Walkthrough

This PR migrates the repo from Yarn/Node 22 to pnpm/Node 24: manifest and workspace updates, CI and release workflows switched to pnpm reusable workflows, Docker and dev hooks moved to pnpm, README updated, and small ESLint/type/code tweaks applied.

Changes

Node.js 24 and pnpm Migration

Layer / File(s) Summary
Package configuration and workspace setup
package.json, pnpm-workspace.yaml, .nvmrc, public/mockServiceWorker.js
package.json switched to pnpm/packageManager and dist/ entrypoints; scripts and lint-staged use pnpm; engines relocated; resolutions removed; devDependencies adjusted and new dev deps added. pnpm-workspace.yaml added with minimumReleaseAge, overrides, and allowBuilds. .nvmrc updated to v24.0.0. Mock service worker PACKAGE_VERSION bumped.
CI/CD workflow updates
.github/workflows/CI.yml, .github/workflows/release-please.yml
CI reusable workflow calls updated to ci-pnpm-node.yml with explicit SONAR_TOKEN and Node 24/24.x; release-please stable and canary build jobs use ci-pnpm-node.yml, new input keys (upload-artifacts/skip-sonar), and canary publish node-version set to 24.
Development tooling and Docker
.husky/pre-commit, Dockerfile
Husky pre-commit commands run via pnpm exec. Dockerfile base image and builder stages switched to a Node 24 pnpm builder, ENV usage standardized, dependencies installed with pnpm install --frozen-lockfile --ignore-scripts, pnpm store prune run, and dev/build/run commands use pnpm equivalents.
Documentation and scripts update
README.md
README updated to standardize on pnpm for installation, scripts, dev commands, Husky instructions, Storybook commands, dependency linking guidance, portals section adjusted/removed, and manual release/publish instructions switched to pnpm.
ESLint and small code tweaks
eslint.config.mjs, src/core/configProvider/defaultConfig.tsx, src/core/pageModules/CardsModule/Icon.tsx
ESLint parser switched to tseslint.parser. defaultConfig removed as const before satisfies Config. Icon component gains an inline eslint-disable for react-hooks/static-components.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 I swapped my yarn for pnpm's neat tune,

Node twenty‑four hums bright by the moon,
Workflows and Docker now purr in new light,
Docs and scripts sing pnpm day and night,
The workspace hops forward — tidy and soon!

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is largely incomplete. While it references the JIRA ticket HCRC-195, it lacks substantive detail about the changes, testing, and implementation approach. Add a detailed description of the migration work, explain the key changes made, and document any testing performed or manual verification steps taken.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the primary change: migrating from Yarn Classic to pnpm, with the relevant ticket reference HCRC-195.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/HCRC-195-pnpm

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/CI.yml:
- Line 12: Replace mutable reusable-workflow refs that use `@main` with immutable
commit SHAs: update the reference string
"City-of-Helsinki/.github/.github/workflows/ci-pnpm-node.yml@main" in CI.yml to
the specific commit SHA for that workflow, and do the same for the other
workflows that reference ci-pnpm-node.yml@main and ci-npm-publish.yml@main
(e.g., in release-please.yml); ensure each "uses:" entry points to the exact
commit SHA rather than the branch name so the CI runs a fixed, auditable
workflow version.

In @.github/workflows/release-please.yml:
- Line 30: The workflow uses for reusable workflows are pinned to the mutable
ref `@main` which is non-reproducible; replace each uses entry referencing
City-of-Helsinki/.github/.github/workflows/ci-pnpm-node.yml@main and
City-of-Helsinki/.github/.github/workflows/ci-npm-publish.yml@main with an
immutable commit SHA (e.g., @<commit-sha>) so runs are reproducible and
supply-chain safe—update both occurrences in release-please.yml (the two
ci-pnpm-node.yml and ci-npm-publish.yml entries) and the ci-pnpm-node.yml
reference in CI.yml to the chosen commit SHAs and commit the updated workflow
files.

In `@Dockerfile`:
- Line 2: The Dockerfile uses a mutable image tag for the builder stage ("FROM
helsinki.azurecr.io/ubi9/nodejs-24-pnpm-builder-base AS appbase"); replace this
with an immutable digest-pinned reference for reproducible builds by resolving
the current image's sha256 digest (e.g., pull the image and obtain its
RepoDigest) and update the FROM line to use the registry@sha256:<digest> form
while keeping the AS appbase stage name unchanged.

In `@README.md`:
- Line 421: Replace the broken sentence "Some of the built packages created with
`pnpm build` does some issues with some types." in the README with a
grammatically correct version; for example: "Some packages built with `pnpm
build` can have issues with exported types, which may cause consuming
applications to be unable to read certain exports (especially enums)..." —
update the text around the `pnpm build` bullet to use this clearer wording and
keep the existing link to the Rollup issue.
- Around line 414-416: Remove the stray Apollo guidance sentence that was
accidentally appended to the Windows publishing note in README.md: delete the
clause starting "An Apollo client linked to a graphql endpoint with a supported
schema (headless CMS) must be provided in the `apolloClient` field of the
`config` object." so the publishing note about Windows and Docker stands alone;
also scan nearby lines in README.md for any other leftover Apollo-client text
and remove or move it to the correct section if intended.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 07f6c06b-ff68-4216-899f-15a26781b1ab

📥 Commits

Reviewing files that changed from the base of the PR and between dfd6608 and daa9191.

⛔ Files ignored due to path filters (2)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (12)
  • .github/workflows/CI.yml
  • .github/workflows/release-please.yml
  • .husky/pre-commit
  • .nvmrc
  • Dockerfile
  • README.md
  • eslint.config.mjs
  • package.json
  • pnpm-workspace.yaml
  • public/mockServiceWorker.js
  • src/core/configProvider/defaultConfig.tsx
  • src/core/pageModules/CardsModule/Icon.tsx

Comment thread .github/workflows/CI.yml
Comment thread .github/workflows/release-please.yml
Comment thread Dockerfile
Comment thread README.md Outdated
Comment thread README.md Outdated
Refs: HCRC-195

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
README.md (2)

401-401: 💤 Low value

Capitalize "React" as a proper noun.

The phrase "react context" should be "React context" since React is a proper noun (the library name).

✨ Suggested fix
-- Jest has difficulties loading this library. When this library is required in a test file, it's possible that some imports are cjs and some are esm. These two variants do not share a react context which can result in `useConfig` calls that return an empty config object even though `<ConfigProvider>` is declared correctly. I.e. `<ConfigProvider>` sets values for `context1` and `useConfig` reads `context2`.
+- Jest has difficulties loading this library. When this library is required in a test file, it's possible that some imports are cjs and some are esm. These two variants do not share a React context which can result in `useConfig` calls that return an empty config object even though `<ConfigProvider>` is declared correctly. I.e. `<ConfigProvider>` sets values for `context1` and `useConfig` reads `context2`.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@README.md` at line 401, Update the README text so the library name is
capitalized: change the phrase "react context" to "React context" in the
sentence that describes mismatched CJS/ESM contexts (the line referencing
`<ConfigProvider>` and `useConfig`) to correctly treat React as a proper noun;
ensure any other occurrences of "react" in this paragraph are also capitalized
to "React".

397-397: 💤 Low value

Polish the Windows publishing note grammar.

Minor phrasing issue: "using Windows environment" should be "in a Windows environment" or "on Windows".

✨ Suggested polish
-**Note:** There is a known issue with publishing using Windows environment. If you are using Windows, use a Docker container to publish the package.
+**Note:** There is a known issue with publishing in a Windows environment. If you are using Windows, use a Docker container to publish the package.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@README.md` at line 397, The sentence "There is a known issue with publishing
using Windows environment." is grammatically awkward; update the README sentence
to use correct preposition and polish phrasing (e.g., "There is a known issue
with publishing in a Windows environment" or "There is a known issue with
publishing on Windows") and keep the recommendation ("If you are using Windows,
use a Docker container to publish the package.") consistent and concise so the
two lines read smoothly together.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@README.md`:
- Line 29: The table of contents contains an orphaned entry "Automated package
smoke test" that has no matching section in the document; either remove that TOC
line or add a corresponding section header "## Automated package smoke test"
with the content for the test steps. Update the README.md TOC to delete the "-
[Automated package smoke test](`#automated-package-smoke-test`)" entry if you
don't intend to add the section, or create the section body (heading and
descriptive content) so the link resolves correctly.

---

Nitpick comments:
In `@README.md`:
- Line 401: Update the README text so the library name is capitalized: change
the phrase "react context" to "React context" in the sentence that describes
mismatched CJS/ESM contexts (the line referencing `<ConfigProvider>` and
`useConfig`) to correctly treat React as a proper noun; ensure any other
occurrences of "react" in this paragraph are also capitalized to "React".
- Line 397: The sentence "There is a known issue with publishing using Windows
environment." is grammatically awkward; update the README sentence to use
correct preposition and polish phrasing (e.g., "There is a known issue with
publishing in a Windows environment" or "There is a known issue with publishing
on Windows") and keep the recommendation ("If you are using Windows, use a
Docker container to publish the package.") consistent and concise so the two
lines read smoothly together.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: fde150ba-8cf0-4854-9060-93d96fbac8dc

📥 Commits

Reviewing files that changed from the base of the PR and between daa9191 and 793b452.

📒 Files selected for processing (1)
  • README.md

Comment thread README.md Outdated
@sonarqubecloud

sonarqubecloud Bot commented Jun 5, 2026

Copy link
Copy Markdown

@Riippi Riippi merged commit 10a7174 into main Jun 8, 2026
7 checks passed
@Riippi Riippi deleted the feat/HCRC-195-pnpm branch June 8, 2026 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants