Compare commits

...

32 Commits

Author SHA1 Message Date
Michael Telatynski
a98504df5c Fix localazy download by using pnpm (#2851) 2026-02-13 09:15:45 +00:00
Michael Telatynski
684f7c04ff Switch element-desktop from yarn classic to pnpm (#2843) 2026-02-11 10:50:23 +00:00
RiotRobot
ebf12081c9 Merge branch 'master' into develop 2026-02-10 16:08:26 +00:00
Michael Telatynski
699ea6d16a Delete .github/ISSUE_TEMPLATE/enhancement.yml 2026-02-10 13:11:19 +00:00
Michael Telatynski
18383ef63a Delete .github/ISSUE_TEMPLATE/bug-desktop.yml 2026-02-10 13:11:13 +00:00
Michael Telatynski
709b861741 Add contact link for Element Desktop bug reports 2026-02-10 13:10:54 +00:00
R Midhun Suresh
a794fe12d4 Merge pull request #2847 from element-hq/midhun/reverts/exit-behaviour
Revert exit logic PRs
2026-02-10 15:16:53 +05:30
R Midhun Suresh
69b51bd278 Revert exit logic PRs 2026-02-09 19:55:38 +05:30
R Midhun Suresh
2e349187b3 Merge pull request #2841 from element-hq/midhun/improve-exit-code
Remove unnecessary check from app exit code
2026-02-06 13:09:06 +05:30
R Midhun Suresh
8a30ac18fc Remove unncessary check 2026-02-05 18:55:12 +05:30
R Midhun Suresh
657e9d2339 Merge pull request #2840 from element-hq/midhun/fix-exit-behaviour
Fix issues with quit logic
2026-02-05 17:54:26 +05:30
R Midhun Suresh
be6fb4e881 Confirm exit when running tests 2026-02-05 17:28:07 +05:30
R Midhun Suresh
067e8e27c1 Set boolean to false when exit is cancelled 2026-02-05 13:32:51 +05:30
R Midhun Suresh
2766333e8a Fix issues with quit logic 2026-02-05 13:13:11 +05:30
ElementRobot
7a00e61675 Merge pull request #2839 from element-hq/actions/localazy-download
Localazy Download
2026-02-04 11:30:25 +01:00
t3chguy
d4ad12300e [create-pull-request] automated change 2026-02-04 06:20:16 +00:00
David Baker
a16ddf7f0d Merge pull request #2836 from element-hq/renovate/electron
Update electron
2026-02-03 17:04:57 +00:00
David Baker
f9a1855bbd Merge pull request #2833 from element-hq/renovate/rust-bullseye
Update rust:bullseye Docker digest to 3ebcc2d
2026-02-03 17:02:44 +00:00
David Baker
0bd5657bab Merge pull request #2831 from element-hq/renovate/actions-setup-python-digest
Update actions/setup-python digest to a309ff8
2026-02-03 16:28:49 +00:00
David Baker
4828e73fe6 Merge pull request #2837 from element-hq/renovate/playwright
Update playwright to v1.58.1
2026-02-03 16:15:01 +00:00
David Baker
97b1df6d4e Merge pull request #2835 from element-hq/renovate/matrix-org
Update dependency matrix-web-i18n to v3.6.0
2026-02-03 16:13:40 +00:00
David Baker
b15ec07272 Merge pull request #2834 from element-hq/renovate/npm-minor-patch
Update npm non-major dependencies
2026-02-03 16:13:12 +00:00
David Baker
f2de2c4503 Merge pull request #2832 from element-hq/renovate/docker
Update docker/login-action digest to 3227f53
2026-02-03 16:11:33 +00:00
David Baker
16e1b10278 Merge pull request #2830 from element-hq/renovate/actions-cache-digest
Update actions/cache digest to cdf6c1f
2026-02-03 15:55:10 +00:00
renovate[bot]
dfd8647ad1 Update playwright to v1.58.1 2026-02-03 15:17:49 +00:00
renovate[bot]
a175dc7ec4 Update electron 2026-02-03 15:17:37 +00:00
renovate[bot]
150f4f7a7d Update dependency matrix-web-i18n to v3.6.0 2026-02-03 15:17:20 +00:00
renovate[bot]
e1da99ee8b Update npm non-major dependencies 2026-02-03 15:17:07 +00:00
renovate[bot]
406a1c9883 Update rust:bullseye Docker digest to 3ebcc2d 2026-02-03 15:16:45 +00:00
renovate[bot]
717b7ca725 Update docker/login-action digest to 3227f53 2026-02-03 15:16:39 +00:00
renovate[bot]
e01f598138 Update actions/setup-python digest to a309ff8 2026-02-03 15:16:32 +00:00
renovate[bot]
8915b008f7 Update actions/cache digest to cdf6c1f 2026-02-03 15:16:25 +00:00
33 changed files with 9756 additions and 7691 deletions

2
.github/CODEOWNERS vendored
View File

@@ -1,5 +1,5 @@
* @element-hq/element-web-reviewers * @element-hq/element-web-reviewers
/.github/workflows/** @element-hq/element-web-team /.github/workflows/** @element-hq/element-web-team
/package.json @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/i18n/strings /src/i18n/strings

View File

@@ -1,76 +0,0 @@
name: Bug report for the Element desktop app (not in a browser)
description: File a bug report if you are using the desktop Element application.
labels: [T-Defect]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report!
Please report security issues by email to security@matrix.org
- type: textarea
id: reproduction-steps
attributes:
label: Steps to reproduce
description: Please attach screenshots, videos or logs if you can.
placeholder: Tell us what you see!
value: |
1. Where are you starting? What can you see?
2. What do you click?
3. More steps…
validations:
required: true
- type: textarea
id: result
attributes:
label: Outcome
placeholder: Tell us what went wrong
value: |
#### What did you expect?
#### What happened instead?
validations:
required: true
- type: input
id: os
attributes:
label: Operating system
placeholder: Windows, macOS, Ubuntu, Arch Linux…
validations:
required: false
- type: input
id: version
attributes:
label: Application version
description: You can find the version information in Settings -> Help & About.
placeholder: e.g. Element version 1.7.34, olm version 3.2.3
validations:
required: false
- type: input
id: source
attributes:
label: How did you install the app?
description: Where did you install the app from? Please give a link or a description.
placeholder: e.g. From https://element.io/get-started
validations:
required: false
- type: input
id: homeserver
attributes:
label: Homeserver
description: |
Which server is your account registered on? If it is a local or non-public homeserver, please tell us what is the homeserver implementation (ex: Synapse/Dendrite/etc.) and the version.
placeholder: e.g. matrix.org or Synapse 1.50.0rc1
validations:
required: false
- type: dropdown
id: rageshake
attributes:
label: Will you send logs?
description: |
Did you know that you can send a /rageshake command from your application to submit logs for this issue? Trigger the defect, then type `/rageshake` into the message input area followed by a description of the problem and send the command. You will be able to add a link to this defect report and submit anonymous logs to the developers.
options:
- "Yes"
- "No"
validations:
required: true

View File

@@ -3,3 +3,6 @@ contact_links:
- name: Bug report for the Element flatpak app - name: Bug report for the Element flatpak app
url: https://github.com/flathub/im.riot.Riot/issues url: https://github.com/flathub/im.riot.Riot/issues
about: Please file bugs with the Flatpak application on the respective repository. about: Please file bugs with the Flatpak application on the respective repository.
- name: Bug report for Element Desktop
url: https://github.com/element-hq/element-web/issues/new/choose
about: Please file all Element Desktop bugs in element-web.

View File

@@ -1,36 +0,0 @@
name: Enhancement request
description: Do you have a suggestion or feature request?
labels: [T-Enhancement]
body:
- type: markdown
attributes:
value: |
Thank you for taking the time to propose an enhancement to an existing feature. If you would like to propose a new feature or a major cross-platform change, please [start a discussion here](https://github.com/vector-im/element-meta/discussions/new?category=ideas).
- type: textarea
id: usecase
attributes:
label: Your use case
description: What would you like to be able to do? Please feel welcome to include screenshots or mock ups.
placeholder: Tell us what you would like to do!
value: |
#### What would you like to do?
#### Why would you like to do it?
#### How would you like to achieve it?
validations:
required: true
- type: textarea
id: alternative
attributes:
label: Have you considered any alternatives?
placeholder: A clear and concise description of any alternative solutions or features you've considered.
validations:
required: false
- type: textarea
id: additional-context
attributes:
label: Additional context
placeholder: Is there anything else you'd like to add?
validations:
required: false

View File

@@ -55,13 +55,14 @@ jobs:
steps: steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6 - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
with: with:
cache: "yarn" cache: "pnpm"
node-version: "lts/*" node-version: "lts/*"
- name: Install dependencies - name: Install dependencies
run: yarn install --frozen-lockfile run: pnpm install --frozen-lockfile
- name: Download blob reports from GitHub Actions Artifacts - name: Download blob reports from GitHub Actions Artifacts
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7 uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7
@@ -71,7 +72,7 @@ jobs:
merge-multiple: true merge-multiple: true
- name: Merge into HTML Report - name: Merge into HTML Report
run: yarn playwright merge-reports -c ./playwright.config.ts --reporter=html ./all-blob-reports run: pnpm playwright merge-reports -c ./playwright.config.ts --reporter=html ./all-blob-reports
- name: Upload HTML report - name: Upload HTML report
if: always() if: always()

View File

@@ -116,22 +116,23 @@ jobs:
- name: Cache .hak - name: Cache .hak
id: cache id: cache
uses: actions/cache@8b402f58fbc84540c8b491a91e594a4576fec3d7 # v5 uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5
with: with:
key: ${{ runner.os }}-${{ github.ref_name }}-${{ inputs.sqlcipher }}-${{ inputs.arch }}-${{ hashFiles('hakHash', 'electronVersion', 'dockerbuild/*') }} key: ${{ runner.os }}-${{ github.ref_name }}-${{ inputs.sqlcipher }}-${{ inputs.arch }}-${{ hashFiles('hakHash', 'electronVersion', 'dockerbuild/*') }}
path: | path: |
./.hak ./.hak
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6 - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
with: with:
node-version-file: .node-version node-version-file: .node-version
cache: "yarn" cache: "pnpm"
env: env:
# Workaround for https://github.com/actions/setup-node/issues/317 # Workaround for https://github.com/actions/setup-node/issues/317
FORCE_COLOR: 0 FORCE_COLOR: 0
- name: Install Deps - name: Install Deps
run: "yarn install --frozen-lockfile" run: pnpm install --frozen-lockfile
- name: "Get modified files" - name: "Get modified files"
id: changed_files id: changed_files
@@ -157,11 +158,16 @@ jobs:
docker run \ docker run \
-v ${{ github.workspace }}:/work -w /work \ -v ${{ github.workspace }}:/work -w /work \
-e SQLCIPHER_BUNDLED \ -e SQLCIPHER_BUNDLED \
-e CI=1 \
$HAK_DOCKER_IMAGE \ $HAK_DOCKER_IMAGE \
yarn build:native pnpm build:native
- name: Fix permissions on .hak - name: Fix permissions
run: sudo chown -R $USER:$USER .hak run: |
# For .hak
sudo chown -R $USER:$USER .hak
# For node_modules pnpm strict security
sudo chmod +x node_modules/7zip-bin/linux/*/7za
- name: Check native libraries in hak dependencies - name: Check native libraries in hak dependencies
run: | run: |
@@ -178,7 +184,7 @@ jobs:
fi fi
- name: Build App - name: Build App
run: yarn build --publish never ${{ steps.config.outputs.build-args }} -l ${{ inputs.targets }} run: pnpm build --publish never ${{ steps.config.outputs.build-args }} -l ${{ inputs.targets }}
env: env:
VARIANT_PATH: variant.json VARIANT_PATH: variant.json
# Only set for Nightly builds # Only set for Nightly builds

View File

@@ -90,7 +90,7 @@ jobs:
- name: Cache .hak - name: Cache .hak
id: cache id: cache
uses: actions/cache@8b402f58fbc84540c8b491a91e594a4576fec3d7 # v5 uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5
with: with:
key: ${{ runner.os }}-${{ hashFiles('hakHash', 'electronVersion') }} key: ${{ runner.os }}-${{ hashFiles('hakHash', 'electronVersion') }}
path: | path: |
@@ -105,7 +105,7 @@ jobs:
rustup target add x86_64-apple-darwin rustup target add x86_64-apple-darwin
# M1 macos-14 comes without Python preinstalled # M1 macos-14 comes without Python preinstalled
- uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6 - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with: with:
python-version: "3.13" python-version: "3.13"
@@ -113,23 +113,24 @@ jobs:
# https://github.com/electron-userland/electron-builder/issues/9511#issuecomment-3774092888 # https://github.com/electron-userland/electron-builder/issues/9511#issuecomment-3774092888
- run: sudo pip3 install pyobjc-framework-Quartz - run: sudo pip3 install pyobjc-framework-Quartz
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6 - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
with: with:
node-version-file: .node-version node-version-file: .node-version
cache: "yarn" cache: "pnpm"
- name: Install Deps - name: Install Deps
run: "yarn install --frozen-lockfile" run: "pnpm install --frozen-lockfile"
- name: Build Natives - name: Build Natives
if: steps.cache.outputs.cache-hit != 'true' if: steps.cache.outputs.cache-hit != 'true'
run: yarn build:native:universal run: pnpm build:native:universal
# We split these because electron-builder gets upset if we set CSC_LINK even to an empty string # We split these because electron-builder gets upset if we set CSC_LINK even to an empty string
- name: "[Signed] Build App" - name: "[Signed] Build App"
if: inputs.sign != '' if: inputs.sign != ''
run: | run: |
yarn build:universal --publish never -m ${{ inputs.targets }} pnpm build:universal --publish never -m ${{ inputs.targets }}
env: env:
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
APPLE_ID: ${{ secrets.APPLE_ID }} APPLE_ID: ${{ secrets.APPLE_ID }}
@@ -151,7 +152,7 @@ jobs:
- name: "[Unsigned] Build App" - name: "[Unsigned] Build App"
if: inputs.sign == '' if: inputs.sign == ''
run: | run: |
yarn build:universal --publish never -m ${{ inputs.targets }} pnpm build:universal --publish never -m ${{ inputs.targets }}
env: env:
CSC_IDENTITY_AUTO_DISCOVERY: false CSC_IDENTITY_AUTO_DISCOVERY: false
VARIANT_PATH: variant.json VARIANT_PATH: variant.json

View File

@@ -56,13 +56,14 @@ jobs:
steps: steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6 - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
with: with:
node-version-file: .node-version node-version-file: .node-version
cache: "yarn" cache: "pnpm"
- name: Install Deps - name: Install Deps
run: "yarn install --frozen-lockfile" run: "pnpm install --frozen-lockfile"
- name: Fetch Element Web (matching branch) - name: Fetch Element Web (matching branch)
id: branch-matching id: branch-matching
@@ -71,10 +72,10 @@ jobs:
run: | run: |
scripts/branch-match.sh scripts/branch-match.sh
cp "$CONFIG_DIR/config.json" element-web/ cp "$CONFIG_DIR/config.json" element-web/
yarn --cwd element-web install --frozen-lockfile pnpm --cwd element-web install --frozen-lockfile
yarn --cwd element-web run build pnpm --cwd element-web run build
mv element-web/webapp . mv element-web/webapp .
yarn asar-webapp pnpm asar-webapp
env: env:
# These must be set for branch-match.sh to get the right branch # These must be set for branch-match.sh to get the right branch
REPOSITORY: ${{ github.repository }} REPOSITORY: ${{ github.repository }}
@@ -83,7 +84,7 @@ jobs:
- name: Fetch Element Web (${{ inputs.version }}) - name: Fetch Element Web (${{ inputs.version }})
if: steps.branch-matching.outcome == 'failure' || steps.branch-matching.outcome == 'skipped' if: steps.branch-matching.outcome == 'failure' || steps.branch-matching.outcome == 'skipped'
run: yarn run fetch --noverify -d ${{ inputs.config }} ${{ inputs.version }} run: pnpm run fetch --noverify -d ${{ inputs.config }} ${{ inputs.version }}
- name: Copy variant config - name: Copy variant config
run: cp "$CONFIG_DIR/build.json" variant.json run: cp "$CONFIG_DIR/build.json" variant.json
@@ -93,8 +94,9 @@ jobs:
# We split this out to save the build_* scripts having to do it to make use of `hashFiles` in the cache action # We split this out to save the build_* scripts having to do it to make use of `hashFiles` in the cache action
- name: Generate cache hash files - name: Generate cache hash files
run: | run: |
set -ex
# Add --no-sandbox as otherwise it fails because the helper isn't setuid root. It's only getting the version. # Add --no-sandbox as otherwise it fails because the helper isn't setuid root. It's only getting the version.
yarn run --silent electron --no-sandbox --version > electronVersion pnpm --silent electron --no-sandbox --version > electronVersion
cat package.json | jq -c .hakDependencies | sha1sum > hakHash cat package.json | jq -c .hakDependencies | sha1sum > hakHash
find hak -type f -print0 | xargs -0 sha1sum >> hakHash find hak -type f -print0 | xargs -0 sha1sum >> hakHash
find scripts/hak -type f -print0 | xargs -0 sha1sum >> hakHash find scripts/hak -type f -print0 | xargs -0 sha1sum >> hakHash

View File

@@ -40,13 +40,14 @@ jobs:
with: with:
repository: ${{ github.repository == 'element-hq/element-web-pro' && 'element-hq/element-desktop' || github.repository }} repository: ${{ github.repository == 'element-hq/element-web-pro' && 'element-hq/element-desktop' || github.repository }}
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6 - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
with: with:
node-version-file: .node-version node-version-file: .node-version
cache: "yarn" cache: "pnpm"
- name: Install Deps - name: Install Deps
run: "yarn install --frozen-lockfile" run: "pnpm install --frozen-lockfile"
- uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7 - uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7
with: with:
@@ -80,7 +81,7 @@ jobs:
uses: coactions/setup-xvfb@6b00cf1889f4e1d5a48635647013c0508128ee1a uses: coactions/setup-xvfb@6b00cf1889f4e1d5a48635647013c0508128ee1a
timeout-minutes: 20 timeout-minutes: 20
with: with:
run: yarn test --project=${{ inputs.project }} ${{ runner.os != 'Linux' && '--ignore-snapshots' || '' }} ${{ inputs.blob_report == false && '--reporter=html' || '' }} ${{ inputs.args }} run: pnpm test --project=${{ inputs.project }} ${{ runner.os != 'Linux' && '--ignore-snapshots' || '' }} ${{ inputs.blob_report == false && '--reporter=html' || '' }} ${{ inputs.args }}
env: env:
ELEMENT_DESKTOP_EXECUTABLE: ${{ steps.executable.outputs.path }} ELEMENT_DESKTOP_EXECUTABLE: ${{ steps.executable.outputs.path }}

View File

@@ -119,7 +119,7 @@ jobs:
- name: Cache .hak - name: Cache .hak
id: cache id: cache
uses: actions/cache@8b402f58fbc84540c8b491a91e594a4576fec3d7 # v5 uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5
with: with:
key: ${{ runner.os }}-${{ inputs.arch }}-${{ hashFiles('hakHash', 'electronVersion') }} key: ${{ runner.os }}-${{ inputs.arch }}-${{ hashFiles('hakHash', 'electronVersion') }}
path: | path: |
@@ -148,27 +148,28 @@ jobs:
rustup default stable rustup default stable
rustup target add ${{ steps.config.outputs.target }} rustup target add ${{ steps.config.outputs.target }}
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6 - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
with: with:
node-version-file: .node-version node-version-file: .node-version
cache: "yarn" cache: "pnpm"
- name: Install Deps - name: Install Deps
run: "yarn install --frozen-lockfile" run: "pnpm install --frozen-lockfile"
- name: Insert config snippet - name: Insert config snippet
if: steps.config.outputs.extra_config != '' if: steps.config.outputs.extra_config != ''
shell: bash shell: bash
run: | run: |
mkdir config-edit mkdir config-edit
yarn asar extract webapp.asar config-edit pnpm asar extract webapp.asar config-edit
cd config-edit cd config-edit
mv config.json old-config.json mv config.json old-config.json
echo '${{ steps.config.outputs.extra_config }}' | jq -s '.[0] * .[1]' old-config.json - > config.json echo '${{ steps.config.outputs.extra_config }}' | jq -s '.[0] * .[1]' old-config.json - > config.json
rm old-config.json rm old-config.json
cd .. cd ..
rm webapp.asar rm webapp.asar
yarn asar pack config-edit/ webapp.asar pnpm asar pack config-edit/ webapp.asar
- name: Set up sqlcipher macros - name: Set up sqlcipher macros
if: steps.cache.outputs.cache-hit != 'true' && contains(inputs.arch, 'arm') if: steps.cache.outputs.cache-hit != 'true' && contains(inputs.arch, 'arm')
@@ -186,7 +187,7 @@ jobs:
if: steps.cache.outputs.cache-hit != 'true' if: steps.cache.outputs.cache-hit != 'true'
run: | run: |
refreshenv refreshenv
yarn build:native --target ${{ steps.config.outputs.target }} pnpm build:native --target ${{ steps.config.outputs.target }}
- name: Install and configure eSigner CKA - name: Install and configure eSigner CKA
run: | run: |
@@ -232,7 +233,7 @@ jobs:
MASTER_KEY_FILE: C:\Users\runneradmin\eSignerCKA\master.key MASTER_KEY_FILE: C:\Users\runneradmin\eSignerCKA\master.key
- name: Build App - name: Build App
run: yarn build --publish never ${{ steps.config.outputs.build-args }} -w ${{ inputs.targets }} run: pnpm build --publish never ${{ steps.config.outputs.build-args }} -w ${{ inputs.targets }}
env: env:
VARIANT_PATH: variant.json VARIANT_PATH: variant.json
# Only set for Nightly builds # Only set for Nightly builds

View File

@@ -39,10 +39,10 @@ jobs:
platforms: linux/amd64 platforms: linux/amd64
- name: Test image - name: Test image
run: docker run -v $PWD:/project element-desktop-dockerbuild yarn install run: docker run -v $PWD:/project element-desktop-dockerbuild pnpm install
- name: Log in to the Container registry - name: Log in to the Container registry
uses: docker/login-action@0567fa5ae8c9a197cb207537dc5cbb43ca3d803f uses: docker/login-action@3227f5311cb93ffd14d13e65d8cc400d30f4dd8a
if: github.event_name != 'pull_request' if: github.event_name != 'pull_request'
with: with:
registry: ${{ env.REGISTRY }} registry: ${{ env.REGISTRY }}

View File

@@ -8,5 +8,7 @@ permissions:
jobs: jobs:
download: download:
uses: matrix-org/matrix-web-i18n/.github/workflows/localazy_download.yaml@main uses: matrix-org/matrix-web-i18n/.github/workflows/localazy_download.yaml@main
with:
packageManager: pnpm
secrets: secrets:
ELEMENT_BOT_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }} ELEMENT_BOT_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }}

