Skip to content

Commit

Permalink
switch to pnpm
Browse files Browse the repository at this point in the history
  • Loading branch information
sndrs committed Dec 12, 2023
1 parent d3a3905 commit dc6ad84
Show file tree
Hide file tree
Showing 49 changed files with 28,717 additions and 32,497 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/amp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
cache: 'pnpm'

- run: yarn install --immutable
- run: pnpm install --frozen-lockfile

- name: Validate AMP
run: make ampValidation
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ar-chromatic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
cache: 'pnpm'

# Root yarn installs all workspaces (root, dotcom)
- run: yarn install --immutable
# Root pnpm installs all workspaces (root, dotcom)
- run: pnpm install --frozen-lockfile

- name: Chromatic - Apps Rendering
env:
Expand All @@ -46,7 +46,7 @@ jobs:
with:
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN__APPS_RENDERING }}
token: ${{ secrets.GITHUB_TOKEN }}
untraced: '**/(package*.json|yarn.lock|preview.js)'
untraced: '**/(package*.json|pnpm-lock.yaml|preview.js)'
exitOnceUploaded: true
onlyChanged: '!(main)' # only turbosnap on non-main branches
workingDir: apps-rendering
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/ar-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,23 @@ jobs:
# Get the desired version of Node installed
- uses: actions/setup-node@v4
with:
cache: yarn
cache: pnpm
node-version-file: .nvmrc

- name: Install dependencies
run: |
yarn --silent --immutable
pnpm install --frozen-lockfile
# Execute some tasks from the `apps-rendering/package.json` file, using `yarn`
# Execute some tasks from the `apps-rendering/package.json` file, using `pnpm`
- name: Build and package
working-directory: apps-rendering
run: |
yarn test
yarn build:client:prod
yarn build:server:prod
yarn copy-manifest
yarn copy-fonts
yarn synth
pnpm test
pnpm build:client:prod
pnpm build:server:prod
pnpm copy-manifest
pnpm copy-fonts
pnpm synth
zip -j dist/server/mobile-apps-rendering.zip dist/server/*
- name: AWS Auth
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/ar-nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,22 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
cache: 'pnpm'

- run: yarn --immutable
- run: pnpm install --frozen-lockfile

- name: lint
run: yarn lint
run: pnpm lint
working-directory: apps-rendering

- name: test
run: yarn test
run: pnpm test
working-directory: apps-rendering

- name: compile client
run: yarn build:client:prod
run: pnpm build:client:prod
working-directory: apps-rendering

- name: compile server
run: yarn build:server:prod
run: pnpm build:server:prod
working-directory: apps-rendering
4 changes: 2 additions & 2 deletions .github/workflows/ar-pr-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
cache: 'pnpm'

- name: install
run: yarn --immutable
run: pnpm install --frozen-lockfile
working-directory: apps-rendering
- name: run
working-directory: apps-rendering
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
cache: 'pnpm'

- run: yarn install --immutable
- run: pnpm install --frozen-lockfile

- name: Generate production build
run: make build
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/bundle-analyser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
cache: 'pnpm'

- run: yarn install --immutable
- run: pnpm install --frozen-lockfile

- name: Generate production build
run: make build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/compress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
cache: 'pnpm'

- uses: preactjs/compressed-size-action@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
cache: 'pnpm'

- name: Add commit hash for PRout
working-directory: dotcom-rendering
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
cache: 'pnpm'

- run: yarn install --immutable
- run: pnpm install --frozen-lockfile

- name: Cypress run
uses: cypress-io/github-action@v6
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/dcr-chromatic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
cache: 'pnpm'

# Root yarn installs all workspaces (root, dotcom)
- run: yarn install --immutable
# Root pnpm installs all workspaces (root, dotcom)
- run: pnpm install --frozen-lockfile

- name: Chromatic - DCR
env:
Expand All @@ -47,6 +47,6 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
autoAcceptChanges: main
onlyChanged: true
untraced: '**/(package*.json|yarn.lock|preview.js)'
untraced: '**/(package*.json|pnpm-lock.yaml|preview.js)'
workingDir: dotcom-rendering
buildScriptName: 'build-storybook'
6 changes: 3 additions & 3 deletions .github/workflows/jest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
cache: 'pnpm'

- run: yarn install --immutable
- run: pnpm install --frozen-lockfile

- name: Run Jest
run: CI=true yarn test
run: CI=true pnpm test
working-directory: dotcom-rendering
4 changes: 2 additions & 2 deletions .github/workflows/lighthouse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
cache: 'pnpm'
# Make sure we install dependencies in the root directory
- run: yarn install --immutable
- run: pnpm install --frozen-lockfile
- run: make build
working-directory: dotcom-rendering
- name: Install and run Lighthouse CI
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
cache: 'pnpm'
- run: make install
working-directory: dotcom-rendering
- name: Lint Project
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
cache: 'pnpm'

