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: migrate from yarn to pnpm #4897

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
5134ddc
chore: migrate public packages to pnpm
cardoso Nov 20, 2024
a4c624b
chore: replace yarn with pnpm in scripts
cardoso Nov 20, 2024
bcf6544
chore: migrate perf-benchmark-components to pnpm
cardoso Nov 20, 2024
7856b08
fix: type and module resolution in tests
cardoso Nov 20, 2024
0b6ca4a
fix: karma tests
cardoso Nov 20, 2024
ee30eab
fix: integration-tests
cardoso Nov 20, 2024
3a31dc4
fix: generate-license-files
cardoso Nov 20, 2024
e2a255d
chore: use pnpm workspace protocol
cardoso Nov 21, 2024
724449a
chore: remove vite-tsconfig-paths
cardoso Nov 21, 2024
577c896
fix: type errors in test
cardoso Nov 21, 2024
a938e90
fix: release:version
cardoso Nov 21, 2024
25c3772
fix: run pnpm audit --fix
cardoso Nov 21, 2024
826c112
fix: type resolution in test files
cardoso Nov 21, 2024
afa6925
fix: revert type change
cardoso Nov 21, 2024
0f17ab2
fix: migrate all usages and mentions of yarn to pnpm
cardoso Nov 21, 2024
9e736f0
fix: integration-tests
cardoso Nov 21, 2024
5ab58d6
Merge branch 'master' of https://github.com/salesforce/lwc into pnpm
cardoso Nov 21, 2024
a32cfcc
Merge branch 'master' of https://github.com/salesforce/lwc into pnpm
cardoso Nov 21, 2024
a45d383
chore: revert license script to js
cardoso Nov 21, 2024
e25143b
fix: revert more unneeded changes
cardoso Nov 21, 2024
122832d
fix(perf-benchmarks): support both yarn and pnpm
cardoso Nov 21, 2024
850c264
fix: test:performance
cardoso Nov 21, 2024
eeb147e
Merge branch 'master' of https://github.com/salesforce/lwc into pnpm
cardoso Nov 22, 2024
ce0bd90
fix: rollup build
cardoso Nov 22, 2024
f602082
fix: add pnpm-lock.yaml to .prettierignore
cardoso Nov 22, 2024
6916891
chore: add instructions for Volta+pnpm
nolanlawson Nov 22, 2024
e846524
chore: fix github ci
nolanlawson Nov 22, 2024
189522b
chore: sort overrides
nolanlawson Nov 22, 2024
c8e5fbb
fix: yarn vs pnpm in benchmark script
nolanlawson Nov 22, 2024
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
8 changes: 4 additions & 4 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: '20.18.0'
cache: 'yarn'
cache: 'pnpm'

- name: Install dependencies
run: yarn install --frozen-lockfile
run: pnpm install --frozen-lockfile

- name: Build benchmarks
run: yarn build:performance
run: pnpm build:performance

- name: Run benchmarks
run: yarn test:performance:best:ci
run: pnpm test:performance:best:ci
10 changes: 5 additions & 5 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: '20.18.0'
cache: 'yarn'
cache: 'pnpm'

# Needed for local browser integration tests
# chrome-version documentation can be found here: https://github.com/browser-actions/setup-chrome?tab=readme-ov-file#usage
Expand All @@ -45,13 +45,13 @@ jobs:
id: setup-chrome

- name: Install dependencies
run: yarn install --frozen-lockfile
run: pnpm install --frozen-lockfile
working-directory: ./

# Pin chromedriver to the same version as Chrome above
- name: Install chromedriver
run: yarn add -W chromedriver@^130
run: pnpm add -w chromedriver@^130
working-directory: ./

- run: CHROME_BINARY=${{ steps.setup-chrome.outputs.chrome-path }} yarn local:prod:ci
- run: CHROME_BINARY=${{ steps.setup-chrome.outputs.chrome-path }} yarn local:dev:ci
- run: CHROME_BINARY=${{ steps.setup-chrome.outputs.chrome-path }} pnpm local:prod:ci
- run: CHROME_BINARY=${{ steps.setup-chrome.outputs.chrome-path }} pnpm local:dev:ci
80 changes: 40 additions & 40 deletions .github/workflows/karma.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'yarn'
cache: 'pnpm'

