Compare commits

...

11 Commits
v1.4.0 ... main

Author SHA1 Message Date
Jacob Schlecht f7223bcddb
fix: Add this missing ' (#274)
Signed-off-by: Jacob Schlecht <dadadah@echoha.us>
2026-08-15 16:11:40 -06:00
Jacob Schlecht 1fbd6f7dfb
feat: Add AppImage build flow to release (#271)
* Add files via upload

Signed-off-by: Arakandai <113034028+NewMasterDai@users.noreply.github.com>

* Update build-appimage.yml

requested changes

Signed-off-by: Arakandai <113034028+NewMasterDai@users.noreply.github.com>

* feat: App image build to release please

Signed-off-by: Jacob Schlecht <dadadah@echoha.us>

---------

Signed-off-by: Arakandai <113034028+NewMasterDai@users.noreply.github.com>
Signed-off-by: Jacob Schlecht <dadadah@echoha.us>
Co-authored-by: Arakandai <113034028+NewMasterDai@users.noreply.github.com>
2026-08-15 15:38:41 -06:00
Jacob Schlecht f79b113da1
fix: What if we just reloaded every startup, would that kill cache? (#269)
Signed-off-by: Jacob Schlecht <dadadah@echoha.us>
2026-08-05 16:36:00 -06:00
Jacob Schlecht 703381739a
chore: Add more ci/cd, fix broken windows build (#268)
Signed-off-by: Jacob Schlecht <dadadah@echoha.us>
2026-08-03 22:56:22 -06:00
Jacob Schlecht 689423100f
refactor: add mise, update electron-forge, add ci/cd workflow for lint (#252)
Signed-off-by: Jacob Schlecht <dadadah@echoha.us>
2026-07-24 16:00:44 -06:00
Jacob Schlecht c5573330a9
feat: Add flatpak build to release-please and update flatpak (#228)
Signed-off-by: Jacob Schlecht <dadadah@echoha.us>
2026-07-22 13:46:35 -06:00
stoat-release[bot] 730cc3d5d5
chore(main): release 1.4.2 (#242)
Co-authored-by: stoat-release[bot] <245062572+stoat-release[bot]@users.noreply.github.com>
2026-07-17 12:18:41 -06:00
Jacob Schlecht dc20b6e232
fix: Don't send audio as undefined and instead omit it (#241)
Signed-off-by: Jacob Schlecht <dadadah@echoha.us>
2026-07-17 12:17:16 -06:00
stoat-release[bot] a5664a35b7
chore(main): release 1.4.1 (#238)
Co-authored-by: stoat-release[bot] <245062572+stoat-release[bot]@users.noreply.github.com>
2026-07-16 15:30:01 -06:00
Jacob Schlecht 1940938850
fix: make electron use loopback instead of loopbackwithmute (#236)
Signed-off-by: Jacob Schlecht <dadadah@echoha.us>
2026-07-16 23:28:24 +02:00
Jacob Schlecht e00f3a860c
fix: Do not enable autostart on first launch (#237)
Signed-off-by: Jacob Schlecht <dadadah@echoha.us>
2026-07-13 11:01:14 -07:00
31 changed files with 1776 additions and 508 deletions

View File

@ -12,5 +12,14 @@
"plugin:import/electron", "plugin:import/electron",
"plugin:import/typescript" "plugin:import/typescript"
], ],
"parser": "@typescript-eslint/parser" "parser": "@typescript-eslint/parser",
"rules": {
"import/no-unresolved": ["error", {
"ignore": ["^.*\\?asset$"]
}],
"@typescript-eslint/no-unused-vars": ["warn", {
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_"
}]
}
} }

View File

@ -0,0 +1,13 @@
#!/bin/sh
set -eu
echo "Extracting Artifact..."
echo "---------------------------------------------------------------"
mkdir -p ./AppDir/bin
unzip /tmp/stoat/Stoat-linux-*.zip
mv -v ./Stoat-linux-"$BUILD_ARCH"/* ./AppDir/bin
echo "Packaging as version $BUILD_VERSION"
echo "$BUILD_VERSION" > ~/version

View File

@ -0,0 +1,11 @@
#!/bin/sh
set -eu
echo "Installing package dependencies..."
echo "---------------------------------------------------------------"
pacman -Syu --noconfirm libnss_nis nss-mdns nss pipewire
echo "Installing debloated packages..."
echo "---------------------------------------------------------------"
get-debloated-pkgs --add-common --prefer-nano

24
.github/build/appimage/make-appimage.sh vendored Normal file
View File

@ -0,0 +1,24 @@
#!/bin/sh
set -eu
ARCH=$(uname -m)
export ARCH
export OUTPATH=./dist
export ADD_HOOKS="self-updater.hook"
export UPINFO="gh-releases-zsync|${GITHUB_REPOSITORY%/*}|${GITHUB_REPOSITORY#*/}|latest|*$ARCH.AppImage.zsync"
export ICON=https://raw.githubusercontent.com/stoatchat/assets/f106946659af67ad4f008588ac51570029b2fd47/desktop/icon.png
export DESKTOP=https://raw.githubusercontent.com/stoatchat/for-desktop/refs/heads/main/chat.stoat.StoatDesktop.desktop
export DEPLOY_PIPEWIRE=1
# Deploy dependencies
quick-sharun ./AppDir/bin/*
# Additional changes can be done in between here
# Turn AppDir into AppImage
quick-sharun --make-appimage
# Test the app for 12 seconds, if the test fails due to the app
# having issues running in the CI use --simple-test instead
quick-sharun --test ./dist/*.AppImage

View File

@ -1,7 +1,15 @@
name: Build & Lint
on: on:
push: push:
branches: branches:
- main - main
paths-ignore:
- ".github/**"
- "!.github/workflows/build.yml"
- ".vscode/**"
- ".gitignore"
- "README.md"
pull_request: pull_request:
jobs: jobs:
@ -13,16 +21,22 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Checkout assets
run: git -c submodule."assets".update=checkout submodule update --init assets
- name: Setup Mise - name: Setup Mise
uses: immich-app/devtools/actions/use-mise@cd24790a7f5f6439ac32cc94f5523cb2de8bfa8c # use-mise-action-v1.1.0 uses: immich-app/devtools/actions/use-mise@7b8610a904d57da241e4ddba17fa62b62b15aed4 # use-mise-action-v2.0.2
with: with:
github-token: ${{ secrets.GITHUB_TOKEN }} github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout assets
run: mise assets
- name: Install dependencies - name: Install dependencies
run: pnpm install run: mise install:frozen
- name: Lint
run: mise lint
- name: Format
run: mise format
- name: Build - name: Build
run: pnpm run package run: mise build

View File

@ -0,0 +1,48 @@
name: Multiplatform Build
on:
push:
branches:
- main
paths-ignore:
- ".github/**"
- "!.github/workflows/build.yml"
- ".vscode/**"
- ".gitignore"
- "README.md"
pull_request:
jobs:
build:
name: Build App
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, macos-latest]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Checkout assets
run: git -c submodule."assets".update=checkout submodule update --init assets
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
run_install: false
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 26
cache: "pnpm"
- name: Install dependencies
run: pnpm ci
- name: Build
run: pnpm package

View File

@ -20,6 +20,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
outputs: outputs:
release_created: ${{ steps.rp.outputs.release_created }} release_created: ${{ steps.rp.outputs.release_created }}
release_version: ${{ steps.rp.outputs.version }}
steps: steps:
- id: app-token - id: app-token
uses: actions/create-github-app-token@v2 uses: actions/create-github-app-token@v2
@ -43,7 +44,7 @@ jobs:
strategy: strategy:
matrix: matrix:
os: [ubuntu-latest, windows-latest, macos-latest] os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-latest, macos-26-intel]
steps: steps:
- name: Checkout - name: Checkout
@ -52,6 +53,15 @@ jobs:
- name: Checkout assets - name: Checkout assets
run: git -c submodule."assets".update=checkout submodule update --init assets run: git -c submodule."assets".update=checkout submodule update --init assets
- name: Install Flatpak Tooling and Runtimes
if: matrix.os == 'ubuntu-latest' || matrix.os == 'ubuntu-24.04-arm'
run: |
sudo apt-get update
sudo apt-get install -y flatpak flatpak-builder
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak install -y --user flathub org.freedesktop.Platform//25.08 org.freedesktop.Sdk//25.08
flatpak install -y --user flathub org.electronjs.Electron2.BaseApp//stable
- name: Install pnpm - name: Install pnpm
uses: pnpm/action-setup@v4 uses: pnpm/action-setup@v4
with: with:
@ -60,7 +70,7 @@ jobs:
- name: Install Node.js - name: Install Node.js
uses: actions/setup-node@v4 uses: actions/setup-node@v4
with: with:
node-version: 22 node-version: 26
cache: "pnpm" cache: "pnpm"
- name: Install dependencies - name: Install dependencies
@ -73,16 +83,64 @@ jobs:
PLATFORM: ${{ matrix.os }} PLATFORM: ${{ matrix.os }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish macOS x64 - name: Upload artifact for AppImage build
if: matrix.os == 'macos-latest' if: matrix.os == 'ubuntu-latest' || matrix.os == 'ubuntu-24.04-arm'
run: pnpm run publish --arch=x64 uses: actions/upload-artifact@v6
env: with:
PLATFORM: ${{ matrix.os }} name: stoat-linux-package-${{ case(matrix.os == 'ubuntu-latest', 'x64', 'arm64') }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} path: ./out/make/zip/linux/${{ case(matrix.os == 'ubuntu-latest', 'x64', 'arm64') }}/Stoat-linux-*.zip
- name: Publish Linux arm64 build-appimage:
if: matrix.os == 'ubuntu-latest' needs: [release-please, publish-release]
run: pnpm run publish --arch=arm64 if: needs.release-please.outputs.release_created == 'true'
runs-on: ${{ matrix.runs-on }}
strategy:
matrix:
runs-on: [ubuntu-latest, ubuntu-24.04-arm]
container: ghcr.io/pkgforge-dev/archlinux:latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Download Artifact
uses: actions/download-artifact@v7
with:
name: stoat-linux-package-${{ case(matrix.os == 'ubuntu-latest', 'x64', 'arm64') }}
path: /tmp/stoat
- name: Preparing Container
uses: pkgforge-dev/anylinux-setup-action@0964f2258d6c93d1391359978dde081fd8b3c6af # v2
- name: Install Dependencies
run: /bin/sh ./.github/build/appimage/get-dependencies.sh
- name: Extract Artifact
run: /bin/sh ./.github/build/appimage/extract-artifact.sh
env:
BUILD_ARCH: ${{ case(matrix.os == 'ubuntu-latest', 'x64', 'arm64') }}
BUILD_VERSION: ${{ needs.release-please.outputs.release_version }}
- name: Make & Test AppImage
run: /bin/sh ./.github/build/appimage/make-appimage.sh
- name: Upload artifact
uses: actions/upload-artifact@v6
with:
name: AppImage-${{ case(matrix.os == 'ubuntu-latest', 'x64', 'arm64') }}
path: dist
publish-appimage:
runs-on: ubuntu-latest
needs: [release-please, build-appimage]
steps:
- name: Download Artifact
uses: actions/download-artifact@v7
with:
pattern: AppImage-*
merge-multiple: true
- name: Update release with AppImage
run: gh release upload ${{ needs.release-please.outputs.release_version }} Stoat-*.AppImage
env: env:
PLATFORM: ${{ matrix.os }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

7
.mise/config.toml Normal file
View File

@ -0,0 +1,7 @@
min_version = { soft = "2026.5.15", hard = "2026.5.12" }
[tools]
node = "26.2.0"
pnpm = "11.17.0"
gh = "2.93.0"
"github:git-town/git-town" = "23.0.1"

6
.mise/tasks/assets/_default Executable file
View File

@ -0,0 +1,6 @@
#!/usr/bin/env bash
#MISE description="Pull in Stoat brand assets"
#MISE depends=["assets:fallback"]
set -e
git -c submodule."assets".update=checkout submodule update --init assets

5
.mise/tasks/assets/fallback Executable file
View File

@ -0,0 +1,5 @@
#!/usr/bin/env bash
#MISE description="Remove Stoat brand assets and use fallback"
set -e
git submodule deinit -f assets

5
.mise/tasks/build/_default Executable file
View File

@ -0,0 +1,5 @@
#!/usr/bin/env bash
#MISE description="Build desktop app"
set -e
pnpm run package

5
.mise/tasks/dev/_default Executable file
View File

@ -0,0 +1,5 @@
#!/usr/bin/env bash
#MISE description="Run the desktop app in dev mode"
set -e
pnpm run start

5
.mise/tasks/format/_default Executable file
View File

@ -0,0 +1,5 @@
#!/usr/bin/env bash
#MISE description="Check code formatting"
set -e
pnpm run fmt

5
.mise/tasks/format/fix Executable file
View File

@ -0,0 +1,5 @@
#!/usr/bin/env bash
#MISE description="Fix code formatting"
set -e
pnpm run fmt:fix

5
.mise/tasks/install/frozen Executable file
View File

@ -0,0 +1,5 @@
#!/usr/bin/env bash
#MISE description="Install dependencies with frozen lockfile"
set -e
pnpm install --frozen-lockfile

5
.mise/tasks/lint/_default Executable file
View File

@ -0,0 +1,5 @@
#!/usr/bin/env bash
#MISE description="Lint code and find issues"
set -e
pnpm run lint

5
.mise/tasks/lint/fix Executable file
View File

@ -0,0 +1,5 @@
#!/usr/bin/env bash
#MISE description="Lint code and fix issues"
set -e
pnpm run lint:fix

12
.mise/tasks/make/_default Executable file
View File

@ -0,0 +1,12 @@
#!/usr/bin/env bash
#MISE description="Make desktop app targets"
#USAGE arg "[arch]" help="Make for a specific architecture" {
#USAGE choices "x64" "arm64"
#USAGE }
set -e
if [[ -z "$usage_arch" ]]; then
pnpm run make
else
pnpm run make --arch=$usage_arch
fi

View File

@ -1,3 +1,3 @@
{ {
".": "1.4.0" ".": "1.4.2"
} }

View File

@ -1,5 +1,20 @@
# Changelog # Changelog
## [1.4.2](https://github.com/stoatchat/for-desktop/compare/v1.4.1...v1.4.2) (2026-07-17)
### Bug Fixes
* Don't send audio as undefined and instead omit it ([#241](https://github.com/stoatchat/for-desktop/issues/241)) ([dc20b6e](https://github.com/stoatchat/for-desktop/commit/dc20b6e232e184ce1053cfdc7b83550e69ea285a))
## [1.4.1](https://github.com/stoatchat/for-desktop/compare/v1.4.0...v1.4.1) (2026-07-16)
### Bug Fixes
* Do not enable autostart on first launch ([#237](https://github.com/stoatchat/for-desktop/issues/237)) ([e00f3a8](https://github.com/stoatchat/for-desktop/commit/e00f3a860c566ea1e8287573144c2e081d243664))
* make electron use loopback instead of loopbackwithmute ([#236](https://github.com/stoatchat/for-desktop/issues/236)) ([1940938](https://github.com/stoatchat/for-desktop/commit/1940938850d9bf7d4821554dc2dbde96a9f94b8c))
## [1.4.0](https://github.com/stoatchat/for-desktop/compare/v1.3.0...v1.4.0) (2026-06-16) ## [1.4.0](https://github.com/stoatchat/for-desktop/compare/v1.3.0...v1.4.0) (2026-06-16)

View File

@ -29,9 +29,8 @@ _Contribution guidelines for Desktop app TBA!_
Before getting started, you'll want to install: Before getting started, you'll want to install:
- Git - [Git](https://git-scm.com/install/)
- Node.js - [mise-en-place](https://mise.jdx.dev/getting-started.html)
- pnpm (run `corepack enable`)
Then proceed to setup: Then proceed to setup:
@ -40,28 +39,31 @@ Then proceed to setup:
git clone --recursive https://github.com/stoatchat/for-desktop stoat-for-desktop git clone --recursive https://github.com/stoatchat/for-desktop stoat-for-desktop
cd stoat-for-desktop cd stoat-for-desktop
# Install tools from mise
mise install
# install all packages # install all packages
pnpm i --frozen-lockfile mise install:frozen
# start the application # start the application
pnpm start mise dev
# ... or build the bundle # ... or build the bundle
pnpm package mise build
# ... or build all distributables # ... or build all distributables
pnpm make mise make
``` ```
Various useful commands for development testing: Various useful commands for development testing:
```bash ```bash
# connect to the development server # connect to the development server
pnpm start -- --force-server http://localhost:5173 mise exec -- pnpm start -- --force-server http://localhost:5173
# test the flatpak (after `make`) # test the flatpak (after `make`)
pnpm install:flatpak mise exec -- pnpm install:flatpak
pnpm run:flatpak mise exec -- pnpm run:flatpak
# ... also connect to dev server like so: # ... also connect to dev server like so:
pnpm run:flatpak --force-server http://localhost:5173 mise exec -- pnpm run:flatpak --force-server http://localhost:5173
# Nix-specific instructions for testing # Nix-specific instructions for testing
pnpm package pnpm package
@ -78,7 +80,7 @@ If you want to pull in Stoat brand assets after pulling, run the following:
```bash ```bash
# update the assets # update the assets
git -c submodule."assets".update=checkout submodule update --init assets mise assets
``` ```
Currently, this is required to build, any forks are expected to provide their own assets. Currently, this is required to build, any forks are expected to provide their own assets.

View File

@ -38,6 +38,63 @@ const makers: ForgeConfig["makers"] = [
copyright: "Copyright (C) 2025 Revolt Platforms LTD", copyright: "Copyright (C) 2025 Revolt Platforms LTD",
}), }),
new MakerZIP({}), new MakerZIP({}),
new MakerFlatpak({
options: {
id: "chat.stoat.StoatDesktop",
description: STRINGS.description,
productName: STRINGS.name,
productDescription: STRINGS.description,
runtimeVersion: "25.08",
icon: {
"16x16": `${ASSET_DIR}/hicolor/16x16.png`,
"32x32": `${ASSET_DIR}/hicolor/32x32.png`,
"64x64": `${ASSET_DIR}/hicolor/64x64.png`,
"128x128": `${ASSET_DIR}/hicolor/128x128.png`,
"256x256": `${ASSET_DIR}/hicolor/256x256.png`,
"512x512": `${ASSET_DIR}/hicolor/512x512.png`,
} as unknown,
categories: ["Network"],
modules: [
// use the latest zypak -- Electron sandboxing for Flatpak
{
name: "zypak",
sources: [
{
type: "git",
url: "https://github.com/refi64/zypak",
tag: "v2025.09",
},
],
},
],
finishArgs: [
// default arguments found by running
// DEBUG=electron-installer-flatpak* pnpm make
"--socket=fallback-x11",
"--socket=wayland",
"--share=ipc",
"--share=network",
"--device=dri",
"--device=all",
"--socket=pulseaudio",
"--filesystem=xdg-run/pipewire-0",
"--filesystem=xdg-videos:ro",
"--filesystem=xdg-pictures:ro",
"--filesystem=xdg-download",
"--filesystem=xdg-run/speech-dispatcher",
"--talk-name=org.freedesktop.ScreenSaver",
"--talk-name=org.freedesktop.Notifications",
"--talk-name=org.kde.StatusNotifierWatcher",
"--talk-name=com.canonical.AppMenu.Registrar",
"--talk-name=com.canonical.indicator.application",
"--talk-name=com.canonical.Unity",
"--env=XCURSOR_PATH=/run/host/user-share/icons:/run/host/share/icons",
"--env=ELECTRON_TRASH=gio",
"--env=TMPDIR=xdg-run/app/chat.stoat.StoatDesktop",
],
files: [],
} as MakerFlatpakOptionsConfig,
}),
]; ];
// skip these makers in CI/CD // skip these makers in CI/CD
@ -50,65 +107,6 @@ if (!process.env.PLATFORM) {
packageExecutable: `app\\${STRINGS.execName}.exe`, packageExecutable: `app\\${STRINGS.execName}.exe`,
publisher: "CN=B040CC7E-0016-4AF5-957F-F8977A6CFA3B", publisher: "CN=B040CC7E-0016-4AF5-957F-F8977A6CFA3B",
}), }),
// flatpak publishing should occur through flathub repos.
// this is just for testing purposes
new MakerFlatpak({
options: {
id: "chat.stoat.stoat-desktop",
description: STRINGS.description,
productName: STRINGS.name,
productDescription: STRINGS.description,
runtimeVersion: "25.08",
icon: {
"16x16": `${ASSET_DIR}/hicolor/16x16.png`,
"32x32": `${ASSET_DIR}/hicolor/32x32.png`,
"64x64": `${ASSET_DIR}/hicolor/64x64.png`,
"128x128": `${ASSET_DIR}/hicolor/128x128.png`,
"256x256": `${ASSET_DIR}/hicolor/256x256.png`,
"512x512": `${ASSET_DIR}/hicolor/512x512.png`,
} as unknown,
categories: ["Network"],
modules: [
// use the latest zypak -- Electron sandboxing for Flatpak
{
name: "zypak",
sources: [
{
type: "git",
url: "https://github.com/refi64/zypak",
tag: "v2025.09",
},
],
},
],
finishArgs: [
// default arguments found by running
// DEBUG=electron-installer-flatpak* pnpm make
"--socket=fallback-x11",
"--socket=wayland",
"--share=ipc",
"--share=network",
"--device=dri",
"--device=all",
"--socket=pulseaudio",
"--filesystem=home",
"--filesystem=xdg-run/pipewire-0",
"--filesystem=xdg-videos:ro",
"--filesystem=xdg-pictures:ro",
"--filesystem=xdg-run/speech-dispatcher",
"--talk-name=org.freedesktop.ScreenSaver",
"--talk-name=org.freedesktop.Notifications",
"--talk-name=org.kde.StatusNotifierWatcher",
"--talk-name=com.canonical.AppMenu.Registrar",
"--talk-name=com.canonical.indicator.application",
"--talk-name=com.canonical.Unity",
"--env=XCURSOR_PATH=/run/host/user-share/icons:/run/host/share/icons",
"--env=ELECTRON_TRASH=gio",
"--env=TMPDIR=xdg-run/app/chat.stoat.stoat-desktop",
],
files: [],
} as MakerFlatpakOptionsConfig,
}),
// testing purposes // testing purposes
new MakerDeb({ new MakerDeb({
options: { options: {

View File

@ -1,5 +0,0 @@
[tools]
node = "25.4.0"
pnpm = "10.28.1"
gh = "2.25.0"
"github:git-town/git-town" = "22.4.0"

View File

@ -1,7 +1,7 @@
{ {
"name": "stoat-desktop", "name": "stoat-desktop",
"productName": "stoat-desktop", "productName": "stoat-desktop",
"version": "1.4.0", "version": "1.4.2",
"main": ".vite/build/main.js", "main": ".vite/build/main.js",
"repository": "stoatchat/desktop", "repository": "stoatchat/desktop",
"scripts": { "scripts": {
@ -10,8 +10,11 @@
"make": "electron-forge make", "make": "electron-forge make",
"publish": "electron-forge publish", "publish": "electron-forge publish",
"lint": "eslint --ext .ts,.tsx .", "lint": "eslint --ext .ts,.tsx .",
"install:flatpak": "flatpak --user install out/make/flatpak/x86_64/chat.stoat.stoat-desktop_stable_x86_64.flatpak", "lint:fix": "eslint --ext --fix .ts,.tsx .",
"run:flatpak": "flatpak run --socket=session-bus chat.stoat.stoat-desktop", "fmt": "prettier --check 'src/**/*.{ts,tsx,json}'",
"fmt:fix": "prettier --write 'src/**/*.{ts,tsx,json}'",
"install:flatpak": "flatpak --user install out/make/flatpak/x86_64/chat.stoat.StoatDesktop_stable_x86_64.flatpak",
"run:flatpak": "flatpak run --socket=session-bus chat.stoat.StoatDesktop",
"run:nix": "/usr/bin/env electron-nix ." "run:nix": "/usr/bin/env electron-nix ."
}, },
"keywords": [], "keywords": [],
@ -20,15 +23,16 @@
"email": "me@insrt.uk" "email": "me@insrt.uk"
}, },
"devDependencies": { "devDependencies": {
"@electron-forge/cli": "^7.9.0", "@electron-forge/cli": "^7.11.2",
"@electron-forge/maker-deb": "^7.9.0", "@electron-forge/maker-appx": "^7.11.2",
"@electron-forge/maker-flatpak": "^7.9.0", "@electron-forge/maker-deb": "^7.11.2",
"@electron-forge/maker-squirrel": "^7.9.0", "@electron-forge/maker-flatpak": "^7.11.2",
"@electron-forge/maker-zip": "^7.9.0", "@electron-forge/maker-squirrel": "^7.11.2",
"@electron-forge/plugin-auto-unpack-natives": "^7.9.0", "@electron-forge/maker-zip": "^7.11.2",
"@electron-forge/plugin-fuses": "^7.9.0", "@electron-forge/plugin-auto-unpack-natives": "^7.11.2",
"@electron-forge/plugin-vite": "^7.9.0", "@electron-forge/plugin-fuses": "^7.11.2",
"@electron-forge/publisher-github": "^7.9.0", "@electron-forge/plugin-vite": "^7.11.2",
"@electron-forge/publisher-github": "^7.11.2",
"@electron/fuses": "^1.8.0", "@electron/fuses": "^1.8.0",
"@trivago/prettier-plugin-sort-imports": "^5.2.2", "@trivago/prettier-plugin-sort-imports": "^5.2.2",
"@types/auto-launch": "^5.0.5", "@types/auto-launch": "^5.0.5",
@ -37,15 +41,17 @@
"@typescript-eslint/eslint-plugin": "^5.62.0", "@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0", "@typescript-eslint/parser": "^5.62.0",
"electron": "^40.8.3", "electron": "^40.8.3",
"electron-vite": "^5.0.0",
"electron-windows-store": "^2.1.0",
"eslint": "^8.57.1", "eslint": "^8.57.1",
"eslint-plugin-import": "^2.32.0", "eslint-plugin-import": "^2.32.0",
"json-schema-typed": "^8.0.1", "json-schema-typed": "^8.0.1",
"lodash": "^4.17.21",
"prettier": "^3.6.2", "prettier": "^3.6.2",
"typescript": "~4.5.4", "typescript": "~4.5.4",
"vite": "^5.4.20" "vite": "^5.4.20"
}, },
"dependencies": { "dependencies": {
"@electron-forge/maker-appx": "^7.9.0",
"@homebridge/dbus-native": "^0.7.2", "@homebridge/dbus-native": "^0.7.2",
"auto-launch": "^5.0.6", "auto-launch": "^5.0.6",
"bufferutil": "^4.0.9", "bufferutil": "^4.0.9",
@ -55,5 +61,5 @@
"update-electron-app": "^3.1.1", "update-electron-app": "^3.1.1",
"utf-8-validate": "^6.0.5" "utf-8-validate": "^6.0.5"
}, },
"packageManager": "pnpm@10.18.1+sha512.77a884a165cbba2d8d1c19e3b4880eee6d2fcabd0d879121e282196b80042351d5eb3ca0935fa599da1dc51265cc68816ad2bddd2a2de5ea9fdf92adbec7cd34" "packageManager": "pnpm@11.17.0+sha512.cca3cea332ad254bb84145f966d19f4879615210346fc92c79a047f23a0d7b3cca3c3792f0076ba1f1831d277efbcf0a9119b31a9a60eca7fb3d6231f331ef72"
} }

