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

Closed
wants to merge 43 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 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
99f25df
fix: use shamefully-hoist
cardoso Nov 25, 2024
f67de1a
fix: revert changes in generate-license-files.js
cardoso Nov 25, 2024
cd90e44
fix: use public-hoist-pattern
cardoso Nov 25, 2024
2cc3519
Merge branch 'master' of https://github.com/salesforce/lwc into pnpm
cardoso Nov 25, 2024
2cc206d
fix: remove unneeded change
cardoso Nov 25, 2024
6408ad9
chore: update integration-karma README.md
cardoso Nov 25, 2024
7f66ae5
Merge branch 'master' of https://github.com/salesforce/lwc into pnpm
cardoso Nov 25, 2024
0c802b9
Merge branch 'master' into pnpm
cardoso Nov 25, 2024
7856a30
chore: add comment to .npmrc
cardoso Nov 25, 2024
36bc724
chore: pin with volta in sub-dirs where we execute stuff
nolanlawson Nov 25, 2024
304be5e
fix: unpin got version
cardoso Nov 25, 2024
9411269
Revert "chore: pin with volta in sub-dirs where we execute stuff"
nolanlawson Nov 26, 2024
9705a91
chore: fix github actions
nolanlawson Nov 26, 2024
bee52c2
chore: do it DRYer
nolanlawson Nov 26, 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
12 changes: 8 additions & 4 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,21 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
with:
version: 9.14.2

- name: Setup Node
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
14 changes: 9 additions & 5 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,15 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
with:
version: 9.14.2

- name: Setup Node
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 +49,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
101 changes: 61 additions & 40 deletions .github/workflows/karma.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ env:
GITHUB_RUN_ID: ${{github.run_id}}
COVERAGE: '1'
NODE_VERSION: '20.18.0'
PNPM_VERSION: '9.14.2'

jobs:
run-karma-tests-group-1:
Expand All @@ -36,14 +37,18 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}

- name: Setup Node
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 +57,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 @@ -76,14 +81,18 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}

- name: Setup Node
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 +101,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 @@ -116,14 +125,18 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}

- name: Setup Node
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 +145,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 @@ -158,14 +171,18 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}

- name: Setup Node
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 +191,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 @@ -204,14 +221,18 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}

- name: Setup Node
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 +256,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
24 changes: 14 additions & 10 deletions .github/workflows/unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,15 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
with:
version: 9.14.2

- name: Setup Node
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 +45,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 +61,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
4 changes: 3 additions & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
registry=https://registry.yarnpkg.com/
registry=https://registry.npmjs.org/
# Hoist all deps to the top level: https://pnpm.io/npmrc#public-hoist-pattern
public-hoist-pattern[]=*
cardoso marked this conversation as resolved.
Show resolved Hide resolved
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
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ public/
types/

.rollup.cache
pnpm-lock.yaml

__benchmarks_results__/

Expand Down
Loading