View File

@@ -11,25 +11,27 @@ jobs:
steps: steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6 - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
with: with:
node-version-file: package.json node-version-file: package.json
cache: "yarn" cache: "pnpm"
# Does not need branch matching as only analyses this layer # Does not need branch matching as only analyses this layer
- name: Install Deps - name: Install Deps
run: "yarn install --frozen-lockfile" run: "pnpm install --frozen-lockfile"
- name: Typecheck - name: Typecheck
run: "yarn run lint:types" run: "pnpm run lint:types"
i18n_lint: i18n_lint:
name: "i18n Check" name: "i18n Check"
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: permissions:
pull-requests: read pull-requests: read
with: with:
hardcoded-words: "Element" hardcoded-words: "Element"
packageManager: pnpm
js_lint: js_lint:
name: "ESLint" name: "ESLint"
@@ -37,17 +39,18 @@ jobs:
steps: steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6 - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
with: with:
node-version-file: package.json node-version-file: package.json
cache: "yarn" cache: "pnpm"
# Does not need branch matching as only analyses this layer # Does not need branch matching as only analyses this layer
- name: Install Deps - name: Install Deps
run: "yarn install --frozen-lockfile" run: "pnpm install --frozen-lockfile"
- name: Run Linter - name: Run Linter
run: "yarn run lint:js" run: "pnpm run lint:js"
workflow_lint: workflow_lint:
name: "Workflow Lint" name: "Workflow Lint"
@@ -55,17 +58,18 @@ jobs:
steps: steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6 - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
with: with:
node-version-file: package.json node-version-file: package.json
cache: "yarn" cache: "pnpm"
# Does not need branch matching as only analyses this layer # Does not need branch matching as only analyses this layer
- name: Install Deps - name: Install Deps
run: "yarn install --frozen-lockfile" run: "pnpm install --frozen-lockfile"
- name: Run Linter - name: Run Linter
run: "yarn lint:workflows" run: "pnpm lint:workflows"
analyse_dead_code: analyse_dead_code:
name: "Analyse Dead Code" name: "Analyse Dead Code"
@@ -73,13 +77,14 @@ jobs:
steps: steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6 - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
with: with:
node-version-file: package.json node-version-file: package.json
cache: "yarn" cache: "pnpm"
- name: Install Deps - name: Install Deps
run: "yarn install --frozen-lockfile" run: "pnpm install --frozen-lockfile"
- name: Run linter - name: Run linter
run: "yarn run lint:knip" run: "pnpm run lint:knip"

