mirror of
https://github.com/element-hq/element-desktop
synced 2025-03-15 00:47:47 +01:00
Merge branch 'develop' into johannes/new-room-header-on-nightly
This commit is contained in:
commit
e16740711f
@ -2,11 +2,11 @@ module.exports = {
|
||||
plugins: ["matrix-org"],
|
||||
extends: [".eslintrc.js"],
|
||||
parserOptions: {
|
||||
project: ["test/tsconfig.json"],
|
||||
project: ["playwright/tsconfig.json"],
|
||||
},
|
||||
overrides: [
|
||||
{
|
||||
files: ["test/**/*.ts"],
|
||||
files: ["playwright/**/*.ts"],
|
||||
extends: ["plugin:matrix-org/typescript"],
|
||||
rules: {
|
||||
// Things we do that break the ideal style
|
||||
|
8
.github/CODEOWNERS
vendored
8
.github/CODEOWNERS
vendored
@ -1,5 +1,5 @@
|
||||
* @vector-im/element-web
|
||||
/.github/workflows/** @vector-im/element-web-app-team
|
||||
/package.json @vector-im/element-web-app-team
|
||||
/yarn.lock @vector-im/element-web-app-team
|
||||
* @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
|
||||
/src/i18n/strings
|
||||
|
13
.github/PULL_REQUEST_TEMPLATE.md
vendored
13
.github/PULL_REQUEST_TEMPLATE.md
vendored
@ -2,12 +2,7 @@
|
||||
|
||||
## Checklist
|
||||
|
||||
- [ ] Ensure your code works with manual testing
|
||||
- [ ] Linter and other CI checks pass
|
||||
- [ ] Sign-off given on the changes (see [CONTRIBUTING.md](https://github.com/vector-im/element-desktop/blob/develop/CONTRIBUTING.md))
|
||||
|
||||
<!--
|
||||
If you would like to specify text for the changelog entry other than your PR title, add the following:
|
||||
|
||||
Notes: Add super cool feature
|
||||
-->
|
||||
- [ ] Ensure your code works with manual testing.
|
||||
- [ ] New or updated `public`/`exported` symbols have accurate [TSDoc](https://tsdoc.org/) documentation.
|
||||
- [ ] Linter and other CI checks pass.
|
||||
- [ ] Sign-off given on the changes (see [CONTRIBUTING.md](https://github.com/vector-im/element-desktop/blob/develop/CONTRIBUTING.md)).
|
||||
|
31
.github/labels.yml
vendored
Normal file
31
.github/labels.yml
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
- name: "A-Install"
|
||||
color: "72A447"
|
||||
- name: "A-Seshat"
|
||||
color: "8262BE"
|
||||
- name: "A-Update"
|
||||
color: "17BE67"
|
||||
- name: "Story"
|
||||
description: "A change to the product that generates user value on its own. Unit of delivery."
|
||||
color: "0BAC47"
|
||||
- name: "X-Breaking-Change"
|
||||
color: "ff7979"
|
||||
- name: "Z-Arch"
|
||||
color: "D601BE"
|
||||
- name: "Z-ARM"
|
||||
color: "5DEC5B"
|
||||
- name: "Z-Flatpak"
|
||||
color: "0CA856"
|
||||
- name: "Z-Linux"
|
||||
color: "7B4A9C"
|
||||
- name: "Z-macOS"
|
||||
color: "500605"
|
||||
- name: "Z-Official"
|
||||
color: "1D2B20"
|
||||
- name: "Z-Snap"
|
||||
color: "29CD95"
|
||||
- name: "Z-Suse"
|
||||
color: "79D07B"
|
||||
- name: "Z-Wayland"
|
||||
color: "94C519"
|
||||
- name: "Z-Windows"
|
||||
color: "0632DE"
|
2
.github/release-drafter.yml
vendored
2
.github/release-drafter.yml
vendored
@ -1 +1 @@
|
||||
_extends: vector-im/element-web
|
||||
_extends: element-hq/element-web
|
||||
|
176
.github/workflows/build_and_deploy.yaml
vendored
176
.github/workflows/build_and_deploy.yaml
vendored
@ -48,6 +48,7 @@ jobs:
|
||||
config: element.io/${{ inputs.mode || (github.event_name == 'release' && 'release') || 'nightly' }}
|
||||
version: ${{ (inputs.mode != 'release' && github.event_name != 'release') && 'develop' || '' }}
|
||||
nightly: ${{ inputs.mode != 'release' && github.event_name != 'release' }}
|
||||
deploy: ${{ inputs.deploy || (github.event_name != 'workflow_dispatch' && github.event.release.prerelease != true) }}
|
||||
secrets:
|
||||
CF_R2_ACCESS_KEY_ID: ${{ secrets.CF_R2_ACCESS_KEY_ID }}
|
||||
CF_R2_TOKEN: ${{ secrets.CF_R2_TOKEN }}
|
||||
@ -58,12 +59,11 @@ jobs:
|
||||
name: Windows ${{ matrix.arch }}
|
||||
strategy:
|
||||
matrix:
|
||||
arch: [x86, x64]
|
||||
arch: [ia32, x64]
|
||||
uses: ./.github/workflows/build_windows.yaml
|
||||
secrets: inherit
|
||||
with:
|
||||
sign: true
|
||||
deploy-mode: true
|
||||
arch: ${{ matrix.arch }}
|
||||
version: ${{ needs.prepare.outputs.nightly-version }}
|
||||
|
||||
@ -75,37 +75,25 @@ jobs:
|
||||
secrets: inherit
|
||||
with:
|
||||
sign: true
|
||||
deploy-mode: true
|
||||
base-url: https://packages.element.io/${{ needs.prepare.outputs.packages-dir }}
|
||||
version: ${{ needs.prepare.outputs.nightly-version }}
|
||||
|
||||
# We do not put these calls into deploy-mode as we do not want it to add to the packages.element.io artifact
|
||||
# We ship this build via reprepro only
|
||||
linux:
|
||||
if: github.event_name != 'workflow_dispatch' || inputs.linux
|
||||
needs: prepare
|
||||
name: Linux ${{ matrix.arch }} (sqlcipher system)
|
||||
name: Linux ${{ matrix.arch }} (sqlcipher ${{ matrix.sqlcipher }})
|
||||
strategy:
|
||||
matrix:
|
||||
arch: [amd64, arm64]
|
||||
sqlcipher: [system, static]
|
||||
exclude:
|
||||
- arch: arm64
|
||||
sqlcipher: static
|
||||
uses: ./.github/workflows/build_linux.yaml
|
||||
with:
|
||||
arch: ${{ matrix.arch }}
|
||||
config: ${{ needs.prepare.outputs.config }}
|
||||
sqlcipher: system
|
||||
version: ${{ needs.prepare.outputs.nightly-version }}
|
||||
|
||||
# We ship the static build via static tarball only
|
||||
linux_static:
|
||||
if: github.event_name != 'workflow_dispatch' || inputs.linux
|
||||
needs: prepare
|
||||
name: Linux (sqlcipher static)
|
||||
uses: ./.github/workflows/build_linux.yaml
|
||||
with:
|
||||
arch: amd64
|
||||
deploy-mode: true
|
||||
config: ${{ needs.prepare.outputs.config }}
|
||||
sqlcipher: static
|
||||
sqlcipher: ${{ matrix.sqlcipher }}
|
||||
version: ${{ needs.prepare.outputs.nightly-version }}
|
||||
|
||||
deploy:
|
||||
@ -113,23 +101,94 @@ jobs:
|
||||
- prepare
|
||||
- macos
|
||||
- linux
|
||||
- linux_static
|
||||
- windows
|
||||
runs-on: ubuntu-latest
|
||||
name: Deploy
|
||||
if: |
|
||||
always() && !failure() && !cancelled() && ((
|
||||
github.event_name != 'workflow_dispatch' &&
|
||||
github.event.release.prerelease != true
|
||||
) || (
|
||||
inputs.deploy && (inputs.macos || inputs.windows || inputs.linux)
|
||||
))
|
||||
environment: packages.element.io
|
||||
name: ${{ needs.prepare.outputs.deploy == 'true' && 'Deploy' || 'Deploy (dry-run)' }}
|
||||
if: always() && !failure() && !cancelled()
|
||||
environment: ${{ needs.prepare.outputs.deploy == 'true' && 'packages.element.io' || '' }}
|
||||
steps:
|
||||
- name: Download artifacts
|
||||
uses: actions/download-artifact@v3
|
||||
uses: actions/download-artifact@v4
|
||||
|
||||
- name: Prepare artifacts for deployment
|
||||
run: |
|
||||
# Windows
|
||||
for arch in x64 ia32 arm64
|
||||
do
|
||||
if [ -d "win-$arch" ]; then
|
||||
mkdir -p packages.element.io/{install,update}/win32/$arch
|
||||
mv win-$arch/squirrel-windows*/*.exe "packages.element.io/install/win32/$arch/"
|
||||
mv win-$arch/squirrel-windows*/*.nupkg "packages.element.io/update/win32/$arch/"
|
||||
mv win-$arch/squirrel-windows*/RELEASES "packages.element.io/update/win32/$arch/"
|
||||
fi
|
||||
done
|
||||
|
||||
# macOS
|
||||
if [ -d macos ]; then
|
||||
mkdir -p packages.element.io/{install,update}/macos
|
||||
mv macos/*.dmg packages.element.io/install/macos/
|
||||
mv macos/*-mac.zip packages.element.io/update/macos/
|
||||
mv macos/*.json packages.element.io/update/macos/
|
||||
fi
|
||||
|
||||
# Linux
|
||||
if [ -d linux-amd64-sqlcipher-static ]; then
|
||||
mkdir -p packages.element.io/install/linux/glibc-x86-64
|
||||
mv linux-amd64-sqlcipher-static/*.tar.gz packages.element.io/install/linux/glibc-x86-64
|
||||
fi
|
||||
|
||||
# We don't wish to store the installer for every nightly ever, so we only keep the latest
|
||||
- name: "[Nightly] Strip version from installer file"
|
||||
if: needs.prepare.outputs.nightly-version != ''
|
||||
run: |
|
||||
# Windows
|
||||
for arch in x64 ia32 arm64
|
||||
do
|
||||
[ -d "win-$arch" ] && mv packages.element.io/install/win32/$arch/{*,"Element Nightly Setup"}.exe
|
||||
done
|
||||
|
||||
# macOS
|
||||
[ -d macos ] && mv packages.element.io/install/macos/{*,"Element Nightly"}.dmg
|
||||
|
||||
# Linux
|
||||
[ -d linux-amd64-sqlcipher-static ] && mv packages.element.io/install/linux/glibc-x86-64/{*,element-desktop-nightly}.tar.gz
|
||||
|
||||
- name: "[Release] Prepare release latest symlink"
|
||||
if: needs.prepare.outputs.nightly-version == ''
|
||||
run: |
|
||||
# Windows
|
||||
for arch in x64 ia32 arm64
|
||||
do
|
||||
if [ -d "win-$arch" ]; then
|
||||
pushd packages.element.io/install/win32/$arch
|
||||
ln -s "$(find . -type f -iname "*.exe" | xargs -0 -n1 -- basename)" "Element Setup.exe"
|
||||
popd
|
||||
fi
|
||||
done
|
||||
|
||||
# macOS
|
||||
if [ -d macos ]; then
|
||||
pushd packages.element.io/install/macos
|
||||
ln -s "$(find . -type f -iname "*.dmg" | xargs -0 -n1 -- basename)" "Element.dmg"
|
||||
popd
|
||||
fi
|
||||
|
||||
# Linux
|
||||
if [ -d linux-amd64-sqlcipher-static ]; then
|
||||
pushd packages.element.io/install/linux/glibc-x86-64
|
||||
ln -s "$(find . -type f -iname "*.tar.gz" | xargs -0 -n1 -- basename)" "element-desktop.tar.gz"
|
||||
popd
|
||||
fi
|
||||
|
||||
- name: Stash packages.element.io
|
||||
if: needs.prepare.outputs.deploy == 'false'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: packages.element.io
|
||||
path: packages.element.io
|
||||
|
||||
- name: Deploy artifacts
|
||||
if: needs.prepare.outputs.deploy == 'true'
|
||||
run: |
|
||||
aws s3 cp --recursive packages.element.io/ s3://$R2_BUCKET/$DEPLOYMENT_DIR --endpoint-url $R2_URL --region auto
|
||||
env:
|
||||
@ -139,10 +198,11 @@ jobs:
|
||||
DEPLOYMENT_DIR: ${{ needs.prepare.outputs.packages-dir }}
|
||||
|
||||
- name: Notify packages.element.io of new files
|
||||
uses: peter-evans/repository-dispatch@bf47d102fdb849e755b0b0023ea3e81a44b6f570 # v2
|
||||
if: needs.prepare.outputs.deploy == 'true'
|
||||
uses: peter-evans/repository-dispatch@ff45666b9427631e3450c54a1bcbee4d9ff4d7c0 # v3
|
||||
with:
|
||||
token: ${{ secrets.ELEMENT_BOT_TOKEN }}
|
||||
repository: vector-im/packages.element.io
|
||||
repository: element-hq/packages.element.io
|
||||
event-type: packages-index
|
||||
|
||||
- name: Find debs
|
||||
@ -154,9 +214,18 @@ jobs:
|
||||
echo "$arch=$(ls linux-$arch-sqlcipher-system/*.deb | tail -n1)" >> $GITHUB_OUTPUT
|
||||
done
|
||||
|
||||
- name: Stash debs
|
||||
if: needs.prepare.outputs.deploy == 'false' && needs.linux.result == 'success'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: debs
|
||||
path: |
|
||||
${{ steps.deb.outputs.amd64 }}
|
||||
${{ steps.deb.outputs.arm64 }}
|
||||
|
||||
- name: Publish amd64 deb to packages.element.io
|
||||
uses: vector-im/packages.element.io@master
|
||||
if: needs.linux.result == 'success'
|
||||
uses: element-hq/packages.element.io@master
|
||||
if: needs.prepare.outputs.deploy == 'true' && needs.linux.result == 'success'
|
||||
with:
|
||||
file: ${{ steps.deb.outputs.amd64 }}
|
||||
github-token: ${{ secrets.ELEMENT_BOT_TOKEN }}
|
||||
@ -165,11 +234,44 @@ jobs:
|
||||
bucket-access-key: ${{ secrets.CF_R2_TOKEN }}
|
||||
|
||||
- name: Publish arm64 deb to packages.element.io
|
||||
uses: vector-im/packages.element.io@master
|
||||
if: needs.linux.result == 'success'
|
||||
uses: element-hq/packages.element.io@master
|
||||
if: needs.prepare.outputs.deploy == 'true' && needs.linux.result == 'success'
|
||||
with:
|
||||
file: ${{ steps.deb.outputs.arm64 }}
|
||||
github-token: ${{ secrets.ELEMENT_BOT_TOKEN }}
|
||||
bucket-api: ${{ vars.CF_R2_S3_API }}
|
||||
bucket-key-id: ${{ secrets.CF_R2_ACCESS_KEY_ID }}
|
||||
bucket-access-key: ${{ secrets.CF_R2_TOKEN }}
|
||||
|
||||
deploy-ess:
|
||||
needs: deploy
|
||||
runs-on: ubuntu-latest
|
||||
name: Deploy builds to ESS
|
||||
if: needs.prepare.outputs.deploy == 'true' && github.event_name == 'release'
|
||||
env:
|
||||
BUCKET_NAME: "element-desktop-msi.onprem.element.io"
|
||||
AWS_REGION: "eu-central-1"
|
||||
permissions:
|
||||
id-token: write # This is required for requesting the JWT
|
||||
steps:
|
||||
- name: Configure AWS credentials
|
||||
uses: aws-actions/configure-aws-credentials@v4
|
||||
with:
|
||||
role-to-assume: arn:aws:iam::264135176173:role/Push-ElementDesktop-MSI
|
||||
role-session-name: githubaction-run-${{ github.run_id }}
|
||||
aws-region: ${{ env.AWS_REGION }}
|
||||
|
||||
- name: Download artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
pattern: win-*
|
||||
|
||||
- name: Copy files to S3
|
||||
run: |
|
||||
PREFIX="${VERSION%.*}"
|
||||
for file in win-*/*.msi; do
|
||||
filename=$(basename "$file")
|
||||
aws s3 cp "$file" "s3://${{ env.BUCKET_NAME }}/$PREFIX/$filename"
|
||||
done
|
||||
env:
|
||||
VERSION: ${{ github.event.release.tag_name }}
|
||||
|
55
.github/workflows/build_and_test.yaml
vendored
55
.github/workflows/build_and_test.yaml
vendored
@ -19,7 +19,7 @@ jobs:
|
||||
uses: ./.github/workflows/build_windows.yaml
|
||||
strategy:
|
||||
matrix:
|
||||
arch: [x64, x86]
|
||||
arch: [x64, ia32]
|
||||
with:
|
||||
arch: ${{ matrix.arch }}
|
||||
|
||||
@ -37,17 +37,17 @@ jobs:
|
||||
REGISTRY: ghcr.io
|
||||
IMAGE_NAME: ${{ github.repository }}-dockerbuild-pr
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: "Get modified files"
|
||||
id: changed_files
|
||||
uses: tj-actions/changed-files@25ef3926d147cd02fc7e931c1ef50772bbb0d25d # v40
|
||||
uses: tj-actions/changed-files@635f118699dd888d737c15018cd30aff2e0274f8 # v44
|
||||
with:
|
||||
files: |
|
||||
dockerbuild/**
|
||||
- name: Log in to the Container registry
|
||||
if: steps.changed_files.outputs.any_modified == 'true'
|
||||
uses: docker/login-action@1f401f745bf57e30b3a2800ad308a87d2ebdf14b
|
||||
uses: docker/login-action@5f4866a30a54f16a52d2ecb4a3898e9e424939cf
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ github.actor }}
|
||||
@ -63,7 +63,7 @@ jobs:
|
||||
|
||||
- name: Build and push Docker image
|
||||
if: steps.changed_files.outputs.any_modified == 'true'
|
||||
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5
|
||||
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5
|
||||
with:
|
||||
context: dockerbuild
|
||||
push: true
|
||||
@ -106,21 +106,26 @@ jobs:
|
||||
- name: macOS Universal
|
||||
os: macos
|
||||
artifact: macos
|
||||
executable: "/Volumes/Element/Element.app/Contents/MacOS/Element"
|
||||
prepare_cmd: "hdiutil attach ./dist/*.dmg -mountpoint /Volumes/Element"
|
||||
executable: "/Users/runner/Applications/Element.app/Contents/MacOS/Element"
|
||||
# We need to mount the DMG and copy the app to the Applications folder as a mounted DMG is
|
||||
# read-only and thus would not allow us to override the fuses as is required for Playwright.
|
||||
prepare_cmd: |
|
||||
hdiutil attach ./dist/*.dmg -mountpoint /Volumes/Element &&
|
||||
rsync -a /Volumes/Element/Element.app ~/Applications/ &&
|
||||
hdiutil detach /Volumes/Element
|
||||
- name: "Linux (amd64) (sqlcipher: system)"
|
||||
os: ubuntu
|
||||
artifact: linux-amd64-sqlcipher-system
|
||||
executable: "element-desktop"
|
||||
executable: "/opt/Element/element-desktop"
|
||||
prepare_cmd: "sudo apt install ./dist/*.deb"
|
||||
- name: "Linux (amd64) (sqlcipher: static)"
|
||||
os: ubuntu
|
||||
artifact: linux-amd64-sqlcipher-static
|
||||
executable: "element-desktop"
|
||||
executable: "/opt/Element/element-desktop"
|
||||
prepare_cmd: "sudo apt install ./dist/*.deb"
|
||||
- name: Windows (x86)
|
||||
os: windows
|
||||
artifact: win-x86
|
||||
artifact: win-ia32
|
||||
executable: "./dist/win-ia32-unpacked/Element.exe"
|
||||
- name: Windows (x64)
|
||||
os: windows
|
||||
@ -129,16 +134,17 @@ jobs:
|
||||
name: Test ${{ matrix.name }}
|
||||
runs-on: ${{ matrix.os }}-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@v3
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: package.json
|
||||
cache: "yarn"
|
||||
|
||||
- name: Install Deps
|
||||
run: "yarn install --frozen-lockfile"
|
||||
|
||||
- uses: actions/download-artifact@v3
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: ${{ matrix.artifact }}
|
||||
path: dist
|
||||
@ -147,18 +153,27 @@ jobs:
|
||||
run: ${{ matrix.prepare_cmd }}
|
||||
if: matrix.prepare_cmd
|
||||
|
||||
# We previously disabled the `EnableNodeCliInspectArguments` fuse, but Playwright requires
|
||||
# it to be enabled to test Electron apps, so turn it back on.
|
||||
- name: Set EnableNodeCliInspectArguments fuse enabled
|
||||
run: $RUN_AS npx @electron/fuses write --app ${{ matrix.executable }} EnableNodeCliInspectArguments=on
|
||||
shell: bash
|
||||
env:
|
||||
# We need sudo on Linux as it is installed in /opt/
|
||||
RUN_AS: ${{ runner.os == 'Linux' && 'sudo' || '' }}
|
||||
|
||||
- name: Run tests
|
||||
uses: coactions/setup-xvfb@b6b4fcfb9f5a895edadc3bc76318fae0ac17c8b3 # v1
|
||||
uses: coactions/setup-xvfb@6b00cf1889f4e1d5a48635647013c0508128ee1a
|
||||
timeout-minutes: 5
|
||||
with:
|
||||
run: "yarn test"
|
||||
run: "yarn test ${{ runner.os != 'Linux' && '--ignore-snapshots' || '' }}"
|
||||
env:
|
||||
ELEMENT_DESKTOP_EXECUTABLE: ${{ matrix.executable }}
|
||||
|
||||
- name: Upload Artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
- name: Upload HTML report
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ matrix.artifact }}
|
||||
path: test_artifacts
|
||||
retention-days: 1
|
||||
name: ${{ matrix.artifact }}-test
|
||||
path: playwright/html-report
|
||||
retention-days: 14
|
||||
|
67
.github/workflows/build_linux.yaml
vendored
67
.github/workflows/build_linux.yaml
vendored
@ -20,24 +20,20 @@ on:
|
||||
type: string
|
||||
required: true
|
||||
description: "How to link sqlcipher, one of 'system' | 'static'"
|
||||
deploy-mode:
|
||||
type: boolean
|
||||
required: false
|
||||
description: "Whether to arrange artifacts in the arrangement needed for deployment, skipping unrelated ones"
|
||||
docker-image:
|
||||
type: string
|
||||
required: false
|
||||
description: "The docker image to use for the build, defaults to ghcr.io/vector-im/element-desktop-dockerbuild"
|
||||
description: "The docker image to use for the build, defaults to ghcr.io/element-hq/element-desktop-dockerbuild"
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: ${{ inputs.docker-image || format('ghcr.io/vector-im/element-desktop-dockerbuild:{0}', github.ref_name == 'master' && 'master' || 'develop') }}
|
||||
image: ${{ inputs.docker-image || format('ghcr.io/element-hq/element-desktop-dockerbuild:{0}', github.ref_name == 'master' && 'master' || 'develop') }}
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
steps:
|
||||
- uses: kanga333/variable-mapper@master
|
||||
- uses: nbucic/variable-mapper@0673f6891a0619ba7c002ecfed0f9f4f39017b6f
|
||||
id: config
|
||||
with:
|
||||
key: "${{ inputs.arch }}"
|
||||
@ -55,22 +51,23 @@ jobs:
|
||||
}
|
||||
}
|
||||
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/download-artifact@v3
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: webapp
|
||||
|
||||
- name: Cache .hak
|
||||
id: cache
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
key: ${{ runner.os }}-${{ inputs.docker-image || github.ref_name }}-${{ inputs.sqlcipher }}-${{ inputs.arch }}-${{ hashFiles('hakHash', 'electronVersion') }}
|
||||
path: |
|
||||
./.hak
|
||||
|
||||
- uses: actions/setup-node@v3
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: package.json
|
||||
cache: "yarn"
|
||||
env:
|
||||
# Workaround for https://github.com/actions/setup-node/issues/317
|
||||
@ -91,12 +88,9 @@ jobs:
|
||||
if: steps.cache.outputs.cache-hit != 'true' && inputs.arch == 'arm64'
|
||||
run: |
|
||||
set -x
|
||||
sed -i 's/deb http/deb [arch=amd64] http/g' /etc/apt/sources.list
|
||||
echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ bionic main multiverse restricted universe" | tee -a /etc/apt/sources.list
|
||||
echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ bionic-updates main multiverse restricted universe" | tee -a /etc/apt/sources.list
|
||||
dpkg --add-architecture arm64
|
||||
apt-get -qq update
|
||||
apt-get -qq install --no-install-recommends crossbuild-essential-arm64 libsqlcipher-dev:arm64 libssl-dev:arm64 libsecret-1-dev:arm64 libgnome-keyring-dev:arm64
|
||||
apt-get -qq install --no-install-recommends crossbuild-essential-arm64 libsqlcipher-dev:arm64 libssl-dev:arm64 libsecret-1-dev:arm64
|
||||
rustup target add aarch64-unknown-linux-gnu
|
||||
mv dockerbuild/aarch64/.cargo .
|
||||
cat dockerbuild/aarch64/.env >> $GITHUB_ENV
|
||||
@ -106,24 +100,19 @@ jobs:
|
||||
run: "yarn build:native --target ${{ steps.config.outputs.target }}"
|
||||
|
||||
- name: "[Nightly] Resolve version"
|
||||
id: nightly
|
||||
if: inputs.version != ''
|
||||
run: |
|
||||
echo "config-args=--nightly '${{ inputs.version }}'" >> $GITHUB_OUTPUT
|
||||
echo "ED_NIGHTLY=${{ inputs.version }}" >> $GITHUB_ENV
|
||||
|
||||
- name: Generate debian files and arguments
|
||||
id: debian
|
||||
run: |
|
||||
if [ -f changelog.Debian ]; then
|
||||
echo "config-args=--deb-changelog changelog.Debian" >> $GITHUB_OUTPUT
|
||||
echo "ED_DEBIAN_CHANGELOG=changelog.Debian" >> $GITHUB_ENV
|
||||
fi
|
||||
|
||||
- name: Build App
|
||||
run: |
|
||||
npx ts-node scripts/generate-builder-config.ts \
|
||||
${{ steps.nightly.outputs.config-args }} \
|
||||
${{ steps.debian.outputs.config-args }}
|
||||
yarn build --publish never -l --config electron-builder.json ${{ steps.config.outputs.build-args }}
|
||||
yarn build --publish never -l ${{ steps.config.outputs.build-args }}
|
||||
|
||||
- name: Check native libraries
|
||||
run: |
|
||||
@ -151,39 +140,11 @@ jobs:
|
||||
env:
|
||||
ARCH: ${{ steps.config.outputs.arch }}
|
||||
|
||||
- name: Stash deb package
|
||||
if: inputs.deploy-mode
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: linux-sqlcipher-${{ inputs.sqlcipher }}-deb
|
||||
path: dist/*.deb
|
||||
retention-days: 1
|
||||
|
||||
- name: Prepare artifacts for deployment
|
||||
if: inputs.deploy-mode
|
||||
run: |
|
||||
mv dist _dist
|
||||
mkdir -p "dist/install/linux/glibc-x86-64/"
|
||||
mv _dist/*.tar.gz "dist/install/linux/glibc-x86-64"
|
||||
|
||||
# We don't wish to store the tarball for every nightly ever, so we only keep the latest
|
||||
- name: "[Nightly] Strip version from tarball"
|
||||
if: inputs.deploy-mode && inputs.version != ''
|
||||
run: |
|
||||
mv dist/install/linux/glibc-x86-64/*.tar.gz "dist/install/linux/glibc-x86-64/element-desktop-nightly.tar.gz"
|
||||
|
||||
- name: "[Release] Prepare release latest symlink"
|
||||
if: inputs.deploy-mode && inputs.version == ''
|
||||
shell: bash
|
||||
run: |
|
||||
ln -s "$(find . -type f -iname "*.tar.gz" | xargs -0 -n1 -- basename)" "element-desktop.tar.gz"
|
||||
working-directory: "dist/install/linux/glibc-x86-64"
|
||||
|
||||
# We exclude *-unpacked as it loses permissions and the tarball contains it with correct permissions
|
||||
- name: Upload Artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ inputs.deploy-mode && 'packages.element.io' || format('linux-{0}-sqlcipher-{1}', inputs.arch, inputs.sqlcipher) }}
|
||||
name: linux-${{ inputs.arch }}-sqlcipher-${{ inputs.sqlcipher }}
|
||||
path: |
|
||||
dist
|
||||
!dist/*-unpacked/**
|
||||
|
72
.github/workflows/build_macos.yaml
vendored
72
.github/workflows/build_macos.yaml
vendored
@ -23,28 +23,24 @@ on:
|
||||
type: string
|
||||
required: false
|
||||
description: "Whether to sign & notarise the build, requires 'packages.element.io' environment"
|
||||
deploy-mode:
|
||||
type: boolean
|
||||
required: false
|
||||
description: "Whether to arrange artifacts in the arrangement needed for deployment, skipping unrelated ones"
|
||||
base-url:
|
||||
type: string
|
||||
required: false
|
||||
description: "The URL to which the output will be deployed, required if deploy-mode is enabled."
|
||||
description: "The URL to which the output will be deployed."
|
||||
jobs:
|
||||
build:
|
||||
runs-on: macos-latest
|
||||
runs-on: macos-14 # M1
|
||||
environment: ${{ inputs.sign && 'packages.element.io' || '' }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/download-artifact@v3
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: webapp
|
||||
|
||||
- name: Cache .hak
|
||||
id: cache
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
key: ${{ runner.os }}-${{ hashFiles('hakHash', 'electronVersion') }}
|
||||
path: |
|
||||
@ -56,9 +52,16 @@ jobs:
|
||||
rustup toolchain install stable --profile minimal --no-self-update
|
||||
rustup default stable
|
||||
rustup target add aarch64-apple-darwin
|
||||
rustup target add x86_64-apple-darwin
|
||||
|
||||
- uses: actions/setup-node@v3
|
||||
# M1 macos-14 comes without Python preinstalled
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.12"
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: package.json
|
||||
cache: "yarn"
|
||||
|
||||
# Does not need branch matching as only analyses this layer
|
||||
@ -73,18 +76,17 @@ jobs:
|
||||
yarn build:native:universal
|
||||
|
||||
- name: "[Nightly] Resolve version"
|
||||
id: nightly
|
||||
if: inputs.version != ''
|
||||
run: |
|
||||
echo "config-args=--nightly '${{ inputs.version }}'" >> $GITHUB_OUTPUT
|
||||
echo "ED_NIGHTLY=${{ inputs.version }}" >> $GITHUB_ENV
|
||||
|
||||
# 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: |
|
||||
scripts/generate-builder-config.ts ${{ steps.nightly.outputs.config-args }} --notarytool-team-id='${{ secrets.APPLE_TEAM_ID }}'
|
||||
yarn build:universal --publish never --config electron-builder.json
|
||||
yarn build:universal --publish never
|
||||
env:
|
||||
ED_NOTARYTOOL_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
|
||||
APPLE_ID: ${{ secrets.APPLE_ID }}
|
||||
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
|
||||
CSC_KEY_PASSWORD: ${{ secrets.APPLE_CSC_KEY_PASSWORD }}
|
||||
@ -93,27 +95,21 @@ jobs:
|
||||
- name: Check app was signed & notarised successfully
|
||||
if: inputs.sign != ''
|
||||
run: |
|
||||
hdiutil attach dist/*.dmg
|
||||
codesign -dv --verbose=4 /Volumes/Element*/*.app
|
||||
spctl -a -vvv -t install /Volumes/Element*/*.app
|
||||
hdiutil detach /Volumes/Element*
|
||||
hdiutil attach dist/*.dmg -mountpoint /Volumes/Element
|
||||
codesign -dv --verbose=4 /Volumes/Element/*.app
|
||||
spctl -a -vvv -t install /Volumes/Element/*.app
|
||||
hdiutil detach /Volumes/Element
|
||||
|
||||
- name: "[Unsigned] Build App"
|
||||
if: inputs.sign == ''
|
||||
run: |
|
||||
scripts/generate-builder-config.ts ${{ steps.nightly.outputs.config-args }}
|
||||
yarn build:universal --publish never --config electron-builder.json
|
||||
yarn build:universal --publish never
|
||||
env:
|
||||
CSC_IDENTITY_AUTO_DISCOVERY: false
|
||||
|
||||
- name: Prepare artifacts for deployment
|
||||
if: inputs.deploy-mode
|
||||
- name: Generate releases.json
|
||||
if: inputs.base-url
|
||||
run: |
|
||||
mv dist _dist
|
||||
mkdir -p dist/install/macos dist/update/macos
|
||||
mv _dist/*-mac.zip dist/update/macos/
|
||||
mv _dist/*.dmg dist/install/macos/
|
||||
|
||||
PKG_JSON_VERSION=$(cat package.json | jq -r .version)
|
||||
LATEST=$(find dist -type f -iname "*-mac.zip" | xargs -0 -n1 -- basename)
|
||||
# Encode spaces in the URL as Squirrel.Mac complains about bad JSON otherwise
|
||||
@ -130,30 +126,18 @@ jobs:
|
||||
},
|
||||
}],
|
||||
}
|
||||
' > dist/update/macos/releases.json
|
||||
' > dist/releases.json
|
||||
jq -n --arg url "$URL" '
|
||||
{ url: $url }
|
||||
' > dist/update/macos/releases-legacy.json
|
||||
' > dist/releases-legacy.json
|
||||
env:
|
||||
VERSION: ${{ inputs.version }}
|
||||
|
||||
# We don't wish to store the installer for every nightly ever, so we only keep the latest
|
||||
- name: "[Nightly] Strip version from installer file"
|
||||
if: inputs.deploy-mode && inputs.version != ''
|
||||
run: |
|
||||
mv dist/install/macos/*.dmg "dist/install/macos/Element Nightly.dmg"
|
||||
|
||||
- name: "[Release] Prepare release latest symlink"
|
||||
if: inputs.deploy-mode && inputs.version == ''
|
||||
run: |
|
||||
ln -s "$(find . -type f -iname "*.dmg" | xargs -0 -n1 -- basename)" "Element.dmg"
|
||||
working-directory: "dist/install/macos"
|
||||
|
||||
# We exclude mac-universal as the unpacked app takes forever to upload and zip and dmg already contain it
|
||||
# We exclude mac-universal as the unpacked app takes forever to upload and zip and dmg already contains it
|
||||
- name: Upload Artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ inputs.deploy-mode && 'packages.element.io' || 'macos' }}
|
||||
name: macos
|
||||
path: |
|
||||
dist
|
||||
!dist/mac-universal/**
|
||||
|
20
.github/workflows/build_prepare.yaml
vendored
20
.github/workflows/build_prepare.yaml
vendored
@ -15,6 +15,11 @@ on:
|
||||
required: false
|
||||
default: false
|
||||
description: "Whether the build is a Nightly and to calculate the version strings new builds should use"
|
||||
deploy:
|
||||
type: boolean
|
||||
required: false
|
||||
default: false
|
||||
description: "Whether the build should be deployed to production"
|
||||
secrets:
|
||||
# Required if `nightly` is set
|
||||
CF_R2_ACCESS_KEY_ID:
|
||||
@ -29,10 +34,13 @@ on:
|
||||
packages-dir:
|
||||
description: "The directory non-deb packages for this run should live in within packages.element.io"
|
||||
value: ${{ inputs.nightly && 'nightly' || 'desktop' }}
|
||||
# This is just a simple pass-through of the input to simplify reuse of complex inline conditions
|
||||
# These are just simple pass-throughs of the input to simplify reuse of complex inline conditions
|
||||
config:
|
||||
description: "The relative path to the config file for this run"
|
||||
value: ${{ inputs.config }}
|
||||
deploy:
|
||||
description: "The relative path to the config file for this run"
|
||||
value: ${{ inputs.deploy }}
|
||||
jobs:
|
||||
prepare:
|
||||
name: Prepare
|
||||
@ -41,10 +49,11 @@ jobs:
|
||||
outputs:
|
||||
nightly-version: ${{ steps.versions.outputs.nightly }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@v3
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: package.json
|
||||
cache: "yarn"
|
||||
|
||||
- name: Install Deps
|
||||
@ -74,6 +83,7 @@ jobs:
|
||||
|
||||
# Pick the greatest one
|
||||
VERSION=$(cat VERSIONS | sort -uf | tail -n1)
|
||||
echo "Found latest nightly version $VERSION"
|
||||
# Increment it
|
||||
echo "nightly=$(scripts/generate-nightly-version.ts --latest $VERSION)" >> $GITHUB_OUTPUT
|
||||
env:
|
||||
@ -124,11 +134,11 @@ jobs:
|
||||
echo "| Component | Version |" >> $GITHUB_STEP_SUMMARY
|
||||
echo "| ----------- | ------- |" >> $GITHUB_STEP_SUMMARY
|
||||
echo "| Bundle Hash | $BUNDLE_HASH |" >> $GITHUB_STEP_SUMMARY
|
||||
echo "| Element Web | [$WEB_VERSION](https://github.com/vector-im/element-web/commit/$WEB_VERSION) |" >> $GITHUB_STEP_SUMMARY
|
||||
echo "| Element Web | [$WEB_VERSION](https://github.com/element-hq/element-web/commit/$WEB_VERSION) |" >> $GITHUB_STEP_SUMMARY
|
||||
echo "| React SDK | [$REACT_VERSION](https://github.com/matrix-org/matrix-react-sdk/commit/$REACT_VERSION) |" >> $GITHUB_STEP_SUMMARY
|
||||
echo "| JS SDK | [$JS_VERSION](https://github.com/matrix-org/matrix-js-sdk/commit/$JS_VERSION) |" >> $GITHUB_STEP_SUMMARY
|
||||
|
||||
- uses: actions/upload-artifact@v3
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: webapp
|
||||
retention-days: 1
|
||||
|
93
.github/workflows/build_windows.yaml
vendored
93
.github/workflows/build_windows.yaml
vendored
@ -1,6 +1,11 @@
|
||||
# This workflow relies on actions/cache to store the hak dependency artifacts as they take a long time to build
|
||||
# Due to this extra care must be taken to only ever run all build_* scripts against the same branch to ensure
|
||||
# the correct cache scoping, and additional care must be taken to not run untrusted actions on the develop branch.
|
||||
|
||||
# window-latest by default uses the pwsh shell which breaks codeSigningCert in the workflow
|
||||
defaults:
|
||||
run:
|
||||
shell: powershell
|
||||
on:
|
||||
workflow_call:
|
||||
secrets:
|
||||
@ -14,7 +19,7 @@ on:
|
||||
arch:
|
||||
type: string
|
||||
required: true
|
||||
description: "The architecture to build for, one of 'x64' | 'x86' | 'arm64'"
|
||||
description: "The architecture to build for, one of 'x64' | 'ia32' | 'arm64'"
|
||||
version:
|
||||
type: string
|
||||
required: false
|
||||
@ -23,10 +28,6 @@ on:
|
||||
type: string
|
||||
required: false
|
||||
description: "Whether to sign & notarise the build, requires 'packages.element.io' environment"
|
||||
deploy-mode:
|
||||
type: boolean
|
||||
required: false
|
||||
description: "Whether to arrange artifacts in the arrangement needed for deployment, skipping unrelated ones"
|
||||
jobs:
|
||||
build:
|
||||
runs-on: windows-latest
|
||||
@ -34,7 +35,7 @@ jobs:
|
||||
env:
|
||||
SIGNTOOL_PATH: "C:/Program Files (x86)/Windows Kits/10/bin/10.0.22000.0/x86/signtool.exe"
|
||||
steps:
|
||||
- uses: kanga333/variable-mapper@3681b75f5c6c00162721168fb91ab74925eaebcb
|
||||
- uses: nbucic/variable-mapper@0673f6891a0619ba7c002ecfed0f9f4f39017b6f
|
||||
id: config
|
||||
with:
|
||||
key: "${{ inputs.arch }}"
|
||||
@ -42,38 +43,36 @@ jobs:
|
||||
map: |
|
||||
{
|
||||
"x64": {
|
||||
"target": "x86_64-pc-windows-msvc",
|
||||
"dir": "x64"
|
||||
"target": "x86_64-pc-windows-msvc"
|
||||
},
|
||||
"arm64": {
|
||||
"target": "aarch64-pc-windows-msvc",
|
||||
"build-args": "--arm64",
|
||||
"arch": "amd64_arm64",
|
||||
"dir": "arm64"
|
||||
"arch": "amd64_arm64"
|
||||
},
|
||||
"x86": {
|
||||
"ia32": {
|
||||
"target": "i686-pc-windows-msvc",
|
||||
"build-args": "--ia32",
|
||||
"dir": "ia32"
|
||||
"arch": "x86"
|
||||
}
|
||||
}
|
||||
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/download-artifact@v3
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: webapp
|
||||
|
||||
- name: Cache .hak
|
||||
id: cache
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
key: ${{ runner.os }}-${{ inputs.arch }}-${{ hashFiles('hakHash', 'electronVersion') }}
|
||||
path: |
|
||||
./.hak
|
||||
|
||||
- name: Set up build tools
|
||||
uses: ilammy/msvc-dev-cmd@cec98b9d092141f74527d0afa6feb2af698cfe89
|
||||
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
|
||||
with:
|
||||
arch: ${{ steps.config.outputs.arch || inputs.arch }}
|
||||
|
||||
@ -100,8 +99,9 @@ jobs:
|
||||
rustup default stable
|
||||
rustup target add ${{ steps.config.outputs.target }}
|
||||
|
||||
- uses: actions/setup-node@v3
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: package.json
|
||||
cache: "yarn"
|
||||
|
||||
# Does not need branch matching as only analyses this layer
|
||||
@ -115,13 +115,14 @@ jobs:
|
||||
yarn build:native --target ${{ steps.config.outputs.target }}
|
||||
|
||||
- name: Install and configure eSigner CKA
|
||||
id: esigner
|
||||
if: inputs.sign
|
||||
run: |
|
||||
Set-StrictMode -Version 'Latest'
|
||||
|
||||
# Download
|
||||
Invoke-WebRequest -OutFile eSigner_CKA.exe "https://packages.element.io/tools/SSL.COM%20eSigner%20CKA_1.0.4-build-20230221_signed.exe"
|
||||
# Download, extract, and rename
|
||||
Invoke-WebRequest -OutFile eSigner_CKA.zip "$env:ESIGNER_URL"
|
||||
Expand-Archive -Path eSigner_CKA.zip -DestinationPath .
|
||||
Get-ChildItem -Path * -Include "*_build_*.exe" | Rename-Item -NewName eSigner_CKA.exe
|
||||
|
||||
# Install
|
||||
New-Item -ItemType Directory -Force -Path "$env:INSTALL_DIR"
|
||||
@ -144,61 +145,37 @@ jobs:
|
||||
# Extract thumbprint and subject name
|
||||
$Thumbprint = $CodeSigningCert.Thumbprint
|
||||
$SubjectName = ($CodeSigningCert.Subject -replace ", ?", "`n" | ConvertFrom-StringData).CN
|
||||
echo "config-args=--signtool-thumbprint '$Thumbprint' --signtool-subject-name '$SubjectName'" >> $env:GITHUB_OUTPUT
|
||||
|
||||
echo "ED_SIGNTOOL_THUMBPRINT=$Thumbprint" >> $env:GITHUB_ENV
|
||||
echo "ED_SIGNTOOL_SUBJECT_NAME=$SubjectName" >> $env:GITHUB_ENV
|
||||
env:
|
||||
ESIGNER_URL: https://github.com/SSLcom/eSignerCKA/releases/download/v1.0.6/SSL.COM-eSigner-CKA_1.0.6.zip
|
||||
INSTALL_DIR: C:\Users\runneradmin\eSignerCKA
|
||||
MASTER_KEY_FILE: C:\Users\runneradmin\eSignerCKA\master.key
|
||||
|
||||
- name: "[Nightly] Resolve version"
|
||||
id: nightly
|
||||
if: inputs.version != ''
|
||||
shell: bash
|
||||
run: |
|
||||
echo "config-args=--nightly '${{ inputs.version }}'" >> $GITHUB_OUTPUT
|
||||
echo "ED_NIGHTLY=${{ inputs.version }}" >> $GITHUB_ENV
|
||||
|
||||
# XXX: For whatever reason if we use `yarn build ...` it freezes, but splitting it into parts it is fine
|
||||
- run: yarn run build:ts
|
||||
- run: yarn run build:res
|
||||
|
||||
- name: Build App
|
||||
run: |
|
||||
yarn ts-node scripts/generate-builder-config.ts ${{ steps.nightly.outputs.config-args }} ${{ steps.esigner.outputs.config-args }}
|
||||
yarn build --publish never -w --config electron-builder.json ${{ steps.config.outputs.build-args }}
|
||||
yarn electron-builder --publish never -w ${{ steps.config.outputs.build-args }}
|
||||
|
||||
- name: Check app was signed successfully
|
||||
if: inputs.sign != ''
|
||||
run: |
|
||||
. "$env:SIGNTOOL_PATH" verify /pa (get-item ./dist/squirrel-windows*/*.exe)
|
||||
|
||||
- name: Prepare artifacts for deployment
|
||||
if: inputs.deploy-mode
|
||||
shell: bash
|
||||
run: |
|
||||
mv dist _dist
|
||||
mkdir -p "dist/install/win32/$DIR/msi" "dist/update/win32/$DIR"
|
||||
mv _dist/squirrel-windows*/*.exe "dist/install/win32/$DIR"
|
||||
mv _dist/squirrel-windows*/*.nupkg "dist/update/win32/$DIR/"
|
||||
mv _dist/squirrel-windows*/RELEASES "dist/update/win32/$DIR/"
|
||||
# mv _dist/*.msi "dist/install/win32/$DIR/msi/"
|
||||
env:
|
||||
DIR: ${{ steps.config.outputs.dir }}
|
||||
|
||||
# We don't wish to store the installer for every nightly ever, so we only keep the latest
|
||||
- name: "[Nightly] Strip version from installer file"
|
||||
if: inputs.deploy-mode && inputs.version != ''
|
||||
shell: bash
|
||||
run: |
|
||||
mv dist/install/win32/$DIR/*.exe "dist/install/win32/$DIR/Element Nightly Setup.exe"
|
||||
# mv dist/install/win32/$DIR/msi/*.msi "dist/install/win32/$DIR/msi/Element Nightly Setup.msi"
|
||||
env:
|
||||
DIR: ${{ steps.config.outputs.dir }}
|
||||
|
||||
- name: "[Release] Prepare release latest symlink"
|
||||
if: inputs.deploy-mode && inputs.version == ''
|
||||
shell: bash
|
||||
run: |
|
||||
ln -s "$(find . -type f -iname "*.exe" | xargs -0 -n1 -- basename)" "Element Setup.exe"
|
||||
working-directory: "dist/install/win32/${{ steps.config.outputs.dir }}"
|
||||
|
||||
- name: Upload Artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ inputs.deploy-mode && 'packages.element.io' || format('win-{0}', inputs.arch) }}
|
||||
path: dist
|
||||
name: win-${{ inputs.arch }}
|
||||
path: |
|
||||
dist
|
||||
retention-days: 1
|
||||
|
8
.github/workflows/dockerbuild.yaml
vendored
8
.github/workflows/dockerbuild.yaml
vendored
@ -17,10 +17,10 @@ jobs:
|
||||
contents: read
|
||||
packages: write
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Log in to the Container registry
|
||||
uses: docker/login-action@1f401f745bf57e30b3a2800ad308a87d2ebdf14b
|
||||
uses: docker/login-action@5f4866a30a54f16a52d2ecb4a3898e9e424939cf
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ github.actor }}
|
||||
@ -28,14 +28,14 @@ jobs:
|
||||
|
||||
- name: Extract metadata for Docker
|
||||
id: meta
|
||||
uses: docker/metadata-action@62339db73c56dd749060f65a6ebb93a6e056b755
|
||||
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5
|
||||
with:
|
||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||
tags: |
|
||||
type=ref,event=branch
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5
|
||||
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5
|
||||
with:
|
||||
context: dockerbuild
|
||||
push: true
|
||||
|
20
.github/workflows/release-drafter.yml
vendored
20
.github/workflows/release-drafter.yml
vendored
@ -2,20 +2,12 @@ name: Release Drafter
|
||||
on:
|
||||
push:
|
||||
branches: [staging]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
previous-version:
|
||||
description: What release to use as a base for release note purposes
|
||||
required: false
|
||||
type: string
|
||||
workflow_dispatch: {}
|
||||
repository_dispatch:
|
||||
types: [upstream-release-notify]
|
||||
concurrency: ${{ github.workflow }}
|
||||
jobs:
|
||||
draft:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: release-drafter/release-drafter@e64b19c4c46173209ed9f2e5a2f4ca7de89a0e86 # v5
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
disable-autolabeler: true
|
||||
previous-version: ${{ inputs.previous-version }}
|
||||
uses: matrix-org/matrix-js-sdk/.github/workflows/release-drafter-workflow.yml@develop
|
||||
with:
|
||||
include-changes: element-hq/element-web~$VERSION
|
||||
|
18
.github/workflows/release.yml
vendored
18
.github/workflows/release.yml
vendored
@ -13,13 +13,27 @@ on:
|
||||
concurrency: ${{ github.workflow }}
|
||||
jobs:
|
||||
release:
|
||||
uses: matrix-org/matrix-js-sdk/.github/workflows/release-action.yml@develop
|
||||
uses: matrix-org/matrix-js-sdk/.github/workflows/release-make.yml@develop
|
||||
secrets:
|
||||
ELEMENT_BOT_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }}
|
||||
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
|
||||
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
|
||||
with:
|
||||
final: ${{ inputs.mode == 'final' }}
|
||||
include-changes: vector-im/element-web@$VERSION
|
||||
include-changes: element-hq/element-web@$VERSION
|
||||
gpg-fingerprint: ${{ vars.GPG_FINGERPRINT }}
|
||||
expected-asset-count: 1
|
||||
|
||||
check:
|
||||
name: Post release checks
|
||||
needs: release
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Wait for desktop packaging
|
||||
uses: t3chguy/wait-on-check-action@18541021811b56544d90e0f073401c2b99e249d6 # fork
|
||||
with:
|
||||
ref: master
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
wait-interval: 10
|
||||
check-name: Deploy
|
||||
allowed-conclusions: success
|
||||
|
30
.github/workflows/static_analysis.yaml
vendored
30
.github/workflows/static_analysis.yaml
vendored
@ -8,10 +8,11 @@ jobs:
|
||||
name: "Typescript Syntax Check"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@v3
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: package.json
|
||||
cache: "yarn"
|
||||
|
||||
# Does not need branch matching as only analyses this layer
|
||||
@ -24,15 +25,18 @@ jobs:
|
||||
i18n_lint:
|
||||
name: "i18n Check"
|
||||
uses: matrix-org/matrix-web-i18n/.github/workflows/i18n_check.yml@main
|
||||
with:
|
||||
hardcoded-words: "Element"
|
||||
|
||||
js_lint:
|
||||
name: "ESLint"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@v3
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: package.json
|
||||
cache: "yarn"
|
||||
|
||||
# Does not need branch matching as only analyses this layer
|
||||
@ -50,6 +54,7 @@ jobs:
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: package.json
|
||||
cache: "yarn"
|
||||
|
||||
# Does not need branch matching as only analyses this layer
|
||||
@ -58,3 +63,20 @@ jobs:
|
||||
|
||||
- name: Run Linter
|
||||
run: "yarn lint:workflows"
|
||||
|
||||
analyse_dead_code:
|
||||
name: "Analyse Dead Code"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: package.json
|
||||
cache: "yarn"
|
||||
|
||||
- name: Install Deps
|
||||
run: "yarn install --frozen-lockfile"
|
||||
|
||||
- name: Run linter
|
||||
run: "yarn run lint:knip"
|
||||
|
21
.github/workflows/sync-labels.yml
vendored
Normal file
21
.github/workflows/sync-labels.yml
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
name: Sync labels
|
||||
on:
|
||||
workflow_dispatch: {}
|
||||
schedule:
|
||||
- cron: "0 2 * * *" # 2am every day
|
||||
push:
|
||||
branches:
|
||||
- develop
|
||||
paths:
|
||||
- .github/labels.yml
|
||||
jobs:
|
||||
sync-labels:
|
||||
uses: element-hq/element-meta/.github/workflows/sync-labels.yml@develop
|
||||
with:
|
||||
LABELS: |
|
||||
element-hq/element-web
|
||||
.github/labels.yml
|
||||
DELETE: true
|
||||
WET: true
|
||||
secrets:
|
||||
ELEMENT_BOT_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }}
|
14
.github/workflows/triage-incoming.yml
vendored
Normal file
14
.github/workflows/triage-incoming.yml
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
name: Move new issues into Issue triage board
|
||||
|
||||
on:
|
||||
issues:
|
||||
types: [opened]
|
||||
|
||||
jobs:
|
||||
automate-project-columns-next:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/add-to-project@main
|
||||
with:
|
||||
project-url: https://github.com/orgs/element-hq/projects/120
|
||||
github-token: ${{ secrets.ELEMENT_BOT_TOKEN }}
|
2
.github/workflows/triage-labelled.yml
vendored
2
.github/workflows/triage-labelled.yml
vendored
@ -6,5 +6,5 @@ on:
|
||||
|
||||
jobs:
|
||||
call-triage-labelled:
|
||||
uses: vector-im/element-web/.github/workflows/triage-labelled.yml@develop
|
||||
uses: element-hq/element-web/.github/workflows/triage-labelled.yml@develop
|
||||
secrets: inherit
|
||||
|
@ -8,6 +8,8 @@
|
||||
/CHANGELOG.md
|
||||
/package-lock.json
|
||||
/yarn.lock
|
||||
/playwright/html-report
|
||||
/playwright/test-results
|
||||
|
||||
**/.idea
|
||||
.vscode
|
||||
|
302
CHANGELOG.md
302
CHANGELOG.md
@ -1,3 +1,305 @@
|
||||
Changes in [1.11.66](https://github.com/element-hq/element-desktop/releases/tag/v1.11.66) (2024-05-07)
|
||||
======================================================================================================
|
||||
## ✨ Features
|
||||
|
||||
* Use a different error message for UTDs when you weren't in the room. ([#12453](https://github.com/matrix-org/matrix-react-sdk/pull/12453)). Contributed by @uhoreg.
|
||||
* Take the Threads Activity Centre out of labs ([#12439](https://github.com/matrix-org/matrix-react-sdk/pull/12439)). Contributed by @dbkr.
|
||||
* Expected UTDs: use a different message for UTDs sent before login ([#12391](https://github.com/matrix-org/matrix-react-sdk/pull/12391)). Contributed by @richvdh.
|
||||
* Add `Tooltip` to `AccessibleButton` ([#12443](https://github.com/matrix-org/matrix-react-sdk/pull/12443)). Contributed by @florianduros.
|
||||
* Add analytics to activity toggles ([#12418](https://github.com/matrix-org/matrix-react-sdk/pull/12418)). Contributed by @dbkr.
|
||||
* Decrypt events in reverse order without copying the array ([#12445](https://github.com/matrix-org/matrix-react-sdk/pull/12445)). Contributed by @Johennes.
|
||||
* Use new compound tooltip ([#12416](https://github.com/matrix-org/matrix-react-sdk/pull/12416)). Contributed by @florianduros.
|
||||
* Expected UTDs: report a different Posthog code ([#12389](https://github.com/matrix-org/matrix-react-sdk/pull/12389)). Contributed by @richvdh.
|
||||
|
||||
## 🐛 Bug Fixes
|
||||
|
||||
* TAC: Fix accessibility issue when the Release announcement is displayed ([#12484](https://github.com/matrix-org/matrix-react-sdk/pull/12484)). Contributed by @RiotRobot.
|
||||
* TAC: Close Release Announcement when TAC button is clicked ([#12485](https://github.com/matrix-org/matrix-react-sdk/pull/12485)). Contributed by @florianduros.
|
||||
* MenuItem: fix caption usage ([#12455](https://github.com/matrix-org/matrix-react-sdk/pull/12455)). Contributed by @florianduros.
|
||||
* Show the local echo in previews ([#12451](https://github.com/matrix-org/matrix-react-sdk/pull/12451)). Contributed by @langleyd.
|
||||
* Fixed the drag and drop of X #27186 ([#12450](https://github.com/matrix-org/matrix-react-sdk/pull/12450)). Contributed by @asimdelvi.
|
||||
* Move the TAC to above the button ([#12438](https://github.com/matrix-org/matrix-react-sdk/pull/12438)). Contributed by @dbkr.
|
||||
* Use the same logic in previews as the timeline to hide events that should be hidden ([#12434](https://github.com/matrix-org/matrix-react-sdk/pull/12434)). Contributed by @langleyd.
|
||||
* Fix selector so maths support doesn't mangle divs ([#12433](https://github.com/matrix-org/matrix-react-sdk/pull/12433)). Contributed by @uhoreg.
|
||||
|
||||
|
||||
|
||||
Changes in [1.11.65](https://github.com/element-hq/element-desktop/releases/tag/v1.11.65) (2024-04-23)
|
||||
======================================================================================================
|
||||
## ✨ Features
|
||||
|
||||
* Make empty state copy for TAC depend on the value of the setting ([#12419](https://github.com/matrix-org/matrix-react-sdk/pull/12419)). Contributed by @dbkr.
|
||||
* Linkify User Interactive Authentication errors ([#12271](https://github.com/matrix-org/matrix-react-sdk/pull/12271)). Contributed by @t3chguy.
|
||||
* Add support for device dehydration v2 ([#12316](https://github.com/matrix-org/matrix-react-sdk/pull/12316)). Contributed by @uhoreg.
|
||||
* Replace `SecurityCustomisations` with `CryptoSetupExtension` ([#12342](https://github.com/matrix-org/matrix-react-sdk/pull/12342)). Contributed by @thoraj.
|
||||
* Add activity toggle for TAC ([#12413](https://github.com/matrix-org/matrix-react-sdk/pull/12413)). Contributed by @dbkr.
|
||||
* Humanize spell check language labels ([#12409](https://github.com/matrix-org/matrix-react-sdk/pull/12409)). Contributed by @t3chguy.
|
||||
* Call Guest Access, give user the option to change the acces level so they can generate a call link. ([#12401](https://github.com/matrix-org/matrix-react-sdk/pull/12401)). Contributed by @toger5.
|
||||
* TAC: Release Announcement ([#12380](https://github.com/matrix-org/matrix-react-sdk/pull/12380)). Contributed by @florianduros.
|
||||
* Show the call and share button if the user can create a guest link. ([#12385](https://github.com/matrix-org/matrix-react-sdk/pull/12385)). Contributed by @toger5.
|
||||
* Add analytics for mark all threads unread ([#12384](https://github.com/matrix-org/matrix-react-sdk/pull/12384)). Contributed by @dbkr.
|
||||
* Add `EventType.RoomEncryption` to the auto approve capabilities of Element Call widgets ([#12386](https://github.com/matrix-org/matrix-react-sdk/pull/12386)). Contributed by @toger5.
|
||||
|
||||
## 🐛 Bug Fixes
|
||||
|
||||
* Fix link modal not shown after access upgrade ([#12411](https://github.com/matrix-org/matrix-react-sdk/pull/12411)). Contributed by @toger5.
|
||||
* Fix thread navigation in timeline ([#12412](https://github.com/matrix-org/matrix-react-sdk/pull/12412)). Contributed by @florianduros.
|
||||
* Fix inability to join a `knock` room via space hierarchy view ([#12404](https://github.com/matrix-org/matrix-react-sdk/pull/12404)). Contributed by @t3chguy.
|
||||
* Focus the thread panel when clicking on an item in the TAC ([#12410](https://github.com/matrix-org/matrix-react-sdk/pull/12410)). Contributed by @dbkr.
|
||||
* Fix space hierarchy tile busy state being stuck after join error ([#12405](https://github.com/matrix-org/matrix-react-sdk/pull/12405)). Contributed by @t3chguy.
|
||||
* Fix room topic in-app links not being handled correctly on topic dialog ([#12406](https://github.com/matrix-org/matrix-react-sdk/pull/12406)). Contributed by @t3chguy.
|
||||
|
||||
|
||||
|
||||
Changes in [1.11.64](https://github.com/element-hq/element-desktop/releases/tag/v1.11.64) (2024-04-09)
|
||||
======================================================================================================
|
||||
## ✨ Features
|
||||
|
||||
* Mark all threads as read button ([#12378](https://github.com/matrix-org/matrix-react-sdk/pull/12378)). Contributed by @dbkr.
|
||||
* Video call meta space ([#12297](https://github.com/matrix-org/matrix-react-sdk/pull/12297)). Contributed by @toger5.
|
||||
* Add leave room warning for last admin ([#9452](https://github.com/matrix-org/matrix-react-sdk/pull/9452)). Contributed by @Arnei.
|
||||
* Iterate styles around Link new device via QR ([#12356](https://github.com/matrix-org/matrix-react-sdk/pull/12356)). Contributed by @t3chguy.
|
||||
* Improve code-splitting of highlight.js and maplibre-gs libs ([#12349](https://github.com/matrix-org/matrix-react-sdk/pull/12349)). Contributed by @t3chguy.
|
||||
* Use data-mx-color for rainbows ([#12325](https://github.com/matrix-org/matrix-react-sdk/pull/12325)). Contributed by @tulir.
|
||||
|
||||
## 🐛 Bug Fixes
|
||||
|
||||
* Fix external guest access url for unencrypted rooms ([#12345](https://github.com/matrix-org/matrix-react-sdk/pull/12345)). Contributed by @toger5.
|
||||
* Fix video rooms not showing share link button ([#12374](https://github.com/matrix-org/matrix-react-sdk/pull/12374)). Contributed by @toger5.
|
||||
* Fix space topic jumping on hover/focus ([#12377](https://github.com/matrix-org/matrix-react-sdk/pull/12377)). Contributed by @t3chguy.
|
||||
* Allow popping out a Jitsi widget to respect Desktop `web_base_url` config ([#12376](https://github.com/matrix-org/matrix-react-sdk/pull/12376)). Contributed by @t3chguy.
|
||||
* Remove the Lazy Loading `InvalidStoreError` Dialogs ([#12358](https://github.com/matrix-org/matrix-react-sdk/pull/12358)). Contributed by @langleyd.
|
||||
* Improve readability of badges and pills ([#12360](https://github.com/matrix-org/matrix-react-sdk/pull/12360)). Contributed by @robintown.
|
||||
|
||||
|
||||
|
||||
Changes in [1.11.63](https://github.com/element-hq/element-desktop/releases/tag/v1.11.63) (2024-03-28)
|
||||
======================================================================================================
|
||||
This is a hotfix release to fix a couple of issues: one where the client would sometimes call the client/server API to set a push rule in a loop, and one where authentication was not sent for widgets when it should have been.
|
||||
|
||||
## 🐛 Bug Fixes
|
||||
|
||||
* Revert "Make EC widget theme reactive - Update widget url when the theme changes" ([#12383](https://github.com/matrix-org/matrix-react-sdk/pull/12383)) in order to fix widgets that require authentication.
|
||||
* Update to hotfixed js-sdk to fix an issue where Element could try to set a push rule in a loop.
|
||||
|
||||
Changes in [1.11.62](https://github.com/element-hq/element-desktop/releases/tag/v1.11.62) (2024-03-26)
|
||||
======================================================================================================
|
||||
## ✨ Features
|
||||
|
||||
* Change user permission by using a new apply button ([#12346](https://github.com/matrix-org/matrix-react-sdk/pull/12346)). Contributed by @florianduros.
|
||||
* Mark as Unread ([#12254](https://github.com/matrix-org/matrix-react-sdk/pull/12254)). Contributed by @dbkr.
|
||||
* Refine the colors of some more components ([#12343](https://github.com/matrix-org/matrix-react-sdk/pull/12343)). Contributed by @robintown.
|
||||
* TAC: Order rooms by most recent after notification level ([#12329](https://github.com/matrix-org/matrix-react-sdk/pull/12329)). Contributed by @florianduros.
|
||||
* Make EC widget theme reactive - Update widget url when the theme changes ([#12295](https://github.com/matrix-org/matrix-react-sdk/pull/12295)). Contributed by @toger5.
|
||||
* Refine styles of menus, toasts, popovers, and modals ([#12332](https://github.com/matrix-org/matrix-react-sdk/pull/12332)). Contributed by @robintown.
|
||||
* Element Call: fix widget shown while its still loading (`waitForIframeLoad=false`) ([#12292](https://github.com/matrix-org/matrix-react-sdk/pull/12292)). Contributed by @toger5.
|
||||
* Improve Forward Dialog a11y by switching to roving tab index interactions ([#12306](https://github.com/matrix-org/matrix-react-sdk/pull/12306)). Contributed by @t3chguy.
|
||||
* Call guest access link creation to join calls as a non registered user via the EC SPA ([#12259](https://github.com/matrix-org/matrix-react-sdk/pull/12259)). Contributed by @toger5.
|
||||
* Use `strong` element to semantically denote visually emphasised content ([#12320](https://github.com/matrix-org/matrix-react-sdk/pull/12320)). Contributed by @t3chguy.
|
||||
* Handle up/down arrow keys as well as left/right for horizontal toolbars for improved a11y ([#12305](https://github.com/matrix-org/matrix-react-sdk/pull/12305)). Contributed by @t3chguy.
|
||||
|
||||
## 🐛 Bug Fixes
|
||||
|
||||
* [Backport staging] Remove the glass border from modal spinners ([#12369](https://github.com/matrix-org/matrix-react-sdk/pull/12369)). Contributed by @RiotRobot.
|
||||
* Fix incorrect check for private read receipt support ([#12348](https://github.com/matrix-org/matrix-react-sdk/pull/12348)). Contributed by @tulir.
|
||||
* TAC: Fix hover state when expanded ([#12337](https://github.com/matrix-org/matrix-react-sdk/pull/12337)). Contributed by @florianduros.
|
||||
* Fix the image view ([#12341](https://github.com/matrix-org/matrix-react-sdk/pull/12341)). Contributed by @robintown.
|
||||
* Use correct push rule to evaluate room-wide mentions ([#12318](https://github.com/matrix-org/matrix-react-sdk/pull/12318)). Contributed by @t3chguy.
|
||||
* Reset power selector on API failure to prevent state mismatch ([#12319](https://github.com/matrix-org/matrix-react-sdk/pull/12319)). Contributed by @t3chguy.
|
||||
* Fix spotlight opening in TAC ([#12315](https://github.com/matrix-org/matrix-react-sdk/pull/12315)). Contributed by @florianduros.
|
||||
|
||||
|
||||
|
||||
Changes in [1.11.61](https://github.com/element-hq/element-desktop/releases/tag/v1.11.61) (2024-03-14)
|
||||
======================================================================================================
|
||||
* No changes
|
||||
|
||||
## 🐛 Bug Fixes
|
||||
|
||||
* Update `@vector-im/compound-design-tokens` in package.json ([#12340](https://github.com/matrix-org/matrix-react-sdk/pull/12340)).
|
||||
|
||||
|
||||
|
||||
Changes in [1.11.60](https://github.com/element-hq/element-desktop/releases/tag/v1.11.60) (2024-03-12)
|
||||
======================================================================================================
|
||||
## ✨ Features
|
||||
|
||||
* Refine styles of controls to match Compound ([#12299](https://github.com/matrix-org/matrix-react-sdk/pull/12299)). Contributed by @robintown.
|
||||
* Hide the archived section ([#12286](https://github.com/matrix-org/matrix-react-sdk/pull/12286)). Contributed by @dbkr.
|
||||
* Add theme data to EC widget Url ([#12279](https://github.com/matrix-org/matrix-react-sdk/pull/12279)). Contributed by @toger5.
|
||||
* Update MSC2965 OIDC Discovery implementation ([#12245](https://github.com/matrix-org/matrix-react-sdk/pull/12245)). Contributed by @t3chguy.
|
||||
* Use green dot for activity notification in `LegacyRoomHeader` ([#12270](https://github.com/matrix-org/matrix-react-sdk/pull/12270)). Contributed by @florianduros.
|
||||
|
||||
## 🐛 Bug Fixes
|
||||
|
||||
* Fix requests for senders to submit auto-rageshakes ([#12304](https://github.com/matrix-org/matrix-react-sdk/pull/12304)). Contributed by @richvdh.
|
||||
* fix automatic DM avatar with functional members ([#12157](https://github.com/matrix-org/matrix-react-sdk/pull/12157)). Contributed by @HarHarLinks.
|
||||
* Feeds event with relation to unknown to the widget ([#12283](https://github.com/matrix-org/matrix-react-sdk/pull/12283)). Contributed by @maheichyk.
|
||||
* Fix TAC opening with keyboard ([#12285](https://github.com/matrix-org/matrix-react-sdk/pull/12285)). Contributed by @florianduros.
|
||||
* Allow screenshot update docker to run multiple test files ([#12291](https://github.com/matrix-org/matrix-react-sdk/pull/12291)). Contributed by @dbkr.
|
||||
* Fix alignment of user menu avatar ([#12289](https://github.com/matrix-org/matrix-react-sdk/pull/12289)). Contributed by @dbkr.
|
||||
* Fix buttons of widget in a room ([#12288](https://github.com/matrix-org/matrix-react-sdk/pull/12288)). Contributed by @florianduros.
|
||||
* ModuleAPI: `overwrite_login` action was not stopping the existing client resulting in the action failing with rust-sdk ([#12272](https://github.com/matrix-org/matrix-react-sdk/pull/12272)). Contributed by @BillCarsonFr.
|
||||
|
||||
|
||||
|
||||
Changes in [1.11.59](https://github.com/element-hq/element-desktop/releases/tag/v1.11.59) (2024-02-27)
|
||||
======================================================================================================
|
||||
## 🦖 Deprecations
|
||||
|
||||
* Enable custom themes to theme Compound ([#12240](https://github.com/matrix-org/matrix-react-sdk/pull/12240)). Contributed by @robintown.
|
||||
* Remove welcome bot `welcome_user_id` support ([#12153](https://github.com/matrix-org/matrix-react-sdk/pull/12153)). Contributed by @t3chguy.
|
||||
|
||||
## ✨ Features
|
||||
|
||||
* Ignore activity in TAC ([#12269](https://github.com/matrix-org/matrix-react-sdk/pull/12269)). Contributed by @florianduros.
|
||||
* Use browser's font size instead of hardcoded `16px` as root font size ([#12246](https://github.com/matrix-org/matrix-react-sdk/pull/12246)). Contributed by @florianduros.
|
||||
* Revert "Use Compound primary colors for most actions" ([#12264](https://github.com/matrix-org/matrix-react-sdk/pull/12264)). Contributed by @florianduros.
|
||||
* Revert "Refine menu, toast, and popover colors" ([#12263](https://github.com/matrix-org/matrix-react-sdk/pull/12263)). Contributed by @florianduros.
|
||||
* Fix Native OIDC for Element Desktop ([#12253](https://github.com/matrix-org/matrix-react-sdk/pull/12253)). Contributed by @t3chguy.
|
||||
* Improve client metadata used for OIDC dynamic registration ([#12257](https://github.com/matrix-org/matrix-react-sdk/pull/12257)). Contributed by @t3chguy.
|
||||
* Refine menu, toast, and popover colors ([#12247](https://github.com/matrix-org/matrix-react-sdk/pull/12247)). Contributed by @robintown.
|
||||
* Call the AsJson forms of import and exportRoomKeys ([#12233](https://github.com/matrix-org/matrix-react-sdk/pull/12233)). Contributed by @andybalaam.
|
||||
* Use Compound primary colors for most actions ([#12241](https://github.com/matrix-org/matrix-react-sdk/pull/12241)). Contributed by @robintown.
|
||||
* Enable redirected media by default ([#12142](https://github.com/matrix-org/matrix-react-sdk/pull/12142)). Contributed by @turt2live.
|
||||
* Reduce TAC width by `16px` ([#12239](https://github.com/matrix-org/matrix-react-sdk/pull/12239)). Contributed by @florianduros.
|
||||
* Pop out of Threads Activity Centre ([#12136](https://github.com/matrix-org/matrix-react-sdk/pull/12136)). Contributed by @florianduros.
|
||||
* Use new semantic tokens for username colors ([#12209](https://github.com/matrix-org/matrix-react-sdk/pull/12209)). Contributed by @robintown.
|
||||
|
||||
## 🐛 Bug Fixes
|
||||
|
||||
* Fix the space panel getting bigger when gaining a scroll bar ([#12267](https://github.com/matrix-org/matrix-react-sdk/pull/12267)). Contributed by @dbkr.
|
||||
* Fix gradients spacings on the space panel ([#12262](https://github.com/matrix-org/matrix-react-sdk/pull/12262)). Contributed by @dbkr.
|
||||
* Remove hardcoded `Element` in tac labs description ([#12266](https://github.com/matrix-org/matrix-react-sdk/pull/12266)). Contributed by @florianduros.
|
||||
* Fix branding in "migrating crypto" message ([#12265](https://github.com/matrix-org/matrix-react-sdk/pull/12265)). Contributed by @richvdh.
|
||||
* Use h1 as first heading in dialogs ([#12250](https://github.com/matrix-org/matrix-react-sdk/pull/12250)). Contributed by @dbkr.
|
||||
* Fix forced lowercase username in login/registration flows ([#9329](https://github.com/matrix-org/matrix-react-sdk/pull/9329)). Contributed by @vrifox.
|
||||
* Update the TAC indicator on event decryption ([#12243](https://github.com/matrix-org/matrix-react-sdk/pull/12243)). Contributed by @dbkr.
|
||||
* Fix OIDC delegated auth account url check ([#12242](https://github.com/matrix-org/matrix-react-sdk/pull/12242)). Contributed by @t3chguy.
|
||||
* New Header edgecase fixes: Close lobby button not shown, disable join button in various places, more... ([#12235](https://github.com/matrix-org/matrix-react-sdk/pull/12235)). Contributed by @toger5.
|
||||
* Fix TAC button alignment when expanded ([#12238](https://github.com/matrix-org/matrix-react-sdk/pull/12238)). Contributed by @florianduros.
|
||||
* Fix tooltip behaviour in TAC ([#12236](https://github.com/matrix-org/matrix-react-sdk/pull/12236)). Contributed by @florianduros.
|
||||
|
||||
|
||||
|
||||
Changes in [1.11.58](https://github.com/element-hq/element-desktop/releases/tag/v1.11.58) (2024-02-13)
|
||||
======================================================================================================
|
||||
* 🦀 🔒 **The flag to enable the Rust crypto implementation is now set to `true` by default. This means that without any additional configuration every new login will use the new cryptography implementation.**
|
||||
* Add Element call related functionality to new room header ([#12091](https://github.com/matrix-org/matrix-react-sdk/pull/12091)). Contributed by @toger5.
|
||||
* Add labs flag for Threads Activity Centre ([#12137](https://github.com/matrix-org/matrix-react-sdk/pull/12137)). Contributed by @florianduros.
|
||||
* Refactor element call lobby + skip lobby ([#12057](https://github.com/matrix-org/matrix-react-sdk/pull/12057)). Contributed by @toger5.
|
||||
* Hide the "Message" button in the sidebar if the CreateRooms components should not be shown ([#9271](https://github.com/matrix-org/matrix-react-sdk/pull/9271)). Contributed by @dhenneke.
|
||||
* Add notification dots to thread summary icons ([#12146](https://github.com/matrix-org/matrix-react-sdk/pull/12146)). Contributed by @dbkr.
|
||||
|
||||
## 🐛 Bug Fixes
|
||||
|
||||
* Fix logout can take ages ([#12191](https://github.com/matrix-org/matrix-react-sdk/pull/12191)). Contributed by @BillCarsonFr.
|
||||
* Fix `Mark all as read` in settings ([#12205](https://github.com/matrix-org/matrix-react-sdk/pull/12205)). Contributed by @florianduros.
|
||||
* Fix default thread notification of the new RoomHeader ([#12194](https://github.com/matrix-org/matrix-react-sdk/pull/12194)). Contributed by @florianduros.
|
||||
* Fix display of room notification debug info ([#12183](https://github.com/matrix-org/matrix-react-sdk/pull/12183)). Contributed by @dbkr.
|
||||
|
||||
Changes in [1.11.57](https://github.com/element-hq/element-desktop/releases/tag/v1.11.57) (2024-01-31)
|
||||
======================================================================================================
|
||||
## 🦖 Deprecations
|
||||
|
||||
* Deprecate welcome bot `welcome_user_id` support ([#26885](https://github.com/element-hq/element-web/pull/26885)). Contributed by @t3chguy.
|
||||
|
||||
## 🦖 Deprecations
|
||||
|
||||
* Deprecate welcome bot `welcome_user_id` support ([#26885](https://github.com/element-hq/element-web/pull/26885)). Contributed by @t3chguy.
|
||||
|
||||
## ✨ Features
|
||||
|
||||
* Use jitsi-lobby in video channel (video rooms) ([#26879](https://github.com/element-hq/element-web/pull/26879)). Contributed by @toger5.
|
||||
## 🐛 Bug Fixes
|
||||
|
||||
* Fix OIDC bugs due to amnesiac stores forgetting OIDC issuer \& other data ([#12166](https://github.com/matrix-org/matrix-react-sdk/pull/12166)). Contributed by @t3chguy.
|
||||
* Fix account management link for delegated auth OIDC setups ([#12144](https://github.com/matrix-org/matrix-react-sdk/pull/12144)). Contributed by @t3chguy.
|
||||
* Fix Safari IME support ([#11016](https://github.com/matrix-org/matrix-react-sdk/pull/11016)). Contributed by @SuperKenVery.
|
||||
* Fix Stickerpicker layout crossing multiple CSS stacking contexts ([#12127](https://github.com/matrix-org/matrix-react-sdk/pull/12127)).
|
||||
* Fix Stickerpicker layout crossing multiple CSS stacking contexts ([#12126](https://github.com/matrix-org/matrix-react-sdk/pull/12126)). Contributed by @t3chguy.
|
||||
* Fix 1F97A and 1F979 in Twemoji COLR font ([#12177](https://github.com/matrix-org/matrix-react-sdk/pull/12177)).
|
||||
## ✨ Features
|
||||
|
||||
* Use jitsi-lobby in video channel (video rooms) ([#26879](https://github.com/element-hq/element-web/pull/26879)). Contributed by @toger5.
|
||||
## 🐛 Bug Fixes
|
||||
* Fix OIDC bugs due to amnesiac stores forgetting OIDC issuer \& other data ([#12166](https://github.com/matrix-org/matrix-react-sdk/pull/12166)). Contributed by @t3chguy.
|
||||
* Fix account management link for delegated auth OIDC setups ([#12144](https://github.com/matrix-org/matrix-react-sdk/pull/12144)). Contributed by @t3chguy.
|
||||
* Fix Safari IME support ([#11016](https://github.com/matrix-org/matrix-react-sdk/pull/11016)). Contributed by @SuperKenVery.
|
||||
* Fix Stickerpicker layout crossing multiple CSS stacking contexts ([#12127](https://github.com/matrix-org/matrix-react-sdk/pull/12127)).
|
||||
* Fix Stickerpicker layout crossing multiple CSS stacking contexts ([#12126](https://github.com/matrix-org/matrix-react-sdk/pull/12126)). Contributed by @t3chguy.
|
||||
* Fix 1F97A and 1F979 in Twemoji COLR font ([#12177](https://github.com/matrix-org/matrix-react-sdk/pull/12177)).
|
||||
|
||||
|
||||
|
||||
Changes in [1.11.54](https://github.com/element-hq/element-desktop/releases/tag/v1.11.54) (2024-01-16)
|
||||
======================================================================================================
|
||||
## 🔧 Security
|
||||
|
||||
* Burn Node-related Electron fuses as a proactive hardening measure ([#1412](https://github.com/element-hq/element-desktop/pull/1412)). Contributed by @t3chguy.
|
||||
|
||||
|
||||
## ✨ Features
|
||||
* Accessibility improvements around aria-labels and tooltips ([#12062](https://github.com/matrix-org/matrix-react-sdk/pull/12062)). Contributed by @t3chguy.
|
||||
* Add RoomKnocksBar to RoomHeader ([#12077](https://github.com/matrix-org/matrix-react-sdk/pull/12077)). Contributed by @charlynguyen.
|
||||
* Adjust tooltip side for DecoratedRoomAvatar to not obscure room name ([#12079](https://github.com/matrix-org/matrix-react-sdk/pull/12079)). Contributed by @t3chguy.
|
||||
* Iterate landmarks around the app in order to improve a11y ([#12064](https://github.com/matrix-org/matrix-react-sdk/pull/12064)). Contributed by @t3chguy.
|
||||
* Update element call embedding UI ([#12056](https://github.com/matrix-org/matrix-react-sdk/pull/12056)). Contributed by @toger5.
|
||||
* Use Compound tooltips instead of homegrown in TextWithTooltip \& InfoTooltip ([#12052](https://github.com/matrix-org/matrix-react-sdk/pull/12052)). Contributed by @t3chguy.
|
||||
## 🐛 Bug Fixes
|
||||
* Fix regression around CSS stacking contexts and PIP widgets ([#12094](https://github.com/matrix-org/matrix-react-sdk/pull/12094)). Contributed by @t3chguy.
|
||||
* Fix Identity Server terms accepting not working as expected ([#12109](https://github.com/matrix-org/matrix-react-sdk/pull/12109)). Contributed by @t3chguy.
|
||||
* fix: microphone and camera dropdown doesn't work In legacy call ([#12105](https://github.com/matrix-org/matrix-react-sdk/pull/12105)). Contributed by @muratersin.
|
||||
* Revert "Set up key backup using non-deprecated APIs (#12005)" ([#12102](https://github.com/matrix-org/matrix-react-sdk/pull/12102)). Contributed by @BillCarsonFr.
|
||||
* Fix regression around read receipt animation from refs changes ([#12100](https://github.com/matrix-org/matrix-react-sdk/pull/12100)). Contributed by @t3chguy.
|
||||
* Added meaning full error message based on platform ([#12074](https://github.com/matrix-org/matrix-react-sdk/pull/12074)). Contributed by @Pankaj-SinghR.
|
||||
* Fix editing event from search room view ([#11992](https://github.com/matrix-org/matrix-react-sdk/pull/11992)). Contributed by @t3chguy.
|
||||
* Fix timeline position when moving to a room and coming back ([#12055](https://github.com/matrix-org/matrix-react-sdk/pull/12055)). Contributed by @florianduros.
|
||||
* Fix threaded reply playwright tests ([#12070](https://github.com/matrix-org/matrix-react-sdk/pull/12070)). Contributed by @dbkr.
|
||||
* Element-R: fix repeated requests to enter 4S key during cross-signing reset ([#12059](https://github.com/matrix-org/matrix-react-sdk/pull/12059)). Contributed by @richvdh.
|
||||
* Fix position of thumbnail in room timeline ([#12016](https://github.com/matrix-org/matrix-react-sdk/pull/12016)). Contributed by @anoopw3bdev.
|
||||
|
||||
|
||||
Changes in [1.11.53](https://github.com/element-hq/element-desktop/releases/tag/v1.11.53) (2024-01-04)
|
||||
======================================================================================================
|
||||
|
||||
## 🐛 Bug Fixes
|
||||
* Fix a fresh login creating a new key backup ([#12106](https://github.com/matrix-org/matrix-react-sdk/pull/12106)).
|
||||
|
||||
|
||||
Changes in [1.11.52](https://github.com/element-hq/element-desktop/releases/tag/v1.11.52) (2023-12-19)
|
||||
======================================================================================================
|
||||
|
||||
|
||||
## ✨ Features
|
||||
* Keep more recent rageshake logs ([#12003](https://github.com/matrix-org/matrix-react-sdk/pull/12003)). Contributed by @richvdh.
|
||||
## 🐛 Bug Fixes
|
||||
* Fix bug which prevented correct clean up of rageshake store ([#12002](https://github.com/matrix-org/matrix-react-sdk/pull/12002)). Contributed by @richvdh.
|
||||
* Set up key backup using non-deprecated APIs ([#12005](https://github.com/matrix-org/matrix-react-sdk/pull/12005)). Contributed by @andybalaam.
|
||||
* Fix notifications appearing for old events ([#3946](https://github.com/matrix-org/matrix-js-sdk/pull/3946)). Contributed by @dbkr.
|
||||
* Prevent phantom notifications from events not in a room's timeline ([#3942](https://github.com/matrix-org/matrix-js-sdk/pull/3942)). Contributed by @dbkr.
|
||||
|
||||
|
||||
Changes in [1.11.51](https://github.com/vector-im/element-desktop/releases/tag/v1.11.51) (2023-12-05)
|
||||
=====================================================================================================
|
||||
|
||||
|
||||
## 🦖 Deprecations
|
||||
* Remove Quote from MessageContextMenu as it is unsupported by WYSIWYG ([#11914](https://github.com/matrix-org/matrix-react-sdk/pull/11914)). Contributed by @t3chguy.
|
||||
## ✨ Features
|
||||
* Always allow call.member events on new rooms ([#11948](https://github.com/matrix-org/matrix-react-sdk/pull/11948)). Contributed by @toger5.
|
||||
* Right panel: view third party invite info without clearing history ([#11934](https://github.com/matrix-org/matrix-react-sdk/pull/11934)). Contributed by @kerryarchibald.
|
||||
* Allow switching to system emoji font ([#11925](https://github.com/matrix-org/matrix-react-sdk/pull/11925)). Contributed by @t3chguy.
|
||||
* Update open in other tab message ([#11916](https://github.com/matrix-org/matrix-react-sdk/pull/11916)). Contributed by @weeman1337.
|
||||
* Add menu for legacy and element call in 1:1 rooms ([#11910](https://github.com/matrix-org/matrix-react-sdk/pull/11910)). Contributed by @toger5.
|
||||
* Add ringing for matrixRTC ([#11870](https://github.com/matrix-org/matrix-react-sdk/pull/11870)). Contributed by @toger5.
|
||||
## 🐛 Bug Fixes
|
||||
* Keep device language when it has been previosuly set, after a successful delegated authentication flow that clears localStorage ([#11902](https://github.com/matrix-org/matrix-react-sdk/pull/11902)). Contributed by @mgcm.
|
||||
* Fix misunderstanding of functional members ([#11918](https://github.com/matrix-org/matrix-react-sdk/pull/11918)). Contributed by @toger5.
|
||||
* Fix: Video Room Chat Header Button Removed ([#11911](https://github.com/matrix-org/matrix-react-sdk/pull/11911)). Contributed by @kerryarchibald.
|
||||
* Fix "not attempting encryption" warning ([#11899](https://github.com/matrix-org/matrix-react-sdk/pull/11899)). Contributed by @richvdh.
|
||||
|
||||
|
||||
Changes in [1.11.50](https://github.com/vector-im/element-desktop/releases/tag/v1.11.50) (2023-11-21)
|
||||
=====================================================================================================
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Docker image to facilitate building Element Desktop with native bits using a glibc version with broader compatibility
|
||||
FROM buildpack-deps:bionic-curl
|
||||
FROM buildpack-deps:buster-curl
|
||||
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
|
||||
@ -11,9 +11,9 @@ RUN apt-get -qq update && apt-get -qq dist-upgrade && \
|
||||
# python for node-gyp
|
||||
# rpm is required for FPM to build rpm package
|
||||
# tclsh is required for building SQLite as part of SQLCipher
|
||||
# libsecret-1-dev and libgnome-keyring-dev are required even for prebuild keytar
|
||||
# libsecret-1-dev is required even for prebuild keytar
|
||||
apt-get -qq install --no-install-recommends qtbase5-dev bsdtar build-essential autoconf libssl-dev gcc-multilib g++-multilib lzip rpm python libcurl4 git git-lfs ssh unzip tcl \
|
||||
libsecret-1-dev libgnome-keyring-dev \
|
||||
libsecret-1-dev \
|
||||
libopenjp2-tools \
|
||||
# Used by github actions \
|
||||
jq grep file \
|
||||
@ -34,13 +34,11 @@ ENV LC_ALL C.UTF-8
|
||||
|
||||
ENV DEBUG_COLORS true
|
||||
ENV FORCE_COLOR true
|
||||
ENV NODE_VERSION 16.18.1
|
||||
ENV NODE_VERSION 18.19.0
|
||||
|
||||
# this package is used for snapcraft and we should not clear apt list - to avoid apt-get update during snap build
|
||||
RUN curl --proto "=https" -L https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64.tar.gz | tar xz -C /usr/local --strip-components=1 && \
|
||||
unlink /usr/local/CHANGELOG.md && unlink /usr/local/LICENSE && unlink /usr/local/README.md && \
|
||||
# https://github.com/npm/npm/issues/4531
|
||||
npm config set unsafe-perm true
|
||||
unlink /usr/local/CHANGELOG.md && unlink /usr/local/LICENSE && unlink /usr/local/README.md
|
||||
|
||||
ENV RUSTUP_HOME=/usr/local/rustup \
|
||||
CARGO_HOME=/usr/local/cargo \
|
||||
|
@ -22,12 +22,7 @@ For releasing Element Desktop, we assume the following prerequisites:
|
||||
|
||||
**Both of these are done automatically when you run the release automation.**
|
||||
|
||||
Once those are ready, the **manual** release build can be manually invoked using https://github.com/vector-im/element-desktop/actions/workflows/build_and_deploy.yaml
|
||||
|
||||
1. Click `Run workflow`
|
||||
1. Specify the `master` branch
|
||||
1. Switch type to release
|
||||
1. Click the green `Run workflow`
|
||||
The packaging is kicked off automagically for you when a Github Release for Element Desktop is published.
|
||||
|
||||
### More detail on the github actions
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
# Windows
|
||||
|
||||
|
||||
## Requirements to build native modules
|
||||
|
||||
We rely on Github Actions `windows-latest` plus a few extra utilities as per [the workflow](https://github.com/vector-im/element-desktop/blob/develop/.github/workflows/build_windows.yaml).
|
||||
|
239
electron-builder.ts
Normal file
239
electron-builder.ts
Normal file
@ -0,0 +1,239 @@
|
||||
import * as os from "os";
|
||||
import * as fs from "fs";
|
||||
import * as path from "path";
|
||||
import { Arch, Configuration as BaseConfiguration, AfterPackContext } from "electron-builder";
|
||||
import { flipFuses, FuseVersion, FuseV1Options } from "@electron/fuses";
|
||||
|
||||
/**
|
||||
* This script has different outputs depending on your os platform.
|
||||
*
|
||||
* On Windows:
|
||||
* Prefixes the nightly version with `0.0.1-nightly.` as it breaks if it is not semver
|
||||
* Passes $ED_SIGNTOOL_THUMBPRINT and $ED_SIGNTOOL_SUBJECT_NAME to
|
||||
* build.win.signingHashAlgorithms and build.win.certificateSubjectName respectively if specified.
|
||||
*
|
||||
* On macOS:
|
||||
* Passes $ED_NOTARYTOOL_TEAM_ID to build.mac.notarize.notarize if specified
|
||||
*
|
||||
* On Linux:
|
||||
* Replaces spaces in the product name with dashes as spaces in paths can cause issues
|
||||
* Removes libsqlcipher0 recommended dependency if env SQLCIPHER_BUNDLED is asserted.
|
||||
* Passes $ED_DEBIAN_CHANGELOG to build.deb.fpm if specified
|
||||
*/
|
||||
|
||||
const NIGHTLY_APP_ID = "im.riot.nightly";
|
||||
const NIGHTLY_DEB_NAME = "element-nightly";
|
||||
|
||||
interface Pkg {
|
||||
name: string;
|
||||
productName: string;
|
||||
description: string;
|
||||
version: string;
|
||||
}
|
||||
|
||||
type Writable<T> = NonNullable<
|
||||
T extends Function ? T : T extends object ? { -readonly [K in keyof T]: Writable<T[K]> } : T
|
||||
>;
|
||||
|
||||
const pkg: Pkg = JSON.parse(fs.readFileSync("package.json", "utf8"));
|
||||
|
||||
interface Configuration extends BaseConfiguration {
|
||||
extraMetadata: Partial<Pick<Pkg, "version">> & Omit<Pkg, "version">;
|
||||
linux: {
|
||||
desktop: Record<string, string>;
|
||||
} & BaseConfiguration["linux"];
|
||||
win: BaseConfiguration["win"];
|
||||
mac: BaseConfiguration["mac"];
|
||||
deb: {
|
||||
fpm: string[];
|
||||
} & BaseConfiguration["deb"];
|
||||
}
|
||||
|
||||
/**
|
||||
* @type {import('electron-builder').Configuration}
|
||||
* @see https://www.electron.build/configuration/configuration
|
||||
*/
|
||||
const config: Writable<Configuration> = {
|
||||
appId: "im.riot.app",
|
||||
asarUnpack: "**/*.node",
|
||||
afterPack: async (context: AfterPackContext) => {
|
||||
if (context.electronPlatformName !== "darwin" || context.arch === Arch.universal) {
|
||||
// Burn in electron fuses for proactive security hardening.
|
||||
// On macOS, we only do this for the universal package, as the constituent arm64 and amd64 packages are embedded within.
|
||||
const ext = (<Record<string, string>>{
|
||||
darwin: ".app",
|
||||
win32: ".exe",
|
||||
linux: "",
|
||||
})[context.electronPlatformName];
|
||||
|
||||
let executableName = context.packager.appInfo.productFilename;
|
||||
if (context.electronPlatformName === "linux") {
|
||||
// Linux uses the package name as the executable name
|
||||
executableName = context.packager.appInfo.name;
|
||||
}
|
||||
|
||||
const electronBinaryPath = path.join(context.appOutDir, `${executableName}${ext}`);
|
||||
console.log(`Flipping fuses for: ${electronBinaryPath}`);
|
||||
|
||||
await flipFuses(electronBinaryPath, {
|
||||
version: FuseVersion.V1,
|
||||
resetAdHocDarwinSignature: context.electronPlatformName === "darwin" && context.arch === Arch.universal,
|
||||
|
||||
[FuseV1Options.EnableCookieEncryption]: true,
|
||||
[FuseV1Options.OnlyLoadAppFromAsar]: true,
|
||||
|
||||
[FuseV1Options.RunAsNode]: false,
|
||||
[FuseV1Options.EnableNodeOptionsEnvironmentVariable]: false,
|
||||
[FuseV1Options.EnableNodeCliInspectArguments]: false,
|
||||
|
||||
// Mac app crashes on arm for us when `LoadBrowserProcessSpecificV8Snapshot` is enabled
|
||||
[FuseV1Options.LoadBrowserProcessSpecificV8Snapshot]: false,
|
||||
// https://github.com/electron/fuses/issues/7
|
||||
[FuseV1Options.EnableEmbeddedAsarIntegrityValidation]: false,
|
||||
});
|
||||
}
|
||||
},
|
||||
files: [
|
||||
"package.json",
|
||||
{
|
||||
from: ".hak/hakModules",
|
||||
to: "node_modules",
|
||||
},
|
||||
"lib/**",
|
||||
],
|
||||
extraResources: [
|
||||
{
|
||||
from: "res/img",
|
||||
to: "img",
|
||||
},
|
||||
"webapp.asar",
|
||||
],
|
||||
extraMetadata: {
|
||||
name: pkg.name,
|
||||
productName: pkg.productName,
|
||||
description: pkg.description,
|
||||
},
|
||||
linux: {
|
||||
target: ["tar.gz", "deb"],
|
||||
category: "Network;InstantMessaging;Chat",
|
||||
maintainer: "support@element.io",
|
||||
icon: "build/icons",
|
||||
desktop: {
|
||||
MimeType: "x-scheme-handler/element",
|
||||
},
|
||||
},
|
||||
deb: {
|
||||
packageCategory: "net",
|
||||
depends: [
|
||||
"libgtk-3-0",
|
||||
"libnotify4",
|
||||
"libnss3",
|
||||
"libxss1",
|
||||
"libxtst6",
|
||||
"xdg-utils",
|
||||
"libatspi2.0-0",
|
||||
"libuuid1",
|
||||
"libsecret-1-0",
|
||||
"libasound2",
|
||||
"libgbm1",
|
||||
],
|
||||
recommends: ["libsqlcipher0", "element-io-archive-keyring"],
|
||||
fpm: [
|
||||
"--deb-field",
|
||||
"Replaces: riot-desktop (<< 1.7.0), riot-web (<< 1.7.0)",
|
||||
"--deb-field",
|
||||
"Breaks: riot-desktop (<< 1.7.0), riot-web (<< 1.7.0)",
|
||||
],
|
||||
},
|
||||
mac: {
|
||||
category: "public.app-category.social-networking",
|
||||
darkModeSupport: true,
|
||||
hardenedRuntime: true,
|
||||
gatekeeperAssess: true,
|
||||
entitlements: "./build/entitlements.mac.plist",
|
||||
icon: "build/icons/icon.icns",
|
||||
},
|
||||
win: {
|
||||
target: ["squirrel", "msi"],
|
||||
signingHashAlgorithms: ["sha256"],
|
||||
icon: "build/icons/icon.ico",
|
||||
},
|
||||
msi: {
|
||||
perMachine: true,
|
||||
},
|
||||
directories: {
|
||||
output: "dist",
|
||||
},
|
||||
protocols: [
|
||||
{
|
||||
name: "element",
|
||||
schemes: ["element"],
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
/**
|
||||
* Allow specifying windows signing cert via env vars
|
||||
* @param {string} process.env.ED_SIGNTOOL_SUBJECT_NAME
|
||||
* @param {string} process.env.ED_SIGNTOOL_THUMBPRINT
|
||||
*/
|
||||
if (process.env.ED_SIGNTOOL_SUBJECT_NAME && process.env.ED_SIGNTOOL_THUMBPRINT) {
|
||||
config.win.certificateSubjectName = process.env.ED_SIGNTOOL_SUBJECT_NAME;
|
||||
config.win.certificateSha1 = process.env.ED_SIGNTOOL_THUMBPRINT;
|
||||
}
|
||||
|
||||
/**
|
||||
* Allow specifying macOS notary team id via env var
|
||||
* @param {string} process.env.ED_NOTARYTOOL_TEAM_ID
|
||||
*/
|
||||
if (process.env.ED_NOTARYTOOL_TEAM_ID) {
|
||||
config.mac.notarize = {
|
||||
teamId: process.env.ED_NOTARYTOOL_TEAM_ID,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Allow specifying nightly version via env var
|
||||
* @param {string} process.env.ED_NIGHTLY
|
||||
*/
|
||||
if (process.env.ED_NIGHTLY) {
|
||||
config.deb.fpm = []; // Clear the fpm as the breaks deb fields don't apply to nightly
|
||||
|
||||
config.appId = NIGHTLY_APP_ID;
|
||||
config.extraMetadata.productName += " Nightly";
|
||||
config.extraMetadata.name += "-nightly";
|
||||
config.extraMetadata.description += " (nightly unstable build)";
|
||||
config.deb.fpm.push("--name", NIGHTLY_DEB_NAME);
|
||||
|
||||
let version = process.env.ED_NIGHTLY;
|
||||
if (os.platform() === "win32") {
|
||||
// The windows packager relies on parsing this as semver, so we have to make it look like one.
|
||||
// This will give our update packages really stupid names, but we probably can't change that either
|
||||
// because squirrel windows parses them for the version too. We don't really care: nobody sees them.
|
||||
// We just give the installer a static name, so you'll just see this in the 'about' dialog.
|
||||
// Turns out if you use 0.0.0 here it makes Squirrel windows crash, so we use 0.0.1.
|
||||
version = "0.0.1-nightly." + version;
|
||||
}
|
||||
config.extraMetadata.version = version;
|
||||
}
|
||||
|
||||
if (os.platform() === "linux") {
|
||||
// Electron crashes on debian if there's a space in the path.
|
||||
// https://github.com/vector-im/element-web/issues/13171
|
||||
config.extraMetadata.productName = config.extraMetadata.productName.replace(/ /g, "-");
|
||||
|
||||
/**
|
||||
* Allow specifying deb changelog via env var
|
||||
* @param {string} process.env.ED_DEB_CHANGELOG
|
||||
*/
|
||||
if (process.env.ED_DEBIAN_CHANGELOG) {
|
||||
config.deb.fpm.push(`--deb-changelog=${process.env.ED_DEBIAN_CHANGELOG}`);
|
||||
}
|
||||
|
||||
if (process.env.SQLCIPHER_BUNDLED) {
|
||||
// Remove sqlcipher dependency when using bundled
|
||||
config.deb.recommends = config.deb.recommends?.filter((d) => d !== "libsqlcipher0");
|
||||
}
|
||||
}
|
||||
|
||||
export default config;
|
@ -49,10 +49,15 @@
|
||||
},
|
||||
"privacy_policy_url": "https://element.io/cookie-policy",
|
||||
"features": {
|
||||
"threadsActivityCentre": true,
|
||||
"feature_spotlight": true,
|
||||
"feature_video_rooms": true,
|
||||
"feature_element_call_video_rooms": true,
|
||||
"feature_new_room_decoration_ui": true
|
||||
},
|
||||
"setting_defaults": {
|
||||
"RustCrypto.staged_rollout_percent": 100
|
||||
},
|
||||
"element_call": {
|
||||
"url": "https://call.element.dev"
|
||||
},
|
||||
|
@ -44,5 +44,8 @@
|
||||
"api_host": "https://posthog.element.io"
|
||||
},
|
||||
"privacy_policy_url": "https://element.io/cookie-policy",
|
||||
"map_style_url": "https://api.maptiler.com/maps/streets/style.json?key=fU3vlMsMn4Jb6dnEIFsx"
|
||||
"map_style_url": "https://api.maptiler.com/maps/streets/style.json?key=fU3vlMsMn4Jb6dnEIFsx",
|
||||
"setting_defaults": {
|
||||
"RustCrypto.staged_rollout_percent": 30
|
||||
}
|
||||
}
|
||||
|
@ -32,6 +32,9 @@ export default async function buildKeytar(hakEnv: HakEnv, moduleInfo: Dependency
|
||||
cwd: moduleInfo.moduleBuildDir,
|
||||
env,
|
||||
stdio: "inherit",
|
||||
// We need shell mode on Windows to be able to launch `.cmd` executables
|
||||
// See https://nodejs.org/en/blog/vulnerability/april-2024-security-releases-2
|
||||
shell: hakEnv.isWin(),
|
||||
},
|
||||
);
|
||||
proc.on("exit", (code) => {
|
||||
|
@ -28,16 +28,12 @@ export default async function (hakEnv: HakEnv, moduleInfo: DependencyInfo): Prom
|
||||
|
||||
console.log("Running yarn install");
|
||||
await new Promise<void>((resolve, reject) => {
|
||||
const proc = childProcess.spawn(
|
||||
"yarn" + (hakEnv.isWin() ? ".cmd" : ""),
|
||||
["install"],
|
||||
{
|
||||
cwd: moduleInfo.moduleBuildDir,
|
||||
env,
|
||||
shell: true,
|
||||
stdio: "inherit",
|
||||
},
|
||||
);
|
||||
const proc = childProcess.spawn("yarn" + (hakEnv.isWin() ? ".cmd" : ""), ["install"], {
|
||||
cwd: moduleInfo.moduleBuildDir,
|
||||
env,
|
||||
shell: true,
|
||||
stdio: "inherit",
|
||||
});
|
||||
proc.on("exit", (code) => {
|
||||
code ? reject(code) : resolve();
|
||||
});
|
||||
@ -47,16 +43,12 @@ export default async function (hakEnv: HakEnv, moduleInfo: DependencyInfo): Prom
|
||||
|
||||
console.log("Running yarn build");
|
||||
await new Promise<void>((resolve, reject) => {
|
||||
const proc = childProcess.spawn(
|
||||
"yarn" + (hakEnv.isWin() ? ".cmd" : ""),
|
||||
["run", buildTarget],
|
||||
{
|
||||
cwd: moduleInfo.moduleBuildDir,
|
||||
env,
|
||||
shell: true,
|
||||
stdio: "inherit",
|
||||
},
|
||||
);
|
||||
const proc = childProcess.spawn("yarn" + (hakEnv.isWin() ? ".cmd" : ""), ["run", buildTarget], {
|
||||
cwd: moduleInfo.moduleBuildDir,
|
||||
env,
|
||||
shell: true,
|
||||
stdio: "inherit",
|
||||
});
|
||||
proc.on("exit", (code) => {
|
||||
code ? reject(code) : resolve();
|
||||
});
|
||||
|
17
knip.ts
Normal file
17
knip.ts
Normal file
@ -0,0 +1,17 @@
|
||||
import { KnipConfig } from "knip";
|
||||
|
||||
export default {
|
||||
entry: ["src/electron-main.ts", "src/preload.ts", "electron-builder.ts", ".eslintrc-*.js", "scripts/**", "hak/**"],
|
||||
project: ["**/*.{js,ts}"],
|
||||
ignoreDependencies: [
|
||||
// Brought in via hak scripts
|
||||
"keytar",
|
||||
"matrix-seshat",
|
||||
// Needed by `electron-builder`
|
||||
"electron-builder-squirrel-windows",
|
||||
"@types/yargs",
|
||||
// Required for `action-validator`
|
||||
"@action-validator/*",
|
||||
],
|
||||
ignoreBinaries: ["jq", "scripts/in-docker.sh"],
|
||||
} satisfies KnipConfig;
|
161
package.json
161
package.json
@ -2,7 +2,7 @@
|
||||
"name": "element-desktop",
|
||||
"productName": "Element",
|
||||
"main": "lib/electron-main.js",
|
||||
"version": "1.11.50",
|
||||
"version": "1.11.66",
|
||||
"description": "A feature-rich client for Matrix.org",
|
||||
"author": "Element",
|
||||
"homepage": "https://element.io",
|
||||
@ -13,34 +13,35 @@
|
||||
"license": "Apache-2.0",
|
||||
"files": [],
|
||||
"engines": {
|
||||
"node": ">=16.0.0"
|
||||
"node": ">=18.0.0"
|
||||
},
|
||||
"scripts": {
|
||||
"i18n": "matrix-gen-i18n && yarn i18n:sort && yarn i18n:lint",
|
||||
"i18n:sort": "jq --sort-keys '.' src/i18n/strings/en_EN.json > src/i18n/strings/en_EN.json.tmp && mv src/i18n/strings/en_EN.json.tmp src/i18n/strings/en_EN.json",
|
||||
"i18n:lint": "prettier --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",
|
||||
"mkdirs": "mkdirp packages deploys",
|
||||
"fetch": "yarn run mkdirs && ts-node 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",
|
||||
"lint:js": "yarn lint:js:src && yarn lint:js:test && yarn lint:js:scripts && yarn lint:js:hak",
|
||||
"lint:js": "yarn lint:js:src && yarn lint:js:test && yarn lint:js:scripts && yarn lint:js:hak && prettier --check .",
|
||||
"lint:js:src": "eslint --max-warnings 0 src",
|
||||
"lint:js:test": "eslint --max-warnings 0 --config .eslintrc-test.js test",
|
||||
"lint:js:test": "eslint --max-warnings 0 --config .eslintrc-test.js playwright",
|
||||
"lint:js:scripts": "eslint --max-warnings 0 --config .eslintrc-scripts.js scripts",
|
||||
"lint:js:hak": "eslint --max-warnings 0 --config .eslintrc-hak.js hak",
|
||||
"lint:js-fix": "yarn lint:js-fix:src &&yarn lint:js-fix:test && yarn lint:js-fix:scripts && yarn lint:js-fix:hak",
|
||||
"lint:js-fix": "yarn lint:js-fix:src &&yarn lint:js-fix:test && yarn lint:js-fix:scripts && yarn lint:js-fix:hak && prettier --log-level=warn --write .",
|
||||
"lint:js-fix:src": "eslint --fix --max-warnings 0 src",
|
||||
"lint:js-fix:test": "eslint --fix --max-warnings 0 --config .eslintrc-test.js test",
|
||||
"lint:js-fix:test": "eslint --fix --max-warnings 0 --config .eslintrc-test.js playwright",
|
||||
"lint:js-fix:scripts": "eslint --fix --max-warnings 0 --config .eslintrc-scripts.js scripts",
|
||||
"lint:js-fix:hak": "eslint --fix --max-warnings 0 --config .eslintrc-hak.js hak",
|
||||
"lint:types": "yarn lint:types:src && yarn lint:types:test && yarn lint:types:scripts && yarn lint:types:hak",
|
||||
"lint:types:src": "tsc --noEmit",
|
||||
"lint:types:test": "tsc --noEmit -p test/tsconfig.json",
|
||||
"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",
|
||||
@ -49,13 +50,16 @@
|
||||
"build": "yarn run build:ts && yarn run build:res && electron-builder",
|
||||
"build:ts": "tsc",
|
||||
"build:res": "ts-node scripts/copy-res.ts",
|
||||
"docker:setup": "docker build -t element-desktop-dockerbuild dockerbuild",
|
||||
"docker:setup": "docker build --platform linux/amd64 -t element-desktop-dockerbuild dockerbuild",
|
||||
"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",
|
||||
"clean": "rimraf webapp.asar dist packages deploys lib",
|
||||
"hak": "ts-node scripts/hak/index.ts",
|
||||
"test": "jest"
|
||||
"test": "playwright test",
|
||||
"test:open": "yarn 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 /var/run/docker.sock:/var/run/docker.sock --platform linux/amd64 -it element-desktop-playwright"
|
||||
},
|
||||
"dependencies": {
|
||||
"@sentry/electron": "^4.3.0",
|
||||
@ -70,146 +74,57 @@
|
||||
"uuid": "^9.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@action-validator/cli": "^0.5.3",
|
||||
"@action-validator/core": "^0.5.3",
|
||||
"@action-validator/cli": "^0.6.0",
|
||||
"@action-validator/core": "^0.6.0",
|
||||
"@babel/core": "^7.18.10",
|
||||
"@babel/preset-env": "^7.18.10",
|
||||
"@babel/preset-typescript": "^7.18.6",
|
||||
"@electron/asar": "^3.2.3",
|
||||
"@electron/fuses": "^1.7.0",
|
||||
"@mapbox/node-pre-gyp": "^1.0.11",
|
||||
"@playwright/test": "1.43.1",
|
||||
"@types/auto-launch": "^5.0.1",
|
||||
"@types/counterpart": "^0.18.1",
|
||||
"@types/detect-libc": "^1.0.0",
|
||||
"@types/jest": "^29.0.0",
|
||||
"@types/minimist": "^1.2.1",
|
||||
"@types/mkdirp": "^1.0.2",
|
||||
"@types/node": "16.18.52",
|
||||
"@types/mkdirp": "^2.0.0",
|
||||
"@types/node": "18.19.31",
|
||||
"@types/pacote": "^11.1.1",
|
||||
"@types/tar": "^6.1.3",
|
||||
"@types/uuid": "^9.0.2",
|
||||
"@typescript-eslint/eslint-plugin": "^5.42.0",
|
||||
"@typescript-eslint/parser": "^5.42.0",
|
||||
"allchange": "^1.0.6",
|
||||
"app-builder-lib": "24.8.1",
|
||||
"babel-jest": "^29.0.0",
|
||||
"@types/yargs": "^17.0.32",
|
||||
"@typescript-eslint/eslint-plugin": "^7.0.0",
|
||||
"@typescript-eslint/parser": "^7.0.0",
|
||||
"app-builder-lib": "24.13.3",
|
||||
"chokidar": "^3.5.2",
|
||||
"detect-libc": "^1.0.3",
|
||||
"electron": "^27.0.0",
|
||||
"electron-builder": "24.6.4",
|
||||
"electron-builder-squirrel-windows": "24.8.1",
|
||||
"detect-libc": "^2.0.0",
|
||||
"electron": "^29.0.0",
|
||||
"electron-builder": "24.13.3",
|
||||
"electron-builder-squirrel-windows": "24.13.3",
|
||||
"electron-devtools-installer": "^3.2.0",
|
||||
"eslint": "^8.26.0",
|
||||
"eslint-config-google": "^0.14.0",
|
||||
"eslint-config-prettier": "^9.0.0",
|
||||
"eslint-plugin-import": "^2.25.4",
|
||||
"eslint-plugin-matrix-org": "^1.0.0",
|
||||
"eslint-plugin-unicorn": "^49.0.0",
|
||||
"expect-playwright": "^0.8.0",
|
||||
"eslint-plugin-unicorn": "^52.0.0",
|
||||
"find-npm-prefix": "^1.0.2",
|
||||
"fs-extra": "^11.0.0",
|
||||
"glob": "^10.0.0",
|
||||
"jest": "^29.0.0",
|
||||
"matrix-web-i18n": "^3.1.3",
|
||||
"knip": "^5.0.0",
|
||||
"matrix-web-i18n": "^3.2.1",
|
||||
"mkdirp": "^3.0.0",
|
||||
"node-pre-gyp": "^0.17.0",
|
||||
"pacote": "^17.0.0",
|
||||
"playwright": "1.37.1",
|
||||
"prettier": "^2.8.1",
|
||||
"pacote": "^18.0.0",
|
||||
"prettier": "^3.0.0",
|
||||
"rimraf": "^5.0.0",
|
||||
"tar": "^6.1.2",
|
||||
"ts-jest": "^29.0.0",
|
||||
"tar": "^6.2.1",
|
||||
"ts-node": "^10.9.1",
|
||||
"typescript": "5.2.2"
|
||||
"typescript": "5.4.5"
|
||||
},
|
||||
"hakDependencies": {
|
||||
"matrix-seshat": "^3.0.1",
|
||||
"keytar": "^7.9.0"
|
||||
},
|
||||
"resolutions": {
|
||||
"@types/node": "16.18.59"
|
||||
},
|
||||
"build": {
|
||||
"appId": "im.riot.app",
|
||||
"asarUnpack": "**/*.node",
|
||||
"files": [
|
||||
"package.json",
|
||||
{
|
||||
"from": ".hak/hakModules",
|
||||
"to": "node_modules"
|
||||
},
|
||||
"lib/**"
|
||||
],
|
||||
"extraResources": [
|
||||
{
|
||||
"from": "res/img",
|
||||
"to": "img"
|
||||
},
|
||||
"webapp.asar"
|
||||
],
|
||||
"linux": {
|
||||
"target": [
|
||||
"tar.gz",
|
||||
"deb"
|
||||
],
|
||||
"category": "Network;InstantMessaging;Chat",
|
||||
"maintainer": "support@element.io",
|
||||
"icon": "build/icons"
|
||||
},
|
||||
"deb": {
|
||||
"packageCategory": "net",
|
||||
"depends": [
|
||||
"libgtk-3-0",
|
||||
"libnotify4",
|
||||
"libnss3",
|
||||
"libxss1",
|
||||
"libxtst6",
|
||||
"xdg-utils",
|
||||
"libatspi2.0-0",
|
||||
"libuuid1",
|
||||
"libsecret-1-0",
|
||||
"libasound2",
|
||||
"libgbm1"
|
||||
],
|
||||
"recommends": [
|
||||
"libsqlcipher0",
|
||||
"element-io-archive-keyring"
|
||||
]
|
||||
},
|
||||
"mac": {
|
||||
"category": "public.app-category.social-networking",
|
||||
"darkModeSupport": true,
|
||||
"hardenedRuntime": true,
|
||||
"gatekeeperAssess": true,
|
||||
"entitlements": "./build/entitlements.mac.plist",
|
||||
"icon": "build/icons/icon.icns"
|
||||
},
|
||||
"win": {
|
||||
"target": [
|
||||
"squirrel"
|
||||
],
|
||||
"signingHashAlgorithms": [
|
||||
"sha256"
|
||||
],
|
||||
"icon": "build/icons/icon.ico"
|
||||
},
|
||||
"directories": {
|
||||
"output": "dist"
|
||||
},
|
||||
"protocols": [
|
||||
{
|
||||
"name": "element",
|
||||
"schemes": [
|
||||
"element"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"jest": {
|
||||
"testEnvironment": "node",
|
||||
"testMatch": [
|
||||
"<rootDir>/test/**/*-test.[jt]s?(x)"
|
||||
],
|
||||
"setupFilesAfterEnv": [
|
||||
"expect-playwright"
|
||||
]
|
||||
"@types/node": "18.19.31",
|
||||
"config-file-ts": "0.2.8-rc1"
|
||||
}
|
||||
}
|
||||
|
33
playwright.config.ts
Normal file
33
playwright.config.ts
Normal file
@ -0,0 +1,33 @@
|
||||
/*
|
||||
Copyright 2023 The Matrix.org Foundation C.I.C.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
import { defineConfig } from "@playwright/test";
|
||||
|
||||
export default defineConfig({
|
||||
use: {
|
||||
viewport: { width: 1280, height: 720 },
|
||||
video: "retain-on-failure",
|
||||
trace: "on-first-retry",
|
||||
},
|
||||
testDir: "playwright/e2e",
|
||||
outputDir: "playwright/test-results",
|
||||
workers: 1,
|
||||
retries: process.env.CI ? 2 : 0,
|
||||
reporter: [["html", { outputFolder: "playwright/html-report" }]],
|
||||
snapshotDir: "playwright/snapshots",
|
||||
snapshotPathTemplate: "{snapshotDir}/{testFilePath}/{arg}-{platform}{ext}",
|
||||
timeout: 10 * 1000,
|
||||
});
|
5
playwright/.gitignore
vendored
Normal file
5
playwright/.gitignore
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
/test-results/
|
||||
/html-report/
|
||||
# Only commit snapshots from Linux
|
||||
/snapshots/**/*.png
|
||||
!/snapshots/**/*-linux.png
|
10
playwright/Dockerfile
Normal file
10
playwright/Dockerfile
Normal file
@ -0,0 +1,10 @@
|
||||
FROM mcr.microsoft.com/playwright:v1.43.1-jammy
|
||||
|
||||
WORKDIR /work/element-desktop
|
||||
|
||||
RUN apt-get update && apt-get -y install xvfb
|
||||
|
||||
USER 1000:1000
|
||||
|
||||
COPY docker-entrypoint.sh /opt/docker-entrypoint.sh
|
||||
ENTRYPOINT ["bash", "/opt/docker-entrypoint.sh"]
|
11
playwright/docker-entrypoint.sh
Normal file
11
playwright/docker-entrypoint.sh
Normal file
@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
echo "Starting Xvfb"
|
||||
Xvfb :99 -ac &
|
||||
sleep 2
|
||||
|
||||
export DISPLAY=:99
|
||||
|
||||
npx playwright test --update-snapshots --reporter line $1
|
27
playwright/e2e/launch/launch.spec.ts
Normal file
27
playwright/e2e/launch/launch.spec.ts
Normal file
@ -0,0 +1,27 @@
|
||||
/*
|
||||
Copyright 2022 - 2023 The Matrix.org Foundation C.I.C.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
import { test, expect } from "../../element-desktop-test";
|
||||
|
||||
test.describe("App launch", () => {
|
||||
test.slow();
|
||||
test("should launch and render the welcome view successfully", async ({ page }) => {
|
||||
await page.locator("#matrixchat").waitFor();
|
||||
await page.locator(".mx_Welcome").waitFor();
|
||||
await expect(page).toHaveURL("vector://vector/webapp/#/welcome");
|
||||
await expect(page).toHaveScreenshot();
|
||||
});
|
||||
});
|
60
playwright/element-desktop-test.ts
Normal file
60
playwright/element-desktop-test.ts
Normal file
@ -0,0 +1,60 @@
|
||||
/*
|
||||
Copyright 2023 The Matrix.org Foundation C.I.C.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
import { _electron as electron, test as base, expect as baseExpect, type ElectronApplication } from "@playwright/test";
|
||||
import fs from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
import os from "node:os";
|
||||
|
||||
export const test = base.extend<{ app: ElectronApplication; tmpDir: string }>({
|
||||
// eslint-disable-next-line no-empty-pattern
|
||||
tmpDir: async ({}, use) => {
|
||||
const tmpDir = await fs.mkdtemp(path.join(os.tmpdir(), "element-desktop-tests-"));
|
||||
console.log("Using temp profile directory: ", tmpDir);
|
||||
await use(tmpDir);
|
||||
await fs.rm(tmpDir, { recursive: true });
|
||||
},
|
||||
app: async ({ tmpDir }, use) => {
|
||||
const args = ["--profile-dir", tmpDir];
|
||||
|
||||
const executablePath = process.env["ELEMENT_DESKTOP_EXECUTABLE"];
|
||||
if (!executablePath) {
|
||||
// Unpackaged mode testing
|
||||
args.unshift(path.join(__dirname, "..", "lib", "electron-main.js"));
|
||||
}
|
||||
|
||||
const app = await electron.launch({
|
||||
env: process.env,
|
||||
executablePath,
|
||||
args,
|
||||
});
|
||||
|
||||
app.process().stdout.pipe(process.stdout);
|
||||
app.process().stderr.pipe(process.stderr);
|
||||
|
||||
await app.firstWindow();
|
||||
await use(app);
|
||||
},
|
||||
page: async ({ app }, use) => {
|
||||
const window = await app.firstWindow();
|
||||
await use(window);
|
||||
await app.close().catch((e) => {
|
||||
console.error(e);
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
export const expect = baseExpect;
|
Binary file not shown.
After Width: | Height: | Size: 1.2 MiB |
11
playwright/tsconfig.json
Normal file
11
playwright/tsconfig.json
Normal file
@ -0,0 +1,11 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"resolveJsonModule": true,
|
||||
"moduleResolution": "node",
|
||||
"esModuleInterop": true,
|
||||
"target": "es2017",
|
||||
"module": "es2022",
|
||||
"lib": ["ESNext", "es2021", "dom"]
|
||||
},
|
||||
"include": ["**/*.ts"]
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Script to perform a release of element-desktop.
|
||||
|
||||
set -e
|
||||
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
./node_modules/matrix-js-sdk/release.sh "$@"
|
2
scripts/@types/node-pre-gyp.d.ts
vendored
2
scripts/@types/node-pre-gyp.d.ts
vendored
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
declare module "node-pre-gyp/lib/util/versioning" {
|
||||
declare module "@mapbox/node-pre-gyp/lib/util/versioning" {
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
export function get_runtime_abi(runtime: string, version: string): string;
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ import riotDesktopPackageJson from "../package.json";
|
||||
import { setPackageVersion } from "./set-version";
|
||||
|
||||
const PUB_KEY_URL = "https://packages.riot.im/element-release-key.asc";
|
||||
const PACKAGE_URL_PREFIX = "https://github.com/vector-im/element-web/releases/download/";
|
||||
const PACKAGE_URL_PREFIX = "https://github.com/element-hq/element-web/releases/download/";
|
||||
const DEVELOP_TGZ_URL = "https://develop.element.io/develop.tar.gz";
|
||||
const ASAR_PATH = "webapp.asar";
|
||||
|
||||
|
@ -1,129 +0,0 @@
|
||||
#!/usr/bin/env -S npx ts-node
|
||||
|
||||
/**
|
||||
* Script to generate electron-builder.json config files for builds which don't match package.json, e.g. nightlies
|
||||
* This script has different outputs depending on your os platform.
|
||||
*
|
||||
* On Windows:
|
||||
* Prefixes the nightly version with `0.0.1-nightly.` as it breaks if it is not semver
|
||||
*
|
||||
* On macOS:
|
||||
* Passes --notarytool-team-id to build.mac.notarize.notarize if specified
|
||||
*
|
||||
* On Linux:
|
||||
* Replaces spaces in the product name with dashes as spaces in paths can cause issues
|
||||
* Passes --deb-custom-control to build.deb.fpm if specified
|
||||
* Removes libsqlcipher0 recommended dependency if env SQLCIPHER_BUNDLED is asserted.
|
||||
*/
|
||||
|
||||
import parseArgs from "minimist";
|
||||
import fsProm from "fs/promises";
|
||||
import * as os from "os";
|
||||
import { Configuration } from "app-builder-lib";
|
||||
|
||||
const ELECTRON_BUILDER_CFG_FILE = "electron-builder.json";
|
||||
|
||||
const NIGHTLY_APP_ID = "im.riot.nightly";
|
||||
const NIGHTLY_APP_NAME = "element-desktop-nightly";
|
||||
const NIGHTLY_DEB_NAME = "element-nightly";
|
||||
|
||||
const argv = parseArgs<{
|
||||
"nightly"?: string;
|
||||
"signtool-thumbprint"?: string;
|
||||
"signtool-subject-name"?: string;
|
||||
"notarytool-team-id"?: string;
|
||||
"deb-changelog"?: string;
|
||||
}>(process.argv.slice(2), {
|
||||
string: ["nightly", "deb-changelog", "signtool-thumbprint", "signtool-subject-name", "notarytool-team-id"],
|
||||
});
|
||||
|
||||
type DeepWriteable<T> = { -readonly [P in keyof T]: DeepWriteable<T[P]> };
|
||||
|
||||
interface PackageBuild extends DeepWriteable<Omit<Configuration, "extraMetadata">> {
|
||||
extraMetadata?: {
|
||||
productName?: string;
|
||||
name?: string;
|
||||
version?: string;
|
||||
description?: string;
|
||||
};
|
||||
}
|
||||
|
||||
interface Package {
|
||||
build: PackageBuild;
|
||||
productName: string;
|
||||
description: string;
|
||||
}
|
||||
|
||||
async function main(): Promise<number | void> {
|
||||
// Electron builder doesn't overlay with the config in package.json, so load it here
|
||||
const pkg: Package = JSON.parse(await fsProm.readFile("package.json", "utf8"));
|
||||
|
||||
const cfg: PackageBuild = {
|
||||
...pkg.build,
|
||||
extraMetadata: {
|
||||
productName: pkg.productName,
|
||||
description: pkg.description,
|
||||
},
|
||||
};
|
||||
|
||||
if (!cfg.deb!.fpm) cfg.deb!.fpm = [];
|
||||
|
||||
if (argv.nightly) {
|
||||
cfg.appId = NIGHTLY_APP_ID;
|
||||
cfg.extraMetadata!.productName += " Nightly";
|
||||
cfg.extraMetadata!.name = NIGHTLY_APP_NAME;
|
||||
cfg.extraMetadata!.description += " (nightly unstable build)";
|
||||
cfg.deb!.fpm!.push("--name", NIGHTLY_DEB_NAME);
|
||||
|
||||
let version = argv.nightly;
|
||||
if (os.platform() === "win32") {
|
||||
// The windows packager relies on parsing this as semver, so we have to make it look like one.
|
||||
// This will give our update packages really stupid names, but we probably can't change that either
|
||||
// because squirrel windows parses them for the version too. We don't really care: nobody sees them.
|
||||
// We just give the installer a static name, so you'll just see this in the 'about' dialog.
|
||||
// Turns out if you use 0.0.0 here it makes Squirrel windows crash, so we use 0.0.1.
|
||||
version = "0.0.1-nightly." + version;
|
||||
}
|
||||
cfg.extraMetadata!.version = version;
|
||||
} else {
|
||||
cfg.deb!.fpm!.push("--deb-field", "Replaces: riot-desktop (<< 1.7.0), riot-web (<< 1.7.0)");
|
||||
cfg.deb!.fpm!.push("--deb-field", "Breaks: riot-desktop (<< 1.7.0), riot-web (<< 1.7.0)");
|
||||
}
|
||||
|
||||
if (argv["signtool-thumbprint"] && argv["signtool-subject-name"]) {
|
||||
cfg.win!.certificateSubjectName = argv["signtool-subject-name"];
|
||||
cfg.win!.certificateSha1 = argv["signtool-thumbprint"];
|
||||
}
|
||||
|
||||
if (argv["notarytool-team-id"]) {
|
||||
cfg.mac!.notarize = {
|
||||
teamId: argv["notarytool-team-id"],
|
||||
};
|
||||
}
|
||||
|
||||
if (os.platform() === "linux") {
|
||||
// Electron crashes on debian if there's a space in the path.
|
||||
// https://github.com/vector-im/element-web/issues/13171
|
||||
cfg.extraMetadata!.productName = cfg.extraMetadata!.productName!.replace(/ /g, "-");
|
||||
|
||||
if (argv["deb-changelog"]) {
|
||||
cfg.deb!.fpm!.push(`--deb-changelog=${argv["deb-changelog"]}`);
|
||||
}
|
||||
|
||||
if (process.env.SQLCIPHER_BUNDLED) {
|
||||
// Remove sqlcipher dependency when using bundled
|
||||
cfg.deb!.recommends = cfg.deb!.recommends?.filter((d) => d !== "libsqlcipher0");
|
||||
}
|
||||
}
|
||||
|
||||
await fsProm.writeFile(ELECTRON_BUILDER_CFG_FILE, JSON.stringify(cfg, null, 4));
|
||||
}
|
||||
|
||||
main()
|
||||
.then((ret) => {
|
||||
process.exit(ret!);
|
||||
})
|
||||
.catch((e) => {
|
||||
console.error(e);
|
||||
process.exit(1);
|
||||
});
|
@ -44,6 +44,9 @@ export default async function fetch(hakEnv: HakEnv, moduleInfo: DependencyInfo):
|
||||
const proc = childProcess.spawn(hakEnv.isWin() ? "yarn.cmd" : "yarn", ["install", "--ignore-scripts"], {
|
||||
stdio: "inherit",
|
||||
cwd: moduleInfo.moduleBuildDir,
|
||||
// We need shell mode on Windows to be able to launch `.cmd` executables
|
||||
// See https://nodejs.org/en/blog/vulnerability/april-2024-security-releases-2
|
||||
shell: hakEnv.isWin(),
|
||||
});
|
||||
proc.on("exit", (code) => {
|
||||
code ? reject(code) : resolve();
|
||||
|
@ -16,18 +16,18 @@ limitations under the License.
|
||||
|
||||
import path from "path";
|
||||
import os from "os";
|
||||
import nodePreGypVersioning from "node-pre-gyp/lib/util/versioning";
|
||||
import { getElectronVersion } from "app-builder-lib/out/electron/electronVersion";
|
||||
import nodePreGypVersioning from "@mapbox/node-pre-gyp/lib/util/versioning";
|
||||
import { getElectronVersionFromInstalled } from "app-builder-lib/out/electron/electronVersion";
|
||||
|
||||
import { Arch, Target, TARGETS, getHost, isHostId, TargetId } from "./target";
|
||||
|
||||
async function getRuntime(projectRoot: string): Promise<string> {
|
||||
const electronVersion = await getElectronVersion(projectRoot);
|
||||
const electronVersion = await getElectronVersionFromInstalled(projectRoot);
|
||||
return electronVersion ? "electron" : "node-webkit";
|
||||
}
|
||||
|
||||
async function getRuntimeVersion(projectRoot: string): Promise<string> {
|
||||
const electronVersion = await getElectronVersion(projectRoot);
|
||||
const electronVersion = await getElectronVersionFromInstalled(projectRoot);
|
||||
if (electronVersion) {
|
||||
return electronVersion;
|
||||
} else {
|
||||
@ -41,7 +41,10 @@ export default class HakEnv {
|
||||
public runtimeVersion?: string;
|
||||
public dotHakDir: string;
|
||||
|
||||
public constructor(public readonly projectRoot: string, targetId: TargetId | null) {
|
||||
public constructor(
|
||||
public readonly projectRoot: string,
|
||||
targetId: TargetId | null,
|
||||
) {
|
||||
const target = targetId ? TARGETS[targetId] : getHost();
|
||||
|
||||
if (!target) {
|
||||
|
@ -53,6 +53,9 @@ export default async function link(hakEnv: HakEnv, moduleInfo: DependencyInfo):
|
||||
const proc = childProcess.spawn(yarnCmd, ["link"], {
|
||||
cwd: moduleInfo.moduleOutDir,
|
||||
stdio: "inherit",
|
||||
// We need shell mode on Windows to be able to launch `.cmd` executables
|
||||
// See https://nodejs.org/en/blog/vulnerability/april-2024-security-releases-2
|
||||
shell: hakEnv.isWin(),
|
||||
});
|
||||
proc.on("exit", (code) => {
|
||||
code ? reject(code) : resolve();
|
||||
@ -63,6 +66,9 @@ export default async function link(hakEnv: HakEnv, moduleInfo: DependencyInfo):
|
||||
const proc = childProcess.spawn(yarnCmd, ["link", moduleInfo.name], {
|
||||
cwd: hakEnv.projectRoot,
|
||||
stdio: "inherit",
|
||||
// We need shell mode on Windows to be able to launch `.cmd` executables
|
||||
// See https://nodejs.org/en/blog/vulnerability/april-2024-security-releases-2
|
||||
shell: hakEnv.isWin(),
|
||||
});
|
||||
proc.on("exit", (code) => {
|
||||
code ? reject(code) : resolve();
|
||||
|
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
import { GLIBC, MUSL, family as processLibC } from "detect-libc";
|
||||
import { GLIBC, MUSL, familySync as processLibC } from "detect-libc";
|
||||
|
||||
// We borrow Rust's target naming scheme as a way of expressing all target
|
||||
// details in a single string.
|
||||
@ -61,7 +61,7 @@ export type WindowsTarget = Target & {
|
||||
|
||||
export type LinuxTarget = Target & {
|
||||
platform: "linux";
|
||||
libC: typeof processLibC;
|
||||
libC: typeof GLIBC | typeof MUSL;
|
||||
};
|
||||
|
||||
export type UniversalTarget = Target & {
|
||||
@ -212,7 +212,7 @@ export function getHost(): Target | undefined {
|
||||
(target) =>
|
||||
target.platform === process.platform &&
|
||||
target.arch === process.arch &&
|
||||
(process.platform !== "linux" || (target as LinuxTarget).libC === processLibC),
|
||||
(process.platform !== "linux" || (target as LinuxTarget).libC === processLibC()),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -11,6 +11,7 @@ fi
|
||||
# Taken from https://www.electron.build/multi-platform-build#docker
|
||||
# Pass through any vars prefixed with INDOCKER_, removing the prefix
|
||||
docker run --rm -ti \
|
||||
--platform linux/amd64 \
|
||||
--env-file <(env | grep -E '^INDOCKER_' | sed -e 's/^INDOCKER_//') \
|
||||
--env ELECTRON_CACHE="/root/.cache/electron" \
|
||||
--env ELECTRON_BUILDER_CACHE="/root/.cache/electron-builder" \
|
||||
|
@ -32,6 +32,11 @@ export async function setPackageVersion(ver: string): Promise<void> {
|
||||
"--new-version",
|
||||
ver,
|
||||
],
|
||||
{
|
||||
// We need shell mode on Windows to be able to launch `.cmd` executables
|
||||
// See https://nodejs.org/en/blog/vulnerability/april-2024-security-releases-2
|
||||
shell: process.platform === "win32",
|
||||
},
|
||||
(err) => {
|
||||
if (err) {
|
||||
reject(err);
|
||||
|
@ -41,6 +41,7 @@ import { getProfileFromDeeplink, protocolInit } from "./protocol";
|
||||
import { _t, AppLocalization } from "./language-helper";
|
||||
import { setDisplayMediaCallback } from "./displayMediaCallback";
|
||||
import { setupMacosTitleBar } from "./macos-titlebar";
|
||||
import { loadJsonFile } from "./utils";
|
||||
|
||||
const argv = minimist(process.argv, {
|
||||
alias: { help: "h" },
|
||||
@ -143,8 +144,7 @@ async function loadConfig(): Promise<void> {
|
||||
const asarPath = await getAsarPath();
|
||||
|
||||
try {
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
global.vectorConfig = require(asarPath + "config.json");
|
||||
global.vectorConfig = loadJsonFile(asarPath, "config.json");
|
||||
} catch (e) {
|
||||
// it would be nice to check the error code here and bail if the config
|
||||
// is unparsable, but we get MODULE_NOT_FOUND in the case of a missing
|
||||
@ -155,8 +155,7 @@ async function loadConfig(): Promise<void> {
|
||||
|
||||
try {
|
||||
// Load local config and use it to override values from the one baked with the build
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const localConfig = require(path.join(app.getPath("userData"), "config.json"));
|
||||
const localConfig = loadJsonFile(app.getPath("userData"), "config.json");
|
||||
|
||||
// If the local config has a homeserver defined, don't use the homeserver from the build
|
||||
// config. This is to avoid a problem where Riot thinks there are multiple homeservers
|
||||
@ -165,10 +164,13 @@ async function loadConfig(): Promise<void> {
|
||||
// Rip out all the homeserver options from the vector config
|
||||
global.vectorConfig = Object.keys(global.vectorConfig)
|
||||
.filter((k) => !homeserverProps.includes(<any>k))
|
||||
.reduce((obj, key) => {
|
||||
obj[key] = global.vectorConfig[key];
|
||||
return obj;
|
||||
}, {} as Omit<Partial<(typeof global)["vectorConfig"]>, keyof typeof homeserverProps>);
|
||||
.reduce(
|
||||
(obj, key) => {
|
||||
obj[key] = global.vectorConfig[key];
|
||||
return obj;
|
||||
},
|
||||
{} as Omit<Partial<(typeof global)["vectorConfig"]>, keyof typeof homeserverProps>,
|
||||
);
|
||||
}
|
||||
|
||||
global.vectorConfig = Object.assign(global.vectorConfig, localConfig);
|
||||
|
@ -3,7 +3,7 @@
|
||||
"cancel": "Nuligi",
|
||||
"close": "Fermi",
|
||||
"close_brand": "Fermu %(brand)s",
|
||||
"copy": "Kopiu",
|
||||
"copy": "Kopii",
|
||||
"cut": "Tranĉi",
|
||||
"delete": "Forigi",
|
||||
"edit": "Redakti",
|
||||
@ -15,9 +15,9 @@
|
||||
"undo": "Malfari"
|
||||
},
|
||||
"common": {
|
||||
"about": "Informilo",
|
||||
"about": "Prio",
|
||||
"help": "Helpo",
|
||||
"preferences": "Preferoj"
|
||||
"preferences": "Agordoj"
|
||||
},
|
||||
"confirm_quit": "Ĉu vi certas, ke vi volas ĉesi?",
|
||||
"edit_menu": {
|
||||
|
@ -5,7 +5,7 @@
|
||||
"close_brand": "Cerrar %(brand)s",
|
||||
"copy": "Copiar",
|
||||
"cut": "Cortar",
|
||||
"delete": "Eliminar",
|
||||
"delete": "Borrar",
|
||||
"edit": "Editar",
|
||||
"minimise": "Minimizar",
|
||||
"paste": "Pegar",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"action": {
|
||||
"cancel": "Tühista",
|
||||
"cancel": "Loobu",
|
||||
"close": "Sulge",
|
||||
"close_brand": "Sulge %(brand)s",
|
||||
"copy": "Kopeeri",
|
||||
@ -22,7 +22,7 @@
|
||||
"about": "Rakenduse teave",
|
||||
"brand_help": "%(brand)s abiteave",
|
||||
"help": "Abiteave",
|
||||
"preferences": "Seadistused"
|
||||
"preferences": "Eelistused"
|
||||
},
|
||||
"confirm_quit": "Kas sa kindlasti soovid rakendusest väljuda?",
|
||||
"edit_menu": {
|
||||
@ -53,7 +53,7 @@
|
||||
"actual_size": "Näita tavasuuruses",
|
||||
"toggle_developer_tools": "Arendaja töövahendid sisse/välja",
|
||||
"toggle_full_screen": "Täisekraanivaade sisse/välja",
|
||||
"view": "Vaata"
|
||||
"view": "Näita"
|
||||
},
|
||||
"window_menu": {
|
||||
"bring_all_to_front": "Too kõik esiplaanile",
|
||||
|
@ -5,7 +5,7 @@
|
||||
"close_brand": "بستن %(brand)s",
|
||||
"copy": "رونوشت",
|
||||
"cut": "برش",
|
||||
"delete": "حذف",
|
||||
"delete": "پاککردن",
|
||||
"edit": "ویرایش",
|
||||
"minimise": "کمینه",
|
||||
"paste": "جایگذاری",
|
||||
@ -20,6 +20,7 @@
|
||||
},
|
||||
"common": {
|
||||
"about": "درباره",
|
||||
"brand_help": "کمک %(brand)s",
|
||||
"help": "راهنما",
|
||||
"preferences": "ترجیحات"
|
||||
},
|
||||
@ -52,7 +53,7 @@
|
||||
"actual_size": "اندازهٔ واقعی",
|
||||
"toggle_developer_tools": "تغییر وضعیت ابزارهای توسعهدهنده",
|
||||
"toggle_full_screen": "تغییر وضعیت تمامصفحه",
|
||||
"view": "دیدن"
|
||||
"view": "مشاهده"
|
||||
},
|
||||
"window_menu": {
|
||||
"bring_all_to_front": "همه را به جلو بیاورید",
|
||||
|
@ -19,9 +19,9 @@
|
||||
"zoom_out": "Pienennä"
|
||||
},
|
||||
"common": {
|
||||
"about": "Tietoja",
|
||||
"help": "Apua",
|
||||
"preferences": "Asetukset"
|
||||
"about": "Tietoa",
|
||||
"help": "Ohje",
|
||||
"preferences": "Valinnat"
|
||||
},
|
||||
"confirm_quit": "Haluatko varmasti poistua?",
|
||||
"edit_menu": {
|
||||
|
@ -50,7 +50,7 @@
|
||||
"actual_size": "Tamaño real",
|
||||
"toggle_developer_tools": "Activar ferramentas de desenvolvemento",
|
||||
"toggle_full_screen": "Activar pantalla completa",
|
||||
"view": "Ver"
|
||||
"view": "Vista"
|
||||
},
|
||||
"window_menu": {
|
||||
"bring_all_to_front": "Traer todo á fronte",
|
||||
|
@ -2,10 +2,11 @@
|
||||
"action": {
|
||||
"cancel": "ביטול",
|
||||
"close": "סגור",
|
||||
"close_brand": "סגור%(brand)s",
|
||||
"copy": "העתק",
|
||||
"cut": "גזור",
|
||||
"delete": "מחק",
|
||||
"edit": "עריכה",
|
||||
"edit": "ערוך",
|
||||
"minimise": "מזער",
|
||||
"paste": "הדבק",
|
||||
"paste_match_style": "הדבק והתאם סגנון",
|
||||
@ -19,6 +20,7 @@
|
||||
},
|
||||
"common": {
|
||||
"about": "אודות",
|
||||
"brand_help": "%(brand)s עזרה",
|
||||
"help": "עזרה",
|
||||
"preferences": "העדפות"
|
||||
},
|
||||
|
@ -1,27 +1,27 @@
|
||||
{
|
||||
"action": {
|
||||
"cancel": "Mégsem",
|
||||
"close": "Bezár",
|
||||
"cancel": "Mégse",
|
||||
"close": "Bezárás",
|
||||
"close_brand": "%(brand)s bezárása",
|
||||
"copy": "Másol",
|
||||
"cut": "Kivág",
|
||||
"delete": "Töröl",
|
||||
"edit": "Szerkeszt",
|
||||
"copy": "Másolás",
|
||||
"cut": "Kivágás",
|
||||
"delete": "Törlés",
|
||||
"edit": "Szerkesztés",
|
||||
"minimise": "Lecsukás",
|
||||
"paste": "Beillesztés",
|
||||
"paste_match_style": "Beillesztés formázással",
|
||||
"quit": "Kilép",
|
||||
"quit": "Kilépés",
|
||||
"redo": "Újra",
|
||||
"select_all": "Összes kijelölése",
|
||||
"show_hide": "Megmutat/Elrejt",
|
||||
"undo": "Visszavon",
|
||||
"zoom_in": "Nagyít",
|
||||
"zoom_out": "Kicsinyít"
|
||||
"show_hide": "Megjelenítés/elrejtés",
|
||||
"undo": "Visszavonás",
|
||||
"zoom_in": "Nagyítás",
|
||||
"zoom_out": "Kicsinyítés"
|
||||
},
|
||||
"common": {
|
||||
"about": "Névjegy",
|
||||
"brand_help": "%(brand)s Súgó",
|
||||
"help": "Segítség",
|
||||
"help": "Súgó",
|
||||
"preferences": "Beállítások"
|
||||
},
|
||||
"confirm_quit": "Biztos, hogy kilép?",
|
||||
@ -34,18 +34,18 @@
|
||||
"label": "Fájl"
|
||||
},
|
||||
"menu": {
|
||||
"hide": "Eltakar",
|
||||
"hide_others": "Minden mást eltakar",
|
||||
"hide": "Elrejtés",
|
||||
"hide_others": "Mások elrejtése",
|
||||
"services": "Szolgáltatás",
|
||||
"unhide": "Felfed"
|
||||
"unhide": "Felfedés"
|
||||
},
|
||||
"right_click_menu": {
|
||||
"add_to_dictionary": "Hozzáadás a szótárhoz",
|
||||
"copy_email": "E-mail cím másolása",
|
||||
"copy_email": "E-mail-cím másolása",
|
||||
"copy_image": "Kép másolása",
|
||||
"copy_image_url": "Kép címének másolása",
|
||||
"copy_link_url": "Hivatkozás másolása",
|
||||
"save_image_as": "Kép mentése másként...",
|
||||
"save_image_as": "Kép mentése másként…",
|
||||
"save_image_as_error_description": "A kép mentése sikertelen",
|
||||
"save_image_as_error_title": "Kép mentése sikertelen"
|
||||
},
|
||||
@ -53,7 +53,7 @@
|
||||
"actual_size": "Jelenlegi méret",
|
||||
"toggle_developer_tools": "Fejlesztői eszközök",
|
||||
"toggle_full_screen": "Teljes képernyő",
|
||||
"view": "Nézet"
|
||||
"view": "Megtekintés"
|
||||
},
|
||||
"window_menu": {
|
||||
"bring_all_to_front": "Mindent előtérbe hoz",
|
||||
|
@ -1,11 +1,12 @@
|
||||
{
|
||||
"action": {
|
||||
"cancel": "Batal",
|
||||
"cancel": "Batalkan",
|
||||
"close": "Tutup",
|
||||
"close_brand": "Tutuo %(brand)s",
|
||||
"copy": "Salin",
|
||||
"cut": "Potong",
|
||||
"delete": "Hapus",
|
||||
"edit": "Sunting",
|
||||
"minimise": "Minimalkan",
|
||||
"paste": "Tempel",
|
||||
"paste_match_style": "Tempel dan Cocokkan Gaya",
|
||||
@ -21,7 +22,7 @@
|
||||
"about": "Tentang",
|
||||
"brand_help": "Bantuan %(brand)s",
|
||||
"help": "Bantuan",
|
||||
"preferences": "Pengaturan"
|
||||
"preferences": "Preferensi"
|
||||
},
|
||||
"confirm_quit": "Apakah Anda yakin ingin keluar?",
|
||||
"edit_menu": {
|
||||
@ -29,6 +30,9 @@
|
||||
"speech_start_speaking": "Mulai Berbicara",
|
||||
"speech_stop_speaking": "Berhenti Berbicara"
|
||||
},
|
||||
"file_menu": {
|
||||
"label": "Berkas"
|
||||
},
|
||||
"menu": {
|
||||
"hide": "Sembunyikan",
|
||||
"hide_others": "Sembunyikan yang Lain",
|
||||
|
@ -57,6 +57,7 @@
|
||||
},
|
||||
"window_menu": {
|
||||
"bring_all_to_front": "Porta tutto in primo piano",
|
||||
"label": "Finestra"
|
||||
"label": "Finestra",
|
||||
"zoom": "Ingrandisci"
|
||||
}
|
||||
}
|
||||
|
@ -51,8 +51,8 @@
|
||||
},
|
||||
"view_menu": {
|
||||
"actual_size": "Rozmiar rzeczywisty",
|
||||
"toggle_developer_tools": "Przełącz na narzędzia deweloperskie",
|
||||
"toggle_full_screen": "Przełącz na pełny ekran",
|
||||
"toggle_developer_tools": "Przełącz narzędzia deweloperskie",
|
||||
"toggle_full_screen": "Przełącz pełny ekran",
|
||||
"view": "Wyświetl"
|
||||
},
|
||||
"window_menu": {
|
||||
|
@ -5,7 +5,7 @@
|
||||
"close_brand": "Fechar %(brand)s",
|
||||
"copy": "Copiar",
|
||||
"cut": "Cortar",
|
||||
"delete": "Deletar",
|
||||
"delete": "Excluir",
|
||||
"edit": "Editar",
|
||||
"minimise": "Minimizar",
|
||||
"paste": "Colar",
|
||||
@ -52,7 +52,7 @@
|
||||
"actual_size": "Tamanho de Verdade",
|
||||
"toggle_developer_tools": "Ativar/Desativar Ferramentas de Desenvolvimento",
|
||||
"toggle_full_screen": "Pôr em/Tirar de Tela Cheia",
|
||||
"view": "Visualizar"
|
||||
"view": "Ver"
|
||||
},
|
||||
"window_menu": {
|
||||
"bring_all_to_front": "Trazer Todas Para Frente",
|
||||
|
@ -6,7 +6,7 @@
|
||||
"copy": "Kopírovať",
|
||||
"cut": "Vystrihnúť",
|
||||
"delete": "Odstrániť",
|
||||
"edit": "Úpravy",
|
||||
"edit": "Upraviť",
|
||||
"minimise": "Minimalizovať",
|
||||
"paste": "Vložiť",
|
||||
"paste_match_style": "Vložiť a prispôsobiť štýl",
|
||||
@ -19,10 +19,10 @@
|
||||
"zoom_out": "Oddialiť"
|
||||
},
|
||||
"common": {
|
||||
"about": "O aplikácii",
|
||||
"about": "Informácie",
|
||||
"brand_help": "%(brand)s Pomoc",
|
||||
"help": "Pomocník",
|
||||
"preferences": "Vlastnosti"
|
||||
"preferences": "Predvoľby"
|
||||
},
|
||||
"confirm_quit": "Naozaj chcete zavrieť aplikáciu?",
|
||||
"edit_menu": {
|
||||
|
@ -6,7 +6,7 @@
|
||||
"copy": "Kopiera",
|
||||
"cut": "Klipp ut",
|
||||
"delete": "Radera",
|
||||
"edit": "Redigera",
|
||||
"edit": "Ändra",
|
||||
"minimise": "Minimera",
|
||||
"paste": "Klistra in",
|
||||
"paste_match_style": "Klistra in och matcha stilen",
|
||||
|
@ -1,12 +1,12 @@
|
||||
{
|
||||
"action": {
|
||||
"cancel": "Hủy bỏ",
|
||||
"cancel": "Huỷ bỏ",
|
||||
"close": "Đóng",
|
||||
"close_brand": "Đóng %(brand)s",
|
||||
"copy": "Sao chép",
|
||||
"cut": "Cắt",
|
||||
"delete": "Xóa",
|
||||
"edit": "Chỉnh sửa",
|
||||
"delete": "Xoá",
|
||||
"edit": "Sửa",
|
||||
"minimise": "Thu nhỏ",
|
||||
"paste": "Dán",
|
||||
"paste_match_style": "Dán và khớp kiểu",
|
||||
|
@ -19,15 +19,12 @@ import { TranslationKey as TKey } from "matrix-web-i18n";
|
||||
|
||||
import type Store from "electron-store";
|
||||
import type EN from "./i18n/strings/en_EN.json";
|
||||
import { loadJsonFile } from "./utils";
|
||||
|
||||
const FALLBACK_LOCALE = "en";
|
||||
|
||||
type TranslationKey = TKey<typeof EN>;
|
||||
|
||||
export function _td(text: TranslationKey): TranslationKey {
|
||||
return text;
|
||||
}
|
||||
|
||||
type SubstitutionValue = number | string;
|
||||
|
||||
interface Variables {
|
||||
@ -109,7 +106,7 @@ export class AppLocalization {
|
||||
public fetchTranslationJson(locale: string): Record<string, string> {
|
||||
try {
|
||||
console.log("Fetching translation json for locale: " + locale);
|
||||
return require(`./i18n/strings/${this.denormalize(locale)}.json`);
|
||||
return loadJsonFile(__dirname, "i18n", "strings", `${this.denormalize(locale)}.json`);
|
||||
} catch (e) {
|
||||
console.log(`Could not fetch translation json for locale: '${locale}'`, e);
|
||||
return {};
|
||||
|
@ -86,8 +86,13 @@ export function getProfileFromDeeplink(args: string[]): string | undefined {
|
||||
if (deeplinkUrl?.includes(SEARCH_PARAM)) {
|
||||
const parsedUrl = new URL(deeplinkUrl);
|
||||
if (parsedUrl.protocol === PROTOCOL) {
|
||||
const ssoID = parsedUrl.searchParams.get(SEARCH_PARAM)!;
|
||||
const store = readStore();
|
||||
let ssoID = parsedUrl.searchParams.get(SEARCH_PARAM);
|
||||
if (!ssoID) {
|
||||
// In OIDC, we must shuttle the value in the `state` param rather than `element-desktop-ssoid`
|
||||
// We encode it as a suffix like `:element-desktop-ssoid:XXYYZZ`
|
||||
ssoID = parsedUrl.searchParams.get("state")!.split(`:${SEARCH_PARAM}:`)[1];
|
||||
}
|
||||
console.log("Forwarding to profile: ", store[ssoID]);
|
||||
return store[ssoID];
|
||||
}
|
||||
|
@ -18,12 +18,16 @@ import path from "path";
|
||||
import { spawn } from "child_process";
|
||||
import { app } from "electron";
|
||||
|
||||
export function getSquirrelExecutable(): string {
|
||||
return path.resolve(path.dirname(process.execPath), "..", "Update.exe");
|
||||
}
|
||||
|
||||
function runUpdateExe(args: string[]): Promise<void> {
|
||||
// Invokes Squirrel's Update.exe which will do things for us like create shortcuts
|
||||
// Note that there's an Update.exe in the app-x.x.x directory and one in the parent
|
||||
// directory: we need to run the one in the parent directory, because it discovers
|
||||
// information about the app by inspecting the directory it's run from.
|
||||
const updateExe = path.resolve(path.dirname(process.execPath), "..", "Update.exe");
|
||||
const updateExe = getSquirrelExecutable();
|
||||
console.log(`Spawning '${updateExe}' with args '${args}'`);
|
||||
return new Promise((resolve) => {
|
||||
spawn(updateExe, args, {
|
||||
|
@ -72,7 +72,9 @@ export function create(config: IConfig): void {
|
||||
guid = uuidv5(`${app.getName()}-${app.getPath("userData")}`, getUuid());
|
||||
}
|
||||
|
||||
trayIcon = new Tray(defaultIcon, guid);
|
||||
// Passing guid=undefined on Windows will cause it to throw `Error: Invalid GUID format`
|
||||
// The type here is wrong, the param must be omitted, never undefined.
|
||||
trayIcon = guid ? new Tray(defaultIcon, guid) : new Tray(defaultIcon);
|
||||
trayIcon.setToolTip(config.brand);
|
||||
initApplicationMenu();
|
||||
trayIcon.on("click", toggleWin);
|
||||
|
@ -15,6 +15,9 @@ limitations under the License.
|
||||
*/
|
||||
|
||||
import { app, autoUpdater, ipcMain } from "electron";
|
||||
import fs from "node:fs/promises";
|
||||
|
||||
import { getSquirrelExecutable } from "./squirrelhooks";
|
||||
|
||||
const UPDATE_POLL_INTERVAL_MS = 60 * 60 * 1000;
|
||||
const INITIAL_UPDATE_DELAY_MS = 30 * 1000;
|
||||
@ -74,10 +77,12 @@ async function pollForUpdates(): Promise<void> {
|
||||
}
|
||||
}
|
||||
|
||||
export function start(updateBaseUrl: string): void {
|
||||
export async function start(updateBaseUrl: string): Promise<void> {
|
||||
if (!(await available(updateBaseUrl))) return;
|
||||
if (updateBaseUrl.slice(-1) !== "/") {
|
||||
updateBaseUrl = updateBaseUrl + "/";
|
||||
}
|
||||
|
||||
try {
|
||||
let url: string;
|
||||
let serverType: "json" | undefined;
|
||||
@ -93,7 +98,6 @@ export function start(updateBaseUrl: string): void {
|
||||
// Squirrel / electron only supports auto-update on these two platforms.
|
||||
// I'm not even going to try to guess which feed style they'd use if they
|
||||
// implemented it on Linux, or if it would be different again.
|
||||
console.log("Auto update not supported on this platform");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -116,6 +120,26 @@ export function start(updateBaseUrl: string): void {
|
||||
}
|
||||
}
|
||||
|
||||
async function available(updateBaseUrl?: string): Promise<boolean> {
|
||||
if (process.platform === "linux") {
|
||||
// Auto update is not supported on Linux
|
||||
console.log("Auto update not supported on this platform");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (process.platform === "win32") {
|
||||
try {
|
||||
await fs.access(getSquirrelExecutable());
|
||||
} catch {
|
||||
console.log("Squirrel not found, auto update not supported");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Otherwise we're either on macOS or Windows with Squirrel
|
||||
return !!updateBaseUrl;
|
||||
}
|
||||
|
||||
ipcMain.on("install_update", installUpdate);
|
||||
ipcMain.on("check_updates", pollForUpdates);
|
||||
|
||||
|
19
src/utils.ts
19
src/utils.ts
@ -15,6 +15,8 @@ limitations under the License.
|
||||
*/
|
||||
|
||||
import crypto from "crypto";
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
|
||||
export async function randomArray(size: number): Promise<string> {
|
||||
return new Promise((resolve, reject) => {
|
||||
@ -27,3 +29,20 @@ export async function randomArray(size: number): Promise<string> {
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
type JsonValue = null | string | number;
|
||||
type JsonArray = Array<JsonValue | JsonObject | JsonArray>;
|
||||
interface JsonObject {
|
||||
[key: string]: JsonObject | JsonArray | JsonValue;
|
||||
}
|
||||
type Json = JsonArray | JsonObject;
|
||||
|
||||
/**
|
||||
* Synchronously load a JSON file from the local filesystem.
|
||||
* Unlike `require`, will never execute any javascript in a loaded file.
|
||||
* @param paths - An array of path segments which will be joined using the system's path delimiter.
|
||||
*/
|
||||
export function loadJsonFile<T extends Json>(...paths: string[]): T {
|
||||
const file = fs.readFileSync(path.join(...paths), { encoding: "utf-8" });
|
||||
return JSON.parse(file);
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ import {
|
||||
import url from "url";
|
||||
import fs from "fs";
|
||||
import fetch from "node-fetch";
|
||||
import { pipeline } from "stream";
|
||||
import { pipeline } from "stream/promises";
|
||||
import path from "path";
|
||||
|
||||
import { _t } from "./language-helper";
|
||||
@ -165,7 +165,7 @@ function onLinkContextMenu(ev: Event, params: ContextMenuParams, webContents: We
|
||||
const resp = await fetch(url);
|
||||
if (!resp.ok) throw new Error(`unexpected response ${resp.statusText}`);
|
||||
if (!resp.body) throw new Error(`unexpected response has no body ${resp.statusText}`);
|
||||
pipeline(resp.body, fs.createWriteStream(filePath));
|
||||
await pipeline(resp.body, fs.createWriteStream(filePath));
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
|
@ -1,66 +0,0 @@
|
||||
/*
|
||||
Copyright 2022 The Matrix.org Foundation C.I.C.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
import * as os from "os";
|
||||
import * as fs from "fs";
|
||||
import * as path from "path";
|
||||
import "expect-playwright";
|
||||
import { _electron as electron } from "playwright";
|
||||
import { ElectronApplication, Page } from "playwright-core";
|
||||
|
||||
describe("App launch", () => {
|
||||
const artifactsPath = path.join(process.cwd(), "test_artifacts");
|
||||
if (!fs.existsSync(artifactsPath)) fs.mkdirSync(artifactsPath);
|
||||
|
||||
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), "element-desktop-tests"));
|
||||
console.log("Using temp profile directory: ", tmpDir);
|
||||
|
||||
let app: ElectronApplication;
|
||||
let window: Page;
|
||||
|
||||
beforeAll(async () => {
|
||||
const args = ["--profile-dir", tmpDir];
|
||||
|
||||
const executablePath = process.env["ELEMENT_DESKTOP_EXECUTABLE"];
|
||||
if (!executablePath) {
|
||||
// Unpackaged mode testing
|
||||
args.unshift("./lib/electron-main.js");
|
||||
}
|
||||
|
||||
app = await electron.launch({
|
||||
executablePath,
|
||||
args,
|
||||
recordVideo: {
|
||||
dir: artifactsPath,
|
||||
},
|
||||
});
|
||||
window = await app.firstWindow();
|
||||
}, 60000);
|
||||
|
||||
afterAll(async () => {
|
||||
await app?.close().catch((e) => {
|
||||
console.error(e);
|
||||
});
|
||||
fs.rmSync(tmpDir, { recursive: true });
|
||||
}, 60000);
|
||||
|
||||
it("should launch and render the welcome view successfully", async () => {
|
||||
await window.locator("#matrixchat").waitFor();
|
||||
await window.locator(".mx_Welcome").waitFor();
|
||||
await expect(window).toMatchURL("vector://vector/webapp/#/welcome");
|
||||
await window.screenshot({ path: path.join(artifactsPath, "welcome.png") });
|
||||
}, 60000);
|
||||
});
|
@ -1,16 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"resolveJsonModule": true,
|
||||
"moduleResolution": "node",
|
||||
"esModuleInterop": true,
|
||||
"target": "es2017",
|
||||
"module": "commonjs",
|
||||
"sourceMap": false,
|
||||
"strict": true,
|
||||
"lib": ["es2020", "dom"]
|
||||
},
|
||||
"include": ["./**/*.ts"],
|
||||
"ts-node": {
|
||||
"transpileOnly": true
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user