Compare commits

..

3 Commits

Author SHA1 Message Date
Louka
b73e147d17 Merge branch 'main' into tpose 2023-01-26 20:43:24 -05:00
Louka
4dae31a138 math wip 2023-01-26 20:42:55 -05:00
Louka
32d0674aad add tpose and ipose toggle 2023-01-23 21:33:01 -05:00
957 changed files with 60323 additions and 111519 deletions

View File

@@ -21,4 +21,3 @@ max_line_length = 88
indent_size = 4
indent_style = tab
max_line_length = 88
ij_kotlin_packages_to_use_import_on_demand = java.util.*,kotlin.math.*

9
.envrc
View File

@@ -1,9 +0,0 @@
if ! has nix_direnv_version || ! nix_direnv_version 2.2.1; then
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.2.1/direnvrc" "sha256-zelF0vLbEl5uaqrfIzbgNzJWGmLzCmYAkInj/LNxvKs="
fi
nix_direnv_watch_file package.json
if ! use flake . --impure
then
echo "devenv could not be built. The devenv environment was not loaded. Make the necessary changes to devenv.nix and hit enter to try again." >&2
fi

5
.gitattributes vendored
View File

@@ -1,5 +0,0 @@
* text=auto
*.png binary
*.webp binary
*.gif binary

63
.github/CODEOWNERS vendored
View File

@@ -1,37 +1,26 @@
# Global code owner
* @Eirenliel
# Make everyone be able to approve SolarXR submodule changes
/solarxr-protocol @ButterscotchV @Erimelowo @loucass003
# Make Loucass the owner of all GUI stuff
/gui/ @loucass003
/pnpm-lock.yaml @loucass003
/pnpm-workspace.yaml @loucass003
# loucass003 and Erimel responsible for i18n
/gui/public/i18n/ @loucass003 @Erimelowo @ImSapphire
/gui/src/i18n/ @loucass003 @Erimelowo
/l10n.toml @loucass003 @Erimelowo
/gui/src/components/settings/ @Erimelowo @loucass003
# Rust part of the GUI
/gui/electron/ @loucass003
# Some server code~
/server/ @ButterscotchV @Eirenliel @Erimelowo
/server/src/main/java/dev/slimevr/autobone/ @ButterscotchV
/server/src/main/java/dev/slimevr/poserecorder/ @ButterscotchV
/server/src/main/java/dev/slimevr/posestreamer/ @ButterscotchV
/server/src/main/java/dev/slimevr/osc/ @Erimelowo
/server/src/main/java/dev/slimevr/tracking/processor/ @Erimelowo
/server/src/main/java/dev/slimevr/filtering/ @Erimelowo
# Linux files
*.nix @loucass003
/flake.lock @loucass003
/dev.slimevr.SlimeVR.metainfo.xml @loucass003
/.envrc @loucass003
# Global code owner
* @Eirenliel
# Make Loucas the owner of all GUI stuff
/gui/ @loucass003
# Uriel and Erimel responsible for i18n
/gui/public/i18n/ @ImUrX @Louka3000
/gui/src/i18n/ @ImUrX @Louka3000 @loucass003
/gui/src/components/settings/ @Louka3000 @loucass003
/gui/src-tauri/ @ImUrX @TheButlah
# Some server code~
/server/ @ButterscotchV @Eirenliel @Louka3000
/server/src/main/java/dev/slimevr/autobone/ @ButterscotchV
/server/src/main/java/dev/slimevr/poserecorder/ @ButterscotchV
/server/src/main/java/dev/slimevr/posestreamer/ @ButterscotchV
/server/src/main/java/dev/slimevr/osc/ @Louka3000
/server/src/main/java/dev/slimevr/vr/processor/ @Louka3000
/server/src/main/java/dev/slimevr/filtering/ @Louka3000
server/src/main/java/dev/slimevr/config/ @loucass003

3
.github/FUNDING.yml vendored
View File

@@ -1,3 +0,0 @@
# These are supported funding model platforms
github: SlimeVR

View File

@@ -1,8 +0,0 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every week
interval: "weekly"

37
.github/labeler.yml vendored
View File

@@ -1,37 +0,0 @@
"Area: Continuous Integration":
- changed-files:
- any-glob-to-any-file: ".github/**"
"Area: Application Protocol":
- changed-files:
- any-glob-to-any-file: ["solarxr-protocol"]
"Area: AutoBone":
- changed-files:
- any-glob-to-any-file: "server/core/src/main/java/dev/slimevr/autobone/**"
"Area: Documentation":
- changed-files:
- any-glob-to-any-file: "**/*.md"
"Area: GUI":
- all:
- changed-files:
- all-globs-to-any-file: ["gui/**/*", "!gui/public/i18n/**/*"]
"Area: Hardware Protocol":
- changed-files:
- any-glob-to-any-file: "server/core/src/main/java/dev/slimevr/tracking/trackers/udp/**"
"Area: Server":
- changed-files:
- any-glob-to-any-file: ["server/**", "*gradle*", "gradle/**"]
"Area: Skeletal Model":
- changed-files:
- any-glob-to-any-file: "server/core/src/main/java/dev/slimevr/tracking/processor/**"
"Area: SteamVR Driver":
- changed-files:
- any-glob-to-any-file: "server/desktop/src/main/java/dev/slimevr/desktop/platform/**"
"Area: Translation":
- changed-files:
- any-glob-to-any-file: "gui/public/i18n/**"
"Area: VMC":
- changed-files:
- any-glob-to-any-file: ["server/core/src/main/java/dev/slimevr/osc/Unity*", "server/core/src/main/java/dev/slimevr/osc/VMC*", "server/core/src/main/java/dev/slimevr/osc/VRM*"]
"Area: VRCOSC":
- changed-files:
- any-glob-to-any-file: ["server/core/src/main/java/dev/slimevr/osc/VRC*"]

81
.github/workflows/build-gui.yml vendored Normal file
View File