- run: yarn install --immutable
- run: pnpm install --frozen-lockfile

- name: Install Playwright Browsers
run: yarn playwright install --with-deps chromium
run: pnpm playwright install --with-deps chromium
working-directory: ./dotcom-rendering

- name: Run Playwright
run: yarn playwright test parallel-${{ matrix.group }}
run: pnpm playwright test parallel-${{ matrix.group }}
working-directory: ./dotcom-rendering

- uses: actions/upload-artifact@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pr-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: 'yarn'
cache: 'pnpm'
# Make sure we install dependencies in the root directory
- run: yarn install --immutable
- run: pnpm install --frozen-lockfile
- run: make build
working-directory: dotcom-rendering
- name: Boot server and run ngrok
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/prettier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
cache: 'pnpm'

- run: yarn install --immutable
- run: pnpm install --frozen-lockfile

- name: Prettier check
run: yarn prettier:check
run: pnpm prettier:check
6 changes: 3 additions & 3 deletions .github/workflows/scheduled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,19 @@ jobs:

- run: corepack enable

# The peer dependencies script relies on `yarn`
# The peer dependencies script relies on `pnpm`
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
cache: 'pnpm'

- name: DCR peer dependencies tracker
run: |
deno run \
--allow-read \
--allow-net \
--allow-env=HOME,GITHUB_TOKEN \
--allow-run=yarn,npm \
--allow-run=pnpm,npm \
scripts/deno/peer-dependencies.ts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/schema-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
cache: 'pnpm'

- run: yarn install --immutable
- run: pnpm install --frozen-lockfile

- name: Run check-schema script
run: make check-schema
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/stories-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
cache: 'pnpm'

- run: yarn install --immutable
- run: pnpm install --frozen-lockfile

- name: Run check-stories script
run: make check-stories
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/typescript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: 'yarn'
cache: 'pnpm'

- run: yarn install --immutable
- run: pnpm install --frozen-lockfile

- name: Check typescript
run: yarn tsc
run: pnpm tsc
working-directory: dotcom-rendering
9 changes: 1 addition & 8 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,7 @@ yarn-error.log*

# Dependency directories
node_modules
.yarn/*

# Things yarn might create that we'd want to check in
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
.yarn

# IDE files
.idea
Expand Down
8 changes: 4 additions & 4 deletions .husky/post-merge
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ RED='\033[0;31m'
ENDCOLOR='\033[0m'

changedFiles="$(git diff-tree -r --name-only --no-commit-id HEAD@{1} HEAD)"
changedLock="$(echo "$changedFiles" | { grep -E 'yarn.lock|package-lock.json' || :; })"
changedLock="$(echo "$changedFiles" | { grep -E 'pnpm-lock.yaml' || :; })"
changedNode="$(echo "$changedFiles" | { grep '.nvmrc' || :; })"

if [[ ! -z $changedLock ]]
then
echo "${RED}This application has new dependencies. Running 'yarn'... ${ENDCOLOR}"
yarn --immutable
echo "${RED}This application has new dependencies. Running 'pnpm'... ${ENDCOLOR}"
pnpm install --frozen-lockfile
fi

if [[ ! -z $changedNode ]]
then
version="$(cat .nvmrc)"
echo "${RED}This project now uses node version "$version". Please use 'nvm use' & run 'yarn'${ENDCOLOR}"
echo "${RED}This project now uses node version "$version". Please use 'nvm use' & run 'pnpm install --frozen-lockfile'${ENDCOLOR}"
fi
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@

. "$(dirname "$0")/_/husky.sh"

yarn lint-staged
pnpm lint-staged
2 changes: 1 addition & 1 deletion .husky/pre-push
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ then
exit 1
fi

yarn workspace @guardian/dotcom-rendering tsc
pnpm --filter @guardian/dotcom-rendering tsc
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
dist
.yarn
deno
.nvmrc

Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json.recommended
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"titleBar.activeBackground": "#648FFF",
"titleBar.activeForeground": "#000000"
},
"jest.jestCommandLine": "yarn workspaces run test",
"jest.jestCommandLine": "pnpm -r run test",
"gitlens.advanced.blame.customArguments": [
"--ignore-revs-file",
".git-blame-ignore-revs"
Expand Down
5 changes: 0 additions & 5 deletions .yarnrc.yml

This file was deleted.

Loading

0 comments on commit dc6ad84

Please sign in to comment.