- name: Install dependencies
run: yarn install --frozen-lockfile
run: pnpm install --frozen-lockfile
working-directory: ./

- uses: saucelabs/sauce-connect-action@v2
Expand All @@ -52,12 +52,12 @@ jobs:
accessKey: ${{ secrets.SAUCE_ACCESS_KEY }}
tunnelName: ${{ env.SAUCE_TUNNEL_ID }}

- run: yarn sauce:ci
- run: DISABLE_SYNTHETIC=1 yarn sauce:ci
- run: LEGACY_BROWSERS=1 yarn sauce:ci
- run: FORCE_NATIVE_SHADOW_MODE_FOR_TEST=1 yarn sauce:ci
- run: DISABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE=1 yarn sauce:ci
- run: DISABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE=1 DISABLE_SYNTHETIC=1 yarn sauce:ci
- run: pnpm sauce:ci
- run: DISABLE_SYNTHETIC=1 pnpm sauce:ci
- run: LEGACY_BROWSERS=1 pnpm sauce:ci
- run: FORCE_NATIVE_SHADOW_MODE_FOR_TEST=1 pnpm sauce:ci
- run: DISABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE=1 pnpm sauce:ci
- run: DISABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE=1 DISABLE_SYNTHETIC=1 pnpm sauce:ci

- name: Upload coverage results
uses: actions/upload-artifact@v4
Expand All @@ -80,10 +80,10 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'yarn'
cache: 'pnpm'

- name: Install dependencies
run: yarn install --frozen-lockfile
run: pnpm install --frozen-lockfile
working-directory: ./

- uses: saucelabs/sauce-connect-action@v2
Expand All @@ -92,12 +92,12 @@ jobs:
accessKey: ${{ secrets.SAUCE_ACCESS_KEY }}
tunnelName: ${{ env.SAUCE_TUNNEL_ID }}

- run: API_VERSION=58 yarn sauce:ci
- run: API_VERSION=58 DISABLE_SYNTHETIC=1 yarn sauce:ci
- run: API_VERSION=59 yarn sauce:ci
- run: API_VERSION=59 DISABLE_SYNTHETIC=1 yarn sauce:ci
- run: API_VERSION=60 yarn sauce:ci
- run: API_VERSION=60 DISABLE_SYNTHETIC=1 yarn sauce:ci
- run: API_VERSION=58 pnpm sauce:ci
- run: API_VERSION=58 DISABLE_SYNTHETIC=1 pnpm sauce:ci
- run: API_VERSION=59 pnpm sauce:ci
- run: API_VERSION=59 DISABLE_SYNTHETIC=1 pnpm sauce:ci
- run: API_VERSION=60 pnpm sauce:ci
- run: API_VERSION=60 DISABLE_SYNTHETIC=1 pnpm sauce:ci

- name: Upload coverage results
uses: actions/upload-artifact@v4
Expand All @@ -120,10 +120,10 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'yarn'
cache: 'pnpm'

- name: Install dependencies
run: yarn install --frozen-lockfile
run: pnpm install --frozen-lockfile
working-directory: ./

- uses: saucelabs/sauce-connect-action@v2
Expand All @@ -132,14 +132,14 @@ jobs:
accessKey: ${{ secrets.SAUCE_ACCESS_KEY }}
tunnelName: ${{ env.SAUCE_TUNNEL_ID }}

