forked from CringeStudios/element-desktop
Compare commits
11 Commits
develop
...
t3chguy/se
Author | SHA1 | Date | |
---|---|---|---|
![]() |
9f00594ae3 | ||
![]() |
02c23e87b5 | ||
![]() |
3e7b10894a | ||
![]() |
be9214fe0b | ||
![]() |
2219ca9ca3 | ||
![]() |
e4dac2a210 | ||
![]() |
36446c108b | ||
![]() |
5ee122cdae | ||
![]() |
fde278d5b5 | ||
![]() |
08b61a7e3a | ||
![]() |
6ae09710c6 |
@ -1,74 +0,0 @@
|
||||
on: [push, workflow_dispatch]
|
||||
|
||||
jobs:
|
||||
build-element:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Download Cringe Studios configuration
|
||||
run: "mkdir cringe && wget -O cringe/config.json https://chat.cringe-studios.com/config.json"
|
||||
|
||||
- name: Install dependencies
|
||||
run: >
|
||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y &&
|
||||
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.2/install.sh | bash &&
|
||||
source ~/.profile &&
|
||||
\. "$HOME/.nvm/nvm.sh" &&
|
||||
nvm install 22 &&
|
||||
nvm use 22 &&
|
||||
curl --proto "=https" -L https://yarnpkg.com/latest.tar.gz | tar xvz && mv yarn-* /yarn && ln -s /yarn/bin/yarn /usr/bin/yarn &&
|
||||
dpkg --add-architecture i386 && apt-get update && apt-get install -y wine mono-devel rpm &&
|
||||
ln -s /usr/bin/wine /usr/bin/wine64
|
||||
|
||||
- name: Install packages
|
||||
run: >
|
||||
source ~/.profile &&
|
||||
\. "$HOME/.nvm/nvm.sh" &&
|
||||
nvm use 22 &&
|
||||
yarn add matrix-seshat &&
|
||||
yarn
|
||||
|
||||
- name: Fetch element
|
||||
run: >
|
||||
source ~/.profile &&
|
||||
\. "$HOME/.nvm/nvm.sh" &&
|
||||
nvm use 22 &&
|
||||
yarn run fetch --noverify --cfgdir cringe
|
||||
|
||||
- name: Build natives
|
||||
run: >
|
||||
source ~/.profile &&
|
||||
\. "$HOME/.nvm/nvm.sh" &&
|
||||
nvm use 22 &&
|
||||
SQLCIPHER_BUNDLED=1 yarn run build:native
|
||||
|
||||
- name: Build packages
|
||||
run: >
|
||||
source ~/.profile &&
|
||||
\. "$HOME/.nvm/nvm.sh" &&
|
||||
nvm use 22 &&
|
||||
yarn run build --linux rpm --linux deb --linux tar.xz --linux AppImage --win squirrel --publish never
|
||||
|
||||
- name: Copy artifacts to output directory
|
||||
run: >
|
||||
mkdir output &&
|
||||
cp dist/element-desktop*.rpm dist/Element*.AppImage dist/element-desktop*.deb dist/element-desktop*.tar.xz dist/squirrel-windows/Element*.exe output/
|
||||
|
||||
#- name: Publish artifacts
|
||||
# uses: christopherhx/gitea-upload-artifact@v4
|
||||
# with:
|
||||
# name: element-desktop
|
||||
# path: |
|
||||
# output/
|
||||
|
||||
- name: Publish artifacts via FTP
|
||||
uses: SamKirkland/FTP-Deploy-Action@v4.3.5
|
||||
with:
|
||||
server: ${{ secrets.FTP_SERVER }}
|
||||
username: ${{ secrets.FTP_USERNAME }}
|
||||
password: ${{ secrets.FTP_PASSWORD }}
|
||||
local-dir: ./output/
|
||||
server-dir: ./artifacts/sekur-chat/
|
||||
|
20
.github/workflows/build_and_deploy.yaml
vendored
20
.github/workflows/build_and_deploy.yaml
vendored
@ -62,7 +62,7 @@ jobs:
|
||||
name: Windows ${{ matrix.arch }}
|
||||
strategy:
|
||||
matrix:
|
||||
arch: [x64, arm64]
|
||||
arch: [ia32, x64, arm64]
|
||||
uses: ./.github/workflows/build_windows.yaml
|
||||
secrets: inherit
|
||||
with:
|
||||
@ -92,6 +92,7 @@ jobs:
|
||||
uses: ./.github/workflows/build_linux.yaml
|
||||
with:
|
||||
arch: ${{ matrix.arch }}
|
||||
config: ${{ needs.prepare.outputs.config }}
|
||||
sqlcipher: ${{ matrix.sqlcipher }}
|
||||
version: ${{ needs.prepare.outputs.nightly-version }}
|
||||
|
||||
@ -114,7 +115,7 @@ jobs:
|
||||
set -x
|
||||
|
||||
# Windows
|
||||
for arch in x64 arm64
|
||||
for arch in x64 ia32 arm64
|
||||
do
|
||||
if [ -d "win-$arch" ]; then
|
||||
mkdir -p packages.element.io/{install,update}/win32/$arch
|
||||
@ -149,7 +150,7 @@ jobs:
|
||||
set -x
|
||||
|
||||
# Windows
|
||||
for arch in x64 arm64
|
||||
for arch in x64 ia32 arm64
|
||||
do
|
||||
[ -d "win-$arch" ] && mv packages.element.io/install/win32/$arch/{*,"Element Nightly Setup"}.exe
|
||||
done
|
||||
@ -167,7 +168,7 @@ jobs:
|
||||
set -x
|
||||
|
||||
# Windows
|
||||
for arch in x64 arm64
|
||||
for arch in x64 ia32 arm64
|
||||
do
|
||||
if [ -d "win-$arch" ]; then
|
||||
pushd packages.element.io/install/win32/$arch
|
||||
@ -202,12 +203,19 @@ jobs:
|
||||
name: packages.element.io
|
||||
path: packages.element.io
|
||||
|
||||
# Checksum algorithm specified as per https://developers.cloudflare.com/r2/examples/aws/aws-cli/
|
||||
# Workaround for https://www.cloudflarestatus.com/incidents/t5nrjmpxc1cj
|
||||
- uses: unfor19/install-aws-cli-action@e8b481e524a99f37fbd39fdc1dcb3341ab091367 # v1
|
||||
if: needs.prepare.outputs.deploy == 'true'
|
||||
with:
|
||||
version: 2.22.35
|
||||
verbose: false
|
||||
arch: amd64
|
||||
|
||||
- name: Deploy artifacts
|
||||
if: needs.prepare.outputs.deploy == 'true'
|
||||
run: |
|
||||
set -x
|
||||
aws s3 cp --recursive packages.element.io/ s3://$R2_BUCKET/$DEPLOYMENT_DIR --endpoint-url $R2_URL --region auto --checksum-algorithm CRC32
|
||||
aws s3 cp --recursive packages.element.io/ s3://$R2_BUCKET/$DEPLOYMENT_DIR --endpoint-url $R2_URL --region auto
|
||||
env:
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.CF_R2_ACCESS_KEY_ID }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.CF_R2_TOKEN }}
|
||||
|
2
.github/workflows/build_and_test.yaml
vendored
2
.github/workflows/build_and_test.yaml
vendored
@ -35,6 +35,7 @@ jobs:
|
||||
sqlcipher: [system, static]
|
||||
arch: [amd64, arm64]
|
||||
with:
|
||||
config: ${{ github.event.pull_request.base.ref == 'develop' && 'element.io/nightly' || 'element.io/release' }}
|
||||
sqlcipher: ${{ matrix.sqlcipher }}
|
||||
arch: ${{ matrix.arch }}
|
||||
|
||||
@ -49,7 +50,6 @@ jobs:
|
||||
- linux
|
||||
- windows
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- name: macOS Universal
|
||||
|
30
.github/workflows/build_linux.yaml
vendored
30
.github/workflows/build_linux.yaml
vendored
@ -8,6 +8,10 @@ on:
|
||||
type: string
|
||||
required: true
|
||||
description: "The architecture to build for, one of 'amd64' | 'arm64'"
|
||||
config:
|
||||
type: string
|
||||
required: true
|
||||
description: "The config directory to use"
|
||||
version:
|
||||
type: string
|
||||
required: false
|
||||
@ -62,14 +66,6 @@ jobs:
|
||||
with:
|
||||
name: webapp
|
||||
|
||||
- name: Cache .hak
|
||||
id: cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
key: ${{ runner.os }}-${{ github.ref_name }}-${{ inputs.sqlcipher }}-${{ inputs.arch }}-${{ hashFiles('hakHash', 'electronVersion', 'dockerbuild/*') }}
|
||||
path: |
|
||||
./.hak
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: .node-version
|
||||
@ -84,14 +80,14 @@ jobs:
|
||||
- name: "Get modified files"
|
||||
id: changed_files
|
||||
if: steps.cache.outputs.cache-hit != 'true' && github.event_name == 'pull_request'
|
||||
uses: tj-actions/changed-files@823fcebdb31bb35fdf2229d9f769b400309430d0 # v46
|
||||
uses: tj-actions/changed-files@dcc7a0cba800f454d79fff4b993e8c3555bcc0a8 # v45
|
||||
with:
|
||||
files: |
|
||||
dockerbuild/**
|
||||
|
||||
# This allows contributors to test changes to the dockerbuild image within a pull request
|
||||
- name: Build docker image
|
||||
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6
|
||||
uses: docker/build-push-action@ca877d9245402d1537745e0e356eab47c3520991 # v6
|
||||
if: steps.changed_files.outputs.any_modified == 'true'
|
||||
with:
|
||||
file: dockerbuild/Dockerfile
|
||||
@ -99,23 +95,11 @@ jobs:
|
||||
platforms: linux/${{ inputs.arch }}
|
||||
tags: ${{ env.HAK_DOCKER_IMAGE }}
|
||||
|
||||
- name: Build Natives
|
||||
if: steps.cache.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
docker run \
|
||||
-v ${{ github.workspace }}:/work -w /work \
|
||||
-e SQLCIPHER_BUNDLED \
|
||||
$HAK_DOCKER_IMAGE \
|
||||
yarn build:native
|
||||
|
||||
- name: Fix permissions on .hak
|
||||
run: sudo chown -R $USER:$USER .hak
|
||||
|
||||
- name: Check native libraries in hak dependencies
|
||||
run: |
|
||||
shopt -s globstar
|
||||
|
||||
for filename in ./.hak/hakModules/**/*.node; do
|
||||
for filename in ./node_modules/**/*.node; do
|
||||
./scripts/glibc-check.sh $filename
|
||||
done
|
||||
|
||||
|
18
.github/workflows/build_macos.yaml
vendored
18
.github/workflows/build_macos.yaml
vendored
@ -39,14 +39,6 @@ jobs:
|
||||
with:
|
||||
name: webapp
|
||||
|
||||
- name: Cache .hak
|
||||
id: cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
key: ${{ runner.os }}-${{ hashFiles('hakHash', 'electronVersion') }}
|
||||
path: |
|
||||
./.hak
|
||||
|
||||
- name: Install Rust
|
||||
if: steps.cache.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
@ -58,7 +50,7 @@ jobs:
|
||||
# M1 macos-14 comes without Python preinstalled
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.13"
|
||||
python-version: "3.12"
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
@ -68,13 +60,11 @@ jobs:
|
||||
- name: Install Deps
|
||||
run: "yarn install --frozen-lockfile"
|
||||
|
||||
# Python 3.12 drops distutils which keytar relies on
|
||||
- name: Install setuptools
|
||||
run: pip3 install setuptools
|
||||
|
||||
- name: Build Natives
|
||||
if: steps.cache.outputs.cache-hit != 'true'
|
||||
run: yarn build:native:universal
|
||||
run: |
|
||||
# Python 3.12 drops distutils which keytar relies on
|
||||
pip3 install setuptools
|
||||
|
||||
# We split these because electron-builder gets upset if we set CSC_LINK even to an empty string
|
||||
- name: "[Signed] Build App"
|
||||
|
11
.github/workflows/build_prepare.yaml
vendored
11
.github/workflows/build_prepare.yaml
vendored
@ -34,9 +34,12 @@ 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: "Whether the build should be deployed to production"
|
||||
description: "The relative path to the config file for this run"
|
||||
value: ${{ inputs.deploy }}
|
||||
permissions: {}
|
||||
jobs:
|
||||
@ -80,7 +83,7 @@ jobs:
|
||||
aws s3 cp s3://$R2_BUCKET/debian/dists/default/main/binary-amd64/Packages - --endpoint-url $R2_URL --region auto | grep "Package: element-nightly" -A 50 | grep Version -m1 | sed -n 's/Version: //p' >> VERSIONS
|
||||
aws s3 cp s3://$R2_BUCKET/debian/dists/default/main/binary-arm64/Packages - --endpoint-url $R2_URL --region auto | grep "Package: element-nightly" -A 50 | grep Version -m1 | sed -n 's/Version: //p' >> VERSIONS
|
||||
aws s3 cp s3://$R2_BUCKET/nightly/update/win32/x64/RELEASES - --endpoint-url $R2_URL --region auto | awk '{print $2}' | cut -d "-" -f 5 | cut -c 8- >> VERSIONS
|
||||
aws s3 cp s3://$R2_BUCKET/nightly/update/win32/arm64/RELEASES - --endpoint-url $R2_URL --region auto | awk '{print $2}' | cut -d "-" -f 5 | cut -c 8- >> VERSIONS
|
||||
aws s3 cp s3://$R2_BUCKET/nightly/update/win32/ia32/RELEASES - --endpoint-url $R2_URL --region auto | awk '{print $2}' | cut -d "-" -f 5 | cut -c 8- >> VERSIONS
|
||||
|
||||
# Pick the greatest one
|
||||
VERSION=$(cat VERSIONS | sort -uf | tail -n1)
|
||||
@ -90,6 +93,8 @@ jobs:
|
||||
env:
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.CF_R2_ACCESS_KEY_ID }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.CF_R2_TOKEN }}
|
||||
# Workaround for https://www.cloudflarestatus.com/incidents/t5nrjmpxc1cj
|
||||
AWS_REQUEST_CHECKSUM_CALCULATION: when_required
|
||||
R2_BUCKET: ${{ vars.R2_BUCKET }}
|
||||
R2_URL: ${{ vars.CF_R2_S3_API }}
|
||||
|
||||
|
31
.github/workflows/build_windows.yaml
vendored
31
.github/workflows/build_windows.yaml
vendored
@ -56,8 +56,7 @@ jobs:
|
||||
"ia32": {
|
||||
"target": "i686-pc-windows-msvc",
|
||||
"build-args": "--ia32",
|
||||
"arch": "x86",
|
||||
"extra_config": "{\"user_notice\": {\"title\": \"Your desktop environment is unsupported.\",\"description\": \"Support for 32-bit Windows installations has ended. Transition to the web or mobile app for continued access.\"}}"
|
||||
"arch": "x86"
|
||||
}
|
||||
}
|
||||
|
||||
@ -67,14 +66,6 @@ jobs:
|
||||
with:
|
||||
name: webapp
|
||||
|
||||
- name: Cache .hak
|
||||
id: cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
key: ${{ runner.os }}-${{ inputs.arch }}-${{ hashFiles('hakHash', 'electronVersion') }}
|
||||
path: |
|
||||
./.hak
|
||||
|
||||
# ActiveTCL package on choco is from 2015,
|
||||
# this one is newer but includes more than we need
|
||||
- name: Choco install tclsh
|
||||
@ -106,20 +97,6 @@ jobs:
|
||||
- name: Install Deps
|
||||
run: "yarn install --frozen-lockfile"
|
||||
|
||||
- name: Insert config snippet
|
||||
if: steps.config.outputs.extra_config != ''
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir config-edit
|
||||
yarn asar extract webapp.asar config-edit
|
||||
cd config-edit
|
||||
mv config.json old-config.json
|
||||
echo '${{ steps.config.outputs.extra_config }}' | jq -s '.[0] * .[1]' old-config.json - > config.json
|
||||
rm old-config.json
|
||||
cd ..
|
||||
rm webapp.asar
|
||||
yarn asar pack config-edit/ webapp.asar
|
||||
|
||||
- name: Set up sqlcipher macros
|
||||
if: steps.cache.outputs.cache-hit != 'true' && contains(inputs.arch, 'arm')
|
||||
shell: pwsh
|
||||
@ -132,12 +109,6 @@ jobs:
|
||||
with:
|
||||
arch: ${{ steps.config.outputs.arch || inputs.arch }}
|
||||
|
||||
- name: Build Natives
|
||||
if: steps.cache.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
refreshenv
|
||||
yarn build:native --target ${{ steps.config.outputs.target }}
|
||||
|
||||
- name: Install and configure eSigner CKA
|
||||
run: |
|
||||
Set-StrictMode -Version 'Latest'
|
||||
|
12
.github/workflows/dockerbuild.yaml
vendored
12
.github/workflows/dockerbuild.yaml
vendored
@ -22,15 +22,15 @@ jobs:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3
|
||||
uses: docker/setup-qemu-action@4574d27a4764455b42196d70a065bc6853246a25 # v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3
|
||||
uses: docker/setup-buildx-action@f7ce87c1d6bead3e36075b2ce75da1f6cc28aaca # v3
|
||||
with:
|
||||
install: true
|
||||
|
||||
- name: Build test image
|
||||
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6
|
||||
uses: docker/build-push-action@ca877d9245402d1537745e0e356eab47c3520991 # v6
|
||||
with:
|
||||
file: dockerbuild/Dockerfile
|
||||
push: false
|
||||
@ -42,7 +42,7 @@ jobs:
|
||||
run: docker run -v $PWD:/project element-desktop-dockerbuild yarn install
|
||||
|
||||
- name: Log in to the Container registry
|
||||
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772
|
||||
uses: docker/login-action@327cd5a69de6c009b9ce71bce8395f28e651bf99
|
||||
if: github.event_name != 'pull_request'
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
@ -52,7 +52,7 @@ jobs:
|
||||
- name: Extract metadata for Docker
|
||||
id: meta
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 # v5
|
||||
uses: docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96 # v5
|
||||
with:
|
||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||
tags: |
|
||||
@ -61,7 +61,7 @@ jobs:
|
||||
|
||||
- name: Build and push Docker image
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6
|
||||
uses: docker/build-push-action@ca877d9245402d1537745e0e356eab47c3520991 # v6
|
||||
with:
|
||||
file: dockerbuild/Dockerfile
|
||||
push: true
|
||||
|
109
CHANGELOG.md
109
CHANGELOG.md
@ -1,112 +1,3 @@
|
||||
Changes in [1.11.97](https://github.com/element-hq/element-desktop/releases/tag/v1.11.97) (2025-04-08)
|
||||
======================================================================================================
|
||||
## ✨ Features
|
||||
|
||||
* New room list: reduce padding between avatar and room list border ([#29634](https://github.com/element-hq/element-web/pull/29634)). Contributed by @florianduros.
|
||||
* Bundle Element Call with Element Web packages ([#29309](https://github.com/element-hq/element-web/pull/29309)). Contributed by @t3chguy.
|
||||
* Hide an event notification if it is redacted ([#29605](https://github.com/element-hq/element-web/pull/29605)). Contributed by @Half-Shot.
|
||||
* Docker: Use nginx-unprivileged as base image ([#29353](https://github.com/element-hq/element-web/pull/29353)). Contributed by @AndrewFerr.
|
||||
* Switch away from nesting React trees and mangling the DOM ([#29586](https://github.com/element-hq/element-web/pull/29586)). Contributed by @t3chguy.
|
||||
* New room list: add notification decoration ([#29552](https://github.com/element-hq/element-web/pull/29552)). Contributed by @florianduros.
|
||||
* RoomListStore: Unread filter should match rooms that were marked as unread ([#29580](https://github.com/element-hq/element-web/pull/29580)). Contributed by @MidhunSureshR.
|
||||
* Add support for hiding videos ([#29496](https://github.com/element-hq/element-web/pull/29496)). Contributed by @Half-Shot.
|
||||
* Use an outline icon for the report room button ([#29573](https://github.com/element-hq/element-web/pull/29573)). Contributed by @robintown.
|
||||
* Generate/load pickle key on SSO ([#29568](https://github.com/element-hq/element-web/pull/29568)). Contributed by @Jujure.
|
||||
* Add report room dialog button/dialog. ([#29513](https://github.com/element-hq/element-web/pull/29513)). Contributed by @Half-Shot.
|
||||
* RoomListViewModel: Make the active room sticky in the list ([#29551](https://github.com/element-hq/element-web/pull/29551)). Contributed by @MidhunSureshR.
|
||||
* Replace checkboxes with Compound checkboxes, and appropriately label each checkbox. ([#29363](https://github.com/element-hq/element-web/pull/29363)). Contributed by @Half-Shot.
|
||||
* New room list: add selection decoration ([#29531](https://github.com/element-hq/element-web/pull/29531)). Contributed by @florianduros.
|
||||
* Simplified Sliding Sync ([#28515](https://github.com/element-hq/element-web/pull/28515)). Contributed by @dbkr.
|
||||
* Add ability to hide images after clicking "show image" ([#29467](https://github.com/element-hq/element-web/pull/29467)). Contributed by @Half-Shot.
|
||||
|
||||
## 🐛 Bug Fixes
|
||||
|
||||
* Fix scroll issues in memberlist ([#29392](https://github.com/element-hq/element-web/pull/29392)). Contributed by @MidhunSureshR.
|
||||
* Ensure clicks on spoilers do not get handled by the hidden content ([#29618](https://github.com/element-hq/element-web/pull/29618)). Contributed by @t3chguy.
|
||||
* New room list: add cursor pointer on room list item ([#29627](https://github.com/element-hq/element-web/pull/29627)). Contributed by @florianduros.
|
||||
* Fix missing ambiguous url tooltips on Element Desktop ([#29619](https://github.com/element-hq/element-web/pull/29619)). Contributed by @t3chguy.
|
||||
* New room list: fix spacing and padding ([#29607](https://github.com/element-hq/element-web/pull/29607)). Contributed by @florianduros.
|
||||
* Make fetchdep check out matching branch name ([#29601](https://github.com/element-hq/element-web/pull/29601)). Contributed by @dbkr.
|
||||
* Fix MFileBody fileName not considering `filename` ([#29589](https://github.com/element-hq/element-web/pull/29589)). Contributed by @t3chguy.
|
||||
* Fix token expiry racing with login causing wrong error to be shown ([#29566](https://github.com/element-hq/element-web/pull/29566)). Contributed by @t3chguy.
|
||||
* Fix bug which caused startup to hang if the clock was wound back since a previous session ([#29558](https://github.com/element-hq/element-web/pull/29558)). Contributed by @richvdh.
|
||||
* RoomListViewModel: Reset any primary filter on secondary filter change ([#29562](https://github.com/element-hq/element-web/pull/29562)). Contributed by @MidhunSureshR.
|
||||
* RoomListStore: Unread filter should only filter rooms having unread counts ([#29555](https://github.com/element-hq/element-web/pull/29555)). Contributed by @MidhunSureshR.
|
||||
* In force-verify mode, prevent bypassing by cancelling device verification ([#29487](https://github.com/element-hq/element-web/pull/29487)). Contributed by @andybalaam.
|
||||
* Add title attribute to user identifier ([#29547](https://github.com/element-hq/element-web/pull/29547)). Contributed by @arpitbatra123.
|
||||
|
||||
|
||||
|
||||
Changes in [1.11.96](https://github.com/element-hq/element-desktop/releases/tag/v1.11.96) (2025-03-25)
|
||||
======================================================================================================
|
||||
## ✨ Features
|
||||
|
||||
* RoomListViewModel: Track the index of the active room in the list ([#29519](https://github.com/element-hq/element-web/pull/29519)). Contributed by @MidhunSureshR.
|
||||
* New room list: add empty state ([#29512](https://github.com/element-hq/element-web/pull/29512)). Contributed by @florianduros.
|
||||
* Implement `MessagePreviewViewModel` ([#29514](https://github.com/element-hq/element-web/pull/29514)). Contributed by @MidhunSureshR.
|
||||
* RoomListViewModel: Add functionality to toggle message preview setting ([#29511](https://github.com/element-hq/element-web/pull/29511)). Contributed by @MidhunSureshR.
|
||||
* New room list: add more options menu on room list item ([#29445](https://github.com/element-hq/element-web/pull/29445)). Contributed by @florianduros.
|
||||
* RoomListViewModel: Provide a way to resort the room list and track the active sort method ([#29499](https://github.com/element-hq/element-web/pull/29499)). Contributed by @MidhunSureshR.
|
||||
* Change \*All rooms\* meta space name to \*All Chats\* ([#29498](https://github.com/element-hq/element-web/pull/29498)). Contributed by @florianduros.
|
||||
* Add setting to hide avatars of rooms you have been invited to. ([#29497](https://github.com/element-hq/element-web/pull/29497)). Contributed by @Half-Shot.
|
||||
* Room List Store: Save preferred sorting algorithm and use that on app launch ([#29493](https://github.com/element-hq/element-web/pull/29493)). Contributed by @MidhunSureshR.
|
||||
* Add key storage toggle to Encryption settings ([#29310](https://github.com/element-hq/element-web/pull/29310)). Contributed by @dbkr.
|
||||
* New room list: add primary filters ([#29481](https://github.com/element-hq/element-web/pull/29481)). Contributed by @florianduros.
|
||||
* Implement MSC4142: Remove unintentional intentional mentions in replies ([#28209](https://github.com/element-hq/element-web/pull/28209)). Contributed by @tulir.
|
||||
* White background for 'They do not match' button ([#29470](https://github.com/element-hq/element-web/pull/29470)). Contributed by @andybalaam.
|
||||
* RoomListViewModel: Support secondary filters in the view model ([#29465](https://github.com/element-hq/element-web/pull/29465)). Contributed by @MidhunSureshR.
|
||||
* RoomListViewModel: Support primary filters in the view model ([#29454](https://github.com/element-hq/element-web/pull/29454)). Contributed by @MidhunSureshR.
|
||||
* Room List Store: Implement secondary filters ([#29458](https://github.com/element-hq/element-web/pull/29458)). Contributed by @MidhunSureshR.
|
||||
* Room List Store: Implement rest of the primary filters ([#29444](https://github.com/element-hq/element-web/pull/29444)). Contributed by @MidhunSureshR.
|
||||
* Room List Store: Support filters by implementing just the favourite filter ([#29433](https://github.com/element-hq/element-web/pull/29433)). Contributed by @MidhunSureshR.
|
||||
* Move toggle switch for integration manager for a11y ([#29436](https://github.com/element-hq/element-web/pull/29436)). Contributed by @Half-Shot.
|
||||
* New room list: basic flat list ([#29368](https://github.com/element-hq/element-web/pull/29368)). Contributed by @florianduros.
|
||||
* Improve rageshake upload experience by providing useful error information ([#29378](https://github.com/element-hq/element-web/pull/29378)). Contributed by @Half-Shot.
|
||||
* Add more functionality to the room list vm ([#29402](https://github.com/element-hq/element-web/pull/29402)). Contributed by @MidhunSureshR.
|
||||
|
||||
## 🐛 Bug Fixes
|
||||
|
||||
* Fix `--no-update` command line flag ([#2210](https://github.com/element-hq/element-desktop/pull/2210)). Contributed by @t3chguy.
|
||||
* New room list: fix compose menu action in space ([#29500](https://github.com/element-hq/element-web/pull/29500)). Contributed by @florianduros.
|
||||
* Change ToggleHiddenEventVisibility \& GoToHome KeyBindingActions ([#29374](https://github.com/element-hq/element-web/pull/29374)). Contributed by @gy-mate.
|
||||
* Fix Docker Healthcheck ([#29471](https://github.com/element-hq/element-web/pull/29471)). Contributed by @benbz.
|
||||
* Room List Store: Fetch rooms after space store is ready + attach store to window ([#29453](https://github.com/element-hq/element-web/pull/29453)). Contributed by @MidhunSureshR.
|
||||
* Room List Store: Fix bug where left rooms appear in room list ([#29452](https://github.com/element-hq/element-web/pull/29452)). Contributed by @MidhunSureshR.
|
||||
* Add space to the bottom of the room summary actions below leave room ([#29270](https://github.com/element-hq/element-web/pull/29270)). Contributed by @langleyd.
|
||||
* Show error screens in group calls ([#29254](https://github.com/element-hq/element-web/pull/29254)). Contributed by @robintown.
|
||||
* Prevent user from accidentally triggering multiple identity resets ([#29388](https://github.com/element-hq/element-web/pull/29388)). Contributed by @uhoreg.
|
||||
* Remove buggy tooltip on room intro \& homepage ([#29406](https://github.com/element-hq/element-web/pull/29406)). Contributed by @t3chguy.
|
||||
|
||||
|
||||
|
||||
Changes in [1.11.95](https://github.com/element-hq/element-desktop/releases/tag/v1.11.95) (2025-03-11)
|
||||
======================================================================================================
|
||||
## ✨ Features
|
||||
|
||||
* Switch to shiftkey/node-keytar as it has NAPI 10 updates ([#2172](https://github.com/element-hq/element-desktop/pull/2172)). Contributed by @t3chguy.
|
||||
* Add support for Windows arm64 ([#624](https://github.com/element-hq/element-desktop/pull/624)). Contributed by @t3chguy.
|
||||
* Room List Store: Filter rooms by active space ([#29399](https://github.com/element-hq/element-web/pull/29399)). Contributed by @MidhunSureshR.
|
||||
* Room List - Update the room list store on actions from the dispatcher ([#29397](https://github.com/element-hq/element-web/pull/29397)). Contributed by @MidhunSureshR.
|
||||
* Room List - Implement a minimal view model ([#29357](https://github.com/element-hq/element-web/pull/29357)). Contributed by @MidhunSureshR.
|
||||
* New room list: add space menu in room header ([#29352](https://github.com/element-hq/element-web/pull/29352)). Contributed by @florianduros.
|
||||
* Room List - Store sorted rooms in skip list ([#29345](https://github.com/element-hq/element-web/pull/29345)). Contributed by @MidhunSureshR.
|
||||
* New room list: add dial to search section ([#29359](https://github.com/element-hq/element-web/pull/29359)). Contributed by @florianduros.
|
||||
* New room list: add compose menu for spaces in header ([#29347](https://github.com/element-hq/element-web/pull/29347)). Contributed by @florianduros.
|
||||
* Use EditInPlace control for Identity Server picker to improve a11y ([#29280](https://github.com/element-hq/element-web/pull/29280)). Contributed by @Half-Shot.
|
||||
* First step to add header to new room list ([#29320](https://github.com/element-hq/element-web/pull/29320)). Contributed by @florianduros.
|
||||
* Add Windows 64-bit arm link and remove 32-bit link on compatibility page ([#29312](https://github.com/element-hq/element-web/pull/29312)). Contributed by @t3chguy.
|
||||
* Honour the backup disable flag from Element X ([#29290](https://github.com/element-hq/element-web/pull/29290)). Contributed by @dbkr.
|
||||
|
||||
## 🐛 Bug Fixes
|
||||
|
||||
* Fix edited code block width ([#29394](https://github.com/element-hq/element-web/pull/29394)). Contributed by @florianduros.
|
||||
* new room list: keep space name in one line in header ([#29369](https://github.com/element-hq/element-web/pull/29369)). Contributed by @florianduros.
|
||||
* Dismiss "Key storage out of sync" toast when secrets received ([#29348](https://github.com/element-hq/element-web/pull/29348)). Contributed by @richvdh.
|
||||
* Minor CSS fixes for the new room list ([#29334](https://github.com/element-hq/element-web/pull/29334)). Contributed by @florianduros.
|
||||
* Add padding to room header icon ([#29271](https://github.com/element-hq/element-web/pull/29271)). Contributed by @langleyd.
|
||||
|
||||
|
||||
|
||||
Changes in [1.11.94](https://github.com/element-hq/element-desktop/releases/tag/v1.11.94) (2025-02-27)
|
||||
======================================================================================================
|
||||
* No changes
|
||||
|
@ -14,7 +14,6 @@ RUN apt-get -qq update && apt-get -y -qq dist-upgrade && \
|
||||
# Used by seshat (when not SQLCIPHER_STATIC) \
|
||||
libsqlcipher-dev && \
|
||||
apt-get purge -y --auto-remove && rm -rf /var/lib/apt/lists/*
|
||||
RUN dpkg --add-architecture i386 && apt-get update && apt-get install -y wine mono-devel rpm
|
||||
RUN ln -s /usr/bin/python3 /usr/bin/python & ln -s /usr/bin/pip3 /usr/bin/pip
|
||||
|
||||
ENV DEBUG_COLORS=true
|
||||
|
@ -93,14 +93,7 @@ const config: Omit<Writable<Configuration>, "electronFuses"> & {
|
||||
afterPack: async (context: AfterPackContext) => {
|
||||
await injectAsarIntegrity(context);
|
||||
},
|
||||
files: [
|
||||
"package.json",
|
||||
{
|
||||
from: ".hak/hakModules",
|
||||
to: "node_modules",
|
||||
},
|
||||
"lib/**",
|
||||
],
|
||||
files: ["package.json", "lib/**"],
|
||||
extraResources: [
|
||||
{
|
||||
from: "res/img",
|
||||
|
@ -1,34 +0,0 @@
|
||||
/*
|
||||
Copyright 2024 New Vector Ltd.
|
||||
Copyright 2020, 2021 The Matrix.org Foundation C.I.C.
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
|
||||
Please see LICENSE files in the repository root for full details.
|
||||
*/
|
||||
|
||||
import type HakEnv from "../../scripts/hak/hakEnv.js";
|
||||
import type { DependencyInfo } from "../../scripts/hak/dep.js";
|
||||
|
||||
export default async function (hakEnv: HakEnv, moduleInfo: DependencyInfo): Promise<void> {
|
||||
const env = hakEnv.makeGypEnv();
|
||||
|
||||
if (!hakEnv.isHost()) {
|
||||
env.CARGO_BUILD_TARGET = hakEnv.getTargetId();
|
||||
}
|
||||
|
||||
console.log("Running yarn install");
|
||||
await hakEnv.spawn("yarn", ["install"], {
|
||||
cwd: moduleInfo.moduleBuildDir,
|
||||
env,
|
||||
shell: true,
|
||||
});
|
||||
|
||||
const buildTarget = hakEnv.wantsStaticSqlCipher() ? "build-bundled" : "build";
|
||||
|
||||
console.log("Running yarn build");
|
||||
await hakEnv.spawn("yarn", ["run", buildTarget], {
|
||||
cwd: moduleInfo.moduleBuildDir,
|
||||
env,
|
||||
shell: true,
|
||||
});
|
||||
}
|
@ -1,55 +0,0 @@
|
||||
/*
|
||||
Copyright 2024 New Vector Ltd.
|
||||
Copyright 2020, 2021 The Matrix.org Foundation C.I.C.
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
|
||||
Please see LICENSE files in the repository root for full details.
|
||||
*/
|
||||
|
||||
import childProcess from "node:child_process";
|
||||
import fsProm from "node:fs/promises";
|
||||
|
||||
import type HakEnv from "../../scripts/hak/hakEnv.js";
|
||||
import type { Tool } from "../../scripts/hak/hakEnv.js";
|
||||
import type { DependencyInfo } from "../../scripts/hak/dep.js";
|
||||
|
||||
export default async function (hakEnv: HakEnv, moduleInfo: DependencyInfo): Promise<void> {
|
||||
const tools: Tool[] = [
|
||||
["rustc", "--version"],
|
||||
["python", "--version"], // node-gyp uses python for reasons beyond comprehension
|
||||
];
|
||||
if (hakEnv.isWin()) {
|
||||
tools.push(["perl", "--version"]); // for openssl configure
|
||||
tools.push(["nasm", "-v"]); // for openssl building
|
||||
tools.push(["patch", "--version"]); // to patch sqlcipher Makefile.msc
|
||||
tools.push(["nmake", "/?"]);
|
||||
} else {
|
||||
tools.push(["make", "--version"]);
|
||||
}
|
||||
await hakEnv.checkTools(tools);
|
||||
|
||||
// Ensure Rust target exists (nb. we avoid depending on rustup)
|
||||
await new Promise((resolve, reject) => {
|
||||
const rustc = childProcess.execFile(
|
||||
"rustc",
|
||||
["--target", hakEnv.getTargetId(), "--emit=obj", "-o", "tmp", "-"],
|
||||
(err, out) => {
|
||||
if (err) {
|
||||
reject(
|
||||
"rustc can't build for target " +
|
||||
hakEnv.getTargetId() +
|
||||
": ensure target is installed via `rustup target add " +
|
||||
hakEnv.getTargetId() +
|
||||
"` " +
|
||||
"or your package manager if not using `rustup`",
|
||||
);
|
||||
}
|
||||
fsProm.unlink("tmp").then(resolve);
|
||||
},
|
||||
);
|
||||
rustc.stdin!.write("fn main() {}");
|
||||
rustc.stdout!.pipe(process.stdout);
|
||||
rustc.stderr!.pipe(process.stderr);
|
||||
rustc.stdin!.end();
|
||||
});
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
{
|
||||
"scripts": {
|
||||
"check": "check.ts",
|
||||
"build": "build.ts"
|
||||
},
|
||||
"copy": "index.node"
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"moduleResolution": "node",
|
||||
"esModuleInterop": true,
|
||||
"target": "es2022",
|
||||
"sourceMap": false,
|
||||
"strict": true,
|
||||
"lib": ["es2022"]
|
||||
},
|
||||
"include": ["../scripts/@types/*.d.ts", "./**/*.ts"]
|
||||
}
|
1
knip.ts
1
knip.ts
@ -5,6 +5,7 @@ export default {
|
||||
project: ["**/*.{js,ts}"],
|
||||
ignoreDependencies: [
|
||||
// Brought in via hak scripts
|
||||
"keytar-forked",
|
||||
"matrix-seshat",
|
||||
// Required for `action-validator`
|
||||
"@action-validator/*",
|
||||
|
36
package.json
36
package.json
@ -3,7 +3,7 @@
|
||||
"productName": "Element",
|
||||
"main": "lib/electron-main.js",
|
||||
"exports": "./lib/electron-main.js",
|
||||
"version": "1.11.97",
|
||||
"version": "1.11.94",
|
||||
"description": "Element: the future of secure communication",
|
||||
"author": "Element",
|
||||
"homepage": "https://element.io",
|
||||
@ -27,17 +27,14 @@
|
||||
"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": "eslint --max-warnings 0 src hak playwright scripts && prettier --check .",
|
||||
"lint:js-fix": "eslint --fix --max-warnings 0 src hak playwright scripts && prettier --log-level=warn --write .",
|
||||
"lint:types": "yarn lint:types:src && yarn lint:types:test && yarn lint:types:scripts && yarn lint:types:hak",
|
||||
"lint:js": "eslint --max-warnings 0 src playwright scripts && prettier --check .",
|
||||
"lint:js-fix": "eslint --fix --max-warnings 0 src playwright scripts && prettier --log-level=warn --write .",
|
||||
"lint:types": "yarn lint:types:src && yarn lint:types:test && yarn lint:types:scripts",
|
||||
"lint:types:src": "tsc --noEmit",
|
||||
"lint:types:test": "tsc --noEmit -p playwright/tsconfig.json",
|
||||
"lint:types:scripts": "tsc --noEmit -p scripts/tsconfig.json",
|
||||
"lint:types:hak": "tsc --noEmit -p hak/tsconfig.json",
|
||||
"lint:workflows": "find .github/workflows -type f \\( -iname '*.yaml' -o -iname '*.yml' \\) | xargs -I {} sh -c 'echo \"Linting {}\"; action-validator \"{}\"'",
|
||||
"lint:knip": "knip",
|
||||
"build:native": "yarn run hak",
|
||||
"build:native:universal": "yarn run hak --target x86_64-apple-darwin fetchandbuild && yarn run hak --target aarch64-apple-darwin fetchandbuild && yarn run hak --target x86_64-apple-darwin --target aarch64-apple-darwin copyandlink",
|
||||
"build:32": "yarn run build:ts && yarn run build:res && electron-builder --ia32",
|
||||
"build:64": "yarn run build:ts && yarn run build:res && electron-builder --x64",
|
||||
"build:universal": "yarn run build:ts && yarn run build:res && electron-builder --universal",
|
||||
@ -45,7 +42,6 @@
|
||||
"build:ts": "tsc",
|
||||
"build:res": "tsx scripts/copy-res.ts",
|
||||
"docker:setup": "docker build --platform linux/amd64 -t element-desktop-dockerbuild -f dockerbuild/Dockerfile .",
|
||||
"docker:build:native": "scripts/in-docker.sh yarn run hak",
|
||||
"docker:build": "scripts/in-docker.sh yarn run build",
|
||||
"docker:install": "scripts/in-docker.sh yarn install",
|
||||
"clean": "rimraf webapp.asar dist packages deploys lib",
|
||||
@ -57,13 +53,14 @@
|
||||
"postinstall": "electron-builder install-app-deps"
|
||||
},
|
||||
"dependencies": {
|
||||
"@sentry/electron": "^6.0.0",
|
||||
"@sentry/electron": "^5.0.0",
|
||||
"@standardnotes/electron-clear-data": "^1.0.5",
|
||||
"auto-launch": "^5.0.5",
|
||||
"counterpart": "^0.18.6",
|
||||
"electron-store": "^10.0.0",
|
||||
"electron-window-state": "^5.0.3",
|
||||
"keytar-forked": "7.10.0",
|
||||
"matrix-seshat": "https://gitpkg.vercel.app/matrix-org/seshat/seshat-node?t3chguy/binding-gyp",
|
||||
"minimist": "^1.2.6",
|
||||
"png-to-ico": "^2.1.1",
|
||||
"uuid": "^11.0.0"
|
||||
@ -75,21 +72,21 @@
|
||||
"@babel/preset-env": "^7.18.10",
|
||||
"@babel/preset-typescript": "^7.18.6",
|
||||
"@electron/asar": "3.3.1",
|
||||
"@playwright/test": "1.51.1",
|
||||
"@stylistic/eslint-plugin": "^4.0.0",
|
||||
"@playwright/test": "1.50.1",
|
||||
"@stylistic/eslint-plugin": "^3.0.0",
|
||||
"@types/auto-launch": "^5.0.1",
|
||||
"@types/counterpart": "^0.18.1",
|
||||
"@types/minimist": "^1.2.1",
|
||||
"@types/node": "18.19.84",
|
||||
"@types/node": "18.19.76",
|
||||
"@types/pacote": "^11.1.1",
|
||||
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
||||
"@typescript-eslint/parser": "^8.0.0",
|
||||
"app-builder-lib": "26.0.12",
|
||||
"app-builder-lib": "26.0.8",
|
||||
"chokidar": "^4.0.0",
|
||||
"detect-libc": "^2.0.0",
|
||||
"electron": "35.1.2",
|
||||
"electron-builder": "26.0.12",
|
||||
"electron-builder-squirrel-windows": "26.0.12",
|
||||
"electron": "34.2.0",
|
||||
"electron-builder": "26.0.8",
|
||||
"electron-builder-squirrel-windows": "26.0.8",
|
||||
"electron-devtools-installer": "^4.0.0",
|
||||
"eslint": "^8.26.0",
|
||||
"eslint-config-google": "^0.14.0",
|
||||
@ -110,13 +107,10 @@
|
||||
"rimraf": "^6.0.0",
|
||||
"tar": "^7.0.0",
|
||||
"tsx": "^4.19.2",
|
||||
"typescript": "5.8.2"
|
||||
},
|
||||
"hakDependencies": {
|
||||
"matrix-seshat": "^4.0.1"
|
||||
"typescript": "5.7.3"
|
||||
},
|
||||
"resolutions": {
|
||||
"@types/node": "18.19.84",
|
||||
"@types/node": "18.19.76",
|
||||
"config-file-ts": "0.2.8-rc1"
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
FROM mcr.microsoft.com/playwright:v1.51.1-jammy
|
||||
FROM mcr.microsoft.com/playwright:v1.50.1-jammy
|
||||
|
||||
WORKDIR /work/element-desktop
|
||||
|
||||
|
@ -55,16 +55,4 @@ test.describe("App launch", () => {
|
||||
}),
|
||||
).resolves.not.toBeNull();
|
||||
});
|
||||
|
||||
test.describe("--no-update", () => {
|
||||
test.use({
|
||||
extraArgs: ["--no-update"],
|
||||
});
|
||||
|
||||
// XXX: this test works fine locally but in CI the app start races with the test plumbing up the stdout/stderr pipes
|
||||
// which means the logs are missed, disabling for now.
|
||||
test.skip("should respect option", async ({ page, stdout }) => {
|
||||
expect(stdout.data.toString()).toContain("Auto update disabled via command line flag");
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -11,37 +11,12 @@ import fs from "node:fs/promises";
|
||||
import path, { dirname } from "node:path";
|
||||
import os from "node:os";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { PassThrough } from "node:stream";
|
||||
|
||||
/**
|
||||
* A PassThrough stream that captures all data written to it.
|
||||
*/
|
||||
class CapturedPassThrough extends PassThrough {
|
||||
private _chunks = [];
|
||||
|
||||
public constructor() {
|
||||
super();
|
||||
super.on("data", this.onData);
|
||||
}
|
||||
|
||||
private onData = (chunk): void => {
|
||||
this._chunks.push(chunk);
|
||||
};
|
||||
|
||||
public get data(): Buffer {
|
||||
return Buffer.concat(this._chunks);
|
||||
}
|
||||
}
|
||||
|
||||
interface Fixtures {
|
||||
app: ElectronApplication;
|
||||
tmpDir: string;
|
||||
extraEnv: Record<string, string>;
|
||||
extraArgs: string[];
|
||||
|
||||
// Utilities to capture stdout and stderr for tests to make assertions against
|
||||
stdout: CapturedPassThrough;
|
||||
stderr: CapturedPassThrough;
|
||||
}
|
||||
|
||||
const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||
@ -49,16 +24,6 @@ const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||
export const test = base.extend<Fixtures>({
|
||||
extraEnv: {},
|
||||
extraArgs: [],
|
||||
|
||||
// eslint-disable-next-line no-empty-pattern
|
||||
stdout: async ({}, use) => {
|
||||
await use(new CapturedPassThrough());
|
||||
},
|
||||
// eslint-disable-next-line no-empty-pattern
|
||||
stderr: async ({}, use) => {
|
||||
await use(new CapturedPassThrough());
|
||||
},
|
||||
|
||||
// eslint-disable-next-line no-empty-pattern
|
||||
tmpDir: async ({}, use) => {
|
||||
const tmpDir = await fs.mkdtemp(path.join(os.tmpdir(), "element-desktop-tests-"));
|
||||
@ -66,7 +31,7 @@ export const test = base.extend<Fixtures>({
|
||||
await use(tmpDir);
|
||||
await fs.rm(tmpDir, { recursive: true });
|
||||
},
|
||||
app: async ({ tmpDir, extraEnv, extraArgs, stdout, stderr }, use) => {
|
||||
app: async ({ tmpDir, extraEnv, extraArgs }, use) => {
|
||||
const args = ["--profile-dir", tmpDir];
|
||||
|
||||
const executablePath = process.env["ELEMENT_DESKTOP_EXECUTABLE"];
|
||||
@ -84,8 +49,8 @@ export const test = base.extend<Fixtures>({
|
||||
args: [...args, ...extraArgs],
|
||||
});
|
||||
|
||||
app.process().stdout.pipe(stdout).pipe(process.stdout);
|
||||
app.process().stderr.pipe(stderr).pipe(process.stderr);
|
||||
app.process().stdout.pipe(process.stdout);
|
||||
app.process().stderr.pipe(process.stderr);
|
||||
|
||||
await app.firstWindow();
|
||||
|
||||
|
@ -1,81 +0,0 @@
|
||||
# hak
|
||||
|
||||
This tool builds native dependencies for element-desktop. Here follows some very minimal
|
||||
documentation for it.
|
||||
|
||||
Goals:
|
||||
|
||||
- Must build compiled native node modules in a shippable state
|
||||
(ie. only dynamically linked against libraries that will be on the
|
||||
target system, all unnecessary files removed).
|
||||
- Must be able to build any native module, no matter what build system
|
||||
it uses (electron-rebuild is supposed to do this job but only works
|
||||
for modules that use gyp).
|
||||
|
||||
It's also loosely designed to be a general tool and agnostic to what it's
|
||||
actually building. It's used here to build modules for the electron app
|
||||
but should work equally well for building modules for normal node.
|
||||
|
||||
# Running
|
||||
|
||||
Hak is invoked with a command and a dependency, eg. `yarn run hak fetch matrix-seshat`.
|
||||
If no dependencies are given, hak runs the command on all dependencies.
|
||||
|
||||
# Files
|
||||
|
||||
There are a lot of files involved:
|
||||
|
||||
- scripts/hak/... - The tool itself
|
||||
- hak/[dependency] - Files provided by the app that tell hak how to build each of its native dependencies.
|
||||
Contains a hak.json file and also some script files, each of which must be referenced in hak.json.
|
||||
- .hak/ - Files generated by hak in the course of doing its job. Includes the dependency module itself and
|
||||
any of the native dependency's native dependencies.
|
||||
- .hak/[dependency]/build - An extracted copy of the dependency's node module used to build it.
|
||||
- .hak/[dependency]/out - Another extracted copy of the dependency, this one contains only what will be shipped.
|
||||
|
||||
# Workings
|
||||
|
||||
Hak works around native node modules that try to fetch or build their native component in
|
||||
the npm 'install' phase - modules that do this will typically end up with native components
|
||||
targeted to the build platform and the node that npm/yarn is using, which is no good for an
|
||||
electron app.
|
||||
|
||||
It does this by installing it with `--ignore-scripts` and then using `yarn link` to keep the
|
||||
dependency module separate so yarn doesn't try to run its install / postinstall script
|
||||
at other points (eg. whenever you `yarn add` a random other dependency).
|
||||
|
||||
This also means that the dependencies cannot be listed in `dependencies` or
|
||||
`devDependencies` in the project, since this would cause npm / yarn to install them and
|
||||
try to fetch their native parts. Instead, they are listed in `hakDependencies` which
|
||||
hak reads to install them for you.
|
||||
|
||||
Hak will _not_ install dependencies for the copy of the module it links into your
|
||||
project, so if your native module has javascript dependencies that are actually needed at
|
||||
runtime (and not just to fetch / build the native parts), it won't work.
|
||||
|
||||
Hak will generate a `.yarnrc` in the project directory to set the link directory to its
|
||||
own in the .hak directory (unless one already exists, in which case this is your problem).
|
||||
|
||||
# Lifecycle
|
||||
|
||||
Hak is divided into lifecycle stages, in order:
|
||||
|
||||
- fetch - Download and extract the source of the dependency
|
||||
- link - Link the copy of the dependency into your node_modules directory
|
||||
- build - The Good Stuff. Configure and build any native dependencies, then the module itself.
|
||||
- copy - Copy the built artifact from the module build directory to the module output directory.
|
||||
|
||||
# hak.json
|
||||
|
||||
The scripts section contains scripts used for lifecycle stages that need them (fetch, build).
|
||||
It also contains 'prune' and 'copy' which are globs of files to delete from the output module directory
|
||||
and copy over from the module build directory to the output module directory, respectively.
|
||||
|
||||
# Shortcomings
|
||||
|
||||
Hak doesn't know about dependencies between lifecycle stages, ie. it doesn't know that you need to
|
||||
'fetch' before you can 'build', etc. You get to run each individually, and remember
|
||||
the right order.
|
||||
|
||||
There is also a _lot_ of duplication in the command execution: we should abstract away
|
||||
some of the boilerplate required to run commands & so forth.
|
@ -1,14 +0,0 @@
|
||||
/*
|
||||
Copyright 2024 New Vector Ltd.
|
||||
Copyright 2020 The Matrix.org Foundation C.I.C.
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
|
||||
Please see LICENSE files in the repository root for full details.
|
||||
*/
|
||||
|
||||
import type { DependencyInfo } from "./dep.js";
|
||||
import type HakEnv from "./hakEnv.js";
|
||||
|
||||
export default async function build(hakEnv: HakEnv, moduleInfo: DependencyInfo): Promise<void> {
|
||||
await moduleInfo.scripts.build(hakEnv, moduleInfo);
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
/*
|
||||
Copyright 2024 New Vector Ltd.
|
||||
Copyright 2020 The Matrix.org Foundation C.I.C.
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
|
||||
Please see LICENSE files in the repository root for full details.
|
||||
*/
|
||||
|
||||
import type { DependencyInfo } from "./dep.js";
|
||||
import type HakEnv from "./hakEnv.js";
|
||||
|
||||
export default async function check(hakEnv: HakEnv, moduleInfo: DependencyInfo): Promise<void> {
|
||||
await moduleInfo.scripts.check?.(hakEnv, moduleInfo);
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
/*
|
||||
Copyright 2024 New Vector Ltd.
|
||||
Copyright 2020 The Matrix.org Foundation C.I.C.
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
|
||||
Please see LICENSE files in the repository root for full details.
|
||||
*/
|
||||
|
||||
import path from "node:path";
|
||||
import { rimraf } from "rimraf";
|
||||
|
||||
import type { DependencyInfo } from "./dep.js";
|
||||
import type HakEnv from "./hakEnv.js";
|
||||
|
||||
export default async function clean(hakEnv: HakEnv, moduleInfo: DependencyInfo): Promise<void> {
|
||||
await rimraf(moduleInfo.moduleDotHakDir);
|
||||
await rimraf(path.join(hakEnv.dotHakDir, "links", moduleInfo.name));
|
||||
await rimraf(path.join(hakEnv.projectRoot, "node_modules", moduleInfo.name));
|
||||
}
|
@ -1,62 +0,0 @@
|
||||
/*
|
||||
Copyright 2024 New Vector Ltd.
|
||||
Copyright 2020, 2021 The Matrix.org Foundation C.I.C.
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
|
||||
Please see LICENSE files in the repository root for full details.
|
||||
*/
|
||||
|
||||
import path from "node:path";
|
||||
import fsProm from "node:fs/promises";
|
||||
import childProcess from "node:child_process";
|
||||
import { glob } from "glob";
|
||||
import { mkdirp } from "mkdirp";
|
||||
|
||||
import type HakEnv from "./hakEnv.js";
|
||||
import type { DependencyInfo } from "./dep.js";
|
||||
|
||||
export default async function copy(hakEnv: HakEnv, moduleInfo: DependencyInfo): Promise<void> {
|
||||
if (moduleInfo.cfg.copy) {
|
||||
// If there are multiple moduleBuildDirs, singular moduleBuildDir
|
||||
// is the same as moduleBuildDirs[0], so we're just listing the contents
|
||||
// of the first one.
|
||||
const files = await glob(moduleInfo.cfg.copy, {
|
||||
cwd: moduleInfo.moduleBuildDir,
|
||||
});
|
||||
|
||||
if (moduleInfo.moduleBuildDirs.length > 1) {
|
||||
if (!hakEnv.isMac()) {
|
||||
console.error(
|
||||
"You asked me to copy multiple targets but I've only been taught " + "how to do that on macOS.",
|
||||
);
|
||||
throw new Error("Can't copy multiple targets on this platform");
|
||||
}
|
||||
|
||||
for (const f of files) {
|
||||
const components = moduleInfo.moduleBuildDirs.map((dir) => path.join(dir, f));
|
||||
const dst = path.join(moduleInfo.moduleOutDir, f);
|
||||
|
||||
await mkdirp(path.dirname(dst));
|
||||
await new Promise<void>((resolve, reject) => {
|
||||
childProcess.execFile("lipo", ["-create", "-output", dst, ...components], (err) => {
|
||||
if (err) {
|
||||
reject(err);
|
||||
} else {
|
||||
resolve();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
} else {
|
||||
console.log("Copying files from " + moduleInfo.moduleBuildDir + " to " + moduleInfo.moduleOutDir);
|
||||
for (const f of files) {
|
||||
console.log("\t" + f);
|
||||
const src = path.join(moduleInfo.moduleBuildDir, f);
|
||||
const dst = path.join(moduleInfo.moduleOutDir, f);
|
||||
|
||||
await mkdirp(path.dirname(dst));
|
||||
await fsProm.copyFile(src, dst);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,24 +0,0 @@
|
||||
/*
|
||||
Copyright 2024 New Vector Ltd.
|
||||
Copyright 2021 The Matrix.org Foundation C.I.C.
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
|
||||
Please see LICENSE files in the repository root for full details.
|
||||
*/
|
||||
|
||||
import type HakEnv from "./hakEnv.js";
|
||||
|
||||
export interface DependencyInfo {
|
||||
name: string;
|
||||
version: string;
|
||||
cfg: Record<string, any>;
|
||||
moduleHakDir: string;
|
||||
moduleDotHakDir: string;
|
||||
moduleTargetDotHakDir: string;
|
||||
moduleBuildDir: string;
|
||||
moduleBuildDirs: string[];
|
||||
moduleOutDir: string;
|
||||
nodeModuleBinDir: string;
|
||||
depPrefix: string;
|
||||
scripts: Record<string, (hakEnv: HakEnv, moduleInfo: DependencyInfo) => Promise<void>>;
|
||||
}
|
@ -1,51 +0,0 @@
|
||||
/*
|
||||
Copyright 2024 New Vector Ltd.
|
||||
Copyright 2020 The Matrix.org Foundation C.I.C.
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
|
||||
Please see LICENSE files in the repository root for full details.
|
||||
*/
|
||||
|
||||
import fsProm from "node:fs/promises";
|
||||
import pacote from "pacote";
|
||||
|
||||
import type HakEnv from "./hakEnv.js";
|
||||
import type { DependencyInfo } from "./dep.js";
|
||||
|
||||
export default async function fetch(hakEnv: HakEnv, moduleInfo: DependencyInfo): Promise<void> {
|
||||
let haveModuleBuildDir;
|
||||
try {
|
||||
const stats = await fsProm.stat(moduleInfo.moduleBuildDir);
|
||||
haveModuleBuildDir = stats.isDirectory();
|
||||
} catch {
|
||||
haveModuleBuildDir = false;
|
||||
}
|
||||
|
||||
if (haveModuleBuildDir) return;
|
||||
|
||||
console.log("Fetching " + moduleInfo.name + "@" + moduleInfo.version);
|
||||
|
||||
const packumentCache = new Map();
|
||||
await pacote.extract(`${moduleInfo.name}@${moduleInfo.version}`, moduleInfo.moduleBuildDir, {
|
||||
packumentCache,
|
||||
});
|
||||
|
||||
console.log("Running yarn install in " + moduleInfo.moduleBuildDir);
|
||||
await hakEnv.spawn("yarn", ["install", "--ignore-scripts"], {
|
||||
cwd: moduleInfo.moduleBuildDir,
|
||||
});
|
||||
|
||||
// also extract another copy to the output directory at this point
|
||||
// nb. we do not yarn install in the output copy: we could install in
|
||||
// production mode to get only runtime dependencies and not devDependencies,
|
||||
// but usually native modules come with dependencies that are needed for
|
||||
// building/fetching the native modules (eg. node-pre-gyp) rather than
|
||||
// actually used at runtime: we do not want to bundle these into our app.
|
||||
// We therefore just install no dependencies at all, and accept that any
|
||||
// actual runtime dependencies will have to be added to the main app's
|
||||
// dependencies. We can't tell what dependencies are real runtime deps
|
||||
// and which are just used for native module building.
|
||||
await pacote.extract(`${moduleInfo.name}@${moduleInfo.version}`, moduleInfo.moduleOutDir, {
|
||||
packumentCache,
|
||||
});
|
||||
}
|
@ -1,130 +0,0 @@
|
||||
/*
|
||||
Copyright 2024 New Vector Ltd.
|
||||
Copyright 2020, 2021 The Matrix.org Foundation C.I.C.
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
|
||||
Please see LICENSE files in the repository root for full details.
|
||||
*/
|
||||
|
||||
import path from "node:path";
|
||||
import os from "node:os";
|
||||
import { getElectronVersionFromInstalled } from "app-builder-lib/out/electron/electronVersion.js";
|
||||
import childProcess, { type SpawnOptions } from "node:child_process";
|
||||
|
||||
import { type Arch, type Target, TARGETS, getHost, isHostId, type TargetId } from "./target.js";
|
||||
|
||||
async function getRuntimeVersion(projectRoot: string): Promise<string> {
|
||||
const electronVersion = await getElectronVersionFromInstalled(projectRoot);
|
||||
if (!electronVersion) {
|
||||
throw new Error("Can't determine Electron version");
|
||||
}
|
||||
return electronVersion;
|
||||
}
|
||||
|
||||
export type Tool = [cmd: string, ...args: string[]];
|
||||
|
||||
export default class HakEnv {
|
||||
public readonly target: Target;
|
||||
public runtime: string = "electron";
|
||||
public runtimeVersion?: string;
|
||||
public dotHakDir: string;
|
||||
|
||||
public constructor(
|
||||
public readonly projectRoot: string,
|
||||
targetId: TargetId | null,
|
||||
) {
|
||||
const target = targetId ? TARGETS[targetId] : getHost();
|
||||
|
||||
if (!target) {
|
||||
throw new Error(`Unknown target ${targetId}!`);
|
||||
}
|
||||
this.target = target;
|
||||
this.dotHakDir = path.join(this.projectRoot, ".hak");
|
||||
}
|
||||
|
||||
public async init(): Promise<void> {
|
||||
this.runtimeVersion = await getRuntimeVersion(this.projectRoot);
|
||||
}
|
||||
|
||||
public getTargetId(): TargetId {
|
||||
return this.target.id;
|
||||
}
|
||||
|
||||
public isWin(): boolean {
|
||||
return this.target.platform === "win32";
|
||||
}
|
||||
|
||||
public isMac(): boolean {
|
||||
return this.target.platform === "darwin";
|
||||
}
|
||||
|
||||
public isLinux(): boolean {
|
||||
return this.target.platform === "linux";
|
||||
}
|
||||
|
||||
public isFreeBSD(): boolean {
|
||||
return this.target.platform === "freebsd";
|
||||
}
|
||||
|
||||
public getTargetArch(): Arch {
|
||||
return this.target.arch;
|
||||
}
|
||||
|
||||
public isHost(): boolean {
|
||||
return isHostId(this.target.id);
|
||||
}
|
||||
|
||||
public makeGypEnv(): Record<string, string | undefined> {
|
||||
return {
|
||||
...process.env,
|
||||
npm_config_arch: this.target.arch,
|
||||
npm_config_target_arch: this.target.arch,
|
||||
npm_config_disturl: "https://electronjs.org/headers",
|
||||
npm_config_runtime: this.runtime,
|
||||
npm_config_target: this.runtimeVersion,
|
||||
npm_config_build_from_source: "true",
|
||||
npm_config_devdir: path.join(os.homedir(), ".electron-gyp"),
|
||||
};
|
||||
}
|
||||
|
||||
public wantsStaticSqlCipher(): boolean {
|
||||
return !(this.isLinux() || this.isFreeBSD()) || process.env.SQLCIPHER_BUNDLED == "1";
|
||||
}
|
||||
|
||||
public spawn(
|
||||
cmd: string,
|
||||
args: string[],
|
||||
{ ignoreWinCmdlet, ...options }: SpawnOptions & { ignoreWinCmdlet?: boolean } = {},
|
||||
): Promise<void> {
|
||||
return new Promise((resolve, reject) => {
|
||||
const proc = childProcess.spawn(cmd + (!ignoreWinCmdlet && this.isWin() ? ".cmd" : ""), args, {
|
||||
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: this.isWin(),
|
||||
...options,
|
||||
});
|
||||
proc.on("exit", (code) => {
|
||||
if (code) {
|
||||
reject(code);
|
||||
} else {
|
||||
resolve();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
public async checkTools(tools: Tool[]): Promise<void> {
|
||||
for (const [tool, ...args] of tools) {
|
||||
try {
|
||||
await this.spawn(tool, args, {
|
||||
ignoreWinCmdlet: true,
|
||||
stdio: ["ignore"],
|
||||
shell: false,
|
||||
});
|
||||
} catch {
|
||||
throw new Error(`Can't find ${tool}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,147 +0,0 @@
|
||||
/*
|
||||
Copyright 2024 New Vector Ltd.
|
||||
Copyright 2020, 2021 The Matrix.org Foundation C.I.C.
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
|
||||
Please see LICENSE files in the repository root for full details.
|
||||
*/
|
||||
|
||||
import path, { dirname } from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
|
||||
import HakEnv from "./hakEnv.js";
|
||||
import type { TargetId } from "./target.js";
|
||||
import type { DependencyInfo } from "./dep.js";
|
||||
import { loadJsonFile } from "../../src/utils.js";
|
||||
import packageJson from "../../package.json";
|
||||
|
||||
// These can only be run on specific modules
|
||||
const MODULECOMMANDS = ["check", "fetch", "link", "build", "copy", "clean"];
|
||||
|
||||
// Shortcuts for multiple commands at once (useful for building universal binaries
|
||||
// because you can run the fetch/build for each arch and then copy/link once)
|
||||
const METACOMMANDS: Record<string, string[]> = {
|
||||
fetchandbuild: ["check", "fetch", "build"],
|
||||
copyandlink: ["copy", "link"],
|
||||
};
|
||||
|
||||
// Scripts valid in a hak.json 'scripts' section
|
||||
const HAKSCRIPTS = ["check", "fetch", "build"];
|
||||
|
||||
const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||
|
||||
async function main(): Promise<void> {
|
||||
const prefix = path.join(__dirname, "..", "..");
|
||||
|
||||
const targetIds: TargetId[] = [];
|
||||
// Apply `--target <target>` option if specified
|
||||
// Can be specified multiple times for the copy command to bundle
|
||||
// multiple arches into a single universal output module)
|
||||
for (;;) {
|
||||
// eslint-disable-line no-constant-condition
|
||||
const targetIndex = process.argv.indexOf("--target");
|
||||
if (targetIndex === -1) break;
|
||||
|
||||
if (targetIndex + 1 >= process.argv.length) {
|
||||
console.error("--target option specified without a target");
|
||||
process.exit(1);
|
||||
}
|
||||
// Extract target ID and remove from args
|
||||
targetIds.push(process.argv.splice(targetIndex, 2)[1] as TargetId);
|
||||
}
|
||||
|
||||
const hakEnvs = targetIds.map((tid) => new HakEnv(prefix, tid));
|
||||
if (hakEnvs.length == 0) hakEnvs.push(new HakEnv(prefix, null));
|
||||
for (const h of hakEnvs) {
|
||||
await h.init();
|
||||
}
|
||||
const hakEnv = hakEnvs[0];
|
||||
|
||||
const deps: Record<string, DependencyInfo> = {};
|
||||
|
||||
const hakDepsCfg = packageJson.hakDependencies || {};
|
||||
|
||||
for (const dep in hakDepsCfg) {
|
||||
const hakJsonPath = path.join(prefix, "hak", dep, "hak.json");
|
||||
let hakJson: Record<string, any>;
|
||||
try {
|
||||
hakJson = loadJsonFile(hakJsonPath);
|
||||
} catch {
|
||||
console.error("No hak.json found for " + dep + ".");
|
||||
console.log("Expecting " + hakJsonPath);
|
||||
process.exit(1);
|
||||
}
|
||||
deps[dep] = {
|
||||
name: dep,
|
||||
version: hakDepsCfg[dep as keyof typeof hakDepsCfg],
|
||||
cfg: hakJson,
|
||||
moduleHakDir: path.join(prefix, "hak", dep),
|
||||
moduleDotHakDir: path.join(hakEnv.dotHakDir, dep),
|
||||
moduleTargetDotHakDir: path.join(hakEnv.dotHakDir, dep, hakEnv.getTargetId()),
|
||||
moduleBuildDir: path.join(hakEnv.dotHakDir, dep, hakEnv.getTargetId(), "build"),
|
||||
moduleBuildDirs: hakEnvs.map((h) => path.join(h.dotHakDir, dep, h.getTargetId(), "build")),
|
||||
moduleOutDir: path.join(hakEnv.dotHakDir, "hakModules", dep),
|
||||
nodeModuleBinDir: path.join(hakEnv.dotHakDir, dep, hakEnv.getTargetId(), "build", "node_modules", ".bin"),
|
||||
depPrefix: path.join(hakEnv.dotHakDir, dep, hakEnv.getTargetId(), "opt"),
|
||||
scripts: {},
|
||||
};
|
||||
|
||||
for (const s of HAKSCRIPTS) {
|
||||
if (hakJson.scripts?.[s]) {
|
||||
// Shockingly, using path.join and backslashes here doesn't work on Windows
|
||||
const scriptModule = await import(`../../hak/${dep}/${hakJson.scripts[s]}`);
|
||||
if (scriptModule.default) {
|
||||
deps[dep].scripts[s] = scriptModule.default;
|
||||
} else {
|
||||
deps[dep].scripts[s] = scriptModule;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let cmds: string[];
|
||||
if (process.argv.length < 3) {
|
||||
cmds = ["check", "fetch", "build", "copy", "link"];
|
||||
} else if (METACOMMANDS[process.argv[2]]) {
|
||||
cmds = METACOMMANDS[process.argv[2]];
|
||||
} else {
|
||||
cmds = [process.argv[2]];
|
||||
}
|
||||
|
||||
if (hakEnvs.length > 1 && cmds.some((c) => !["copy", "link"].includes(c))) {
|
||||
// We allow link here too for convenience because it's completely arch independent
|
||||
console.error("Multiple targets only supported with the copy command");
|
||||
return;
|
||||
}
|
||||
|
||||
let modules = process.argv.slice(3);
|
||||
if (modules.length === 0) modules = Object.keys(deps);
|
||||
|
||||
for (const cmd of cmds) {
|
||||
if (!MODULECOMMANDS.includes(cmd)) {
|
||||
console.error("Unknown command: " + cmd);
|
||||
console.log("Commands I know about:");
|
||||
for (const cmd of MODULECOMMANDS) {
|
||||
console.log("\t" + cmd);
|
||||
}
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const cmdFunc = (await import("./" + cmd)).default;
|
||||
|
||||
for (const mod of modules) {
|
||||
const depInfo = deps[mod];
|
||||
if (depInfo === undefined) {
|
||||
console.log("Module " + mod + " not found - is it in hakDependencies " + "in your package.json?");
|
||||
process.exit(1);
|
||||
}
|
||||
console.log("hak " + cmd + ": " + mod);
|
||||
await cmdFunc(hakEnv, depInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
main().catch((err) => {
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
});
|
@ -1,47 +0,0 @@
|
||||
/*
|
||||
Copyright 2024 New Vector Ltd.
|
||||
Copyright 2020 The Matrix.org Foundation C.I.C.
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
|
||||
Please see LICENSE files in the repository root for full details.
|
||||
*/
|
||||
|
||||
import path from "node:path";
|
||||
import os from "node:os";
|
||||
import fsProm from "node:fs/promises";
|
||||
|
||||
import type HakEnv from "./hakEnv.js";
|
||||
import { type DependencyInfo } from "./dep.js";
|
||||
|
||||
export default async function link(hakEnv: HakEnv, moduleInfo: DependencyInfo): Promise<void> {
|
||||
const yarnrc = path.join(hakEnv.projectRoot, ".yarnrc");
|
||||
// this is fairly terrible but it's reasonably clunky to either parse a yarnrc
|
||||
// properly or get yarn to do it, so this will probably suffice for now.
|
||||
// We just check to see if there is a local .yarnrc at all, and assume that
|
||||
// if you've put one there yourself, you probably know what you're doing and
|
||||
// we won't meddle with it.
|
||||
// Also we do this for each module which is unnecessary, but meh.
|
||||
try {
|
||||
await fsProm.stat(yarnrc);
|
||||
} catch {
|
||||
await fsProm.writeFile(
|
||||
yarnrc,
|
||||
// XXX: 1. This must be absolute, as yarn will resolve link directories
|
||||
// relative to the closest project root, which means when we run it
|
||||
// in the dependency project, it will put the link directory in its
|
||||
// own project folder rather than the main project.
|
||||
// 2. The parser gets very confused by strings with colons in them
|
||||
// (ie. Windows absolute paths) but strings in quotes get parsed as
|
||||
// JSON so need to be valid JSON encoded strings (ie. have the
|
||||
// backslashes escaped). JSON.stringify will add quotes and escape.
|
||||
"--link-folder " + JSON.stringify(path.join(hakEnv.dotHakDir, "links")) + os.EOL,
|
||||
);
|
||||
}
|
||||
|
||||
await hakEnv.spawn("yarn", ["link"], {
|
||||
cwd: moduleInfo.moduleOutDir,
|
||||
});
|
||||
await hakEnv.spawn("yarn", ["link", moduleInfo.name], {
|
||||
cwd: hakEnv.projectRoot,
|
||||
});
|
||||
}
|
@ -1,217 +0,0 @@
|
||||
/*
|
||||
Copyright 2024 New Vector Ltd.
|
||||
Copyright 2021 The Matrix.org Foundation C.I.C.
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
|
||||
Please see LICENSE files in the repository root for full details.
|
||||
*/
|
||||
|
||||
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.
|
||||
// See https://doc.rust-lang.org/rustc/platform-support.html.
|
||||
export type TargetId =
|
||||
| "aarch64-apple-darwin"
|
||||
| "x86_64-apple-darwin"
|
||||
| "universal-apple-darwin"
|
||||
| "i686-pc-windows-msvc"
|
||||
| "x86_64-pc-windows-msvc"
|
||||
| "aarch64-pc-windows-msvc"
|
||||
| "i686-unknown-freebsd"
|
||||
| "x86_64-unknown-freebsd"
|
||||
| "aarch64-unknown-freebsd"
|
||||
| "i686-unknown-linux-musl"
|
||||
| "i686-unknown-linux-gnu"
|
||||
| "x86_64-unknown-linux-musl"
|
||||
| "x86_64-unknown-linux-gnu"
|
||||
| "aarch64-unknown-linux-musl"
|
||||
| "aarch64-unknown-linux-gnu"
|
||||
| "powerpc64le-unknown-linux-musl"
|
||||
| "powerpc64le-unknown-linux-gnu";
|
||||
|
||||
// Values are expected to match those used in `process.platform`.
|
||||
export type Platform = "darwin" | "freebsd" | "linux" | "win32";
|
||||
|
||||
// Values are expected to match those used in `process.arch`.
|
||||
export type Arch = "arm64" | "ia32" | "x64" | "ppc64" | "universal";
|
||||
|
||||
// Values are expected to match those used by Visual Studio's `vcvarsall.bat`.
|
||||
// See https://docs.microsoft.com/cpp/build/building-on-the-command-line?view=msvc-160#vcvarsall-syntax
|
||||
export type VcVarsArch = "amd64" | "arm64" | "x86";
|
||||
|
||||
export type Target = {
|
||||
id: TargetId;
|
||||
platform: Platform;
|
||||
arch: Arch;
|
||||
};
|
||||
|
||||
export type WindowsTarget = Target & {
|
||||
platform: "win32";
|
||||
vcVarsArch: VcVarsArch;
|
||||
};
|
||||
|
||||
export type LinuxTarget = Target & {
|
||||
platform: "linux";
|
||||
libC: typeof GLIBC | typeof MUSL;
|
||||
};
|
||||
|
||||
export type UniversalTarget = Target & {
|
||||
arch: "universal";
|
||||
subtargets: Target[];
|
||||
};
|
||||
|
||||
const aarch64AppleDarwin: Target = {
|
||||
id: "aarch64-apple-darwin",
|
||||
platform: "darwin",
|
||||
arch: "arm64",
|
||||
};
|
||||
|
||||
const x8664AppleDarwin: Target = {
|
||||
id: "x86_64-apple-darwin",
|
||||
platform: "darwin",
|
||||
arch: "x64",
|
||||
};
|
||||
|
||||
const universalAppleDarwin: UniversalTarget = {
|
||||
id: "universal-apple-darwin",
|
||||
platform: "darwin",
|
||||
arch: "universal",
|
||||
subtargets: [aarch64AppleDarwin, x8664AppleDarwin],
|
||||
};
|
||||
|
||||
const i686PcWindowsMsvc: WindowsTarget = {
|
||||
id: "i686-pc-windows-msvc",
|
||||
platform: "win32",
|
||||
arch: "ia32",
|
||||
vcVarsArch: "x86",
|
||||
};
|
||||
|
||||
const x8664PcWindowsMsvc: WindowsTarget = {
|
||||
id: "x86_64-pc-windows-msvc",
|
||||
platform: "win32",
|
||||
arch: "x64",
|
||||
vcVarsArch: "amd64",
|
||||
};
|
||||
|
||||
const aarch64WindowsMsvc: WindowsTarget = {
|
||||
id: "aarch64-pc-windows-msvc",
|
||||
platform: "win32",
|
||||
arch: "arm64",
|
||||
vcVarsArch: "arm64",
|
||||
};
|
||||
|
||||
const i686UnknownFreebsd: Target = {
|
||||
id: "i686-unknown-freebsd",
|
||||
platform: "freebsd",
|
||||
arch: "ia32",
|
||||
};
|
||||
|
||||
const x8664UnknownFreebsd: Target = {
|
||||
id: "x86_64-unknown-freebsd",
|
||||
platform: "freebsd",
|
||||
arch: "x64",
|
||||
};
|
||||
|
||||
const aarch64UnknownFreebsd: Target = {
|
||||
id: "aarch64-unknown-freebsd",
|
||||
platform: "freebsd",
|
||||
arch: "arm64",
|
||||
};
|
||||
|
||||
const x8664UnknownLinuxGnu: LinuxTarget = {
|
||||
id: "x86_64-unknown-linux-gnu",
|
||||
platform: "linux",
|
||||
arch: "x64",
|
||||
libC: GLIBC,
|
||||
};
|
||||
|
||||
const x8664UnknownLinuxMusl: LinuxTarget = {
|
||||
id: "x86_64-unknown-linux-musl",
|
||||
platform: "linux",
|
||||
arch: "x64",
|
||||
libC: MUSL,
|
||||
};
|
||||
|
||||
const i686UnknownLinuxGnu: LinuxTarget = {
|
||||
id: "i686-unknown-linux-gnu",
|
||||
platform: "linux",
|
||||
arch: "ia32",
|
||||
libC: GLIBC,
|
||||
};
|
||||
|
||||
const i686UnknownLinuxMusl: LinuxTarget = {
|
||||
id: "i686-unknown-linux-musl",
|
||||
platform: "linux",
|
||||
arch: "ia32",
|
||||
libC: MUSL,
|
||||
};
|
||||
|
||||
const aarch64UnknownLinuxGnu: LinuxTarget = {
|
||||
id: "aarch64-unknown-linux-gnu",
|
||||
platform: "linux",
|
||||
arch: "arm64",
|
||||
libC: GLIBC,
|
||||
};
|
||||
|
||||
const aarch64UnknownLinuxMusl: LinuxTarget = {
|
||||
id: "aarch64-unknown-linux-musl",
|
||||
platform: "linux",
|
||||
arch: "arm64",
|
||||
libC: MUSL,
|
||||
};
|
||||
|
||||
const powerpc64leUnknownLinuxGnu: LinuxTarget = {
|
||||
id: "powerpc64le-unknown-linux-gnu",
|
||||
platform: "linux",
|
||||
arch: "ppc64",
|
||||
libC: GLIBC,
|
||||
};
|
||||
|
||||
const powerpc64leUnknownLinuxMusl: LinuxTarget = {
|
||||
id: "powerpc64le-unknown-linux-musl",
|
||||
platform: "linux",
|
||||
arch: "ppc64",
|
||||
libC: MUSL,
|
||||
};
|
||||
|
||||
export const TARGETS: Record<TargetId, Target> = {
|
||||
// macOS
|
||||
"aarch64-apple-darwin": aarch64AppleDarwin,
|
||||
"x86_64-apple-darwin": x8664AppleDarwin,
|
||||
"universal-apple-darwin": universalAppleDarwin,
|
||||
// Windows
|
||||
"i686-pc-windows-msvc": i686PcWindowsMsvc,
|
||||
"x86_64-pc-windows-msvc": x8664PcWindowsMsvc,
|
||||
"aarch64-pc-windows-msvc": aarch64WindowsMsvc,
|
||||
// FreeBSD
|
||||
"i686-unknown-freebsd": i686UnknownFreebsd,
|
||||
"x86_64-unknown-freebsd": x8664UnknownFreebsd,
|
||||
"aarch64-unknown-freebsd": aarch64UnknownFreebsd,
|
||||
// Linux
|
||||
"i686-unknown-linux-musl": i686UnknownLinuxMusl,
|
||||
"i686-unknown-linux-gnu": i686UnknownLinuxGnu,
|
||||
"x86_64-unknown-linux-musl": x8664UnknownLinuxMusl,
|
||||
"x86_64-unknown-linux-gnu": x8664UnknownLinuxGnu,
|
||||
"aarch64-unknown-linux-musl": aarch64UnknownLinuxMusl,
|
||||
"aarch64-unknown-linux-gnu": aarch64UnknownLinuxGnu,
|
||||
"powerpc64le-unknown-linux-musl": powerpc64leUnknownLinuxMusl,
|
||||
"powerpc64le-unknown-linux-gnu": powerpc64leUnknownLinuxGnu,
|
||||
};
|
||||
|
||||
export function getHost(): Target | undefined {
|
||||
return Object.values(TARGETS).find(
|
||||
(target) =>
|
||||
target.platform === process.platform &&
|
||||
target.arch === process.arch &&
|
||||
(process.platform !== "linux" || (target as LinuxTarget).libC === processLibC()),
|
||||
);
|
||||
}
|
||||
|
||||
export function isHostId(id: TargetId): boolean {
|
||||
return getHost()?.id === id;
|
||||
}
|
||||
|
||||
export function isHost(target: Target): boolean {
|
||||
return getHost()?.id === target.id;
|
||||
}
|
@ -8,21 +8,16 @@ if [ $? != 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "${PWD}"
|
||||
echo $(ls "${PWD}")
|
||||
|
||||
# Taken from https://www.electron.build/multi-platform-build#docker
|
||||
# Pass through any vars prefixed with INDOCKER_, removing the prefix
|
||||
docker run --rm \
|
||||
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" \
|
||||
-v ${PWD}:/project \
|
||||
-v ${PWD}/docker/node_modules:/project/node_modules \
|
||||
-v ${PWD}/docker/.hak:/project/.hak \
|
||||
-v ${PWD}/docker/.gnupg:/root/.gnupg \
|
||||
-v ~/.cache/electron:/root/.cache/electron \
|
||||
-v ~/.cache/electron-builder:/root/.cache/electron-builder \
|
||||
--workdir "/project" \
|
||||
"$IMAGE" "$@"
|
||||
|
@ -436,9 +436,8 @@ app.on("ready", async () => {
|
||||
});
|
||||
});
|
||||
|
||||
// Minimist parses `--no-`-prefixed arguments as booleans with value `false` rather than verbatim.
|
||||
if (argv["update"] === false) {
|
||||
console.log("Auto update disabled via command line flag");
|
||||
if (argv["no-update"]) {
|
||||
console.log('Auto update disabled via command line flag "--no-update"');
|
||||
} else if (global.vectorConfig["update_base_url"]) {
|
||||
console.log(`Starting auto update with base URL: ${global.vectorConfig["update_base_url"]}`);
|
||||
void updater.start(global.vectorConfig["update_base_url"]);
|
||||
|
@ -9,7 +9,7 @@
|
||||
"edit": "Golygu",
|
||||
"minimise": "Lleihau",
|
||||
"paste": "Gludo",
|
||||
"paste_match_style": "Arddull Gludo a Chyfateb",
|
||||
"paste_match_style": "Gludo a Chyfateb Arddull",
|
||||
"quit": "Gadael",
|
||||
"redo": "Ail-wneud",
|
||||
"select_all": "Dewis y Cyfan",
|
||||
@ -20,7 +20,7 @@
|
||||
},
|
||||
"common": {
|
||||
"about": "Ynghylch",
|
||||
"brand_help": "Cymorth %(brand)s",
|
||||
"brand_help": "%(brand)s Cymorth",
|
||||
"help": "Cymorth",
|
||||
"preferences": "Dewisiadau"
|
||||
},
|
||||
@ -40,18 +40,18 @@
|
||||
"unhide": "Datguddio"
|
||||
},
|
||||
"right_click_menu": {
|
||||
"add_to_dictionary": "Ychwanegu at y geiriadur",
|
||||
"add_to_dictionary": "Ychwanegu i'r Geiriadur",
|
||||
"copy_email": "Copïo cyfeiriad e-bost",
|
||||
"copy_image": "Copïo delwedd",
|
||||
"copy_image_url": "Copïo cyfeiriad delwedd",
|
||||
"copy_link_url": "Copïo cyfeiriad y ddolen",
|
||||
"save_image_as": "Cadw delwedd fel...",
|
||||
"save_image_as_error_description": "Methodd cadw'r ddelwedd",
|
||||
"save_image_as_error_title": "Methodd cadw'r ddelwedd"
|
||||
"save_image_as_error_description": "Methodd y ddelwedd â chadw",
|
||||
"save_image_as_error_title": "Wedi methu cadw'r ddelwedd"
|
||||
},
|
||||
"view_menu": {
|
||||
"actual_size": "Maint Gwirioneddol",
|
||||
"toggle_developer_tools": "Toglo Offer Datblygwyr",
|
||||
"toggle_developer_tools": "Toggle Developer Tools",
|
||||
"toggle_full_screen": "Toglo Sgrin Lawn",
|
||||
"view": "Golwg"
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user