diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index ad1804bfc5..d905231103 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,7 +1,7 @@ * @element-hq/element-web-reviewers /.github/workflows/** @element-hq/element-web-team /package.json @element-hq/element-web-team -/yarn.lock @element-hq/element-web-team +/pnpm-lock.yaml @element-hq/element-web-team /src/SecurityManager.ts @element-hq/element-crypto-web-reviewers /test/SecurityManager-test.ts @element-hq/element-crypto-web-reviewers diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5d863a6a32..cb69bf88f2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -44,16 +44,14 @@ jobs: steps: - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 + - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4 - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6 with: # Disable cache on Windows as it is slower than not caching # https://github.com/actions/setup-node/issues/975 - cache: ${{ runner.os != 'Windows' && 'yarn' || '' }} + cache: ${{ runner.os != 'Windows' && 'pnpm' || '' }} node-version: "lts/*" - # Workaround for yarn install timeouts, especially on Windows - - run: yarn config set network-timeout 300000 - - name: Fetch layered build run: ./scripts/layered.sh @@ -63,7 +61,7 @@ jobs: - name: Build env: CI_PACKAGE: true - run: VERSION=$(scripts/get-version-from-git.sh) yarn build + run: VERSION=$(scripts/get-version-from-git.sh) pnpm build - name: Upload Artifact uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6 diff --git a/.github/workflows/build_develop.yml b/.github/workflows/build_develop.yml index 72ebd40d25..cb943f05cf 100644 --- a/.github/workflows/build_develop.yml +++ b/.github/workflows/build_develop.yml @@ -28,9 +28,10 @@ jobs: steps: - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 + - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4 - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6 with: - cache: "yarn" + cache: "pnpm" node-version: "lts/*" - name: Install Dependencies diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index a3e9e40247..fed2bc422d 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -33,17 +33,18 @@ jobs: repository: matrix-org/matrix-js-sdk path: matrix-js-sdk + - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4 - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6 with: - cache: "yarn" - cache-dependency-path: element-web/yarn.lock + cache: "pnpm" + cache-dependency-path: element-web/pnpm-lock.yaml node-version: "lts/*" - name: Generate automations docs working-directory: element-web run: | - yarn install --frozen-lockfile - yarn node ./scripts/gen-workflow-mermaid.ts ../element-desktop ../element-web ../matrix-js-sdk > docs/automations.md + pnpm install --frozen-lockfile + pnpm node ./scripts/gen-workflow-mermaid.ts ../element-desktop ../element-web ../matrix-js-sdk > docs/automations.md echo "- [Automations](automations.md)" >> docs/SUMMARY.md - name: Setup mdBook diff --git a/.github/workflows/end-to-end-tests.yaml b/.github/workflows/end-to-end-tests.yaml index 304e4468e2..9de03f7e5e 100644 --- a/.github/workflows/end-to-end-tests.yaml +++ b/.github/workflows/end-to-end-tests.yaml @@ -54,9 +54,10 @@ jobs: with: repository: element-hq/element-web + - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4 - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6 with: - cache: "yarn" + cache: "pnpm" node-version: "lts/*" - name: Fetch layered build @@ -71,7 +72,7 @@ jobs: - name: Build env: CI_PACKAGE: true - run: VERSION=$(scripts/get-version-from-git.sh) yarn build + run: VERSION=$(scripts/get-version-from-git.sh) pnpm build - name: Upload Artifact uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6 @@ -133,18 +134,19 @@ jobs: name: webapp path: webapp + - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4 - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6 with: - cache: "yarn" - cache-dependency-path: yarn.lock + cache: "pnpm" + cache-dependency-path: pnpm-lock.yaml node-version: "lts/*" - name: Install dependencies - run: yarn install --frozen-lockfile + run: pnpm install --frozen-lockfile - name: Get installed Playwright version id: playwright - run: echo "version=$(yarn list --pattern @playwright/test --depth=0 --json --non-interactive --no-progress | jq -r '.data.trees[].name')" >> $GITHUB_OUTPUT + run: echo "version=$(pnpm list @playwright/test --depth=0 --json | jq -r '.[].devDependencies["@playwright/test"].version')" >> $GITHUB_OUTPUT - name: Cache playwright binaries uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5 @@ -155,17 +157,17 @@ jobs: - name: Install Playwright browsers if: steps.playwright-cache.outputs.cache-hit != 'true' - run: yarn playwright install --with-deps --no-shell + run: pnpm playwright install --with-deps --no-shell - name: Install system dependencies for WebKit # Some WebKit dependencies seem to lay outside the cache and will need to be installed separately if: matrix.project == 'WebKit' && steps.playwright-cache.outputs.cache-hit == 'true' - run: yarn playwright install-deps webkit + run: pnpm playwright install-deps webkit # We skip tests tagged with @mergequeue when running on PRs, but run them in MQ and everywhere else - name: Run Playwright tests run: | - yarn playwright test \ + pnpm playwright test \ --shard "${{ matrix.runner }}/${{ needs.build.outputs.num-runners }}" \ --project="${{ matrix.project }}" \ ${{ (github.event_name == 'pull_request' && matrix.runAllTests == false ) && '--grep-invert @mergequeue' || '' }} @@ -200,15 +202,16 @@ jobs: persist-credentials: false repository: element-hq/element-web + - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4 - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6 if: inputs.skip != true with: - cache: "yarn" + cache: "pnpm" node-version: "lts/*" - name: Install dependencies if: inputs.skip != true - run: yarn install --frozen-lockfile + run: pnpm install --frozen-lockfile - name: Download blob reports from GitHub Actions Artifacts if: inputs.skip != true @@ -220,7 +223,7 @@ jobs: - name: Merge into HTML Report if: inputs.skip != true - run: yarn playwright merge-reports --reporter=html,./playwright/flaky-reporter.ts,@element-hq/element-web-playwright-common/lib/stale-screenshot-reporter.js ./all-blob-reports + run: pnpm playwright merge-reports --reporter=html,./playwright/flaky-reporter.ts,@element-hq/element-web-playwright-common/lib/stale-screenshot-reporter.js ./all-blob-reports env: # Only pass creds to the flaky-reporter on main branch runs GITHUB_TOKEN: ${{ github.ref_name == 'develop' && secrets.ELEMENT_BOT_TOKEN || '' }} diff --git a/.github/workflows/shared-component-publish.yaml b/.github/workflows/shared-component-publish.yaml index a1b6a0c882..99bcac9a3d 100644 --- a/.github/workflows/shared-component-publish.yaml +++ b/.github/workflows/shared-component-publish.yaml @@ -15,10 +15,11 @@ jobs: - name: 🧮 Checkout code uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 + - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4 - name: 🔧 Set up node environment uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6 with: - cache: "yarn" + cache: "pnpm" node-version-file: ".node-version" registry-url: "https://registry.npmjs.org" @@ -28,12 +29,12 @@ jobs: # Need to setup element web too as it needs the translations - name: 🛠️ Setup EW - run: yarn install --pure-lockfile + run: pnpm install --pure-lockfile - name: 🛠️ Setup # When running `install` it also calls the `prepare` step which generates # a build - run: yarn --cwd packages/shared-components install --pure-lockfile + run: pnpm --dir packages/shared-components install --pure-lockfile - name: 🚀 Publish to npm working-directory: packages/shared-components diff --git a/.github/workflows/shared-component-visual-tests.yaml b/.github/workflows/shared-component-visual-tests.yaml index b2015f0a08..e242dde766 100644 --- a/.github/workflows/shared-component-visual-tests.yaml +++ b/.github/workflows/shared-component-visual-tests.yaml @@ -26,19 +26,20 @@ jobs: persist-credentials: false repository: element-hq/element-web + - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4 - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6 with: - cache: "yarn" + cache: "pnpm" node-version: "lts/*" - name: Install dependencies working-directory: packages/shared-components - run: yarn install --frozen-lockfile + run: pnpm install --frozen-lockfile - name: Get installed Playwright version working-directory: packages/shared-components id: playwright - run: echo "version=$(yarn list --pattern @playwright/test --depth=0 --json --non-interactive --no-progress | jq -r '.data.trees[].name')" >> $GITHUB_OUTPUT + run: echo "version=$(pnpm list @playwright/test --depth=0 --json | jq -r '.[].devDependencies["@playwright/test"].version')" >> $GITHUB_OUTPUT - name: Cache playwright binaries uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5 @@ -50,11 +51,11 @@ jobs: - name: Install Playwright browsers working-directory: packages/shared-components if: steps.playwright-cache.outputs.cache-hit != 'true' - run: "yarn playwright install --with-deps --only-shell" + run: "pnpm playwright install --with-deps --only-shell" - name: Run Visual tests working-directory: packages/shared-components - run: "yarn test:storybook --run" + run: "pnpm test:storybook --run" # Workaround for vis silently adding new baselines if they didn't exist # Can be removed once https://github.com/repobuddy/visual-testing/issues/516 is released diff --git a/.github/workflows/static_analysis.yaml b/.github/workflows/static_analysis.yaml index c26ee1b487..c358269485 100644 --- a/.github/workflows/static_analysis.yaml +++ b/.github/workflows/static_analysis.yaml @@ -24,22 +24,23 @@ jobs: steps: - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 + - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4 - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6 with: - cache: "yarn" + cache: "pnpm" node-version: "lts/*" - name: Install Dependencies run: "./scripts/layered.sh" - name: Typecheck - run: "yarn run lint:types" + run: "pnpm run lint:types" - name: Install Shared Component Dependencies - run: "yarn --cwd packages/shared-components install" + run: "pnpm --dir packages/shared-components install" - name: Typecheck Shared Components - run: "yarn --cwd packages/shared-components run lint:types" + run: "pnpm --dir packages/shared-components run lint:types" i18n_lint_ew: name: "i18n Check (Element Web)" @@ -84,23 +85,24 @@ jobs: steps: - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 + - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4 - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6 with: - cache: "yarn" + cache: "pnpm" node-version: "lts/*" # Does not need branch matching as only analyses this layer - name: Install Deps - run: "yarn install --frozen-lockfile" + run: "pnpm install --frozen-lockfile" - name: Run Linter - run: "yarn run lint:js" + run: "pnpm run lint:js" - name: Install Shared Component Deps - run: "yarn --cwd packages/shared-components install --frozen-lockfile" + run: "pnpm --dir packages/shared-components install --frozen-lockfile" - name: Run Linter - run: "yarn --cwd packages/shared-components run lint:js" + run: "pnpm --dir packages/shared-components run lint:js" style_lint: name: "Style Lint" @@ -108,17 +110,18 @@ jobs: steps: - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 + - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4 - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6 with: - cache: "yarn" + cache: "pnpm" node-version: "lts/*" # Does not need branch matching as only analyses this layer - name: Install Deps - run: "yarn install" + run: "pnpm install" - name: Run Linter - run: "yarn run lint:style" + run: "pnpm run lint:style" workflow_lint: name: "Workflow Lint" @@ -126,17 +129,18 @@ jobs: steps: - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 + - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4 - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6 with: - cache: "yarn" + cache: "pnpm" node-version: "lts/*" # Does not need branch matching as only analyses this layer - name: Install Deps - run: "yarn install --frozen-lockfile" + run: "pnpm install --frozen-lockfile" - name: Run Linter - run: "yarn lint:workflows" + run: "pnpm lint:workflows" analyse_dead_code: name: "Analyse Dead Code" @@ -144,13 +148,14 @@ jobs: steps: - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 + - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4 - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6 with: - cache: "yarn" + cache: "pnpm" node-version: "lts/*" - name: Install Deps - run: "yarn install --frozen-lockfile" + run: "pnpm install --frozen-lockfile" - name: Run linter - run: "yarn run lint:knip" + run: "pnpm run lint:knip" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4b90ca2cb5..ce473d5cbd 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -43,11 +43,12 @@ jobs: with: repository: ${{ inputs.matrix-js-sdk-sha && 'element-hq/element-web' || github.repository }} - - name: Yarn cache + - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4 + - name: pnpm cache uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6 with: node-version: "lts/*" - cache: "yarn" + cache: "pnpm" - name: Install Deps run: "./scripts/layered.sh" @@ -58,7 +59,7 @@ jobs: uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5 with: path: /tmp/jest_cache - key: ${{ hashFiles('**/yarn.lock') }} + key: ${{ hashFiles('**/pnpm-lock.yaml') }} - name: Get number of CPU cores id: cpu-cores @@ -66,7 +67,7 @@ jobs: - name: Run tests run: | - yarn test \ + pnpm test \ --coverage=${{ env.ENABLE_COVERAGE }} \ --ci \ --max-workers ${{ steps.cpu-cores.outputs.count }} \ @@ -122,15 +123,16 @@ jobs: with: repository: ${{ inputs.matrix-js-sdk-sha && 'element-hq/element-web' || github.repository }} - - name: Yarn cache + - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4 + - name: pnpm cache uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6 with: node-version: "lts/*" - cache: "yarn" + cache: "pnpm" - name: Install Shared Component Deps working-directory: "packages/shared-components" - run: "yarn install" + run: "pnpm install" - name: Cache storybook & vitest uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5 @@ -138,12 +140,12 @@ jobs: path: | packages/shared-components/node_modules/.cache packages/shared-components/node_modules/.vite/vitest - key: ${{ hashFiles('packages/shared-components/yarn.lock') }} + key: ${{ hashFiles('packages/shared-components/pnpm-lock.yaml') }} - name: Get installed Playwright version working-directory: packages/shared-components id: playwright - run: echo "version=$(yarn list --pattern @playwright/test --depth=0 --json --non-interactive --no-progress | jq -r '.data.trees[].name')" >> $GITHUB_OUTPUT + run: echo "version=$(pnpm list @playwright/test --depth=0 --json | jq -r '.[].devDependencies["@playwright/test"].version')" >> $GITHUB_OUTPUT - name: Cache playwright binaries uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5 @@ -155,11 +157,11 @@ jobs: - name: Install Playwright browsers working-directory: packages/shared-components if: steps.playwright-cache.outputs.cache-hit != 'true' - run: "yarn playwright install --with-deps --only-shell" + run: "pnpm playwright install --with-deps --only-shell" - name: Run tests working-directory: "packages/shared-components" - run: yarn test:unit --coverage=${{ env.ENABLE_COVERAGE }} + run: pnpm test:unit --coverage=${{ env.ENABLE_COVERAGE }} - name: Upload Artifact if: env.ENABLE_COVERAGE == 'true' diff --git a/.github/workflows/update-jitsi.yml b/.github/workflows/update-jitsi.yml index b37a2967d4..5bcc12d12b 100644 --- a/.github/workflows/update-jitsi.yml +++ b/.github/workflows/update-jitsi.yml @@ -11,16 +11,17 @@ jobs: steps: - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 + - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4 - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6 with: - cache: "yarn" + cache: "pnpm" node-version: "lts/*" - name: Install Deps - run: "yarn install --frozen-lockfile" + run: "pnpm install --frozen-lockfile" - name: Fetch Jitsi - run: "yarn update:jitsi" + run: "pnpm update:jitsi" - name: Create Pull Request uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8