@@ -0,0 +1,81 @@
name: Build GUI
on:
push:
branches:
- main
paths:
- .github/workflows/build-gui.yml
- gui/**
- package*.json
pull_request:
paths:
- .github/workflows/build-gui.yml
- gui/**
- package*.json
workflow_dispatch:
create:
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, windows-latest]
runs-on: ${{ matrix.os }}
env:
# Don't mark warnings as errors
CI: false
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- if: matrix.os == 'ubuntu-20.04'
name: Set up Linux dependencies
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf
# Increment to invalidate the cache
version: 1.0
# Enables a workaround to attempt to run pre and post install scripts
execute_install_scripts: true
# Disables uploading logs as a build artifact
debug: false
- name: Cache cargo dependencies
uses: Swatinem/rust-cache@v2
with:
shared-key: "tauri"
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version-file: '.node-version'
cache: 'npm'
- name: Build
run: |
npm ci
npm run skipbundler
- if: matrix.os == 'windows-latest'
name: Upload a Build Artifact
uses: actions/upload-artifact@v3.1.0
with:
# Artifact name
name: SlimeVR-GUI
# A file, directory or wildcard pattern that describes what to upload
path: target/release/slimevr.exe
- if: matrix.os == 'ubuntu-20.04'
name: Upload a Build Artifact
uses: actions/upload-artifact@v3.1.0
with:
# Artifact name
name: SlimeVR-GUI-Linux
# A file, directory or wildcard pattern that describes what to upload
path: target/release/slimevr

View File

@@ -1,281 +0,0 @@
name: SlimeVR Full Build
on:
push:
branches: [main]
tags: ["v*"]
pull_request:
workflow_dispatch:
jobs:
setup-matrix:
name: Configure Build Matrix
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- id: set-matrix
shell: bash
run: |
BASE='[{"os":"ubuntu-22.04","platform":"linux"},{"os":"windows-latest","platform":"windows"},{"os":"macos-latest","platform":"macos"}]'
EXTRA='[{"os":"ubuntu-22.04-arm","platform":"linux"},{"os":"windows-11-arm","platform":"windows"}]'
if [[ "${{ github.ref }}" == refs/tags/v* || "${{ github.ref }}" == refs/heads/main || "${{ github.event_name }}" == "workflow_dispatch" ]]; then
RESULT=$(echo "$BASE $EXTRA" | jq -c -s 'add')
else
RESULT=$(echo "$BASE" | jq -c '.')
fi
echo "matrix={\"include\":$RESULT}" >> "$GITHUB_OUTPUT"
gui-checks:
name: Gui Checks
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
submodules: recursive
- name: Setup PNPM
uses: pnpm/action-setup@v4
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version-file: '.node-version'
cache: 'pnpm'
- name: GUI Lint
run: pnpm i && cd gui && pnpm run lint
java-checks:
name: Java Checks
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
submodules: recursive
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
java-version: '17'
distribution: 'adopt'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v5
- name: Java Spotless Check
run: ./gradlew spotlessCheck --build-cache
build-server-jar:
name: Build Desktop Server
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
submodules: recursive
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
java-version: '17'
distribution: 'adopt'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v5
- name: Build ShadowJar
run: ./gradlew :server:desktop:shadowJar --build-cache
- name: Test with Gradle
run: ./gradlew :server:desktop:test
- name: Upload Server Jar
uses: actions/upload-artifact@v6
with:
name: server-jar
path: |
server/desktop/build/libs/slimevr.jar
server/core/resources
build-gui-frontend:
name: Build GUI Assets
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
submodules: recursive
- name: Setup PNPM
uses: pnpm/action-setup@v4
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version-file: '.node-version'
cache: 'pnpm'
- name: Build JS
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
run: pnpm i && cd gui && pnpm run build
- name: Tar GUI Dist
run: tar -czf slimevr-gui-dist.tar.gz -C gui/out .
- name: Upload GUI Dist
uses: actions/upload-artifact@v6
with:
name: gui-dist
path: slimevr-gui-dist.tar.gz
package-desktop:
name: Package Desktop (${{ matrix.platform }} - ${{ matrix.os }})
needs: [setup-matrix, build-server-jar, build-gui-frontend]
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix) }}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v6
with:
submodules: recursive
- name: Setup PNPM
uses: pnpm/action-setup@v4
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version-file: '.node-version'
cache: 'pnpm'
- name: Download Server Jar
uses: actions/download-artifact@v6
with:
name: server-jar
path: server
- name: Download GUI Dist
uses: actions/download-artifact@v6
with:
name: gui-dist
- name: Extract GUI for Electron
shell: bash
run: mkdir -p gui/out && tar -xzf slimevr-gui-dist.tar.gz -C gui/out
- name: Run Electron Builder
shell: bash
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
run: |
mkdir -p gui/dist/artifacts/linux/ \
gui/dist/artifacts/win \
gui/dist/artifacts/mac
cd gui
pnpm i
pnpm exec electron-builder --${{ matrix.platform }} \
${{ matrix.platform == 'macos' && '--universal' || '' }} \
--publish never
- name: Collect and Rename Artifacts
shell: bash
run: |
SRC_DIR="${{ github.workspace }}/gui/dist/artifacts"
DEST_DIR="${{ github.workspace }}/release-out"
mkdir -p "$DEST_DIR"
if [ "${{ matrix.platform }}" == "windows" ]; then
[[ "${{ matrix.os }}" == *"arm"* ]] && SUFFIX="win-aarch64" || SUFFIX="win64"
cp "$SRC_DIR"/win/*.zip "$DEST_DIR/SlimeVR-$SUFFIX.zip"
elif [ "${{ matrix.platform }}" == "linux" ]; then
for f in "$SRC_DIR"/linux/*; do
[ -d "$f" ] && continue
BASE=$(basename "$f")
NEW_NAME=$(echo "$BASE" | sed -e 's/x86_64/amd64/g' -e 's/arm64/aarch64/g')
cp "$f" "$DEST_DIR/$NEW_NAME"
done
elif [ "${{ matrix.platform }}" == "macos" ]; then
cp "$SRC_DIR"/mac/*.dmg "$DEST_DIR/SlimeVR-mac.dmg"
fi
echo "Collected files:"
ls -lh "$DEST_DIR"
- name: Upload For Release
uses: actions/upload-artifact@v6
with:
name: release-${{ matrix.platform }}-${{ matrix.os }}
path: release-out/*
bundle-android:
name: Build Android APK
needs: [build-gui-frontend]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
submodules: recursive
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
java-version: '17'
distribution: 'adopt'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v5
- name: Download GUI Dist
uses: actions/download-artifact@v6
with:
name: gui-dist
- name: Extract GUI for Android
run: mkdir -p gui/out && tar -xzf slimevr-gui-dist.tar.gz -C gui/out
- name: Build APK
run: ./gradlew :server:android:build --build-cache
env:
ANDROID_STORE_FILE: ${{ secrets.ANDROID_STORE_FILE }}
ANDROID_STORE_PASSWD: ${{ secrets.ANDROID_STORE_PASSWD }}
ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }}
ANDROID_KEY_PASSWD: ${{ secrets.ANDROID_KEY_PASSWD }}
- name: Test with Gradle
run: ./gradlew test
- name: Prepare APK
run: cp server/android/build/outputs/apk/release/*.apk ./SlimeVR-android.apk
- name: Upload APK
uses: actions/upload-artifact@v6
with:
name: release-android
path: SlimeVR-android.apk
- name: Build Google Play release bundle
if: startsWith(github.ref, 'refs/tags/')
run: ./gradlew :server:android:bundleRelease
env:
ANDROID_STORE_FILE: ${{ secrets.ANDROID_GPLAY_STORE_FILE }}
ANDROID_STORE_PASSWD: ${{ secrets.ANDROID_GPLAY_STORE_PASSWD }}
ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_GPLAY_KEY_ALIAS }}
ANDROID_KEY_PASSWD: ${{ secrets.ANDROID_GPLAY_KEY_PASSWD }}
- name: Upload the Google Play artifact
uses: actions/upload-artifact@v6
if: startsWith(github.ref, 'refs/tags/')
with:
# Artifact name
name: 'SlimeVR-Android-GPDev' # optional, default is artifact
# A file, directory or wildcard pattern that describes what to upload
path: server/android/build/outputs/bundle/release/*
create-release:
name: Finalize Release Draft
needs: [package-desktop, bundle-android, build-server-jar, build-gui-frontend]
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: Download All Release Artifacts
uses: actions/download-artifact@v6
with:
pattern: release-*
path: release-out
merge-multiple: true
- name: Download Server Jar
uses: actions/download-artifact@v6
with:
name: server-jar
path: server
- name: Download GUI Dist
uses: actions/download-artifact@v6
with:
name: gui-dist
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
draft: true
generate_release_notes: true
files: |
release-out/*
server/desktop/build/libs/slimevr.jar
slimevr-gui-dist.tar.gz

View File

@@ -1,34 +0,0 @@
# This workflow will build the update manifest for the updater and update a GitHub release
name: Generate update manifest
on:
workflow_dispatch:
release:
types: [released]
jobs:
generate-manifest:
runs-on: ubuntu-22.04
steps:
- uses: actions/setup-node@v6
with:
node-version: '22.x'
- name: Generate update-manifest.json
run: |
npx @slimevr/update-manifest-generator@latest
- uses: actions/upload-artifact@v6
with:
name: "update-manifest.json"
path: ./update-manifest.json
- name: Upload update-manifest.json to release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ secrets.UPDATE_MANIFEST_RELEASE_TAG }}
files: ./update-manifest.json
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

132
.github/workflows/gradle.yaml vendored Normal file
View File

@@ -0,0 +1,132 @@
# This workflow will build a Java project with Gradle
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
name: SlimeVR Server
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
create:
jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: "17"
distribution: "adopt"
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Check code formatting
run: ./gradlew spotlessCheck
- name: Test with Gradle
run: ./gradlew test
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: "17"
distribution: "adopt"
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Build with Gradle
run: ./gradlew shadowJar
- name: Upload the Server JAR as a Build Artifact
uses: actions/upload-artifact@v3
with:
# Artifact name
name: "SlimeVR-Server" # optional, default is artifact
# A file, directory or wildcard pattern that describes what to upload
path: server/build/libs/*
bundle:
runs-on: ubuntu-20.04
needs: build
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/download-artifact@v3
with:
name: "SlimeVR-Server"
path: server/build/libs/
- name: Set up Linux dependencies
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf libfuse2
# Increment to invalidate the cache
version: 1.0
# Enables a workaround to attempt to run pre and post install scripts
execute_install_scripts: true
# Disables uploading logs as a build artifact
debug: false
- name: Cache cargo dependencies
uses: Swatinem/rust-cache@v2
with:
shared-key: "tauri"
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version-file: '.node-version'
cache: 'npm'
- name: Build
run: |
npm ci
npm run tauri build
- uses: actions/upload-artifact@v3.1.0
with:
name: SlimeVR-GUI-Deb
path: target/release/bundle/deb/slimevr*.deb
- name: Install appimage-builder
run: |
wget "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage"
chmod a+x appimagetool-x86_64.AppImage
sudo mv appimagetool-x86_64.AppImage /usr/local/bin/appimagetool
- name: Modify and Build AppImage
run: |
cd target/release/bundle/appimage
chmod a+x slimevr*.AppImage
./slimevr*.AppImage --appimage-extract
cp $( git rev-parse --show-toplevel )/server/build/libs/slimevr.jar squashfs-root/slimevr.jar
chmod 644 squashfs-root/slimevr.jar
appimagetool squashfs-root slimevr*.AppImage
- uses: actions/upload-artifact@v3.1.0
with:
name: SlimeVR-GUI-AppImage
path: target/release/bundle/appimage/slimevr*.AppImage

View File

@@ -1,22 +0,0 @@
# This workflow will triage pull requests and apply a label based on the
# paths that are modified in the pull request.
#
# To use this workflow, you will need to set up a .github/labeler.yml
# file with configuration. For more information, see:
# https://github.com/actions/labeler
name: Labeler
on: [pull_request_target]
jobs:
label:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/labeler@v6
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"

View File

@@ -1,21 +0,0 @@
name: Update translations in main
on:
push:
branches:
- pontoon
jobs:
pull_request:
if: ${{ github.repository == 'SlimeVR/SlimeVR-Server' }}
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
- name: pull-request
env:
GH_TOKEN: ${{ secrets.PONTOON_BOT_KEY }}
run: |
gh_pr_up() { gh pr create "$@" --label "Area: Translation" --base main || gh pr edit "$@"; }
gh_pr_up --title "New Pontoon translations" --body "Please don't squash me 🥺"

View File

@@ -1,39 +0,0 @@
# This workflow will rebase `pontoon` with `main` changes, it's for making the
# Pontoon bot not try making commits to main
name: Rebase pontoon branch to main
on:
push:
branches:
- main
jobs:
rebase:
if: ${{ github.repository == 'SlimeVR/SlimeVR-Server' }}
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v6
with:
ref: pontoon
submodules: recursive
# Get all the git history for rebasing
fetch-depth: 0
- name: Rebase
run: |
git config --local user.name "slimevr-bot"
git config --local user.email 'pantoon@slimevr.dev'
git fetch origin main
git rebase origin/main
git submodule update
- name: Push rebase
uses: github-actions-x/commit@v2.9
with:
github-token: ${{ secrets.PONTOON_BOT_KEY }}
push-branch: "pontoon"
commit-message: "update"
force-push: "true"
name: "slimevr-bot"
email: "pantoon@slimevr.dev"

20
.gitignore vendored
View File

@@ -7,8 +7,6 @@
# Ignore .idea
.idea
# Ignore .fleet
.fleet
# Ignore eclipse stuff
.project
@@ -17,7 +15,6 @@
# VSCode stuff
/.vscode/settings.json
/.vscode/launch.json
# Ignore eclipse stuff
.project
@@ -28,22 +25,9 @@
/node_modules
.husky
# kotlin stuff
/.kotlin
# ignore gradle build folder
build/
# direnv has been claimed for Nix usage
.direnv/
.devenv
# Ignore Android local properties
local.properties
# Ignore temporary config
vrconfig.yml.tmp
# Nixos
.bin/
# Rust build artifacts
/target

View File

@@ -1,33 +0,0 @@
YELLOW="\033[1;33m"
GREEN="\033[1;32m"
RESET="\033[0m"
if git rev-parse -q --verify MERGE_HEAD; then
echo -e "${YELLOW}Skipping precommit hook because of merge${RESET}"
exit 0
fi
APP_PRE_COMMIT_OPTIONS="$(dirname "$0")/_/pre-commit.options"
if ! [ -f "$APP_PRE_COMMIT_OPTIONS" ]; then
echo -e "${YELLOW}\nSkipping pre-commit hook."
echo -e "If you want to use pre-commit for lint-staged, run:\n"
echo -e " ${GREEN}echo -e 'APP_LINT=true;' > ${APP_PRE_COMMIT_OPTIONS}${RESET}"
echo -e "${YELLOW}\nIt will add some delay before committing!\n${RESET}"
exit 0
fi
source $APP_PRE_COMMIT_OPTIONS
if [ -n "${APP_LINT}" ] && [ "${APP_LINT}" == "true" ]; then
echo -e "${GREEN}[husky] [pre-commit] [lint-staged]${RESET}"
case "$(uname -sr)" in
CYGWIN*|MINGW*|MINGW32*|MSYS*)
npx.cmd lint-staged
;;
*)
npx lint-staged
;;
esac
fi

View File

@@ -1,3 +0,0 @@
{
"ignoredFiles": ["gui/src-tauri/icons/*"]
}

View File

@@ -1,9 +0,0 @@
export default {
'server/**/*.{java,kt,kts}': (filenames) =>
filenames.map(
(filename) =>
`./gradlew${
process.platform === 'win32' ? '.bat' : ''
} spotlessApply "-PspotlessIdeHook=${filename}"`
),
};

View File

@@ -1 +1 @@
22.17.0
18.12.1

1
.npmrc
View File

@@ -1 +0,0 @@
update-notifier=false

View File

@@ -7,10 +7,9 @@
"gaborv.flatbuffers",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"rust-lang.rust-analyzer",
"bradlc.vscode-tailwindcss",
"EditorConfig.EditorConfig",
"macabeus.vscode-fluent",
"redhat.vscode-yaml"
"EditorConfig.EditorConfig"
],
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
"unwantedRecommendations": []

