Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: migration from npm to pnpm #4537

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// "forwardPorts": [],

// Use 'updateContentCommand ' to run commands when the prebuild is created or updated https://docs.github.com/en/codespaces/prebuilding-your-codespaces/configuring-prebuilds#configuring-time-consuming-tasks-to-be-included-in-the-prebuild
"onCreateCommand": "CI=true bash -c 'npm ci && npm run build'"
"onCreateCommand": "CI=true bash -c 'pnpm i && pnpm run build'"

// Configure tool-specific properties.
// "customizations": {},
Expand Down
13 changes: 0 additions & 13 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,6 @@ module.exports = {
sourceType: 'module',
},
overrides: [
{
files: ['**/package-lock.json'],
parser: 'eslint-plugin-json-es',
plugins: ['package-lock'],
rules: {
'package-lock/lock-file-version': [
'error',
{
version: 3,
},
],
},
},
{
// Note: *.md files are directly checked using cspell cli in lint-staged
files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx', '**/*.mjs'],
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ runs:
path: .nx/cache
key: nx-${{ github.sha }}-${{ inputs.cache-suffix }}
- if: steps.nx-cache.outputs.cache-hit != 'true'
run: npm run build
run: pnpm run build
shell: bash
2 changes: 1 addition & 1 deletion .github/actions/cdn-checks/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ runs:
cache-suffix: 'cdn'
env:
DEPLOYMENT_ENVIRONMENT: CDN
- run: npm run build
- run: pnpm run build
env:
DEPLOYMENT_ENVIRONMENT: CDN
shell: bash
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/e2e-atomic-angular/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ runs:
name: Run Cypress
with:
browser: chrome
command-prefix: 'npx -w @coveo/atomic-angular-samples cypress-repeat run -n 3 --until-passes --rerun-failed-only --'
start: npx nx run atomic-angular-samples:dev
command-prefix: 'pnpm --filter @coveo/atomic-angular-samples exec cypress-repeat run -n 3 --until-passes --rerun-failed-only --'
start: pnpm nx run atomic-angular-samples:dev
wait-on: 'http://localhost:4200'
# Wait up to 10min for the Angular Server to spool up.
wait-on-timeout: 600000
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/e2e-atomic-csp/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ runs:
steps:
- name: Complementary setup
run: |
npm ci
npm run build -w=@coveo/atomic
pnpm i
pnpm --filter @coveo/atomic run build
shell: bash
- name: Run tests
# TODO KIT-3105
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/e2e-atomic-insight-panel/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ runs:
name: Run Cypress
with:
browser: chrome
command-prefix: 'npx -w @coveo/atomic cypress-repeat run -n 3 --until-passes --rerun-failed-only --'
command-prefix: 'pnpm --filter @coveo/atomic exec cypress-repeat run -n 3 --until-passes --rerun-failed-only --'
config-file: cypress-insight-panel.config.mjs
start: npm start -w @coveo/atomic
start: pnpm --filter @coveo/atomic run start
wait-on: 'http://localhost:3333/ping'
wait-on-timeout: 600000
install: false
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/e2e-atomic-next/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ runs:
name: Run Cypress
with:
browser: chrome
command-prefix: 'npx -w @coveo/atomic-next-samples cypress-repeat run -n 3 --until-passes --rerun-failed-only --'
start: npx nx run atomic-next-samples:dev
command-prefix: 'pnpm --filter @coveo/atomic-next-samples exec cypress-repeat run -n 3 --until-passes --rerun-failed-only --'
start: pnpm nx run atomic-next-samples:dev
wait-on: 'http://localhost:3000'
wait-on-timeout: 600000
install: false
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/e2e-atomic-react/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ runs:
name: Run Cypress
with:
browser: chrome
command-prefix: 'npx -w @coveo/atomic-react-samples cypress-repeat run -n 3 --until-passes --rerun-failed-only --'
start: npx nx run atomic-react-samples:dev
command-prefix: 'pnpm --filter @coveo/atomic-react-samples exec cypress-repeat run -n 3 --until-passes --rerun-failed-only --'
start: pnpm nx run atomic-react-samples:dev
wait-on: 'http://localhost:3000'
wait-on-timeout: 600000
install: false
Expand Down
7 changes: 4 additions & 3 deletions .github/actions/e2e-atomic-screenshots/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@ inputs:
runs:
using: composite
steps:
- run: npx cypress install
- run: pnpm cypress install
shell: bash
- uses: cypress-io/github-action@v5
name: Run Cypress
with:
browser: chrome
command-prefix: 'npx -w @coveo/atomic cypress-repeat run -n 3 --until-passes --rerun-failed-only --'
command-prefix: 'pnpm exec cypress-repeat run -n 3 --until-passes --rerun-failed-only --'
working-directory: packages/atomic
config-file: cypress-screenshots.config.mjs
start: npm start -w @coveo/atomic
start: pnpm --filter @coveo/atomic run start
wait-on: 'http://localhost:3333/ping'
wait-on-timeout: 600000
install: false
Expand Down
7 changes: 4 additions & 3 deletions .github/actions/e2e-atomic/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,16 @@ inputs:
runs:
using: composite
steps:
- run: npx cypress install
- run: pnpm cypress install
shell: bash
- uses: cypress-io/github-action@v5
name: Run Cypress
with:
browser: chrome
command-prefix: 'npx -w @coveo/atomic cypress-repeat run -n 3 --until-passes --rerun-failed-only --'
command-prefix: 'pnpm exec cypress-repeat run -n 3 --until-passes --rerun-failed-only --'
working-directory: packages/atomic
spec: ${{ inputs.spec }}
start: npm start -w @coveo/atomic
start: pnpm --filter @coveo/atomic start
wait-on: 'http://localhost:3333/ping'
wait-on-timeout: 600000
install: false
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/e2e-headless-ssr-app-dev/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ runs:
name: Run Cypress
with:
browser: chrome
command-prefix: 'npm run -w @coveo/headless-ssr-samples-app-router e2e'
start: npx nx run headless-ssr-samples-app-router:dev
command-prefix: 'pnpm --filter @coveo/atomic exec cypress-repeat run -n 3 --until-passes --rerun-failed-only --'
start: pnpm nx run headless-ssr-samples-app-router:dev
wait-on: 'http://localhost:3000'
wait-on-timeout: 600000
install: false
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/e2e-headless-ssr-app-prod/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ runs:
name: Run Cypress
with:
browser: chrome
command-prefix: 'npm run -w @coveo/headless-ssr-samples-app-router e2e'
start: npx nx run headless-ssr-samples-app-router:prod
command-prefix: 'pnpm --filter @coveo/headless-ssr-samples-app-router run e2e'
start: pnpm nx run headless-ssr-samples-app-router:prod
wait-on: 'http://localhost:3000'
wait-on-timeout: 600000
install: false
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/e2e-headless-ssr-pages-dev/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ runs:
name: Run Cypress
with:
browser: chrome
command-prefix: 'npm run -w @coveo/headless-ssr-samples-pages-router e2e'
start: npx nx run headless-ssr-samples-pages-router:dev
command-prefix: 'pnpm --filter @coveo/headless-ssr-samples-pages-router run e2e'
start: pnpm nx run headless-ssr-samples-pages-router:dev
wait-on: 'http://localhost:3000'
wait-on-timeout: 600000
install: false
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/e2e-headless-ssr-pages-prod/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ runs:
name: Run Cypress
with:
browser: chrome
command-prefix: 'npm run -w @coveo/headless-ssr-samples-pages-router e2e'
start: npx nx run headless-ssr-samples-pages-router:prod
command-prefix: 'pnpm --filter @coveo/headless-ssr-samples-pages-router run e2e'
start: pnpm nx run headless-ssr-samples-pages-router:prod
wait-on: 'http://localhost:3000'
wait-on-timeout: 600000
install: false
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/e2e-iife/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ runs:
name: Run Cypress
with:
browser: chrome
command-prefix: 'npx -w @coveo/iife-samples cypress-repeat run -n 3 --until-passes --rerun-failed-only --'
start: npx nx run iife-samples:prod
command-prefix: 'pnpm --filter @coveo/iife-samples exec cypress-repeat run -n 3 --until-passes --rerun-failed-only --'
start: pnpm nx run iife-samples:prod
wait-on: 'http://localhost:3000'
wait-on-timeout: 600000
install: false
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/e2e-quantic-setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ inputs:
runs:
using: composite
steps:
- run: npx nx run quantic:build
- run: pnpm nx run quantic:build
shell: bash
- run: |
echo "${{ inputs.jwtkey }}" > server.key
npx --no-install ts-node scripts/build/deploy-community.ts --ci
pnpm exec --no-install ts-node scripts/build/deploy-community.ts --ci
rm server.key
shell: bash
working-directory: ./packages/quantic
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/e2e-quantic/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ runs:
with:
path: packages/quantic/cypress/plugins/config
key: quantic-cypress-config-${{ github.sha }}
- run: npx cypress install
- run: pnpm cypress install
shell: bash
- uses: cypress-io/github-action@v5
name: Run Cypress
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/e2e-stencil/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ runs:
name: Run Cypress
with:
browser: chrome
command-prefix: 'npx -w @coveo/atomic-stencil-samples cypress-repeat run -n 3 --until-passes --rerun-failed-only --'
start: npx nx run atomic-stencil-samples:dev
command-prefix: 'pnpm --filter @coveo/atomic-stencil-samples exec cypress-repeat run -n 3 --until-passes --rerun-failed-only --'
start: pnpm nx run atomic-stencil-samples:dev
wait-on: 'http://localhost:3666'
wait-on-timeout: 600000
install: false
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/e2e-vuejs/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ runs:
# name: Run Cypress
# with:
# browser: chrome
# command-prefix: 'npx -w @coveo/atomic-vuejs-samples cypress-repeat run -n 3 --until-passes --rerun-failed-only --'
# start: npx nx run atomic-vuejs-samples:dev
# command-prefix: 'pnpm --filter @coveo/atomic-vuejs-samples exec cypress-repeat run -n 3 --until-passes --rerun-failed-only --'
# start: pnpm nx run atomic-vuejs-samples:dev
# wait-on: 'http://[::1]:5173'
# wait-on-timeout: 600000
# install: false
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/merge-playwright-reports/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ runs:
pattern: blob-report-*
merge-multiple: true
- name: Merge into JSON Report
run: npx playwright merge-reports --reporter html ./all-blob-reports
run: pnpm playwright merge-reports --reporter html ./all-blob-reports
working-directory: packages/atomic
shell: bash

Expand Down
4 changes: 2 additions & 2 deletions .github/actions/playwright-atomic-hosted-pages/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ runs:
using: composite
steps:
- name: Install Playwright Browsers
run: npx playwright install --with-deps
run: pnpm playwright install --with-deps
working-directory: packages/atomic-hosted-page
shell: bash
- name: Run Playwright tests
run: npx playwright test
run: pnpm playwright test
working-directory: packages/atomic-hosted-page
shell: bash
- uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/playwright-atomic/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ runs:
using: composite
steps:
- name: Install Playwright Browsers
run: npx playwright install --with-deps
run: pnpm playwright install --with-deps
working-directory: packages/atomic
shell: bash
- name: Run Playwright tests
run: npx playwright test ${{ inputs.testsToRun }} --shard=${{ inputs.shardIndex }}/${{ inputs.shardTotal }}
run: pnpm playwright test ${{ inputs.testsToRun }} --shard=${{ inputs.shardIndex }}/${{ inputs.shardTotal }}
working-directory: packages/atomic
shell: bash
- uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ runs:
using: composite
steps:
- name: Install Playwright Browsers
run: npx playwright install --with-deps
run: pnpm playwright install --with-deps
working-directory: packages/samples/headless-commerce-react
shell: bash
- name: Run Playwright tests
run: npx playwright test
run: pnpm playwright test
working-directory: packages/samples/headless-commerce-react
shell: bash
2 changes: 1 addition & 1 deletion .github/actions/setup-sfdx/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ runs:
using: composite
steps:
- shell: bash
run: npm i -g @salesforce/cli@2.27.6
run: pnpm i -g @salesforce/cli@2.27.6
14 changes: 7 additions & 7 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,34 +19,34 @@ runs:
- name: Ensure Nx cache can be shared between different CI environments # Source: https://nx.dev/recipes/troubleshooting/unknown-local-cache
run: echo "NX_REJECT_UNKNOWN_LOCAL_CACHE=0" >> $GITHUB_ENV
shell: bash
- name: Install npm
run: npm i -g npm@10
- name: Enable Corepack (installs pnpm)
shell: bash
run: corepack enable
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4
id: npm-cache
with:
path: |
**/node_modules/
!.nx/cache/
key: npm-${{ hashFiles('package-lock.json', 'patches/*') }}
key: npm-${{ hashFiles('pnpm-lock.yml', 'patches/*') }}
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4
with:
path: packages/quantic/force-app/main/default/staticresources
key: quantic-${{ hashFiles('package-lock.json') }}}}
key: quantic-${{ hashFiles('pnpm-lock.json') }}}}
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4
with:
path: ~/.cache/Cypress
key: cy-${{ hashFiles('package-lock.json') }}
key: cy-${{ hashFiles('pnpm-lock.json') }}
- if: inputs.load-cache == 'true'
uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4
id: nx-cache
with:
path: .nx/cache
key: nx-${{ github.sha }}-${{ inputs.cache-suffix }}
- if: steps.npm-cache.outputs.cache-hit != 'true'
run: npm ci
run: pnpm i
shell: bash
# TODO KIT-3483: Move to artifact
# - if: steps.nx-cache.outputs.cache-hit != 'true'
- run: npm run build
- run: pnpm run build
shell: bash
2 changes: 1 addition & 1 deletion .github/workflows/create-quantic-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
working-directory: ./packages/quantic
run: |
echo "${{ secrets.SFDX_AUTH_JWT_KEY }}" > ${{ vars.SFDX_AUTH_JWT_KEY_FILE }}
npx --no-install ts-node scripts/build/create-package.ts --remove-translations --ci
pnpm exec --no-install ts-node scripts/build/create-package.ts --remove-translations --ci
rm ${{ vars.SFDX_AUTH_JWT_KEY_FILE }}
env:
SFDX_AUTH_JWT_USERNAME: ${{ vars.SFDX_AUTH_JWT_USERNAME }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-quantic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@ jobs:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- uses: ./.github/actions/setup
- uses: ./.github/actions/setup-sfdx
- run: npx --no-install ts-node packages/quantic/scripts/build/delete-org.ts
- run: pnpm --no-install ts-node packages/quantic/scripts/build/delete-org.ts
shell: bash
13 changes: 6 additions & 7 deletions .github/workflows/masterbot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,15 @@ jobs:
with:
registry-url: 'https://registry.npmjs.org'
node-version-file: '.nvmrc'
- name: Install npm
run: npm i -g npm@10
shell: bash
- run: npm ci
- name: Install pnpm
uses: pnpm/action-setup@v4
- run: pnpm i
shell: bash
- name: Release
run: |
npm run nx:graph
npm run release:phase1
npm run release:phase2
pnpm run nx:graph
pnpm run release:phase1
pnpm run release:phase2
env:
DEBUG: '*'
IS_PRERELEASE: 'true'
21 changes: 0 additions & 21 deletions .github/workflows/package-lock-root-fail.yml

This file was deleted.

Loading
Loading