Compare commits

...

44 Commits

Author SHA1 Message Date
Michael Telatynski
09af7c0634 Set -ex
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2026-02-06 10:37:33 +00:00
Michael Telatynski
cc1e3945ba Merge branch 'develop' of ssh://github.com/vector-im/element-desktop into t3chguy/pnpm
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

# Conflicts:
#	yarn.lock
2026-02-06 10:32:16 +00:00
Michael Telatynski
b750882136 Switch element-desktop from yarn classic to pnpm
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2026-02-06 10:27:29 +00:00
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
renovate[bot]
d4fc645262 Update dependency tar to v7.5.7 [SECURITY] (#2823)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-29 15:17:39 +00:00
renovate[bot]
5d27c0aa1b Update electron-builder to v26.6.0 (#2821)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2026-01-28 16:05:40 +00:00
RiotRobot
8f9198bc74 Merge branch 'master' into develop 2026-01-27 13:05:25 +00:00
ElementRobot
5cde23b88a Merge pull request #2816 from element-hq/actions/localazy-download
Localazy Download
2026-01-23 06:24:04 +00:00
t3chguy
d3be664f17 [create-pull-request] automated change 2026-01-23 06:09:34 +00:00
renovate[bot]
9dd06fb45a Update dependency node-abi to v4.26.0 (#2812)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-21 09:48:41 +00:00
renovate[bot]
379908b5b6 Update dependency tar to v7.5.4 [SECURITY] (#2810)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-21 09:29:10 +00:00
Michael Telatynski
87baf1246b Generate badge icon for macOS DMG (#2809) 2026-01-21 09:05:56 +00:00
renovate[bot]
61ea39e2c8 Update npm non-major dependencies (#2805)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-20 15:40:19 +00:00
renovate[bot]
444d4a06f2 Update dependency electron to v40 (#2808)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-20 15:24:31 +00:00
renovate[bot]
bc741994e1 Update dependency @sentry/electron to v7.6.0 (#2806)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-20 15:20:47 +00:00
renovate[bot]
2c65a38a51 Update rust:bullseye Docker digest to c6d501c (#2803)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-20 15:20:17 +00:00
renovate[bot]
2eafa2720f Update docker/login-action digest to 0567fa5 (#2802)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-20 15:19:15 +00:00
renovate[bot]
18c22f23f4 Update actions/setup-node digest to 6044e13 (#2801)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-20 15:19:06 +00:00
renovate[bot]
4e2a7a5f22 Update actions/cache digest to 8b402f5 (#2800)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-20 15:18:52 +00:00
renovate[bot]
c17ac70060 Update Node.js to v24.13.0 (#2807)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-20 15:13:58 +00:00
renovate[bot]
4b9595d058 Update dependency eslint-plugin-n to v17.23.2 (#2804)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-20 15:13:35 +00:00
35 changed files with 9645 additions and 7603 deletions

2
.github/CODEOWNERS vendored
View File

@@ -1,5 +1,5 @@
* @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/i18n/strings

View File

@@ -55,13 +55,14 @@ jobs:
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # 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: yarn install --frozen-lockfile
run: pnpm install --frozen-lockfile
- name: Download blob reports from GitHub Actions Artifacts
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7
@@ -71,7 +72,7 @@ jobs:
merge-multiple: true
- 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
if: always()

View File

@@ -116,22 +116,23 @@ jobs:
- name: Cache .hak
id: cache
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5
with:
key: ${{ runner.os }}-${{ github.ref_name }}-${{ inputs.sqlcipher }}-${{ inputs.arch }}-${{ hashFiles('hakHash', 'electronVersion', 'dockerbuild/*') }}
path: |
./.hak
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
with:
node-version-file: .node-version
cache: "yarn"
cache: "pnpm"
env:
# Workaround for https://github.com/actions/setup-node/issues/317
FORCE_COLOR: 0
- name: Install Deps
run: "yarn install --frozen-lockfile"
run: "pnpm install --frozen-lockfile"
- name: "Get modified files"
id: changed_files
@@ -158,7 +159,7 @@ jobs:
-v ${{ github.workspace }}:/work -w /work \
-e SQLCIPHER_BUNDLED \
$HAK_DOCKER_IMAGE \
yarn build:native
pnpm build:native
- name: Fix permissions on .hak
run: sudo chown -R $USER:$USER .hak
@@ -178,7 +179,7 @@ jobs:
fi
- 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:
VARIANT_PATH: variant.json
# Only set for Nightly builds

View File

@@ -90,7 +90,7 @@ jobs:
- name: Cache .hak
id: cache
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5
with:
key: ${{ runner.os }}-${{ hashFiles('hakHash', 'electronVersion') }}
path: |
@@ -105,27 +105,32 @@ jobs:
rustup target add x86_64-apple-darwin
# M1 macos-14 comes without Python preinstalled
- uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with:
python-version: "3.13"
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6
# Install Quartz for DMG badges
# https://github.com/electron-userland/electron-builder/issues/9511#issuecomment-3774092888
- run: sudo pip3 install pyobjc-framework-Quartz
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
with:
node-version-file: .node-version
cache: "yarn"
cache: "pnpm"
- name: Install Deps
run: "yarn install --frozen-lockfile"
run: "pnpm install --frozen-lockfile"
- name: Build Natives
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
- name: "[Signed] Build App"
if: inputs.sign != ''
run: |
yarn build:universal --publish never -m ${{ inputs.targets }}
pnpm build:universal --publish never -m ${{ inputs.targets }}
env:
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
APPLE_ID: ${{ secrets.APPLE_ID }}
@@ -147,7 +152,7 @@ jobs:
- name: "[Unsigned] Build App"
if: inputs.sign == ''
run: |
yarn build:universal --publish never -m ${{ inputs.targets }}
pnpm build:universal --publish never -m ${{ inputs.targets }}
env:
CSC_IDENTITY_AUTO_DISCOVERY: false
VARIANT_PATH: variant.json

View File

@@ -56,13 +56,14 @@ jobs:
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
with:
node-version-file: .node-version
cache: "yarn"
cache: "pnpm"
- name: Install Deps
run: "yarn install --frozen-lockfile"
run: "pnpm install --frozen-lockfile"
- name: Fetch Element Web (matching branch)
id: branch-matching
@@ -71,10 +72,10 @@ jobs:
run: |
scripts/branch-match.sh
cp "$CONFIG_DIR/config.json" element-web/
yarn --cwd element-web install --frozen-lockfile
yarn --cwd element-web run build
pnpm --cwd element-web install --frozen-lockfile
pnpm --cwd element-web run build
mv element-web/webapp .
yarn asar-webapp
pnpm asar-webapp
env:
# These must be set for branch-match.sh to get the right branch
REPOSITORY: ${{ github.repository }}
@@ -83,7 +84,7 @@ jobs:
- name: Fetch Element Web (${{ inputs.version }})
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
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
- name: Generate cache hash files
run: |
set -ex
# 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 run --silent electron --no-sandbox --version > electronVersion
cat package.json | jq -c .hakDependencies | sha1sum > hakHash
find 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:
repository: ${{ github.repository == 'element-hq/element-web-pro' && 'element-hq/element-desktop' || github.repository }}
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
with:
node-version-file: .node-version
cache: "yarn"
cache: "pnpm"
- name: Install Deps
run: "yarn install --frozen-lockfile"
run: "pnpm install --frozen-lockfile"
- uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7
with:
@@ -80,7 +81,7 @@ jobs:
uses: coactions/setup-xvfb@6b00cf1889f4e1d5a48635647013c0508128ee1a
timeout-minutes: 20
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:
ELEMENT_DESKTOP_EXECUTABLE: ${{ steps.executable.outputs.path }}

View File

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

View File

@@ -39,10 +39,10 @@ jobs:
platforms: linux/amd64
- 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
uses: docker/login-action@6862ffc5ab2cdb4405cf318a62a6f4c066e2298b
uses: docker/login-action@3227f5311cb93ffd14d13e65d8cc400d30f4dd8a
if: github.event_name != 'pull_request'
with:
registry: ${{ env.REGISTRY }}

View File

@@ -11,17 +11,18 @@ jobs:
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
with:
node-version-file: package.json
cache: "yarn"
cache: "pnpm"
# Does not need branch matching as only analyses this layer
- name: Install Deps
run: "yarn install --frozen-lockfile"
run: "pnpm install --frozen-lockfile"
- name: Typecheck
run: "yarn run lint:types"
run: "pnpm run lint:types"
i18n_lint:
name: "i18n Check"
@@ -37,17 +38,18 @@ jobs:
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
with:
node-version-file: package.json
cache: "yarn"
cache: "pnpm"
# 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"
workflow_lint:
name: "Workflow Lint"
@@ -55,17 +57,18 @@ jobs:
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
with:
node-version-file: package.json
cache: "yarn"
cache: "pnpm"
# 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"
@@ -73,13 +76,14 @@ jobs:
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
with:
node-version-file: package.json
cache: "yarn"
cache: "pnpm"
- 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"

View File

@@ -1 +1 @@
24.12.0
24.13.0

View File

@@ -7,7 +7,7 @@
/src/i18n/strings
/CHANGELOG.md
/package-lock.json
/yarn.lock
/pnpm-lock.yaml
/playwright/html-report
/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:
```
yarn install
pnpm install
```
# 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
# 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.
yarn run fetch --noverify --cfgdir ""
pnpm run fetch --noverify --cfgdir ""
```
...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
# it into your local GPG keychain (you'll need GPG installed). You only need to to do this
# once.
yarn run fetch --importkey
pnpm run fetch --importkey
# 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:
@@ -45,7 +45,7 @@ yarn run fetch --cfgdir ""
```
# 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.
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
@@ -53,7 +53,7 @@ provide the `webapp` directory directly:
```
# 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.
ln -s ../element-web/webapp ./
```
@@ -72,7 +72,7 @@ which include support for searching in encrypted rooms and secure storage. Skipp
Then, run
```
yarn run build
pnpm run build
```
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
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)
yarn run docker:build:native
yarn run docker:build
pnpm run docker:build:native
pnpm run docker:build
```
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:
```
yarn start
pnpm start
```
# Config
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
with the `--cfgdir` option to `yarn run fetch`, eg:
with the `--cfgdir` option to `pnpm run fetch`, eg:
```
mkdir 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,

View File

@@ -1,10 +1,9 @@
# 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.
FROM rust:bullseye@sha256:182c38f1049c4348a0286392d817d400a6cdb51eebb479d446cd6286bbe6e758
FROM rust:bullseye@sha256:3ebcc2d6d71fb93a2967e35723902c51dd87dbb36f66f795a58d7921553fbcd4
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 && \
apt-get -y -qq install --no-install-recommends \
# 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//')
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
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
best way to do this is to figure out the version of Element-Desktop, then
look at
[`yarn.lock`](https://github.com/element-hq/element-desktop/blob/develop/yarn.lock)
for the corresponding version. There should be an entry starting
`electron@`, and under it a `version` line: this will tell you the version
of Electron that was used for that version of Element-Desktop.
[`package.json`](https://github.com/element-hq/element-desktop/blob/develop/package.json)
for the corresponding version. There will be an entry within `dependencies` of
`electron`: the value will tell you the version of Electron that was used for that version of Element-Desktop.
3. Go to [Electron's releases page](https://github.com/electron/electron/releases/)
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:
```
yarn docker:setup
yarn docker:install
INDOCKER_SQLCIPHER_BUNDLED=1 yarn docker:build:native
pnpm docker:setup
pnpm docker:install
INDOCKER_SQLCIPHER_BUNDLED=1 pnpm docker:build:native
```
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:
```
yarn --cwd docker/node_modules/matrix-seshat link
yarn link matrix-seshat
pnpm link docker/node_modules/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.)
@@ -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:
```
yarn run build:native
pnpm run build:native
```
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.
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
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:
ELECTRON_VERSION=$(electron --version)
yarn run electron-build-env -- --electron ${ELECTRON_VERSION#v} -- neon build matrix-seshat --release
pnpm run 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
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
as usual using:
yarn start
pnpm start
### 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:
```
yarn run build:native:universal
pnpm run build:native:universal
```
...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
```
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.
To bundle a universal build for macOS, run:
```
yarn run build:universal
pnpm run build:universal
```
### 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:
```
yarn run build:32
pnpm run build:32
```
or
```
yarn run build:64
pnpm run build:64
```
### Cross compiling
@@ -156,19 +155,19 @@ at this time.
The native module build system keeps the different architectures
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
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
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
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
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
```

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):
```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:

View File

@@ -162,6 +162,9 @@ const config: Omit<Writable<Configuration>, "electronFuses"> & {
mergeASARs: true,
x64ArchFiles: "**/matrix-seshat/*.node", // hak already runs lipo
},
dmg: {
badgeIcon: "build/icon.icon",
},
win: {
target: ["squirrel", "msi"],
signtoolOptions: {

View File

@@ -16,8 +16,8 @@ export default async function (hakEnv: HakEnv, moduleInfo: DependencyInfo): Prom
env.CARGO_BUILD_TARGET = hakEnv.getTargetId();
}
console.log("Running yarn install");
await hakEnv.spawn("yarn", ["install"], {
console.log("Running pnpm install");
await hakEnv.spawn("pnpm", ["install"], {
cwd: moduleInfo.moduleBuildDir,
env,
shell: true,
@@ -25,8 +25,8 @@ export default async function (hakEnv: HakEnv, moduleInfo: DependencyInfo): Prom
const buildTarget = hakEnv.wantsStaticSqlCipher() ? "build-bundled" : "build";
console.log("Running yarn build");
await hakEnv.spawn("yarn", ["run", buildTarget], {
console.log("Running pnpm build");
await hakEnv.spawn("pnpm", ["run", buildTarget], {
cwd: moduleInfo.moduleBuildDir,
env,
shell: true,

View File

@@ -21,43 +21,43 @@
"node": ">=18.0.0"
},
"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: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",
"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",
"start": "yarn run build:ts && yarn run build:res && electron .",
"lint": "yarn lint:types && yarn lint:js && yarn lint:workflows",
"start": "pnpm run build:ts && pnpm run build:res && electron .",
"lint": "pnpm lint:types && pnpm lint:js && pnpm lint:workflows",
"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: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:test": "tsc --noEmit -p playwright/tsconfig.json",
"lint:types:scripts": "tsc --noEmit -p scripts/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:knip": "knip",
"build:native": "yarn 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:32": "yarn run build:ts && yarn run build:res && electron-builder --ia32",
"build:64": "yarn run build:ts && yarn run build:res && electron-builder --x64",
"build:universal": "yarn run build:ts && yarn run build:res && electron-builder --universal",
"build": "yarn run build:ts && yarn run build:res && electron-builder",
"build:native": "pnpm run hak",
"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": "pnpm run build:ts && pnpm run build:res && electron-builder --ia32",
"build:64": "pnpm run build:ts && pnpm run build:res && electron-builder --x64",
"build:universal": "pnpm run build:ts && pnpm run build:res && electron-builder --universal",
"build": "pnpm run build:ts && pnpm run build:res && electron-builder",
"build:ts": "tsc",
"build:res": "tsx scripts/copy-res.ts",
"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": "scripts/in-docker.sh yarn run build",
"docker:install": "scripts/in-docker.sh yarn install",
"docker:build:native": "scripts/in-docker.sh pnpm run hak",
"docker:build": "scripts/in-docker.sh pnpm run build",
"docker:install": "scripts/in-docker.sh pnpm install",
"clean": "rimraf webapp.asar dist packages deploys lib",
"hak": "tsx scripts/hak/index.ts",
"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: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": {
"@sentry/electron": "^7.0.0",
@@ -76,7 +76,7 @@
"@babel/preset-env": "^7.18.10",
"@babel/preset-typescript": "^7.18.6",
"@electron/asar": "4.0.1",
"@playwright/test": "1.57.0",
"@playwright/test": "1.58.1",
"@stylistic/eslint-plugin": "^5.0.0",
"@types/auto-launch": "^5.0.1",
"@types/counterpart": "^0.18.1",
@@ -85,13 +85,14 @@
"@types/pacote": "^11.1.1",
"@typescript-eslint/eslint-plugin": "^8.0.0",
"@typescript-eslint/parser": "^8.0.0",
"app-builder-lib": "26.4.0",
"app-builder-lib": "26.6.0",
"chokidar": "^5.0.0",
"detect-libc": "^2.0.0",
"electron": "39.2.7",
"electron-builder": "26.4.0",
"electron-builder-squirrel-windows": "26.4.0",
"electron": "40.1.0",
"electron-builder": "26.6.0",
"electron-builder-squirrel-windows": "26.6.0",
"electron-devtools-installer": "^4.0.0",
"electron-playwright-helpers": "^2.1.0",
"eslint": "^8.26.0",
"eslint-config-google": "^0.14.0",
"eslint-config-prettier": "^10.0.0",
@@ -103,11 +104,9 @@
"husky": "^9.1.6",
"knip": "^5.0.0",
"lint-staged": "^16.0.0",
"matrix-web-i18n": "3.5.2",
"matrix-web-i18n": "3.6.0",
"mkdirp": "^3.0.0",
"pacote": "^21.0.0",
"patch-package": "^8.0.1",
"postinstall-postinstall": "^2.1.0",
"prettier": "^3.0.0",
"rimraf": "^6.0.0",
"tar": "^7.0.0",
@@ -118,10 +117,27 @@
"matrix-seshat": "^4.0.1"
},
"resolutions": {
"atomically": "2.0.5",
"atomically": "2.1.0",
"@types/node": "18.19.130",
"config-file-ts": "0.2.8-rc1",
"node-abi": "4.24.0",
"node-abi": "4.26.0",
"@types/pg-pool": "2.0.7"
}
},
"pnpm": {
"onlyBuiltDependencies": [
"matrix-js-sdk"
],
"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
--- a/node_modules/@types/auto-launch/index.d.ts
+++ b/node_modules/@types/auto-launch/index.d.ts
--- a/index.d.ts
+++ b/index.d.ts
@@ -25,6 +25,13 @@ interface AutoLaunchOptions {
declare class AutoLaunch {
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

View File

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

View File

@@ -12,6 +12,7 @@ import path, { dirname } from "node:path";
import os from "node:os";
import { fileURLToPath } from "node:url";
import { PassThrough } from "node:stream";
import { stubDialog } from "electron-playwright-helpers";
/**
* A PassThrough stream that captures all data written to it.
@@ -111,6 +112,8 @@ export const test = base.extend<Fixtures>({
page: async ({ app }, use) => {
const window = await app.firstWindow();
await use(window);
// EW may be configured to ask for confirmation before the app exits.
await stubDialog(app, "showMessageBoxSync", 1);
await app.close().catch((e) => {
console.error(e);
});

9416
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
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.
# 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
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.
It does this by installing it with `--ignore-scripts` and then using `yarn link` to keep the
dependency module separate so yarn doesn't try to run its install / postinstall script
at other points (eg. whenever you `yarn add` a random other dependency).
It does this by installing it with `--ignore-scripts` and then using `pnpm link` to keep the
dependency module separate so pnpm doesn't try to run its install / postinstall script
at other points (eg. whenever you `pnpm add` a random other dependency).
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
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
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
Hak is divided into lifecycle stages, in order:

View File

@@ -30,13 +30,13 @@ export default async function fetch(hakEnv: HakEnv, moduleInfo: DependencyInfo):
packumentCache,
});
console.log("Running yarn install in " + moduleInfo.moduleBuildDir);
await hakEnv.spawn("yarn", ["install", "--ignore-scripts"], {
console.log("Running pnpm install in " + moduleInfo.moduleBuildDir);
await hakEnv.spawn("pnpm", ["install", "--ignore-scripts"], {
cwd: moduleInfo.moduleBuildDir,
});
// also extract another copy to the output directory at this point
// nb. we do not yarn install in the output copy: we could install in
// nb. we do not pnpm install in the output copy: we could install in
// production mode to get only runtime dependencies and not devDependencies,
// but usually native modules come with dependencies that are needed for
// building/fetching the native modules (eg. node-pre-gyp) rather than

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.
*/
import path from "node:path";
import type HakEnv from "./hakEnv.js";
import { type DependencyInfo } from "./dep.js";
export default async function link(hakEnv: HakEnv, moduleInfo: DependencyInfo): Promise<void> {
const linkFolder = path.join(hakEnv.dotHakDir, "links");
await hakEnv.spawn("yarn", ["link", "--link-folder", linkFolder], {
cwd: moduleInfo.moduleOutDir,
});
await hakEnv.spawn("yarn", ["link", "--link-folder", linkFolder, moduleInfo.name], {
await hakEnv.spawn("pnpm", ["link", moduleInfo.moduleOutDir], {
cwd: hakEnv.projectRoot,
});
}

View File

@@ -8,7 +8,7 @@ IMAGE=${DOCKER_IMAGE_NAME:-"element-desktop-dockerbuild"}
docker inspect "$IMAGE" 2> /dev/null > /dev/null
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
fi

View File

@@ -14,7 +14,7 @@ export async function versionFromAsar(): Promise<string> {
try {
await fs.stat("webapp.asar");
} 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();
@@ -25,7 +25,7 @@ export async function setPackageVersion(ver: string): Promise<void> {
// all the various version fields
await new Promise<void>((resolve, reject) => {
childProcess.execFile(
process.platform === "win32" ? "yarn.cmd" : "yarn",
process.platform === "win32" ? "pnpm.cmd" : "pnpm",
[
"version",
"-s",

View File

@@ -507,15 +507,42 @@ app.on("ready", async () => {
const exitShortcutPressed =
input.type === "keyDown" && exitShortcuts.some((shortcutFn) => shortcutFn(input, process.platform));
// We only care about the exit shortcuts here
if (!exitShortcutPressed || !global.mainWindow) return;
// Early return if:
// 1. Keys that were pressed are not shortcuts for exiting the app
// 2. Electron mainWindow is null for some reason
// 3. The application is already in the process of quitting
if (!exitShortcutPressed || !global.mainWindow || global.appQuitting) return;
// Prevent the default behaviour
event.preventDefault();
// Let's ask the user if they really want to exit the app
// Check if the user expects us to minimize to tray instead of quitting the app
// Two cases:
// 1. On Linux/Windows, user has enabled "Show tray icon and minimise window to it on close" in settings.
// 2. On Mac, the canonical behaviour is to minimize to tray; this is not configurable.
const shouldMinimize = store.get("minimizeToTray") || process.platform === "darwin";
if (shouldMinimize) {
if (global.mainWindow?.isFullScreen()) {
global.mainWindow.once("leave-full-screen", () => global.mainWindow?.hide());
global.mainWindow.setFullScreen(false);
} else {
global.mainWindow?.hide();
}
return;
}
// Quit the app; rest of the quit logic is on the close event handler below.
app.quit();
});
global.mainWindow.on("closed", () => {
global.mainWindow = null;
});
global.mainWindow.on("close", async (e) => {
// Check if the user expects us to ask for confirmation before quitting the app
const shouldWarnBeforeExit = store.get("warnBeforeExit", true);
if (shouldWarnBeforeExit) {
if (shouldWarnBeforeExit && global.mainWindow) {
const shouldCancelCloseRequest =
dialog.showMessageBoxSync(global.mainWindow, {
type: "question",
@@ -529,33 +556,11 @@ app.on("ready", async () => {
defaultId: 1,
cancelId: 0,
}) === 0;
if (shouldCancelCloseRequest) return;
}
// Exit the app
app.exit();
});
global.mainWindow.on("closed", () => {
global.mainWindow = null;
});
global.mainWindow.on("close", async (e) => {
// If we are not quitting and have a tray icon then minimize to tray
if (!global.appQuitting && (tray.hasTray() || process.platform === "darwin")) {
// On Mac, closing the window just hides it
// (this is generally how single-window Mac apps
// behave, eg. Mail.app)
e.preventDefault();
if (global.mainWindow?.isFullScreen()) {
global.mainWindow.once("leave-full-screen", () => global.mainWindow?.hide());
global.mainWindow.setFullScreen(false);
} else {
global.mainWindow?.hide();
if (shouldCancelCloseRequest) {
e.preventDefault();
global.appQuitting = false;
return false;
}
return false;
}
});

View File

@@ -35,7 +35,7 @@
"eol": {
"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",
"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": {
"label": "Soubor"

View File

@@ -6,7 +6,7 @@
"copy": "Salin",
"cut": "Potong",
"delete": "Hapus",
"edit": "Sunting",
"edit": "Edit",
"minimise": "Minimalkan",
"paste": "Tempel",
"paste_match_style": "Tempel dan Cocokkan Gaya",

7405
yarn.lock
View File

File diff suppressed because it is too large Load Diff