Skip to content

feat: migrate frontend to pnpm#9172

Merged
kevin9foong merged 31 commits intofeat/migrate-npm-to-pnpmfrom
feat/migrate-frontend-to-pnpm
Mar 4, 2026
Merged

feat: migrate frontend to pnpm#9172
kevin9foong merged 31 commits intofeat/migrate-npm-to-pnpmfrom
feat/migrate-frontend-to-pnpm

Conversation

@scottheng96
Copy link
Copy Markdown
Contributor

Problem

Part of the work moving FormSG to monorepo structure

Closes FRM-2309

Solution

  1. Followed steps to migrate from npm to pnpm
  2. Updated github/ci deployment scripts
  3. Resolved dependencies

Breaking Changes

  • No - this PR is backwards compatible

@scottheng96 scottheng96 requested a review from a team as a code owner March 3, 2026 08:45
@linear
Copy link
Copy Markdown

linear Bot commented Mar 3, 2026

@scottheng96 scottheng96 changed the base branch from develop to feat/migrate-npm-to-pnpm March 3, 2026 08:46
id="emails"
isRequired
isInvalid={staticTagInputErrorMessage}
isInvalid={!!staticTagInputErrorMessage}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Image

@datadog-opengovsg
Copy link
Copy Markdown

datadog-opengovsg Bot commented Mar 3, 2026

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 225ebe4 | Docs | Was this helpful? Give us feedback!

@kevin9foong
Copy link
Copy Markdown
Contributor

kevin9foong commented Mar 3, 2026

issue: could we explore why The CLI tried to run your build-storybook script is failing? its triggering for the downstreams as well

Comment thread .github/workflows/chromatic.yml Outdated
skip: dependabot/**
# Only run when the react-email-preview directory has changes
untraced: '!(react-email-preview)/**'
# untraced: '!(react-email-preview)/**'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

question: is this supposed to be commented out?

Comment thread .github/workflows/ci.yml Outdated
key: ${{ runner.OS }}-node-modules-${{ hashFiles('**/package-lock.json', '**/pnpm-lock.yaml') }}
fail-on-cache-miss: true
- run: npm run lint:frontend
- run: pnpm lint-ci
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

issue: seems like lint-ci is meant to lint the backend src/ directory. is pnpm lint:frontend expected instead?

Comment thread frontend/package.json Outdated
"@chakra-ui/anatomy": "^2.3.4",
"@chakra-ui/checkbox": "^2.3.2",
"@chakra-ui/form-control": "^2.2.0",
"@chakra-ui/hooks": "^2.4.2",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

info: btw, we can check what version we were using by searching in the old package.json. This here enforces a version bump for some of these dependencies, which we may not want to do to reduce risk this change.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