- run: API_VERSION=61 yarn sauce:ci
- run: API_VERSION=61 DISABLE_SYNTHETIC=1 yarn sauce:ci
- run: API_VERSION=62 yarn sauce:ci
- run: API_VERSION=62 DISABLE_SYNTHETIC=1 yarn sauce:ci
- run: DISABLE_SYNTHETIC_SHADOW_SUPPORT_IN_COMPILER=1 DISABLE_SYNTHETIC=1 yarn sauce:ci
- run: DISABLE_SYNTHETIC_SHADOW_SUPPORT_IN_COMPILER=1 DISABLE_SYNTHETIC=1 DISABLE_STATIC_CONTENT_OPTIMIZATION=1 yarn sauce:ci
- run: ENABLE_ARIA_REFLECTION_GLOBAL_POLYFILL=1 yarn sauce:ci
- run: ENABLE_ARIA_REFLECTION_GLOBAL_POLYFILL=1 DISABLE_SYNTHETIC=1 yarn sauce:ci
- run: API_VERSION=61 pnpm sauce:ci
- run: API_VERSION=61 DISABLE_SYNTHETIC=1 pnpm sauce:ci
- run: API_VERSION=62 pnpm sauce:ci
- run: API_VERSION=62 DISABLE_SYNTHETIC=1 pnpm sauce:ci
- run: DISABLE_SYNTHETIC_SHADOW_SUPPORT_IN_COMPILER=1 DISABLE_SYNTHETIC=1 pnpm sauce:ci
- run: DISABLE_SYNTHETIC_SHADOW_SUPPORT_IN_COMPILER=1 DISABLE_SYNTHETIC=1 DISABLE_STATIC_CONTENT_OPTIMIZATION=1 pnpm sauce:ci
- run: ENABLE_ARIA_REFLECTION_GLOBAL_POLYFILL=1 pnpm sauce:ci
- run: ENABLE_ARIA_REFLECTION_GLOBAL_POLYFILL=1 DISABLE_SYNTHETIC=1 pnpm sauce:ci

- name: Upload coverage results
uses: actions/upload-artifact@v4
Expand All @@ -162,10 +162,10 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'yarn'
cache: 'pnpm'

- name: Install dependencies
run: yarn install --frozen-lockfile
run: pnpm install --frozen-lockfile
working-directory: ./

- uses: saucelabs/sauce-connect-action@v2
Expand All @@ -174,15 +174,15 @@ jobs:
accessKey: ${{ secrets.SAUCE_ACCESS_KEY }}
tunnelName: ${{ env.SAUCE_TUNNEL_ID }}

- run: DISABLE_STATIC_CONTENT_OPTIMIZATION=1 yarn sauce:ci
- run: DISABLE_STATIC_CONTENT_OPTIMIZATION=1 DISABLE_SYNTHETIC=1 yarn sauce:ci
- run: NODE_ENV_FOR_TEST=production yarn sauce:ci
- run: NODE_ENV_FOR_TEST=production DISABLE_SYNTHETIC=1 yarn sauce:ci
- run: yarn hydration:sauce:ci
- run: ENABLE_SYNTHETIC_SHADOW_IN_HYDRATION=1 yarn hydration:sauce:ci
- run: NODE_ENV_FOR_TEST=production yarn hydration:sauce:ci
- run: DISABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE=1 yarn hydration:sauce:ci
- run: DISABLE_STATIC_CONTENT_OPTIMIZATION=1 yarn hydration:sauce:ci
- run: DISABLE_STATIC_CONTENT_OPTIMIZATION=1 pnpm sauce:ci
- run: DISABLE_STATIC_CONTENT_OPTIMIZATION=1 DISABLE_SYNTHETIC=1 pnpm sauce:ci
- run: NODE_ENV_FOR_TEST=production pnpm sauce:ci
- run: NODE_ENV_FOR_TEST=production DISABLE_SYNTHETIC=1 pnpm sauce:ci
- run: pnpm hydration:sauce:ci
- run: ENABLE_SYNTHETIC_SHADOW_IN_HYDRATION=1 pnpm hydration:sauce:ci
- run: NODE_ENV_FOR_TEST=production pnpm hydration:sauce:ci
- run: DISABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE=1 pnpm hydration:sauce:ci
- run: DISABLE_STATIC_CONTENT_OPTIMIZATION=1 pnpm hydration:sauce:ci

- name: Upload coverage results
uses: actions/upload-artifact@v4
Expand All @@ -208,10 +208,10 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'yarn'
cache: 'pnpm'

- name: Install dependencies
run: yarn install --frozen-lockfile
run: pnpm install --frozen-lockfile
working-directory: ./

- name: Download coverage results - group 1
Expand All @@ -235,7 +235,7 @@ jobs:
name: coverage-report-group-4
path: ./packages/@lwc/integration-karma/coverage

