diff --git a/.github/sync-to-mirrors.sh b/.github/sync-to-mirrors.sh index 757e1d10..1a65bf2d 100755 --- a/.github/sync-to-mirrors.sh +++ b/.github/sync-to-mirrors.sh @@ -93,12 +93,12 @@ while read -r PLUGIN_NAME; do echo "Failed to find a branch to branch from, just creating an empty one." FORCE_COMMIT=--allow-empty fi - git add -Af + git add -A echo "::endgroup::" if [[ -n "$FORCE_COMMIT" || -n "$(git status --porcelain)" ]]; then echo "Committing to $PLUGIN_NAME" - if git commit --quiet $FORCE_COMMIT --author="${COMMIT_ORIGINAL_AUTHOR}" -m "${COMMIT_MESSAGE}" && + if git commit $FORCE_COMMIT --author="${COMMIT_ORIGINAL_AUTHOR}" -m "${COMMIT_MESSAGE}" && { [[ -z "$CI" ]] || git push origin "$BRANCH"; } # Only do the actual push from the GitHub Action then # echo "$BUILD_BASE/changes.diff" diff --git a/.github/workflows/lint-rust.yml b/.github/workflows/lint-rust.yml index 4ad8c167..da353a56 100644 --- a/.github/workflows/lint-rust.yml +++ b/.github/workflows/lint-rust.yml @@ -6,14 +6,14 @@ on: - dev paths: - ".github/workflows/lint-rust.yml" - - "plugins/src/**" + - "plugins/*/src/**" - "**/Cargo.toml" pull_request: branches: - dev paths: - ".github/workflows/lint-rust.yml" - - "plugins/src/**" + - "plugins/*/src/**" - "**/Cargo.toml" concurrency: @@ -28,42 +28,30 @@ jobs: steps: - uses: actions/checkout@v3 - - name: install webkit2gtk + + - name: install webkit2gtk and libudev for [authenticator] run: | sudo apt-get update - sudo apt-get install -y webkit2gtk-4.0 - - name: install libudev for [authenticator] - run: | - sudo apt-get install -y libudev-dev + sudo apt-get install -y webkit2gtk-4.0 libudev-dev + - name: Install clippy with stable toolchain - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@stable with: - profile: minimal - toolchain: stable - override: true components: clippy - - uses: Swatinem/rust-cache@v1 - - uses: actions-rs/clippy-check@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - args: --workspace --exclude 'tauri-plugin-sql' --all-targets --all-features -- -D warnings - name: clippy - - uses: actions-rs/clippy-check@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - args: --workspace --package 'tauri-plugin-sql' --all-targets --features sqlite -- -D warnings - name: clippy sql:sqlite - - uses: actions-rs/clippy-check@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - args: --workspace --package 'tauri-plugin-sql' --all-targets --features mysql -- -D warnings - name: clippy sql:mysql - - uses: actions-rs/clippy-check@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - args: --workspace --package 'tauri-plugin-sql' --all-targets --features postgres -- -D warnings - name: clippy sql:postgres + - uses: Swatinem/rust-cache@v2 + + - name: clippy + run: cargo clippy --workspace --exclude 'tauri-plugin-sql' --all-targets --all-features -- -D warnings + + - name: clippy sql:sqlite + run: cargo clippy --package 'tauri-plugin-sql' --all-targets --features sqlite -- -D warnings + + - name: clippy sql:mysql + run: cargo clippy --package 'tauri-plugin-sql' --all-targets --features mysql -- -D warnings + + - name: clippy sql:postgres + run: cargo clippy --package 'tauri-plugin-sql' --all-targets --features postgres -- -D warnings fmt: runs-on: ubuntu-latest @@ -72,14 +60,11 @@ jobs: steps: - uses: actions/checkout@v3 + - name: Install rustfmt with nightly toolchain - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@nightly with: - profile: minimal - toolchain: nightly - override: true components: rustfmt - - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all -- --check + + - name: Check formatting + run: cargo fmt --all -- --check diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml index aabf8d93..51521aab 100644 --- a/.github/workflows/sync.yml +++ b/.github/workflows/sync.yml @@ -33,5 +33,5 @@ jobs: - name: Sync run: .github/sync-to-mirrors.sh env: - BUILD_BASE: ./plugins + BUILD_BASE: ${{ github.workspace }}/plugins API_TOKEN_GITHUB: ${{ secrets.ORG_TAURI_BOT_PAT }} diff --git a/.prettierignore b/.prettierignore index 2c6d35b6..13134b1f 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,3 +1,5 @@ target node_modules -dist \ No newline at end of file +dist +pnpm-lock.yaml +Cargo.lock \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml index 41ae9082..48a6a386 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,4 +12,5 @@ thiserror = "1" [workspace.package] edition = "2021" authors = [ "Tauri Programme within The Commons Conservancy" ] -license = "Apache-2.0 OR MIT" \ No newline at end of file +license = "Apache-2.0 OR MIT" +rust-version = "1.59" \ No newline at end of file diff --git a/plugins/authenticator/Cargo.toml b/plugins/authenticator/Cargo.toml index 73978f5f..145b5140 100644 --- a/plugins/authenticator/Cargo.toml +++ b/plugins/authenticator/Cargo.toml @@ -1,9 +1,11 @@ [package] name = "tauri-plugin-authenticator" version = "0.1.0" -edition.workspace = true +description = "Use hardware security-keys in your Tauri App." authors.workspace = true license.workspace = true +edition.workspace = true +rust-version.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/plugins/authenticator/README.md b/plugins/authenticator/README.md index 08f7df92..884d81b9 100644 --- a/plugins/authenticator/README.md +++ b/plugins/authenticator/README.md @@ -1,6 +1,6 @@ ![plugin-authenticator](banner.png) -Use Hardware Security-keys in your Tauri App. +Use hardware security-keys in your Tauri App. ## Install diff --git a/plugins/authenticator/package.json b/plugins/authenticator/package.json index 6cf8288e..e0c7725e 100644 --- a/plugins/authenticator/package.json +++ b/plugins/authenticator/package.json @@ -1,6 +1,7 @@ { "name": "tauri-plugin-authenticator-api", "version": "0.0.0", + "description": "Use hardware security-keys in your Tauri App.", "license": "MIT or APACHE-2.0", "authors": [ "Tauri Programme within The Commons Conservancy" diff --git a/plugins/autostart/Cargo.toml b/plugins/autostart/Cargo.toml index 3819ec10..e129794e 100644 --- a/plugins/autostart/Cargo.toml +++ b/plugins/autostart/Cargo.toml @@ -1,9 +1,11 @@ [package] name = "tauri-plugin-autostart" version = "0.1.0" -edition.workspace = true +description = "Automatically launch your application at startup." authors.workspace = true license.workspace = true +edition.workspace = true +rust-version.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/plugins/fs-extra/Cargo.toml b/plugins/fs-extra/Cargo.toml index 63d5a13e..79b0e7ce 100644 --- a/plugins/fs-extra/Cargo.toml +++ b/plugins/fs-extra/Cargo.toml @@ -1,9 +1,11 @@ [package] name = "tauri-plugin-fs-extra" version = "0.1.0" -edition.workspace = true +description = "Additional file system methods not included in the core API." authors.workspace = true license.workspace = true +edition.workspace = true +rust-version.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/plugins/fs-extra/README.md b/plugins/fs-extra/README.md index a9937451..6ea6ea1c 100644 --- a/plugins/fs-extra/README.md +++ b/plugins/fs-extra/README.md @@ -1,4 +1,6 @@ - +![tauri-plugin-fs-extra](banner.png) + +Additional file system methods not included in the core API. ## Install diff --git a/plugins/fs-extra/package.json b/plugins/fs-extra/package.json index 8929b996..52eb1eef 100644 --- a/plugins/fs-extra/package.json +++ b/plugins/fs-extra/package.json @@ -1,6 +1,7 @@ { "name": "tauri-plugin-fs-extra-api", "version": "0.0.0", + "description": "Additional file system methods not included in the core API.", "license": "MIT or APACHE-2.0", "authors": [ "Tauri Programme within The Commons Conservancy" diff --git a/plugins/fs-watch/Cargo.toml b/plugins/fs-watch/Cargo.toml index 0eb232a4..89501ac8 100644 --- a/plugins/fs-watch/Cargo.toml +++ b/plugins/fs-watch/Cargo.toml @@ -1,9 +1,11 @@ [package] name = "tauri-plugin-fs-watch" version = "0.1.0" -edition.workspace = true +description = "Watch files and directories for changes." authors.workspace = true license.workspace = true +edition.workspace = true +rust-version.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/plugins/fs-watch/README.md b/plugins/fs-watch/README.md index 19445c42..26ee5bfc 100644 --- a/plugins/fs-watch/README.md +++ b/plugins/fs-watch/README.md @@ -1,6 +1,6 @@ ![plugin-fs-watch](banner.png) -Watch changes on files and directories through [notify](https://github.com/notify-rs/notify). +Watch files and directories for changes using [notify](https://github.com/notify-rs/notify). ## Install diff --git a/plugins/fs-watch/package.json b/plugins/fs-watch/package.json index c903f942..adf44a2c 100644 --- a/plugins/fs-watch/package.json +++ b/plugins/fs-watch/package.json @@ -1,6 +1,7 @@ { "name": "tauri-plugin-fs-watch-api", "version": "0.0.0", + "description": "Watch files and directories for changes.", "license": "MIT or APACHE-2.0", "authors": [ "Tauri Programme within The Commons Conservancy" diff --git a/plugins/localhost/Cargo.toml b/plugins/localhost/Cargo.toml index 5c20919d..b7ccae7c 100644 --- a/plugins/localhost/Cargo.toml +++ b/plugins/localhost/Cargo.toml @@ -1,9 +1,11 @@ [package] name = "tauri-plugin-localhost" version = "0.1.0" -edition.workspace = true +description = "Expose your apps assets through a localhost server instead of the default custom protocol." authors.workspace = true license.workspace = true +edition.workspace = true +rust-version.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/plugins/log/Cargo.toml b/plugins/log/Cargo.toml index 8d627dfe..e590222b 100644 --- a/plugins/log/Cargo.toml +++ b/plugins/log/Cargo.toml @@ -1,9 +1,11 @@ [package] name = "tauri-plugin-log" version = "0.1.0" -edition.workspace = true +description = "Configurable logging for your Tauri app." authors.workspace = true license.workspace = true +edition.workspace = true +rust-version.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/plugins/log/package.json b/plugins/log/package.json index 9574a8fc..ff13c42d 100644 --- a/plugins/log/package.json +++ b/plugins/log/package.json @@ -1,6 +1,7 @@ { "name": "tauri-plugin-log-api", "version": "0.0.0", + "description": "Configurable logging for your Tauri app.", "license": "MIT or APACHE-2.0", "authors": [ "Tauri Programme within The Commons Conservancy" diff --git a/plugins/mirrors.txt b/plugins/mirrors.txt index ca4cb0cf..4ad29c51 100644 --- a/plugins/mirrors.txt +++ b/plugins/mirrors.txt @@ -1 +1,14 @@ +authenticator +autostart +fs-extra +fs-watch +localhost +log +persisted-scope +positioner +sql +store +stronghold +upload websocket +window-state diff --git a/plugins/persisted-scope/Cargo.toml b/plugins/persisted-scope/Cargo.toml index 58427d32..7bc30228 100644 --- a/plugins/persisted-scope/Cargo.toml +++ b/plugins/persisted-scope/Cargo.toml @@ -1,9 +1,11 @@ [package] name = "tauri-plugin-persisted-scope" version = "0.1.0" -edition.workspace = true +description = "Save filesystem and asset scopes and restore them when the app is reopened." authors.workspace = true license.workspace = true +edition.workspace = true +rust-version.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/plugins/persisted-scope/src/lib.rs b/plugins/persisted-scope/src/lib.rs index 9fbdf4f7..ef0625ba 100644 --- a/plugins/persisted-scope/src/lib.rs +++ b/plugins/persisted-scope/src/lib.rs @@ -54,13 +54,13 @@ pub fn init() -> TauriPlugin { .map_err(Error::from) .and_then(|scope| bincode::deserialize(&scope).map_err(Into::into)) .unwrap_or_default(); - for allowed in scope.allowed_paths { + for allowed in &scope.allowed_paths { // allows the path as is let _ = fs_scope.allow_file(allowed); #[cfg(feature = "protocol-asset")] let _ = asset_protocol_scope.allow_file(allowed); } - for forbidden in scope.forbidden_patterns { + for forbidden in &scope.forbidden_patterns { // forbid the path as is let _ = fs_scope.forbid_file(forbidden); #[cfg(feature = "protocol-asset")] diff --git a/plugins/positioner/Cargo.toml b/plugins/positioner/Cargo.toml index 59a9cfef..08155a5d 100644 --- a/plugins/positioner/Cargo.toml +++ b/plugins/positioner/Cargo.toml @@ -1,9 +1,11 @@ [package] name = "tauri-plugin-positioner" version = "0.2.7" -edition.workspace = true +description = "Position your windows at well-known locations." authors.workspace = true license.workspace = true +edition.workspace = true +rust-version.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/plugins/positioner/package.json b/plugins/positioner/package.json index 5ee70039..8f20982c 100644 --- a/plugins/positioner/package.json +++ b/plugins/positioner/package.json @@ -1,6 +1,7 @@ { "name": "tauri-plugin-positioner-api", "version": "0.0.0", + "description": "Position your windows at well-known locations.", "license": "MIT or APACHE-2.0", "authors": [ "Tauri Programme within The Commons Conservancy" diff --git a/plugins/sql/Cargo.toml b/plugins/sql/Cargo.toml index cee4ba13..c72e237c 100644 --- a/plugins/sql/Cargo.toml +++ b/plugins/sql/Cargo.toml @@ -1,9 +1,11 @@ [package] name = "tauri-plugin-sql" version = "0.1.0" -edition.workspace = true +description = "Interface with SQL databases." authors.workspace = true license.workspace = true +edition.workspace = true +rust-version.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/plugins/sql/package.json b/plugins/sql/package.json index 35b279ed..9ad3d1fe 100644 --- a/plugins/sql/package.json +++ b/plugins/sql/package.json @@ -1,6 +1,7 @@ { "name": "tauri-plugin-sql-api", "version": "0.0.0", + "description": "Interface with SQL databases", "license": "MIT or APACHE-2.0", "authors": [ "Tauri Programme within The Commons Conservancy" diff --git a/plugins/store/Cargo.toml b/plugins/store/Cargo.toml index 4ea9924e..9fd091fc 100644 --- a/plugins/store/Cargo.toml +++ b/plugins/store/Cargo.toml @@ -1,9 +1,11 @@ [package] name = "tauri-plugin-store" version = "0.1.0" -edition.workspace = true +description = "Simple, persistent key-value store." authors.workspace = true license.workspace = true +edition.workspace = true +rust-version.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/plugins/store/package.json b/plugins/store/package.json index cc55321f..37f6c532 100644 --- a/plugins/store/package.json +++ b/plugins/store/package.json @@ -1,6 +1,7 @@ { "name": "tauri-plugin-store-api", "version": "0.0.0", + "description": "Simple, persistent key-value store.", "license": "MIT or APACHE-2.0", "authors": [ "Tauri Programme within The Commons Conservancy" diff --git a/plugins/store/src/lib.rs b/plugins/store/src/lib.rs index db9b3048..6c641dbc 100644 --- a/plugins/store/src/lib.rs +++ b/plugins/store/src/lib.rs @@ -244,12 +244,12 @@ async fn save( } #[derive(Default)] -pub struct PluginBuilder { +pub struct Builder { stores: HashMap, frozen: bool, } -impl PluginBuilder { +impl Builder { /// Registers a store with the plugin. /// /// # Examples diff --git a/plugins/stronghold/Cargo.toml b/plugins/stronghold/Cargo.toml index ba8f6c3f..7abd5f07 100644 --- a/plugins/stronghold/Cargo.toml +++ b/plugins/stronghold/Cargo.toml @@ -1,9 +1,11 @@ [package] name = "tauri-plugin-stronghold" version = "0.1.0" -edition.workspace = true +description = "Store secrets and keys using the IOTA Stronghold encrypted database." authors.workspace = true license.workspace = true +edition.workspace = true +rust-version.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/plugins/stronghold/package.json b/plugins/stronghold/package.json index b929c2c2..4892e730 100644 --- a/plugins/stronghold/package.json +++ b/plugins/stronghold/package.json @@ -1,6 +1,7 @@ { "name": "tauri-plugin-stronghold-api", "version": "0.0.0", + "description": "Store secrets and keys using the IOTA Stronghold encrypted database.", "license": "MIT or APACHE-2.0", "authors": [ "Tauri Programme within The Commons Conservancy" diff --git a/plugins/upload/Cargo.toml b/plugins/upload/Cargo.toml index 9d427d15..b06c1e32 100644 --- a/plugins/upload/Cargo.toml +++ b/plugins/upload/Cargo.toml @@ -1,9 +1,11 @@ [package] name = "tauri-plugin-upload" version = "0.1.0" -edition.workspace = true +description = "Upload files from disk to a remote server over HTTP." authors.workspace = true license.workspace = true +edition.workspace = true +rust-version.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/plugins/upload/README.md b/plugins/upload/README.md index 2ee4fa43..1168a362 100644 --- a/plugins/upload/README.md +++ b/plugins/upload/README.md @@ -1,6 +1,6 @@ ![plugin-upload](banner.png) -Upload files from disk to a remote server over http. +Upload files from disk to a remote server over HTTP. ## Install diff --git a/plugins/upload/package.json b/plugins/upload/package.json index 8ec9afaf..711620b2 100644 --- a/plugins/upload/package.json +++ b/plugins/upload/package.json @@ -1,6 +1,7 @@ { "name": "tauri-plugin-upload-api", "version": "0.0.0", + "description": "Upload files from disk to a remote server over HTTP.", "license": "MIT or APACHE-2.0", "authors": [ "Tauri Programme within The Commons Conservancy" diff --git a/plugins/websocket/Cargo.toml b/plugins/websocket/Cargo.toml index 1bea91f3..6acc0bbf 100644 --- a/plugins/websocket/Cargo.toml +++ b/plugins/websocket/Cargo.toml @@ -1,9 +1,10 @@ [package] name = "tauri-plugin-websocket" version = "0.1.0" -edition.workspace = true authors.workspace = true license.workspace = true +edition.workspace = true +rust-version.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/plugins/window-state/Cargo.toml b/plugins/window-state/Cargo.toml index 001ac646..00d15f97 100644 --- a/plugins/window-state/Cargo.toml +++ b/plugins/window-state/Cargo.toml @@ -1,9 +1,11 @@ [package] name = "tauri-plugin-window-state" version = "0.1.0" -edition.workspace = true +description = "Save window positions and sizse and restore them when the app is reopened." authors.workspace = true license.workspace = true +edition.workspace = true +rust-version.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/plugins/window-state/README.md b/plugins/window-state/README.md index 668d68ad..de309e73 100644 --- a/plugins/window-state/README.md +++ b/plugins/window-state/README.md @@ -2,8 +2,6 @@ Save window positions and sizse and restore them when the app is reopened. - - ## Install There are three general methods of installation that we can recommend. diff --git a/renovate.json b/renovate.json new file mode 100644 index 00000000..4dac52b1 --- /dev/null +++ b/renovate.json @@ -0,0 +1,4 @@ +{ + "extends": ["config:base"], + "enabledManagers": ["cargo", "npm"] +} diff --git a/shared/template/guest-js/tsconfig.json b/shared/template/guest-js/tsconfig.json deleted file mode 120000 index 9c2b2da2..00000000 --- a/shared/template/guest-js/tsconfig.json +++ /dev/null @@ -1 +0,0 @@ -../../../shared/tsconfig.json \ No newline at end of file diff --git a/shared/template/guest-js/package.json b/shared/template/package.json similarity index 63% rename from shared/template/guest-js/package.json rename to shared/template/package.json index 2c479ef3..ac5eefd1 100644 --- a/shared/template/guest-js/package.json +++ b/shared/template/package.json @@ -6,13 +6,13 @@ "Tauri Programme within The Commons Conservancy" ], "type": "module", - "browser": "dist/index.min.js", - "module": "dist/index.mjs", - "types": "dist/index.d.ts", + "browser": "guest-js/dist/index.min.js", + "module": "guest-js/dist/index.mjs", + "types": "guest-js/dist/index.d.ts", "exports": { - "import": "./dist/index.mjs", - "types": "./dist/index.d.ts", - "browser": "./dist/index.min.js" + "import": "./guest-js/dist/index.mjs", + "types": "./guest-js/dist/index.d.ts", + "browser": "./guest-js/dist/index.min.js" }, "scripts": { "build": "rollup -c" diff --git a/shared/template/guest-js/rollup.config.mjs b/shared/template/rollup.config.mjs similarity index 70% rename from shared/template/guest-js/rollup.config.mjs rename to shared/template/rollup.config.mjs index ee885522..96840adc 100644 --- a/shared/template/guest-js/rollup.config.mjs +++ b/shared/template/rollup.config.mjs @@ -1,8 +1,9 @@ import { readFileSync } from "fs"; -import { createConfig } from "../../../shared/rollup.config.mjs"; +import { createConfig } from "../rollup.config.mjs"; export default createConfig({ + input: "guest-js/index.ts", pkg: JSON.parse( readFileSync(new URL("./package.json", import.meta.url), "utf8") ), diff --git a/shared/template/tsconfig.json b/shared/template/tsconfig.json new file mode 120000 index 00000000..4ec6ff6a --- /dev/null +++ b/shared/template/tsconfig.json @@ -0,0 +1 @@ +../tsconfig.json \ No newline at end of file