for example, we were using

    "node_modules/@chakra-ui/hooks": {
      "version": "2.2.1",

Comment thread package.json
"prepare": "husky",
"pre-commit": "lint-staged",
"storybook": "npm run --prefix frontend storybook",
"postinstall:frontend": "npm --prefix frontend install --legacy-peer-deps",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

question: just for my understanding, how does pnpm resolve peer deps differently?

Comment thread .github/workflows/chromatic.yml Outdated
- name: Install BE dependencies
working-directory: src
run: npm i
# - name: Install BE dependencies
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

issue: uncomment this

Comment thread frontend/package.json Outdated
"@chakra-ui/checkbox": "^2.3.2",
"@chakra-ui/form-control": "^2.2.0",
"@chakra-ui/hooks": "^2.2.1",
"@chakra-ui/layout": "^2.1.0",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

should be 2.3.1

@kevin9foong kevin9foong force-pushed the feat/migrate-frontend-to-pnpm branch from f2485ff to d6b61a4 Compare March 4, 2026 07:57
@kevin9foong
Copy link
Copy Markdown
Contributor

lgtm!

@kevin9foong kevin9foong merged commit 8e65bfc into feat/migrate-npm-to-pnpm Mar 4, 2026
21 of 24 checks passed
@kevin9foong kevin9foong deleted the feat/migrate-frontend-to-pnpm branch March 4, 2026 09:24
kevin9foong added a commit that referenced this pull request Mar 5, 2026
* feat: migrate shared to pnpm (#9163)

* feat: migrate shared to pnpm

* feat: update ci to support pnpm

* feat: install eslint in shared

* feat: update ci scripts to install pnpm, remove pnpm caching

* feat: update chromatic script with pnpm

* feat: use common env for pnpm and npm and pin to specific

* Merge pull request #9162 from opengovsg/feat/migrate-serverless-virus-scanner-to-pnpm

feat: migrate serverless virus scanner to pnpm

* feat: migrate backend to pnpm (#9164)

* feat: migrate backend to pnpm

* feat: use pnpm in ci scripts

* feat: install missing deps and fix typing

* feat: add pnpm installation to ci jobs

* feat: update playwright and ci

* feat: use pnpm for build

* feat: create shared pnpm base

* feat: use shared env version

* feat: remove ebs files (#9170)

* feat: remove ebextensions

* feat: remove dockerrun used for ebs

* feat: migrate serverless pdf lambda to pnpm (#9167)

* feat: migrate pdf lambda from npm to pnpm

* feat: replace ci yml scripts and build.sh to use pnpm

* chore: remove --frozen-lockfile

* feat: updated deploy-pdf-gen-lambda.yml to standardised pnpm steps

* feat: updated ci.yml to pnpm for pdf-gen

* feat: updated package.json root builds with pnpm for pdf-gen

* feat: replace pnpm ci with pnpm install

* feat: split build and deploy

* chore: replace strategy matrix, updated README/md

* feat: updated ci.yml pdf gen to use env.PNPM_VERSION

* feat: updated deploy-pdf-gen-lambda to use pnpm run sam-deploy and pnpm sam-build

* feat: updated quickstart.md

* feat: add -p to build-dist.sh

* fix: ci script typo

* feat: migrate payments recon to pnpm (#9174)

* feat: update payments recon documentation

* chore: update staging to stg, added stg-alt3

* feat: remove npmrc

* feat: update translation.md

* feat: update root package json engine

* feat: update playwright to build webserver using pnpm

* feat: remove stale puppeteer

* fix(frontend): hardcode success style extension

* feat: migrate frontend to pnpm (#9172)

* feat: migrated package-lock.json to pnpm-lock.yaml

* feat: updated package.json to pnpm commands & added built dependencies

* feat: added phantom dependencies directly into frontend/package.json, resolved build issues

* feat: updated root package.json

* feat: updated readme, quickstart & missed package.json

* chore: remove legacy-peer-deps

* feat: updated ci.yml file

* feat: added install pnpm to frontend_lint & _test in ci.yml

* feat: updated Dockerfile production to copy pnpm-lock.yaml:

* chore: replace all pnpm run with pnpm

* feat: updated Dockerfile

* feat: updated chromatic.yml

* chore: remove cache, updated emailpreview in chromatic.yml to install pnpm

* chore: remove untraced to explicitly run react-email-preview

* fix: remove BE dependency installed from chromatic.yml

* feat: replace package-lock.json with pnpm-lock.yaml for react-eail-preview

* feat: add microtime to built dependencies for package.json frontend

* fix: addressed comments

* fix: updated package versions to match package-lock.json

* feat: update pnpm lock

* fix: uncommented testing code

* fix: email be dep working dir

* fix: lint errors

* feat: migrate react-email-preview to pnpm

* fix: bummp react-rotuer version

* fix: updated layout package.json

* fix: ran pnpm install for frontend

* feat: move ignore built deps to package.json

* fix: frontend lint

* feat: update readme

* feat: update comments and readme to use pnpm

---------

Co-authored-by: Kevin Foong <55353265+kevin9foong@users.noreply.github.com>
Co-authored-by: Eliot Lim <eliot@open.gov.sg>

---------

Co-authored-by: scottheng96 <44297674+scottheng96@users.noreply.github.com>
Co-authored-by: Eliot Lim <eliot@open.gov.sg>
kevin9foong added a commit that referenced this pull request Mar 5, 2026
* feat: monorepo phase 1 - migrate npm to pnpm (#9166)

* feat: migrate shared to pnpm (#9163)

* feat: migrate shared to pnpm

* feat: update ci to support pnpm

* feat: install eslint in shared

* feat: update ci scripts to install pnpm, remove pnpm caching

* feat: update chromatic script with pnpm

* feat: use common env for pnpm and npm and pin to specific

* Merge pull request #9162 from opengovsg/feat/migrate-serverless-virus-scanner-to-pnpm

feat: migrate serverless virus scanner to pnpm

* feat: migrate backend to pnpm (#9164)

* feat: migrate backend to pnpm

* feat: use pnpm in ci scripts

* feat: install missing deps and fix typing

* feat: add pnpm installation to ci jobs

* feat: update playwright and ci

* feat: use pnpm for build

* feat: create shared pnpm base

* feat: use shared env version

* feat: remove ebs files (#9170)

* feat: remove ebextensions

* feat: remove dockerrun used for ebs

* feat: migrate serverless pdf lambda to pnpm (#9167)

* feat: migrate pdf lambda from npm to pnpm

* feat: replace ci yml scripts and build.sh to use pnpm

* chore: remove --frozen-lockfile

* feat: updated deploy-pdf-gen-lambda.yml to standardised pnpm steps

* feat: updated ci.yml to pnpm for pdf-gen

* feat: updated package.json root builds with pnpm for pdf-gen

* feat: replace pnpm ci with pnpm install

* feat: split build and deploy

* chore: replace strategy matrix, updated README/md

* feat: updated ci.yml pdf gen to use env.PNPM_VERSION

* feat: updated deploy-pdf-gen-lambda to use pnpm run sam-deploy and pnpm sam-build

* feat: updated quickstart.md

* feat: add -p to build-dist.sh

* fix: ci script typo

* feat: migrate payments recon to pnpm (#9174)

* feat: update payments recon documentation

* chore: update staging to stg, added stg-alt3

* feat: remove npmrc

* feat: update translation.md

* feat: update root package json engine

* feat: update playwright to build webserver using pnpm

* feat: remove stale puppeteer

* fix(frontend): hardcode success style extension

* feat: migrate frontend to pnpm (#9172)

* feat: migrated package-lock.json to pnpm-lock.yaml

* feat: updated package.json to pnpm commands & added built dependencies

* feat: added phantom dependencies directly into frontend/package.json, resolved build issues

* feat: updated root package.json

* feat: updated readme, quickstart & missed package.json

* chore: remove legacy-peer-deps

* feat: updated ci.yml file

* feat: added install pnpm to frontend_lint & _test in ci.yml

* feat: updated Dockerfile production to copy pnpm-lock.yaml:

* chore: replace all pnpm run with pnpm

* feat: updated Dockerfile

* feat: updated chromatic.yml

* chore: remove cache, updated emailpreview in chromatic.yml to install pnpm

* chore: remove untraced to explicitly run react-email-preview

* fix: remove BE dependency installed from chromatic.yml

* feat: replace package-lock.json with pnpm-lock.yaml for react-eail-preview

* feat: add microtime to built dependencies for package.json frontend

* fix: addressed comments

* fix: updated package versions to match package-lock.json

* feat: update pnpm lock

* fix: uncommented testing code

* fix: email be dep working dir

* fix: lint errors

* feat: migrate react-email-preview to pnpm

* fix: bummp react-rotuer version

* fix: updated layout package.json

* fix: ran pnpm install for frontend

* feat: move ignore built deps to package.json

* fix: frontend lint

* feat: update readme

* feat: update comments and readme to use pnpm

---------

Co-authored-by: Kevin Foong <55353265+kevin9foong@users.noreply.github.com>
Co-authored-by: Eliot Lim <eliot@open.gov.sg>

---------

Co-authored-by: scottheng96 <44297674+scottheng96@users.noreply.github.com>
Co-authored-by: Eliot Lim <eliot@open.gov.sg>

* chore: bump version to v6.312.0

---------

Co-authored-by: scottheng96 <44297674+scottheng96@users.noreply.github.com>
Co-authored-by: Eliot Lim <eliot@open.gov.sg>
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