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: switch to npm #4950

Closed
wants to merge 47 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 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
6c6e295
chore: switch to npm
nolanlawson Nov 26, 2024
608852a
fix: package-lock
nolanlawson Nov 26, 2024
0599865
chore: fix github actions
nolanlawson Nov 26, 2024
b1f11f3
fix: fix more stuff
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
11 changes: 7 additions & 4 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,16 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: '20.18.0'
cache: 'yarn'
cache: 'npm'

- name: Setup npm
run: npm install -g [email protected]

- name: Install dependencies
run: yarn install --frozen-lockfile
run: npm ci

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

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

- name: Setup npm
run: npm install -g [email protected]

# 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 +48,13 @@ jobs:
id: setup-chrome

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

# Pin chromedriver to the same version as Chrome above
- name: Install chromedriver
run: yarn add -W chromedriver@^130
run: npm install --save-dev 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 }} npm run local:prod:ci
- run: CHROME_BINARY=${{ steps.setup-chrome.outputs.chrome-path }} npm run local:dev:ci
99 changes: 57 additions & 42 deletions .github/workflows/karma.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,14 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'yarn'
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'

- name: Setup npm
run: npm install -g [email protected]

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

- uses: saucelabs/sauce-connect-action@v2
Expand All @@ -52,12 +55,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: npm run sauce:ci
- run: DISABLE_SYNTHETIC=1 npm run sauce:ci
- run: LEGACY_BROWSERS=1 npm run sauce:ci
- run: FORCE_NATIVE_SHADOW_MODE_FOR_TEST=1 npm run sauce:ci
- run: DISABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE=1 npm run sauce:ci
- run: DISABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE=1 DISABLE_SYNTHETIC=1 npm run sauce:ci

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

- name: Setup npm
run: npm install -g [email protected]

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

- uses: saucelabs/sauce-connect-action@v2
Expand All @@ -92,12 +98,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 npm run sauce:ci
- run: API_VERSION=58 DISABLE_SYNTHETIC=1 npm run sauce:ci
- run: API_VERSION=59 npm run sauce:ci
- run: API_VERSION=59 DISABLE_SYNTHETIC=1 npm run sauce:ci
- run: API_VERSION=60 npm run sauce:ci
- run: API_VERSION=60 DISABLE_SYNTHETIC=1 npm run sauce:ci

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

- name: Setup npm
run: npm install -g [email protected]

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

- uses: saucelabs/sauce-connect-action@v2
Expand All @@ -132,14 +141,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 npm run sauce:ci
- run: API_VERSION=61 DISABLE_SYNTHETIC=1 npm run sauce:ci
- run: API_VERSION=62 npm run sauce:ci
- run: API_VERSION=62 DISABLE_SYNTHETIC=1 npm run sauce:ci
- run: DISABLE_SYNTHETIC_SHADOW_SUPPORT_IN_COMPILER=1 DISABLE_SYNTHETIC=1 npm run sauce:ci
- run: DISABLE_SYNTHETIC_SHADOW_SUPPORT_IN_COMPILER=1 DISABLE_SYNTHETIC=1 DISABLE_STATIC_CONTENT_OPTIMIZATION=1 npm run sauce:ci
- run: ENABLE_ARIA_REFLECTION_GLOBAL_POLYFILL=1 npm run sauce:ci
- run: ENABLE_ARIA_REFLECTION_GLOBAL_POLYFILL=1 DISABLE_SYNTHETIC=1 npm run sauce:ci

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

- name: Setup npm
run: npm install -g [email protected]

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

- uses: saucelabs/sauce-connect-action@v2
Expand All @@ -174,15 +186,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 npm run sauce:ci
- run: DISABLE_STATIC_CONTENT_OPTIMIZATION=1 DISABLE_SYNTHETIC=1 npm run sauce:ci
- run: NODE_ENV_FOR_TEST=production npm run sauce:ci
- run: NODE_ENV_FOR_TEST=production DISABLE_SYNTHETIC=1 npm run sauce:ci
- run: npm run hydration:sauce:ci
- run: ENABLE_SYNTHETIC_SHADOW_IN_HYDRATION=1 npm run hydration:sauce:ci
- run: NODE_ENV_FOR_TEST=production npm run hydration:sauce:ci
- run: DISABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE=1 npm run hydration:sauce:ci
- run: DISABLE_STATIC_CONTENT_OPTIMIZATION=1 npm run hydration:sauce:ci

- name: Upload coverage results
uses: actions/upload-artifact@v4
Expand All @@ -207,11 +219,14 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'yarn'
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'

- name: Setup npm
run: npm install -g [email protected]

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

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

- run: yarn coverage
- run: npm coverage

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

- name: Setup npm
run: npm install -g [email protected]

# 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 +44,12 @@ jobs:
id: setup-chrome

- name: Install dependencies
run: yarn install --frozen-lockfile
run: npm ci

# 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: npm install --save-dev chromedriver@^130

- name: Check package.json integrity
run: node ./scripts/tasks/check-and-rewrite-package-json.js --test
Expand All @@ -57,25 +60,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: npm prettier --check '{packages,scripts}/**/*.{js,ts,json,md}'
- name: Run linter
run: yarn lint
run: npm run lint
- name: Check the size of the LWC bundle
run: yarn bundlesize
run: npm run bundlesize
- name: Check types
run: yarn test:types
run: npm run test:types
- name: Run unit tests
run: yarn test:ci
run: npm run 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 npm run 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 npm run 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
npm run 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
npm run lint-staged
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: npm run 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: npm run test
# this project runs npm run build after npm install so skip explicit build step
node-build: &node-build
skip: true
node-pre-release-tests:
params:
command: yarn test
command: npm run 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
Loading