Skip to content

Commit 904074f

Browse files
committed
CCM-10981: switch over to pnpm
1 parent c6fdd96 commit 904074f

File tree

30 files changed

+16355
-36560
lines changed

30 files changed

+16355
-36560
lines changed

.github/actions/acceptance-tests/action.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ runs:
3030
- name: "Repo setup"
3131
shell: bash
3232
run: |
33-
npm ci
33+
pnpm run ci
3434
3535
- name: Generate outputs file
3636
shell: bash
3737
run: |
3838
root_dir=${GITHUB_WORKSPACE}
3939
mv ./terraform_output.json ./sandbox_tf_outputs.json
40-
npm run generate-outputs sandbox-output
40+
pnpm run generate-outputs sandbox-output
4141
4242
- name: Run test - ${{ inputs.testType }}
4343
shell: bash

.github/actions/node-modules-cache/action.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: "Node modules cache + setup"
2-
description: "Setup Node, restore node_modules cache, and optionally run npm ci on cache miss"
2+
description: "Setup Node, restore node_modules cache, and optionally run pnpm install on cache miss"
33
inputs:
44
node_version:
55
description: "Node.js version"
@@ -15,7 +15,7 @@ runs:
1515
uses: actions/setup-node@v4
1616
with:
1717
node-version: "${{ inputs.node_version }}"
18-
cache: "npm"
18+
cache: "pnpm"
1919
cache-dependency-path: "${{ inputs.cache_lock_path }}"
2020
- name: "Restore node_modules from cache"
2121
id: node-modules-cache
@@ -31,4 +31,4 @@ runs:
3131
if: steps.node-modules-cache.outputs.cache-hit != 'true'
3232
shell: bash
3333
run: |
34-
npm ci
34+
pnpm install

.github/dependabot.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ updates:
1212
schedule:
1313
interval: "daily"
1414

15-
- package-ecosystem: "npm"
15+
- package-ecosystem: "pnpm"
1616
directory: "/"
1717
schedule:
1818
interval: "daily"

.github/workflows/pr_closed.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ jobs:
8585
- name: check if local version differs from latest published version
8686
id: check-version
8787
run: |
88-
published_version=$(npm view @nhsdigital/nhs-notify-event-schemas-template-management --json 2>/dev/null | jq -r '.["dist-tags"].latest // "null"')
88+
published_version=$(pnpm view @nhsdigital/nhs-notify-event-schemas-template-management --json 2>/dev/null | jq -r '.["dist-tags"].latest // "null"')
8989
echo "Published version: $published_version"
9090
9191
local_version=$(jq -r '.version' packages/event-schemas/package.json)
@@ -119,9 +119,9 @@ jobs:
119119
registry-url: 'https://npm.pkg.github.com'
120120

121121
- name: Install dependencies
122-
run: npm ci
122+
run: pnpm install
123123

124124
- name: Publish to GitHub Packages
125-
run: npm publish --workspace packages/event-schemas
125+
run: pnpm publish --workspace packages/event-schemas
126126
env:
127127
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/stage-1-commit.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,10 +249,10 @@ jobs:
249249
uses: actions/checkout@v4
250250

251251
- name: Install dependencies
252-
run: npm ci
252+
run: pnpm install
253253

254254
- name: Re-generate schemas
255-
run: npm --workspace packages/event-schemas run generate-json-schemas
255+
run: pnpm --filter ./packages/event-schemas run generate-json-schemas
256256

257257
- name: Check for schema changes
258258
run: git diff --quiet packages/event-schemas/schemas

.github/workflows/stage-2-test.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
node_version: "${{ inputs.nodejs_version }}"
6868
- name: "Generate dependencies"
6969
run: |
70-
npm run generate-dependencies --workspaces --if-present
70+
pnpm run generate-dependencies
7171
git diff --exit-code
7272
7373
test-unit:
@@ -84,7 +84,7 @@ jobs:
8484
node_version: "${{ inputs.nodejs_version }}"
8585
- name: "Generate dependencies"
8686
run: |
87-
npm run generate-dependencies --workspaces --if-present
87+
pnpm run generate-dependencies
8888
- name: "Run unit test suite"
8989
run: |
9090
make test-unit
@@ -116,7 +116,7 @@ jobs:
116116
node_version: "${{ inputs.nodejs_version }}"
117117
- name: "Generate dependencies"
118118
run: |
119-
npm run generate-dependencies --workspaces --if-present
119+
pnpm run generate-dependencies
120120
- name: "Run linting"
121121
run: |
122122
make test-lint
@@ -135,7 +135,7 @@ jobs:
135135
node_version: "${{ inputs.nodejs_version }}"
136136
- name: "Generate dependencies"
137137
run: |
138-
npm run generate-dependencies --workspaces --if-present
138+
pnpm run generate-dependencies
139139
- name: "Run typecheck"
140140
run: |
141141
make test-typecheck

.npmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
prefer-workspace-packages=true
2+
link-workspace-packages=true

.tool-versions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ act 0.2.64
22
gitleaks 8.24.0
33
jq 1.6
44
nodejs 20.18.2
5+
pnpm 10.10.0
56
pre-commit 3.6.0
67
terraform 1.10.1
78
terraform-docs 0.19.0

frontend/jest.config.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/* eslint-disable import/no-relative-packages */
2-
31
import type { Config } from 'jest';
42
import nextJest from 'next/jest.js';
53
import { pathsToModuleNameMapper } from 'ts-jest';

frontend/package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"@types/react-dom": "^19.0.4",
3636
"constructs": "^10.4.2",
3737
"eslint-config-next": "^15.4.6",
38+
"jest": "^29.7.0",
3839
"jest-mock-extended": "^3.0.7",
3940
"js-cookie": "^3.0.5",
4041
"mochawesome": "^7.1.3",
@@ -51,19 +52,19 @@
5152
"name": "nhs-notify-web-template-management-frontend",
5253
"private": true,
5354
"scripts": {
54-
"app:start": "pm2 start npm -- start",
55+
"app:start": "pm2 start pnpm -- start",
5556
"app:stop": "pm2 kill",
5657
"app:wait": "wait-on -l http://localhost:3000/templates/create-and-submit-templates",
5758
"build": "next build",
5859
"create-sandbox": "pm2 start npx -- ampx sandbox",
5960
"destroy-sandbox": "npx ampx sandbox delete --y",
6061
"dev": "next dev",
61-
"lint": "npm run mock-amplify-outputs && next lint --dir .",
62-
"lint:fix": "npm run lint -- --fix",
62+
"lint": "pnpm mock-amplify-outputs && next lint --dir .",
63+
"lint:fix": "pnpm lint -- --fix",
6364
"mock-amplify-outputs": "if [ ! -f ./amplify_outputs.json ]; then echo \"{}\" > ./amplify_outputs.json ; fi",
6465
"start": "next start",
65-
"test:unit": "npm run mock-amplify-outputs && jest",
66-
"typecheck": "npm run mock-amplify-outputs && tsc --noEmit"
66+
"test:unit": "pnpm mock-amplify-outputs && jest",
67+
"typecheck": "pnpm mock-amplify-outputs && tsc --noEmit"
6768
},
6869
"version": "0.1.0"
6970
}

0 commit comments

Comments
 (0)