diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..7e464ae --- /dev/null +++ b/.editorconfig @@ -0,0 +1,14 @@ +# EditorConfig is awesome: https://editorconfig.org + +# top-most EditorConfig file +root = true + +# Unix-style newlines with a newline ending every file +[*] +end_of_line = lf +insert_final_newline = true +charset = utf-8 + +[*.yaml] +indent_style = space +indent_size = 2 diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index e6e4dc1..d5b20cf 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -11,14 +11,19 @@ jobs: uses: ./.github/workflows/setup-linux.yaml with: command: npm run build-linux-project --workspace @project-gauntlet/build + upload-artifact: true + secrets: inherit build-macos: uses: ./.github/workflows/setup-macos.yaml with: command: npm run build-macos-project --workspace @project-gauntlet/build + upload-artifact: true secrets: inherit build-windows: uses: ./.github/workflows/setup-windows.yaml with: command: npm run build-windows-project --workspace @project-gauntlet/build + upload-artifact: true + secrets: inherit diff --git a/.github/workflows/format.yaml b/.github/workflows/format.yaml new file mode 100644 index 0000000..e9d96ac --- /dev/null +++ b/.github/workflows/format.yaml @@ -0,0 +1,19 @@ +name: format +on: [push, pull_request] +jobs: + rust: + runs-on: ubuntu-22.04 + steps: + - uses: dtolnay/rust-toolchain@nightly + with: + components: rustfmt + - uses: actions/checkout@v4 + - name: rustfmt + run: cargo +nightly fmt --all -- --check + nix: + runs-on: ubuntu-22.04 + steps: + - uses: cachix/install-nix-action@v31 + - uses: actions/checkout@v4 + - name: alejandra + run: nix shell nixpkgs#alejandra -c alejandra -c . diff --git a/.github/workflows/nix.yaml b/.github/workflows/nix.yaml new file mode 100644 index 0000000..41a5ab8 --- /dev/null +++ b/.github/workflows/nix.yaml @@ -0,0 +1,11 @@ +name: nix build +on: [push, pull_request] +jobs: + all: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - uses: cachix/install-nix-action@v25 + with: + nix_path: nixpkgs=channel:nixos-unstable + - run: nix-build diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 20de2e8..b908321 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -25,16 +25,14 @@ on: jobs: publish-init: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 outputs: github-release-id: ${{ steps.init-step.outputs.github-release-id }} steps: - uses: actions/checkout@v4 - with: - submodules: true - uses: actions/setup-node@v4 with: - node-version: 18 + node-version: 22 - run: npm ci diff --git a/.github/workflows/setup-linux.yaml b/.github/workflows/setup-linux.yaml index 98a92e0..1a104cf 100644 --- a/.github/workflows/setup-linux.yaml +++ b/.github/workflows/setup-linux.yaml @@ -6,12 +6,15 @@ on: command: required: true type: string + upload-artifact: + default: false + type: boolean github-release-id: type: string jobs: run-on-linux: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 timeout-minutes: 60 steps: - run: sudo apt-get update @@ -21,12 +24,10 @@ jobs: - run: sudo apt-get install -y libxkbcommon-dev - uses: actions/checkout@v4 - with: - submodules: true - - run: git pull + - uses: actions/setup-node@v4 with: - node-version: 18 + node-version: 22 registry-url: "https://registry.npmjs.org" scope: '@project-gauntlet' - uses: dtolnay/rust-toolchain@stable @@ -42,3 +43,11 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }} GITHUB_RELEASE_ID: ${{ inputs.github-release-id }} + + - uses: actions/upload-artifact@v4 + if: ${{ inputs.upload-artifact }} + with: + name: 'gauntlet-x86_64-linux.tar.gz' + path: 'target/x86_64-unknown-linux-gnu/release/archive/gauntlet-x86_64-linux.tar.gz' + if-no-files-found: 'error' + retention-days: 7 diff --git a/.github/workflows/setup-macos.yaml b/.github/workflows/setup-macos.yaml index 14c3fc6..6b1b8eb 100644 --- a/.github/workflows/setup-macos.yaml +++ b/.github/workflows/setup-macos.yaml @@ -6,6 +6,9 @@ on: command: required: true type: string + upload-artifact: + default: false + type: boolean github-release-id: type: string @@ -20,9 +23,7 @@ jobs: echo Killing XProtect.; sudo pkill -9 XProtect >/dev/null || true; - uses: actions/checkout@v4 - with: - submodules: true - - run: git pull + - uses: actions/setup-node@v4 with: node-version: 22 @@ -34,6 +35,8 @@ jobs: uses: Homebrew/actions/setup-homebrew@master - uses: dtolnay/rust-toolchain@stable + with: + targets: aarch64-apple-darwin,x86_64-apple-darwin - run: brew install protobuf - run: brew install create-dmg @@ -54,3 +57,11 @@ jobs: APPLE_SIGNING_KEY_PEM: ${{ secrets.APPLE_SIGNING_KEY_PEM }} APPLE_SIGNING_CERT_PEM: ${{ secrets.APPLE_SIGNING_CERT_PEM }} APP_STORE_CONNECT_KEY: ${{ secrets.APP_STORE_CONNECT_KEY }} + + - uses: actions/upload-artifact@v4 + if: ${{ inputs.upload-artifact }} + with: + name: 'gauntlet-universal-macos.dmg' + path: 'target/gauntlet-universal-macos.dmg' + if-no-files-found: 'error' + retention-days: 7 diff --git a/.github/workflows/setup-windows.yaml b/.github/workflows/setup-windows.yaml index e409a6a..51d2e8a 100644 --- a/.github/workflows/setup-windows.yaml +++ b/.github/workflows/setup-windows.yaml @@ -6,28 +6,29 @@ on: command: required: true type: string + upload-artifact: + default: false + type: boolean github-release-id: type: string jobs: run-on-windows: - runs-on: windows-latest + runs-on: windows-2022 timeout-minutes: 60 steps: - uses: actions/checkout@v4 - with: - submodules: true - - run: git pull + - uses: actions/setup-node@v4 with: - node-version: 18 + node-version: 22 registry-url: "https://registry.npmjs.org" scope: '@project-gauntlet' - uses: dtolnay/rust-toolchain@stable - run: choco install protoc - - run: dotnet tool install --global wix - - run: wix extension add -g WixToolset.Util.wixext + - run: dotnet tool install --global wix --version 5.0.2 + - run: wix extension add -g WixToolset.Util.wixext/5.0.2 - uses: Swatinem/rust-cache@v2 with: @@ -40,3 +41,12 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }} GITHUB_RELEASE_ID: ${{ inputs.github-release-id }} + + - uses: actions/upload-artifact@v4 + if: ${{ inputs.upload-artifact }} + with: + name: 'gauntlet-x86_64-windows.msi' + path: 'target/x86_64-pc-windows-msvc/release/gauntlet-x86_64-windows.msi' + if-no-files-found: 'error' + retention-days: 7 + diff --git a/.github/workflows/winget.yaml b/.github/workflows/winget.yaml new file mode 100644 index 0000000..33b4387 --- /dev/null +++ b/.github/workflows/winget.yaml @@ -0,0 +1,27 @@ +name: Publish to WinGet + +on: + release: + types: [published] + +env: + VERSION_REGEX: '^v(\d+)$' + # winget-create will read the following environment variable to access the GitHub token needed for submitting a PR + # See https://aka.ms/winget-create-token + WINGET_CREATE_GITHUB_TOKEN: ${{ secrets.WINGET_TOKEN }} + +jobs: + publish: + runs-on: windows-latest # Action can only run on Windows + steps: + - name: Publish To WinGet + run: | + $release = '${{ toJSON(github.event.release) }}' | ConvertFrom-Json + $wingetRelevantAsset = $release | Select-Object -Property assets | Where-Object { $_.name -like '*.msi' } | Select-Object -First 1 + $regex = [Regex]::New($env:VERSION_REGEX) + $version = $regex.Match($release.tag_name).Groups[1].Value + + $wingetPackage = "Exidex.Gauntlet" + + & curl.exe -JLO https://aka.ms/wingetcreate/latest + & .\wingetcreate.exe update $wingetPackage -s -v $version -u $wingetRelevantAsset.browser_download_url diff --git a/.gitignore b/.gitignore index 668d4bf..8d7a724 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ .idea /target /node_modules +/.direnv +result +.DS_Store diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 607863f..0000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "tools"] - path = tools - url = https://github.com/project-gauntlet/tools diff --git a/CHANGELOG.md b/CHANGELOG.md index 4388769..c747466 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,12 +3,324 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), -and this project doesn't adhere to Semantic Versioning, see [Versioning](./README.md#versioning) +and this project doesn't adhere to Semantic Versioning, see [Versioning](https://gauntlet.sh/docs/information/versioning) For changes in `@project-gauntlet/tools` see [separate CHANGELOG.md](https://github.com/project-gauntlet/tools/blob/main/CHANGELOG.md) ## [Unreleased] +## [21] - 2025-08-16 + +### General + +- When opening `Opened windows` view second item is now focused by default + - Because the window ordering is "most recently focused on the top", second can be considered as an "alternative" application that was focused before the last one +- Implemented native hud notifications on Linux + - Enabled by default + - `linux.native_hud` boolean configuration option is available to disable this +- Restricted JavaScript runtime heap size to 50 MB per plugin + +### Plugins +- It is now possible to programmatically control which item in grid/list is focused + - `` and `` now have new property `focusedItemId` + - If `focusedItemId` property is `undefined` the focus is uncontrolled + - if `focusedItemId` property is `null` the focus is controlled and unset + - if `focusedItemId` property is `string` the focus is controlled and set to item with specified `id` +- Refine nullability of event function arguments on React components + - **BREAKING CHANGE**: Following function properties now return `null` as an argument instead of `undefined` + - ``'s `onAction` + - ``'s `onItemFocusChange` + - ``'s `onItemFocusChange` + - For following function property arguments `undefined` was removed from type signature + - ``'s `onChange` + - ``'s `onChange` + - ``'s `onChange` + - `