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 dcea4ea..d5b20cf 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -2,8 +2,6 @@ name: build on: push: - branches: - - main pull_request: branches: - main @@ -13,8 +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 06eb04e..b908321 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,19 +1,38 @@ name: release -on: workflow_dispatch +on: + workflow_dispatch: + inputs: + provided-github-release-id: + type: string + description: Providing this value will reuse previous version and github release, use only in case of failed previous release + do-npm-publish: + type: boolean + default: true + description: Providing false will skip `npm publish`, use only in case of failed previous release + do-linux-build: + type: boolean + default: true + description: Providing false will skip linux build, use only in case of failed previous release + do-macos-build: + type: boolean + default: true + description: Providing false will skip macos build, use only in case of failed previous release + do-windows-build: + type: boolean + default: true + description: Providing false will skip windows build, use only in case of failed previous release 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 @@ -24,28 +43,43 @@ jobs: id: init-step env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PROVIDED_GITHUB_RELEASE_ID: ${{ inputs.provided-github-release-id }} publish-linux: needs: - publish-init + if: ${{ inputs.do-linux-build }} uses: ./.github/workflows/setup-linux.yaml with: command: npm run publish-linux-project --workspace @project-gauntlet/build github-release-id: ${{ needs.publish-init.outputs.github-release-id }} + publish-windows: + needs: + - publish-init + if: ${{ inputs.do-windows-build }} + uses: ./.github/workflows/setup-windows.yaml + with: + command: npm run publish-windows-project --workspace @project-gauntlet/build + github-release-id: ${{ needs.publish-init.outputs.github-release-id }} + publish-macos: needs: - publish-init + if: ${{ inputs.do-macos-build }} uses: ./.github/workflows/setup-macos.yaml with: command: npm run publish-macos-project --workspace @project-gauntlet/build github-release-id: ${{ needs.publish-init.outputs.github-release-id }} + secrets: inherit publish-final: needs: - publish-linux - publish-macos + - publish-windows - publish-init + if: ${{ inputs.do-npm-publish }} uses: ./.github/workflows/setup-linux.yaml with: command: npm run publish-final-project --workspace @project-gauntlet/build diff --git a/.github/workflows/setup-linux.yaml b/.github/workflows/setup-linux.yaml index b06d552..1a104cf 100644 --- a/.github/workflows/setup-linux.yaml +++ b/.github/workflows/setup-linux.yaml @@ -6,12 +6,16 @@ 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 - run: sudo apt-get install -y protobuf-compiler @@ -20,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 @@ -41,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 cb8f299..6b1b8eb 100644 --- a/.github/workflows/setup-macos.yaml +++ b/.github/workflows/setup-macos.yaml @@ -6,12 +6,16 @@ on: command: required: true type: string + upload-artifact: + default: false + type: boolean github-release-id: type: string jobs: run-on-macos: runs-on: macos-latest + timeout-minutes: 60 steps: # https://github.com/actions/runner-images/issues/7522#issuecomment-1556766641 - name: Kill XProtectBehaviorService @@ -19,12 +23,10 @@ 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: 18 + node-version: 22 registry-url: "https://registry.npmjs.org" scope: '@project-gauntlet' @@ -33,9 +35,12 @@ 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 + - run: cargo install apple-codesign - uses: Swatinem/rust-cache@v2 with: @@ -45,6 +50,18 @@ jobs: - run: ${{ inputs.command }} env: + MACOSX_DEPLOYMENT_TARGET: 11 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }} GITHUB_RELEASE_ID: ${{ inputs.github-release-id }} + 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 new file mode 100644 index 0000000..51d2e8a --- /dev/null +++ b/.github/workflows/setup-windows.yaml @@ -0,0 +1,52 @@ +name: setup windows + +on: + workflow_call: + inputs: + command: + required: true + type: string + upload-artifact: + default: false + type: boolean + github-release-id: + type: string + +jobs: + run-on-windows: + runs-on: windows-2022 + timeout-minutes: 60 + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + 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 --version 5.0.2 + - run: wix extension add -g WixToolset.Util.wixext/5.0.2 + + - uses: Swatinem/rust-cache@v2 + with: + save-if: ${{ github.ref == 'refs/heads/main' }} + + - run: npm ci + + - run: ${{ inputs.command }} + env: + 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/.npmrc b/.npmrc new file mode 100644 index 0000000..41583e3 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +@jsr:registry=https://npm.jsr.io diff --git a/CHANGELOG.md b/CHANGELOG.md index 3645c80..c747466 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,12 +3,572 @@ 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` + - `