Skip to content

Commit a21aaac

Browse files
authored
Merge pull request #35 from mrquantumoff/codex/sidecar
Add electron as an alternative runtime to Tauri
2 parents 1a86250 + b757414 commit a21aaac

100 files changed

Lines changed: 7862 additions & 2486 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/flatpak.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ jobs:
7373
gh release download "$TAG" \
7474
--repo "$RELEASE_REPO" \
7575
--dir downloads \
76-
--pattern "Quadrant_${VERSION}_amd64.deb" \
77-
--pattern "Quadrant_${VERSION}_arm64.deb"
76+
--pattern "Quadrant-${VERSION}-linux-x64-electron.AppImage" \
77+
--pattern "Quadrant-${VERSION}-linux-arm64-electron.AppImage"
7878
7979
- name: Compute source hashes
8080
id: hashes
@@ -84,8 +84,8 @@ jobs:
8484
set -euo pipefail
8585
8686
metainfo_sha="$(sha256sum "$METAINFO_PATH" | awk '{print $1}')"
87-
amd64_sha="$(sha256sum "downloads/Quadrant_${VERSION}_amd64.deb" | awk '{print $1}')"
88-
arm64_sha="$(sha256sum "downloads/Quadrant_${VERSION}_arm64.deb" | awk '{print $1}')"
87+
amd64_sha="$(sha256sum "downloads/Quadrant-${VERSION}-linux-x64-electron.AppImage" | awk '{print $1}')"
88+
arm64_sha="$(sha256sum "downloads/Quadrant-${VERSION}-linux-arm64-electron.AppImage" | awk '{print $1}')"
8989
9090
echo "metainfo_sha=$metainfo_sha" >> "$GITHUB_OUTPUT"
9191
echo "amd64_sha=$amd64_sha" >> "$GITHUB_OUTPUT"
@@ -192,8 +192,8 @@ jobs:
192192
set -euo pipefail
193193
194194
metainfo_url="https://github.com/${RELEASE_REPO}/raw/${TAG}/${METAINFO_PATH}"
195-
amd64_url="https://github.com/${RELEASE_REPO}/releases/download/${TAG}/Quadrant_${VERSION}_amd64.deb"
196-
arm64_url="https://github.com/${RELEASE_REPO}/releases/download/${TAG}/Quadrant_${VERSION}_arm64.deb"
195+
amd64_url="https://github.com/${RELEASE_REPO}/releases/download/${TAG}/Quadrant-${VERSION}-linux-x64-electron.AppImage"
196+
arm64_url="https://github.com/${RELEASE_REPO}/releases/download/${TAG}/Quadrant-${VERSION}-linux-arm64-electron.AppImage"
197197
pr_head="${FLATHUB_HEAD_OWNER}:${FLATHUB_BRANCH}"
198198
199199
{

.github/workflows/release.yml

Lines changed: 64 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ jobs:
3737
- name: Setup bun
3838
uses: oven-sh/setup-bun@v2
3939

40-
4140
- name: install Rust stable
4241
uses: dtolnay/rust-toolchain@stable
4342

@@ -71,12 +70,74 @@ jobs:
7170
releaseDraft: false
7271
prerelease: ${{ !endsWith(github.ref_name, 'stable') }}
7372
args: ${{ matrix.args }}
74-
tauriScript: 'bun tauri'
73+
tauriScript: "bun tauri"
7574
tagName: ${{github.ref_name}}
7675

76+
publish-electron:
77+
permissions:
78+
contents: write
79+
strategy:
80+
fail-fast: false
81+
matrix:
82+
include:
83+
- platform: "blacksmith-4vcpu-windows-2025"
84+
os: "windows"
85+
arch: "x64"
86+
- platform: "blacksmith-4vcpu-ubuntu-2404"
87+
os: "linux"
88+
arch: "x64"
89+
- platform: "windows-11-arm"
90+
os: "windows"
91+
arch: "arm64"
92+
- platform: "blacksmith-4vcpu-ubuntu-2404-arm"
93+
os: "linux"
94+
arch: "arm64"
95+
runs-on: ${{ matrix.platform }}
96+
steps:
97+
- uses: actions/checkout@v4
98+
99+
- name: Setup bun
100+
uses: oven-sh/setup-bun@v2
101+
102+
- name: install Rust stable
103+
uses: dtolnay/rust-toolchain@stable
104+
105+
- name: install dependencies (ubuntu only)
106+
if: matrix.os == 'linux'
107+
run: |
108+
sudo apt update
109+
sudo apt install -y libsecret-1-dev libarchive-tools rpm
110+
111+
- name: install frontend dependencies (bun)
112+
run: bun install
113+
114+
- uses: Swatinem/rust-cache@v2
115+
with:
116+
workspaces: "./src-tauri -> target"
117+
118+
- name: Package Electron app
119+
env:
120+
ETERNAL_API_TOKEN: ${{ secrets.ETERNAL_API_TOKEN }}
121+
QUADRANT_API_KEY: ${{ secrets.QUADRANT_API_KEY }}
122+
QUADRANT_OAUTH2_CLIENT_ID: ${{ secrets.QUADRANT_OAUTH2_CLIENT_ID }}
123+
QUADRANT_OAUTH2_CLIENT_SECRET: ${{ secrets.QUADRANT_OAUTH2_CLIENT_SECRET }}
124+
QUADRANT_API_BASE_URL: ${{ vars.QUADRANT_API_BASE_URL }}
125+
run: bun run package:electron -- --arch=${{ matrix.arch }}
126+
127+
- name: Upload Electron assets to release
128+
env:
129+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
130+
TAG_NAME: ${{ github.ref_name }}
131+
shell: bash
132+
run: |
133+
mapfile -d '' files < <(find dist-electron -maxdepth 1 -type f -print0)
134+
gh release upload "$TAG_NAME" "${files[@]}" --clobber
135+
77136
sync_flathub:
78137
name: Sync Flathub
79-
needs: publish-tauri
138+
needs:
139+
- publish-tauri
140+
- publish-electron
80141
if: endsWith(github.ref_name, '-stable') || endsWith(github.ref_name, '-flatpak')
81142
uses: ./.github/workflows/flatpak.yml
82143
secrets: inherit
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Validate Desktop
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
- master
9+
- release
10+
11+
jobs:
12+
validate:
13+
runs-on: ubuntu-24.04
14+
env:
15+
# quadrant-core still uses compile-time env!() for these desktop-only
16+
# credentials, so CI must provide placeholder values for every Rust build.
17+
QUADRANT_API_KEY: dev
18+
QUADRANT_OAUTH2_CLIENT_ID: dev
19+
QUADRANT_OAUTH2_CLIENT_SECRET: dev
20+
ETERNAL_API_TOKEN: dev
21+
steps:
22+
- uses: actions/checkout@v4
23+
24+
- name: Setup bun
25+
uses: oven-sh/setup-bun@v2
26+
27+
- name: Install Rust stable
28+
uses: dtolnay/rust-toolchain@stable
29+
30+
- name: Install Linux desktop dependencies
31+
run: |
32+
sudo apt update
33+
sudo apt install -y libwebkit2gtk-4.1-dev xdg-utils libappindicator3-dev librsvg2-dev patchelf libsecret-1-dev libarchive-tools rpm
34+
35+
- name: Install frontend dependencies
36+
run: bun install
37+
38+
- uses: Swatinem/rust-cache@v2
39+
with:
40+
workspaces: "./src-tauri -> target"
41+
42+
- name: Build shared renderer
43+
run: bun run build
44+
45+
- name: Build native addon
46+
run: bun run build:napi
47+
48+
- name: Build Electron shell
49+
run: node scripts/build-electron.mjs
50+
51+
- name: Build Tauri shell
52+
run: bun tauri build --no-bundle

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ lerna-debug.log*
99

1010
node_modules
1111
dist
12+
dist-electron
1213
dist-ssr
1314
*.local
1415

@@ -39,3 +40,5 @@ src-tauri/versoview
3940
target/
4041
AppxContent
4142
AppxBundles
43+
electron/runtime-config.generated.json
44+
packages/quadrant-node/native/

.vscode/settings.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
{
2-
"rust-analyzer.cargo.cfgs": [
3-
"debug_assertions"
4-
],
5-
"typescript.tsdk": "node_modules\\typescript\\lib"
6-
}
2+
"rust-analyzer.cargo.cfgs": ["debug_assertions"],
3+
"typescript.tsdk": "node_modules\\typescript\\lib"
4+
}

AppxManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
xmlns:desktop="http://schemas.microsoft.com/appx/manifest/desktop/windows10"
99
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
1010
IgnorableNamespaces="uap uap3 uap10 desktop rescap">
11-
<Identity Name="58734MrQuantumOFFDemirYer.MinecraftModpackManagerR" Version="26.4.0.0"
11+
<Identity Name="58734MrQuantumOFFDemirYer.MinecraftModpackManagerR" Version="26.4.1.0"
1212
Publisher="CN=010914FC-8843-4963-A3FE-E3E06E6D9F53" ProcessorArchitecture="x64" />
1313
<Properties>
1414
<DisplayName>QuadrantMC</DisplayName>

DEVELOP.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,10 @@ You can develop the Quadrant Next client by:
44

55
- Installing the needed dependencies for [Tauri](https://tauri.app/start/prerequisites/) and [Rust](https://www.rust-lang.org/). If you're on Linux, you'll also need libsecret-1-dev.
66
- Then install bun and run `bun install` in the root directory of the project.
7-
- After that in order to run the app without any of the proprietary features, you can run `bun tauri dev -- -- --no-default-features`.
7+
- Renderer-only development remains available through `bun run dev`.
8+
- Tauri development is available through `bun run dev:tauri`.
9+
- Electron development is available through `bun run dev:electron`.
10+
- To build the shared renderer only, run `bun run build`.
11+
- To build the native Electron addon explicitly, run `bun run build:napi`.
12+
- To package the Electron app, run `bun run package:electron`.
13+
- To build the Tauri app without any of the proprietary features, run `bun tauri dev -- -- --no-default-features`.

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44

55
> An easy way to manage your modpacks, written in React and Rust.
66
7+
## Desktop Runtimes
8+
9+
Quadrant supports two desktop runtimes, they share the frontend and backend logic, but differ in technicalities:
10+
11+
- `Tauri`: the original Quadrant experience.
12+
- `Electron`: the Node/Electron shell in `electron/`, backed by the Quadrant N-API bindings, should work better on Linux, because it replaces WebKit with CEF.
13+
714
### Installation guide:
815

916
##### The app is available on these stores:

0 commit comments

Comments
 (0)