mirror of
https://github.com/vector-im/element-web.git
synced 2026-03-01 19:41:15 +01:00
Switch from yarn classic to pnpm (#31971)
* Switch shared-components from yarn classic to pnpm Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Switch element-web from yarn classic to pnpm Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Switch CI to pnpm Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Update docs & comments Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Hold back postcss to match yarn.lock & use workspace protocol Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Tweak CI Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Rid the world of `$(res)` Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Switch to type=module Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Fix module import Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Make knip happy Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Update playwright imports Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Make docker build happy Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Remove stale params Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Fix badly formatted logging Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Switch to lodash-es Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Make jest happier Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Switch element-web to ESM Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Update testcontainers imports Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Fix modernizr cjs Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Fix modernizr cjs ignore files Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Move modernizr sonar exclusion to exclude everything Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Update playwright tests for esm compat Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Add pnpm-link utility Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Test matrix-web-i18n Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Iterate Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Iterate Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Discard changes to src/vector/index.ts * Update playwright-common Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Use catalogs Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Improve pnpm-link script Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Use pnpm import to regenerate lockfile from yarn.lock Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --------- Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
9360f0e5e2
commit
ffd4270051
2
.github/CODEOWNERS
vendored
2
.github/CODEOWNERS
vendored
@ -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
|
||||
|
||||
8
.github/workflows/build.yml
vendored
8
.github/workflows/build.yml
vendored
@ -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
|
||||
|
||||
3
.github/workflows/build_develop.yml
vendored
3
.github/workflows/build_develop.yml
vendored
@ -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
|
||||
|
||||
9
.github/workflows/docs.yml
vendored
9
.github/workflows/docs.yml
vendored
@ -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
|
||||
|
||||
27
.github/workflows/end-to-end-tests.yaml
vendored
27
.github/workflows/end-to-end-tests.yaml
vendored
@ -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 || '' }}
|
||||
|
||||
@ -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 --frozen-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 --frozen-lockfile
|
||||
|
||||
- name: 🚀 Publish to npm
|
||||
working-directory: packages/shared-components
|
||||
|
||||
@ -18,19 +18,20 @@ jobs:
|
||||
- name: 🧮 Checkout code
|
||||
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
|
||||
|
||||
- name: 🔧 Yarn cache
|
||||
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4
|
||||
- name: 🔧 Pnpm cache
|
||||
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6
|
||||
with:
|
||||
cache: "yarn"
|
||||
cache: "pnpm"
|
||||
node-version-file: package.json
|
||||
|
||||
- name: 🔨 Install dependencies
|
||||
working-directory: packages/shared-components
|
||||
run: "yarn install --pure-lockfile"
|
||||
run: "pnpm install --frozen-lockfile"
|
||||
|
||||
- name: 📖 Build Storybook
|
||||
working-directory: packages/shared-components
|
||||
run: yarn build:storybook
|
||||
run: pnpm build:storybook
|
||||
|
||||
- name: 🚀 Deploy to Cloudflare Pages
|
||||
uses: cloudflare/wrangler-action@9681c2997648301493e78cacbfb790a9f19c833f # v3
|
||||
|
||||
@ -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
|
||||
|
||||
47
.github/workflows/static_analysis.yaml
vendored
47
.github/workflows/static_analysis.yaml
vendored
@ -24,30 +24,32 @@ 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)"
|
||||
uses: matrix-org/matrix-web-i18n/.github/workflows/i18n_check.yml@main
|
||||
uses: matrix-org/matrix-web-i18n/.github/workflows/i18n_check.yml@3673fd3abbf8dfae1de849c6cd3e69e24ed7a766
|
||||
permissions:
|
||||
pull-requests: read
|
||||
with:
|
||||
hardcoded-words: "Element"
|
||||
packageManager: pnpm
|
||||
allowed-hardcoded-keys: |
|
||||
console_dev_note
|
||||
labs|element_call_video_rooms
|
||||
@ -61,12 +63,13 @@ jobs:
|
||||
|
||||
i18n_lint_shared_components:
|
||||
name: "i18n Check (Shared Components)"
|
||||
uses: matrix-org/matrix-web-i18n/.github/workflows/i18n_check.yml@main
|
||||
uses: matrix-org/matrix-web-i18n/.github/workflows/i18n_check.yml@3673fd3abbf8dfae1de849c6cd3e69e24ed7a766
|
||||
permissions:
|
||||
pull-requests: read
|
||||
with:
|
||||
path: "packages/shared-components"
|
||||
hardcoded-words: "Element"
|
||||
packageManager: pnpm
|
||||
|
||||
rethemendex_lint:
|
||||
name: "Rethemendex Check"
|
||||
@ -84,23 +87,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 +112,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 +131,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 +150,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"
|
||||
|
||||
24
.github/workflows/tests.yml
vendored
24
.github/workflows/tests.yml
vendored
@ -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('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'
|
||||
|
||||
7
.github/workflows/update-jitsi.yml
vendored
7
.github/workflows/update-jitsi.yml
vendored
@ -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
|
||||
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@ -41,3 +41,5 @@ storybook-static
|
||||
|
||||
# TSC incremental compilation information
|
||||
*.tsbuildinfo
|
||||
|
||||
/.link-config
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
/node_modules
|
||||
/webapp
|
||||
/*.log
|
||||
yarn.lock
|
||||
pnpm-lock.yaml
|
||||
electron/dist
|
||||
electron/pub
|
||||
**/.idea
|
||||
|
||||
@ -11,8 +11,9 @@ ARG JS_SDK_BRANCH="master"
|
||||
WORKDIR /src
|
||||
|
||||
COPY --exclude=docker . /src
|
||||
RUN corepack enable
|
||||
RUN /src/scripts/docker-link-repos.sh
|
||||
RUN yarn --network-timeout=200000 install
|
||||
RUN pnpm install
|
||||
RUN /src/scripts/docker-package.sh
|
||||
|
||||
# Copy the config now so that we don't create another layer in the app image
|
||||
|
||||
12
README.md
12
README.md
@ -116,14 +116,14 @@ instead of adding that last line.
|
||||
Element is a modular webapp built with modern ES6 and uses a Node.js build system.
|
||||
Ensure you have the latest LTS version of Node.js installed.
|
||||
|
||||
Using `yarn` instead of `npm` is recommended. Please see the Yarn [install
|
||||
guide](https://classic.yarnpkg.com/en/docs/install) if you do not have it already.
|
||||
Using `pnpm` instead of `npm` is recommended. Please see the pnpm [install
|
||||
guide](https://pnpm.io/installation#using-corepack) if you do not have it already.
|
||||
|
||||
1. Install or update `node.js` so that your `node` is at least the current recommended LTS.
|
||||
1. Install `yarn` if not present already.
|
||||
1. Install `pnpm` if not present already.
|
||||
1. Clone the repo: `git clone https://github.com/element-hq/element-web.git`.
|
||||
1. Switch to the element-web directory: `cd element-web`.
|
||||
1. Install the prerequisites: `yarn install`.
|
||||
1. Install the prerequisites: `pnpm install`.
|
||||
- If you're using the `develop` branch, then it is recommended to set up a
|
||||
proper development environment (see [Setting up a dev
|
||||
environment](./developer_guide.md#setting-up-a-dev-environment) below). Alternatively, you
|
||||
@ -131,11 +131,11 @@ guide](https://classic.yarnpkg.com/en/docs/install) if you do not have it alread
|
||||
the develop branch.
|
||||
1. Configure the app by copying `config.sample.json` to `config.json` and
|
||||
modifying it. See the [configuration docs](docs/config.md) for details.
|
||||
1. `yarn dist` to build a tarball to deploy. Untaring this file will give
|
||||
1. `pnpm dist` to build a tarball to deploy. Untaring this file will give
|
||||
a version-specific directory containing all the files that need to go on your
|
||||
web server.
|
||||
|
||||
Note that `yarn dist` is not supported on Windows, so Windows users can run `yarn build`,
|
||||
Note that `pnpm dist` is not supported on Windows, so Windows users can run `pnpm build`,
|
||||
which will build all the necessary files into the `webapp` directory. The version of Element
|
||||
will not appear in Settings without using the dist script. You can then mount the
|
||||
`webapp` directory on your web server to actually serve up the app, which is
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
# The modules to install. See ./docs/modules.md for more information on
|
||||
# what modules are.
|
||||
#
|
||||
# The values of this are provided to `yarn add` for inclusion.
|
||||
# The values of this are provided to `pnpm add` for inclusion.
|
||||
modules:
|
||||
# An example of pulling a module from NPM
|
||||
- "@vector-im/element-web-ilag-module@^0.0.1"
|
||||
|
||||
@ -28,8 +28,7 @@ First clone and build `matrix-js-sdk`:
|
||||
```bash
|
||||
git clone https://github.com/matrix-org/matrix-js-sdk.git
|
||||
pushd matrix-js-sdk
|
||||
yarn link
|
||||
yarn install
|
||||
pnpm install
|
||||
popd
|
||||
```
|
||||
|
||||
@ -43,12 +42,17 @@ cd element-web
|
||||
Configure the app by copying `config.sample.json` to `config.json` and
|
||||
modifying it. See the [configuration docs](docs/config.md) for details.
|
||||
|
||||
Set up your local development link by creating a `.link-config` file with contents like:
|
||||
|
||||
```
|
||||
matrix-js-sdk=/path/to/matrix-js-sdk
|
||||
```
|
||||
|
||||
Finally, build and start Element itself:
|
||||
|
||||
```bash
|
||||
yarn link matrix-js-sdk
|
||||
yarn install
|
||||
yarn start
|
||||
pnpm install
|
||||
pnpm start
|
||||
```
|
||||
|
||||
Wait a few seconds for the initial build to finish; you should see something like:
|
||||
@ -104,7 +108,7 @@ There are a number of application-level tests in the `tests` directory; these
|
||||
are designed to run with Jest and JSDOM. To run them
|
||||
|
||||
```
|
||||
yarn test
|
||||
pnpm test
|
||||
```
|
||||
|
||||
### End-to-End tests
|
||||
|
||||
@ -249,7 +249,7 @@ Together, the options might look like this in your config:
|
||||
Note that `index.html` also has an og:image meta tag that is set to an image hosted on element.io. This is the image used if
|
||||
links to your copy of Element appear in some websites like Facebook, and indeed Element itself. This has to be static in the HTML
|
||||
and an absolute URL (and HTTP rather than HTTPS), so it's not possible for this to be an option in config.json. If you'd like to
|
||||
change it, you can build Element, but run `RIOT_OG_IMAGE_URL="http://example.com/logo.png" yarn build`. Alternatively, you can edit
|
||||
change it, you can build Element, but run `RIOT_OG_IMAGE_URL="http://example.com/logo.png" pnpm build`. Alternatively, you can edit
|
||||
the `og:image` meta tag in `index.html` directly each time you download a new version of Element.
|
||||
|
||||
## SSO setup
|
||||
|
||||
@ -4,14 +4,14 @@
|
||||
> DEPRECATED. Use [Element web module api](https://github.com/element-hq/element-modules/tree/main/packages/element-web-module-api) instead.
|
||||
|
||||
The module system in Element Web is a way to add or modify functionality of Element Web itself, bundled at compile time
|
||||
for the app. This means that modules are loaded as part of the `yarn build` process but have an effect on user experience
|
||||
for the app. This means that modules are loaded as part of the `pnpm build` process but have an effect on user experience
|
||||
at runtime.
|
||||
|
||||
## Installing modules
|
||||
|
||||
If you already have a module you want to install, such as our [ILAG Module](https://github.com/element-hq/element-web-ilag-module),
|
||||
then copy `build_config.sample.yaml` to `build_config.yaml` in the same directory. In your new `build_config.yaml` simply
|
||||
add the reference to the module as described by the sample file, using the same syntax you would for `yarn add`:
|
||||
add the reference to the module as described by the sample file, using the same syntax you would for `pnpm add`:
|
||||
|
||||
```yaml
|
||||
modules:
|
||||
@ -19,7 +19,7 @@ modules:
|
||||
- "@vector-im/element-web-ilag-module@latest"
|
||||
```
|
||||
|
||||
Then build the app as you normally would: `yarn build` or `yarn dist` (if compatible on your platform). If you are building
|
||||
Then build the app as you normally would: `pnpm build` or `pnpm dist` (if compatible on your platform). If you are building
|
||||
the Docker image then ensure your `build_config.yaml` ends up in the build directory. Usually this works fine if you use
|
||||
the current directory as the build context (the `.` in `docker build -t my-element-web .`).
|
||||
|
||||
@ -41,9 +41,9 @@ The following requirements are key for any module:
|
||||
1. The module must depend on `@matrix-org/react-sdk-module-api` (usually as a dev dependency).
|
||||
2. The module's `main` entrypoint must have a `default` export for the `RuntimeModule` instance, supporting a constructor
|
||||
which takes a single parameter: a `ModuleApi` instance. This instance is passed to `super()`.
|
||||
3. The module must be deployed in a way where `yarn add` can access it, as that is how the build system will try to
|
||||
3. The module must be deployed in a way where `pnpm add` can access it, as that is how the build system will try to
|
||||
install it. Note that while this is often NPM, it can also be a GitHub/GitLab repo or private NPM registry.
|
||||
Be careful when using git dependencies in yarn classic, many lifecycle scripts will not be executed which may mean
|
||||
Be careful when using git dependencies in pnpm classic, many lifecycle scripts will not be executed which may mean
|
||||
that your module is not built and thus may fail to be imported.
|
||||
|
||||
... and that's pretty much it. As with any code, please be responsible and call things in line with the documentation.
|
||||
|
||||
@ -43,7 +43,7 @@ Follow the Playwright installation instructions:
|
||||
- **System dependencies:** <https://playwright.dev/docs/browsers#install-system-dependencies>
|
||||
|
||||
```sh
|
||||
yarn playwright install --with-deps
|
||||
pnpm playwright install --with-deps
|
||||
```
|
||||
|
||||
### 2. Container Runtime
|
||||
@ -56,7 +56,7 @@ Element Web E2E tests require an instance running on `http://localhost:8080` (co
|
||||
|
||||
You can either:
|
||||
|
||||
- **Run manually:** `yarn start` in a separate terminal (not working for screenshot tests running in a docker environment).
|
||||
- **Run manually:** `pnpm start` in a separate terminal (not working for screenshot tests running in a docker environment).
|
||||
- **Auto-start:** Playwright will start the webserver automatically if it's not already running
|
||||
|
||||
## Running the Tests
|
||||
@ -68,19 +68,19 @@ Our main Playwright tests run against a full Element Web instance with Synapse/D
|
||||
**Run all E2E tests:**
|
||||
|
||||
```sh
|
||||
yarn run test:playwright
|
||||
pnpm run test:playwright
|
||||
```
|
||||
|
||||
**Run a specific test file:**
|
||||
|
||||
```sh
|
||||
yarn run test:playwright playwright/e2e/register/register.spec.ts
|
||||
pnpm run test:playwright playwright/e2e/register/register.spec.ts
|
||||
```
|
||||
|
||||
**Run tests interactively with Playwright UI:**
|
||||
|
||||
```sh
|
||||
yarn run test:playwright:open
|
||||
pnpm run test:playwright:open
|
||||
```
|
||||
|
||||
**Run screenshot tests only:**
|
||||
@ -89,7 +89,7 @@ yarn run test:playwright:open
|
||||
> This command run the playwright tests in a docker environment.
|
||||
|
||||
```sh
|
||||
yarn run test:playwright:screenshots
|
||||
pnpm run test:playwright:screenshots
|
||||
```
|
||||
|
||||
For more information about visual testing, see [Visual Testing](playwright#visual-testing).
|
||||
@ -387,7 +387,7 @@ This command runs only tests tagged with `@screenshot` in the Docker environment
|
||||
When you need to update screenshot baselines (e.g., after intentional UI changes):
|
||||
|
||||
```sh
|
||||
yarn run test:playwright:screenshots
|
||||
pnpm run test:playwright:screenshots
|
||||
```
|
||||
|
||||
**Important:** Always use this command to update screenshots rather than running tests locally with `--update-snapshots`.
|
||||
|
||||
@ -50,7 +50,7 @@ We are aiming for a set of common strings to be shared then some more localised
|
||||
|
||||
1. Check if the import `import { _t } from ".../languageHandler";` is present. If not add it to the other import statements. Also import `_td` if needed.
|
||||
1. Add `_t()` to your string passing the translation key you come up with based on the rules above. If the string is introduced at a point before the translation system has not yet been initialized, use `_td()` instead, and call `_t()` at the appropriate time.
|
||||
1. Run `yarn i18n` to add the keys to `src/i18n/strings/en_EN.json`
|
||||
1. Run `pnpm i18n` to add the keys to `src/i18n/strings/en_EN.json`
|
||||
1. Modify the new entries in `src/i18n/strings/en_EN.json` with the English (UK) translations for the added keys.
|
||||
|
||||
## Editing existing strings
|
||||
|
||||
2
knip.ts
2
knip.ts
@ -29,6 +29,7 @@ export default {
|
||||
],
|
||||
},
|
||||
},
|
||||
ignoreBinaries: ["test:storybook", "test:unit", "build:storybook"],
|
||||
ignoreDependencies: [
|
||||
// Required for `action-validator`
|
||||
"@action-validator/*",
|
||||
@ -49,7 +50,6 @@ export default {
|
||||
// Embedded into webapp
|
||||
"@element-hq/element-call-embedded",
|
||||
// Transitive dep of jest
|
||||
"@jest/globals",
|
||||
"vitest-environment-jest-fixed-jsdom",
|
||||
|
||||
// We import this in some tests, transitive dep of @playwright/test
|
||||
|
||||
@ -38,7 +38,7 @@ export function installer(config: BuildConfig): void {
|
||||
let exitCode = 0;
|
||||
|
||||
// We cheat a bit and store the current package.json and lockfile so we can safely
|
||||
// run `yarn add` without creating extra committed files for people. We restore
|
||||
// run `pnpm add` without creating extra committed files for people. We restore
|
||||
// these files by simply overwriting them when we're done.
|
||||
const packageDeps = readCurrentPackageDetails();
|
||||
|
||||
@ -47,7 +47,7 @@ export function installer(config: BuildConfig): void {
|
||||
const currentOptDeps = getOptionalDepNames(packageDeps.packageJson);
|
||||
|
||||
try {
|
||||
// Install the modules with yarn
|
||||
// Install the modules with pnpm
|
||||
const yarnAddRef = config.modules.join(" ");
|
||||
callYarnAdd(yarnAddRef); // install them all at once
|
||||
|
||||
@ -108,20 +108,20 @@ type RawDependencies = {
|
||||
|
||||
function readCurrentPackageDetails(): RawDependencies {
|
||||
return {
|
||||
lockfile: fs.readFileSync("./yarn.lock", "utf-8"),
|
||||
lockfile: fs.readFileSync("./pnpm-lock.yaml", "utf-8"),
|
||||
packageJson: fs.readFileSync("./package.json", "utf-8"),
|
||||
};
|
||||
}
|
||||
|
||||
function writePackageDetails(deps: RawDependencies): void {
|
||||
fs.writeFileSync("./yarn.lock", deps.lockfile, "utf-8");
|
||||
fs.writeFileSync("./pnpm-lock.yaml", deps.lockfile, "utf-8");
|
||||
fs.writeFileSync("./package.json", deps.packageJson, "utf-8");
|
||||
}
|
||||
|
||||
function callYarnAdd(dep: string): void {
|
||||
// Add the module to the optional dependencies section just in case something
|
||||
// goes wrong in restoring the original package details.
|
||||
childProcess.execSync(`yarn add -O ${dep}`, {
|
||||
childProcess.execSync(`pnpm add -O ${dep}`, {
|
||||
env: process.env,
|
||||
stdio: ["inherit", "inherit", "inherit"],
|
||||
});
|
||||
@ -170,7 +170,7 @@ function getTopLevelDependencyVersion(dep: string): string {
|
||||
|
||||
function getModuleApiVersionFor(moduleName: string): string {
|
||||
// We'll just pretend that this isn't highly problematic...
|
||||
// Yarn is fairly stable in putting modules in a flat hierarchy, at least.
|
||||
// pnpm is fairly stable in putting modules in a flat hierarchy, at least.
|
||||
const pkgJsonStr = fs.readFileSync(`./node_modules/${moduleName}/package.json`, "utf-8");
|
||||
return findDepVersionInPackageJson(moduleApiDepName, pkgJsonStr);
|
||||
}
|
||||
|
||||
94
package.json
94
package.json
@ -30,30 +30,30 @@
|
||||
"UserFriendlyError"
|
||||
],
|
||||
"scripts": {
|
||||
"i18n": "matrix-gen-i18n src res && yarn i18n:sort && yarn i18n:lint",
|
||||
"i18n:sort": "matrix-sort-i18n src/i18n/strings/en_EN.json && yarn --cwd packages/shared-components i18n:sort",
|
||||
"i18n:lint": "matrix-i18n-lint && prettier --log-level=silent --write src/i18n/strings/ --ignore-path /dev/null && yarn --cwd packages/shared-components i18n:lint",
|
||||
"i18n:diff": "cp src/i18n/strings/en_EN.json src/i18n/strings/en_EN_orig.json && yarn i18n && matrix-compare-i18n-files src/i18n/strings/en_EN_orig.json src/i18n/strings/en_EN.json",
|
||||
"i18n": "matrix-gen-i18n src res && pnpm i18n:sort && pnpm i18n:lint",
|
||||
"i18n:sort": "matrix-sort-i18n src/i18n/strings/en_EN.json && pnpm --dir packages/shared-components i18n:sort",
|
||||
"i18n:lint": "matrix-i18n-lint && prettier --log-level=silent --write src/i18n/strings/ --ignore-path /dev/null && pnpm --dir packages/shared-components i18n:lint",
|
||||
"i18n:diff": "cp src/i18n/strings/en_EN.json src/i18n/strings/en_EN_orig.json && pnpm i18n && matrix-compare-i18n-files src/i18n/strings/en_EN_orig.json src/i18n/strings/en_EN.json",
|
||||
"make-component": "node scripts/make-react-component.js",
|
||||
"rethemendex": "./res/css/rethemendex.sh",
|
||||
"clean": "rimraf lib webapp",
|
||||
"build": "yarn clean && yarn build:genfiles && yarn build:bundle",
|
||||
"build-stats": "yarn clean && yarn build:genfiles && yarn build:bundle-stats",
|
||||
"build": "pnpm clean && pnpm build:genfiles && pnpm build:bundle",
|
||||
"build-stats": "pnpm clean && pnpm build:genfiles && pnpm build:bundle-stats",
|
||||
"build:res": "node scripts/copy-res.ts",
|
||||
"build:genfiles": "yarn build:res && yarn build:module_system",
|
||||
"build:genfiles": "pnpm build:res && pnpm build:module_system",
|
||||
"build:modernizr": "modernizr -c .modernizr.json -d src/vector/modernizr.js && mv src/vector/modernizr.js src/vector/modernizr.cjs",
|
||||
"build:bundle": "webpack --progress --mode production",
|
||||
"build:bundle-stats": "webpack --progress --mode production --json > webpack-stats.json",
|
||||
"build:module_system": "node module_system/scripts/install.ts",
|
||||
"dist": "./scripts/package.sh",
|
||||
"start": "concurrently --kill-others-on-fail --prefix \"{time} [{name}]\" -n modules,res \"yarn build:module_system\" \"yarn build:res\" && concurrently --kill-others-on-fail --prefix \"{time} [{name}]\" -n res,element-js \"yarn start:res\" \"yarn start:js\"",
|
||||
"start:https": "concurrently --kill-others-on-fail --prefix \"{time} [{name}]\" -n res,element-js \"yarn start:res\" \"yarn start:js --server-type https\"",
|
||||
"start": "concurrently --kill-others-on-fail --prefix \"{time} [{name}]\" -n modules,res \"pnpm build:module_system\" \"pnpm build:res\" && concurrently --kill-others-on-fail --prefix \"{time} [{name}]\" -n res,element-js \"pnpm start:res\" \"pnpm start:js\"",
|
||||
"start:https": "concurrently --kill-others-on-fail --prefix \"{time} [{name}]\" -n res,element-js \"pnpm start:res\" \"pnpm start:js --server-type https\"",
|
||||
"start:res": "node scripts/copy-res.ts -w",
|
||||
"start:js": "webpack serve --output-path webapp --output-filename=bundles/_dev_/[name].js --output-chunk-filename=bundles/_dev_/[name].js --mode development",
|
||||
"lint": "yarn lint:types && yarn lint:js && yarn lint:style && yarn lint:workflows",
|
||||
"lint": "pnpm lint:types && pnpm lint:js && pnpm lint:style && pnpm lint:workflows",
|
||||
"lint:js": "eslint --max-warnings 0 src test playwright module_system && prettier --check .",
|
||||
"lint:js-fix": "prettier --log-level=warn --write . && eslint --fix src test playwright module_system",
|
||||
"lint:types": "yarn lint:types:src && yarn lint:types:module_system",
|
||||
"lint:types": "pnpm lint:types:src && pnpm lint:types:module_system",
|
||||
"lint:types:src": "tsc --noEmit --jsx react && tsc --noEmit --jsx react -p playwright",
|
||||
"lint:types:module_system": "tsc --noEmit --project ./tsconfig.module_system.json",
|
||||
"lint:style": "stylelint \"res/css/**/*.pcss\"",
|
||||
@ -61,18 +61,17 @@
|
||||
"lint:knip": "knip",
|
||||
"test": "jest",
|
||||
"test:playwright": "playwright test",
|
||||
"test:playwright:open": "yarn test:playwright --ui",
|
||||
"test:playwright:open": "pnpm test:playwright --ui",
|
||||
"test:playwright:screenshots": "playwright-screenshots --project=Chrome",
|
||||
"coverage": "yarn test --coverage",
|
||||
"coverage": "pnpm test --coverage",
|
||||
"analyse:webpack-bundles": "webpack-bundle-analyzer webpack-stats.json webapp",
|
||||
"update:jitsi": "curl -s https://meet.element.io/libs/external_api.min.js > ./res/jitsi_external_api.min.js",
|
||||
"install": "yarn --cwd packages/shared-components install --frozen-lockfile",
|
||||
"postinstall": "patch-package"
|
||||
"postinstall": "node scripts/pnpm-link.ts"
|
||||
},
|
||||
"resolutions": {
|
||||
"**/pretty-format/react-is": "19.2.4",
|
||||
"@types/react": "19.2.10",
|
||||
"@types/react-dom": "19.2.3",
|
||||
"pretty-format@30>react-is": "19.2.4",
|
||||
"@types/react": "catalog:",
|
||||
"@types/react-dom": "catalog:",
|
||||
"oidc-client-ts": "3.4.1",
|
||||
"jwt-decode": "4.0.0",
|
||||
"caniuse-lite": "1.0.30001766",
|
||||
@ -84,7 +83,7 @@
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.12.5",
|
||||
"@element-hq/element-web-module-api": "1.9.0",
|
||||
"@element-hq/web-shared-components": "link:packages/shared-components",
|
||||
"@element-hq/web-shared-components": "workspace:*",
|
||||
"@fontsource/fira-code": "^5",
|
||||
"@fontsource/inter": "^5",
|
||||
"@formatjs/intl-segmenter": "^12.0.0",
|
||||
@ -141,10 +140,10 @@
|
||||
"posthog-js": "1.336.4",
|
||||
"qrcode": "1.5.4",
|
||||
"re-resizable": "6.11.2",
|
||||
"react": "^19.0.0",
|
||||
"react": "catalog:",
|
||||
"react-beautiful-dnd": "^13.1.0",
|
||||
"react-blurhash": "^0.3.0",
|
||||
"react-dom": "^19.0.0",
|
||||
"react-dom": "catalog:",
|
||||
"react-focus-lock": "^2.5.1",
|
||||
"react-string-replace": "^2.0.0",
|
||||
"react-transition-group": "^4.4.1",
|
||||
@ -179,8 +178,9 @@
|
||||
"@babel/runtime": "^7.12.5",
|
||||
"@casualbot/jest-sonar-reporter": "2.5.0",
|
||||
"@element-hq/element-call-embedded": "0.16.3",
|
||||
"@element-hq/element-web-playwright-common": "2.2.5",
|
||||
"@element-hq/element-web-playwright-common": "2.2.6",
|
||||
"@fetch-mock/jest": "^0.2.20",
|
||||
"@jest/globals": "^30.2.0",
|
||||
"@peculiar/webcrypto": "^1.4.3",
|
||||
"@playwright/test": "1.58.1",
|
||||
"@principalstudio/html-webpack-inject-preload": "^1.2.7",
|
||||
@ -206,12 +206,12 @@
|
||||
"@types/lodash": "^4.14.168",
|
||||
"@types/minimist": "^1.2.5",
|
||||
"@types/modernizr": "^3.5.3",
|
||||
"@types/node": "18",
|
||||
"@types/node": "22",
|
||||
"@types/pako": "^2.0.0",
|
||||
"@types/qrcode": "^1.3.5",
|
||||
"@types/react": "19.2.10",
|
||||
"@types/react": "catalog:",
|
||||
"@types/react-beautiful-dnd": "^13.0.0",
|
||||
"@types/react-dom": "19.2.3",
|
||||
"@types/react-dom": "catalog:",
|
||||
"@types/react-transition-group": "^4.4.0",
|
||||
"@types/sanitize-html": "2.16.0",
|
||||
"@types/sdp-transform": "^2.4.10",
|
||||
@ -262,17 +262,16 @@
|
||||
"mini-css-extract-plugin": "2.10.0",
|
||||
"minimist": "^1.2.6",
|
||||
"modernizr": "^3.12.0",
|
||||
"patch-package": "^8.0.0",
|
||||
"postcss": "8.5.6",
|
||||
"postcss-easings": "^4.0.0",
|
||||
"postcss-easings": "4.0.0",
|
||||
"postcss-hexrgba": "2.1.0",
|
||||
"postcss-import": "16.1.1",
|
||||
"postcss-loader": "8.2.0",
|
||||
"postcss-mixins": "^12.0.0",
|
||||
"postcss-nested": "^7.0.0",
|
||||
"postcss-preset-env": "^11.0.0",
|
||||
"postcss-scss": "^4.0.4",
|
||||
"postcss-simple-vars": "^7.0.1",
|
||||
"postcss-mixins": "12.0.0",
|
||||
"postcss-nested": "7.0.2",
|
||||
"postcss-preset-env": "11.1.1",
|
||||
"postcss-scss": "4.0.9",
|
||||
"postcss-simple-vars": "7.0.1",
|
||||
"prettier": "3.8.1",
|
||||
"process": "^0.11.10",
|
||||
"raw-loader": "^4.0.2",
|
||||
@ -285,7 +284,7 @@
|
||||
"stylelint-value-no-unknown-custom-properties": "^6.0.1",
|
||||
"terser-webpack-plugin": "^5.3.9",
|
||||
"testcontainers": "^11.0.0",
|
||||
"typescript": "5.9.3",
|
||||
"typescript": "catalog:",
|
||||
"util": "^0.12.5",
|
||||
"web-streams-polyfill": "^4.0.0",
|
||||
"webpack": "^5.89.0",
|
||||
@ -296,6 +295,32 @@
|
||||
"webpack-version-file-plugin": "^0.5.0",
|
||||
"yaml": "^2.3.3"
|
||||
},
|
||||
"pnpm": {
|
||||
"onlyBuiltDependencies": [
|
||||
"matrix-js-sdk"
|
||||
],
|
||||
"patchedDependencies": {
|
||||
"@vector-im/matrix-wysiwyg": "patches/@vector-im__matrix-wysiwyg.patch",
|
||||
"react-blurhash": "patches/react-blurhash.patch",
|
||||
"linkify-html": "patches/linkify-html.patch",
|
||||
"@matrix-org/react-sdk-module-api": "patches/@matrix-org__react-sdk-module-api.patch",
|
||||
"@types/mdx": "patches/@types__mdx.patch",
|
||||
"await-lock": "patches/await-lock.patch",
|
||||
"jest-fixed-jsdom": "patches/jest-fixed-jsdom.patch",
|
||||
"jsdom": "patches/jsdom.patch"
|
||||
},
|
||||
"peerDependencyRules": {
|
||||
"allowedVersions": {
|
||||
"react": "19",
|
||||
"react-dom": "19",
|
||||
"eslint": "8"
|
||||
}
|
||||
},
|
||||
"allowedDeprecatedVersions": {
|
||||
"eslint": "8",
|
||||
"react-beautiful-dnd": "13"
|
||||
}
|
||||
},
|
||||
"@casualbot/jest-sonar-reporter": {
|
||||
"outputDirectory": "coverage",
|
||||
"outputName": "jest-sonar-report.xml",
|
||||
@ -304,5 +329,6 @@
|
||||
"engines": {
|
||||
"node": ">=22.18"
|
||||
},
|
||||
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
|
||||
"packageManager": "pnpm@10.28.2+sha512.41872f037ad22f7348e3b1debbaf7e867cfd448f2726d9cf74c08f19507c31d2c8e7a11525b983febc2df640b5438dee6023ebb1f84ed43cc2d654d2bc326264",
|
||||
"private": true
|
||||
}
|
||||
|
||||
@ -16,8 +16,8 @@ When adding this library to a new project, as well as installing
|
||||
dependency:
|
||||
|
||||
```bash
|
||||
yarn add @element-hq/web-shared-components
|
||||
yarn add @vector-im/compound-web
|
||||
pnpm add @element-hq/web-shared-components
|
||||
pnpm add @vector-im/compound-web
|
||||
```
|
||||
|
||||
(This avoids problems where we end up with different versions of compound-web in the
|
||||
@ -99,22 +99,22 @@ function MyApp() {
|
||||
### Prerequisites
|
||||
|
||||
- Node.js >= 20.0.0
|
||||
- Yarn 1.22.22+
|
||||
- pnpm => 10
|
||||
|
||||
### Setup
|
||||
|
||||
```bash
|
||||
# Install dependencies
|
||||
yarn install
|
||||
pnpm install
|
||||
|
||||
# Build the library
|
||||
yarn prepare
|
||||
pnpm prepare
|
||||
```
|
||||
|
||||
### Running Storybook
|
||||
|
||||
```bash
|
||||
yarn storybook
|
||||
pnpm storybook
|
||||
```
|
||||
|
||||
### Write components
|
||||
@ -300,7 +300,7 @@ export const Docs = {
|
||||
|
||||
1. Write TsDoc in your utility function
|
||||
2. Export the function from `src/index.ts`
|
||||
3. Run `yarn build:doc` to generate TypeDoc markdown
|
||||
3. Run `pnpm build:doc` to generate TypeDoc markdown
|
||||
4. Create a `.stories.tsx` file importing the generated markdown
|
||||
5. The documentation appears automatically in Storybook
|
||||
|
||||
@ -314,7 +314,7 @@ These tests cover the logic of the components and utilities. Built with Vitest
|
||||
and React Testing Library.
|
||||
|
||||
```bash
|
||||
yarn test:unit
|
||||
pnpm test:unit
|
||||
```
|
||||
|
||||
### Visual Regression Tests
|
||||
@ -323,7 +323,7 @@ These tests ensure the UI components render correctly.
|
||||
Built with Storybook and run under vitest using playwright.
|
||||
|
||||
```bash
|
||||
yarn test:storybook:update
|
||||
pnpm test:storybook:update
|
||||
```
|
||||
|
||||
Each story will be rendered and a screenshot will be taken and compared to the
|
||||
@ -341,7 +341,7 @@ First see our [translation guide](../../docs/translating.md) and [translation de
|
||||
To generate translation strings for this package, run:
|
||||
|
||||
```bash
|
||||
yarn i18n
|
||||
pnpm i18n
|
||||
```
|
||||
|
||||
## Publish a new version
|
||||
|
||||
@ -35,17 +35,17 @@
|
||||
"package.json"
|
||||
],
|
||||
"scripts": {
|
||||
"i18n": "matrix-gen-i18n src && yarn i18n:sort && yarn i18n:lint",
|
||||
"i18n": "matrix-gen-i18n src && pnpm i18n:sort && pnpm i18n:lint",
|
||||
"i18n:sort": "matrix-sort-i18n src/i18n/strings/en_EN.json",
|
||||
"i18n:lint": "matrix-i18n-lint && prettier --log-level=silent --write src/i18n/strings/ --ignore-path /dev/null",
|
||||
"test:unit": "vitest --project=unit",
|
||||
"test:storybook": "yarn build:doc && vitest --project=storybook",
|
||||
"test:storybook": "pnpm build:doc && vitest --project=storybook",
|
||||
"test:storybook:update": "playwright-screenshots --entrypoint /work/scripts/storybook-screenshot-update.sh --with-node-modules",
|
||||
"prepare": "patch-package && vite build",
|
||||
"prepare": "vite build",
|
||||
"storybook": "storybook dev -p 6007",
|
||||
"build:storybook": "yarn build:doc && storybook build && node scripts/storybook-build-i18n.ts",
|
||||
"build:storybook": "pnpm build:doc && storybook build && node scripts/storybook-build-i18n.ts",
|
||||
"build:doc": "typedoc",
|
||||
"lint": "yarn lint:types && yarn lint:js",
|
||||
"lint": "pnpm lint:types && pnpm lint:js",
|
||||
"lint:js": "eslint --max-warnings 0 src && prettier --check .",
|
||||
"lint:types": "tsc --noEmit && tsc --noEmit -p tsconfig.node.json"
|
||||
},
|
||||
@ -79,8 +79,8 @@
|
||||
"@testing-library/user-event": "^14.6.1",
|
||||
"@types/counterpart": "^0.18.4",
|
||||
"@types/lodash": "^4.17.20",
|
||||
"@types/react": "^19.2.2",
|
||||
"@types/react-dom": "^19.2.3",
|
||||
"@types/react": "catalog:",
|
||||
"@types/react-dom": "catalog:",
|
||||
"@typescript-eslint/eslint-plugin": "^8.53.1",
|
||||
"@typescript-eslint/parser": "^8.53.1",
|
||||
"@vector-im/compound-web": "^8.3.6",
|
||||
@ -101,14 +101,13 @@
|
||||
"eslint-plugin-storybook": "^10.0.7",
|
||||
"eslint-plugin-unicorn": "^56.0.0",
|
||||
"expect": "^30.2.0",
|
||||
"patch-package": "^8.0.1",
|
||||
"prettier": "^3.6.2",
|
||||
"storybook": "^10.0.7",
|
||||
"storybook-addon-vis": "^3.1.2",
|
||||
"typedoc": "^0.28.16",
|
||||
"typedoc-plugin-markdown": "^4.9.0",
|
||||
"typedoc-plugin-missing-exports": "^4.1.2",
|
||||
"typescript": "^5.9.3",
|
||||
"typescript": "catalog:",
|
||||
"vite": "^7.3.1",
|
||||
"vite-plugin-dts": "^4.5.4",
|
||||
"vite-plugin-node-polyfills": "^0.25.0",
|
||||
@ -119,7 +118,7 @@
|
||||
"engines": {
|
||||
"node": ">=20.0.0"
|
||||
},
|
||||
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e",
|
||||
"packageManager": "pnpm@10.28.2+sha512.41872f037ad22f7348e3b1debbaf7e867cfd448f2726d9cf74c08f19507c31d2c8e7a11525b983febc2df640b5438dee6023ebb1f84ed43cc2d654d2bc326264",
|
||||
"peerDependencies": {
|
||||
"@vector-im/compound-web": "^8.3.5"
|
||||
}
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
# Update storybook screenshots
|
||||
#
|
||||
# This script should be used as the entrypoint parameter of the `playwright-screenshots` script. It
|
||||
# installs the yarn dependencies, and then runs `vitest --run --update --project=storybook` to update the storybook screenshots.
|
||||
# installs the pnpm dependencies, and then runs `vitest --run --update --project=storybook` to update the storybook screenshots.
|
||||
#
|
||||
# It requires that `playwright-screenshots` is given the `--with-node-modules` parameter.
|
||||
|
||||
@ -13,7 +13,7 @@ set -e
|
||||
# because we have which must be built for the right architecture (and some environments use a VM
|
||||
# to run docker containers, meaning that things inside a container use a different architecture than
|
||||
# those on the host).
|
||||
yarn
|
||||
pnpm install
|
||||
|
||||
# Now run the screenshot update, we set CI=1 to inform vis to update the real baselines
|
||||
CI=1 /work/node_modules/.bin/vitest --run --update --project=storybook "$@"
|
||||
|
||||
@ -94,7 +94,7 @@ const translateWithFallback = (text: string, options?: IVariables): { translated
|
||||
// Even the translation via FALLBACK_LOCALE failed; this can happen if
|
||||
//
|
||||
// 1. The string isn't in the translations dictionary, usually because you're in develop
|
||||
// and haven't run yarn i18n
|
||||
// and haven't run pnpm i18n
|
||||
// 2. Loading the translation resources over the network failed, which can happen due to
|
||||
// to network or if the client tried to load a translation that's been removed from the
|
||||
// server.
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,7 +1,7 @@
|
||||
diff --git a/node_modules/@matrix-org/react-sdk-module-api/lib/ModuleApi.d.ts b/node_modules/@matrix-org/react-sdk-module-api/lib/ModuleApi.d.ts
|
||||
index 917a7fc..a2710c6 100644
|
||||
--- a/node_modules/@matrix-org/react-sdk-module-api/lib/ModuleApi.d.ts
|
||||
+++ b/node_modules/@matrix-org/react-sdk-module-api/lib/ModuleApi.d.ts
|
||||
diff --git a/lib/ModuleApi.d.ts b/lib/ModuleApi.d.ts
|
||||
index 917a7fc073ea208ed8e45ccca994ae2ca0493bb8..a2710c6f99b1c6a9186232f3d1aa4d5e8a903062 100644
|
||||
--- a/lib/ModuleApi.d.ts
|
||||
+++ b/lib/ModuleApi.d.ts
|
||||
@@ -37,7 +37,7 @@ export interface ModuleApi {
|
||||
* @returns Whether the user submitted the dialog or closed it, and the model returned by the
|
||||
* dialog component if submitted.
|
||||
@ -11,11 +11,11 @@ index 917a7fc..a2710c6 100644
|
||||
didOkOrSubmit: boolean;
|
||||
model: M;
|
||||
}>;
|
||||
diff --git a/node_modules/@matrix-org/react-sdk-module-api/lib/lifecycles/CryptoSetupExtensions.d.ts b/node_modules/@matrix-org/react-sdk-module-api/lib/lifecycles/CryptoSetupExtensions.d.ts
|
||||
index cb5f2e5..51daa51 100644
|
||||
--- a/node_modules/@matrix-org/react-sdk-module-api/lib/lifecycles/CryptoSetupExtensions.d.ts
|
||||
+++ b/node_modules/@matrix-org/react-sdk-module-api/lib/lifecycles/CryptoSetupExtensions.d.ts
|
||||
@@ -66,23 +66,23 @@ export interface SetupEncryptionStoreProjection {
|
||||
diff --git a/lib/lifecycles/CryptoSetupExtensions.d.ts b/lib/lifecycles/CryptoSetupExtensions.d.ts
|
||||
index cb5f2e5224f36e4a258caf782d49bf925dd552b9..d3474c6847c0c65e953219bf6616c1d8a2c37b62 100644
|
||||
--- a/lib/lifecycles/CryptoSetupExtensions.d.ts
|
||||
+++ b/lib/lifecycles/CryptoSetupExtensions.d.ts
|
||||
@@ -66,8 +66,8 @@ export interface SetupEncryptionStoreProjection {
|
||||
export interface ProvideCryptoSetupExtensions {
|
||||
examineLoginResponse(response: any, credentials: ExtendedMatrixClientCreds): void;
|
||||
persistCredentials(credentials: ExtendedMatrixClientCreds): void;
|
||||
@ -26,10 +26,7 @@ index cb5f2e5..51daa51 100644
|
||||
catchAccessSecretStorageError(e: Error): void;
|
||||
setupEncryptionNeeded: (args: CryptoSetupArgs) => boolean;
|
||||
/** @deprecated This callback is no longer used by matrix-react-sdk */
|
||||
- getDehydrationKeyCallback(): ((keyInfo: SecretStorageKeyDescription, checkFunc: (key: Uint8Array) => void) => Promise<Uint8Array>) | null;
|
||||
+ getDehydrationKeyCallback(): ((keyInfo: SecretStorageKeyDescription, checkFunc: (key: Uint8Array<ArrayBuffer>) => void) => Promise<Uint8Array<ArrayBuffer>>) | null;
|
||||
SHOW_ENCRYPTION_SETUP_UI: boolean;
|
||||
}
|
||||
@@ -77,8 +77,8 @@ export interface ProvideCryptoSetupExtensions {
|
||||
export declare abstract class CryptoSetupExtensionsBase implements ProvideCryptoSetupExtensions {
|
||||
abstract examineLoginResponse(response: any, credentials: ExtendedMatrixClientCreds): void;
|
||||
abstract persistCredentials(credentials: ExtendedMatrixClientCreds): void;
|
||||
@ -40,12 +37,7 @@ index cb5f2e5..51daa51 100644
|
||||
abstract catchAccessSecretStorageError(e: Error): void;
|
||||
abstract setupEncryptionNeeded(args: CryptoSetupArgs): boolean;
|
||||
/** `getDehydrationKeyCallback` is no longer used; we provide an empty impl for type compatibility. */
|
||||
- getDehydrationKeyCallback(): ((keyInfo: SecretStorageKeyDescription, checkFunc: (key: Uint8Array) => void) => Promise<Uint8Array>) | null;
|
||||
+ getDehydrationKeyCallback(): ((keyInfo: SecretStorageKeyDescription, checkFunc: (key: Uint8Array<ArrayBuffer>) => void) => Promise<Uint8Array<ArrayBuffer>>) | null;
|
||||
abstract SHOW_ENCRYPTION_SETUP_UI: boolean;
|
||||
}
|
||||
export interface CryptoSetupArgs {
|
||||
@@ -98,9 +98,9 @@ export declare class DefaultCryptoSetupExtensions extends CryptoSetupExtensionsB
|
||||
@@ -98,8 +98,8 @@ export declare class DefaultCryptoSetupExtensions extends CryptoSetupExtensionsB
|
||||
SHOW_ENCRYPTION_SETUP_UI: boolean;
|
||||
examineLoginResponse(response: any, credentials: ExtendedMatrixClientCreds): void;
|
||||
persistCredentials(credentials: ExtendedMatrixClientCreds): void;
|
||||
@ -55,13 +47,11 @@ index cb5f2e5..51daa51 100644
|
||||
+ createSecretStorageKey(): Uint8Array<ArrayBuffer> | null;
|
||||
catchAccessSecretStorageError(e: Error): void;
|
||||
setupEncryptionNeeded(args: CryptoSetupArgs): boolean;
|
||||
- getDehydrationKeyCallback(): ((keyInfo: SecretStorageKeyDescription, checkFunc: (key: Uint8Array) => void) => Promise<Uint8Array>) | null;
|
||||
+ getDehydrationKeyCallback(): ((keyInfo: SecretStorageKeyDescription, checkFunc: (key: Uint8Array<ArrayBuffer>) => void) => Promise<Uint8Array<ArrayBuffer>>) | null;
|
||||
}
|
||||
diff --git a/node_modules/@matrix-org/react-sdk-module-api/lib/lifecycles/CryptoSetupExtensions.js b/node_modules/@matrix-org/react-sdk-module-api/lib/lifecycles/CryptoSetupExtensions.js
|
||||
index 5d422ed..b823add 100644
|
||||
--- a/node_modules/@matrix-org/react-sdk-module-api/lib/lifecycles/CryptoSetupExtensions.js
|
||||
+++ b/node_modules/@matrix-org/react-sdk-module-api/lib/lifecycles/CryptoSetupExtensions.js
|
||||
getDehydrationKeyCallback(): ((keyInfo: SecretStorageKeyDescription, checkFunc: (key: Uint8Array) => void) => Promise<Uint8Array>) | null;
|
||||
diff --git a/lib/lifecycles/CryptoSetupExtensions.js b/lib/lifecycles/CryptoSetupExtensions.js
|
||||
index 5d422ed500ac5846e713a8e8ecddb3be75357b60..011c19fafd06d1f203df1383360c52a45e387dcf 100644
|
||||
--- a/lib/lifecycles/CryptoSetupExtensions.js
|
||||
+++ b/lib/lifecycles/CryptoSetupExtensions.js
|
||||
@@ -124,34 +124,28 @@ var DefaultCryptoSetupExtensions = /*#__PURE__*/function (_CryptoSetupExtension)
|
||||
(0, _createClass2["default"])(DefaultCryptoSetupExtensions, [{
|
||||
key: "examineLoginResponse",
|
||||
@ -1,13 +1,13 @@
|
||||
diff --git a/node_modules/@types/mdx/types.d.ts b/node_modules/@types/mdx/types.d.ts
|
||||
index 498bb69..4e89216 100644
|
||||
--- a/node_modules/@types/mdx/types.d.ts
|
||||
+++ b/node_modules/@types/mdx/types.d.ts
|
||||
diff --git a/types.d.ts b/types.d.ts
|
||||
index 498bb694de2e6a62f14d3fe998dc538aff920fc6..ab288cdf8ca228fc8daaff2c5fb84ce665b40812 100644
|
||||
--- a/types.d.ts
|
||||
+++ b/types.d.ts
|
||||
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
// @ts-ignore JSX runtimes may optionally define JSX.ElementType. The MDX types need to work regardless whether this is
|
||||
// defined or not.
|
||||
-type ElementType = any extends JSX.ElementType ? never : JSX.ElementType;
|
||||
+type ElementType = any extends JSX.ElementType ? never : React.JSX.ElementType;
|
||||
+type ElementType = any extends React.JSX.ElementType ? never : React.JSX.ElementType;
|
||||
|
||||
/**
|
||||
* This matches any function component types that ar part of `ElementType`.
|
||||
@ -1,12 +0,0 @@
|
||||
diff --git a/node_modules/@vector-im/matrix-wysiwyg/package.json b/node_modules/@vector-im/matrix-wysiwyg/package.json
|
||||
index 8163a3b..dfef973 100644
|
||||
--- a/node_modules/@vector-im/matrix-wysiwyg/package.json
|
||||
+++ b/node_modules/@vector-im/matrix-wysiwyg/package.json
|
||||
@@ -11,6 +11,7 @@
|
||||
"license": "SEE LICENSE IN README.md",
|
||||
"exports": {
|
||||
".": {
|
||||
+ "types": "./dist/index.d.ts",
|
||||
"import": "./dist/matrix-wysiwyg.js",
|
||||
"require": "./dist/matrix-wysiwyg.umd.cjs"
|
||||
}
|
||||
12
patches/@vector-im__matrix-wysiwyg.patch
Normal file
12
patches/@vector-im__matrix-wysiwyg.patch
Normal file
@ -0,0 +1,12 @@
|
||||
diff --git a/package.json b/package.json
|
||||
index 8163a3bea0bba33af6fc97cd21c1a04ddef548b7..dfef973c43d84b8f0453be7e67db89a654426c60 100644
|
||||
--- a/package.json
|
||||
+++ b/package.json
|
||||
@@ -11,6 +11,7 @@
|
||||
"license": "SEE LICENSE IN README.md",
|
||||
"exports": {
|
||||
".": {
|
||||
+ "types": "./dist/index.d.ts",
|
||||
"import": "./dist/matrix-wysiwyg.js",
|
||||
"require": "./dist/matrix-wysiwyg.umd.cjs"
|
||||
}
|
||||
@ -1,7 +1,7 @@
|
||||
diff --git a/node_modules/await-lock/package.json b/node_modules/await-lock/package.json
|
||||
index 84a2734..cbda839 100644
|
||||
--- a/node_modules/await-lock/package.json
|
||||
+++ b/node_modules/await-lock/package.json
|
||||
diff --git a/package.json b/package.json
|
||||
index 84a2734a8989f43fd5368adbd4638b52560a11ab..cbda8398f3b4094b2d86152211811fe6c2342232 100644
|
||||
--- a/package.json
|
||||
+++ b/package.json
|
||||
@@ -6,7 +6,8 @@
|
||||
"exports": {
|
||||
".": {
|
||||
@ -1,11 +1,11 @@
|
||||
diff --git a/node_modules/jest-fixed-jsdom/index.js b/node_modules/jest-fixed-jsdom/index.js
|
||||
diff --git a/index.js b/index.js
|
||||
index ac8033b..b1ba8f0 100644
|
||||
--- a/node_modules/jest-fixed-jsdom/index.js
|
||||
+++ b/node_modules/jest-fixed-jsdom/index.js
|
||||
--- a/index.js
|
||||
+++ b/index.js
|
||||
@@ -21,9 +21,10 @@ class FixedJSDOMEnvironment extends JSDOMEnvironment {
|
||||
this.global.TextEncoderStream = TextEncoderStream
|
||||
this.global.ReadableStream = ReadableStream
|
||||
|
||||
|
||||
- this.global.Blob = Blob
|
||||
+ // this.global.Blob = Blob
|
||||
+ // this.global.File = File
|
||||
@ -1,10 +1,10 @@
|
||||
diff --git a/node_modules/jsdom/lib/jsdom/browser/Window.js b/node_modules/jsdom/lib/jsdom/browser/Window.js
|
||||
diff --git a/lib/jsdom/browser/Window.js b/lib/jsdom/browser/Window.js
|
||||
index 52d011c..f62f6d6 100644
|
||||
--- a/node_modules/jsdom/lib/jsdom/browser/Window.js
|
||||
+++ b/node_modules/jsdom/lib/jsdom/browser/Window.js
|
||||
--- a/lib/jsdom/browser/Window.js
|
||||
+++ b/lib/jsdom/browser/Window.js
|
||||
@@ -505,10 +505,10 @@ function installOwnProperties(window, options) {
|
||||
event: makeReplaceablePropertyDescriptor("event", window),
|
||||
|
||||
|
||||
// [LegacyUnforgeable]:
|
||||
- window: { configurable: false },
|
||||
- document: { configurable: false },
|
||||
@ -15,12 +15,12 @@ index 52d011c..f62f6d6 100644
|
||||
+ location: { configurable: true },
|
||||
+ top: { configurable: true }
|
||||
});
|
||||
|
||||
|
||||
diff --git a/node_modules/jsdom/lib/jsdom/living/generated/Location.js b/node_modules/jsdom/lib/jsdom/living/generated/Location.js
|
||||
|
||||
|
||||
diff --git a/lib/jsdom/living/generated/Location.js b/lib/jsdom/living/generated/Location.js
|
||||
index fc4d1dd..c855bd5 100644
|
||||
--- a/node_modules/jsdom/lib/jsdom/living/generated/Location.js
|
||||
+++ b/node_modules/jsdom/lib/jsdom/living/generated/Location.js
|
||||
--- a/lib/jsdom/living/generated/Location.js
|
||||
+++ b/lib/jsdom/living/generated/Location.js
|
||||
@@ -322,19 +322,19 @@ function getUnforgeables(globalObject) {
|
||||
}
|
||||
});
|
||||
@ -1,7 +1,7 @@
|
||||
diff --git a/node_modules/linkify-html/dist/linkify-html.mjs b/node_modules/linkify-html/dist/linkify-html.mjs
|
||||
index 63b1fe5..f61e3b7 100644
|
||||
--- a/node_modules/linkify-html/dist/linkify-html.mjs
|
||||
+++ b/node_modules/linkify-html/dist/linkify-html.mjs
|
||||
diff --git a/dist/linkify-html.mjs b/dist/linkify-html.mjs
|
||||
index 63b1fe5019a58d73986974fc621701db33a4ac11..f61e3b7118ed6adc93da88ca9ecf2dce486989fd 100644
|
||||
--- a/dist/linkify-html.mjs
|
||||
+++ b/dist/linkify-html.mjs
|
||||
@@ -201,6 +201,8 @@ var EventedTokenizer = /** @class */function () {
|
||||
this.consume();
|
||||
if (this.delegate.endDoctype) this.delegate.endDoctype();
|
||||
@ -1,7 +1,7 @@
|
||||
diff --git a/node_modules/react-blurhash/dist/index.d.ts b/node_modules/react-blurhash/dist/index.d.ts
|
||||
index 3adbd0a..32e8c13 100644
|
||||
--- a/node_modules/react-blurhash/dist/index.d.ts
|
||||
+++ b/node_modules/react-blurhash/dist/index.d.ts
|
||||
diff --git a/dist/index.d.ts b/dist/index.d.ts
|
||||
index 3adbd0a4561d9114277241af6994111f97e17cbf..32e8c13a574d860d589c2c8232795b8fc1e3195f 100644
|
||||
--- a/dist/index.d.ts
|
||||
+++ b/dist/index.d.ts
|
||||
@@ -19,7 +19,7 @@ declare class Blurhash extends React.PureComponent<Props$1> {
|
||||
resolutionY: number;
|
||||
};
|
||||
@ -79,7 +79,7 @@ export default defineConfig<WorkerOptions>({
|
||||
trace: "on-first-retry",
|
||||
},
|
||||
webServer: {
|
||||
command: process.env.CI ? "npx serve -p 8080 -L ./webapp" : "yarn start",
|
||||
command: process.env.CI ? "npx serve -p 8080 -L ./webapp" : "pnpm start",
|
||||
url: `${baseURL}/config.json`,
|
||||
reuseExistingServer: true,
|
||||
timeout: (process.env.CI ? 30 : 120) * 1000,
|
||||
|
||||
@ -15,7 +15,7 @@ test.use({
|
||||
// We redirect to decoder-ring because it's a predictable page that isn't Element itself.
|
||||
// We could use example.org, matrix.org, or something else, however this puts dependency of external
|
||||
// infrastructure on our tests. In the same vein, we don't really want to figure out how to ship a
|
||||
// `test-landing.html` page when running with an uncontrolled Element (via `yarn start`).
|
||||
// `test-landing.html` page when running with an uncontrolled Element (via `pnpm start`).
|
||||
// Using the decoder-ring is just as fine, and we can search for strategic names.
|
||||
logout_redirect_url: "/decoder-ring/",
|
||||
},
|
||||
|
||||
21159
pnpm-lock.yaml
generated
Normal file
21159
pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load Diff
12
pnpm-workspace.yaml
Normal file
12
pnpm-workspace.yaml
Normal file
@ -0,0 +1,12 @@
|
||||
nodeLinker: hoisted
|
||||
linkWorkspacePackages: true
|
||||
packages:
|
||||
- "packages/*"
|
||||
catalog:
|
||||
# typescript
|
||||
typescript: 5.9.3
|
||||
# react
|
||||
react: ^19.0.0
|
||||
react-dom: ^19.0.0
|
||||
"@types/react": ^19.2.10
|
||||
"@types/react-dom": ^19.2.3
|
||||
@ -28,7 +28,7 @@ ignore.push("/common.ts");
|
||||
// We ignore js-sdk by default as it may export for other non element-web projects
|
||||
if (!includeJSSDK) ignore.push("matrix-js-sdk");
|
||||
|
||||
const command = `yarn ts-prune --ignore "${ignore.join("|")}" | grep -v "(used in module)"`;
|
||||
const command = `pnpm ts-prune --ignore "${ignore.join("|")}" | grep -v "(used in module)"`;
|
||||
|
||||
exec(command, (error, stdout, stderr) => {
|
||||
if (error) throw error;
|
||||
|
||||
@ -21,9 +21,9 @@ fi
|
||||
echo "Linking js-sdk"
|
||||
git clone --depth 1 --branch $JS_SDK_BRANCH "$JS_SDK_REPO" js-sdk
|
||||
cd js-sdk
|
||||
yarn link
|
||||
yarn --network-timeout=100000 install
|
||||
pnpm link
|
||||
pnpm install
|
||||
cd ../
|
||||
|
||||
echo "Setting up element-web with js-sdk package"
|
||||
yarn link matrix-js-sdk
|
||||
pnpm link matrix-js-sdk
|
||||
|
||||
@ -18,4 +18,4 @@ fi
|
||||
|
||||
DIST_VERSION=$("$DIR"/normalize-version.sh "$DIST_VERSION")
|
||||
|
||||
VERSION=$DIST_VERSION yarn build
|
||||
VERSION=$DIST_VERSION pnpm build
|
||||
|
||||
@ -14,7 +14,7 @@ set -ex
|
||||
# for the primary repo (element-web in this case).
|
||||
|
||||
# Install dependencies
|
||||
yarn install --frozen-lockfile
|
||||
pnpm install --frozen-lockfile
|
||||
|
||||
# Pass appropriate repo to fetchdep.sh
|
||||
export PR_ORG=element-hq
|
||||
@ -24,8 +24,8 @@ export PR_REPO=element-web
|
||||
scripts/fetchdep.sh matrix-org matrix-js-sdk develop
|
||||
pushd matrix-js-sdk
|
||||
[ -n "$JS_SDK_GITHUB_BASE_REF" ] && git fetch --depth 1 origin $JS_SDK_GITHUB_BASE_REF && git checkout $JS_SDK_GITHUB_BASE_REF
|
||||
yarn link
|
||||
yarn install --frozen-lockfile
|
||||
pnpm link
|
||||
pnpm install --frozen-lockfile
|
||||
popd
|
||||
|
||||
# Also set up matrix-analytics-events for branch with matching name
|
||||
@ -34,13 +34,13 @@ scripts/fetchdep.sh matrix-org matrix-analytics-events
|
||||
# This is expected as this project does not share a release cycle but we still branch match it
|
||||
if [ -d matrix-analytics-events ]; then
|
||||
pushd matrix-analytics-events
|
||||
yarn link
|
||||
yarn install --frozen-lockfile
|
||||
yarn build:ts
|
||||
pnpm link
|
||||
pnpm install --frozen-lockfile
|
||||
pnpm build:ts
|
||||
popd
|
||||
fi
|
||||
|
||||
# Link the layers into element-web
|
||||
yarn link matrix-js-sdk
|
||||
[ -d matrix-analytics-events ] && yarn link @matrix-org/analytics-events
|
||||
yarn install --frozen-lockfile $@
|
||||
pnpm link matrix-js-sdk
|
||||
[ -d matrix-analytics-events ] && pnpm link @matrix-org/analytics-events
|
||||
pnpm install --frozen-lockfile $@
|
||||
|
||||
@ -8,11 +8,11 @@ else
|
||||
version=`git describe --dirty --tags || echo unknown`
|
||||
fi
|
||||
|
||||
yarn clean
|
||||
VERSION=$version yarn build
|
||||
pnpm clean
|
||||
VERSION=$version pnpm build
|
||||
|
||||
# include the sample config in the tarball. Arguably this should be done by
|
||||
# `yarn build`, but it's just too painful.
|
||||
# `pnpm build`, but it's just too painful.
|
||||
cp config.sample.json webapp/
|
||||
|
||||
mkdir -p dist
|
||||
|
||||
58
scripts/pnpm-link.ts
Executable file
58
scripts/pnpm-link.ts
Executable file
@ -0,0 +1,58 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
/*
|
||||
Copyright 2026 Element Creations Ltd.
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
|
||||
Please see LICENSE files in the repository root for full details.
|
||||
*/
|
||||
|
||||
// Utility script to mimic yarn classic `link` behaviour
|
||||
// to enable rapid development of libraries like matrix-js-sdk using symlinks/directory junctions
|
||||
// reads .link-config file for DEPENDENCY=PATH values and removes those dependencies from node_modules,
|
||||
// replacing them with a symlink/directory junction.
|
||||
// This tool is a helpful substitute to `pnpm link` as that modifies the package.json & pnpm-lock.yaml files.
|
||||
|
||||
import fs from "node:fs/promises";
|
||||
import { join, dirname } from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { execSync } from "node:child_process";
|
||||
|
||||
const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||
const configPath = join(__dirname, "..", ".link-config");
|
||||
const nodeModulesPath = join(__dirname, "..", "node_modules");
|
||||
|
||||
try {
|
||||
const configFile = await fs.readFile(configPath, "utf-8");
|
||||
for (const line of configFile.trim().split("\n")) {
|
||||
const [dependency, path] = line.split("=");
|
||||
const dependencyPath = join(nodeModulesPath, dependency);
|
||||
|
||||
try {
|
||||
const stat = await fs.stat(dependencyPath);
|
||||
if (stat.isSymbolicLink()) {
|
||||
const linkPath = await fs.readlink(dependencyPath);
|
||||
if (linkPath === path) {
|
||||
// already done
|
||||
continue;
|
||||
} else {
|
||||
await fs.unlink(dependencyPath);
|
||||
}
|
||||
} else {
|
||||
await fs.rm(dependencyPath, { recursive: true });
|
||||
}
|
||||
|
||||
console.log(`Linking ${dependency} to ${path}`);
|
||||
await fs.symlink(path, dependencyPath);
|
||||
|
||||
// pnpm install may have wiped out the `node_modules` dir so we have to restore it
|
||||
execSync("pnpm i --ignore-scripts --frozen-lockfile", {
|
||||
cwd: dependencyPath,
|
||||
});
|
||||
} catch (e) {
|
||||
console.error(`Failed to link ${dependency}`, e);
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
// Ignore config file not existing
|
||||
}
|
||||
@ -8,8 +8,6 @@ Please see LICENSE files in the repository root for full details.
|
||||
/* TODO: Match the user's theme: https://github.com/element-hq/element-web/issues/12794 */
|
||||
|
||||
@import url("@vector-im/compound-design-tokens/assets/web/css/compound-design-tokens.css");
|
||||
/* Path to `res` dir in the source tree */
|
||||
$res: ../../../res;
|
||||
|
||||
@font-face {
|
||||
font-family: "Nunito";
|
||||
|
||||
@ -91,11 +91,11 @@ const moduleReplacementPlugins = [
|
||||
module.exports = (env, argv) => {
|
||||
// Establish settings based on the environment and args.
|
||||
//
|
||||
// argv.mode is always set to "production" by yarn build
|
||||
// argv.mode is always set to "production" by pnpm build
|
||||
// (called to build prod, nightly and develop.element.io)
|
||||
// arg.mode is set to "development" by yarn start
|
||||
// arg.mode is set to "development" by pnpm start
|
||||
// (called by developers, runs the continuous reload script)
|
||||
// process.env.CI_PACKAGE is set when yarn build is called from scripts/ci_package.sh
|
||||
// process.env.CI_PACKAGE is set when pnpm build is called from scripts/ci_package.sh
|
||||
// (called to build nightly and develop.element.io)
|
||||
const nodeEnv = argv.mode;
|
||||
const devMode = nodeEnv !== "production";
|
||||
@ -204,7 +204,7 @@ module.exports = (env, argv) => {
|
||||
alias: {
|
||||
// alias any requires to the react module to the one in our path,
|
||||
// otherwise we tend to get the react source included twice when
|
||||
// using `npm link` / `yarn link`.
|
||||
// using linked dependencies.
|
||||
"react": path.resolve(__dirname, "node_modules/react"),
|
||||
"react-dom": path.resolve(__dirname, "node_modules/react-dom"),
|
||||
|
||||
@ -281,7 +281,7 @@ module.exports = (env, argv) => {
|
||||
|
||||
// we use the original source files of js-sdk, so we need to
|
||||
// run them through babel. Because the path tested is the resolved, absolute
|
||||
// path, these could be anywhere thanks to yarn link. We must also not
|
||||
// path, these could be anywhere thanks to linking. We must also not
|
||||
// include node modules inside these modules, so we add 'src'.
|
||||
if (f.startsWith(jsSdkSrcDir)) return true;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user