View File

@@ -7,7 +7,7 @@
/src/i18n/strings /src/i18n/strings
/CHANGELOG.md /CHANGELOG.md
/package-lock.json /package-lock.json
/yarn.lock /pnpm-lock.yaml
/playwright/html-report /playwright/html-report
/playwright/test-results /playwright/test-results

View File

@@ -14,7 +14,7 @@ Element Desktop is a Matrix client for desktop platforms with Element Web at its
Before you do anything else, fetch the dependencies: Before you do anything else, fetch the dependencies:
``` ```
yarn install pnpm install
``` ```
# Fetching Element # Fetching Element
@@ -26,7 +26,7 @@ so the first step is to get a working copy of Element Web. There are a few ways
# Fetch the prebuilt release Element package from the element-web GitHub releases page. The version # Fetch the prebuilt release Element package from the element-web GitHub releases page. The version
# fetched will be the same as the local element-desktop package. # fetched will be the same as the local element-desktop package.
# We're explicitly asking for no config, so the packaged Element will have no config.json. # We're explicitly asking for no config, so the packaged Element will have no config.json.
yarn run fetch --noverify --cfgdir "" pnpm run fetch --noverify --cfgdir ""
``` ```
...or if you'd like to use GPG to verify the downloaded package: ...or if you'd like to use GPG to verify the downloaded package:
@@ -35,9 +35,9 @@ yarn run fetch --noverify --cfgdir ""
# Fetch the Element public key from the element.io web server over a secure connection and import # Fetch the Element public key from the element.io web server over a secure connection and import
# it into your local GPG keychain (you'll need GPG installed). You only need to to do this # it into your local GPG keychain (you'll need GPG installed). You only need to to do this
# once. # once.
yarn run fetch --importkey pnpm run fetch --importkey
# Fetch the package and verify the signature # Fetch the package and verify the signature
yarn run fetch --cfgdir "" pnpm run fetch --cfgdir ""
``` ```
...or either of the above, but fetching a specific version of Element: ...or either of the above, but fetching a specific version of Element:
@@ -45,7 +45,7 @@ yarn run fetch --cfgdir ""
``` ```
# Fetch the prebuilt release Element package from the element-web GitHub releases page. The version # Fetch the prebuilt release Element package from the element-web GitHub releases page. The version
# fetched will be the same as the local element-desktop package. # fetched will be the same as the local element-desktop package.
yarn run fetch --noverify --cfgdir "" v1.5.6 pnpm run fetch --noverify --cfgdir "" v1.5.6
``` ```
If you only want to run the app locally and don't need to build packages, you can If you only want to run the app locally and don't need to build packages, you can
@@ -53,7 +53,7 @@ provide the `webapp` directory directly:
``` ```
# Assuming you've checked out and built a copy of element-web in ../element-web. # Assuming you've checked out and built a copy of element-web in ../element-web.
# Note that you will not be able to `yarn build` after this, but `yarn start` # Note that you will not be able to `pnpm build` after this, but `pnpm start`
# will work fine. # will work fine.
ln -s ../element-web/webapp ./ ln -s ../element-web/webapp ./
``` ```
@@ -72,7 +72,7 @@ which include support for searching in encrypted rooms and secure storage. Skipp
Then, run Then, run
``` ```
yarn run build pnpm run build
``` ```
This will do a couple of things: This will do a couple of things:
@@ -88,12 +88,12 @@ Alternatively, you can also build using docker, which will always produce the li
``` ```
# Run this once to make the docker image # Run this once to make the docker image
yarn run docker:setup pnpm run docker:setup
yarn run docker:install pnpm run docker:install
# if you want to build the native modules (this will take a while) # if you want to build the native modules (this will take a while)
yarn run docker:build:native pnpm run docker:build:native
yarn run docker:build pnpm run docker:build
``` ```
After running, the packages should be in `dist/`. After running, the packages should be in `dist/`.
@@ -103,19 +103,19 @@ After running, the packages should be in `dist/`.
If you'd just like to run the electron app locally for development: If you'd just like to run the electron app locally for development:
``` ```
yarn start pnpm start
``` ```
# Config # Config
If you'd like the packaged Element to have a configuration file, you can create a If you'd like the packaged Element to have a configuration file, you can create a
config directory and place `config.json` in there, then specify this directory config directory and place `config.json` in there, then specify this directory
with the `--cfgdir` option to `yarn run fetch`, eg: with the `--cfgdir` option to `pnpm run fetch`, eg:
``` ```
mkdir myconfig mkdir myconfig
cp /path/to/my/config.json myconfig/ cp /path/to/my/config.json myconfig/
yarn run fetch --cfgdir myconfig pnpm run fetch --cfgdir myconfig
``` ```
The config dir for the official Element app is in `element.io`. If you use this, The config dir for the official Element app is in `element.io`. If you use this,

