From 67e55f6b7d94099abd0cf024beb12ec47d5bf7e9 Mon Sep 17 00:00:00 2001 From: wiiznokes <78230769+wiiznokes@users.noreply.github.com> Date: Tue, 23 Jan 2024 04:47:03 +0100 Subject: [PATCH] feat: add resource resolver crate (#106) --- .changes/config.json | 39 +- .github/workflows/check-nodejs-bindings.yml | 2 + .github/workflows/check.yml | 1 + .../workflows/covector-version-or-publish.yml | 10 + ...lish-packager-resource-resolver-nodejs.yml | 418 ++++++++ Cargo.lock | 902 +++++++++--------- Cargo.toml | 7 +- bindings/packager/nodejs/README.md | 5 +- bindings/packager/nodejs/schema.json | 2 +- bindings/packager/nodejs/src-ts/config.d.ts | 4 +- .../nodejs/.cargo/config.toml | 3 + bindings/resource-resolver/nodejs/.npmignore | 13 + bindings/resource-resolver/nodejs/Cargo.toml | 20 + bindings/resource-resolver/nodejs/README.md | 20 + bindings/resource-resolver/nodejs/build.rs | 5 + .../resource-resolver/nodejs/fix-types.js | 46 + bindings/resource-resolver/nodejs/index.d.ts | 22 + bindings/resource-resolver/nodejs/index.js | 274 ++++++ .../nodejs/npm/darwin-arm64/README.md | 3 + .../nodejs/npm/darwin-arm64/package.json | 18 + .../nodejs/npm/darwin-x64/README.md | 3 + .../nodejs/npm/darwin-x64/package.json | 18 + .../nodejs/npm/linux-arm-gnueabihf/README.md | 3 + .../npm/linux-arm-gnueabihf/package.json | 18 + .../nodejs/npm/linux-arm64-gnu/README.md | 3 + .../nodejs/npm/linux-arm64-gnu/package.json | 21 + .../nodejs/npm/linux-arm64-musl/README.md | 3 + .../nodejs/npm/linux-arm64-musl/package.json | 21 + .../nodejs/npm/linux-x64-gnu/README.md | 3 + .../nodejs/npm/linux-x64-gnu/package.json | 21 + .../nodejs/npm/linux-x64-musl/README.md | 3 + .../nodejs/npm/linux-x64-musl/package.json | 21 + .../nodejs/npm/win32-arm64-msvc/README.md | 3 + .../nodejs/npm/win32-arm64-msvc/package.json | 18 + .../nodejs/npm/win32-ia32-msvc/README.md | 3 + .../nodejs/npm/win32-ia32-msvc/package.json | 18 + .../nodejs/npm/win32-x64-msvc/README.md | 3 + .../nodejs/npm/win32-x64-msvc/package.json | 18 + .../resource-resolver/nodejs/package.json | 37 + bindings/resource-resolver/nodejs/src/lib.rs | 42 + crates/packager/Cargo.toml | 4 +- crates/packager/README.md | 5 +- crates/packager/schema.json | 4 +- crates/packager/src/config/mod.rs | 152 +-- crates/packager/src/lib.rs | 4 +- crates/resource-resolver/Cargo.toml | 21 + crates/resource-resolver/README.md | 30 + crates/resource-resolver/build.rs | 10 + crates/resource-resolver/src/error.rs | 31 + crates/resource-resolver/src/lib.rs | 137 +++ crates/updater/Cargo.toml | 26 +- crates/updater/src/lib.rs | 4 +- crates/utils/Cargo.toml | 20 + crates/utils/README.md | 3 + crates/{updater => utils}/src/current_exe.rs | 0 crates/utils/src/lib.rs | 172 ++++ pnpm-lock.yaml | 9 + 57 files changed, 2107 insertions(+), 619 deletions(-) create mode 100644 .github/workflows/publish-packager-resource-resolver-nodejs.yml create mode 100644 bindings/resource-resolver/nodejs/.cargo/config.toml create mode 100644 bindings/resource-resolver/nodejs/.npmignore create mode 100644 bindings/resource-resolver/nodejs/Cargo.toml create mode 100644 bindings/resource-resolver/nodejs/README.md create mode 100644 bindings/resource-resolver/nodejs/build.rs create mode 100644 bindings/resource-resolver/nodejs/fix-types.js create mode 100644 bindings/resource-resolver/nodejs/index.d.ts create mode 100644 bindings/resource-resolver/nodejs/index.js create mode 100644 bindings/resource-resolver/nodejs/npm/darwin-arm64/README.md create mode 100644 bindings/resource-resolver/nodejs/npm/darwin-arm64/package.json create mode 100644 bindings/resource-resolver/nodejs/npm/darwin-x64/README.md create mode 100644 bindings/resource-resolver/nodejs/npm/darwin-x64/package.json create mode 100644 bindings/resource-resolver/nodejs/npm/linux-arm-gnueabihf/README.md create mode 100644 bindings/resource-resolver/nodejs/npm/linux-arm-gnueabihf/package.json create mode 100644 bindings/resource-resolver/nodejs/npm/linux-arm64-gnu/README.md create mode 100644 bindings/resource-resolver/nodejs/npm/linux-arm64-gnu/package.json create mode 100644 bindings/resource-resolver/nodejs/npm/linux-arm64-musl/README.md create mode 100644 bindings/resource-resolver/nodejs/npm/linux-arm64-musl/package.json create mode 100644 bindings/resource-resolver/nodejs/npm/linux-x64-gnu/README.md create mode 100644 bindings/resource-resolver/nodejs/npm/linux-x64-gnu/package.json create mode 100644 bindings/resource-resolver/nodejs/npm/linux-x64-musl/README.md create mode 100644 bindings/resource-resolver/nodejs/npm/linux-x64-musl/package.json create mode 100644 bindings/resource-resolver/nodejs/npm/win32-arm64-msvc/README.md create mode 100644 bindings/resource-resolver/nodejs/npm/win32-arm64-msvc/package.json create mode 100644 bindings/resource-resolver/nodejs/npm/win32-ia32-msvc/README.md create mode 100644 bindings/resource-resolver/nodejs/npm/win32-ia32-msvc/package.json create mode 100644 bindings/resource-resolver/nodejs/npm/win32-x64-msvc/README.md create mode 100644 bindings/resource-resolver/nodejs/npm/win32-x64-msvc/package.json create mode 100644 bindings/resource-resolver/nodejs/package.json create mode 100644 bindings/resource-resolver/nodejs/src/lib.rs create mode 100644 crates/resource-resolver/Cargo.toml create mode 100644 crates/resource-resolver/README.md create mode 100644 crates/resource-resolver/build.rs create mode 100644 crates/resource-resolver/src/error.rs create mode 100644 crates/resource-resolver/src/lib.rs create mode 100644 crates/utils/Cargo.toml create mode 100644 crates/utils/README.md rename crates/{updater => utils}/src/current_exe.rs (100%) create mode 100644 crates/utils/src/lib.rs diff --git a/.changes/config.json b/.changes/config.json index 12a04ffb..a4d19bf4 100644 --- a/.changes/config.json +++ b/.changes/config.json @@ -100,10 +100,20 @@ } }, "packages": { + "cargo-packager-utils": { + "path": "./crates/utils", + "manager": "rust", + "assets": [ + { + "path": "${ pkg.path }/target/package/cargo-packager-utils-${ pkgFile.version }.crate", + "name": "${ pkg.pkg }-${ pkgFile.version }.crate" + } + ] + }, "cargo-packager": { "path": "./crates/packager", "manager": "rust", - "dependencies": ["cargo-packager-config"], + "dependencies": ["cargo-packager-utils"], "assets": [ { "path": "${ pkg.path }/target/package/cargo-packager-${ pkgFile.version }.crate", @@ -114,13 +124,14 @@ "@crabnebula/packager": { "path": "./bindings/packager/nodejs", "manager": "javascript", - "dependencies": ["cargo-packager"], + "dependencies": ["cargo-packager", "cargo-packager-utils"], "prepublish": [], "publish": [], "postpublish": [] }, "cargo-packager-updater": { "path": "./crates/updater", + "dependencies": ["cargo-packager-utils"], "manager": "rust", "assets": [ { @@ -132,7 +143,29 @@ "@crabnebula/updater": { "path": "./bindings/updater/nodejs", "manager": "javascript", - "dependencies": ["cargo-packager-updater"], + "dependencies": ["cargo-packager-updater", "cargo-packager-utils"], + "prepublish": [], + "publish": [], + "postpublish": [] + }, + "cargo-packager-resource-resolver": { + "path": "./crates/resource-resolver", + "dependencies": ["cargo-packager-utils"], + "manager": "rust", + "assets": [ + { + "path": "${ pkg.path }/target/package/cargo-packager-resource-resolver-${ pkgFile.version }.crate", + "name": "${ pkg.pkg }-${ pkgFile.version }.crate" + } + ] + }, + "@crabnebula/packager-resource-resolver": { + "path": "./bindings/resource-resolver/nodejs", + "manager": "javascript", + "dependencies": [ + "cargo-packager-resource-resolver", + "cargo-packager-utils" + ], "prepublish": [], "publish": [], "postpublish": [] diff --git a/.github/workflows/check-nodejs-bindings.yml b/.github/workflows/check-nodejs-bindings.yml index 3e5f654a..f0626e17 100644 --- a/.github/workflows/check-nodejs-bindings.yml +++ b/.github/workflows/check-nodejs-bindings.yml @@ -8,6 +8,7 @@ on: - ".github/workflows/check-nodejs-bindings.yml" - "crates/packager/**" - "crates/updater/**" + - "crates/resource-resolver/**" - "bindings/*/nodejs/**" pull_request: branches: @@ -16,6 +17,7 @@ on: - ".github/workflows/check-nodejs-bindings.yml" - "crates/packager/**" - "crates/updater/**" + - "crates/resource-resolver/**" - "bindings/*/nodejs/**" env: diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index e6380b56..78236f4c 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -32,6 +32,7 @@ jobs: version: latest - run: pnpm install - run: pnpm format:check + rustfmt: if: ${{ !startsWith(github.head_ref, 'renovate/') }} runs-on: ubuntu-latest diff --git a/.github/workflows/covector-version-or-publish.yml b/.github/workflows/covector-version-or-publish.yml index 067e1318..467d429b 100644 --- a/.github/workflows/covector-version-or-publish.yml +++ b/.github/workflows/covector-version-or-publish.yml @@ -68,3 +68,13 @@ jobs: event-type: publish-updater-nodejs client-payload: >- {"releaseId": "${{ steps.covector.outputs['-crabnebula-updater-releaseId'] }}" } + + - name: Trigger `@crabnebula/packager-resource-resolver` publishing workflow + if: | + steps.covector.outputs.successfulPublish == 'true' && + contains(steps.covector.outputs.packagesPublished, '@crabnebula/packager-resource-resolver') + uses: peter-evans/repository-dispatch@v2 + with: + event-type: publish-packager-resource-resolver-nodejs + client-payload: >- + {"releaseId": "${{ steps.covector.outputs['-crabnebula-packager-resource-resolver-releaseId'] }}" } diff --git a/.github/workflows/publish-packager-resource-resolver-nodejs.yml b/.github/workflows/publish-packager-resource-resolver-nodejs.yml new file mode 100644 index 00000000..398ebe2b --- /dev/null +++ b/.github/workflows/publish-packager-resource-resolver-nodejs.yml @@ -0,0 +1,418 @@ +name: Publish `@crabnebula/packager-resource-resolver` + +env: + DEBUG: napi:* + APP_NAME: packager-resource-resolver + MACOSX_DEPLOYMENT_TARGET: "10.13" + +permissions: + contents: write + id-token: write + +on: + workflow_dispatch: + inputs: + releaseId: + description: "ID of the `@crabnebula/packager-resource-resolver` release" + required: true + repository_dispatch: + types: [publish-packager-resource-resolver-nodejs] + +defaults: + run: + working-directory: bindings/resource-resolver/nodejs + +jobs: + build: + strategy: + fail-fast: false + matrix: + settings: + - host: macos-latest + target: x86_64-apple-darwin + build: | + pnpm build + strip -x *.node + - host: windows-latest + build: pnpm build + target: x86_64-pc-windows-msvc + - host: windows-latest + build: pnpm build --target i686-pc-windows-msvc + target: i686-pc-windows-msvc + - host: ubuntu-latest + target: x86_64-unknown-linux-gnu + docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian + build: | + cd bindings/resource-resolver/nodejs + set -e && + pnpm build --target x86_64-unknown-linux-gnu && + strip *.node + - host: ubuntu-latest + target: x86_64-unknown-linux-musl + docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine + build: | + cd bindings/resource-resolver/nodejs + set -e + pnpm build + strip *.node + - host: macos-latest + target: aarch64-apple-darwin + build: | + pnpm build --target aarch64-apple-darwin --features native-tls-vendored --cargo-flags="--no-default-features" + strip -x *.node + - host: ubuntu-latest + target: aarch64-unknown-linux-gnu + docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian-aarch64 + build: | + cd bindings/resource-resolver/nodejs + set -e && + pnpm build --target aarch64-unknown-linux-gnu && + aarch64-unknown-linux-gnu-strip *.node + - host: ubuntu-latest + target: armv7-unknown-linux-gnueabihf + setup: | + sudo apt-get update + sudo apt-get install gcc-arm-linux-gnueabihf -y + build: | + pnpm build --target armv7-unknown-linux-gnueabihf + arm-linux-gnueabihf-strip *.node + - host: ubuntu-latest + target: aarch64-unknown-linux-musl + docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine + build: | + cd bindings/resource-resolver/nodejs + set -e && + rustup target add aarch64-unknown-linux-musl && + pnpm build --target aarch64-unknown-linux-musl && + /aarch64-linux-musl-cross/bin/aarch64-linux-musl-strip *.node + - host: windows-latest + target: aarch64-pc-windows-msvc + build: pnpm build --target aarch64-pc-windows-msvc --features native-tls-vendored --cargo-flags="--no-default-features" + name: stable - ${{ matrix.settings.target }} - node@18 + runs-on: ${{ matrix.settings.host }} + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v2 + with: + version: latest + package_json_file: bindings/resource-resolver/nodejs + - uses: actions/setup-node@v4 + if: ${{ !matrix.settings.docker }} + - name: Install + uses: dtolnay/rust-toolchain@stable + if: ${{ !matrix.settings.docker }} + with: + toolchain: stable + targets: ${{ matrix.settings.target }} + - name: Cache cargo + uses: actions/cache@v4 + with: + path: | + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + .cargo-cache + target/ + key: ${{ matrix.settings.target }}-cargo-${{ matrix.settings.host }} + - uses: goto-bus-stop/setup-zig@v2 + if: ${{ matrix.settings.target == 'armv7-unknown-linux-gnueabihf' }} + with: + version: 0.11.0 + - name: Setup toolchain + run: ${{ matrix.settings.setup }} + if: ${{ matrix.settings.setup }} + shell: bash + - name: Setup node x86 + if: matrix.settings.target == 'i686-pc-windows-msvc' + run: pnpm config set supportedArchitectures.cpu "ia32" + shell: bash + - run: pnpm install + - name: Setup node x86 + uses: actions/setup-node@v4 + if: matrix.settings.target == 'i686-pc-windows-msvc' + with: + node-version: 18 + architecture: x86 + - name: Build in docker + uses: addnab/docker-run-action@v3 + if: ${{ matrix.settings.docker }} + with: + image: ${{ matrix.settings.docker }} + options: "--user 0:0 -v ${{ github.workspace }}/.cargo-cache/git/db:/usr/local/cargo/git/db -v ${{ github.workspace }}/.cargo/registry/cache:/usr/local/cargo/registry/cache -v ${{ github.workspace }}/.cargo/registry/index:/usr/local/cargo/registry/index -v ${{ github.workspace }}:/build -w /build" + run: ${{ matrix.settings.build }} + - name: Build + run: ${{ matrix.settings.build }} + if: ${{ !matrix.settings.docker }} + shell: bash + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: bindings-${{ matrix.settings.target }} + path: bindings/resource-resolver/nodejs/${{ env.APP_NAME }}.*.node + if-no-files-found: error + test-macOS-windows-binding: + name: Test bindings on ${{ matrix.settings.target }} - node@${{ matrix.node }} + needs: + - build + strategy: + fail-fast: false + matrix: + settings: + - host: macos-latest + target: x86_64-apple-darwin + - host: windows-latest + target: x86_64-pc-windows-msvc + node: + - "18" + - "20" + runs-on: ${{ matrix.settings.host }} + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v2 + with: + version: latest + package_json_file: bindings/resource-resolver/nodejs + - uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node }} + - run: pnpm install + - name: Download artifacts + uses: actions/download-artifact@v3 + with: + name: bindings-${{ matrix.settings.target }} + path: bindings/resource-resolver/nodejs + - name: List packages + run: ls -R . + shell: bash + - name: Test bindings + run: pnpm test + test-linux-x64-gnu-binding: + name: Test bindings on Linux-x64-gnu - node@${{ matrix.node }} + needs: + - build + strategy: + fail-fast: false + matrix: + node: + - "18" + - "20" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v2 + with: + version: latest + package_json_file: bindings/resource-resolver/nodejs + - uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node }} + - run: pnpm install + - name: Download artifacts + uses: actions/download-artifact@v3 + with: + name: bindings-x86_64-unknown-linux-gnu + path: bindings/resource-resolver/nodejs + - name: List packages + run: ls -R . + shell: bash + - name: Test bindings + working-directory: . + run: docker run --rm -v $(pwd):/build -w /build node:${{ matrix.node }}-slim sh -c "cd bindings/resource-resolver/nodejs && yarn test" + test-linux-x64-musl-binding: + name: Test bindings on x86_64-unknown-linux-musl - node@${{ matrix.node }} + needs: + - build + strategy: + fail-fast: false + matrix: + node: + - "18" + - "20" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v2 + with: + version: latest + package_json_file: bindings/resource-resolver/nodejs + - uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node }} + - name: Install dependencies + run: | + pnpm config set supportedArchitectures.libc "musl" + pnpm install + - name: Download artifacts + uses: actions/download-artifact@v3 + with: + name: bindings-x86_64-unknown-linux-musl + path: bindings/resource-resolver/nodejs + - name: List packages + run: ls -R . + shell: bash + - name: Test bindings + working-directory: . + run: docker run --rm -v $(pwd):/build -w /build node:${{ matrix.node }}-alpine sh -c "cd bindings/resource-resolver/nodejs && yarn test" + test-linux-aarch64-gnu-binding: + name: Test bindings on aarch64-unknown-linux-gnu - node@${{ matrix.node }} + needs: + - build + strategy: + fail-fast: false + matrix: + node: + - "18" + - "20" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Download artifacts + uses: actions/download-artifact@v3 + with: + name: bindings-aarch64-unknown-linux-gnu + path: bindings/resource-resolver/nodejs + - name: List packages + run: ls -R . + shell: bash + - uses: pnpm/action-setup@v2 + with: + version: latest + package_json_file: bindings/resource-resolver/nodejs + - name: Install dependencies + run: | + pnpm config set supportedArchitectures.cpu "arm64" + pnpm config set supportedArchitectures.libc "glibc" + pnpm install + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: arm64 + - run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes + - name: Setup and run tests + uses: addnab/docker-run-action@v3 + with: + image: node:${{ matrix.node }}-slim + options: "--platform linux/arm64 -v ${{ github.workspace }}:/build -w /build" + run: | + set -e + cd bindings/resource-resolver/nodejs + yarn test + ls -la + test-linux-aarch64-musl-binding: + name: Test bindings on aarch64-unknown-linux-musl - node@${{ matrix.node }} + needs: + - build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Download artifacts + uses: actions/download-artifact@v3 + with: + name: bindings-aarch64-unknown-linux-musl + path: bindings/resource-resolver/nodejs + - name: List packages + run: ls -R . + shell: bash + - uses: pnpm/action-setup@v2 + with: + version: latest + package_json_file: bindings/resource-resolver/nodejs + - name: Install dependencies + run: | + pnpm config set supportedArchitectures.cpu "arm64" + pnpm config set supportedArchitectures.libc "musl" + pnpm install + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: arm64 + - run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes + - name: Setup and run tests + uses: addnab/docker-run-action@v3 + with: + image: node:lts-alpine + options: "--platform linux/arm64 -v ${{ github.workspace }}:/build -w /build" + run: | + set -e + cd bindings/resource-resolver/nodejs + yarn test + test-linux-arm-gnueabihf-binding: + name: Test bindings on armv7-unknown-linux-gnueabihf - node@${{ matrix.node }} + needs: + - build + strategy: + fail-fast: false + matrix: + node: + - "18" + - "20" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Download artifacts + uses: actions/download-artifact@v3 + with: + name: bindings-armv7-unknown-linux-gnueabihf + path: bindings/resource-resolver/nodejs + - name: List packages + run: ls -R . + shell: bash + - uses: pnpm/action-setup@v2 + with: + version: latest + package_json_file: bindings/resource-resolver/nodejs + - name: Install dependencies + run: | + pnpm config set supportedArchitectures.cpu "arm" + pnpm install + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: arm + - run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes + - name: Setup and run tests + uses: addnab/docker-run-action@v3 + with: + image: node:${{ matrix.node }}-bullseye-slim + options: "--platform linux/arm/v7 -v ${{ github.workspace }}:/build -w /build" + run: | + set -e + cd bindings/resource-resolver/nodejs + yarn test + ls -la + publish: + name: Publish + runs-on: ubuntu-latest + needs: + - build + - test-macOS-windows-binding + - test-linux-x64-gnu-binding + - test-linux-x64-musl-binding + - test-linux-aarch64-gnu-binding + - test-linux-aarch64-musl-binding + - test-linux-arm-gnueabihf-binding + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v2 + with: + version: latest + package_json_file: bindings/resource-resolver/nodejs + - uses: actions/setup-node@v4 + - run: pnpm install + - name: Download all artifacts + uses: actions/download-artifact@v4 + with: + path: bindings/resource-resolver/nodejs/artifacts + - name: Move artifacts + run: pnpm artifacts + - name: List packages + run: ls -R ./npm + shell: bash + - name: Publish + run: | + echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc + npm publish --access public + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + RELEASE_ID: ${{ github.event.client_payload.releaseId || inputs.releaseId }} diff --git a/Cargo.lock b/Cargo.lock index 41e6b822..6b0f5115 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -26,9 +26,9 @@ checksum = "76eb1adf08c5bcaa8490b9851fd53cca27fa9880076f178ea9d29f05196728a8" [[package]] name = "accesskit" -version = "0.12.1" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca8410747ed85a17c4a1e9ed3f5a74d3e7bdcc876cf9a18ff40ae21d645997b2" +checksum = "6cb10ed32c63247e4e39a8f42e8e30fb9442fbf7878c8e4a9849e7e381619bea" [[package]] name = "accesskit_consumer" @@ -45,7 +45,7 @@ version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c17cca53c09fbd7288667b22a201274b9becaa27f0b91bf52a526db95de45e6" dependencies = [ - "accesskit 0.12.1", + "accesskit 0.12.2", ] [[package]] @@ -66,7 +66,7 @@ version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd3b6ae1eabbfbced10e840fd3fce8a93ae84f174b3e4ba892ab7bcb42e477a7" dependencies = [ - "accesskit 0.12.1", + "accesskit 0.12.2", "accesskit_consumer 0.16.1", "objc2 0.3.0-beta.3.patch-leaks.3", "once_cell", @@ -93,7 +93,7 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09f46c18d99ba61ad7123dd13eeb0c104436ab6af1df6a1cd8c11054ed394a08" dependencies = [ - "accesskit 0.12.1", + "accesskit 0.12.2", "accesskit_consumer 0.16.1", "async-channel 2.1.1", "async-once-cell", @@ -124,7 +124,7 @@ version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "afcae27ec0974fc7c3b0b318783be89fd1b2e66dd702179fe600166a38ff4a0b" dependencies = [ - "accesskit 0.12.1", + "accesskit 0.12.2", "accesskit_consumer 0.16.1", "once_cell", "paste", @@ -151,11 +151,11 @@ version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5284218aca17d9e150164428a0ebc7b955f70e3a9a78b4c20894513aabf98a67" dependencies = [ - "accesskit 0.12.1", + "accesskit 0.12.2", "accesskit_macos 0.10.1", "accesskit_unix 0.6.2", "accesskit_windows 0.15.1", - "winit 0.29.4", + "winit 0.29.10", ] [[package]] @@ -181,12 +181,12 @@ checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234" [[package]] name = "ahash" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" +checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" dependencies = [ "cfg-if", - "getrandom 0.2.11", + "getrandom 0.2.12", "once_cell", "version_check", "zerocopy", @@ -242,12 +242,12 @@ dependencies = [ [[package]] name = "android-activity" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "052ad56e336bcc615a214bffbeca6c181ee9550acec193f0327e0b103b033a4d" +checksum = "39b801912a977c3fd52d80511fe1c0c8480c6f957f21ae2ce1b92ffe970cf4b9" dependencies = [ "android-properties", - "bitflags 2.4.1", + "bitflags 2.4.2", "cc", "cesu8", "jni 0.21.1", @@ -257,7 +257,7 @@ dependencies = [ "ndk 0.8.0", "ndk-context", "ndk-sys 0.5.0+25.2.9519653", - "num_enum 0.7.1", + "num_enum 0.7.2", "thiserror", ] @@ -284,9 +284,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.5" +version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d664a92ecae85fd0a7392615844904654d1d5f5514837f471ddef4a057aba1b6" +checksum = "6e2e1ebcb11de5c03c67de28a7df593d32191b44939c482e97702baaaa6ab6a5" dependencies = [ "anstyle", "anstyle-parse", @@ -332,9 +332,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.75" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" +checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" [[package]] name = "ar" @@ -356,7 +356,7 @@ dependencies = [ "parking_lot", "thiserror", "winapi", - "x11rb", + "x11rb 0.12.0", ] [[package]] @@ -411,7 +411,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ca33f4bc4ed1babef42cad36cc1f51fa88be00420404e5b1e80ab1b18f7678c" dependencies = [ "concurrent-queue", - "event-listener 4.0.0", + "event-listener 4.0.3", "event-listener-strategy", "futures-core", "pin-project-lite", @@ -423,11 +423,11 @@ version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17ae5ebefcc48e7452b4987947920dac9450be1110cadf34d1b8c116bdbaf97c" dependencies = [ - "async-lock 3.2.0", + "async-lock 3.3.0", "async-task", "concurrent-queue", "fastrand 2.0.1", - "futures-lite 2.1.0", + "futures-lite 2.2.0", "slab", ] @@ -465,18 +465,18 @@ dependencies = [ [[package]] name = "async-io" -version = "2.2.2" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6afaa937395a620e33dc6a742c593c01aced20aa376ffb0f628121198578ccc7" +checksum = "fb41eb19024a91746eba0773aa5e16036045bbf45733766661099e182ea6a744" dependencies = [ - "async-lock 3.2.0", + "async-lock 3.3.0", "cfg-if", "concurrent-queue", "futures-io", - "futures-lite 2.1.0", + "futures-lite 2.2.0", "parking", - "polling 3.3.1", - "rustix 0.38.28", + "polling 3.3.2", + "rustix 0.38.30", "slab", "tracing", "windows-sys 0.52.0", @@ -493,11 +493,11 @@ dependencies = [ [[package]] name = "async-lock" -version = "3.2.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7125e42787d53db9dd54261812ef17e937c95a51e4d291373b670342fa44310c" +checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" dependencies = [ - "event-listener 4.0.0", + "event-listener 4.0.3", "event-listener-strategy", "pin-project-lite", ] @@ -521,7 +521,7 @@ dependencies = [ "cfg-if", "event-listener 3.1.0", "futures-lite 1.13.0", - "rustix 0.38.28", + "rustix 0.38.30", "windows-sys 0.48.0", ] @@ -533,7 +533,7 @@ checksum = "5fd55a5ba1179988837d24ab4c7cc8ed6efdeff578ede0416b4225a5fca35bd0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.48", ] [[package]] @@ -542,13 +542,13 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e47d90f65a225c4527103a8d747001fc56e375203592b25ad103e1ca13124c5" dependencies = [ - "async-io 2.2.2", + "async-io 2.3.0", "async-lock 2.8.0", "atomic-waker", "cfg-if", "futures-core", "futures-io", - "rustix 0.38.28", + "rustix 0.38.30", "signal-hook-registry", "slab", "windows-sys 0.48.0", @@ -556,19 +556,19 @@ dependencies = [ [[package]] name = "async-task" -version = "4.6.0" +version = "4.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d90cd0b264dfdd8eb5bad0a2c217c1f88fa96a8573f40e7b12de23fb468f46" +checksum = "fbb36e985947064623dbd357f727af08ffd077f93d696782f3c56365fa2e2799" [[package]] name = "async-trait" -version = "0.1.74" +version = "0.1.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" +checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.48", ] [[package]] @@ -684,14 +684,14 @@ dependencies = [ [[package]] name = "auto_enums" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a764179c02b324e33cf71b4180e7dd13572400ff7e5c866da813f6c84e0e4cd3" +checksum = "f1c074a5fdb14f54a9cc22ad68979588325bc6986eed6b859e03de43e4880214" dependencies = [ "derive_utils", "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.48", ] [[package]] @@ -723,9 +723,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.5" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "bindgen" @@ -733,7 +733,7 @@ version = "0.68.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "726e4313eb6ec35d2730258ad4e15b547ee75d6afaa1361a922e78e59b7d8078" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "cexpr", "clang-sys", "lazy_static", @@ -746,7 +746,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.41", + "syn 2.0.48", "which", ] @@ -764,9 +764,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.1" +version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" +checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" dependencies = [ "serde", ] @@ -797,9 +797,9 @@ dependencies = [ [[package]] name = "block-sys" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dd7cf50912cddc06dc5ea7c08c5e81c1b2c842a70d19def1848d54c586fed92" +checksum = "ae85a0696e7ea3b835a453750bf002770776609115e6d25c6d2ff28a8200f7e7" dependencies = [ "objc-sys 0.3.2", ] @@ -820,7 +820,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "15b55663a85f33501257357e6421bb33e769d5c9ffb5ba0921c975a123e35e68" dependencies = [ - "block-sys 0.2.0", + "block-sys 0.2.1", "objc2 0.4.1", ] @@ -831,11 +831,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a37913e8dc4ddcc604f0c6d3bf2887c995153af3611de9e23c352b44c1b9118" dependencies = [ "async-channel 2.1.1", - "async-lock 3.2.0", + "async-lock 3.3.0", "async-task", "fastrand 2.0.1", "futures-io", - "futures-lite 2.1.0", + "futures-lite 2.2.0", "piper", "tracing", ] @@ -890,7 +890,7 @@ checksum = "965ab7eb5f8f97d2a083c799f3a1b994fc397b2fe2da5d1da1626ce15a39f2b1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.48", ] [[package]] @@ -949,14 +949,14 @@ dependencies = [ [[package]] name = "calloop" -version = "0.12.3" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b50b5a44d59a98c55a9eeb518f39bf7499ba19fd98ee7d22618687f3f10adbf" +checksum = "fba7adb4dd5aa98e5553510223000e7148f621165ec5f9acd7113f6ca4995298" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "log", - "polling 3.3.1", - "rustix 0.38.28", + "polling 3.3.2", + "rustix 0.38.30", "slab", "thiserror", ] @@ -967,8 +967,8 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0f0ea9b9476c7fad82841a8dbb380e2eae480c21910feba80725b46931ed8f02" dependencies = [ - "calloop 0.12.3", - "rustix 0.38.28", + "calloop 0.12.4", + "rustix 0.38.30", "wayland-backend", "wayland-client 0.31.1", ] @@ -984,10 +984,11 @@ dependencies = [ [[package]] name = "cargo-packager" -version = "0.4.3" +version = "0.4.5" dependencies = [ "ar", - "base64 0.21.5", + "base64 0.21.7", + "cargo-packager-utils", "cargo_metadata", "clap", "dirs", @@ -1038,11 +1039,22 @@ dependencies = [ "serde_json", ] +[[package]] +name = "cargo-packager-resource-resolver" +version = "0.0.0" +dependencies = [ + "cargo-packager-utils", + "heck", + "log", + "thiserror", +] + [[package]] name = "cargo-packager-updater" version = "0.1.1" dependencies = [ - "base64 0.21.5", + "base64 0.21.7", + "cargo-packager-utils", "ctor 0.2.6", "dirs", "dunce", @@ -1068,11 +1080,21 @@ dependencies = [ "cargo-packager-updater", ] +[[package]] +name = "cargo-packager-utils" +version = "0.0.0" +dependencies = [ + "clap", + "ctor 0.2.6", + "schemars", + "serde", +] + [[package]] name = "cargo-platform" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e34637b3140142bdf929fb439e8aa4ebad7651ebf7b1080b3930aa16ac1459ff" +checksum = "ceed8ef69d8518a5dda55c07425450b58a4e1946f4951eab6d7191ee86c2443d" dependencies = [ "serde", ] @@ -1139,9 +1161,9 @@ dependencies = [ [[package]] name = "cfg-expr" -version = "0.15.5" +version = "0.15.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03915af431787e6ffdcc74c645077518c6b6e01f80b761e0fbbfa288536311b3" +checksum = "6100bc57b6209840798d95cb2775684849d332f7bd788db2a8c8caf7ef82a41a" dependencies = [ "smallvec", "target-lexicon", @@ -1170,15 +1192,15 @@ dependencies = [ [[package]] name = "chrono" -version = "0.4.31" +version = "0.4.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" +checksum = "41daef31d7a747c5c847246f36de49ced6f7403b4cdabc807a97b5cc184cda7a" dependencies = [ "android-tzdata", "iana-time-zone", "num-traits", "serde", - "windows-targets 0.48.5", + "windows-targets 0.52.0", ] [[package]] @@ -1199,20 +1221,20 @@ dependencies = [ [[package]] name = "clang-sys" -version = "1.6.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c688fc74432808e3eb684cae8830a86be1d66a2bd58e1f248ed0960a590baf6f" +checksum = "67523a3b4be3ce1989d607a828d036249522dd9c1c8de7f4dd2dae43a37369d1" dependencies = [ "glob", "libc", - "libloading 0.7.4", + "libloading 0.8.1", ] [[package]] name = "clap" -version = "4.4.11" +version = "4.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfaff671f6b22ca62406885ece523383b9b64022e341e53e009a62ebc47a45f2" +checksum = "1e578d6ec4194633722ccf9544794b71b1385c3c027efe0c55db226fc880865c" dependencies = [ "clap_builder", "clap_derive", @@ -1220,9 +1242,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.11" +version = "4.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a216b506622bb1d316cd51328dce24e07bdff4a6128a47c7e7fad11878d5adbb" +checksum = "4df4df40ec50c46000231c914968278b1eb05098cf8f1b3a518a95030e71d1c7" dependencies = [ "anstream", "anstyle", @@ -1239,7 +1261,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.48", ] [[package]] @@ -1386,7 +1408,7 @@ checksum = "57aaaad9185d3bcb3afe63549d8ba60b2fb0ea8dc2da83f62dd56805edf56fd1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.48", ] [[package]] @@ -1524,7 +1546,7 @@ dependencies = [ "lazy_static", "proc-macro2", "regex", - "syn 2.0.41", + "syn 2.0.48", "unicode-xid", ] @@ -1536,7 +1558,7 @@ checksum = "3e1a2532e4ed4ea13031c13bc7bc0dbca4aae32df48e9d77f0d1e743179f2ea1" dependencies = [ "lazy_static", "proc-macro2", - "syn 2.0.41", + "syn 2.0.48", ] [[package]] @@ -1551,14 +1573,14 @@ dependencies = [ "lazy_static", "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.48", ] [[package]] name = "cpufeatures" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" dependencies = [ "libc", ] @@ -1575,6 +1597,17 @@ dependencies = [ "tracing", ] +[[package]] +name = "crabnebula_packager_resource_resolver" +version = "0.0.0" +dependencies = [ + "cargo-packager-resource-resolver", + "dunce", + "napi", + "napi-build", + "napi-derive", +] + [[package]] name = "crabnebula_updater" version = "0.0.0" @@ -1604,45 +1637,37 @@ checksum = "7059fff8937831a9ae6f0fe4d658ffabf58f2ca96aa9dec1c889f936f705f216" [[package]] name = "crossbeam-channel" -version = "0.5.9" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c3242926edf34aec4ac3a77108ad4854bffaa2e4ddc1824124ce59231302d5" +checksum = "176dc175b78f56c0f321911d9c8eb2b77a78a4860b9c19db83835fea1a46649b" dependencies = [ - "cfg-if", "crossbeam-utils", ] [[package]] name = "crossbeam-deque" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fca89a0e215bab21874660c67903c5f143333cab1da83d041c7ded6053774751" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" dependencies = [ - "cfg-if", "crossbeam-epoch", "crossbeam-utils", ] [[package]] name = "crossbeam-epoch" -version = "0.9.16" +version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d2fe95351b870527a5d09bf563ed3c97c0cffb87cf1c78a591bf48bb218d9aa" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" dependencies = [ - "autocfg", - "cfg-if", "crossbeam-utils", - "memoffset 0.9.0", ] [[package]] name = "crossbeam-utils" -version = "0.8.17" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d96137f14f244c37f989d9fff8f95e6c18b918e71f36638f8c49112e4c78f" -dependencies = [ - "cfg-if", -] +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" [[package]] name = "crunchy" @@ -1693,7 +1718,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331" dependencies = [ "quote", - "syn 2.0.41", + "syn 2.0.48", ] [[package]] @@ -1713,7 +1738,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "30d2b3721e861707777e3195b0158f950ae6dc4a27e4d02ff9f67e3eb3de199e" dependencies = [ "quote", - "syn 2.0.41", + "syn 2.0.48", ] [[package]] @@ -1743,7 +1768,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.41", + "syn 2.0.48", ] [[package]] @@ -1754,7 +1779,7 @@ checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" dependencies = [ "darling_core", "quote", - "syn 2.0.41", + "syn 2.0.48", ] [[package]] @@ -1771,9 +1796,9 @@ checksum = "5c297a1c74b71ae29df00c3e22dd9534821d60eb9af5a0192823fa2acea70c2a" [[package]] name = "deranged" -version = "0.3.10" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eb30d70a07a3b04884d2677f06bec33509dc67ca60d92949e5535352d3191dc" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" dependencies = [ "powerfmt", "serde", @@ -1811,7 +1836,7 @@ checksum = "9abcad25e9720609ccb3dcdb795d845e37d8ce34183330a9f48b03a1a71c8e21" dependencies = [ "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.48", ] [[package]] @@ -1868,7 +1893,7 @@ dependencies = [ "prettyplease", "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.48", ] [[package]] @@ -1978,7 +2003,7 @@ dependencies = [ "dioxus-core", "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.48", ] [[package]] @@ -2229,11 +2254,12 @@ dependencies = [ [[package]] name = "embed-resource" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f54cc3e827ee1c3812239a9a41dede7b4d7d5d5464faa32d71bd7cba28ce2cb2" +checksum = "3bde55e389bea6a966bd467ad1ad7da0ae14546a5bc794d16d1e55e7fca44881" dependencies = [ "cc", + "memchr", "rustc_version", "toml 0.8.8", "vswhom", @@ -2273,7 +2299,7 @@ checksum = "f95e2801cd355d4a1a3e3953ce6ee5ae9603a5c833455343a8bfe3f44d418246" dependencies = [ "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.48", ] [[package]] @@ -2294,7 +2320,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.48", ] [[package]] @@ -2369,9 +2395,9 @@ dependencies = [ [[package]] name = "event-listener" -version = "4.0.0" +version = "4.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "770d968249b5d99410d61f5bf89057f3199a077a04d087092f58e7d10692baae" +checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" dependencies = [ "concurrent-queue", "parking", @@ -2384,7 +2410,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" dependencies = [ - "event-listener 4.0.0", + "event-listener 4.0.3", "pin-project-lite", ] @@ -2421,25 +2447,26 @@ checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" [[package]] name = "fdeflate" -version = "0.3.1" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64d6dafc854908ff5da46ff3f8f473c6984119a2876a383a860246dd7841a868" +checksum = "4f9bfee30e4dedf0ab8b422f03af778d9612b63f502710fc500a334ebe2de645" dependencies = [ "simd-adler32", ] [[package]] name = "femtovg" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19df4b4c86231086212f22513ccfdbce94a1e1270d1cb09c030bd39fd73f3ee4" +checksum = "18ab822e58e8bc2b89840dc5dde49afe39302e129c60d39c8520200c085404a7" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "fnv", "generational-arena", - "glow 0.13.0", + "glow 0.13.1", "image", "imgref", + "log", "lru", "rgb", "rustybuzz 0.11.0", @@ -2562,7 +2589,7 @@ checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" dependencies = [ "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.48", ] [[package]] @@ -2598,24 +2625,24 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" dependencies = [ "futures-core", ] [[package]] name = "futures-core" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] name = "futures-executor" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f4fb8693db0cf099eadcca0efe2a5a22e4550f98ed16aba6c48700da29597bc" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" dependencies = [ "futures-core", "futures-task", @@ -2624,9 +2651,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bf34a163b5c4c52d0478a4d757da8fb65cabef42ba90515efee0f6f9fa45aaa" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" [[package]] name = "futures-lite" @@ -2645,9 +2672,9 @@ dependencies = [ [[package]] name = "futures-lite" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aeee267a1883f7ebef3700f262d2d54de95dfaf38189015a74fdc4e0c7ad8143" +checksum = "445ba825b27408685aaecefd65178908c36c6e96aaf6d8599419d46e624192ba" dependencies = [ "fastrand 2.0.1", "futures-core", @@ -2658,32 +2685,32 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.48", ] [[package]] name = "futures-sink" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" [[package]] name = "futures-task" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-util" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ "futures-core", "futures-io", @@ -2855,6 +2882,16 @@ dependencies = [ "winapi", ] +[[package]] +name = "gethostname" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0176e0459c2e4a1fe232f984bca6890e681076abb9934f6cea7c326f3fc47818" +dependencies = [ + "libc", + "windows-targets 0.48.5", +] + [[package]] name = "getrandom" version = "0.1.16" @@ -2868,9 +2905,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" dependencies = [ "cfg-if", "js-sys", @@ -3006,9 +3043,9 @@ dependencies = [ [[package]] name = "glow" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "886c2a30b160c4c6fec8f987430c26b526b7988ca71f664e6a699ddf6f9601e4" +checksum = "bd348e04c43b32574f2de31c8bb397d96c9fcfa1371bd4ca6d8bdc464ab121b1" dependencies = [ "js-sys", "slotmap", @@ -3041,11 +3078,11 @@ dependencies = [ [[package]] name = "glutin" -version = "0.31.1" +version = "0.31.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eca18d477e18c996c1fd1a50e04c6a745b67e2d512c7fb51f2757d9486a0e3ee" +checksum = "005459a22af86adc706522d78d360101118e2638ec21df3852fcc626e0dbb212" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "cfg_aliases", "cgl", "core-foundation", @@ -3082,9 +3119,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ebcdfba24f73b8412c5181e56f092b5eff16671c514ce896b258a0a64bd7735" dependencies = [ "cfg_aliases", - "glutin 0.31.1", + "glutin 0.31.2", "raw-window-handle 0.5.2", - "winit 0.29.4", + "winit 0.29.10", ] [[package]] @@ -3213,9 +3250,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.22" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d6250322ef6e60f93f9a2162799302cd6f68f79f6e5d85c8c16f14d1d958178" +checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9" dependencies = [ "bytes", "fnv", @@ -3286,9 +3323,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" +checksum = "5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f" [[package]] name = "hex" @@ -3425,10 +3462,10 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28d0c47573bf4fb9ffbab394464e51b564465e83e5860d4269e78f6c08cd4be9" dependencies = [ - "calloop 0.12.3", + "calloop 0.12.4", "drm", "gbm", - "glutin 0.31.1", + "glutin 0.31.2", "i-slint-common", "i-slint-core", "i-slint-renderer-femtovg", @@ -3479,7 +3516,7 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "565ece613df99476e516a8a3c853269795fc06b553f66ed0a8f7159d4cb5c975" dependencies = [ - "accesskit 0.12.1", + "accesskit 0.12.2", "accesskit_winit 0.16.1", "bytemuck", "cfg-if", @@ -3488,7 +3525,7 @@ dependencies = [ "const-field-offset", "copypasta", "derive_more", - "glutin 0.31.1", + "glutin 0.31.2", "glutin-winit 0.4.2", "i-slint-common", "i-slint-core", @@ -3508,7 +3545,7 @@ dependencies = [ "vtable", "wasm-bindgen", "web-sys", - "winit 0.29.4", + "winit 0.29.10", ] [[package]] @@ -3541,7 +3578,7 @@ dependencies = [ "linked_hash_set", "lyon_extra", "lyon_path", - "num_enum 0.7.1", + "num_enum 0.7.2", "once_cell", "proc-macro2", "quote", @@ -3604,7 +3641,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9148dba9642f055cdda5060f2e82be4a4c1c4a046ea1d08970e9279220b7ed13" dependencies = [ "quote", - "syn 2.0.41", + "syn 2.0.48", ] [[package]] @@ -3620,7 +3657,7 @@ dependencies = [ "derive_more", "dwrote", "femtovg", - "glow 0.13.0", + "glow 0.13.1", "i-slint-common", "i-slint-core", "i-slint-core-macros", @@ -3655,8 +3692,8 @@ dependencies = [ "core-graphics-types", "derive_more", "foreign-types 0.5.0", - "glow 0.13.0", - "glutin 0.31.1", + "glow 0.13.1", + "glutin 0.31.2", "i-slint-common", "i-slint-core", "i-slint-core-macros", @@ -3677,9 +3714,9 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.58" +version = "0.1.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8326b86b6cff230b97d0d312a6c40a60726df3332e721f72a1b035f451663b20" +checksum = "b6a67363e2aa4443928ce15e57ebae94fd8949958fd1223c4cfc0cd473ad7539" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -3737,9 +3774,9 @@ dependencies = [ [[package]] name = "image" -version = "0.24.7" +version = "0.24.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f3dfdbdd72063086ff443e297b61695500514b1e41095b6fb9a5ab48a70a711" +checksum = "034bbe799d1909622a74d1193aa50147769440040ff36cb2baa947609b0a4e23" dependencies = [ "bytemuck", "byteorder", @@ -3747,7 +3784,6 @@ dependencies = [ "exr", "gif", "jpeg-decoder", - "num-rational", "num-traits", "png", "qoi", @@ -3762,9 +3798,9 @@ checksum = "029d73f573d8e8d63e6d5020011d3255b28c3ba85d6cf870a07184ed23de9284" [[package]] name = "imgref" -version = "1.10.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90d944e334f00f4449c9640b440a171f816be0152305c12ef90424fc35fd035c" +checksum = "44feda355f4159a7c757171a77de25daf6411e217b4cabd03bd6650690468126" [[package]] name = "indexmap" @@ -3831,12 +3867,9 @@ dependencies = [ [[package]] name = "input-sys" -version = "1.17.0" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f6c2a17e8aba7217660e32863af87b0febad811d4b8620ef76b386603fddc2" -dependencies = [ - "libc", -] +checksum = "bd4f5b4d1c00331c5245163aacfe5f20be75b564c7112d45893d4ae038119eb0" [[package]] name = "instant" @@ -3993,18 +4026,18 @@ dependencies = [ [[package]] name = "jpeg-decoder" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc0000e42512c92e31c2252315bda326620a4e034105e900c98ec492fa077b3e" +checksum = "f5d4a7da358eff58addd2877a45865158f0d78c911d43a5784ceb7bbf52833b0" dependencies = [ "rayon", ] [[package]] name = "js-sys" -version = "0.3.66" +version = "0.3.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cee9c64da59eae3b50095c18d3e74f8b73c0b86d2792824ff01bbce68ba229ca" +checksum = "9a1d36f1235bc969acba30b7f5990b864423a6068a10f7c90ae8f0112e3a59d1" dependencies = [ "wasm-bindgen", ] @@ -4027,7 +4060,7 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b750dcadc39a09dbadd74e118f6dd6598df77fa01df0cfcdc52c28dece74528a" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "serde", "unicode-segmentation", ] @@ -4085,9 +4118,9 @@ checksum = "03087c2bad5e1034e8cace5926dec053fb3790248370865f5117a7d0213354c8" [[package]] name = "libc" -version = "0.2.151" +version = "0.2.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "302d7ab3130588088d277783b1e2d2e10c9e9e4a16dd9050e6ec93fb3e7048f4" +checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" [[package]] name = "libflate" @@ -4145,7 +4178,7 @@ version = "0.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "libc", "redox_syscall 0.4.1", ] @@ -4156,7 +4189,7 @@ version = "0.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3af92c55d7d839293953fcd0fda5ecfe93297cfde6ffbdec13b41d99c0ba6607" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "libc", "redox_syscall 0.4.1", ] @@ -4223,9 +4256,9 @@ checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] name = "linux-raw-sys" -version = "0.4.12" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" [[package]] name = "lock_api" @@ -4291,9 +4324,9 @@ dependencies = [ [[package]] name = "lyon_geom" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74df1ff0a0147282eb10699537a03baa7d31972b58984a1d44ce0624043fe8ad" +checksum = "edecfb8d234a2b0be031ab02ebcdd9f3b9ee418fb35e265f7a540a48d197bff9" dependencies = [ "arrayvec", "euclid", @@ -4362,9 +4395,9 @@ checksum = "490cc448043f947bae3cbee9c203358d62dbee0db12107a74be5c30ccfd09771" [[package]] name = "memchr" -version = "2.6.4" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" [[package]] name = "memmap2" @@ -4386,9 +4419,9 @@ dependencies = [ [[package]] name = "memmap2" -version = "0.9.2" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39a69c7c189ae418f83003da62820aca28d15a07725ce51fb924999335d622ff" +checksum = "45fd3a57831bf88bc63f8cebc0cf956116276e97fef3966103e96416209f7c92" dependencies = [ "libc", ] @@ -4426,7 +4459,7 @@ version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c43f73953f8cbe511f021b58f18c3ce1c3d1ae13fe953293e13345bf83217f25" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "block", "core-graphics-types", "foreign-types 0.5.0", @@ -4453,7 +4486,7 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4225fad231f4cfb67990de1750bb53f10ff1d5b42b91beb2a49e6ebd36c9ab4a" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.12", "rpassword", "scrypt", ] @@ -4488,11 +4521,11 @@ dependencies = [ [[package]] name = "napi" -version = "2.14.1" +version = "2.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1133249c46e92da921bafc8aba4912bf84d6c475f7625183772ed2d0844dc3a7" +checksum = "2fc1cb00cde484640da9f01a124edbb013576a6ae9843b23857c940936b76d91" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "ctor 0.2.6", "napi-derive", "napi-sys", @@ -4508,23 +4541,23 @@ checksum = "d4b4532cf86bfef556348ac65e561e3123879f0e7566cca6d43a6ff5326f13df" [[package]] name = "napi-derive" -version = "2.14.4" +version = "2.14.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b5af262f1d8e660742eb722abc7113a5b3c3de4144d0ef23ede2518672ceff1" +checksum = "e61bec1ee990ae3e9a5f443484c65fb38e571a898437f0ad283ed69c82fc59c0" dependencies = [ "cfg-if", "convert_case 0.6.0", "napi-derive-backend", "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.48", ] [[package]] name = "napi-derive-backend" -version = "1.0.57" +version = "1.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ea236321b521d6926213a2021e407b0562e28a257c037a45919e414d2cdb4f8" +checksum = "2314f777bc9cde51705d991c44466cee4de4a3f41c6d3d019fcbbebb5cdd47c4" dependencies = [ "convert_case 0.6.0", "once_cell", @@ -4532,7 +4565,7 @@ dependencies = [ "quote", "regex", "semver", - "syn 2.0.41", + "syn 2.0.48", ] [[package]] @@ -4595,11 +4628,11 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2076a31b7010b17a38c01907c45b945e8f11495ee4dd588309718901b1f7a5b7" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "jni-sys", "log", "ndk-sys 0.5.0+25.2.9519653", - "num_enum 0.7.1", + "num_enum 0.7.2", "raw-window-handle 0.5.2", "raw-window-handle 0.6.0", "thiserror", @@ -4687,7 +4720,7 @@ version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "cfg-if", "libc", ] @@ -4724,27 +4757,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "num-integer" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" -dependencies = [ - "autocfg", - "num-traits", -] - -[[package]] -name = "num-rational" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - [[package]] name = "num-traits" version = "0.2.17" @@ -4785,11 +4797,11 @@ dependencies = [ [[package]] name = "num_enum" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "683751d591e6d81200c39fb0d1032608b77724f34114db54f571ff1317b337c0" +checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845" dependencies = [ - "num_enum_derive 0.7.1", + "num_enum_derive 0.7.2", ] [[package]] @@ -4813,19 +4825,19 @@ dependencies = [ "proc-macro-crate 1.3.1", "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.48", ] [[package]] name = "num_enum_derive" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c11e44798ad209ccdd91fc192f0526a369a01234f7373e1b141c96d7cee4f0e" +checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" dependencies = [ - "proc-macro-crate 2.0.0", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.48", ] [[package]] @@ -4917,9 +4929,9 @@ dependencies = [ [[package]] name = "object" -version = "0.32.1" +version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ "memchr", ] @@ -4936,11 +4948,11 @@ dependencies = [ [[package]] name = "openssl" -version = "0.10.61" +version = "0.10.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b8419dc8cc6d866deb801274bba2e6f8f6108c1bb7fcc10ee5ab864931dbb45" +checksum = "15c9d69dd87a29568d4d017cfe8ec518706046a05184e5aea92d0af890b803c8" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "cfg-if", "foreign-types 0.3.2", "libc", @@ -4957,7 +4969,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.48", ] [[package]] @@ -4977,9 +4989,9 @@ dependencies = [ [[package]] name = "openssl-sys" -version = "0.9.97" +version = "0.9.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3eaad34cdd97d81de97964fc7f29e2d104f483840d906ef56daa1912338460b" +checksum = "22e1bf214306098e4832460f797824c05d25aacdf896f64a985fb0fd992454ae" dependencies = [ "cc", "libc", @@ -5024,12 +5036,12 @@ dependencies = [ [[package]] name = "os_pipe" -version = "1.1.4" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ae859aa07428ca9a929b936690f8b12dc5f11dd8c6992a18ca93919f28bc177" +checksum = "57119c3b893986491ec9aa85056780d3a0f3cf4da7cc09dd3650dbd6c6738fb9" dependencies = [ "libc", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -5132,9 +5144,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.5" +version = "2.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae9cee2a55a544be8b89dc6848072af97a20f2422603c10865be2a42b580fff5" +checksum = "1f200d8d83c44a45b21764d1916299752ca035d15ecd46faca3e9a2a2bf6ad06" dependencies = [ "memchr", "thiserror", @@ -5143,9 +5155,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.7.5" +version = "2.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81d78524685f5ef2a3b3bd1cafbc9fcabb036253d9b1463e726a91cd16e2dfc2" +checksum = "bcd6ab1236bbdb3a49027e920e693192ebfe8913f6d60e294de57463a493cfde" dependencies = [ "pest", "pest_generator", @@ -5153,22 +5165,22 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.5" +version = "2.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68bd1206e71118b5356dae5ddc61c8b11e28b09ef6a31acbd15ea48a28e0c227" +checksum = "2a31940305ffc96863a735bef7c7994a00b325a7138fdbc5bda0f1a0476d3275" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.48", ] [[package]] name = "pest_meta" -version = "2.7.5" +version = "2.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c747191d4ad9e4a4ab9c8798f1e82a39affe7ef9648390b7e5548d18e099de6" +checksum = "a7ff62f5259e53b78d1af898941cdcdccfae7385cf7d793a6e55de5d05bb4b7d" dependencies = [ "once_cell", "pest", @@ -5296,7 +5308,7 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.48", ] [[package]] @@ -5330,9 +5342,9 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.27" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" +checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb" [[package]] name = "plist" @@ -5340,7 +5352,7 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5699cc8a63d1aa2b1ee8e12b9ad70ac790d65788cd36101fa37f87ea46c4cef" dependencies = [ - "base64 0.21.5", + "base64 0.21.7", "indexmap 2.1.0", "line-wrap", "quick-xml 0.31.0", @@ -5350,9 +5362,9 @@ dependencies = [ [[package]] name = "png" -version = "0.17.10" +version = "0.17.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd75bf2d8dd3702b9707cdbc56a5b9ef42cec752eb8b3bafc01234558442aa64" +checksum = "1f6c3c3e617595665b8ea2ff95a86066be38fb121ff920a9c0eb282abcd1da5a" dependencies = [ "bitflags 1.3.2", "crc32fast", @@ -5379,14 +5391,14 @@ dependencies = [ [[package]] name = "polling" -version = "3.3.1" +version = "3.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf63fa624ab313c11656b4cda960bfc46c410187ad493c41f6ba2d8c1e991c9e" +checksum = "545c980a3880efd47b2e262f6a4bb6daad6555cf3367aa9c4e52895f69537a41" dependencies = [ "cfg-if", "concurrent-queue", "pin-project-lite", - "rustix 0.38.28", + "rustix 0.38.30", "tracing", "windows-sys 0.52.0", ] @@ -5420,12 +5432,12 @@ checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" [[package]] name = "prettyplease" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d" +checksum = "a41cf62165e97c7f814d2221421dbb9afcbcdb0a88068e5ea206e19951c2cbb5" dependencies = [ "proc-macro2", - "syn 2.0.41", + "syn 2.0.48", ] [[package]] @@ -5440,11 +5452,11 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "2.0.0" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8366a6159044a37876a2b9817124296703c586a5c92e2c53751fa06d8d43e8" +checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" dependencies = [ - "toml_edit 0.20.7", + "toml_edit 0.21.0", ] [[package]] @@ -5479,9 +5491,9 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro2" -version = "1.0.70" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" dependencies = [ "unicode-ident", ] @@ -5526,9 +5538,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.33" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] @@ -5593,7 +5605,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.12", ] [[package]] @@ -5628,9 +5640,9 @@ checksum = "42a9830a0e1b9fb145ebb365b8bc4ccd75f290f98c0247deafbbe2c75cefb544" [[package]] name = "rayon" -version = "1.8.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1" +checksum = "fa7237101a77a10773db45d62004a272517633fbcc3df19d96455ede1122e051" dependencies = [ "either", "rayon-core", @@ -5638,9 +5650,9 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.12.0" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" dependencies = [ "crossbeam-deque", "crossbeam-utils", @@ -5676,20 +5688,20 @@ version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.12", "libredox 0.0.1", "thiserror", ] [[package]] name = "regex" -version = "1.10.2" +version = "1.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" +checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.3", + "regex-automata 0.4.4", "regex-syntax 0.8.2", ] @@ -5704,9 +5716,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" +checksum = "3b7fa1134405e2ec9353fd416b17f8dacd46c473d7d3fd1cf202706a14eb792a" dependencies = [ "aho-corasick", "memchr", @@ -5727,9 +5739,9 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "relative-path" -version = "1.9.0" +version = "1.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c707298afce11da2efef2f600116fa93ffa7a032b5d7b628aa17711ec81383ca" +checksum = "e898588f33fdd5b9420719948f9f2a32c922a246964576f71ba7f24f80610fbc" [[package]] name = "reqwest" @@ -5737,7 +5749,7 @@ version = "0.11.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37b1ae8d9ac08420c66222fb9096fc5de435c3c48542bc5336c51892cffafb41" dependencies = [ - "base64 0.21.5", + "base64 0.21.7", "bytes", "encoding_rs", "futures-core", @@ -5831,7 +5843,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" dependencies = [ "cc", - "getrandom 0.2.11", + "getrandom 0.2.12", "libc", "spin", "untrusted", @@ -5924,14 +5936,14 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.28" +version = "0.38.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72e572a5e8ca657d7366229cdde4bd14c4eb5499a9573d4d366fe1b599daa316" +checksum = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "errno", "libc", - "linux-raw-sys 0.4.12", + "linux-raw-sys 0.4.13", "windows-sys 0.52.0", ] @@ -5953,7 +5965,7 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" dependencies = [ - "base64 0.21.5", + "base64 0.21.7", ] [[package]] @@ -6036,11 +6048,11 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" +checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -6123,13 +6135,13 @@ dependencies = [ [[package]] name = "sctk-adwaita" -version = "0.7.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1729a30a469de249c6effc17ec8d039b0aa29b3af79b819b7f51cb6ab8046a90" +checksum = "82b2eaf3a5b264a521b988b2e73042e742df700c4f962cde845d1541adb46550" dependencies = [ "ab_glyph", "log", - "memmap2 0.9.2", + "memmap2 0.9.3", "smithay-client-toolkit 0.18.0", "tiny-skia 0.11.3", ] @@ -6179,9 +6191,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.20" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" +checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" dependencies = [ "serde", ] @@ -6194,9 +6206,9 @@ checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" [[package]] name = "serde" -version = "1.0.193" +version = "1.0.195" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" +checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02" dependencies = [ "serde_derive", ] @@ -6213,13 +6225,13 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.193" +version = "1.0.195" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" +checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.48", ] [[package]] @@ -6235,9 +6247,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.108" +version = "1.0.111" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" +checksum = "176e46fa42316f18edd598015a5166857fc835ec732f5215eac6b7bdbf0a84f4" dependencies = [ "itoa 1.0.10", "ryu", @@ -6246,20 +6258,20 @@ dependencies = [ [[package]] name = "serde_repr" -version = "0.1.17" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3081f5ffbb02284dda55132aa26daecedd7372a42417bbbab6f14ab7d6bb9145" +checksum = "0b2e6b945e9d3df726b65d6ee24060aff8e3533d431f677a9695db04eff9dfdb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.48", ] [[package]] name = "serde_spanned" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12022b835073e5b11e90a14f86838ceb1c8fb0325b72416845c487ac0fa95e80" +checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" dependencies = [ "serde", ] @@ -6278,11 +6290,11 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.4.0" +version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64cd236ccc1b7a29e7e2739f27c0b2dd199804abc4290e32f59f3b68d6405c23" +checksum = "f58c3a1b3e418f61c25b2aeb43fc6c95eaa252b8cecdda67f401943e9e08d33f" dependencies = [ - "base64 0.21.5", + "base64 0.21.7", "chrono", "hex", "indexmap 1.9.3", @@ -6295,14 +6307,14 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.4.0" +version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93634eb5f75a2323b16de4748022ac4297f9e76b6dced2be287a099f41b5e788" +checksum = "d2068b437a31fc68f25dd7edc296b078f04b45145c199d8eed9866e45f1ff274" dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.48", ] [[package]] @@ -6376,9 +6388,9 @@ dependencies = [ [[package]] name = "shlex" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7cee0529a6d40f580e7a5e6c495c8fbfe21b7b52795ed4bb5e62cdf92bc6380" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "signal-hook-registry" @@ -6434,7 +6446,7 @@ version = "0.68.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed678303df69daf5b666faf477800ff7fcb7b67316b10a94c31d748d42dd5a83" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "lazy_static", "skia-bindings", "winapi", @@ -6516,9 +6528,9 @@ checksum = "d92359f97e6b417da4328a970cf04a044db104fbd57f7d72cb7ff665bb8806af" [[package]] name = "smallvec" -version = "1.11.2" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" +checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" [[package]] name = "smithay-client-toolkit" @@ -6545,14 +6557,14 @@ version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60e3d9941fa3bacf7c2bf4b065304faa14164151254cd16ce1b1bc8fc381600f" dependencies = [ - "bitflags 2.4.1", - "calloop 0.12.3", + "bitflags 2.4.2", + "calloop 0.12.4", "calloop-wayland-source", "cursor-icon", "libc", "log", - "memmap2 0.9.2", - "rustix 0.38.28", + "memmap2 0.9.3", + "rustix 0.38.30", "thiserror", "wayland-backend", "wayland-client 0.31.1", @@ -6587,9 +6599,9 @@ dependencies = [ [[package]] name = "smol_str" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74212e6bbe9a4352329b2f68ba3130c15a3f26fe88ff22dbdc6cdd58fa85e99c" +checksum = "e6845563ada680337a52d43bb0b29f396f2d911616f6573012645b9e3d048a49" dependencies = [ "serde", ] @@ -6616,9 +6628,9 @@ dependencies = [ [[package]] name = "softbuffer" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "826da2ead8e85d1b4ea579fae3d58ec10c81a77d61deab8918c4a4f7514b2948" +checksum = "f266ce2aa23eaaaa4e758ed44495d505d00fb79f359d46f6c1900cb053123b62" dependencies = [ "as-raw-xcb-connection", "bytemuck", @@ -6629,11 +6641,11 @@ dependencies = [ "foreign-types 0.5.0", "js-sys", "log", - "memmap2 0.9.2", + "memmap2 0.9.3", "objc", "raw-window-handle 0.5.2", "redox_syscall 0.4.1", - "rustix 0.38.28", + "rustix 0.38.30", "tiny-xlib", "wasm-bindgen", "wayland-backend", @@ -6641,7 +6653,7 @@ dependencies = [ "wayland-sys 0.31.1", "web-sys", "windows-sys 0.48.0", - "x11rb", + "x11rb 0.12.0", ] [[package]] @@ -6786,7 +6798,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.41", + "syn 2.0.48", ] [[package]] @@ -6811,7 +6823,7 @@ version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bbdb58577b6301f8d17ae2561f32002a5bae056d444e0f69e611e504a276204" dependencies = [ - "base64 0.21.5", + "base64 0.21.7", "serde", "serde_json", ] @@ -6829,9 +6841,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.41" +version = "2.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44c8b28c477cc3bf0e7966561e3460130e1255f7a1cf71931075f1c5e7a7e269" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" dependencies = [ "proc-macro2", "quote", @@ -6943,9 +6955,9 @@ dependencies = [ [[package]] name = "target-lexicon" -version = "0.12.12" +version = "0.12.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c39fd04924ca3a864207c66fc2cd7d22d7c016007f9ce846cbb9326331930a" +checksum = "69758bda2e78f098e4ccb393021a0963bb3442eac05f135c30f61b7370bbafae" [[package]] name = "tauri" @@ -7020,7 +7032,7 @@ version = "2.0.0-alpha.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c1f1611ab0896f2693163ba4e8f3e39c02a1b70cdca4314286b5e365a5e08c6" dependencies = [ - "base64 0.21.5", + "base64 0.21.7", "brotli", "ico", "json-patch", @@ -7167,7 +7179,7 @@ dependencies = [ "cfg-if", "fastrand 2.0.1", "redox_syscall 0.4.1", - "rustix 0.38.28", + "rustix 0.38.30", "windows-sys 0.52.0", ] @@ -7184,9 +7196,9 @@ dependencies = [ [[package]] name = "termcolor" -version = "1.4.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff1bc3d3f05aff0403e8ac0d92ced918ec05b666a43f83297ccef5bea8a3d449" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" dependencies = [ "winapi-util", ] @@ -7205,22 +7217,22 @@ checksum = "8eaa81235c7058867fa8c0e7314f33dcce9c215f535d1913822a2b3f5e289f3c" [[package]] name = "thiserror" -version = "1.0.51" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f11c217e1416d6f036b870f14e0413d480dbf28edbee1f877abaf0206af43bb7" +checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.51" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01742297787513b79cf8e29d1056ede1313e2420b7b3b15d0a768b4921f549df" +checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" dependencies = [ "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.48", ] [[package]] @@ -7235,9 +7247,9 @@ dependencies = [ [[package]] name = "tiff" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d172b0f4d3fba17ba89811858b9d3d97f928aece846475bbda076ca46736211" +checksum = "ba1310fcea54c6a9a4fd1aad794ecc02c31682f6bfbecdf460bf19533eed1e3e" dependencies = [ "flate2", "jpeg-decoder", @@ -7246,9 +7258,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5" +checksum = "f657ba42c3f86e7680e53c8cd3af8abbe56b5491790b46e22e19c0d57463583e" dependencies = [ "deranged", "itoa 1.0.10", @@ -7266,9 +7278,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" +checksum = "26197e33420244aeb70c3e8c78376ca46571bc4e701e4791c2cd9f57dcb3a43f" dependencies = [ "time-core", ] @@ -7371,9 +7383,9 @@ checksum = "c7c4ceeeca15c8384bbc3e011dbd8fccb7f068a440b752b7d9b32ceb0ca0e2e8" [[package]] name = "tokio" -version = "1.35.0" +version = "1.35.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "841d45b238a16291a4e1584e61820b8ae57d696cc5015c459c229ccc6990cc1c" +checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104" dependencies = [ "backtrace", "bytes", @@ -7394,7 +7406,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.48", ] [[package]] @@ -7477,17 +7489,6 @@ dependencies = [ "winnow", ] -[[package]] -name = "toml_edit" -version = "0.20.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" -dependencies = [ - "indexmap 2.1.0", - "toml_datetime", - "winnow", -] - [[package]] name = "toml_edit" version = "0.21.0" @@ -7526,7 +7527,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.48", ] [[package]] @@ -7631,9 +7632,9 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.14" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f2528f27a9eb2b21e69c95319b30bd0efd85d09c379741b0f78ea1d86be2416" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] name = "unicode-bidi-mirroring" @@ -7670,9 +7671,9 @@ dependencies = [ [[package]] name = "unicode-properties" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7f91c8b21fbbaa18853c3d0801c78f4fc94cdb976699bb03e832e75f7fd22f0" +checksum = "e4259d9d4425d9f0661581b804cb85fe66a4c631cadd8f490d1c13a35d5d9291" [[package]] name = "unicode-script" @@ -7710,7 +7711,7 @@ version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8cdd25c339e200129fe4de81451814e5228c9b771d57378817d6117cc2b3f97" dependencies = [ - "base64 0.21.5", + "base64 0.21.7", "flate2", "log", "native-tls", @@ -7745,7 +7746,7 @@ version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c51daa774fe9ee5efcf7b4fec13019b8119cda764d9a8b5b06df02bb1445c656" dependencies = [ - "base64 0.21.5", + "base64 0.21.7", "log", "pico-args", "usvg-parser", @@ -7814,11 +7815,11 @@ checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] name = "uuid" -version = "1.6.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e395fcf16a7a3d8127ec99782007af141946b4795001f876d54fb0d55978560" +checksum = "f00cc9702ca12d3c81455259621e676d0f7251cec66a21e98fe2e9a37db93b2a" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.12", "sha1_smol", ] @@ -7892,7 +7893,7 @@ checksum = "6b2b8eecdb8e4284adf5546fc518f048f6dc33e7203dbe36fa93a4add39b31f6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.48", ] [[package]] @@ -7934,9 +7935,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ed0d4f68a3015cc185aff4db9506a015f4b96f95303897bfa23f846db54064e" +checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -7944,24 +7945,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b56f625e64f3a1084ded111c4d5f477df9f8c92df113852fa5a374dbda78826" +checksum = "fcdc935b63408d58a32f8cc9738a0bffd8f05cc7c002086c6ef20b7312ad9dcd" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.48", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.39" +version = "0.4.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac36a15a220124ac510204aec1c3e5db8a22ab06fd6706d881dc6149f8ed9a12" +checksum = "bde2032aeb86bdfaecc8b261eef3cba735cc426c1f3a3416d1e0791be95fc461" dependencies = [ "cfg-if", "js-sys", @@ -7971,9 +7972,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0162dbf37223cd2afce98f3d0785506dcb8d266223983e4b5b525859e6e182b2" +checksum = "3e4c238561b2d428924c49815533a8b9121c664599558a5d9ec51f8a1740a999" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -7981,22 +7982,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" +checksum = "bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.48", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f" +checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" [[package]] name = "wasm-streams" @@ -8047,7 +8048,7 @@ version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ca7d52347346f5473bf2f56705f360e8440873052e575e55890c4fa57843ed3" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "nix 0.26.4", "wayland-backend", "wayland-scanner 0.31.0", @@ -8071,7 +8072,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "625c5029dbd43d25e6aa9615e88b829a5cad13b2819c4ae129fdbb7c31ab4c7e" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "cursor-icon", "wayland-backend", ] @@ -8116,7 +8117,7 @@ version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e253d7107ba913923dc253967f35e8561a3c65f914543e46843c88ddd729e21c" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "wayland-backend", "wayland-client 0.31.1", "wayland-scanner 0.31.0", @@ -8128,7 +8129,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23803551115ff9ea9bce586860c5c5a971e360825a0309264102a9495a5ff479" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "wayland-backend", "wayland-client 0.31.1", "wayland-protocols 0.31.0", @@ -8141,7 +8142,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ad1f61b76b6c2d8742e10f9ba5c3737f6530b4c243132c2a2ccc8aa96fe25cd6" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "wayland-backend", "wayland-client 0.31.1", "wayland-protocols 0.31.0", @@ -8207,9 +8208,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.66" +version = "0.3.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50c24a44ec86bb68fbecd1b3efed7e85ea5621b39b35ef2766b66cd984f8010f" +checksum = "58cd2333b6e0be7a39605f0e255892fd7418a682d8da8fe042fe25128794d2ed" dependencies = [ "js-sys", "wasm-bindgen", @@ -8217,9 +8218,9 @@ dependencies = [ [[package]] name = "web-time" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57099a701fb3a8043f993e8228dc24229c7b942e2b009a1b962e54489ba1d3bf" +checksum = "aa30049b1c872b72c89866d458eae9f20380ab280ffd1b1e18df2d3e2d98cfe0" dependencies = [ "js-sys", "wasm-bindgen", @@ -8332,9 +8333,9 @@ dependencies = [ [[package]] name = "weezl" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9193164d4de03a926d909d3bc7c30543cecb35400c02114792c2cae20d5e2dbb" +checksum = "53a85b86a771b1c87058196170769dd264f66c0782acf1ae6cc51bfd64b39082" [[package]] name = "which" @@ -8345,7 +8346,7 @@ dependencies = [ "either", "home", "once_cell", - "rustix 0.38.28", + "rustix 0.38.30", ] [[package]] @@ -8422,11 +8423,11 @@ dependencies = [ [[package]] name = "windows-core" -version = "0.51.1" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.48.5", + "windows-targets 0.52.0", ] [[package]] @@ -8720,16 +8721,16 @@ dependencies = [ [[package]] name = "winit" -version = "0.29.4" +version = "0.29.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d25d662bb83b511acd839534bb2d88521b0bbc81440969cb077d23c4db9e62c7" +checksum = "4c824f11941eeae66ec71111cc2674373c772f482b58939bb4066b642aa2ffcf" dependencies = [ "ahash", - "android-activity 0.5.0", + "android-activity 0.5.1", "atomic-waker", - "bitflags 2.4.1", + "bitflags 2.4.2", "bytemuck", - "calloop 0.12.3", + "calloop 0.12.4", "cfg_aliases", "core-foundation", "core-graphics 0.23.1", @@ -8738,7 +8739,7 @@ dependencies = [ "js-sys", "libc", "log", - "memmap2 0.9.2", + "memmap2 0.9.3", "ndk 0.8.0", "ndk-sys 0.5.0+25.2.9519653", "objc2 0.4.1", @@ -8748,8 +8749,8 @@ dependencies = [ "raw-window-handle 0.5.2", "raw-window-handle 0.6.0", "redox_syscall 0.3.5", - "rustix 0.38.28", - "sctk-adwaita 0.7.0", + "rustix 0.38.30", + "sctk-adwaita 0.8.1", "smithay-client-toolkit 0.18.0", "smol_str", "unicode-segmentation", @@ -8763,15 +8764,15 @@ dependencies = [ "web-time", "windows-sys 0.48.0", "x11-dl", - "x11rb", + "x11rb 0.13.0", "xkbcommon-dl", ] [[package]] name = "winnow" -version = "0.5.30" +version = "0.5.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b5c3db89721d50d0e2a673f5043fc4722f76dcc352d7b1ab8b8288bed4ed2c5" +checksum = "b7cf47b659b318dccbd69cc4797a39ae128f533dce7902a1096044d1967b9c16" dependencies = [ "memchr", ] @@ -8877,7 +8878,7 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b41aca1115b1f195f21c541c5efb423470848d48143127d0f07f8b90c27440df" dependencies = [ - "x11rb", + "x11rb 0.12.0", ] [[package]] @@ -8898,14 +8899,29 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1641b26d4dec61337c35a1b1aaf9e3cba8f46f0b43636c609ab0291a648040a" dependencies = [ "as-raw-xcb-connection", - "gethostname", + "gethostname 0.3.0", "libc", "libloading 0.7.4", "nix 0.26.4", "once_cell", "winapi", "winapi-wsapoll", - "x11rb-protocol", + "x11rb-protocol 0.12.0", +] + +[[package]] +name = "x11rb" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8f25ead8c7e4cba123243a6367da5d3990e0d3affa708ea19dce96356bd9f1a" +dependencies = [ + "as-raw-xcb-connection", + "gethostname 0.4.3", + "libc", + "libloading 0.8.1", + "once_cell", + "rustix 0.38.30", + "x11rb-protocol 0.13.0", ] [[package]] @@ -8917,15 +8933,21 @@ dependencies = [ "nix 0.26.4", ] +[[package]] +name = "x11rb-protocol" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e63e71c4b8bd9ffec2c963173a4dc4cbde9ee96961d4fcb4429db9929b606c34" + [[package]] name = "xattr" -version = "1.1.3" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7dae5072fe1f8db8f8d29059189ac175196e410e40ba42d5d4684ae2f750995" +checksum = "8da84f1a25939b27f6820d92aed108f83ff920fdf11a7b19366c27c4cda81d4f" dependencies = [ "libc", - "linux-raw-sys 0.4.12", - "rustix 0.38.28", + "linux-raw-sys 0.4.13", + "rustix 0.38.30", ] [[package]] @@ -8961,7 +8983,7 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6924668544c48c0133152e7eec86d644a056ca3d09275eb8d5cdb9855f9d8699" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "dlib", "log", "once_cell", @@ -9060,22 +9082,22 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.7.31" +version = "0.7.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c4061bedbb353041c12f413700357bec76df2c7e2ca8e4df8bac24c6bf68e3d" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.31" +version = "0.7.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3c129550b3e6de3fd0ba67ba5c81818f9805e58b8d7fee80a3a59d2c9fc601a" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.48", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 4a046afe..c022fc01 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,10 @@ [workspace] -members = ["crates/*", "examples/*", "bindings/*/nodejs", "crates/updater/tests/app"] +members = [ + "crates/*", + "examples/*", + "bindings/*/nodejs", + "crates/updater/tests/app", +] exclude = ["examples/deno", "examples/wails", "examples/electron"] resolver = "2" diff --git a/bindings/packager/nodejs/README.md b/bindings/packager/nodejs/README.md index 9a7f6432..66d8c804 100644 --- a/bindings/packager/nodejs/README.md +++ b/bindings/packager/nodejs/README.md @@ -1,7 +1,10 @@ # @crabnebula/packager Executable packager, bundler and updater. A cli tool and library to generate installers or app bundles for your executables. -It also has a compatible updater through [@crabnebula/updater](https://www.npmjs.com/package/@crabnebula/updater). +It also comes with useful addons: + +- an [updater](https://www.npmjs.com/package/@crabnebula/updater) +- a [resource resolver](https://www.npmjs.com/package/@crabnebula/packager-resource-resolver) #### Supported packages: diff --git a/bindings/packager/nodejs/schema.json b/bindings/packager/nodejs/schema.json index aba0f52f..62b8645e 100644 --- a/bindings/packager/nodejs/schema.json +++ b/bindings/packager/nodejs/schema.json @@ -377,7 +377,7 @@ ] }, "PackageFormat": { - "description": "The type of the package we're packaging.", + "description": "Types of supported packages by [`cargo-packager`](https://docs.rs/cargo-packager).", "oneOf": [ { "description": "All available package formats for the current platform.\n\nSee [`PackageFormat::platform_all`]", diff --git a/bindings/packager/nodejs/src-ts/config.d.ts b/bindings/packager/nodejs/src-ts/config.d.ts index 2b32baaa..1fe64a30 100644 --- a/bindings/packager/nodejs/src-ts/config.d.ts +++ b/bindings/packager/nodejs/src-ts/config.d.ts @@ -26,7 +26,7 @@ export type HookCommand = */ export type LogLevel = "error" | "warn" | "info" | "debug" | "trace"; /** - * The type of the package we're packaging. + * Types of supported packages by [`cargo-packager`](https://docs.rs/cargo-packager). */ export type PackageFormat = "all" | "default" | "app" | "dmg" | "wix" | "nsis" | "deb" | "appimage"; /** @@ -412,7 +412,7 @@ export interface DebianConfig { */ section?: string | null; /** - * Change the priority of the Debian Package. By default, it is set to `optional`. Recognized Priorities as of now are : `required`, `important`, `standard`, `optional`, extra + * Change the priority of the Debian Package. By default, it is set to `optional`. Recognized Priorities as of now are : `required`, `important`, `standard`, `optional`, `extra` */ priority?: string | null; /** diff --git a/bindings/resource-resolver/nodejs/.cargo/config.toml b/bindings/resource-resolver/nodejs/.cargo/config.toml new file mode 100644 index 00000000..7ede30ee --- /dev/null +++ b/bindings/resource-resolver/nodejs/.cargo/config.toml @@ -0,0 +1,3 @@ +[target.aarch64-unknown-linux-musl] +linker = "aarch64-linux-musl-gcc" +rustflags = ["-C", "target-feature=-crt-static"] \ No newline at end of file diff --git a/bindings/resource-resolver/nodejs/.npmignore b/bindings/resource-resolver/nodejs/.npmignore new file mode 100644 index 00000000..ec144db2 --- /dev/null +++ b/bindings/resource-resolver/nodejs/.npmignore @@ -0,0 +1,13 @@ +target +Cargo.lock +.cargo +.github +npm +.eslintrc +.prettierignore +rustfmt.toml +yarn.lock +*.node +.yarn +__test__ +renovate.json diff --git a/bindings/resource-resolver/nodejs/Cargo.toml b/bindings/resource-resolver/nodejs/Cargo.toml new file mode 100644 index 00000000..9347b162 --- /dev/null +++ b/bindings/resource-resolver/nodejs/Cargo.toml @@ -0,0 +1,20 @@ +[package] +name = "crabnebula_packager_resource_resolver" +version = "0.0.0" +publish = false +edition = { workspace = true } +license = { workspace = true } +repository = { workspace = true } + +[lib] +crate-type = ["cdylib"] + +[dependencies] +# Default enable napi4 feature, see https://nodejs.org/api/n-api.html#node-api-version-matrix +napi = { workspace = true, features = ["napi4"] } +napi-derive = { workspace = true } +cargo-packager-resource-resolver = { path = "../../../crates/resource-resolver" } +dunce.workspace = true + +[build-dependencies] +napi-build = { workspace = true } diff --git a/bindings/resource-resolver/nodejs/README.md b/bindings/resource-resolver/nodejs/README.md new file mode 100644 index 00000000..c8140ada --- /dev/null +++ b/bindings/resource-resolver/nodejs/README.md @@ -0,0 +1,20 @@ +# @crabnebula/packager-resource-resolver + +Resource resolver for apps that was packaged by [`@crabnebula/packager`](https://www.npmjs.com/package/@crabnebula/packager). + +It resolves the root path which contains resources, which was set using the `resources` field of [cargo packager configuration](https://docs.rs/cargo-packager/latest/cargo_packager/config/struct.Config.html). + +## Get the resource path + +```ts +import { + resourcesDir, + PackageFormat, +} from "@crabnebula/packager-resource-resolver"; + +const dir = resourcesDir(PackageFormat.Nsis); +``` + +## Licenses + +MIT or MIT/Apache 2.0 where applicable. diff --git a/bindings/resource-resolver/nodejs/build.rs b/bindings/resource-resolver/nodejs/build.rs new file mode 100644 index 00000000..9fc23678 --- /dev/null +++ b/bindings/resource-resolver/nodejs/build.rs @@ -0,0 +1,5 @@ +extern crate napi_build; + +fn main() { + napi_build::setup(); +} diff --git a/bindings/resource-resolver/nodejs/fix-types.js b/bindings/resource-resolver/nodejs/fix-types.js new file mode 100644 index 00000000..a1f83aa9 --- /dev/null +++ b/bindings/resource-resolver/nodejs/fix-types.js @@ -0,0 +1,46 @@ +// Due to a NAPI-rs bug? still unconfirmed +// index.d.ts will contain a duplicate definition of `PackageFromat` enum +// and we only need the second definition. +// This script sole purpose is to remove the extra definition. + +const { readFileSync, writeFileSync } = require("fs"); +const { join } = require("path"); + +const typesPath = join(__dirname, "index.d.ts"); +const types = readFileSync(typesPath, "utf8"); + +let out = ""; +let inRemoval = false; +for (const line of types.split("\n")) { + if (inRemoval) { + if (line === "}") inRemoval = false; + continue; + } + + const startOfRemoval = line.startsWith( + "/** Types of supported packages by [`cargo-packager`](https://docs.rs/cargo-packager). */", + ); + if (startOfRemoval) { + inRemoval = true; + continue; + } + + out += line + "\n"; +} + +writeFileSync(typesPath, out); + +const problematicCode = `const { PackageFormat, PackageFormat, resourcesDir } = nativeBinding + +module.exports.PackageFormat = PackageFormat +module.exports.PackageFormat = PackageFormat +module.exports.resourcesDir = resourcesDir`; +const correctCode = `const { PackageFormat, resourcesDir } = nativeBinding + +module.exports.PackageFormat = PackageFormat +module.exports.resourcesDir = resourcesDir`; + +const indexPath = join(__dirname, "index.js"); +const indexContent = readFileSync(indexPath, "utf8"); + +writeFileSync(indexPath, indexContent.replace(problematicCode, correctCode)); diff --git a/bindings/resource-resolver/nodejs/index.d.ts b/bindings/resource-resolver/nodejs/index.d.ts new file mode 100644 index 00000000..4a7aaac4 --- /dev/null +++ b/bindings/resource-resolver/nodejs/index.d.ts @@ -0,0 +1,22 @@ +/* tslint:disable */ +/* eslint-disable */ + +/* auto-generated by NAPI-RS */ + +/** Types of supported packages by [`@crabnebula/packager`](https://www.npmjs.com/package/@crabnebula/packager) */ +export const enum PackageFormat { + /** The macOS application bundle (.app). */ + App = "App", + /** The macOS DMG package (.dmg). */ + Dmg = "Dmg", + /** The Microsoft Software Installer (.msi) through WiX Toolset. */ + Wix = "Wix", + /** The NSIS installer (.exe). */ + Nsis = "Nsis", + /** The Linux Debian package (.deb). */ + Deb = "Deb", + /** The Linux AppImage package (.AppImage). */ + AppImage = "AppImage", +} +/** Retrieve the resource path of your app, packaged with cargo packager. */ +export function resourcesDir(packageFormat: PackageFormat): string; diff --git a/bindings/resource-resolver/nodejs/index.js b/bindings/resource-resolver/nodejs/index.js new file mode 100644 index 00000000..db83a154 --- /dev/null +++ b/bindings/resource-resolver/nodejs/index.js @@ -0,0 +1,274 @@ +/* tslint:disable */ +/* eslint-disable */ +/* prettier-ignore */ + +/* auto-generated by NAPI-RS */ + +const { existsSync, readFileSync } = require('fs') +const { join } = require("path"); + +const { platform, arch } = process; + +let nativeBinding = null; +let localFileExisted = false; +let loadError = null; + +function isMusl() { + // For Node 10 + if (!process.report || typeof process.report.getReport !== "function") { + try { + const lddPath = require("child_process") + .execSync("which ldd") + .toString() + .trim(); + return readFileSync(lddPath, "utf8").includes("musl"); + } catch (e) { + return true; + } + } else { + const { glibcVersionRuntime } = process.report.getReport().header; + return !glibcVersionRuntime; + } +} + +switch (platform) { + case "android": + switch (arch) { + case "arm64": + localFileExisted = existsSync( + join(__dirname, "packager-resource-resolver.android-arm64.node"), + ); + try { + if (localFileExisted) { + nativeBinding = require("./packager-resource-resolver.android-arm64.node"); + } else { + nativeBinding = require("@crabnebula/packager-resource-resolver-android-arm64"); + } + } catch (e) { + loadError = e; + } + break; + case "arm": + localFileExisted = existsSync( + join(__dirname, "packager-resource-resolver.android-arm-eabi.node"), + ); + try { + if (localFileExisted) { + nativeBinding = require("./packager-resource-resolver.android-arm-eabi.node"); + } else { + nativeBinding = require("@crabnebula/packager-resource-resolver-android-arm-eabi"); + } + } catch (e) { + loadError = e; + } + break; + default: + throw new Error(`Unsupported architecture on Android ${arch}`); + } + break; + case "win32": + switch (arch) { + case "x64": + localFileExisted = existsSync( + join(__dirname, "packager-resource-resolver.win32-x64-msvc.node"), + ); + try { + if (localFileExisted) { + nativeBinding = require("./packager-resource-resolver.win32-x64-msvc.node"); + } else { + nativeBinding = require("@crabnebula/packager-resource-resolver-win32-x64-msvc"); + } + } catch (e) { + loadError = e; + } + break; + case "ia32": + localFileExisted = existsSync( + join(__dirname, "packager-resource-resolver.win32-ia32-msvc.node"), + ); + try { + if (localFileExisted) { + nativeBinding = require("./packager-resource-resolver.win32-ia32-msvc.node"); + } else { + nativeBinding = require("@crabnebula/packager-resource-resolver-win32-ia32-msvc"); + } + } catch (e) { + loadError = e; + } + break; + case "arm64": + localFileExisted = existsSync( + join(__dirname, "packager-resource-resolver.win32-arm64-msvc.node"), + ); + try { + if (localFileExisted) { + nativeBinding = require("./packager-resource-resolver.win32-arm64-msvc.node"); + } else { + nativeBinding = require("@crabnebula/packager-resource-resolver-win32-arm64-msvc"); + } + } catch (e) { + loadError = e; + } + break; + default: + throw new Error(`Unsupported architecture on Windows: ${arch}`); + } + break; + case "darwin": + localFileExisted = existsSync( + join(__dirname, "packager-resource-resolver.darwin-universal.node"), + ); + try { + if (localFileExisted) { + nativeBinding = require("./packager-resource-resolver.darwin-universal.node"); + } else { + nativeBinding = require("@crabnebula/packager-resource-resolver-darwin-universal"); + } + break; + } catch {} + switch (arch) { + case "x64": + localFileExisted = existsSync( + join(__dirname, "packager-resource-resolver.darwin-x64.node"), + ); + try { + if (localFileExisted) { + nativeBinding = require("./packager-resource-resolver.darwin-x64.node"); + } else { + nativeBinding = require("@crabnebula/packager-resource-resolver-darwin-x64"); + } + } catch (e) { + loadError = e; + } + break; + case "arm64": + localFileExisted = existsSync( + join(__dirname, "packager-resource-resolver.darwin-arm64.node"), + ); + try { + if (localFileExisted) { + nativeBinding = require("./packager-resource-resolver.darwin-arm64.node"); + } else { + nativeBinding = require("@crabnebula/packager-resource-resolver-darwin-arm64"); + } + } catch (e) { + loadError = e; + } + break; + default: + throw new Error(`Unsupported architecture on macOS: ${arch}`); + } + break; + case "freebsd": + if (arch !== "x64") { + throw new Error(`Unsupported architecture on FreeBSD: ${arch}`); + } + localFileExisted = existsSync( + join(__dirname, "packager-resource-resolver.freebsd-x64.node"), + ); + try { + if (localFileExisted) { + nativeBinding = require("./packager-resource-resolver.freebsd-x64.node"); + } else { + nativeBinding = require("@crabnebula/packager-resource-resolver-freebsd-x64"); + } + } catch (e) { + loadError = e; + } + break; + case "linux": + switch (arch) { + case "x64": + if (isMusl()) { + localFileExisted = existsSync( + join(__dirname, "packager-resource-resolver.linux-x64-musl.node"), + ); + try { + if (localFileExisted) { + nativeBinding = require("./packager-resource-resolver.linux-x64-musl.node"); + } else { + nativeBinding = require("@crabnebula/packager-resource-resolver-linux-x64-musl"); + } + } catch (e) { + loadError = e; + } + } else { + localFileExisted = existsSync( + join(__dirname, "packager-resource-resolver.linux-x64-gnu.node"), + ); + try { + if (localFileExisted) { + nativeBinding = require("./packager-resource-resolver.linux-x64-gnu.node"); + } else { + nativeBinding = require("@crabnebula/packager-resource-resolver-linux-x64-gnu"); + } + } catch (e) { + loadError = e; + } + } + break; + case "arm64": + if (isMusl()) { + localFileExisted = existsSync( + join(__dirname, "packager-resource-resolver.linux-arm64-musl.node"), + ); + try { + if (localFileExisted) { + nativeBinding = require("./packager-resource-resolver.linux-arm64-musl.node"); + } else { + nativeBinding = require("@crabnebula/packager-resource-resolver-linux-arm64-musl"); + } + } catch (e) { + loadError = e; + } + } else { + localFileExisted = existsSync( + join(__dirname, "packager-resource-resolver.linux-arm64-gnu.node"), + ); + try { + if (localFileExisted) { + nativeBinding = require("./packager-resource-resolver.linux-arm64-gnu.node"); + } else { + nativeBinding = require("@crabnebula/packager-resource-resolver-linux-arm64-gnu"); + } + } catch (e) { + loadError = e; + } + } + break; + case "arm": + localFileExisted = existsSync( + join( + __dirname, + "packager-resource-resolver.linux-arm-gnueabihf.node", + ), + ); + try { + if (localFileExisted) { + nativeBinding = require("./packager-resource-resolver.linux-arm-gnueabihf.node"); + } else { + nativeBinding = require("@crabnebula/packager-resource-resolver-linux-arm-gnueabihf"); + } + } catch (e) { + loadError = e; + } + break; + default: + throw new Error(`Unsupported architecture on Linux: ${arch}`); + } + break; + default: + throw new Error(`Unsupported OS: ${platform}, architecture: ${arch}`); +} + +if (!nativeBinding) { + if (loadError) { + throw loadError; + } + throw new Error(`Failed to load native binding`); +} + +const { PackageFormat, resourcesDir } = nativeBinding; + +module.exports.PackageFormat = PackageFormat; +module.exports.resourcesDir = resourcesDir; diff --git a/bindings/resource-resolver/nodejs/npm/darwin-arm64/README.md b/bindings/resource-resolver/nodejs/npm/darwin-arm64/README.md new file mode 100644 index 00000000..e7ba084d --- /dev/null +++ b/bindings/resource-resolver/nodejs/npm/darwin-arm64/README.md @@ -0,0 +1,3 @@ +# `@crabnebula/packager-resource-resolver-darwin-arm64` + +This is the **aarch64-apple-darwin** binary for `@crabnebula/packager-resource-resolver` diff --git a/bindings/resource-resolver/nodejs/npm/darwin-arm64/package.json b/bindings/resource-resolver/nodejs/npm/darwin-arm64/package.json new file mode 100644 index 00000000..888296f7 --- /dev/null +++ b/bindings/resource-resolver/nodejs/npm/darwin-arm64/package.json @@ -0,0 +1,18 @@ +{ + "name": "@crabnebula/packager-resource-resolver-darwin-arm64", + "version": "0.0.0", + "os": [ + "darwin" + ], + "cpu": [ + "arm64" + ], + "main": "packager-resource-resolver.darwin-arm64.node", + "files": [ + "packager-resource-resolver.darwin-arm64.node" + ], + "license": "MIT", + "engines": { + "node": ">= 10" + } +} diff --git a/bindings/resource-resolver/nodejs/npm/darwin-x64/README.md b/bindings/resource-resolver/nodejs/npm/darwin-x64/README.md new file mode 100644 index 00000000..83c6a62a --- /dev/null +++ b/bindings/resource-resolver/nodejs/npm/darwin-x64/README.md @@ -0,0 +1,3 @@ +# `@crabnebula/packager-resource-resolver-darwin-x64` + +This is the **x86_64-apple-darwin** binary for `@crabnebula/packager-resource-resolver` diff --git a/bindings/resource-resolver/nodejs/npm/darwin-x64/package.json b/bindings/resource-resolver/nodejs/npm/darwin-x64/package.json new file mode 100644 index 00000000..51e921d5 --- /dev/null +++ b/bindings/resource-resolver/nodejs/npm/darwin-x64/package.json @@ -0,0 +1,18 @@ +{ + "name": "@crabnebula/packager-resource-resolver-darwin-x64", + "version": "0.0.0", + "os": [ + "darwin" + ], + "cpu": [ + "x64" + ], + "main": "packager-resource-resolver.darwin-x64.node", + "files": [ + "packager-resource-resolver.darwin-x64.node" + ], + "license": "MIT", + "engines": { + "node": ">= 10" + } +} diff --git a/bindings/resource-resolver/nodejs/npm/linux-arm-gnueabihf/README.md b/bindings/resource-resolver/nodejs/npm/linux-arm-gnueabihf/README.md new file mode 100644 index 00000000..1f2a273f --- /dev/null +++ b/bindings/resource-resolver/nodejs/npm/linux-arm-gnueabihf/README.md @@ -0,0 +1,3 @@ +# `@crabnebula/packager-resource-resolver-linux-arm-gnueabihf` + +This is the **armv7-unknown-linux-gnueabihf** binary for `@crabnebula/packager-resource-resolver` diff --git a/bindings/resource-resolver/nodejs/npm/linux-arm-gnueabihf/package.json b/bindings/resource-resolver/nodejs/npm/linux-arm-gnueabihf/package.json new file mode 100644 index 00000000..c416db09 --- /dev/null +++ b/bindings/resource-resolver/nodejs/npm/linux-arm-gnueabihf/package.json @@ -0,0 +1,18 @@ +{ + "name": "@crabnebula/packager-resource-resolver-linux-arm-gnueabihf", + "version": "0.0.0", + "os": [ + "linux" + ], + "cpu": [ + "arm" + ], + "main": "packager-resource-resolver.linux-arm-gnueabihf.node", + "files": [ + "packager-resource-resolver.linux-arm-gnueabihf.node" + ], + "license": "MIT", + "engines": { + "node": ">= 10" + } +} diff --git a/bindings/resource-resolver/nodejs/npm/linux-arm64-gnu/README.md b/bindings/resource-resolver/nodejs/npm/linux-arm64-gnu/README.md new file mode 100644 index 00000000..510314c9 --- /dev/null +++ b/bindings/resource-resolver/nodejs/npm/linux-arm64-gnu/README.md @@ -0,0 +1,3 @@ +# `@crabnebula/packager-resource-resolver-linux-arm64-gnu` + +This is the **aarch64-unknown-linux-gnu** binary for `@crabnebula/packager-resource-resolver` diff --git a/bindings/resource-resolver/nodejs/npm/linux-arm64-gnu/package.json b/bindings/resource-resolver/nodejs/npm/linux-arm64-gnu/package.json new file mode 100644 index 00000000..16b19d8c --- /dev/null +++ b/bindings/resource-resolver/nodejs/npm/linux-arm64-gnu/package.json @@ -0,0 +1,21 @@ +{ + "name": "@crabnebula/packager-resource-resolver-linux-arm64-gnu", + "version": "0.0.0", + "os": [ + "linux" + ], + "cpu": [ + "arm64" + ], + "main": "packager-resource-resolver.linux-arm64-gnu.node", + "files": [ + "packager-resource-resolver.linux-arm64-gnu.node" + ], + "license": "MIT", + "engines": { + "node": ">= 10" + }, + "libc": [ + "glibc" + ] +} diff --git a/bindings/resource-resolver/nodejs/npm/linux-arm64-musl/README.md b/bindings/resource-resolver/nodejs/npm/linux-arm64-musl/README.md new file mode 100644 index 00000000..f4e9d91d --- /dev/null +++ b/bindings/resource-resolver/nodejs/npm/linux-arm64-musl/README.md @@ -0,0 +1,3 @@ +# `@crabnebula/packager-resource-resolver-linux-arm64-musl` + +This is the **aarch64-unknown-linux-musl** binary for `@crabnebula/packager-resource-resolver` diff --git a/bindings/resource-resolver/nodejs/npm/linux-arm64-musl/package.json b/bindings/resource-resolver/nodejs/npm/linux-arm64-musl/package.json new file mode 100644 index 00000000..ed5363dc --- /dev/null +++ b/bindings/resource-resolver/nodejs/npm/linux-arm64-musl/package.json @@ -0,0 +1,21 @@ +{ + "name": "@crabnebula/packager-resource-resolver-linux-arm64-musl", + "version": "0.0.0", + "os": [ + "linux" + ], + "cpu": [ + "arm64" + ], + "main": "packager-resource-resolver.linux-arm64-musl.node", + "files": [ + "packager-resource-resolver.linux-arm64-musl.node" + ], + "license": "MIT", + "engines": { + "node": ">= 10" + }, + "libc": [ + "musl" + ] +} diff --git a/bindings/resource-resolver/nodejs/npm/linux-x64-gnu/README.md b/bindings/resource-resolver/nodejs/npm/linux-x64-gnu/README.md new file mode 100644 index 00000000..429c4e9c --- /dev/null +++ b/bindings/resource-resolver/nodejs/npm/linux-x64-gnu/README.md @@ -0,0 +1,3 @@ +# `@crabnebula/packager-resource-resolver-linux-x64-gnu` + +This is the **x86_64-unknown-linux-gnu** binary for `@crabnebula/packager-resource-resolver` diff --git a/bindings/resource-resolver/nodejs/npm/linux-x64-gnu/package.json b/bindings/resource-resolver/nodejs/npm/linux-x64-gnu/package.json new file mode 100644 index 00000000..138743b8 --- /dev/null +++ b/bindings/resource-resolver/nodejs/npm/linux-x64-gnu/package.json @@ -0,0 +1,21 @@ +{ + "name": "@crabnebula/packager-resource-resolver-linux-x64-gnu", + "version": "0.0.0", + "os": [ + "linux" + ], + "cpu": [ + "x64" + ], + "main": "packager-resource-resolver.linux-x64-gnu.node", + "files": [ + "packager-resource-resolver.linux-x64-gnu.node" + ], + "license": "MIT", + "engines": { + "node": ">= 10" + }, + "libc": [ + "glibc" + ] +} diff --git a/bindings/resource-resolver/nodejs/npm/linux-x64-musl/README.md b/bindings/resource-resolver/nodejs/npm/linux-x64-musl/README.md new file mode 100644 index 00000000..0831c093 --- /dev/null +++ b/bindings/resource-resolver/nodejs/npm/linux-x64-musl/README.md @@ -0,0 +1,3 @@ +# `@crabnebula/packager-resource-resolver-linux-x64-musl` + +This is the **x86_64-unknown-linux-musl** binary for `@crabnebula/packager-resource-resolver` diff --git a/bindings/resource-resolver/nodejs/npm/linux-x64-musl/package.json b/bindings/resource-resolver/nodejs/npm/linux-x64-musl/package.json new file mode 100644 index 00000000..95b0364f --- /dev/null +++ b/bindings/resource-resolver/nodejs/npm/linux-x64-musl/package.json @@ -0,0 +1,21 @@ +{ + "name": "@crabnebula/packager-resource-resolver-linux-x64-musl", + "version": "0.0.0", + "os": [ + "linux" + ], + "cpu": [ + "x64" + ], + "main": "packager-resource-resolver.linux-x64-musl.node", + "files": [ + "packager-resource-resolver.linux-x64-musl.node" + ], + "license": "MIT", + "engines": { + "node": ">= 10" + }, + "libc": [ + "musl" + ] +} diff --git a/bindings/resource-resolver/nodejs/npm/win32-arm64-msvc/README.md b/bindings/resource-resolver/nodejs/npm/win32-arm64-msvc/README.md new file mode 100644 index 00000000..9abb4fe5 --- /dev/null +++ b/bindings/resource-resolver/nodejs/npm/win32-arm64-msvc/README.md @@ -0,0 +1,3 @@ +# `@crabnebula/packager-resource-resolver-win32-arm64-msvc` + +This is the **aarch64-pc-windows-msvc** binary for `@crabnebula/packager-resource-resolver` diff --git a/bindings/resource-resolver/nodejs/npm/win32-arm64-msvc/package.json b/bindings/resource-resolver/nodejs/npm/win32-arm64-msvc/package.json new file mode 100644 index 00000000..0c6c273c --- /dev/null +++ b/bindings/resource-resolver/nodejs/npm/win32-arm64-msvc/package.json @@ -0,0 +1,18 @@ +{ + "name": "@crabnebula/packager-resource-resolver-win32-arm64-msvc", + "version": "0.0.0", + "os": [ + "win32" + ], + "cpu": [ + "arm64" + ], + "main": "packager-resource-resolver.win32-arm64-msvc.node", + "files": [ + "packager-resource-resolver.win32-arm64-msvc.node" + ], + "license": "MIT", + "engines": { + "node": ">= 10" + } +} diff --git a/bindings/resource-resolver/nodejs/npm/win32-ia32-msvc/README.md b/bindings/resource-resolver/nodejs/npm/win32-ia32-msvc/README.md new file mode 100644 index 00000000..f9d260fe --- /dev/null +++ b/bindings/resource-resolver/nodejs/npm/win32-ia32-msvc/README.md @@ -0,0 +1,3 @@ +# `@crabnebula/packager-resource-resolver-win32-ia32-msvc` + +This is the **i686-pc-windows-msvc** binary for `@crabnebula/packager-resource-resolver` diff --git a/bindings/resource-resolver/nodejs/npm/win32-ia32-msvc/package.json b/bindings/resource-resolver/nodejs/npm/win32-ia32-msvc/package.json new file mode 100644 index 00000000..2802622a --- /dev/null +++ b/bindings/resource-resolver/nodejs/npm/win32-ia32-msvc/package.json @@ -0,0 +1,18 @@ +{ + "name": "@crabnebula/packager-resource-resolver-win32-ia32-msvc", + "version": "0.0.0", + "os": [ + "win32" + ], + "cpu": [ + "ia32" + ], + "main": "packager-resource-resolver.win32-ia32-msvc.node", + "files": [ + "packager-resource-resolver.win32-ia32-msvc.node" + ], + "license": "MIT", + "engines": { + "node": ">= 10" + } +} diff --git a/bindings/resource-resolver/nodejs/npm/win32-x64-msvc/README.md b/bindings/resource-resolver/nodejs/npm/win32-x64-msvc/README.md new file mode 100644 index 00000000..6eff0d49 --- /dev/null +++ b/bindings/resource-resolver/nodejs/npm/win32-x64-msvc/README.md @@ -0,0 +1,3 @@ +# `@crabnebula/packager-resource-resolver-win32-x64-msvc` + +This is the **x86_64-pc-windows-msvc** binary for `@crabnebula/packager-resource-resolver` diff --git a/bindings/resource-resolver/nodejs/npm/win32-x64-msvc/package.json b/bindings/resource-resolver/nodejs/npm/win32-x64-msvc/package.json new file mode 100644 index 00000000..2c7a7471 --- /dev/null +++ b/bindings/resource-resolver/nodejs/npm/win32-x64-msvc/package.json @@ -0,0 +1,18 @@ +{ + "name": "@crabnebula/packager-resource-resolver-win32-x64-msvc", + "version": "0.0.0", + "os": [ + "win32" + ], + "cpu": [ + "x64" + ], + "main": "packager-resource-resolver.win32-x64-msvc.node", + "files": [ + "packager-resource-resolver.win32-x64-msvc.node" + ], + "license": "MIT", + "engines": { + "node": ">= 10" + } +} diff --git a/bindings/resource-resolver/nodejs/package.json b/bindings/resource-resolver/nodejs/package.json new file mode 100644 index 00000000..76628ed1 --- /dev/null +++ b/bindings/resource-resolver/nodejs/package.json @@ -0,0 +1,37 @@ +{ + "name": "@crabnebula/packager-resource-resolver", + "version": "0.0.0", + "main": "./index.js", + "types": "./index.d.ts", + "napi": { + "name": "packager-resource-resolver", + "triples": { + "additional": [ + "aarch64-apple-darwin", + "aarch64-unknown-linux-gnu", + "aarch64-unknown-linux-musl", + "aarch64-pc-windows-msvc", + "armv7-unknown-linux-gnueabihf", + "x86_64-unknown-linux-musl", + "i686-pc-windows-msvc" + ] + } + }, + "license": "MIT", + "scripts": { + "artifacts": "napi artifacts", + "build": "napi build --platform --profile release-size-optimized", + "postbuild": "node ./fix-types.js", + "build:debug": "napi build --platform", + "prepublishOnly": "napi prepublish -t npm --gh-release-id $RELEASE_ID", + "universal": "napi universal", + "version": "napi version" + }, + "devDependencies": { + "@napi-rs/cli": "^2.16.5", + "@types/node": "^20.8.10" + }, + "engines": { + "node": ">= 10" + } +} diff --git a/bindings/resource-resolver/nodejs/src/lib.rs b/bindings/resource-resolver/nodejs/src/lib.rs new file mode 100644 index 00000000..d8430cc4 --- /dev/null +++ b/bindings/resource-resolver/nodejs/src/lib.rs @@ -0,0 +1,42 @@ +use napi::{Result, Status}; + +use cargo_packager_resource_resolver::PackageFormat as ResolverPackageFormat; + +/// Types of supported packages by [`@crabnebula/packager`](https://www.npmjs.com/package/@crabnebula/packager) +#[derive(Debug, Eq, PartialEq)] +#[napi_derive::napi(string_enum)] +pub enum PackageFormat { + /// The macOS application bundle (.app). + App, + /// The macOS DMG package (.dmg). + Dmg, + /// The Microsoft Software Installer (.msi) through WiX Toolset. + Wix, + /// The NSIS installer (.exe). + Nsis, + /// The Linux Debian package (.deb). + Deb, + /// The Linux AppImage package (.AppImage). + AppImage, +} + +impl From for ResolverPackageFormat { + fn from(value: PackageFormat) -> Self { + match value { + PackageFormat::App => ResolverPackageFormat::App, + PackageFormat::Dmg => ResolverPackageFormat::Dmg, + PackageFormat::Wix => ResolverPackageFormat::Wix, + PackageFormat::Nsis => ResolverPackageFormat::Nsis, + PackageFormat::Deb => ResolverPackageFormat::Deb, + PackageFormat::AppImage => ResolverPackageFormat::AppImage, + } + } +} + +/// Retrieve the resource path of your app, packaged with cargo packager. +#[napi_derive::napi] +pub fn resources_dir(package_format: PackageFormat) -> Result { + cargo_packager_resource_resolver::resources_dir(package_format.into()) + .map_err(|e| napi::Error::new(Status::GenericFailure, e.to_string())) + .map(|p| dunce::simplified(&p).to_string_lossy().to_string()) +} diff --git a/crates/packager/Cargo.toml b/crates/packager/Cargo.toml index 6eaed0f3..6334ca88 100644 --- a/crates/packager/Cargo.toml +++ b/crates/packager/Cargo.toml @@ -31,7 +31,8 @@ targets = [ [features] default = [ "cli", "rustls-tls" ] cli = [ "clap", "dep:tracing-subscriber" ] -schema = [ "schemars" ] +schema = [ "schemars", "cargo-packager-utils/schema" ] +clap = ["dep:clap", "cargo-packager-utils/clap" ] native-tls = [ "ureq/native-tls" ] native-tls-vendored = [ "native-tls", "native-tls/vendored" ] rustls-tls = [ "ureq/tls" ] @@ -65,6 +66,7 @@ libflate = "2.0" strsim = "0.10" schemars = { workspace = true, optional = true } native-tls = { version = "0.2", optional = true } +cargo-packager-utils = { path = "../utils" , features = ["serde"] } [target."cfg(target_os = \"windows\")".dependencies] winreg = "0.52" diff --git a/crates/packager/README.md b/crates/packager/README.md index 353fd34c..e83154a9 100644 --- a/crates/packager/README.md +++ b/crates/packager/README.md @@ -3,7 +3,10 @@ cargo-packager splash Executable packager, bundler and updater. A cli tool and library to generate installers or app bundles for your executables. -It also has a compatible updater through [cargo-packager-updater](https://docs.rs/cargo-packager-updater). +It also comes with useful addons: + +- an [updater](https://docs.rs/cargo-packager-updater) +- a [resource resolver](https://docs.rs/cargo-packager-resource-resolver) #### Supported packages: diff --git a/crates/packager/schema.json b/crates/packager/schema.json index 15e6c7c0..62b8645e 100644 --- a/crates/packager/schema.json +++ b/crates/packager/schema.json @@ -377,7 +377,7 @@ ] }, "PackageFormat": { - "description": "The type of the package we're packaging.", + "description": "Types of supported packages by [`cargo-packager`](https://docs.rs/cargo-packager).", "oneOf": [ { "description": "All available package formats for the current platform.\n\nSee [`PackageFormat::platform_all`]", @@ -1220,4 +1220,4 @@ "additionalProperties": false } } -} +} \ No newline at end of file diff --git a/crates/packager/src/config/mod.rs b/crates/packager/src/config/mod.rs index ecb93c11..52d08e59 100644 --- a/crates/packager/src/config/mod.rs +++ b/crates/packager/src/config/mod.rs @@ -21,157 +21,7 @@ mod category; pub use builder::*; pub use category::AppCategory; -/// The type of the package we're packaging. -#[derive(Clone, Copy, Debug, Eq, PartialEq, Deserialize, Serialize)] -#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] -#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] -#[cfg_attr(feature = "clap", value(rename_all = "lowercase"))] -#[serde(rename_all = "lowercase")] -#[non_exhaustive] -pub enum PackageFormat { - /// All available package formats for the current platform. - /// - /// See [`PackageFormat::platform_all`] - All, - /// The default list of package formats for the current platform. - /// - /// See [`PackageFormat::platform_default`] - Default, - /// The macOS application bundle (.app). - App, - /// The macOS DMG package (.dmg). - Dmg, - /// The Microsoft Software Installer (.msi) through WiX Toolset. - Wix, - /// The NSIS installer (.exe). - Nsis, - /// The Linux Debian package (.deb). - Deb, - /// The Linux AppImage package (.AppImage). - AppImage, -} - -impl Display for PackageFormat { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{}", self.short_name()) - } -} - -impl PackageFormat { - /// Maps a short name to a [PackageFormat]. - /// Possible values are "deb", "ios", "wix", "app", "rpm", "appimage", "dmg". - pub fn from_short_name(name: &str) -> Option { - // Other types we may eventually want to support: apk. - match name { - "app" => Some(PackageFormat::App), - "dmg" => Some(PackageFormat::Dmg), - "wix" => Some(PackageFormat::Wix), - "nsis" => Some(PackageFormat::Nsis), - "deb" => Some(PackageFormat::Deb), - "appimage" => Some(PackageFormat::AppImage), - _ => None, - } - } - - /// Gets the short name of this [PackageFormat]. - pub fn short_name(&self) -> &'static str { - match *self { - PackageFormat::All => "all", - PackageFormat::Default => "default", - PackageFormat::App => "app", - PackageFormat::Dmg => "dmg", - PackageFormat::Wix => "wix", - PackageFormat::Nsis => "nsis", - PackageFormat::Deb => "deb", - PackageFormat::AppImage => "appimage", - } - } - - /// Gets the list of the possible package types on the current OS. - /// - /// - **macOS**: App, Dmg - /// - **Windows**: Nsis, Wix - /// - **Linux**: Deb, AppImage - pub fn platform_all() -> &'static [PackageFormat] { - &[ - #[cfg(target_os = "macos")] - PackageFormat::App, - #[cfg(target_os = "macos")] - PackageFormat::Dmg, - #[cfg(target_os = "windows")] - PackageFormat::Wix, - #[cfg(target_os = "windows")] - PackageFormat::Nsis, - #[cfg(any( - target_os = "linux", - target_os = "dragonfly", - target_os = "freebsd", - target_os = "netbsd", - target_os = "openbsd" - ))] - PackageFormat::Deb, - #[cfg(any( - target_os = "linux", - target_os = "dragonfly", - target_os = "freebsd", - target_os = "netbsd", - target_os = "openbsd" - ))] - PackageFormat::AppImage, - ] - } - - /// Returns the default list of targets this platform - /// - /// - **macOS**: App, Dmg - /// - **Windows**: Nsis - /// - **Linux**: Deb, AppImage - pub fn platform_default() -> &'static [PackageFormat] { - &[ - #[cfg(target_os = "macos")] - PackageFormat::App, - #[cfg(target_os = "macos")] - PackageFormat::Dmg, - #[cfg(target_os = "windows")] - PackageFormat::Nsis, - #[cfg(any( - target_os = "linux", - target_os = "dragonfly", - target_os = "freebsd", - target_os = "netbsd", - target_os = "openbsd" - ))] - PackageFormat::Deb, - #[cfg(any( - target_os = "linux", - target_os = "dragonfly", - target_os = "freebsd", - target_os = "netbsd", - target_os = "openbsd" - ))] - PackageFormat::AppImage, - ] - } - - /// Gets a number representing priority which used to sort package types - /// in an order that guarantees that if a certain package type - /// depends on another (like Dmg depending on MacOsBundle), the dependency - /// will be built first - /// - /// The lower the number, the higher the priority - pub fn priority(&self) -> u32 { - match self { - PackageFormat::All => 0, - PackageFormat::Default => 0, - PackageFormat::App => 0, - PackageFormat::Wix => 0, - PackageFormat::Nsis => 0, - PackageFormat::Deb => 0, - PackageFormat::AppImage => 0, - PackageFormat::Dmg => 1, - } - } -} +pub use cargo_packager_utils::PackageFormat; /// **macOS-only**. Corresponds to CFBundleTypeRole #[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)] diff --git a/crates/packager/src/lib.rs b/crates/packager/src/lib.rs index cd96f900..14533413 100644 --- a/crates/packager/src/lib.rs +++ b/crates/packager/src/lib.rs @@ -5,7 +5,9 @@ //! [![cargo-packager splash](https://github.com/crabnebula-dev/cargo-packager/raw/main/.github/splash.png)](https://github.com/crabnebula-dev/cargo-packager) //! //! Executable packager, bundler and updater. A cli tool and library to generate installers or app bundles for your executables. -//! It also has a compatible updater through [cargo-packager-updater](https://docs.rs/cargo-packager-updater). +//! It also comes with useful addons: +//! - an [updater](https://docs.rs/cargo-packager-updater) +//! - a [resource resolver](https://docs.rs/cargo-packager-resource-resolver) //! //! ### Supported packages //! diff --git a/crates/resource-resolver/Cargo.toml b/crates/resource-resolver/Cargo.toml new file mode 100644 index 00000000..5494938b --- /dev/null +++ b/crates/resource-resolver/Cargo.toml @@ -0,0 +1,21 @@ +[package] +name = "cargo-packager-resource-resolver" +description = "Cargo packager resource resolver" +version = "0.0.0" +authors = { workspace = true } +edition = { workspace = true } +license = { workspace = true } +repository = { workspace = true } + +[package.metadata.docs.rs] +features = ["auto-detect-format"] + +[dependencies] +thiserror = { workspace = true } +cargo-packager-utils = { path = "../utils", default-features = false } +log = "0.4.20" +heck = "0.4.1" + +[features] +process-relaunch-dangerous-allow-symlink-macos = [] +auto-detect-format = [] diff --git a/crates/resource-resolver/README.md b/crates/resource-resolver/README.md new file mode 100644 index 00000000..0a364b3f --- /dev/null +++ b/crates/resource-resolver/README.md @@ -0,0 +1,30 @@ +# cargo-packager-resource-resolver + +Resource resolver for apps that was packaged by [`cargo-packager`](https://docs.rs/cargo-packager). + +It resolves the root path which contains resources, which was set using the `resources` field of [cargo packager configuration](https://docs.rs/cargo-packager/latest/cargo_packager/config/struct.Config.html). + +## Get the resource path + +```rs +use cargo_packager_resource_resolver::{resources_dir, PackageFormat}; + +let resource_path = resources_dir(PackageFormat::Nsis).unwrap(); +``` + +## Automatically detect formats + +:warning: This feature is only available for Rust apps that were built with cargo packager. + +1. Make sure to use the `before_each_package_command` field of [cargo packager configuration](https://docs.rs/cargo-packager/latest/cargo_packager/config/struct.Config.html) to build your app (this will not work with the `before_packaging_command` field). +2. Activete the feature `auto-detect-format` for this crate in your Cargo.toml. + +```rs +use cargo_packager_resource_resolver::{resources_dir, current_format}; + +let resource_path = resources_dir(current_format().unwrap()).unwrap(); +``` + +## Licenses + +MIT or MIT/Apache 2.0 where applicable. diff --git a/crates/resource-resolver/build.rs b/crates/resource-resolver/build.rs new file mode 100644 index 00000000..1352994f --- /dev/null +++ b/crates/resource-resolver/build.rs @@ -0,0 +1,10 @@ +use std::env; + +fn main() { + if env::var("CARGO_FEATURE_AUTO_DETECT_FORMAT").is_ok() { + println!("cargo:rerun-if-env-changed=CARGO_PACKAGER_FORMAT"); + if let Ok(var) = env::var("CARGO_PACKAGER_FORMAT") { + println!("cargo:rustc-cfg=CARGO_PACKAGER_FORMAT=\"{}\"", var); + } + } +} diff --git a/crates/resource-resolver/src/error.rs b/crates/resource-resolver/src/error.rs new file mode 100644 index 00000000..0c15111f --- /dev/null +++ b/crates/resource-resolver/src/error.rs @@ -0,0 +1,31 @@ +// Copyright 2023-2023 CrabNebula Ltd. +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +use std::path::PathBuf; + +/// The result type of `resource-resolver`. +pub type Result = std::result::Result; + +/// The error type of `resource-resolver`. +#[derive(Debug, thiserror::Error)] +#[non_exhaustive] +pub enum Error { + #[error(transparent)] + Io(#[from] std::io::Error), + /// Unkown package format. + #[error("Unkown package format")] + UnkownPackageFormat, + /// Unsupported package format. + #[error("Unsupported package format")] + UnsupportedPackageFormat, + /// Couldn't find `APPDIR` environment variable. + #[error("Couldn't find `APPDIR` environment variable")] + AppDirNotFound, + /// `APPDIR` or `APPIMAGE` environment variable found but this application was not detected as an AppImage; this might be a security issue. + #[error("`APPDIR` or `APPIMAGE` environment variable found but this application was not detected as an AppImage; this might be a security issue.")] + InvalidAppImage, + /// Couldn't find parent of path. + #[error("Couldn't find parent of {0}")] + ParentNotFound(PathBuf), +} diff --git a/crates/resource-resolver/src/lib.rs b/crates/resource-resolver/src/lib.rs new file mode 100644 index 00000000..8a7377f1 --- /dev/null +++ b/crates/resource-resolver/src/lib.rs @@ -0,0 +1,137 @@ +// Copyright 2023-2023 CrabNebula Ltd. +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +//! # cargo-packager-resource-resolver +//! +//! Resource resolver for apps that were packaged by [`cargo-packager`](https://docs.rs/cargo-packager). +//! +//! It resolves the root path which contains resources, which was set using the `resources` +//! field of [cargo packager configuration](https://docs.rs/cargo-packager/latest/cargo_packager/config/struct.Config.html). +//! +//! ## Get the resource path +//! +//! ``` +//! use cargo_packager_resource_resolver::{resources_dir, PackageFormat}; +//! +//! let resource_path = resources_dir(PackageFormat::Nsis).unwrap(); +//! ``` +//! ## Automatically detect formats +//! +//!
+//! +//! This feature is only available for apps that were built with cargo packager. So the node js binding will not work. +//! +//!
+//! +//! 1. Make sure to use the `before_each_package_command` field of [cargo packager configuration](https://docs.rs/cargo-packager/latest/cargo_packager/config/struct.Config.html) to build your app (this will not work with the `before_packaging_command` field). +//! 2. Active the feature `auto-detect-format`. +//! +//! ```rs +//! use cargo_packager_resource_resolver::{resources_dir, current_format}; +//! +//! let resource_path = resources_dir(current_format()).unwrap(); +//! ``` +//! +use std::path::PathBuf; + +use cargo_packager_utils::current_exe::current_exe; +pub use cargo_packager_utils::PackageFormat; +use error::Result; + +mod error; + +pub use error::Error; + +/// Get the current package format. +/// Can only be used if the app was build with cargo-packager +/// and when the `before-each-package-command` Cargo feature is enabled. +#[cfg(feature = "auto-detect-format")] +pub fn current_format() -> crate::Result { + // sync with PackageFormat::short_name function of packager crate + // maybe having a special crate for the Config struct, + // that both packager and resource-resolver could be a + // better alternative + if cfg!(CARGO_PACKAGER_FORMAT = "app") { + Ok(PackageFormat::App) + } else if cfg!(CARGO_PACKAGER_FORMAT = "dmg") { + Ok(PackageFormat::Dmg) + } else if cfg!(CARGO_PACKAGER_FORMAT = "wix") { + Ok(PackageFormat::Wix) + } else if cfg!(CARGO_PACKAGER_FORMAT = "nsis") { + Ok(PackageFormat::Nsis) + } else if cfg!(CARGO_PACKAGER_FORMAT = "deb") { + Ok(PackageFormat::Deb) + } else if cfg!(CARGO_PACKAGER_FORMAT = "appimage") { + Ok(PackageFormat::AppImage) + } else { + Err(Error::UnkownPackageFormat) + } +} + +/// Retrieve the resource path of your app, packaged with cargo packager. +/// +/// ## Example +/// +/// ``` +/// use cargo_packager_resource_resolver::{resources_dir, PackageFormat}; +/// +/// let resource_path = resources_dir(PackageFormat::Nsis).unwrap(); +/// ``` +pub fn resources_dir(package_format: PackageFormat) -> Result { + match package_format { + PackageFormat::App | PackageFormat::Dmg => { + let exe = current_exe()?; + let exe_dir = exe + .parent() + .ok_or_else(|| Error::ParentNotFound(exe.clone()))?; + Ok(exe_dir.join("../Resources")) + } + PackageFormat::Wix | PackageFormat::Nsis => { + let exe = current_exe()?; + let exe_dir = exe + .parent() + .ok_or_else(|| Error::ParentNotFound(exe.clone()))?; + Ok(exe_dir.to_path_buf()) + } + PackageFormat::Deb => { + let exe = current_exe()?; + let exe_name = exe.file_name().unwrap().to_string_lossy(); + + let path = format!("/usr/lib/{}/", exe_name); + Ok(PathBuf::from(path)) + } + + PackageFormat::AppImage => { + let appdir = std::env::var_os("APPDIR").ok_or(Error::AppDirNotFound)?; + + // validate that we're actually running on an AppImage + // an AppImage is mounted to `/$TEMPDIR/.mount_${appPrefix}${hash}` + // see https://github.com/AppImage/AppImageKit/blob/1681fd84dbe09c7d9b22e13cdb16ea601aa0ec47/src/runtime.c#L501 + // note that it is safe to use `std::env::current_exe` here since we just loaded an AppImage. + let is_temp = std::env::current_exe() + .map(|p| { + p.display() + .to_string() + .starts_with(&format!("{}/.mount_", std::env::temp_dir().display())) + }) + .unwrap_or(true); + + if !is_temp { + return Err(Error::InvalidAppImage); + } + + let appdir: &std::path::Path = appdir.as_ref(); + + let exe = current_exe()?; + let exe_name = exe.file_name().unwrap().to_string_lossy(); + + Ok(PathBuf::from(format!( + "{}/usr/lib/{}", + appdir.display(), + exe_name + ))) + } + _ => Err(Error::UnsupportedPackageFormat), + } +} diff --git a/crates/updater/Cargo.toml b/crates/updater/Cargo.toml index b59c0baf..a1bae13a 100644 --- a/crates/updater/Cargo.toml +++ b/crates/updater/Cargo.toml @@ -2,22 +2,25 @@ name = "cargo-packager-updater" version = "0.1.1" description = "Rust executable updater." -authors = [ - "CrabNebula Ltd.", - "Tauri Programme within The Commons Conservancy" -] +authors = ["CrabNebula Ltd.", "Tauri Programme within The Commons Conservancy"] edition = { workspace = true } license = { workspace = true } repository = { workspace = true } [features] -process-relaunch-dangerous-allow-symlink-macos = [ ] -native-tls = [ "reqwest/native-tls" ] -native-tls-vendored = [ "reqwest/native-tls-vendored" ] -rustls-tls = [ "reqwest/rustls-tls" ] +process-relaunch-dangerous-allow-symlink-macos = [] +native-tls = ["reqwest/native-tls"] +native-tls-vendored = ["reqwest/native-tls-vendored"] +rustls-tls = ["reqwest/rustls-tls"] [dependencies] -reqwest = { version = "0.11", default-features = false, features = [ "json", "stream", "blocking" ] } +cargo-packager-utils = { path = "../utils" } + +reqwest = { version = "0.11", default-features = false, features = [ + "json", + "stream", + "blocking", +] } thiserror = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } @@ -25,13 +28,12 @@ dunce = { workspace = true } dirs = { workspace = true } semver = { workspace = true } base64 = { workspace = true } -time = { workspace = true, features = [ "parsing", "formatting" ] } +time = { workspace = true, features = ["parsing", "formatting"] } http = "0.2" -url = { version = "2.5", features = [ "serde" ] } +url = { version = "2.5", features = ["serde"] } minisign-verify = "0.2" ctor = "0.2" tempfile = "3.9" - [target."cfg(target_os = \"macos\")".dependencies] tar = { workspace = true } flate2 = "1.0" diff --git a/crates/updater/src/lib.rs b/crates/updater/src/lib.rs index beabaefe..ba02f3fd 100644 --- a/crates/updater/src/lib.rs +++ b/crates/updater/src/lib.rs @@ -137,6 +137,7 @@ #![deny(missing_docs)] use base64::Engine; +use cargo_packager_utils::current_exe::current_exe; use http::HeaderName; use minisign_verify::{PublicKey, Signature}; use reqwest::{ @@ -155,9 +156,6 @@ use std::{ use time::OffsetDateTime; use url::Url; -use crate::current_exe::current_exe; - -mod current_exe; mod custom_serialization; mod error; diff --git a/crates/utils/Cargo.toml b/crates/utils/Cargo.toml new file mode 100644 index 00000000..7441e18a --- /dev/null +++ b/crates/utils/Cargo.toml @@ -0,0 +1,20 @@ +[package] +name = "cargo-packager-utils" +version = "0.0.0" +authors = { workspace = true } +edition = { workspace = true } +license = { workspace = true } +repository = { workspace = true } + +[dependencies] +ctor = "0.2" +schemars = { workspace = true, optional = true } +clap = { workspace = true, optional = true } +serde = { workspace = true, optional = true } + +[features] +default = ["cli"] +cli = [] +schema = ["schemars"] +clap = ["dep:clap"] +serde = ["dep:serde"] diff --git a/crates/utils/README.md b/crates/utils/README.md new file mode 100644 index 00000000..5102077b --- /dev/null +++ b/crates/utils/README.md @@ -0,0 +1,3 @@ +# cargo-packager-utils + +Utilities for cargo-packager crate and related crates. diff --git a/crates/updater/src/current_exe.rs b/crates/utils/src/current_exe.rs similarity index 100% rename from crates/updater/src/current_exe.rs rename to crates/utils/src/current_exe.rs diff --git a/crates/utils/src/lib.rs b/crates/utils/src/lib.rs new file mode 100644 index 00000000..2584b3be --- /dev/null +++ b/crates/utils/src/lib.rs @@ -0,0 +1,172 @@ +// Copyright 2023-2023 CrabNebula Ltd. +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +//! # cargo-packager-utils +//! +//! Contain reusable components of the cargo-packager ecosystem. + +use std::fmt::Display; + +pub mod current_exe; + +// NOTE: When making changes to this enum, +// make sure to also update in updater and resource-resolver bindings if needed +/// Types of supported packages by [`cargo-packager`](https://docs.rs/cargo-packager). +#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))] +#[cfg_attr(feature = "serde", serde(rename_all = "lowercase"))] +#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "clap", value(rename_all = "lowercase"))] +#[non_exhaustive] +pub enum PackageFormat { + /// All available package formats for the current platform. + /// + /// See [`PackageFormat::platform_all`] + #[cfg(feature = "cli")] + All, + /// The default list of package formats for the current platform. + /// + /// See [`PackageFormat::platform_default`] + #[cfg(feature = "cli")] + Default, + /// The macOS application bundle (.app). + App, + /// The macOS DMG package (.dmg). + Dmg, + /// The Microsoft Software Installer (.msi) through WiX Toolset. + Wix, + /// The NSIS installer (.exe). + Nsis, + /// The Linux Debian package (.deb). + Deb, + /// The Linux AppImage package (.AppImage). + AppImage, +} + +impl Display for PackageFormat { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{}", self.short_name()) + } +} + +impl PackageFormat { + /// Maps a short name to a [PackageFormat]. + /// Possible values are "deb", "ios", "wix", "app", "rpm", "appimage", "dmg". + pub fn from_short_name(name: &str) -> Option { + // Other types we may eventually want to support: apk. + match name { + "app" => Some(PackageFormat::App), + "dmg" => Some(PackageFormat::Dmg), + "wix" => Some(PackageFormat::Wix), + "nsis" => Some(PackageFormat::Nsis), + "deb" => Some(PackageFormat::Deb), + "appimage" => Some(PackageFormat::AppImage), + _ => None, + } + } + + /// Gets the short name of this [PackageFormat]. + pub fn short_name(&self) -> &'static str { + match *self { + #[cfg(feature = "cli")] + PackageFormat::All => "all", + #[cfg(feature = "cli")] + PackageFormat::Default => "default", + PackageFormat::App => "app", + PackageFormat::Dmg => "dmg", + PackageFormat::Wix => "wix", + PackageFormat::Nsis => "nsis", + PackageFormat::Deb => "deb", + PackageFormat::AppImage => "appimage", + } + } + + /// Gets the list of the possible package types on the current OS. + /// + /// - **macOS**: App, Dmg + /// - **Windows**: Nsis, Wix + /// - **Linux**: Deb, AppImage + pub fn platform_all() -> &'static [PackageFormat] { + &[ + #[cfg(target_os = "macos")] + PackageFormat::App, + #[cfg(target_os = "macos")] + PackageFormat::Dmg, + #[cfg(target_os = "windows")] + PackageFormat::Wix, + #[cfg(target_os = "windows")] + PackageFormat::Nsis, + #[cfg(any( + target_os = "linux", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd" + ))] + PackageFormat::Deb, + #[cfg(any( + target_os = "linux", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd" + ))] + PackageFormat::AppImage, + ] + } + + /// Returns the default list of targets this platform + /// + /// - **macOS**: App, Dmg + /// - **Windows**: Nsis + /// - **Linux**: Deb, AppImage + pub fn platform_default() -> &'static [PackageFormat] { + &[ + #[cfg(target_os = "macos")] + PackageFormat::App, + #[cfg(target_os = "macos")] + PackageFormat::Dmg, + #[cfg(target_os = "windows")] + PackageFormat::Nsis, + #[cfg(any( + target_os = "linux", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd" + ))] + PackageFormat::Deb, + #[cfg(any( + target_os = "linux", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd" + ))] + PackageFormat::AppImage, + ] + } + + /// Gets a number representing priority which used to sort package types + /// in an order that guarantees that if a certain package type + /// depends on another (like Dmg depending on MacOsBundle), the dependency + /// will be built first + /// + /// The lower the number, the higher the priority + pub fn priority(&self) -> u32 { + match self { + #[cfg(feature = "cli")] + PackageFormat::All => 0, + #[cfg(feature = "cli")] + PackageFormat::Default => 0, + PackageFormat::App => 0, + PackageFormat::Wix => 0, + PackageFormat::Nsis => 0, + PackageFormat::Deb => 0, + PackageFormat::AppImage => 0, + PackageFormat::Dmg => 1, + } + } +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index cae0f750..c429f2c0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -49,6 +49,15 @@ importers: specifier: ^5.2.2 version: 5.2.2 + bindings/resource-resolver/nodejs: + devDependencies: + '@napi-rs/cli': + specifier: ^2.16.5 + version: 2.16.5 + '@types/node': + specifier: ^20.8.10 + version: 20.9.1 + bindings/updater/nodejs: devDependencies: '@crabnebula/packager':