View File

@@ -1,65 +1,41 @@
# Contributing to SlimeVR
This document describes essential knowledge required to contribute to the SlimeVR Server.
This document describes essential knowledge for contributors to SlimeVR.
### Prerequisites
## How to get started
- [Git](https://git-scm.com/downloads)
- [Java v17+](https://adoptium.net/temurin/releases/)
- [Node.js v16.9+](https://nodejs.org) (We recommend the use of `nvm` instead of installing Node.js directly)
## Cloning the code
First, clone the codebase using git in a terminal in the folder you want.
### Getting the code
First, clone the codebase using `git`. If you don't have `git` installed, go install it.
```bash
# Clone repositories
git clone --recursive https://github.com/SlimeVR/SlimeVR-Server.git
# Enter the directory of the codebase
cd SlimeVR-Server
```
Now you can open the codebase in [IDEA](https://www.jetbrains.com/idea/download/) (Recommended; VSCode and Eclipse also work but have limited Kotlin support).
Now you can open the codebase in your favorite IDE or text editor.
### Building the code
The code is built with `gradle`, a cli tool that manages java projects and their
dependencies. You can build the code with `./gradlew build` and run it with
`./gradlew run`.
## Building the code
### Java (server)
The Java code is built with `gradle`, a CLI tool that manages java projects and their
dependencies.
- You can run the server by running `./gradlew run` in your IDE's terminal.
- To compile the code, run `./gradlew shadowJar`. The result will
be at `server/build/libs/slimevr.jar` (you can ignore `server.jar`).
(Note: Your IDE may be able to do all of the above for you.)
### Electron (gui)
- Activate corepack (included with Node.JS) via `corepack enable` (might require administrator permissions)
- Run `pnpm i` in your IDE's terminal to download and install dependencies.
- To launch the GUI in dev mode, run `pnpm gui`.
- Finally, to compile for production, run `pnpm package:build`. The result
will be at `dist/artifacts/` content will change depending of the platform.
## Code style
### Java (server)
The Java code is auto-formatted with [spotless](https://github.com/diffplug/spotless/tree/main/plugin-gradle).
## Code Style
Code is autoformatted with [spotless](https://github.com/diffplug/spotless/tree/main/plugin-gradle).
Code is checked for autoformatting whenever you build, but you can also run
`./gradlew spotlessCheck` if you prefer.
To auto-format your Java and Kotlin code from the command line, you can run `./gradlew spotlessApply`.
We recommend installing support for spotless in your IDE, and formatting
whenever you save a file to make things easy.
To autoformat your code from the command line, you can run `./gradlew spotlessApply`.
We recommend installing support for spotless in your IDE of choice, and formatting
whenever you save a file, to make things easy.
If you need to prevent autoformatting for a select region of code, use
If you need to prevent autoformatting for a particular region of code, use
`// @formatter:off` and `// @formatter:on`
#### Setting up spotless for IntelliJ IDEA
* Install https://plugins.jetbrains.com/plugin/18321-spotless-gradle
* Add a keyboard shortcut for `Code` > `Reformat Code with Spotless`
* They are working on support to do this on save without a keybind
[here](https://github.com/ragurney/spotless-intellij-gradle/issues/8)
#### Setting up spotless for VSCode
### Setting up spotless in VSCode
* Install the `richardwillis.vscode-spotless-gradle` extension
* Add the following to your workspace settings, at `.vscode/settings.json`:
```json
@@ -70,7 +46,13 @@ If you need to prevent autoformatting for a select region of code, use
}
```
#### Setting up Eclipse autoformatting
### Setting up spotless for IntelliJ
* Install https://plugins.jetbrains.com/plugin/18321-spotless-gradle.
* Add a keyboard shortcut for `Code` > `Reformat Code with Spotless`
* They are working on support to do this on save without a keybind
[here](https://github.com/ragurney/spotless-intellij-gradle/issues/8)
### Setting up Eclipse autoformatting
Import the formatting settings defined in `spotless.xml`, like this:
* Go to `File > Properties`, then `Java Code Style > Formatter`
* Check `Enable project specific settings`
@@ -82,41 +64,21 @@ Import the formatting settings defined in `spotless.xml`, like this:
Eclipse will only do a subset of the checks in `spotless`, so you may still want to do
`./gradlew spotlessApply` if you ever see an error from spotless.
### Electron (gui)
### Version bumping
* Create the git tag instead of making it from releases, you can do it by just ``git tag VERSION``,
example ``git tag v0.5.0``
* You need to push this change with ``git push origin VERSION`` or ``git push origin --tags``
(will push all tags you made).
We use ESLint and Prettier to format GUI code.
- First, go into the GUI's directory with your terminal by running `cd gui`.
- To check code formatting, run `pnpm run lint`.
- To fix code formatting, run `pnpm run lint:fix` and `pnpm run format`
Don't forget to run `cd ..` to return to the root directory.
## SolarXR Protocol
SolarXR is used to communicate between the server (backend) and GUI (frontend).
It can also be used to communicate to third party applications.
When touching SolarXR:
- You will need `flatc`. To know which version to get, refer to
[SolarXR's README](https://github.com/SlimeVR/SolarXR-Protocol/blob/main/README.md#flatc)
- The only files you should edit are in the `schema` directory.
- After editing files, you should run `cd solarxr-protocol`, then either run
`./generate-flatbuffer.ps1` (Windows) or `./generate-flatbuffer.sh` (Linux/OSX)
- Make sure to commit your changes inside the submodule.
- To make sure the gui use the latest generated code, run `pnpm i`.
We recommend committing first and then making the tag, that tag will point to the commit you are currently
on.
## Code Licensing
SlimeVR uses dual MIT and Apache-2.0 license. Be sure that any code that you reference,
or dependencies you add, are compatible with these licenses. For example, `GPL-v3` is
or dependencies you add, are compatible with these licenses. `GPL-v3` for example is
not compatible because it requires any and all code that depends on it to *also* be
licensed under `GPL-v3`.
## Discord
We use discord *a lot* to coordinate and discuss development. Come join us at
https://discord.gg/SlimeVR!
## Use of AI
We DO NOT accept contributions that are generated with AI (for example, "vibe-coding").
If you do use AI, and you believe your usage of AI is reasonable, you must clearly disclose
how you used AI in your submission.

3835
Cargo.lock generated Normal file

File diff suppressed because it is too large Load Diff

13
Cargo.toml Normal file
View File

@@ -0,0 +1,13 @@
[workspace]
# Use 2021 edition resolver, better resolves crate features.
resolver = "2"
# A list of all rust crates in the workspace.
members = ["gui/src-tauri"]
# These settings can be inherited by workspace members
[workspace.package]
edition = "2021"
license = "MIT OR Apache-2.0"
rust-version = "1.65" # This version stabilized GATs and let-else
repository = "https://github.com/SlimeVR/SlimeVR-Server"

View File

@@ -5,32 +5,22 @@ Server orchestrates communication between multiple sensors and integrations, lik
Sensors implementations:
* [SlimeVR Tracker for ESP](https://github.com/SlimeVR/SlimeVR-Tracker-ESP) - ESP microcontrollers and multiple IMUs are supported
* [owoTrack Mobile App](https://github.com/abb128/owoTrackVRSyncMobile) - use phones as trackers (limited functionality and compatibility)
* [SlimeVR Wrangler](https://github.com/carl-anders/slimevr-wrangler) - use Nintendo Switch Joycon controllers as trackers
* [owoTrack Mobile App](https://github.com/abb128/owoTrackVRSyncMobile) - use phone as a tracker (limited functionality and compatibility)
Integrations:
* Use [SlimeVR OpenVR Driver](https://github.com/SlimeVR/SlimeVR-OpenVR-Driver) as a driver for SteamVR.
* Use built-in OSC Trackers support for FBT integration with VRChat, PCVR or Standalone.
* Use built-in VMC support for sending and receiving tracking data to and from other apps such as VSeeFace.
* Export recordings as .BVH files to integrate motion capture data into 3d applications such as Blender.
* Use [SlimeVR OpenVR Driver](https://github.com/SlimeVR/SlimeVR-OpenVR-Driver) as a driver for SteamVR
* Integrations with other systems will be added later
## Installing
It's highly recommended to install using the installer downloadable here: https://github.com/SlimeVR/SlimeVR-Installer/releases/latest/download/slimevr_web_installer.exe
## How to use
It's recommended to download installer from here: https://github.com/SlimeVR/SlimeVR-Installer/releases/latest/download/slimevr_web_installer.exe
Latest setup instructions are [in our docs](https://docs.slimevr.dev/server/index.html).
Latest instructions are [on our site](https://docs.slimevr.dev/server-setup/slimevr-setup.html).
## Building & Contributing
For information on building and contributing to the codebase, see [CONTRIBUTING.md](CONTRIBUTING.md).
## Translating
Translation is done via Pontoon at [i18n.slimevr.dev](https://i18n.slimevr.dev/). Please join our [Discord translation forum](https://discord.com/channels/817184208525983775/1050413434249949235) to coordinate.
## License clarification
## License Clarification
**SlimeVR software** (including server, firmware, drivers, installer, documents, and others - see
licence for each case specifically) **is distributed under a dual MIT/Apache 2.0 License
([LICENSE-MIT] and [LICENSE-APACHE]). The software is the copyright of the SlimeVR
contributors.**
contributors.**
**However, these licenses have some limits, and if you wish to distribute software based
on SlimeVR, you need to be aware of them:**
@@ -47,11 +37,6 @@ on SlimeVR, you need to be aware of them:**
Please refer to the [LICENSE-MIT] and [LICENSE-APACHE] files if you are at any point
uncertain what the exact requirements are.
## Trademark and Logo use
**SlimeVR is a trademark or a registered trademark of SlimeVR B.V. Usage of SlimeVR software, hardware, or other intellectual property in this or other repositories does not grant you the right to use SlimeVR trademark as your own.**
For more information, please refer to the [TRADEMARK].
## Contributions
Any contributions submitted for inclusion in this repository will be dual-licensed under
either:
@@ -67,9 +52,7 @@ You also certify that the code you have used is compatible with those licenses o
authored by you. If you're doing so on your work time, you certify that your employer is
okay with this and that you are authorized to provide the above licenses.
For a how-to on contributing, see [CONTRIBUTING.md](CONTRIBUTING.md).
[LICENSE-MIT]: LICENSE-MIT
[LICENSE-APACHE]: LICENSE-APACHE
[TRADEMARK]: TRADEMARK.md
*if you read this, u cute*

View File

@@ -1,33 +0,0 @@
## SlimeVR is a trademark or a registered trademark of SlimeVR B.V.
**Usage of SlimeVR software, hardware, or other intellectual property in this or other repositories does not grant you the right to use SlimeVR trademark as your own.**
The purpose of a trademark is to remove uncertainty for users and customers regarding the product's manufacturer or endorsement. You're not allowed to market your product using SlimeVR name, and your usage of the name should be only factual and descriptive. For example, calling original SlimeVR products SlimeVR or describing compatibility of other products or derivatives. This applies to all products, including software, and hardware including non-official Full-Body Trackers.
**Here are a few _acceptable_ uses of SlimeVR name when selling unofficial Slime trackers:**
* SlimeVR-compatible trackers
* Unofficial SlimeVR trackers / Non-official SlimeVR trackers
* DIY SlimeVR trackers
* Third-party SlimeVR Trackers
* Custom SlimeVR-compatible trackers
* < Your Brand > Slime Trackers
* Using "SlimeVR" as a search tag
**_Unacceptable_ uses include, but are not limited to:**
* SlimeVR store
* Buy SlimeVR
* SlimeVR Trackers
* Original SlimeVR
* Official SlimeVR
* SlimeVR BMI270 (or any other IMU model along with SlimeVR name)
* < Your brand > SlimeVR / < your brand > SlimeVR Trackers
Use of the SlimeVR name that can cause confusion is not allowed in any part of the listing, including, but not limited to: product title, product description, product metadata, site title, site name, site metadata, site texts, social media posts, or other advertisement.
Also, please ensure you use the correct spelling and capitalization: only **"SlimeVR" is acceptable**. Not "Slimevr", "slimevr", or "Slime VR". You're allowed to use the word "slime" as you wish, it's not a trademark.
Please understand that we have an obligation to reduce confusion for the customers, and we believe that our usage terms are generous compared to many other companies and products. This applies to all sellers or derivative products, we do not make exceptions.
---
If you have any questions about SlimeVR trademark or copyrighted materials, you can reach out to us at *tm[at]slimevr.dev*.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 566 KiB

View File

@@ -1,3 +0,0 @@
plugins {
id("org.ajoberstar.grgit")
}

61
flake.lock generated
View File

@@ -1,61 +0,0 @@
{
"nodes": {
"flake-parts": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1762980239,
"narHash": "sha256-8oNVE8TrD19ulHinjaqONf9QWCKK+w4url56cdStMpM=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "52a2caecc898d0b46b2b905f058ccc5081f842da",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1756787288,
"narHash": "sha256-rw/PHa1cqiePdBxhF66V7R+WAP8WekQ0mCDG4CFqT8Y=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "d0fc30899600b9b3466ddb260fd83deb486c32f1",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-lib": {
"locked": {
"lastModified": 1761765539,
"narHash": "sha256-b0yj6kfvO8ApcSE+QmA6mUfu8IYG6/uU28OFn4PaC8M=",
"owner": "nix-community",
"repo": "nixpkgs.lib",
"rev": "719359f4562934ae99f5443f20aa06c2ffff91fc",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixpkgs.lib",
"type": "github"
}
},
"root": {
"inputs": {
"flake-parts": "flake-parts",
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

View File

@@ -1,50 +0,0 @@
{
description = "SlimeVR Server & GUI";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
};
outputs = inputs@{ self, nixpkgs, flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [ "x86_64-linux" ];
perSystem = { pkgs, ... }:
let
runtimeLibs = pkgs: (with pkgs; [
jdk17
alsa-lib at-spi2-atk at-spi2-core cairo cups dbus expat
gdk-pixbuf glib gtk3 libdrm libgbm libglvnd libnotify
libxkbcommon mesa nspr nss pango systemd vulkan-loader
wayland xorg.libX11 xorg.libXcomposite xorg.libXdamage
xorg.libXext xorg.libXfixes xorg.libXrandr xorg.libxcb
xorg.libxshmfence libusb1 udev libxcrypt-legacy
rpm fpm
wineWow64Packages.stable
zlib squashfsTools fakeroot libarchive icu
nodejs_22 pnpm pkg-config python3 gcc gnumake binutils git
pkgs.nodePackages.node-gyp-build
]);
slimeShell = pkgs.buildFHSEnv {
name = "slimevr-env";
targetPkgs = runtimeLibs;
profile = ''
export JAVA_HOME=${pkgs.jdk17}
export PATH="${pkgs.jdk17}/bin:$PATH"
# Tell electron-builder to use system tools instead of downloading them
export USE_SYSTEM_FPM=true
export USE_SYSTEM_MKSQUASHFS=true
'';
runScript = "bash";
};
in
{
devShells.default = slimeShell.env;
};
};
}

View File

@@ -6,17 +6,3 @@ org.gradle.jvmargs=--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAME
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
kotlin.code.style=official
# https://github.com/Kotlin/kotlinx-atomicfu#atomicfu-compiler-plugin
kotlinx.atomicfu.enableJvmIrTransformation=true
android.useAndroidX=true
android.nonTransitiveRClass=true
org.gradle.unsafe.configuration-cache=false
kotlinVersion=2.3.10
spotlessVersion=8.2.1
shadowJarVersion=9.3.1
buildconfigVersion=6.0.7
# We should probably stop using grgit, see:
# https://andrewoberstar.com/posts/2024-04-02-dont-commit-to-grgit/
grgitVersion=5.3.3

Binary file not shown.

View File

@@ -1,8 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.4-bin.zip
distributionSha256Sum=f1771298a70f6db5a29daf62378c4e18a17fc33c9ba6b14362e0cdf40610380d
networkTimeout=10000
validateDistributionUrl=true
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

44
gradlew vendored
View File

@@ -15,8 +15,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#
##############################################################################
#
@@ -57,7 +55,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -82,12 +80,13 @@ do
esac
done
# This is normally unused
# shellcheck disable=SC2034
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
APP_NAME="Gradle"
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
@@ -134,29 +133,22 @@ location of your Java installation."
fi
else
JAVACMD=java
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi
# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
@@ -201,15 +193,11 @@ if "$cygwin" || "$msys" ; then
done
fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
@@ -217,12 +205,6 @@ set -- \
org.gradle.wrapper.GradleWrapperMain \
"$@"
# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.

37
gradlew.bat vendored Executable file → Normal file
View File

@@ -13,10 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem
@if "%DEBUG%"=="" @echo off
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@@ -27,8 +25,7 @@
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@@ -43,13 +40,13 @@ if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute
if "%ERRORLEVEL%" == "0" goto execute
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
@@ -59,11 +56,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
@@ -78,15 +75,13 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
:end
@rem End local scope for the variables with windows NT shell
if %ERRORLEVEL% equ 0 goto mainEnd
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal

View File

@@ -1,8 +0,0 @@
VITE_FIRMWARE_TOOL_URL=https://fw-tool-api-v2.slimevr.io
VITE_FIRMWARE_TOOL_S3_URL=https://fw-tool-bucket-v2.slimevr.io
FIRMWARE_TOOL_SCHEMA_URL=https://fw-tool-api-v2.slimevr.io/api-json
# VITE_FIRMWARE_TOOL_URL=http://localhost:3000
# VITE_FIRMWARE_TOOL_S3_URL=http://localhost:9099
# FIRMWARE_TOOL_SCHEMA_URL=http://localhost:3000/api-json

40
gui/.eslintrc.json Normal file
View File

@@ -0,0 +1,40 @@
{
"env": {
"browser": true,
"es2021": true,
"jest": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": ["react-hooks", "@typescript-eslint", "prettier"],
"rules": {
"react/react-in-jsx-scope": "off",
"react/prop-types": "off",
"spaced-comment": "error",
"quotes": ["error", "single"],
"no-duplicate-imports": "error",
"no-inline-styles": "off",
"@typescript-eslint/no-explicit-any": "off",
"react/no-unescaped-entities": "off",
"prettier/prettier": "warn"
},
"settings": {
"import/resolver": {
"typescript": {}
},
"react": {
"version": "detect"
}
}
}

14
gui/.gitignore vendored
View File

@@ -25,17 +25,5 @@ yarn-error.log*
*.log
# vite
/dist
/stats.html
vite.config.ts.timestamp*
electron.vite.config.*.mjs
# eslint
.eslintcache
# Sentry Config File
.env.sentry-build-plugin
# electron
out/
/dist

View File

@@ -1,5 +0,0 @@
export default {
'**/*.{ts,tsx}': () => 'tsc -p tsconfig.json --noEmit',
'src/**/*.{js,jsx,ts,tsx}': 'eslint --max-warnings=0 --no-warn-ignored --cache --fix',
'**/*.{js,jsx,ts,tsx,css,scss,md,json}': 'prettier --write',
};

6
gui/LICENSE.md Normal file
View File

@@ -0,0 +1,6 @@
This directory and all subdirectories are dual-licensed under either
* MIT License ([/LICENSE-MIT](/LICENSE-MIT))
* Apache License, Version 2.0 ([/LICENSE-APACHE](/LICENSE-APACHE))
at your option.

30
gui/README.md Normal file
View File

@@ -0,0 +1,30 @@
# SlimeVR UI
This is the GUI of SlimeVR, it uses the SolarXR protocol to communicate with the server and is completely isolated from the server logic.
This project is written in Typescript + React for the frontend and uses Tauri + Rust as a small backend. This makes the application more lightweight than electron.
## Compiling
### Prerequisites
- [Node.js](https://nodejs.org) 16 (We recommend the use of `nvm` instead of installing Node.js directly)
- Windows Webview
- SlimeVR server installed
- [Rust](https://rustup.rs)
```
npm install
```
Build for production
```
npm run tauri build
```
Launch in dev mode
```
npm run tauri dev
```

View File

@@ -1,70 +0,0 @@
appId: dev.slimevr.SlimeVR
productName: SlimeVR
# Global naming pattern
artifactName: "${productName}-${version}-${os}-${arch}.${ext}"
directories:
output: dist/artifacts/${os}
asar: true
asarUnpack:
- out/main/chunks/*.jar
electronLanguages:
- en-US
files:
- out/**/*
- index.html
- package.json
- node_modules/**
- "!node_modules/*/{README,readme,README.md,readme.md,CHANGELOG,CHANGELOG.md,changelog.md}"
- "!node_modules/*/{test,tests,__tests__,docs,doc,example,examples}"
- "!node_modules/*/.{git,github,vscode,editorconfig,eslintrc,prettierrc}"
- "!node_modules/**/*.{map,ts,tsx,d.ts}"
- "!**/.DS_Store"
linux:
category: Game
artifactName: "${productName}-${arch}.${ext}"
target:
- target: AppImage
- target: deb
- target: rpm
extraFiles:
- from: "../server/desktop/build/libs/slimevr.jar"
to: "."
- from: "./electron/resources/69-slimevr-devices.rules"
to: "."
icon: "./electron/resources/icons"
deb:
depends: [openjdk-17-jre-headless, udev]
afterInstall: "./electron/resources/scripts/postinstall.sh"
afterRemove: "./electron/resources/scripts/postremove.sh"
rpm:
depends: [java-latest-openjdk, udev]
afterInstall: "./electron/resources/scripts/postinstall.sh"
afterRemove: "./electron/resources/scripts/postremove.sh"
win:
artifactName: "${productName}-${os}-${arch}.${ext}"
target: zip
icon: "./electron/resources/icons/icon.ico"
extraFiles:
- from: "../server/desktop/build/libs/slimevr.jar"
to: "."
- from: "../server/core/resources"
to: "."
filter: ["**/*"]
mac:
target: dmg
artifactName: "SlimeVR-mac.${ext}"
x64ArchFiles: "**/register-protocol-handler.node"
icon: "./electron/resources/icons/icon.icns"
extraFiles:
- from: "../server/desktop/build/libs/slimevr.jar"
to: "Resources/slimevr.jar"

View File

@@ -1,47 +0,0 @@
import { defineConfig } from 'electron-vite'
import { resolve } from 'path'
import rendererConfig from './vite.config' // Import your existing React config
export default defineConfig({
main: {
build: {
rollupOptions: {
input: resolve(__dirname, 'electron/main/index.ts'),
external: [
'pino',
'pino-pretty',
'pino-roll',
'commander',
'open'
]
}
}
},
preload: {
build: {
rollupOptions: {
input: resolve(__dirname, 'electron/preload/index.ts'),
output: {
format: 'cjs', // Force CJS for the preload
entryFileNames: 'index.js' // Change back to .js
}
}
}
},
renderer: {
...rendererConfig,
root: '.',
build: {
commonjsOptions: {
// Force Rollup to treat the protocol directory as CommonJS
// even though it's not in node_modules
include: [/solarxr-protocol/, /node_modules/],
// Required for Flatbuffers/Generated code interop
transformMixedEsModules: true,
},
rollupOptions: {
input: resolve(__dirname, 'index.html')
}
}
}
})

View File

@@ -1 +0,0 @@
resources/java-version/JavaVersion.class

View File

@@ -1,12 +0,0 @@
import { program } from "commander";
program
.option('-p --path <path>', 'set launch path')
.option(
'--skip-server-if-running',
'gui will not launch the server if it is already running'
)
.allowUnknownOption();
program.parse(process.argv);
export const options = program.opts();

View File

@@ -1,477 +0,0 @@
import {
app,
BrowserWindow,
dialog,
Menu,
nativeImage,
net,
protocol,
screen,
shell,
Tray,
} from 'electron';
import { IPC_CHANNELS } from '../shared';
import path, { dirname, join } from 'path';
import open from 'open';
import trayIcon from '../resources/icons/icon.png?asset';
import appleTrayIcon from '../resources/icons/Square30x30Logo.png?asset';
import { readFile, stat } from 'fs/promises';
import { getPlatform, handleIpc, isPortAvailable } from './utils';
import {
findServerJar,
findSystemJRE,
getGuiDataFolder,
getLogsFolder,
getServerDataFolder,
getWindowStateFile,
} from './paths';
import { stores } from './store';
import { closeLogger, logger } from './logger';
import { writeFileSync } from 'node:fs';
import { spawn } from 'node:child_process';
import { discordPresence } from './presence';
import { options } from './cli';
import { ServerStatusEvent } from 'electron/preload/interface';
import { mkdir } from 'node:fs/promises';
import { MenuItem } from 'electron/main';
// Fixes colors looking washed on linux
// Might affect hdr
if (process.platform === 'linux') {
app.commandLine.appendSwitch('disable-features', 'WaylandWpColorManagerV1');
app.commandLine.appendSwitch('force-color-profile', 'srgb');
}
app.setPath('userData', getGuiDataFolder());
app.setPath('sessionData', join(getGuiDataFolder(), 'electron'));
protocol.registerSchemesAsPrivileged([
{
scheme: 'app',
privileges: {
standard: true,
secure: true,
supportFetchAPI: true,
corsEnabled: true,
},
},
]);
let mainWindow: BrowserWindow | null = null;
handleIpc(IPC_CHANNELS.GH_FETCH, async (e, options) => {
if (options.type === 'fw-releases') {
return fetch(
'https://api.github.com/repos/SlimeVR/SlimeVR-Tracker-ESP/releases'
).then((res) => res.json());
}
if (options.type === 'asset') {
if (
!options.url.startsWith(
'https://github.com/SlimeVR/SlimeVR-Tracker-ESP/releases/download'
)
)
return null;
return fetch(options.url).then((res) => res.json());
}
});
handleIpc(IPC_CHANNELS.OS_STATS, async () => {
return {
type: getPlatform(),
};
});
handleIpc(IPC_CHANNELS.I18N_OVERRIDE, async () => {
const overridefile = join(getServerDataFolder(), 'override.ftl');
const exists = await stat(overridefile)
.then(() => true)
.catch(() => false);
if (!exists) return false;
return readFile(overridefile, { encoding: 'utf-8' });
});
handleIpc(IPC_CHANNELS.LOG, (e, type, ...args) => {
let payload: Record<string, unknown> = {};
const messageParts: unknown[] = [];
args.forEach((arg) => {
if (arg instanceof Error) {
payload.err = arg;
} else if (typeof arg === 'object' && arg !== null) {
payload = { ...payload, ...arg };
} else {
messageParts.push(arg);
}
});
const msg = messageParts.join(' ');
switch (type) {
case 'error':
logger.error(payload, msg);
break;
case 'warn':
logger.warn(payload, msg);
break;
default:
logger.info(payload, msg);
}
});
handleIpc(IPC_CHANNELS.OPEN_URL, (e, url) => {
const allowed_urls = [
/steam:\/\/.*/,
/ms-settings:network$/,
/https:\/\/.*\.slimevr\.dev.*/,
/https:\/\/github\.com\/.*/,
/https:\/\/discord\.gg\/slimevr$/,
];
if (allowed_urls.find((a) => url.match(a))) open(url);
else logger.error({ url }, 'attempted to open non-whitelisted URL');
});
handleIpc(IPC_CHANNELS.STORAGE, async (e, { type, method, key, value }) => {
const store = stores[type];
if (!store) throw new Error(`Storage type ${type} not found`);
switch (method) {
case 'get':
return store.get(key!);
case 'set':
return store.set(key!, value);
case 'delete':
return store.delete(key!);
case 'save':
return store.save();
}
});
handleIpc(IPC_CHANNELS.DISCORD_PRESENCE, async (e, options) => {
if (options.enable && !discordPresence.state.ready) {
await discordPresence.connect();
discordPresence.updateActivity(options.activity);
} else if (!options.enable && discordPresence.state.ready) {
discordPresence.destroy();
}
});
handleIpc(IPC_CHANNELS.OPEN_FILE, (e, folder) => {
const requestedPath = path.resolve(folder);
const isAllowed = [getServerDataFolder(), getGuiDataFolder(), getLogsFolder()].some(
(parent) => {
const absoluteParent = path.resolve(parent);
const relative = path.relative(absoluteParent, requestedPath);
return !relative.includes('..') && !path.isAbsolute(relative);
}
);
if (isAllowed) {
shell.openPath(requestedPath);
} else {
logger.error({ path: requestedPath }, 'Blocked unauthorized path');
}
});
handleIpc(IPC_CHANNELS.GET_FOLDER, (e, folder) => {
switch (folder) {
case 'config':
return getGuiDataFolder();
case 'logs':
return getLogsFolder();
}
});
const windowStateFile = await readFile(getWindowStateFile(), {
encoding: 'utf-8',
}).catch(() => null);
const defaultWindowState: {
width: number;
height: number;
x?: number;
y?: number;
} = {
width: 1289.0,
height: 709.0,
x: undefined,
y: undefined,
};
const windowState = windowStateFile ? JSON.parse(windowStateFile) : defaultWindowState;
const MIN_WIDTH = 393;
const MIN_HEIGHT = 667;
function validateWindowState(state: typeof defaultWindowState) {
if (state.x === undefined || state.y === undefined) {
return state;
}
const displays = screen.getAllDisplays();
const isVisible = displays.some((display) => {
return (
state.x! >= display.bounds.x &&
state.y! >= display.bounds.y &&
state.x! + state.width <= display.bounds.x + display.bounds.width &&
state.y! + state.height <= display.bounds.y + display.bounds.height
);
});
const minWidth = MIN_WIDTH;
const minHeight = MIN_HEIGHT;
if (!isVisible || state.width < minWidth || state.height < minHeight) {
return defaultWindowState;
}
return state;
}
const saveWindowState = async () => {
await mkdir(dirname(getWindowStateFile()), { recursive: true });
writeFileSync(getWindowStateFile(), JSON.stringify(windowState));
};
function createWindow() {
const validatedState = validateWindowState(windowState);
mainWindow = new BrowserWindow({
width: validatedState.width,
height: validatedState.height,
x: validatedState.x,
y: validatedState.y,
minHeight: MIN_HEIGHT,
minWidth: MIN_WIDTH,
movable: true,
frame: false,
roundedCorners: true,
webPreferences: {
preload: join(__dirname, '../preload/index.js'),
nodeIntegration: false,
contextIsolation: true,
devTools: true,
},
});
if (process.env.ELECTRON_RENDERER_URL) {
mainWindow.loadURL(process.env.ELECTRON_RENDERER_URL);
mainWindow.webContents.openDevTools();
} else {
mainWindow.loadURL('app://./index.html');
}
mainWindow.on('closed', () => {
mainWindow = null;
});
handleIpc('window-actions', (e, action) => {
switch (action) {
case 'close':
mainWindow?.close();
break;
case 'hide':
mainWindow?.hide();
break;
case 'minimize':
mainWindow?.minimize();
break;
case 'maximize':
mainWindow?.maximize();
break;
}
});
handleIpc('open-dialog', (e, options) => dialog.showOpenDialog(options));
handleIpc('save-dialog', (e, options) => dialog.showSaveDialog(options));
const icon = nativeImage.createFromPath(
getPlatform() === 'macos' ? appleTrayIcon : trayIcon
);
const tray = new Tray(icon);
tray.setToolTip('SlimeVR');
tray.on('click', () => {
mainWindow?.show();
});
const contextMenu = Menu.buildFromTemplate([
{
label: 'Show',
click: () => {
mainWindow?.show();
},
},
{
label: 'Hide',
click: () => {
mainWindow?.hide();
},
},
{ role: 'quit' },
]);
tray.setContextMenu(contextMenu);
const updateWindowState = () => {
if (!mainWindow) return;
windowState.minimized = mainWindow.isMinimized();
if (!mainWindow.isMinimized() && !mainWindow.isMaximized()) {
const bounds = mainWindow.getBounds();
windowState.width = bounds.width;
windowState.height = bounds.height;
windowState.x = bounds.x;
windowState.y = bounds.y;
}
};
mainWindow.on('move', updateWindowState);
mainWindow.on('resize', updateWindowState);
mainWindow.on('minimize', updateWindowState);
mainWindow.on('maximize', updateWindowState);
mainWindow.webContents.on('context-menu', (event, params) => {
const menu = new Menu();
menu.append(
new MenuItem({
label: 'Inspect Element',
click: () => {
mainWindow?.webContents.inspectElement(params.x, params.y);
},
})
);
menu.append(new MenuItem({ type: 'separator' }));
menu.append(new MenuItem({ label: 'Copy', role: 'copy' }));
menu.append(new MenuItem({ label: 'Paste', role: 'paste' }));
if (mainWindow) menu.popup({ window: mainWindow });
});
}
const checkEnvironmentVariables = () => {
const to_check = ['_JAVA_OPTIONS', 'JAVA_TOOL_OPTIONS'];
const set = to_check.filter((env) => !!process.env[env]);
if (set.length > 0) {
dialog.showErrorBox(
'SlimeVR',
`You have environment variables ${set.join(', ')} set, which may cause the SlimeVR Server to fail to launch properly.`
);
app.quit();
}
};
const isServerRunning = async () => !(await isPortAvailable(21110));
const spawnServer = async () => {
if (options.skipServerIfRunning && (await isServerRunning())) {
logger.info(
{ skipServerIfRunning: options.skipServerIfRunning },
'Server is already running, skipping server start'
);
return;
}
const serverJar = findServerJar();
if (!serverJar) {
logger.info('server jar not found, skipping');
return;
}
const sharedDir = dirname(serverJar);
const javaBin = await findSystemJRE(sharedDir);
if (!javaBin) {
dialog.showErrorBox(
'SlimeVR',
`Couldn't find a compatible Java version, please download Java 17 or higher`
);
app.quit()
return;
}
logger.info({ javaBin, serverJar }, 'Found Java and server jar');
const platform = getPlatform();
const serverWorkdir = getServerDataFolder()
const serverProcess = spawn(javaBin, ['-Xmx128M', '-jar', serverJar, 'run'], {
cwd: serverWorkdir,
shell: false,
env:
platform === 'windows'
? {
...process.env,
APPDATA: app.getPath('appData'),
LOCALAPPDATA: process.env['USERPROFILE'] ? path.join(process.env['USERPROFILE'], 'AppData', 'Local') : undefined,
}
: undefined,
});
const sendToWindow = (event: ServerStatusEvent) => {
if (mainWindow && !mainWindow.webContents.isDestroyed()) {
mainWindow.webContents.send(IPC_CHANNELS.SERVER_STATUS, event);
}
};
serverProcess.stdout?.on('data', (message) => {
sendToWindow({ message: message.toString(), type: 'stdout' });
});
serverProcess.stderr?.on('data', (message) => {
sendToWindow({ message: message.toString(), type: 'stderr' });
});
serverProcess.on('error', (err) => {
logger.info({ err }, 'Error launching the java server');
if (!isQuitting) app.quit();
})
serverProcess.on('exit', () => {
logger.info('Server process exiting');
})
const exited = new Promise<void>((resolve) => serverProcess.once('exit', resolve));
return {
process: serverProcess,
close: () => serverProcess.kill(),
waitForExit: () => exited,
};
};
let isQuitting = false;
app.whenReady().then(async () => {
// Register protocol handler for app:// scheme to handle assets with leading slashes
protocol.handle('app', (request) => {
const url = request.url.slice('app://'.length);
const filePath = path.normalize(join(__dirname, '../renderer', url));
return net.fetch('file://' + filePath);
});
checkEnvironmentVariables();
const server = await spawnServer();
createWindow();
logger.info('SlimeVR started!');
app.on('window-all-closed', () => {
app.quit();
});
app.on('before-quit', async (event) => {
if (isQuitting) return;
isQuitting = true;
event.preventDefault();
logger.info('App quitting, saving...');
server?.close();
await server?.waitForExit();
stores.settings.save();
stores.cache.save();
discordPresence.destroy();
await saveWindowState();
await closeLogger();
app.exit(0);
});
});

View File

@@ -1,34 +0,0 @@
import pino from 'pino';
import { getLogsFolder } from './paths';
import { join } from 'node:path';
const transport = pino.transport({
targets: [
{
target: 'pino-roll',
options: {
file: join(getLogsFolder(), 'slimevr-gui.log'),
frequency: 'daily',
size: '10m',
mkdir: true,
limit: { count: 7 },
},
level: 'info',
},
{
target: 'pino-pretty',
options: { colorize: true },
level: 'debug',
},
],
});
export const logger = pino(transport);
export const closeLogger = () =>
new Promise<void>((resolve) => {
logger.flush(() => {
transport.once('close', resolve);
transport.end();
});
});

View File

@@ -1,120 +0,0 @@
import { app } from 'electron';
import path, { join } from 'node:path';
import { getPlatform } from './utils';
import { glob } from 'glob';
import { spawn } from 'node:child_process';
import javaVersionJar from '../resources/java-version/JavaVersion.jar?asset&asarUnpack';
import { existsSync } from 'node:fs';
import { options } from './cli';
const javaBin = getPlatform() === 'windows' ? 'java.exe' : 'java';
export const CONFIG_IDENTIFIER = 'dev.slimevr.SlimeVR';
export const getGuiDataFolder = () => {
const platform = getPlatform();
switch (platform) {
case 'linux':
if (process.env['XDG_DATA_HOME'])
return join(process.env['XDG_DATA_HOME'], CONFIG_IDENTIFIER);
return join(app.getPath('home'), '.local/share', CONFIG_IDENTIFIER);
case 'windows':
return join(app.getPath('appData'), CONFIG_IDENTIFIER);
case 'macos':
return join(
app.getPath('home'),
'Library/Application Support',
CONFIG_IDENTIFIER
);
case 'unknown':
throw 'error';
}
};
export const getServerDataFolder = () => {
const platform = getPlatform();
switch (platform) {
case 'linux':
case 'windows':
case 'macos':
return join(app.getPath('appData'), CONFIG_IDENTIFIER);
case 'unknown':
throw 'error';
}
};
export const getLogsFolder = () => {
return join(getGuiDataFolder(), 'logs');
};
export const getWindowStateFile = () =>
join(getServerDataFolder(), '.window-state.json');
const localJavaBin = (sharedDir: string) => {
const jre = join(sharedDir, 'jre/bin', javaBin);
return jre;
};
const javaHomeBin = () => {
const javaHome = process.env['JAVA_HOME'];
if (!javaHome) return null;
const javaHomeJre = join(javaHome, 'bin', javaBin);
return javaHomeJre;
};
export const findSystemJRE = async (sharedDir: string) => {
const paths = [
localJavaBin(sharedDir),
javaHomeBin(),
...(await glob('/usr/lib/jvm/*/bin/' + javaBin)),
...(await glob('/Library/Java/JavaVirtualMachines/*/Contents/Home/bin/' + javaBin)),
];
for (const path of paths) {
if (!path) continue;
const version = await new Promise<number | null>((resolve) => {
const process = spawn(path, ['-jar', javaVersionJar], {});
let version: number | null = null;
process.stdout?.once('data', (data) => {
try {
version = parseFloat(data.toString());
} catch {
version = null;
}
});
process.on('error', () => {
resolve(null);
});
process.on('exit', () => {
resolve(version);
});
});
if (version && version >= 17) return path;
}
return null;
};
export const findServerJar = () => {
const paths = [
options.path ? path.resolve(options.path) : undefined,
app.isPackaged ? path.resolve(process.resourcesPath) : undefined,
// AppImage passes the fakeroot in `APPDIR` env var.
process.env['APPDIR']
? path.resolve(join(process.env['APPDIR'], 'usr/share/slimevr/'))
: undefined,
path.dirname(app.getPath('exe')),
// For flatpack container
path.resolve('/app/share/slimevr/'),
path.resolve('/usr/share/slimevr/'),
];
return paths
.filter((p) => !!p)
.map((p) => join(p!, 'slimevr.jar'))
.find((p) => existsSync(p));
};

View File

@@ -1,49 +0,0 @@
import { Client } from '@xhayper/discord-rpc';
import { logger } from './logger';
export const richPresence = () => {
const initialState = () => ({ ready: false, start: Date.now() });
const state = initialState();
const client = new Client({
clientId: '1237970689009647639',
transport: { type: 'ipc' },
});
client.on('ready', () => {
state.ready = true;
});
client.on('disconnected', () => {
state.ready = false;
});
return {
state,
connect: async () => {
try {
await client.login();
} catch (e) {
logger.error(e, 'unable to connect to discord rpc');
}
},
updateActivity: (content: string) => {
if (!state.ready) return;
client.user
?.setActivity({
state: content,
largeImageKey: 'icon',
startTimestamp: state.start,
})
.catch((e) => {
logger.error(e, 'unable to update rpc activity');
});
},
destroy: () => {
client.destroy();
Object.assign(state, initialState());
},
};
};
export const discordPresence = richPresence();

View File

@@ -1,76 +0,0 @@
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
import { dirname, join } from "path";
import { logger } from "./logger";
import { getGuiDataFolder } from "./paths";
export class CustomStore {
private data: Record<string, unknown> = {};
private saveTimeout: NodeJS.Timeout | null = null;
private filePath: string;
private debounceMs: number;
constructor(filePath: string, debounceMs: number = 2000) {
this.filePath = filePath;
this.debounceMs = debounceMs;
this.load();
}
private load() {
try {
if (existsSync(this.filePath)) {
const raw = readFileSync(this.filePath, 'utf-8');
this.data = JSON.parse(raw);
}
} catch (err) {
logger.error(err, `Failed to load store at ${this.filePath}`);
this.data = {};
}
}
/** Set a key and trigger the debounced auto-save */
set(key: string, value: unknown) {
this.data[key] = value;
this.triggerAutoSave();
}
get<T>(key: string): T | undefined {
return this.data[key] as T;
}
delete(key: string): boolean {
if (key in this.data) {
delete this.data[key];
this.triggerAutoSave();
return true;
}
return false;
}
private triggerAutoSave() {
if (this.saveTimeout) clearTimeout(this.saveTimeout);
this.saveTimeout = setTimeout(() => {
this.save();
}, this.debounceMs);
}
save(): boolean {
try {
if (this.saveTimeout) clearTimeout(this.saveTimeout);
const dir = dirname(this.filePath);
if (!existsSync(dir)) mkdirSync(dir, { recursive: true });
writeFileSync(this.filePath, JSON.stringify(this.data, null, 2), 'utf-8');
return true;
} catch (err) {
logger.error(err, 'Save failed', this.filePath);
return false;
}
}
}
export const stores = {
settings: new CustomStore(join(getGuiDataFolder(), 'gui-settings.dat'), 1000),
cache: new CustomStore(join(getGuiDataFolder(), 'gui-cache.dat'), 100),
};

View File

@@ -1,50 +0,0 @@
import os from 'os'
import { OSStats } from "../preload/interface";
import { ipcMain, IpcMainInvokeEvent } from 'electron';
import { IpcInvokeMap } from '../shared';
import net from 'net'
export const getPlatform = (): OSStats['type'] => {
switch (os.platform()) {
case 'darwin':
return 'macos';
case 'win32':
return 'windows';
case 'linux':
return 'linux';
default:
return 'unknown';
}
};
export const isPortAvailable = (port: number) => {
return new Promise((resolve) => {
const s = net.createServer();
s.once('error', (err) => {
s.close();
if ("code" in err && err["code"] == "EADDRINUSE") {
resolve(false);
} else {
resolve(false);
}
});
s.once('listening', () => {
resolve(true);
s.close();
});
s.listen(port);
});
};
export function handleIpc<K extends keyof IpcInvokeMap>(
channel: K,
handler: (
event: IpcMainInvokeEvent,
...args: Parameters<IpcInvokeMap[K]>
) => ReturnType<IpcInvokeMap[K]>
) {
ipcMain.handle(channel, (event, ...args) => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
return handler(event, ...args as any);
});
}

View File

@@ -1,40 +0,0 @@
import { contextBridge, ipcRenderer, IpcRendererEvent } from 'electron';
import { IElectronAPI, ServerStatusEvent } from './interface';
import { IPC_CHANNELS } from '../shared';
contextBridge.exposeInMainWorld('electronAPI', {
onServerStatus: (callback) => {
const subscription = (_event: IpcRendererEvent, value: ServerStatusEvent) =>
callback(value);
ipcRenderer.on(IPC_CHANNELS.SERVER_STATUS, subscription);
return () => ipcRenderer.removeListener(IPC_CHANNELS.SERVER_STATUS, subscription);
},
openUrl: (url) => ipcRenderer.invoke(IPC_CHANNELS.OPEN_URL, url),
osStats: () => ipcRenderer.invoke(IPC_CHANNELS.OS_STATS),
close: () => ipcRenderer.invoke(IPC_CHANNELS.WINDOW_ACTIONS, 'close'),
hide: () => ipcRenderer.invoke(IPC_CHANNELS.WINDOW_ACTIONS, 'hide'),
minimize: () => ipcRenderer.invoke(IPC_CHANNELS.WINDOW_ACTIONS, 'minimize'),
maximize: () => ipcRenderer.invoke(IPC_CHANNELS.WINDOW_ACTIONS, 'maximize'),
getStorage: async (type) => {
return {
get: (key) =>
ipcRenderer.invoke(IPC_CHANNELS.STORAGE, { type, method: 'get', key }),
set: (key, value) =>
ipcRenderer.invoke(IPC_CHANNELS.STORAGE, { type, method: 'set', key, value }),
delete: (key) =>
ipcRenderer.invoke(IPC_CHANNELS.STORAGE, { type, method: 'delete', key }),
save: () => ipcRenderer.invoke(IPC_CHANNELS.STORAGE, { type, method: 'save' }),
};
},
log: (type, ...args) => ipcRenderer.invoke(IPC_CHANNELS.LOG, type, ...args),
i18nOverride: async () => ipcRenderer.invoke(IPC_CHANNELS.I18N_OVERRIDE),
showDecorations: () => {},
setTranslations: () => {},
openDialog: (options) => ipcRenderer.invoke(IPC_CHANNELS.OPEN_DIALOG, options),
saveDialog: (options) => ipcRenderer.invoke(IPC_CHANNELS.SAVE_DIALOG, options),
openConfigFolder: async () => ipcRenderer.invoke(IPC_CHANNELS.OPEN_FILE, await ipcRenderer.invoke(IPC_CHANNELS.GET_FOLDER, 'config')),
openLogsFolder: async () => ipcRenderer.invoke(IPC_CHANNELS.OPEN_FILE, await ipcRenderer.invoke(IPC_CHANNELS.GET_FOLDER, 'logs')),
openFile: (path) => ipcRenderer.invoke(IPC_CHANNELS.OPEN_FILE, path),
ghGet: (req) => ipcRenderer.invoke(IPC_CHANNELS.GH_FETCH, req),
setPresence: (options) => ipcRenderer.invoke(IPC_CHANNELS.DISCORD_PRESENCE, options)
} satisfies IElectronAPI);

View File

@@ -1,65 +0,0 @@
import {
OpenDialogOptions,
OpenDialogReturnValue,
SaveDialogOptions,
SaveDialogReturnValue,
} from 'electron';
export type ServerStatusEvent = {
type: 'stdout' | 'stderr' | 'error' | 'terminated' | 'other';
message: string;
};
export type OSStats = {
type: 'linux' | 'windows' | 'macos' | 'unknown';
};
export interface CrossStorage {
set(key: string, value: unknown): Promise<void>;
get<T>(key: string): Promise<T | undefined>;
delete(key: string): Promise<boolean>;
save(): Promise<boolean>;
}
export type GHGet = { type: 'fw-releases' } | { type: 'asset'; url: string };
export type GHReturn = {
asset: [number, string][] | null;
['fw-releases']:
| {
assets: { browser_download_url: string; name: string; digest: string }[];
prerelease: boolean;
tag_name: string;
body: string;
}[]
| null;
};
export type DiscordPresence = { enable: false } | { enable: true, activity: string }
export interface IElectronAPI {
onServerStatus: (cb: (data: ServerStatusEvent) => void) => () => void;
openUrl: (url: string) => Promise<void>;
osStats: () => Promise<OSStats>;
openLogsFolder: () => Promise<void>;
openConfigFolder: () => Promise<void>;
close: () => void;
hide: () => void;
minimize: () => void;
maximize: () => void;
showDecorations: (decorations: boolean) => void;
setTranslations: (translations: Record<string, string>) => void;
i18nOverride: () => Promise<string | false>;
getStorage: (type: 'settings' | 'cache') => Promise<CrossStorage>;
openDialog: (options: OpenDialogOptions) => Promise<OpenDialogReturnValue>;
saveDialog: (options: SaveDialogOptions) => Promise<SaveDialogReturnValue>;
log: (type: 'info' | 'error' | 'warn', ...args: unknown[]) => void;
openFile: (path: string) => void;
ghGet: <T extends GHGet>(options: T) => Promise<GHReturn[T['type']]>;
setPresence: (options: DiscordPresence) => void;
}
declare global {
interface Window {
electronAPI: IElectronAPI;
}
}

View File

@@ -1,46 +0,0 @@
# Copyright 2025 Eiren Rain and SlimeVR Contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
## QinHeng
# CH340
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1A86", ATTRS{idProduct}=="7522", MODE="0660", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1A86", ATTRS{idProduct}=="7523", MODE="0660", TAG+="uaccess"
# CH341
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1A86", ATTRS{idProduct}=="5523", MODE="0660", TAG+="uaccess"
# CH343
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1A86", ATTRS{idProduct}=="55D3", MODE="0660", TAG+="uaccess"
# CH9102x
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1A86", ATTRS{idProduct}=="55D4", MODE="0660", TAG+="uaccess"
## Silabs
# CP210x
SUBSYSTEMS=="usb", ATTRS{idVendor}=="10C4", ATTRS{idProduct}=="EA60", MODE="0660", TAG+="uaccess"
## Espressif
# ESP32-S3 / ESP32-C3 / ESP32-C5 / ESP32-C6 / ESP32-C61 / ESP32-H2 / ESP32-P4
SUBSYSTEMS=="usb", ATTRS{idVendor}=="303A", ATTRS{idProduct}=="1001", MODE="0660", TAG+="uaccess"
# ESP32-S2
SUBSYSTEMS=="usb", ATTRS{idVendor}=="303A", ATTRS{idProduct}=="0002", MODE="0660", TAG+="uaccess"
## FTDI
# FT232BM/L/Q, FT245BM/L/Q
# FT232RL/Q, FT245RL/Q
# VNC1L with VDPS Firmware
# VNC2 with FT232Slave
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", MODE="0660", TAG+="uaccess"
## SlimeVR
# smol slime dongle
SUBSYSTEM=="usb", ATTR{idVendor}=="1209", ATTR{idProduct}=="7690", MODE="0660", TAG+="uaccess"
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="1209", ATTRS{idProduct}=="7690", MODE="0660", TAG+="uaccess"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 747 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 698 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1008 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 922 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" stroke-miterlimit="10" clip-rule="evenodd" version="1.1" viewBox="0 0 380 380" xml:space="preserve"><rect id="bg" width="380" height="380" fill="#663499" stroke-width="1" rx="76" /><g id="logo" fill="none" stroke="#fff"><path id="left" stroke-width="13.62" d="m72.867 191.74 37-39 39 36"/><path id="right" stroke-width="13.62" d="m208.87 187.74 38-35 36 38"/><path id="outer" stroke-linecap="square" stroke-width="17" d="m56.867 253.74s130.61-31.182 248 5c13.45 4.146 20.244 2.975 20-8s1.909-126.06-46-131"/></g></svg>

Before

Width:  |  Height:  |  Size: 579 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 555 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 848 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 848 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 645 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 848 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

View File

@@ -1,26 +0,0 @@
#!/bin/bash
SRC="/opt/SlimeVR/69-slimevr-devices.rules"
DESTDIRS=("/lib" "/usr/lib")
if [[ ! -f "$SRC" ]]; then
echo "SlimeVR udev rules not found, serial console and dongles may not work" >&2
exit 0
fi
echo "Configuring SlimeVR udev rules..."
for DIR in "${DESTDIRS[@]}"; do
if [[ -d "$DIR" && ! -h "$DIR" ]]; then
echo "Copying rules to $DIR"
install -Dm644 "$SRC" "$DIR/udev/rules.d/69-slimevr-devices.rules"
if command -v udevadm >/dev/null 2>&1; then
udevadm control --reload-rules
udevadm trigger
fi
exit 0
fi
done
echo "Couldn't copy SlimeVR udev rules, serial console and dongles may not work" >&2

View File

@@ -1,8 +0,0 @@
#!/bin/bash
echo "Removing SlimeVR udev rules..."
rm -f "/lib/udev/rules.d/69-slimevr-devices.rules"
rm -f "/usr/lib/udev/rules.d/69-slimevr-devices.rules"
if command -v udevadm >/dev/null 2>&1; then
udevadm control --reload-rules
fi

View File

@@ -1,49 +0,0 @@
import {
OpenDialogOptions,
OpenDialogReturnValue,
SaveDialogOptions,
SaveDialogReturnValue,
} from 'electron';
import { DiscordPresence, GHGet, GHReturn, OSStats } from './preload/interface';
export const IPC_CHANNELS = {
SERVER_STATUS: 'server-status',
OPEN_URL: 'open-url',
OS_STATS: 'os-stats',
WINDOW_ACTIONS: 'window-actions',
LOG: 'log',
STORAGE: 'storage',
OPEN_DIALOG: 'open-dialog',
SAVE_DIALOG: 'save-dialog',
I18N_OVERRIDE: 'i18n-override',
OPEN_FILE: 'open-file',
GET_FOLDER: 'get-folder',
GH_FETCH: 'gh-fetch',
DISCORD_PRESENCE: 'discord-presence'
} as const;
export interface IpcInvokeMap {
[IPC_CHANNELS.OPEN_URL]: (url: string) => void;
[IPC_CHANNELS.OS_STATS]: () => Promise<OSStats>;
[IPC_CHANNELS.WINDOW_ACTIONS]: (action: 'close' | 'minimize' | 'maximize' | 'hide') => void;
[IPC_CHANNELS.LOG]: (type: 'info' | 'error' | 'warn', ...args: unknown[]) => void;
[IPC_CHANNELS.OPEN_DIALOG]: (
options: OpenDialogOptions
) => Promise<OpenDialogReturnValue>;
[IPC_CHANNELS.SAVE_DIALOG]: (
options: SaveDialogOptions
) => Promise<SaveDialogReturnValue>;
[IPC_CHANNELS.I18N_OVERRIDE]: () => Promise<string | false>;
[IPC_CHANNELS.STORAGE]: (args: {
type: 'settings' | 'cache';
method: 'get' | 'set' | 'delete' | 'save';
key?: string;
value?: unknown;
}) => Promise<unknown>;
[IPC_CHANNELS.OPEN_FILE]: (path: string) => void;
[IPC_CHANNELS.GET_FOLDER]: (folder: 'config' | 'logs') => string;
[IPC_CHANNELS.GH_FETCH]: <T extends GHGet>(
options: T
) => Promise<GHReturn[T['type']]>;
[IPC_CHANNELS.DISCORD_PRESENCE]: (options: DiscordPresence) => void;
}

View File

@@ -1,82 +0,0 @@
import { FlatCompat } from '@eslint/eslintrc';
import eslint from '@eslint/js';
import globals from 'globals';
import tseslint from 'typescript-eslint';
import stylistic from '@stylistic/eslint-plugin';
const compat = new FlatCompat();
export const gui = [
eslint.configs.recommended,
...tseslint.configs.recommended,
...compat.extends('plugin:@dword-design/import-alias/recommended'),
...compat.plugins('eslint-plugin-react-hooks'),
// Add import-alias rule inside compat because plugin doesn't like flat configs
...compat.config({
rules: {
'@dword-design/import-alias/prefer-alias': [
'error',
{
alias: {
'@': './src/',
},
},
],
},
}),
{
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
parser: tseslint.parser,
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
globals: {
...globals.browser,
...globals.jest,
},
},
files: ['src/**/*.{js,jsx,ts,tsx,json}'],
plugins: {
'@typescript-eslint': tseslint.plugin,
'@stylistic': stylistic,
},
rules: {
'react/react-in-jsx-scope': 'off',
'react/prop-types': 'off',
'spaced-comment': 'error',
quotes: ['error', 'single'],
'no-duplicate-imports': 'error',
'no-inline-styles': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'react/no-unescaped-entities': 'off',
camelcase: 'error',
'@typescript-eslint/no-unused-vars': [
'warn',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
ignoreRestSiblings: true,
},
],
'@stylistic/jsx-self-closing-comp': 'error',
},
settings: {
'import/resolver': {
typescript: {},
},
react: {
version: 'detect',
},
},
},
// Global ignore
{
ignores: ['**/firmware-tool-api/'],
},
];
export default gui;

View File

@@ -3,14 +3,14 @@
<head>
<meta charset="utf-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, minimum-scale=1.0" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="theme-color" content="#000000" />
<link rel="apple-touch-icon" href="/logo192.png" />
<link rel="manifest" href="/manifest.json" />
<title>SlimeVR GUI</title>
<title>React App</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>

View File

@@ -1,28 +0,0 @@
import {
generateSchemaTypes,
generateReactQueryComponents,
} from '@openapi-codegen/typescript';
import { defineConfig } from '@openapi-codegen/cli';
import dotenv from 'dotenv';
dotenv.config()
export default defineConfig({
firmwareTool: {
from: {
source: 'url',
url: process.env.FIRMWARE_TOOL_SCHEMA_URL ?? 'http://localhost:3000/api-json',
},
outputDir: 'src/firmware-tool-api',
to: async (context) => {
const filenamePrefix = 'firmwareTool';
const { schemasFiles } = await generateSchemaTypes(context, {
filenamePrefix,
});
await generateReactQueryComponents(context, {
filenamePrefix,
schemasFiles,
});
},
},
});

View File

@@ -1,113 +1,95 @@
{
"name": "slimevr",
"version": "0.0.0",
"author": "SlimeVR Team <contact@slimevr.dev>",
"homepage": "https://slimevr.dev",
"type": "module",
"name": "slimevr-ui",
"version": "0.5.1",
"private": true,
"dependencies": {
"@ryuziii/discord-rpc": "1.0.1-rc.1",
"@xhayper/discord-rpc": "^1.3.0",
"commander": "^14.0.3",
"discord-rich-presence": "^0.0.8",
"glob": "^13.0.3",
"open": "^11.0.0",
"pino": "^10.3.1",
"pino-pretty": "^13.1.3",
"pino-roll": "^4.0.0"
"@fluent/bundle": "^0.17.1",
"@fluent/react": "^0.14.1",
"@fontsource/poppins": "^4.5.8",
"@formatjs/intl-localematcher": "^0.2.32",
"@react-three/fiber": "^8.10.0",
"@tauri-apps/api": "^1.2.0",
"@vitejs/plugin-react": "^3.0.0",
"browserslist": "^4.18.1",
"camelcase": "^6.2.1",
"classnames": "^2.3.1",
"dotenv": "^10.0.0",
"dotenv-expand": "^5.1.0",
"eslint-config-react-app": "^7.0.0",
"file-loader": "^6.2.0",
"flatbuffers": "^22.10.26",
"fs-extra": "^10.0.0",
"identity-obj-proxy": "^3.0.0",
"intl-pluralrules": "^1.3.1",
"ip-num": "^1.4.1",
"postcss-flexbugs-fixes": "^5.0.2",
"postcss-normalize": "^10.0.1",
"postcss-preset-env": "^7.0.1",
"prompts": "^2.4.2",
"react": "^18.0.0",
"react-dev-utils": "^12.0.0",
"react-dom": "^18.0.0",
"react-hook-form": "^7.29.0",
"react-modal": "3.15.1",
"react-router-dom": "^6.2.2",
"semver": "^7.3.5",
"solarxr-protocol": "file:../solarxr-protocol",
"three": "^0.148.0",
"typescript": "^4.6.3"
},
"scripts": {
"start": "vite --force",
"gui": "electron-vite dev --config electron.vite.config.ts --watch",
"build": "electron-vite build --config electron.vite.config.ts",
"package": "electron-builder",
"package:build": "pnpm build && pnpm package",
"preview": "electron-vite preview --config electron.vite.config.ts",
"skipbundler": "vite build",
"lint": "tsc --noEmit && eslint --max-warnings=0 \"src/**/*.{js,jsx,ts,tsx,json}\" && prettier --check \"src/**/*.{js,jsx,ts,tsx,css,scss,md,json}\"",
"lint:fix": "tsc --noEmit && eslint --fix --max-warnings=0 \"src/**/*.{js,jsx,ts,tsx,json}\" && pnpm run format",
"format": "prettier --write \"src/**/*.{js,jsx,ts,tsx,css,scss,md,json}\"",
"javaversion-build": "cd electron/resources/java-version/ && javac JavaVersion.java && jar cvfe JavaVersion.jar JavaVersion JavaVersion.class",
"gen:javaversion": "cd electron/resources/java-version/ && javac JavaVersion.java && jar cvfe JavaVersion.jar JavaVersion JavaVersion.class",
"gen:firmware-tool": "openapi-codegen gen firmwareTool"
"build": "vite build",
"dev": "tauri dev",
"skipbundler": "tauri build -b none",
"tauri": "tauri",
"lint": "eslint src/**/*.{js,jsx,ts,tsx,json}",
"lint:fix": "eslint --fix src/**/*.{js,jsx,ts,tsx,json}",
"format": "prettier --write src/**/*.{js,jsx,ts,tsx,css,md,json} --config ./.prettierrc",
"preview-vite": "vite preview",
"javaversion-build": "cd src-tauri/src/ && javac JavaVersion.java && jar cvfe JavaVersion.jar JavaVersion JavaVersion.class"
},
"eslintConfig": {
"extends": [
"react-app"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"@dword-design/eslint-plugin-import-alias": "^4.0.9",
"@electron/asar": "^4.0.1",
"@fluent/bundle": "^0.18.0",
"@fluent/react": "^0.15.2",
"@fontsource/poppins": "^5.1.0",
"@formatjs/intl-localematcher": "^0.2.32",
"@hookform/resolvers": "^3.6.0",
"@openapi-codegen/cli": "^3.1.0",
"@openapi-codegen/typescript": "^8.0.2",
"@react-hookz/deep-equal": "^3.0.3",
"@sentry/react": "10.29.0",
"@sentry/vite-plugin": "^2.22.7",
"@stylistic/eslint-plugin": "^5.5.0",
"@tailwindcss/forms": "^0.5.9",
"@tailwindcss/typography": "^0.5.15",
"@tanstack/react-query": "^5.48.0",
"@tweenjs/tween.js": "^25.0.0",
"@twemoji/svg": "^15.0.0",
"@types/file-saver": "^2.0.7",
"@types/node": "^24.3.1",
"@types/react": "^18.3.11",
"@types/react-dom": "^18.3.0",
"@types/react-helmet": "^6.1.11",
"@types/react-modal": "3.16.3",
"@types/semver": "^7.5.8",
"@types/three": "^0.163.0",
"@typescript-eslint/eslint-plugin": "^8.48.1",
"@typescript-eslint/parser": "^8.48.1",
"@vitejs/plugin-react": "^4.3.2",
"ajv": "^8.17.1",
"autoprefixer": "^10.4.20",
"browser-fs-access": "^0.35.0",
"classnames": "^2.5.1",
"convert": "^5.12.0",
"dmg-license": "^1.0.11",
"dotenv": "^16.4.5",
"electron": "^40.3.0",
"electron-builder": "^26.7.0",
"electron-vite": "^5.0.0",
"eslint": "^9.39.1",
"eslint-import-resolver-typescript": "^3.10.1",
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-jsx-a11y": "^6.10.2",
"eslint-plugin-react": "^7.37.5",
"eslint-plugin-react-hooks": "^7.0.1",
"flatbuffers": "22.10.26",
"globals": "^15.10.0",
"intl-pluralrules": "^2.0.1",
"ip-num": "^1.5.1",
"jotai": "^2.12.2",
"prettier": "^3.3.3",
"prompts": "^2.4.2",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-error-boundary": "^4.0.13",
"react-helmet": "^6.1.0",
"react-hook-form": "^7.63.0",
"react-markdown": "^9.0.1",
"react-modal": "^3.16.1",
"react-responsive": "^10.0.0",
"react-router-dom": "^6.26.2",
"remark-gfm": "^4.0.0",
"rollup-plugin-visualizer": "^5.12.0",
"sass": "^1.79.4",
"semver": "^7.6.3",
"solarxr-protocol": "file:../solarxr-protocol",
"spdx-satisfies": "^5.0.1",
"tailwind-gradient-mask-image": "^1.2.0",
"tailwindcss": "^3.4.13",
"three": "^0.163.0",
"ts-pattern": "^5.4.0",
"typescript": "^5.6.3",
"typescript-eslint": "^8.46.2",
"use-double-tap": "^1.3.6",
"uuid": "^13.0.0",
"vite": "^5.4.8",
"yup": "^1.4.0"
},
"main": "./out/main/index.js"
"@tailwindcss/forms": "^0.5.0",
"@tauri-apps/cli": "^1.2.2",
"@types/react": "18.0.25",
"@types/react-dom": "^18.0.5",
"@types/react-modal": "3.13.1",
"@types/three": "^0.148.0",
"@typescript-eslint/eslint-plugin": "^5.43.0",
"@typescript-eslint/parser": "^5.43.0",
"autoprefixer": "^10.4.4",
"cross-env": "^7.0.3",
"eslint": "^8.18.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-prettier": "^8.5.0",
"eslint-import-resolver-typescript": "^3.1.1",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsx-a11y": "^6.6.0",
"eslint-plugin-prettier": "^4.1.0",
"eslint-plugin-react": "^7.30.1",
"eslint-plugin-react-hooks": "^4.6.0",
"postcss": "^8.4.12",
"prettier": "^2.7.1",
"pretty-quick": "^3.1.3",
"tailwindcss": "^3.0.23",
"vite": "^4.0.3"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

Some files were not shown because too many files have changed in this diff Show More