View File

@@ -1,10 +1,9 @@
# Docker image to facilitate building Element Desktop's native bits using a glibc version (2.31) # Docker image to facilitate building Element Desktop's native bits using a glibc version (2.31)
# with broader compatibility, down to Debian bullseye & Ubuntu focal. # with broader compatibility, down to Debian bullseye & Ubuntu focal.
FROM rust:bullseye@sha256:c6d501c039204c21e9fa374f234bd41bdc8b36cfd455a407ef145d9bef19f2b7 FROM rust:bullseye@sha256:3ebcc2d6d71fb93a2967e35723902c51dd87dbb36f66f795a58d7921553fbcd4
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
RUN curl --proto "=https" -L https://yarnpkg.com/latest.tar.gz | tar xvz && mv yarn-* /yarn && ln -s /yarn/bin/yarn /usr/bin/yarn
RUN apt-get -qq update && apt-get -y -qq dist-upgrade && \ RUN apt-get -qq update && apt-get -y -qq dist-upgrade && \
apt-get -y -qq install --no-install-recommends \ apt-get -y -qq install --no-install-recommends \
# tclsh is required for building SQLite as part of SQLCipher # tclsh is required for building SQLite as part of SQLCipher

View File

@@ -9,3 +9,4 @@ ARCH="${archMap["$TARGETARCH"]}"
NODE_VERSION=$(cat /.node-version | sed -e 's/^v//') NODE_VERSION=$(cat /.node-version | sed -e 's/^v//')
curl --proto "=https" -L "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-$TARGETOS-$ARCH.tar.gz" | tar xz -C /usr/local --strip-components=1 && \ curl --proto "=https" -L "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-$TARGETOS-$ARCH.tar.gz" | tar xz -C /usr/local --strip-components=1 && \
unlink /usr/local/CHANGELOG.md && unlink /usr/local/LICENSE && unlink /usr/local/README.md unlink /usr/local/CHANGELOG.md && unlink /usr/local/LICENSE && unlink /usr/local/README.md
corepack enable

