From 6ff801e27d972a221325c8e86cbdfddb6bb9c099 Mon Sep 17 00:00:00 2001 From: Amr Bashir Date: Fri, 7 Apr 2023 17:11:05 +0200 Subject: [PATCH] chore: rename `config-schema` to `tauri-config-schema` (#6250) Co-authored-by: Lucas Nogueira --- .changes/config.json | 6 +++--- .github/workflows/check-generated-files.yml | 8 ++++---- .prettierignore | 2 +- .scripts/covector/package-latest-version.js | 12 +++++++----- Cargo.toml | 6 +++--- core/config-schema/Cargo.toml | 13 ------------- core/tauri-config-schema/Cargo.toml | 15 +++++++++++++++ .../build.rs | 0 .../schema.json | 0 .../src/main.rs | 0 .../test/fixture/src-tauri/tauri.conf.json | 2 +- core/tests/app-updater/tauri.conf.json | 2 +- examples/api/src-tauri/tauri.conf.json | 2 +- examples/commands/tauri.conf.json | 2 +- examples/helloworld/tauri.conf.json | 2 +- examples/isolation/tauri.conf.json | 2 +- examples/multiwindow/tauri.conf.json | 2 +- examples/navigation/tauri.conf.json | 2 +- examples/parent-window/tauri.conf.json | 2 +- examples/resources/src-tauri/tauri.conf.json | 2 +- examples/sidecar/src-tauri/tauri.conf.json | 2 +- examples/splashscreen/tauri.conf.json | 2 +- examples/state/tauri.conf.json | 2 +- examples/streaming/tauri.conf.json | 2 +- .../src-tauri/tauri.conf.json | 2 +- examples/updater/src-tauri/tauri.conf.json | 2 +- examples/workspace/index.html | 18 ++++++++---------- examples/workspace/src-tauri/tauri.conf.json | 8 ++------ .../cpu_intensive/src-tauri/tauri.conf.json | 2 +- .../files_transfer/src-tauri/tauri.conf.json | 2 +- .../tests/helloworld/src-tauri/tauri.conf.json | 2 +- .../fixtures/app/src-tauri/tauri.conf.json | 2 +- 32 files changed, 63 insertions(+), 65 deletions(-) delete mode 100644 core/config-schema/Cargo.toml create mode 100644 core/tauri-config-schema/Cargo.toml rename core/{config-schema => tauri-config-schema}/build.rs (100%) rename core/{config-schema => tauri-config-schema}/schema.json (100%) rename core/{config-schema => tauri-config-schema}/src/main.rs (100%) diff --git a/.changes/config.json b/.changes/config.json index afefb9037..7243cc8a5 100644 --- a/.changes/config.json +++ b/.changes/config.json @@ -211,7 +211,7 @@ "dependencies": ["tauri-codegen", "tauri-utils"], "postversion": [ "node ../../.scripts/covector/sync-cli-metadata.js ${ pkg.pkg } ${ release.type }", - "cargo build --manifest-path ../config-schema/Cargo.toml" + "cargo build --manifest-path ../tauri-config-schema/Cargo.toml" ], "assets": [ { @@ -238,7 +238,7 @@ "dependencies": ["cli.rs"], "postversion": [ "node ../../../.scripts/covector/sync-cli-metadata.js ${ pkg.pkg } ${ release.type }", - "cargo build --manifest-path ../../../core/config-schema/Cargo.toml" + "cargo build --manifest-path ../../../core/tauri-config-schema/Cargo.toml" ], "prepublish": [], "publish": [], @@ -250,7 +250,7 @@ "dependencies": ["tauri-bundler", "tauri-utils"], "postversion": [ "cargo check", - "cargo build --manifest-path ../../core/config-schema/Cargo.toml" + "cargo build --manifest-path ../../core/tauri-config-schema/Cargo.toml" ], "assets": [ { diff --git a/.github/workflows/check-generated-files.yml b/.github/workflows/check-generated-files.yml index 4e675d1e6..099ba0129 100644 --- a/.github/workflows/check-generated-files.yml +++ b/.github/workflows/check-generated-files.yml @@ -12,7 +12,7 @@ on: - 'core/tauri/scripts/bundle.global.js' - 'core/tauri-utils/src/config.rs' - 'tooling/cli/schema.json' - - 'core/config-schema/schema.json' + - 'core/tauri-config-schema/schema.json' push: branches: - dev @@ -22,7 +22,7 @@ on: - 'core/tauri/scripts/bundle.global.js' - 'core/tauri-utils/src/config.rs' - 'tooling/cli/schema.json' - - 'core/config-schema/schema.json' + - 'core/tauri-config-schema/schema.json' concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -47,7 +47,7 @@ jobs: schema: - 'core/tauri-utils/src/config.rs' - 'tooling/cli/schema.json' - - 'core/config-schema/schema.json' + - 'core/tauri-config-schema/schema.json' check-api: runs-on: ubuntu-latest @@ -90,7 +90,7 @@ jobs: uses: actions-rs/cargo@v1 with: command: build - args: --manifest-path ./core/config-schema/Cargo.toml + args: --manifest-path ./core/tauri-config-schema/Cargo.toml - name: check schema run: ./.scripts/ci/has-diff.sh diff --git a/.prettierignore b/.prettierignore index 86c1e514d..fd6c5b9ba 100644 --- a/.prettierignore +++ b/.prettierignore @@ -10,4 +10,4 @@ dist /tooling/cli/node /tooling/cli/schema.json /tooling/api/docs/js-api.json -/core/config-schema/schema.json +/core/tauri-config-schema/schema.json diff --git a/.scripts/covector/package-latest-version.js b/.scripts/covector/package-latest-version.js index d7ec15add..3988a926e 100644 --- a/.scripts/covector/package-latest-version.js +++ b/.scripts/covector/package-latest-version.js @@ -19,10 +19,10 @@ let url = null switch (kind) { case 'cargo': url = `https://crates.io/api/v1/crates/${packageName}` - break; + break case 'npm': url = `https://registry.npmjs.org/${packageName}` - break; + break default: throw new Error('unexpected kind ' + kind) } @@ -30,7 +30,7 @@ switch (kind) { const options = { headers: { 'Content-Type': 'application/json', - 'Accept': 'application/json', + Accept: 'application/json', 'User-Agent': 'tauri (https://github.com/tauri-apps/tauri)' } } @@ -44,10 +44,12 @@ https.get(url, options, (response) => { response.on('end', function () { const data = JSON.parse(chunks.join('')) if (kind === 'cargo') { - const versions = data.versions.filter(v => v.num.startsWith(target)) + const versions = data.versions.filter((v) => v.num.startsWith(target)) console.log(versions.length ? versions[0].num : '0.0.0') } else if (kind === 'npm') { - const versions = Object.keys(data.versions).filter(v => v.startsWith(target)) + const versions = Object.keys(data.versions).filter((v) => + v.startsWith(target) + ) console.log(versions[versions.length - 1] || '0.0.0') } }) diff --git a/Cargo.toml b/Cargo.toml index cd6783a04..af5d14713 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,11 +8,11 @@ members = [ "core/tauri-utils", "core/tauri-build", "core/tauri-codegen", - "core/config-schema", + "core/tauri-config-schema", # integration tests "core/tests/restart", - "core/tests/app-updater" + "core/tests/app-updater", ] exclude = [ @@ -22,7 +22,7 @@ exclude = [ "examples/resources/src-tauri", "examples/sidecar/src-tauri", "examples/web/core", - "examples/workspace" + "examples/workspace", ] # default to small, optimized workspace release binaries diff --git a/core/config-schema/Cargo.toml b/core/config-schema/Cargo.toml deleted file mode 100644 index a304bfa38..000000000 --- a/core/config-schema/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "config-schema" -version = "0.0.0" -edition = "2021" -publish = false - -[build-dependencies] -tauri-utils = { version = "1.0.0", features = [ "schema" ], path = "../tauri-utils" } -schemars = { version = "0.8", features = [ "url", "preserve_order" ] } -serde = { version = "1.0", features = [ "derive" ] } -serde_json = "1.0" -serde_with = "1.12" -url = { version = "2.3", features = [ "serde" ] } diff --git a/core/tauri-config-schema/Cargo.toml b/core/tauri-config-schema/Cargo.toml new file mode 100644 index 000000000..ff32019ce --- /dev/null +++ b/core/tauri-config-schema/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "tauri-tauri-config-schema" +version = "0.0.0" +edition = "2021" +publish = false + +[build-dependencies] +tauri-utils = { version = "1.0.0", features = [ + "schema", +], path = "../tauri-utils" } +schemars = { version = "0.8", features = ["url", "preserve_order"] } +serde = { version = "1.0", features = ["derive"] } +serde_json = "1.0" +serde_with = "1.12" +url = { version = "2.3", features = ["serde"] } diff --git a/core/config-schema/build.rs b/core/tauri-config-schema/build.rs similarity index 100% rename from core/config-schema/build.rs rename to core/tauri-config-schema/build.rs diff --git a/core/config-schema/schema.json b/core/tauri-config-schema/schema.json similarity index 100% rename from core/config-schema/schema.json rename to core/tauri-config-schema/schema.json diff --git a/core/config-schema/src/main.rs b/core/tauri-config-schema/src/main.rs similarity index 100% rename from core/config-schema/src/main.rs rename to core/tauri-config-schema/src/main.rs diff --git a/core/tauri/test/fixture/src-tauri/tauri.conf.json b/core/tauri/test/fixture/src-tauri/tauri.conf.json index 6aa450ea6..6b4473313 100644 --- a/core/tauri/test/fixture/src-tauri/tauri.conf.json +++ b/core/tauri/test/fixture/src-tauri/tauri.conf.json @@ -1,5 +1,5 @@ { - "$schema": "../../../../../core/config-schema/schema.json", + "$schema": "../../../../../core/tauri-config-schema/schema.json", "build": { "distDir": "../dist", "devPath": "http://localhost:4000" diff --git a/core/tests/app-updater/tauri.conf.json b/core/tests/app-updater/tauri.conf.json index 9af34d677..8c3351c63 100644 --- a/core/tests/app-updater/tauri.conf.json +++ b/core/tests/app-updater/tauri.conf.json @@ -1,5 +1,5 @@ { - "$schema": "../../../core/config-schema/schema.json", + "$schema": "../../../core/tauri-config-schema/schema.json", "build": { "distDir": [], "devPath": [] diff --git a/examples/api/src-tauri/tauri.conf.json b/examples/api/src-tauri/tauri.conf.json index 192781efb..422f2e6ed 100644 --- a/examples/api/src-tauri/tauri.conf.json +++ b/examples/api/src-tauri/tauri.conf.json @@ -1,5 +1,5 @@ { - "$schema": "../../../core/config-schema/schema.json", + "$schema": "../../../core/tauri-config-schema/schema.json", "build": { "distDir": "../dist", "devPath": "http://localhost:5173", diff --git a/examples/commands/tauri.conf.json b/examples/commands/tauri.conf.json index bcd77b872..1d5a5d2da 100644 --- a/examples/commands/tauri.conf.json +++ b/examples/commands/tauri.conf.json @@ -1,5 +1,5 @@ { - "$schema": "../../core/config-schema/schema.json", + "$schema": "../../core/tauri-config-schema/schema.json", "build": { "distDir": ["index.html"], "devPath": ["index.html"], diff --git a/examples/helloworld/tauri.conf.json b/examples/helloworld/tauri.conf.json index 7e9a5813c..f08db8277 100644 --- a/examples/helloworld/tauri.conf.json +++ b/examples/helloworld/tauri.conf.json @@ -1,5 +1,5 @@ { - "$schema": "../../core/config-schema/schema.json", + "$schema": "../../core/tauri-config-schema/schema.json", "build": { "distDir": ["index.html"], "devPath": ["index.html"], diff --git a/examples/isolation/tauri.conf.json b/examples/isolation/tauri.conf.json index ac62f8e09..79404cdbc 100644 --- a/examples/isolation/tauri.conf.json +++ b/examples/isolation/tauri.conf.json @@ -1,5 +1,5 @@ { - "$schema": "../../core/config-schema/schema.json", + "$schema": "../../core/tauri-config-schema/schema.json", "package": { "productName": "Isolation", "version": "0.1.0" diff --git a/examples/multiwindow/tauri.conf.json b/examples/multiwindow/tauri.conf.json index c93a27225..4530cf911 100644 --- a/examples/multiwindow/tauri.conf.json +++ b/examples/multiwindow/tauri.conf.json @@ -1,5 +1,5 @@ { - "$schema": "../../core/config-schema/schema.json", + "$schema": "../../core/tauri-config-schema/schema.json", "build": { "distDir": ["index.html"], "devPath": ["index.html"], diff --git a/examples/navigation/tauri.conf.json b/examples/navigation/tauri.conf.json index 3c22f36fd..4e02eadcd 100644 --- a/examples/navigation/tauri.conf.json +++ b/examples/navigation/tauri.conf.json @@ -1,5 +1,5 @@ { - "$schema": "../../core/config-schema/schema.json", + "$schema": "../../core/tauri-config-schema/schema.json", "build": { "distDir": "public", "devPath": "public", diff --git a/examples/parent-window/tauri.conf.json b/examples/parent-window/tauri.conf.json index 04d69c887..0054ffefb 100644 --- a/examples/parent-window/tauri.conf.json +++ b/examples/parent-window/tauri.conf.json @@ -1,5 +1,5 @@ { - "$schema": "../../core/config-schema/schema.json", + "$schema": "../../core/tauri-config-schema/schema.json", "build": { "distDir": ["index.html"], "devPath": ["index.html"], diff --git a/examples/resources/src-tauri/tauri.conf.json b/examples/resources/src-tauri/tauri.conf.json index 0f2882174..4249968b3 100644 --- a/examples/resources/src-tauri/tauri.conf.json +++ b/examples/resources/src-tauri/tauri.conf.json @@ -1,5 +1,5 @@ { - "$schema": "../../../core/config-schema/schema.json", + "$schema": "../../../core/tauri-config-schema/schema.json", "build": { "distDir": ["../index.html"], "devPath": ["../index.html"], diff --git a/examples/sidecar/src-tauri/tauri.conf.json b/examples/sidecar/src-tauri/tauri.conf.json index f1c3ec9bb..223643629 100644 --- a/examples/sidecar/src-tauri/tauri.conf.json +++ b/examples/sidecar/src-tauri/tauri.conf.json @@ -1,5 +1,5 @@ { - "$schema": "../../../core/config-schema/schema.json", + "$schema": "../../../core/tauri-config-schema/schema.json", "build": { "distDir": ["../index.html"], "devPath": ["../index.html"], diff --git a/examples/splashscreen/tauri.conf.json b/examples/splashscreen/tauri.conf.json index 8703d5b8b..edb2c8efd 100644 --- a/examples/splashscreen/tauri.conf.json +++ b/examples/splashscreen/tauri.conf.json @@ -1,5 +1,5 @@ { - "$schema": "../../core/config-schema/schema.json", + "$schema": "../../core/tauri-config-schema/schema.json", "build": { "distDir": "dist", "devPath": "dist", diff --git a/examples/state/tauri.conf.json b/examples/state/tauri.conf.json index 0307a29ad..899e78f63 100644 --- a/examples/state/tauri.conf.json +++ b/examples/state/tauri.conf.json @@ -1,5 +1,5 @@ { - "$schema": "../../core/config-schema/schema.json", + "$schema": "../../core/tauri-config-schema/schema.json", "build": { "distDir": ["index.html"], "devPath": ["index.html"], diff --git a/examples/streaming/tauri.conf.json b/examples/streaming/tauri.conf.json index b8baf642d..9e303f1b2 100644 --- a/examples/streaming/tauri.conf.json +++ b/examples/streaming/tauri.conf.json @@ -1,5 +1,5 @@ { - "$schema": "../../core/config-schema/schema.json", + "$schema": "../../core/tauri-config-schema/schema.json", "build": { "distDir": ["index.html"], "devPath": ["index.html"], diff --git a/examples/tauri-dynamic-lib/src-tauri/tauri.conf.json b/examples/tauri-dynamic-lib/src-tauri/tauri.conf.json index 4c80266a1..773034cdc 100644 --- a/examples/tauri-dynamic-lib/src-tauri/tauri.conf.json +++ b/examples/tauri-dynamic-lib/src-tauri/tauri.conf.json @@ -1,5 +1,5 @@ { - "$schema": "../../../core/config-schema/schema.json", + "$schema": "../../../core/tauri-config-schema/schema.json", "build": { "distDir": ["src/index.html"], "devPath": ["src/index.html"], diff --git a/examples/updater/src-tauri/tauri.conf.json b/examples/updater/src-tauri/tauri.conf.json index 797800ee3..f935ca361 100644 --- a/examples/updater/src-tauri/tauri.conf.json +++ b/examples/updater/src-tauri/tauri.conf.json @@ -1,5 +1,5 @@ { - "$schema": "../../../core/config-schema/schema.json", + "$schema": "../../../core/tauri-config-schema/schema.json", "build": { "distDir": ["../index.html"], "devPath": ["../index.html"], diff --git a/examples/workspace/index.html b/examples/workspace/index.html index 64bfd7adc..33433a69e 100644 --- a/examples/workspace/index.html +++ b/examples/workspace/index.html @@ -1,13 +1,11 @@ + + + + - - - - - - -

Workspace Example!

- - - \ No newline at end of file + +

Workspace Example!

+ + diff --git a/examples/workspace/src-tauri/tauri.conf.json b/examples/workspace/src-tauri/tauri.conf.json index dce681d88..120012081 100644 --- a/examples/workspace/src-tauri/tauri.conf.json +++ b/examples/workspace/src-tauri/tauri.conf.json @@ -1,11 +1,7 @@ { "build": { - "distDir": [ - "../index.html" - ], - "devPath": [ - "../index.html" - ] + "distDir": ["../index.html"], + "devPath": ["../index.html"] }, "package": { "productName": "workspace" diff --git a/tooling/bench/tests/cpu_intensive/src-tauri/tauri.conf.json b/tooling/bench/tests/cpu_intensive/src-tauri/tauri.conf.json index 4fd4aa03d..7241cb0e2 100644 --- a/tooling/bench/tests/cpu_intensive/src-tauri/tauri.conf.json +++ b/tooling/bench/tests/cpu_intensive/src-tauri/tauri.conf.json @@ -1,5 +1,5 @@ { - "$schema": "../../../../../core/config-schema/schema.json", + "$schema": "../../../../../core/tauri-config-schema/schema.json", "build": { "distDir": "../public", "devPath": "../public", diff --git a/tooling/bench/tests/files_transfer/src-tauri/tauri.conf.json b/tooling/bench/tests/files_transfer/src-tauri/tauri.conf.json index f41ef37cb..a9765df29 100644 --- a/tooling/bench/tests/files_transfer/src-tauri/tauri.conf.json +++ b/tooling/bench/tests/files_transfer/src-tauri/tauri.conf.json @@ -1,5 +1,5 @@ { - "$schema": "../../../../../core/config-schema/schema.json", + "$schema": "../../../../../core/tauri-config-schema/schema.json", "build": { "distDir": "../public", "devPath": "../public", diff --git a/tooling/bench/tests/helloworld/src-tauri/tauri.conf.json b/tooling/bench/tests/helloworld/src-tauri/tauri.conf.json index 4fd4aa03d..7241cb0e2 100644 --- a/tooling/bench/tests/helloworld/src-tauri/tauri.conf.json +++ b/tooling/bench/tests/helloworld/src-tauri/tauri.conf.json @@ -1,5 +1,5 @@ { - "$schema": "../../../../../core/config-schema/schema.json", + "$schema": "../../../../../core/tauri-config-schema/schema.json", "build": { "distDir": "../public", "devPath": "../public", diff --git a/tooling/cli/node/test/jest/fixtures/app/src-tauri/tauri.conf.json b/tooling/cli/node/test/jest/fixtures/app/src-tauri/tauri.conf.json index ff75d57c1..98017f164 100644 --- a/tooling/cli/node/test/jest/fixtures/app/src-tauri/tauri.conf.json +++ b/tooling/cli/node/test/jest/fixtures/app/src-tauri/tauri.conf.json @@ -1,5 +1,5 @@ { - "$schema": "../../../../../../../../core/config-schema/schema.json", + "$schema": "../../../../../../../../core/tauri-config-schema/schema.json", "build": { "devPath": "../dist", "distDir": "../dist",