- run: yarn coverage
- run: pnpm coverage

- name: Upload combined coverage
uses: actions/upload-artifact@v4
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: '20.18.0'
cache: 'yarn'
cache: 'pnpm'

# Needed for perf smoke tests, matches the chromedriver version installed by tachometer (https://github.com/google/tachometer/blob/main/README.md#on-demand-dependencies)
# chrome-version documentation can be found here: https://github.com/browser-actions/setup-chrome?tab=readme-ov-file#usage
Expand All @@ -41,12 +41,12 @@ jobs:
id: setup-chrome

- name: Install dependencies
run: yarn install --frozen-lockfile
run: pnpm install --frozen-lockfile

# Pin chromedriver to the same version as Chrome above, so Tachometer uses this version.
# See: https://github.com/google/tachometer#on-demand-dependencies
- name: Install chromedriver
run: yarn add -W chromedriver@^130
run: pnpm add -w chromedriver@^130

- name: Check package.json integrity
run: node ./scripts/tasks/check-and-rewrite-package-json.js --test
Expand All @@ -57,25 +57,25 @@ jobs:
- name: Verify that dependencies are declared
run: node ./scripts/tasks/check-imports-are-declared-dependencies.js
- name: Check formatting
run: yarn prettier --check '{packages,scripts}/**/*.{js,ts,json,md}'
run: pnpm prettier --check '{packages,scripts}/**/*.{js,ts,json,md}'
- name: Run linter
run: yarn lint
run: pnpm lint
- name: Check the size of the LWC bundle
run: yarn bundlesize
run: pnpm bundlesize
- name: Check types
run: yarn test:types
run: pnpm test:types
- name: Run unit tests
run: yarn test:ci
run: pnpm test:ci
# TODO [#4815]: enable all SSR v2 tests
- name: Run experimental SSR fixture tests
run: TEST_SSR_COMPILER=1 yarn test packages/@lwc/ssr-compiler/src/__tests__/fixtures.spec.ts
run: TEST_SSR_COMPILER=1 pnpm test packages/@lwc/ssr-compiler/src/__tests__/fixtures.spec.ts
- name: Upload unit test coverage report
uses: actions/upload-artifact@v4
with:
name: test-coverage-report
path: coverage/
- name: Run benchmark smoke tests
run: CHROME_BINARY=${{ steps.setup-chrome.outputs.chrome-path }} BENCHMARK_SMOKE_TEST=1 yarn test:performance
run: CHROME_BINARY=${{ steps.setup-chrome.outputs.chrome-path }} BENCHMARK_SMOKE_TEST=1 pnpm test:performance
- name: Add step summary
# 1. Remove leading/trailing "border" lines from output
# 2. Wrap file names in backticks
Expand Down
2 changes: 1 addition & 1 deletion .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1 +1 @@
yarn commitlint --edit $1
pnpm commitlint --edit $1
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
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
@@ -1,5 +1,5 @@
set -e
node ./scripts/tasks/check-and-rewrite-package-json.js --test
node ./scripts/tasks/generate-license-files.js --test
node ./scripts/tasks/generate-license-files.mjs --test
node ./scripts/tasks/verify-treeshakable.js ./packages/@lwc/shared/dist/index.js
node ./scripts/tasks/check-imports-are-declared-dependencies.js
2 changes: 1 addition & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
registry=https://registry.yarnpkg.com/
registry=https://registry.npmjs.org/
10 changes: 5 additions & 5 deletions .nucleus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,20 @@ jobs:
steps:
node-conformance:
run:
command: yarn run lint
command: pnpm lint
after: node-build
node-unit-tests:
run:
command: yarn test
# this project runs yarn build after yarn install so skip explicit build step
command: pnpm test
# this project runs pnpm build after pnpm install so skip explicit build step
node-build: &node-build
skip: true
node-pre-release-tests:
params:
command: yarn test
command: pnpm test
npm-configure:
params:
registry-url: https://registry.yarnpkg.com
registry-url: https://registry.npmjs.org
npm-configure-for-publish:
params:
registry-url: https://registry.npmjs.org
Expand Down
Loading