View File

@@ -13,10 +13,9 @@ you will need debug symbols.
2. Figure out which version of Electron your Element-Desktop is based on. The 2. Figure out which version of Electron your Element-Desktop is based on. The
best way to do this is to figure out the version of Element-Desktop, then best way to do this is to figure out the version of Element-Desktop, then
look at look at
[`yarn.lock`](https://github.com/element-hq/element-desktop/blob/develop/yarn.lock) [`package.json`](https://github.com/element-hq/element-desktop/blob/develop/package.json)
for the corresponding version. There should be an entry starting for the corresponding version. There will be an entry within `dependencies` of
`electron@`, and under it a `version` line: this will tell you the version `electron`: the value will tell you the version of Electron that was used for that version of Element-Desktop.
of Electron that was used for that version of Element-Desktop.
3. Go to [Electron's releases page](https://github.com/electron/electron/releases/) 3. Go to [Electron's releases page](https://github.com/electron/electron/releases/)
and find the version you just identified. Under "Assets", download and find the version you just identified. Under "Assets", download

View File

@@ -18,21 +18,20 @@ when releasing.
If you are building for Linux, you can build the native modules with: If you are building for Linux, you can build the native modules with:
``` ```
yarn docker:setup pnpm docker:setup
yarn docker:install pnpm docker:install
INDOCKER_SQLCIPHER_BUNDLED=1 yarn docker:build:native INDOCKER_SQLCIPHER_BUNDLED=1 pnpm docker:build:native
``` ```
The above will build `matrix-seshat` in The above will build `matrix-seshat` in
`docker/node_modules/matrix-seshat`. You can then either run `yarn docker:build` `docker/node_modules/matrix-seshat`. You can then either run `pnpm docker:build`
to build the app inside docker, or: to build the app inside docker, or:
``` ```
yarn --cwd docker/node_modules/matrix-seshat link pnpm link docker/node_modules/matrix-seshat
yarn link matrix-seshat
``` ```
... and build the app with `yarn build` or run it with `yarn start`. ... and build the app with `pnpm build` or run it with `pnpm start`.
(See also https://github.com/element-hq/element-desktop#docker.) (See also https://github.com/element-hq/element-desktop#docker.)
@@ -49,7 +48,7 @@ Then optionally, [add seshat and dependencies to support search in E2E rooms](#a
Then, to build for an architecture selected automatically based on your system (recommended), run: Then, to build for an architecture selected automatically based on your system (recommended), run:
``` ```
yarn run build:native pnpm run build:native
``` ```
If you need to build for a specific architecture, see [here](#compiling-for-specific-architectures). If you need to build for a specific architecture, see [here](#compiling-for-specific-architectures).
@@ -67,20 +66,20 @@ Seshat also depends on the SQLCipher library to store its data in encrypted form
on disk. You'll need to install it via your OS package manager. on disk. You'll need to install it via your OS package manager.
After installing the Rust compiler and SQLCipher, Seshat support can be added After installing the Rust compiler and SQLCipher, Seshat support can be added
using yarn at the root of this project: using pnpm at the root of this project:
yarn add matrix-seshat pnpm add matrix-seshat
You will have to rebuild the native libraries against electron's version You will have to rebuild the native libraries against electron's version
of node rather than your system node, using the `electron-build-env` tool. of node rather than your system node, using the `electron-build-env` tool.
This is also needed to when pulling in changes to Seshat using `yarn link`. This is also needed to when pulling in changes to Seshat using `pnpm link`.
yarn add electron-build-env pnpm add electron-build-env
Recompiling Seshat itself can be done like so: Recompiling Seshat itself can be done like so:
ELECTRON_VERSION=$(electron --version) ELECTRON_VERSION=$(electron --version)
yarn run electron-build-env -- --electron ${ELECTRON_VERSION#v} -- neon build matrix-seshat --release pnpm electron-build-env -- --electron ${ELECTRON_VERSION#v} -- neon build matrix-seshat --release
Please make sure to include all the `--` as well as the `--release` command line Please make sure to include all the `--` as well as the `--release` command line
switch at the end. Modify your electron version accordingly depending on the switch at the end. Modify your electron version accordingly depending on the
@@ -89,7 +88,7 @@ version that is installed on your system.
After this is done the Electron version of Element can be run from the main folder After this is done the Electron version of Element can be run from the main folder
as usual using: as usual using:
yarn start pnpm start
### Statically linking libsqlcipher ### Statically linking libsqlcipher
@@ -109,26 +108,26 @@ and https://github.com/vector-im/element-web/issues/20926.
On macOS, you can build universal native modules too: On macOS, you can build universal native modules too:
``` ```
yarn run build:native:universal pnpm run build:native:universal
``` ```
...or you can build for a specific architecture: ...or you can build for a specific architecture:
``` ```
yarn run build:native --target x86_64-apple-darwin pnpm run build:native --target x86_64-apple-darwin
``` ```
or or
``` ```
yarn run build:native --target aarch64-apple-darwin pnpm run build:native --target aarch64-apple-darwin
``` ```
You'll then need to create a built bundle with the same architecture. You'll then need to create a built bundle with the same architecture.
To bundle a universal build for macOS, run: To bundle a universal build for macOS, run:
``` ```
yarn run build:universal pnpm run build:universal
``` ```
### Windows ### Windows
@@ -136,13 +135,13 @@ yarn run build:universal
If you're on Windows, you can choose to build specifically for 32 or 64 bit: If you're on Windows, you can choose to build specifically for 32 or 64 bit:
``` ```
yarn run build:32 pnpm run build:32
``` ```
or or
``` ```
yarn run build:64 pnpm run build:64
``` ```
### Cross compiling ### Cross compiling
@@ -156,19 +155,19 @@ at this time.
The native module build system keeps the different architectures The native module build system keeps the different architectures
separate, so you can keep native modules for several architectures at the same separate, so you can keep native modules for several architectures at the same
time and switch which are active using a `yarn run hak copy` command, passing time and switch which are active using a `pnpm run hak copy` command, passing
the appropriate architectures. This will error if you haven't yet built those the appropriate architectures. This will error if you haven't yet built those
architectures. eg: architectures. eg:
``` ```
yarn run build:native --target x86_64-apple-darwin pnpm run build:native --target x86_64-apple-darwin
# We've now built & linked into place native modules for Intel # We've now built & linked into place native modules for Intel
yarn run build:native --target aarch64-apple-darwin pnpm run build:native --target aarch64-apple-darwin
# We've now built Apple Silicon modules too, and linked them into place as the active ones # We've now built Apple Silicon modules too, and linked them into place as the active ones
yarn run hak copy --target x86_64-apple-darwin pnpm run hak copy --target x86_64-apple-darwin
# We've now switched back to our Intel modules # We've now switched back to our Intel modules
yarn run hak copy --target x86_64-apple-darwin --target aarch64-apple-darwin pnpm run hak copy --target x86_64-apple-darwin --target aarch64-apple-darwin
# Now our native modules are universal x86_64+aarch64 binaries # Now our native modules are universal x86_64+aarch64 binaries
``` ```

View File

@@ -16,7 +16,7 @@ If you want to build native modules, make sure that the following tools are inst
You can install the above tools using [Chocolatey](https://chocolatey.org/install): You can install the above tools using [Chocolatey](https://chocolatey.org/install):
```cmd ```cmd
choco install --no-progress -y git nodejs-lts yarn python StrawberryPerl rustup.install nasm magicsplat-tcl-tk choco install --no-progress -y git nodejs-lts pnpm python StrawberryPerl rustup.install nasm magicsplat-tcl-tk
``` ```
- [Build Tools for Visual Studio 2019](https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2019) with the following configuration: - [Build Tools for Visual Studio 2019](https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2019) with the following configuration:

View File

@@ -21,43 +21,43 @@
"node": ">=18.0.0" "node": ">=18.0.0"
}, },
"scripts": { "scripts": {
"i18n": "matrix-gen-i18n && yarn i18n:sort && yarn i18n:lint", "i18n": "matrix-gen-i18n && pnpm i18n:sort && pnpm i18n:lint",
"i18n:sort": "matrix-sort-i18n src/i18n/strings/en_EN.json", "i18n:sort": "matrix-sort-i18n src/i18n/strings/en_EN.json",
"i18n:lint": "prettier --log-level=silent --write src/i18n/strings/ --ignore-path /dev/null", "i18n:lint": "prettier --log-level=silent --write src/i18n/strings/ --ignore-path /dev/null",
"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: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",
"mkdirs": "mkdirp packages deploys", "mkdirs": "mkdirp packages deploys",
"fetch": "yarn run mkdirs && tsx scripts/fetch-package.ts", "fetch": "pnpm run mkdirs && tsx scripts/fetch-package.ts",
"asar-webapp": "asar p webapp webapp.asar", "asar-webapp": "asar p webapp webapp.asar",
"start": "yarn run build:ts && yarn run build:res && electron .", "start": "pnpm run build:ts && pnpm run build:res && electron .",
"lint": "yarn lint:types && yarn lint:js && yarn lint:workflows", "lint": "pnpm lint:types && pnpm lint:js && pnpm lint:workflows",
"lint:js": "eslint --max-warnings 0 src hak playwright scripts && prettier --check .", "lint:js": "eslint --max-warnings 0 src hak playwright scripts && prettier --check .",
"lint:js-fix": "eslint --fix --max-warnings 0 src hak playwright scripts && prettier --log-level=warn --write .", "lint:js-fix": "eslint --fix --max-warnings 0 src hak playwright scripts && prettier --log-level=warn --write .",
"lint:types": "yarn lint:types:src && yarn lint:types:test && yarn lint:types:scripts && yarn lint:types:hak", "lint:types": "pnpm lint:types:src && pnpm lint:types:test && pnpm lint:types:scripts && pnpm lint:types:hak",
"lint:types:src": "tsc --noEmit", "lint:types:src": "tsc --noEmit",
"lint:types:test": "tsc --noEmit -p playwright/tsconfig.json", "lint:types:test": "tsc --noEmit -p playwright/tsconfig.json",
"lint:types:scripts": "tsc --noEmit -p scripts/tsconfig.json", "lint:types:scripts": "tsc --noEmit -p scripts/tsconfig.json",
"lint:types:hak": "tsc --noEmit -p hak/tsconfig.json", "lint:types:hak": "tsc --noEmit -p hak/tsconfig.json",
"lint:workflows": "find .github/workflows -type f \\( -iname '*.yaml' -o -iname '*.yml' \\) | xargs -I {} sh -c 'echo \"Linting {}\"; action-validator \"{}\"'", "lint:workflows": "find .github/workflows -type f \\( -iname '*.yaml' -o -iname '*.yml' \\) | xargs -I {} sh -c 'echo \"Linting {}\"; action-validator \"{}\"'",
"lint:knip": "knip", "lint:knip": "knip",
"build:native": "yarn run hak", "build:native": "pnpm run hak",
"build:native:universal": "yarn run hak --target x86_64-apple-darwin fetchandbuild && yarn run hak --target aarch64-apple-darwin fetchandbuild && yarn run hak --target x86_64-apple-darwin --target aarch64-apple-darwin copyandlink", "build:native:universal": "pnpm run hak --target x86_64-apple-darwin fetchandbuild && pnpm run hak --target aarch64-apple-darwin fetchandbuild && pnpm run hak --target x86_64-apple-darwin --target aarch64-apple-darwin copyandlink",
"build:32": "yarn run build:ts && yarn run build:res && electron-builder --ia32", "build:32": "pnpm run build:ts && pnpm run build:res && electron-builder --ia32",
"build:64": "yarn run build:ts && yarn run build:res && electron-builder --x64", "build:64": "pnpm run build:ts && pnpm run build:res && electron-builder --x64",
"build:universal": "yarn run build:ts && yarn run build:res && electron-builder --universal", "build:universal": "pnpm run build:ts && pnpm run build:res && electron-builder --universal",
"build": "yarn run build:ts && yarn run build:res && electron-builder", "build": "pnpm run build:ts && pnpm run build:res && electron-builder",
"build:ts": "tsc", "build:ts": "tsc",
"build:res": "tsx scripts/copy-res.ts", "build:res": "tsx scripts/copy-res.ts",
"docker:setup": "docker build --platform linux/amd64 -t element-desktop-dockerbuild -f dockerbuild/Dockerfile .", "docker:setup": "docker build --platform linux/amd64 -t element-desktop-dockerbuild -f dockerbuild/Dockerfile .",
"docker:build:native": "scripts/in-docker.sh yarn run hak", "docker:build:native": "scripts/in-docker.sh pnpm run hak",
"docker:build": "scripts/in-docker.sh yarn run build", "docker:build": "scripts/in-docker.sh pnpm run build",
"docker:install": "scripts/in-docker.sh yarn install", "docker:install": "scripts/in-docker.sh pnpm install",
"clean": "rimraf webapp.asar dist packages deploys lib", "clean": "rimraf webapp.asar dist packages deploys lib",
"hak": "tsx scripts/hak/index.ts", "hak": "tsx scripts/hak/index.ts",
"test": "playwright test", "test": "playwright test",
"test:open": "yarn test --ui", "test:open": "pnpm test --ui",
"test:screenshots:build": "docker build playwright -t element-desktop-playwright --platform linux/amd64", "test:screenshots:build": "docker build playwright -t element-desktop-playwright --platform linux/amd64",
"test:screenshots:run": "docker run --rm --network host -v $(pwd):/work/element-desktop -v element-desktop-playwright:/work/element-desktop/node_modules -v /var/run/docker.sock:/var/run/docker.sock --platform linux/amd64 -it element-desktop-playwright", "test:screenshots:run": "docker run --rm --network host -v $(pwd):/work/element-desktop -v element-desktop-playwright:/work/element-desktop/node_modules -v /var/run/docker.sock:/var/run/docker.sock --platform linux/amd64 -it element-desktop-playwright",
"postinstall": "patch-package && electron-builder install-app-deps" "postinstall": "electron-builder install-app-deps"
}, },
"dependencies": { "dependencies": {
"@sentry/electron": "^7.0.0", "@sentry/electron": "^7.0.0",
@@ -76,7 +76,7 @@
"@babel/preset-env": "^7.18.10", "@babel/preset-env": "^7.18.10",
"@babel/preset-typescript": "^7.18.6", "@babel/preset-typescript": "^7.18.6",
"@electron/asar": "4.0.1", "@electron/asar": "4.0.1",
"@playwright/test": "1.57.0", "@playwright/test": "1.58.1",
"@stylistic/eslint-plugin": "^5.0.0", "@stylistic/eslint-plugin": "^5.0.0",
"@types/auto-launch": "^5.0.1", "@types/auto-launch": "^5.0.1",
"@types/counterpart": "^0.18.1", "@types/counterpart": "^0.18.1",
@@ -88,7 +88,7 @@
"app-builder-lib": "26.6.0", "app-builder-lib": "26.6.0",
"chokidar": "^5.0.0", "chokidar": "^5.0.0",
"detect-libc": "^2.0.0", "detect-libc": "^2.0.0",
"electron": "40.0.0", "electron": "40.1.0",
"electron-builder": "26.6.0", "electron-builder": "26.6.0",
"electron-builder-squirrel-windows": "26.6.0", "electron-builder-squirrel-windows": "26.6.0",
"electron-devtools-installer": "^4.0.0", "electron-devtools-installer": "^4.0.0",
@@ -103,11 +103,9 @@
"husky": "^9.1.6", "husky": "^9.1.6",
"knip": "^5.0.0", "knip": "^5.0.0",
"lint-staged": "^16.0.0", "lint-staged": "^16.0.0",
"matrix-web-i18n": "3.5.2", "matrix-web-i18n": "3.6.0",
"mkdirp": "^3.0.0", "mkdirp": "^3.0.0",
"pacote": "^21.0.0", "pacote": "^21.0.0",
"patch-package": "^8.0.1",
"postinstall-postinstall": "^2.1.0",
"prettier": "^3.0.0", "prettier": "^3.0.0",
"rimraf": "^6.0.0", "rimraf": "^6.0.0",
"tar": "^7.0.0", "tar": "^7.0.0",
@@ -123,5 +121,22 @@
"config-file-ts": "0.2.8-rc1", "config-file-ts": "0.2.8-rc1",
"node-abi": "4.26.0", "node-abi": "4.26.0",
"@types/pg-pool": "2.0.7" "@types/pg-pool": "2.0.7"
} },
"pnpm": {
"onlyBuiltDependencies": [
"electron"
],
"patchedDependencies": {
"@types/auto-launch": "patches/@types__auto-launch.patch"
},
"peerDependencyRules": {
"allowedVersions": {
"eslint": "8"
}
},
"allowedDeprecatedVersions": {
"eslint": "8"
}
},
"packageManager": "pnpm@10.28.2+sha512.41872f037ad22f7348e3b1debbaf7e867cfd448f2726d9cf74c08f19507c31d2c8e7a11525b983febc2df640b5438dee6023ebb1f84ed43cc2d654d2bc326264"
} }

View File

@@ -1,7 +1,7 @@
diff --git a/node_modules/@types/auto-launch/index.d.ts b/node_modules/@types/auto-launch/index.d.ts diff --git a/index.d.ts b/index.d.ts
index a30a77c..e512ce1 100644 index a30a77c..e512ce1 100644
--- a/node_modules/@types/auto-launch/index.d.ts --- a/index.d.ts
+++ b/node_modules/@types/auto-launch/index.d.ts +++ b/index.d.ts
@@ -25,6 +25,13 @@ interface AutoLaunchOptions { @@ -25,6 +25,13 @@ interface AutoLaunchOptions {
declare class AutoLaunch { declare class AutoLaunch {
constructor(options: AutoLaunchOptions); constructor(options: AutoLaunchOptions);

View File

@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/playwright:v1.57.0-jammy@sha256:6aca677c27a967caf7673d108ac67ffaf8fed134f27e17b27a05464ca0ace831 FROM mcr.microsoft.com/playwright:v1.58.1-jammy@sha256:1b52a0833ae13c3bb16f728eec5f9216db29f3cd5eec21a9cbd33e7623723c0e
WORKDIR /work/element-desktop WORKDIR /work/element-desktop

View File

@@ -8,8 +8,8 @@ sleep 2
export DISPLAY=:99 export DISPLAY=:99
yarn install --frozen-lockfile pnpm install --frozen-lockfile
yarn build -l --dir pnpm build -l --dir
PLAYWRIGHT_HTML_OPEN=never ELEMENT_DESKTOP_EXECUTABLE="./dist/linux-unpacked/element-desktop" \ PLAYWRIGHT_HTML_OPEN=never ELEMENT_DESKTOP_EXECUTABLE="./dist/linux-unpacked/element-desktop" \
npx playwright test --update-snapshots --reporter line,html "$1" npx playwright test --update-snapshots --reporter line,html "$1"

9575
pnpm-lock.yaml generated Normal file
View File

File diff suppressed because it is too large Load Diff

1
pnpm-workspace.yaml Normal file
View File

@@ -0,0 +1 @@
nodeLinker: hoisted

View File

@@ -18,7 +18,7 @@ but should work equally well for building modules for normal node.
# Running # Running
Hak is invoked with a command and a dependency, eg. `yarn run hak fetch matrix-seshat`. Hak is invoked with a command and a dependency, eg. `pnpm run hak fetch matrix-seshat`.
If no dependencies are given, hak runs the command on all dependencies. If no dependencies are given, hak runs the command on all dependencies.
# Files # Files
@@ -37,15 +37,15 @@ There are a lot of files involved:
Hak works around native node modules that try to fetch or build their native component in Hak works around native node modules that try to fetch or build their native component in
the npm 'install' phase - modules that do this will typically end up with native components the npm 'install' phase - modules that do this will typically end up with native components
targeted to the build platform and the node that npm/yarn is using, which is no good for an targeted to the build platform and the node that npm/pnpm is using, which is no good for an
electron app. electron app.
It does this by installing it with `--ignore-scripts` and then using `yarn link` to keep the It does this by installing it with `--ignore-scripts` and then using `pnpm link` to keep the
dependency module separate so yarn doesn't try to run its install / postinstall script dependency module separate so pnpm doesn't try to run its install / postinstall script
at other points (eg. whenever you `yarn add` a random other dependency). at other points (eg. whenever you `pnpm add` a random other dependency).
This also means that the dependencies cannot be listed in `dependencies` or This also means that the dependencies cannot be listed in `dependencies` or
`devDependencies` in the project, since this would cause npm / yarn to install them and `devDependencies` in the project, since this would cause pnpm to install them and
try to fetch their native parts. Instead, they are listed in `hakDependencies` which try to fetch their native parts. Instead, they are listed in `hakDependencies` which
hak reads to install them for you. hak reads to install them for you.
@@ -53,9 +53,6 @@ Hak will _not_ install dependencies for the copy of the module it links into you
project, so if your native module has javascript dependencies that are actually needed at project, so if your native module has javascript dependencies that are actually needed at
runtime (and not just to fetch / build the native parts), it won't work. runtime (and not just to fetch / build the native parts), it won't work.
Hak will generate a `.yarnrc` in the project directory to set the link directory to its
own in the .hak directory (unless one already exists, in which case this is your problem).
# Lifecycle # Lifecycle
Hak is divided into lifecycle stages, in order: Hak is divided into lifecycle stages, in order:

View File

@@ -8,6 +8,7 @@ Please see LICENSE files in the repository root for full details.
import fsProm from "node:fs/promises"; import fsProm from "node:fs/promises";
import pacote from "pacote"; import pacote from "pacote";
import path from "node:path";
import type HakEnv from "./hakEnv.js"; import type HakEnv from "./hakEnv.js";
import type { DependencyInfo } from "./dep.js"; import type { DependencyInfo } from "./dep.js";
@@ -30,6 +31,13 @@ export default async function fetch(hakEnv: HakEnv, moduleInfo: DependencyInfo):
packumentCache, packumentCache,
}); });
// Workaround for us switching to pnpm but matrix-seshat still using yarn classic
const packageJsonPath = path.join(moduleInfo.moduleBuildDir, "package.json");
const packageJson = await fsProm.readFile(packageJsonPath, "utf-8");
const packageJsonData = JSON.parse(packageJson);
packageJsonData["packageManager"] = "yarn@1.22.22";
await fsProm.writeFile(packageJsonPath, JSON.stringify(packageJsonData, null, 2), "utf-8");
console.log("Running yarn install in " + moduleInfo.moduleBuildDir); console.log("Running yarn install in " + moduleInfo.moduleBuildDir);
await hakEnv.spawn("yarn", ["install", "--ignore-scripts"], { await hakEnv.spawn("yarn", ["install", "--ignore-scripts"], {
cwd: moduleInfo.moduleBuildDir, cwd: moduleInfo.moduleBuildDir,

View File

@@ -6,18 +6,11 @@ SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Com
Please see LICENSE files in the repository root for full details. Please see LICENSE files in the repository root for full details.
*/ */
import path from "node:path";
import type HakEnv from "./hakEnv.js"; import type HakEnv from "./hakEnv.js";
import { type DependencyInfo } from "./dep.js"; import { type DependencyInfo } from "./dep.js";
export default async function link(hakEnv: HakEnv, moduleInfo: DependencyInfo): Promise<void> { export default async function link(hakEnv: HakEnv, moduleInfo: DependencyInfo): Promise<void> {
const linkFolder = path.join(hakEnv.dotHakDir, "links"); await hakEnv.spawn("pnpm", ["link", moduleInfo.moduleOutDir], {
await hakEnv.spawn("yarn", ["link", "--link-folder", linkFolder], {
cwd: moduleInfo.moduleOutDir,
});
await hakEnv.spawn("yarn", ["link", "--link-folder", linkFolder, moduleInfo.name], {
cwd: hakEnv.projectRoot, cwd: hakEnv.projectRoot,
}); });
} }

View File

@@ -8,7 +8,7 @@ IMAGE=${DOCKER_IMAGE_NAME:-"element-desktop-dockerbuild"}
docker inspect "$IMAGE" 2> /dev/null > /dev/null docker inspect "$IMAGE" 2> /dev/null > /dev/null
if [ $? != 0 ]; then if [ $? != 0 ]; then
echo "Docker image $IMAGE not found. Have you run yarn run docker:setup?" echo "Docker image $IMAGE not found. Have you run pnpm run docker:setup?"
exit 1 exit 1
fi fi

View File

@@ -14,7 +14,7 @@ export async function versionFromAsar(): Promise<string> {
try { try {
await fs.stat("webapp.asar"); await fs.stat("webapp.asar");
} catch { } catch {
throw new Error("No 'webapp.asar' found. Run 'yarn run fetch'"); throw new Error("No 'webapp.asar' found. Run 'pnpm run fetch'");
} }
return asar.extractFile("webapp.asar", "version").toString().trim(); return asar.extractFile("webapp.asar", "version").toString().trim();
@@ -25,7 +25,7 @@ export async function setPackageVersion(ver: string): Promise<void> {
// all the various version fields // all the various version fields
await new Promise<void>((resolve, reject) => { await new Promise<void>((resolve, reject) => {
childProcess.execFile( childProcess.execFile(
process.platform === "win32" ? "yarn.cmd" : "yarn", process.platform === "win32" ? "pnpm.cmd" : "pnpm",
[ [
"version", "version",
"-s", "-s",

View File

@@ -35,7 +35,7 @@
"eol": { "eol": {
"no_more_updates": "Používáte nepodporovanou verzi systému macOS. Prosím upgradujte %(brand)s pro získání aktualizací.", "no_more_updates": "Používáte nepodporovanou verzi systému macOS. Prosím upgradujte %(brand)s pro získání aktualizací.",
"title": "Systém není podporován", "title": "Systém není podporován",
"warning": "Používáte nepodporovanou verzi systému macOS. Proveďte prosím upgrade %(brand)s , aby byl stále funkční." "warning": "Používáte nepodporovanou verzi systému macOS. Proveďte prosím upgrade %(brand)s, aby byl stále funkční."
}, },
"file_menu": { "file_menu": {
"label": "Soubor" "label": "Soubor"

7432
yarn.lock
View File

File diff suppressed because it is too large Load Diff