File diff suppressed because it is too large Load Diff

View File

@ -1,9 +1,15 @@
allowBuilds:
bufferutil: true
electron: true
electron-winstaller: true
esbuild: true
register-scheme@https://codeload.github.com/devsnek/node-register-scheme/tar.gz/e7cc9a63a1f512565da44cb57316d9fb10750e17: true
utf-8-validate: true
nodeLinker: hoisted nodeLinker: hoisted
onlyBuiltDependencies: blockExoticSubdeps: false # required to make discord-rpc work
- bufferutil
- electron # Override for node 26 bug
- electron-winstaller overrides:
- esbuild yauzl: ^3.3.1
- register-scheme
- utf-8-validate

View File

@ -3,7 +3,6 @@ import { IUpdateInfo, updateElectronApp } from "update-electron-app";
import { BrowserWindow, Notification, app, shell } from "electron"; import { BrowserWindow, Notification, app, shell } from "electron";
import started from "electron-squirrel-startup"; import started from "electron-squirrel-startup";
import { autoLaunch } from "./native/autoLaunch";
import { config } from "./native/config"; import { config } from "./native/config";
import { initDiscordRpc } from "./native/discordRpc"; import { initDiscordRpc } from "./native/discordRpc";
import { initTray } from "./native/tray"; import { initTray } from "./native/tray";
@ -43,11 +42,10 @@ if (acquiredLock) {
// create window and application contexts // create window and application contexts
createMainWindow(); createMainWindow();
// enable auto start on Windows and MacOS // save first launch state
if (config.firstLaunch) { if (config.firstLaunch) {
if (process.platform === "win32" || process.platform === "darwin") { // Doesn't do anything right now. Used to enable auto start, but that behaviour was removed.
autoLaunch.enable(); // Left in case it gets used in the future.
}
config.firstLaunch = false; config.firstLaunch = false;
} }

View File

@ -2,8 +2,6 @@ import AutoLaunch from "auto-launch";
import { ipcMain } from "electron"; import { ipcMain } from "electron";
import { mainWindow } from "./window";
export const autoLaunch = new AutoLaunch({ export const autoLaunch = new AutoLaunch({
name: "Stoat", name: "Stoat",
}); });

View File

@ -47,7 +47,7 @@ export async function setBadgeCount(count: number) {
signature: "sa{sv}", signature: "sa{sv}",
body: [ body: [
process.env.container === "1" process.env.container === "1"
? "application://chat.stoat.stoat-desktop.desktop" // flatpak handling ? "application://chat.stoat.StoatDesktop.desktop" // flatpak handling
: "application://stoat-desktop.desktop", : "application://stoat-desktop.desktop",
[ [
["count", ["x", Math.min(count, 0)]], ["count", ["x", Math.min(count, 0)]],

View File

@ -29,10 +29,10 @@ export function initTray() {
tray.setImage(trayIcon); tray.setImage(trayIcon);
tray.on("click", () => { tray.on("click", () => {
if (mainWindow.isVisible()) { if (mainWindow.isVisible()) {
mainWindow.hide(); mainWindow.hide();
} else { } else {
mainWindow.show(); mainWindow.show();
mainWindow.focus(); mainWindow.focus();
} }
}); });
} }

View File

@ -89,7 +89,9 @@ export function createMainWindow() {
} }
// load the entrypoint // load the entrypoint
mainWindow.loadURL(BUILD_URL.toString()); mainWindow
.loadURL(BUILD_URL.toString())
.then(() => mainWindow.webContents.reload());
// minimise window to tray // minimise window to tray
mainWindow.on("close", (event) => { mainWindow.on("close", (event) => {
@ -202,10 +204,14 @@ export function createMainWindow() {
if (sources.length == 1) { if (sources.length == 1) {
// TODO: Get audio to work with wayland // TODO: Get audio to work with wayland
// See vencord for an implementation using a virtual microphone. // See vencord for an implementation using a virtual microphone.
callback({ request.audioRequested
video: sources[0], ? callback({
audio: request.audioRequested ? "loopbackWithMute" : undefined, video: sources[0],
}); audio: "loopback",
})
: callback({
video: sources[0],
});
return; return;
} }
ipcMain.once( ipcMain.once(
@ -214,10 +220,14 @@ export function createMainWindow() {
if (idx < 0 || idx > sources.length) { if (idx < 0 || idx > sources.length) {
callback({}); callback({});
} else { } else {
callback({ audio
video: sources[idx], ? callback({
audio: audio ? "loopbackWithMute" : undefined, video: sources[idx],
}); audio: "loopback",
})
: callback({
video: sources[idx],
});
} }
}, },
); );