Merge branch 'develop'
This commit is contained in:
13
bump.config.ts
Normal file
13
bump.config.ts
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
import { defineConfig } from "bumpp";
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
release: "patch",
|
||||||
|
commit: false,
|
||||||
|
tag: false,
|
||||||
|
push: false,
|
||||||
|
files: [
|
||||||
|
"package.json",
|
||||||
|
"src-tauri/tauri.conf.json",
|
||||||
|
"src-tauri/Cargo.toml"
|
||||||
|
]
|
||||||
|
});
|
@@ -1,8 +1,3 @@
|
|||||||
import { internalIpV4 } from "internal-ip";
|
|
||||||
|
|
||||||
// @ts-expect-error process is a nodejs global
|
|
||||||
const mobile = !!/android|ios/.exec(process.env.TAURI_ENV_PLATFORM);
|
|
||||||
|
|
||||||
export default defineNuxtConfig({
|
export default defineNuxtConfig({
|
||||||
modules: [
|
modules: [
|
||||||
"@vueuse/nuxt",
|
"@vueuse/nuxt",
|
||||||
@@ -45,13 +40,11 @@ export default defineNuxtConfig({
|
|||||||
envPrefix: ["VITE_", "TAURI_"],
|
envPrefix: ["VITE_", "TAURI_"],
|
||||||
server: {
|
server: {
|
||||||
strictPort: true,
|
strictPort: true,
|
||||||
hmr: mobile
|
hmr: {
|
||||||
? {
|
protocol: "ws",
|
||||||
protocol: "ws",
|
host: "0.0.0.0",
|
||||||
host: await internalIpV4(),
|
port: 3001
|
||||||
port: 3001
|
},
|
||||||
}
|
|
||||||
: undefined,
|
|
||||||
watch: {
|
watch: {
|
||||||
ignored: ["**/src-tauri/**"]
|
ignored: ["**/src-tauri/**"]
|
||||||
}
|
}
|
||||||
|
29
package.json
29
package.json
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "nuxtor",
|
"name": "nuxtor",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "0.0.2",
|
"version": "0.0.3",
|
||||||
"private": true,
|
"private": true,
|
||||||
"packageManager": "pnpm@9.4.0",
|
"packageManager": "pnpm@9.4.0",
|
||||||
"description": "Starter template for Nuxt 3 with Tauri",
|
"description": "Starter template for Nuxt 3 with Tauri",
|
||||||
@@ -16,37 +16,34 @@
|
|||||||
"preinstall": "npx only-allow pnpm",
|
"preinstall": "npx only-allow pnpm",
|
||||||
"postinstall": "nuxt prepare",
|
"postinstall": "nuxt prepare",
|
||||||
"lint": "eslint . --fix",
|
"lint": "eslint . --fix",
|
||||||
"bump:patch": "tsx scripts/bump.ts patch && eslint package.json src-tauri/tauri.conf.json src-tauri/Cargo.toml --fix",
|
"bump": "bumpp",
|
||||||
"bump:minor": "tsx scripts/bump.ts minor && eslint package.json src-tauri/tauri.conf.json src-tauri/Cargo.toml --fix",
|
|
||||||
"bump:major": "tsx scripts/bump.ts major && eslint package.json src-tauri/tauri.conf.json src-tauri/Cargo.toml --fix",
|
|
||||||
"tauri": "tauri",
|
"tauri": "tauri",
|
||||||
"tauri:dev": "tauri dev",
|
"tauri:dev": "tauri dev",
|
||||||
"tauri:build": "tauri build",
|
"tauri:build": "tauri build",
|
||||||
"tauri:build:debug": "tauri build --debug"
|
"tauri:build:debug": "tauri build --debug"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@tauri-apps/api": ">=2.0.0-beta.13",
|
"@tauri-apps/api": ">=2.0.0-beta.14",
|
||||||
"@tauri-apps/plugin-notification": "2.0.0-beta.5",
|
"@tauri-apps/plugin-fs": "2.0.0-beta.6",
|
||||||
"@tauri-apps/plugin-os": "2.0.0-beta.5",
|
"@tauri-apps/plugin-notification": "2.0.0-beta.6",
|
||||||
"@tauri-apps/plugin-shell": "2.0.0-beta.6"
|
"@tauri-apps/plugin-os": "2.0.0-beta.6",
|
||||||
|
"@tauri-apps/plugin-shell": "2.0.0-beta.7"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@antfu/eslint-config": "^2.21.1",
|
"@antfu/eslint-config": "^2.21.2",
|
||||||
"@iarna/toml": "^2.2.5",
|
|
||||||
"@iconify-json/heroicons-solid": "^1.1.11",
|
"@iconify-json/heroicons-solid": "^1.1.11",
|
||||||
"@nuxt/eslint": "^0.3.13",
|
"@nuxt/eslint": "^0.3.13",
|
||||||
"@tauri-apps/cli": ">=2.0.0-beta.20",
|
"@tauri-apps/cli": ">=2.0.0-beta.21",
|
||||||
"@unocss/eslint-plugin": "^0.61.0",
|
"@unocss/eslint-plugin": "^0.61.0",
|
||||||
"@unocss/nuxt": "^0.61.0",
|
"@unocss/nuxt": "^0.61.0",
|
||||||
"@vueuse/core": "^10.11.0",
|
"@vueuse/core": "^10.11.0",
|
||||||
"@vueuse/nuxt": "^10.11.0",
|
"@vueuse/nuxt": "^10.11.0",
|
||||||
|
"bumpp": "^9.4.1",
|
||||||
"eslint": "8.57.0",
|
"eslint": "8.57.0",
|
||||||
"internal-ip": "^8.0.0",
|
"nuxt": "^3.12.3",
|
||||||
"nuxt": "^3.12.1",
|
|
||||||
"nuxt-svgo": "^4.0.1",
|
"nuxt-svgo": "^4.0.1",
|
||||||
"sass": "^1.77.5",
|
"sass": "^1.77.6",
|
||||||
"tsx": "^4.15.6",
|
"typescript": "^5.5.3",
|
||||||
"typescript": "^5.4.5",
|
|
||||||
"unplugin-auto-import": "^0.17.6"
|
"unplugin-auto-import": "^0.17.6"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
4460
pnpm-lock.yaml
generated
4460
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -1,44 +0,0 @@
|
|||||||
import { readFileSync, writeFileSync } from "node:fs";
|
|
||||||
import { parse, stringify } from "@iarna/toml";
|
|
||||||
|
|
||||||
type BumpMethod = "patch" | "minor" | "major";
|
|
||||||
|
|
||||||
const bumpVersion = (currentVersion: string) => {
|
|
||||||
const method = <BumpMethod>process.argv[2] || "patch";
|
|
||||||
|
|
||||||
const parts = currentVersion.split(".");
|
|
||||||
let major = Number.parseInt(parts[0], 10);
|
|
||||||
let minor = Number.parseInt(parts[1], 10);
|
|
||||||
let patch = Number.parseInt(parts[2], 10);
|
|
||||||
|
|
||||||
if (method === "patch") {
|
|
||||||
patch += 1;
|
|
||||||
} else if (method === "minor") {
|
|
||||||
minor += 1;
|
|
||||||
patch = 0;
|
|
||||||
} else if (method === "major") {
|
|
||||||
major += 1;
|
|
||||||
minor = 0;
|
|
||||||
patch = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
const newVersion = `${major}.${minor}.${patch}`;
|
|
||||||
|
|
||||||
console.log(`Version bumped to ${newVersion}`);
|
|
||||||
|
|
||||||
return newVersion;
|
|
||||||
};
|
|
||||||
|
|
||||||
const packageJson = JSON.parse(readFileSync("./package.json", "utf-8"));
|
|
||||||
const tauriConfig = JSON.parse(readFileSync("./src-tauri/tauri.conf.json", "utf-8"));
|
|
||||||
const tauriToml = parse(readFileSync("./src-tauri/Cargo.toml", "utf-8"));
|
|
||||||
|
|
||||||
packageJson.version = bumpVersion(packageJson.version);
|
|
||||||
tauriConfig.version = bumpVersion(tauriConfig.version);
|
|
||||||
|
|
||||||
// @ts-expect-error No interface for parsed TOML
|
|
||||||
tauriToml.package.version = bumpVersion(tauriToml.package.version);
|
|
||||||
|
|
||||||
writeFileSync("./package.json", JSON.stringify(packageJson, null, "\t"));
|
|
||||||
writeFileSync("./src-tauri/tauri.conf.json", JSON.stringify(tauriConfig, null, "\t"));
|
|
||||||
writeFileSync("./src-tauri/Cargo.toml", stringify(tauriToml));
|
|
155
src-tauri/Cargo.lock
generated
155
src-tauri/Cargo.lock
generated
@@ -936,6 +936,16 @@ version = "1.0.1"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5"
|
checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "erased-serde"
|
||||||
|
version = "0.4.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "24e2389d65ab4fab27dc2a5de7b191e1f6617d1f1c8855c0dc569c94a4cbb18d"
|
||||||
|
dependencies = [
|
||||||
|
"serde",
|
||||||
|
"typeid",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "errno"
|
name = "errno"
|
||||||
version = "0.3.9"
|
version = "0.3.9"
|
||||||
@@ -2212,6 +2222,19 @@ version = "0.1.14"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb"
|
checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "notify-rust"
|
||||||
|
version = "4.11.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "5312f837191c317644f313f7b2b39f9cb1496570c74f7c17152dd3961219551f"
|
||||||
|
dependencies = [
|
||||||
|
"log",
|
||||||
|
"mac-notification-sys",
|
||||||
|
"serde",
|
||||||
|
"tauri-winrt-notification",
|
||||||
|
"zbus",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nu-ansi-term"
|
name = "nu-ansi-term"
|
||||||
version = "0.46.0"
|
version = "0.46.0"
|
||||||
@@ -2270,12 +2293,13 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nuxtor"
|
name = "nuxtor"
|
||||||
version = "0.0.1"
|
version = "0.0.3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"tauri",
|
"tauri",
|
||||||
"tauri-build",
|
"tauri-build",
|
||||||
|
"tauri-plugin-fs",
|
||||||
"tauri-plugin-notification",
|
"tauri-plugin-notification",
|
||||||
"tauri-plugin-os",
|
"tauri-plugin-os",
|
||||||
"tauri-plugin-shell",
|
"tauri-plugin-shell",
|
||||||
@@ -3194,6 +3218,17 @@ dependencies = [
|
|||||||
"serde_derive",
|
"serde_derive",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "serde-untagged"
|
||||||
|
version = "0.1.6"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "2676ba99bd82f75cae5cbd2c8eda6fa0b8760f18978ea840e980dd5567b5c5b6"
|
||||||
|
dependencies = [
|
||||||
|
"erased-serde",
|
||||||
|
"serde",
|
||||||
|
"typeid",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_derive"
|
name = "serde_derive"
|
||||||
version = "1.0.203"
|
version = "1.0.203"
|
||||||
@@ -3641,14 +3676,14 @@ checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tauri"
|
name = "tauri"
|
||||||
version = "2.0.0-beta.22"
|
version = "2.0.0-beta.23"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5a258ecc5ac7ddade525f512c4962fd01cd0f5265e917b4572579c32c027bb31"
|
checksum = "68725c4f17f62f0fb1fa2eecaf391200bf00a9414c84f30783ddca10570690c3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"bytes",
|
"bytes",
|
||||||
"cocoa",
|
"cocoa",
|
||||||
"dirs-next",
|
"dirs",
|
||||||
"dunce",
|
"dunce",
|
||||||
"embed_plist",
|
"embed_plist",
|
||||||
"futures-util",
|
"futures-util",
|
||||||
@@ -3685,18 +3720,18 @@ dependencies = [
|
|||||||
"webkit2gtk",
|
"webkit2gtk",
|
||||||
"webview2-com",
|
"webview2-com",
|
||||||
"window-vibrancy",
|
"window-vibrancy",
|
||||||
"windows 0.56.0",
|
"windows 0.57.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tauri-build"
|
name = "tauri-build"
|
||||||
version = "2.0.0-beta.17"
|
version = "2.0.0-beta.18"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "82b964bb6d03d97e24e12f896aab463b02a3c2ff76a60f728cc37b5548eb470e"
|
checksum = "b1822847744f663babbfc8b7532a104734e9cf99e3408bba7109018bf9177917"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"cargo_toml",
|
"cargo_toml",
|
||||||
"dirs-next",
|
"dirs",
|
||||||
"glob",
|
"glob",
|
||||||
"heck 0.5.0",
|
"heck 0.5.0",
|
||||||
"json-patch",
|
"json-patch",
|
||||||
@@ -3712,9 +3747,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tauri-codegen"
|
name = "tauri-codegen"
|
||||||
version = "2.0.0-beta.17"
|
version = "2.0.0-beta.18"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "3529cfa977ed7c097f2a5e8da19ecffbe61982450a6c819e6165b6d0cfd3dd3a"
|
checksum = "8e36fa3c2e3bd935827fef1eed459885414fb27c82f687d8b9a15112c8a5c8f0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base64 0.22.1",
|
"base64 0.22.1",
|
||||||
"brotli",
|
"brotli",
|
||||||
@@ -3739,9 +3774,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tauri-macros"
|
name = "tauri-macros"
|
||||||
version = "2.0.0-beta.17"
|
version = "2.0.0-beta.18"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "36f97dd80334f29314aa5f40b5fad10cb9feffd08e5a5324fd728613841e5d33"
|
checksum = "34aba4bed4648c3cb17d421af5783c7c29a033a94ab8597ef3791dadea69289d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"heck 0.5.0",
|
"heck 0.5.0",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
@@ -3753,9 +3788,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tauri-plugin"
|
name = "tauri-plugin"
|
||||||
version = "2.0.0-beta.17"
|
version = "2.0.0-beta.18"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7c8385fd0a4f661f5652b0d9e2d7256187d553bb174f88564d10ebcfa6a3af53"
|
checksum = "431ac9636bf81e7a04042399918ffa6b9d2413926dabc9366a24f6b487f64653"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"glob",
|
"glob",
|
||||||
@@ -3769,31 +3804,48 @@ dependencies = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tauri-plugin-notification"
|
name = "tauri-plugin-fs"
|
||||||
version = "2.0.0-beta.7"
|
version = "2.0.0-beta.10"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "39ac3fe3293a3646317fd2d62f5c67a96ed911346d2969261dbd0a755dae8b55"
|
checksum = "17e1f9fb6054cbc48c9e0fda7e8c8aeaccddb4fe880163473555beeed580010e"
|
||||||
|
dependencies = [
|
||||||
|
"anyhow",
|
||||||
|
"glob",
|
||||||
|
"schemars",
|
||||||
|
"serde",
|
||||||
|
"serde_json",
|
||||||
|
"serde_repr",
|
||||||
|
"tauri",
|
||||||
|
"tauri-plugin",
|
||||||
|
"thiserror",
|
||||||
|
"url",
|
||||||
|
"uuid",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "tauri-plugin-notification"
|
||||||
|
version = "2.0.0-beta.9"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "4eef9166e4f50b295ef1fb5ad0c4039a34a215857bc3499bbb0586b438e88620"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"log",
|
"log",
|
||||||
"mac-notification-sys",
|
"notify-rust",
|
||||||
"rand 0.8.5",
|
"rand 0.8.5",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"serde_repr",
|
"serde_repr",
|
||||||
"tauri",
|
"tauri",
|
||||||
"tauri-plugin",
|
"tauri-plugin",
|
||||||
"tauri-winrt-notification",
|
|
||||||
"thiserror",
|
"thiserror",
|
||||||
"time",
|
"time",
|
||||||
"url",
|
"url",
|
||||||
"zbus",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tauri-plugin-os"
|
name = "tauri-plugin-os"
|
||||||
version = "2.0.0-beta.6"
|
version = "2.0.0-beta.7"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b9ae3c8aeb113ce614cc36a43b1061fdf64381f7635d02c390052ce7579ec628"
|
checksum = "2946635d31de19ed4191f1c556da20d1257f4667a1bac03852d9bb4be9fa8ffa"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"gethostname",
|
"gethostname",
|
||||||
"log",
|
"log",
|
||||||
@@ -3809,9 +3861,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tauri-plugin-shell"
|
name = "tauri-plugin-shell"
|
||||||
version = "2.0.0-beta.7"
|
version = "2.0.0-beta.8"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f8675bf7ab71f571a99192d0685ae870eb7af1264bdbbb66a1d655609f6c7ebd"
|
checksum = "85f0347c4d056cca543b5f2dd74c33b64182553e03d1dba2738fe2a95f0ec9ef"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"encoding_rs",
|
"encoding_rs",
|
||||||
"log",
|
"log",
|
||||||
@@ -3830,9 +3882,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tauri-runtime"
|
name = "tauri-runtime"
|
||||||
version = "2.0.0-beta.18"
|
version = "2.0.0-beta.19"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d7dc96172a43536236ab55b7da7b8461bf75810985e668589e2395cb476937cb"
|
checksum = "e5fa872242a432195b814e87f91ce10f293ae5b01fbd1eb139455496260aa7c9"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"dpi",
|
"dpi",
|
||||||
"gtk",
|
"gtk",
|
||||||
@@ -3844,14 +3896,14 @@ dependencies = [
|
|||||||
"tauri-utils",
|
"tauri-utils",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
"url",
|
"url",
|
||||||
"windows 0.56.0",
|
"windows 0.57.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tauri-runtime-wry"
|
name = "tauri-runtime-wry"
|
||||||
version = "2.0.0-beta.18"
|
version = "2.0.0-beta.19"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5d4fd913b1f14a9b618c7f3ae35656d3aa759767fcb95b72006357c12b9d0b09"
|
checksum = "3ad6d5ef3c05d1c4b6cf97b9eac1ca1ad8ff2a7057ad0a92b3e4c476f009341e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cocoa",
|
"cocoa",
|
||||||
"gtk",
|
"gtk",
|
||||||
@@ -3867,15 +3919,15 @@ dependencies = [
|
|||||||
"url",
|
"url",
|
||||||
"webkit2gtk",
|
"webkit2gtk",
|
||||||
"webview2-com",
|
"webview2-com",
|
||||||
"windows 0.56.0",
|
"windows 0.57.0",
|
||||||
"wry",
|
"wry",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tauri-utils"
|
name = "tauri-utils"
|
||||||
version = "2.0.0-beta.17"
|
version = "2.0.0-beta.18"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "4f24a9c20d676a3f025331cc1c3841256ba88c9f25fb7fae709d2b3089c50d90"
|
checksum = "1f81a672883c9a67eb24727c99cce583625c919a5fb696c661603b426c463c72"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"brotli",
|
"brotli",
|
||||||
"cargo_metadata",
|
"cargo_metadata",
|
||||||
@@ -3895,6 +3947,7 @@ dependencies = [
|
|||||||
"schemars",
|
"schemars",
|
||||||
"semver",
|
"semver",
|
||||||
"serde",
|
"serde",
|
||||||
|
"serde-untagged",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"serde_with",
|
"serde_with",
|
||||||
"swift-rs",
|
"swift-rs",
|
||||||
@@ -3917,9 +3970,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tauri-winrt-notification"
|
name = "tauri-winrt-notification"
|
||||||
version = "0.3.1"
|
version = "0.2.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "36778770f6c7f9a60ec08fcd2d923915a4e9015ea36d4dde80ba573345312f0a"
|
checksum = "f89f5fb70d6f62381f5d9b2ba9008196150b40b75f3068eb24faeddf1c686871"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"quick-xml",
|
"quick-xml",
|
||||||
"windows 0.56.0",
|
"windows 0.56.0",
|
||||||
@@ -4228,6 +4281,12 @@ version = "0.2.5"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"
|
checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "typeid"
|
||||||
|
version = "1.0.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "059d83cc991e7a42fc37bd50941885db0888e34209f8cfd9aab07ddec03bc9cf"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "typenum"
|
name = "typenum"
|
||||||
version = "1.17.0"
|
version = "1.17.0"
|
||||||
@@ -4565,16 +4624,16 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "webview2-com"
|
name = "webview2-com"
|
||||||
version = "0.30.0"
|
version = "0.31.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5c914dd492a52f0377bef56fd1b6e74a79090f9ee631d625d5b505a00e4538b6"
|
checksum = "6516cfa64c6b3212686080eeec378e662c2af54bb2a5b2a22749673f5cb2226f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"webview2-com-macros",
|
"webview2-com-macros",
|
||||||
"webview2-com-sys",
|
"webview2-com-sys",
|
||||||
"windows 0.56.0",
|
"windows 0.57.0",
|
||||||
"windows-core 0.56.0",
|
"windows-core 0.57.0",
|
||||||
"windows-implement 0.56.0",
|
"windows-implement 0.57.0",
|
||||||
"windows-interface 0.56.0",
|
"windows-interface 0.57.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -4590,13 +4649,13 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "webview2-com-sys"
|
name = "webview2-com-sys"
|
||||||
version = "0.30.0"
|
version = "0.31.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "2a46bcf03482ec28eeb764ca788f67998cde4213adfbbfa90462622058530f5e"
|
checksum = "c76d5b77320ff155660be1df3e6588bc85c75f1a9feef938cc4dc4dd60d1d7cf"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"thiserror",
|
"thiserror",
|
||||||
"windows 0.56.0",
|
"windows 0.57.0",
|
||||||
"windows-core 0.56.0",
|
"windows-core 0.57.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -5005,9 +5064,9 @@ checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wry"
|
name = "wry"
|
||||||
version = "0.40.1"
|
version = "0.41.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1fa597526af53f310a8e6218630c5024fdde8271f229e70d7d2fc70b52b8fb1e"
|
checksum = "68b00c945786b02d7805d09a969fa36d0eee4e0bd4fb3ec2a79d2bf45a1b44cd"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base64 0.22.1",
|
"base64 0.22.1",
|
||||||
"block",
|
"block",
|
||||||
@@ -5039,8 +5098,8 @@ dependencies = [
|
|||||||
"webkit2gtk",
|
"webkit2gtk",
|
||||||
"webkit2gtk-sys",
|
"webkit2gtk-sys",
|
||||||
"webview2-com",
|
"webview2-com",
|
||||||
"windows 0.56.0",
|
"windows 0.57.0",
|
||||||
"windows-core 0.56.0",
|
"windows-core 0.57.0",
|
||||||
"windows-version",
|
"windows-version",
|
||||||
"x11-dl",
|
"x11-dl",
|
||||||
]
|
]
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "nuxtor"
|
name = "nuxtor"
|
||||||
version = "0.0.2"
|
version = "0.0.3"
|
||||||
description = "Starter template for Nuxt 3 with Tauri"
|
description = "Starter template for Nuxt 3 with Tauri"
|
||||||
authors = [ "NicolaSpadari" ]
|
authors = [ "NicolaSpadari" ]
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
@@ -16,17 +16,18 @@ crate-type = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[build-dependencies.tauri-build]
|
[build-dependencies.tauri-build]
|
||||||
version = "2.0.0-beta"
|
version = "2.0.0-beta.18"
|
||||||
features = [ ]
|
features = [ ]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
tauri-plugin-shell = "2.0.0-beta"
|
tauri-plugin-shell = "2.0.0-beta.8"
|
||||||
tauri-plugin-notification = "2.0.0-beta"
|
tauri-plugin-notification = "2.0.0-beta.9"
|
||||||
tauri-plugin-os = "2.0.0-beta"
|
tauri-plugin-os = "2.0.0-beta.7"
|
||||||
|
tauri-plugin-fs = "2.0.0-beta.10"
|
||||||
serde_json = "1"
|
serde_json = "1"
|
||||||
|
|
||||||
[dependencies.tauri]
|
[dependencies.tauri]
|
||||||
version = "2.0.0-beta"
|
version = "2.0.0-beta.23"
|
||||||
features = [ ]
|
features = [ ]
|
||||||
|
|
||||||
[dependencies.serde]
|
[dependencies.serde]
|
||||||
|
@@ -34,6 +34,8 @@
|
|||||||
"os:allow-arch",
|
"os:allow-arch",
|
||||||
"os:allow-family",
|
"os:allow-family",
|
||||||
"os:allow-version",
|
"os:allow-version",
|
||||||
"os:allow-locale"
|
"os:allow-locale",
|
||||||
|
"fs:allow-document-read",
|
||||||
|
"fs:allow-document-write"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
|||||||
{"main":{"identifier":"main","description":"Capabilities for the main window","local":true,"windows":["main"],"permissions":["path:default","event:default","window:default","app:default","resources:default","menu:default","shell:allow-open",{"identifier":"shell:allow-execute","allow":[{"args":["-c",{"validator":"\\S+"}],"cmd":"sh","name":"exec-sh","sidecar":false}]},"notification:default","os:allow-platform","os:allow-arch","os:allow-family","os:allow-version","os:allow-locale"]}}
|
{"main":{"identifier":"main","description":"Capabilities for the main window","local":true,"windows":["main"],"permissions":["path:default","event:default","window:default","app:default","resources:default","menu:default","shell:allow-open",{"identifier":"shell:allow-execute","allow":[{"args":["-c",{"validator":"\\S+"}],"cmd":"sh","name":"exec-sh","sidecar":false}]},"notification:default","os:allow-platform","os:allow-arch","os:allow-family","os:allow-version","os:allow-locale","fs:allow-document-read","fs:allow-document-write"]}}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -4,6 +4,7 @@ pub fn run() {
|
|||||||
.plugin(tauri_plugin_shell::init())
|
.plugin(tauri_plugin_shell::init())
|
||||||
.plugin(tauri_plugin_notification::init())
|
.plugin(tauri_plugin_notification::init())
|
||||||
.plugin(tauri_plugin_os::init())
|
.plugin(tauri_plugin_os::init())
|
||||||
|
.plugin(tauri_plugin_fs::init())
|
||||||
.run(tauri::generate_context!())
|
.run(tauri::generate_context!())
|
||||||
.expect("error while running tauri application");
|
.expect("error while running tauri application");
|
||||||
}
|
}
|
@@ -32,7 +32,7 @@
|
|||||||
"devUrl": "http://localhost:3000"
|
"devUrl": "http://localhost:3000"
|
||||||
},
|
},
|
||||||
"productName": "Nuxtor",
|
"productName": "Nuxtor",
|
||||||
"version": "0.0.2",
|
"version": "0.0.3",
|
||||||
"identifier": "com.nicolaspadari.nuxtor",
|
"identifier": "com.nicolaspadari.nuxtor",
|
||||||
"plugins": {},
|
"plugins": {},
|
||||||
"app": {
|
"app": {
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<button transition-colors gap-1 rounded-md bg-emerald-500 px-3.5 py-2.5 text-sm text-white font-semibold shadow-sm hover="bg-emerald-600" focus-visible="outline-2 outline-emerald-600 outline-offset-2 outline">
|
<button class="disabled:(cursor-not-allowed opacity-60)" gap-1 rounded-md bg-emerald-500 px-3.5 py-2.5 text-sm text-white font-semibold shadow-sm transition-colors hover="bg-emerald-600" focus-visible="outline-2 outline-emerald-600 outline-offset-2 outline">
|
||||||
<slot />
|
<slot />
|
||||||
</button>
|
</button>
|
||||||
</template>
|
</template>
|
||||||
|
@@ -21,8 +21,8 @@
|
|||||||
<NavLink to="/os">
|
<NavLink to="/os">
|
||||||
OS Informations
|
OS Informations
|
||||||
</NavLink>
|
</NavLink>
|
||||||
<NavLink to="/foo">
|
<NavLink to="/file">
|
||||||
404
|
File
|
||||||
</NavLink>
|
</NavLink>
|
||||||
</div>
|
</div>
|
||||||
<div hidden lg="flex flex-1 justify-end">
|
<div hidden lg="flex flex-1 justify-end">
|
||||||
@@ -36,7 +36,7 @@
|
|||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
const { showSidebar } = useSidebar();
|
const { showSidebar } = useSidebar();
|
||||||
const tauriVersion = await getTauriVersion();
|
const tauriVersion = await useTauriAppGetTauriVersion();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
@@ -44,7 +44,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
const tauriVersion = await getTauriVersion();
|
const tauriVersion = await useTauriAppGetTauriVersion();
|
||||||
const { showSidebar } = useSidebar();
|
const { showSidebar } = useSidebar();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@@ -3,24 +3,45 @@ import * as tauriApp from "@tauri-apps/api/app";
|
|||||||
import * as tauriShell from "@tauri-apps/plugin-shell";
|
import * as tauriShell from "@tauri-apps/plugin-shell";
|
||||||
import * as tauriOs from "@tauri-apps/plugin-os";
|
import * as tauriOs from "@tauri-apps/plugin-os";
|
||||||
import * as tauriNotification from "@tauri-apps/plugin-notification";
|
import * as tauriNotification from "@tauri-apps/plugin-notification";
|
||||||
|
import * as tauriFs from "@tauri-apps/plugin-fs";
|
||||||
|
|
||||||
export default defineNuxtModule({
|
const capitalize = (name: string) => {
|
||||||
|
return name.charAt(0).toUpperCase() + name.slice(1);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default defineNuxtModule<ModuleOptions>({
|
||||||
meta: {
|
meta: {
|
||||||
name: "nuxt-tauri",
|
name: "nuxt-tauri",
|
||||||
configKey: "nuxt-tauri"
|
configKey: "nuxt-tauri"
|
||||||
},
|
},
|
||||||
setup() {
|
defaults: {
|
||||||
|
prefix: "useTauri"
|
||||||
|
},
|
||||||
|
setup(options) {
|
||||||
Object.keys(tauriApp).filter((name) => name !== "default").forEach((name) => {
|
Object.keys(tauriApp).filter((name) => name !== "default").forEach((name) => {
|
||||||
addImports({ from: "@tauri-apps/api/app", name });
|
const prefix = `${options.prefix}App` || "";
|
||||||
|
const as = prefix ? prefix + capitalize(name) : name;
|
||||||
|
addImports({ from: "@tauri-apps/api/app", name, as });
|
||||||
});
|
});
|
||||||
Object.keys(tauriShell).filter((name) => name !== "default").forEach((name) => {
|
Object.keys(tauriShell).filter((name) => name !== "default").forEach((name) => {
|
||||||
addImports({ from: "@tauri-apps/plugin-shell", name });
|
const prefix = `${options.prefix}Shell` || "";
|
||||||
|
const as = prefix ? prefix + capitalize(name) : name;
|
||||||
|
addImports({ from: "@tauri-apps/plugin-shell", name, as });
|
||||||
});
|
});
|
||||||
Object.keys(tauriOs).filter((name) => name !== "default").forEach((name) => {
|
Object.keys(tauriOs).filter((name) => name !== "default").forEach((name) => {
|
||||||
addImports({ from: "@tauri-apps/plugin-os", name });
|
const prefix = `${options.prefix}Os` || "";
|
||||||
|
const as = prefix ? prefix + capitalize(name) : name;
|
||||||
|
addImports({ from: "@tauri-apps/plugin-os", name, as });
|
||||||
});
|
});
|
||||||
Object.keys(tauriNotification).filter((name) => name !== "default").forEach((name) => {
|
Object.keys(tauriNotification).filter((name) => name !== "default").forEach((name) => {
|
||||||
addImports({ from: "@tauri-apps/plugin-notification", name });
|
const prefix = `${options.prefix}Notification` || "";
|
||||||
|
const as = prefix ? prefix + capitalize(name) : name;
|
||||||
|
addImports({ from: "@tauri-apps/plugin-notification", name, as });
|
||||||
|
});
|
||||||
|
Object.keys(tauriFs).filter((name) => name !== "default").forEach((name) => {
|
||||||
|
const prefix = `${options.prefix}Fs` || "";
|
||||||
|
const as = prefix ? prefix + capitalize(name) : name;
|
||||||
|
addImports({ from: "@tauri-apps/plugin-fs", name, as });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@@ -34,7 +34,7 @@
|
|||||||
const result = ref("");
|
const result = ref("");
|
||||||
|
|
||||||
const sendCommand = async () => {
|
const sendCommand = async () => {
|
||||||
const response = await Command.create("exec-sh", [
|
const response = await useTauriShellCommand.create("exec-sh", [
|
||||||
"-c",
|
"-c",
|
||||||
input.value
|
input.value
|
||||||
]).execute();
|
]).execute();
|
||||||
|
69
src/pages/file.vue
Normal file
69
src/pages/file.vue
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
<template>
|
||||||
|
<LayoutTile
|
||||||
|
title="File System"
|
||||||
|
description="Access the file system. For this demo the only allowed permission is read/write to the Documents folder (no sub directories)."
|
||||||
|
>
|
||||||
|
<form @submit.prevent="createDummyFile()">
|
||||||
|
<div mx-auto max-w-xl lg="mr-0 max-w-lg">
|
||||||
|
<div grid grid-cols-1 gap-x-8 gap-y-6>
|
||||||
|
<div>
|
||||||
|
<label for="filename-input" block text-sm text-white font-semibold leading-6>
|
||||||
|
Text file name
|
||||||
|
<span text-neutral-400 font-light>(with extension)</span>
|
||||||
|
</label>
|
||||||
|
<div mt="2.5">
|
||||||
|
<input id="filename-input" v-model="fileName" type="text" name="filename-input" block w-full border-0 rounded-md bg="white/5" px="3.5" py-2 text-white shadow-sm ring-1 ring="white/10" ring-inset sm="text-sm leading-6" focus="ring-2 ring-emerald-500 ring-inset">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div mt-8>
|
||||||
|
<label for="filecontent-input" block text-sm text-white font-semibold leading-6>File content</label>
|
||||||
|
<div mt="2.5">
|
||||||
|
<textarea id="filecontent-input" v-model="fileContent" name="filecontent-input" rows="10" block w-full border-0 rounded-md bg="white/5" px="3.5" py-2 text-white shadow-sm ring-1 ring="white/10" ring-inset sm="text-sm leading-6" focus="ring-2 ring-emerald-500 ring-inset" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div flex justify-end gap-3>
|
||||||
|
<div v-if="done" h-full flex-center text-emerald-400 space-x-1>
|
||||||
|
<p>Done</p>
|
||||||
|
<i-heroicons-solid-check size-4 />
|
||||||
|
</div>
|
||||||
|
<div v-if="error" h-full flex-center text-red-400 space-x-1>
|
||||||
|
<p>Error</p>
|
||||||
|
<i-heroicons-solid-exclamation-triangle size-4 />
|
||||||
|
</div>
|
||||||
|
<Btn type="submit" :disabled="fileName === ''">
|
||||||
|
Create file
|
||||||
|
</Btn>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</LayoutTile>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
const fileName = ref("");
|
||||||
|
const fileContent = ref("");
|
||||||
|
const done = ref(false);
|
||||||
|
const error = ref(false);
|
||||||
|
|
||||||
|
const createDummyFile = async () => {
|
||||||
|
try {
|
||||||
|
const fileExists = await useTauriFsExists(fileName.value, {
|
||||||
|
baseDir: useTauriFsBaseDirectory.Document
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!fileExists) {
|
||||||
|
await useTauriFsWriteTextFile(fileName.value, fileContent.value, {
|
||||||
|
baseDir: useTauriFsBaseDirectory.Document
|
||||||
|
});
|
||||||
|
done.value = true;
|
||||||
|
fileName.value = fileContent.value = "";
|
||||||
|
setTimeout(() => done.value = false, 3000);
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
console.error("Error creating file:", err);
|
||||||
|
error.value = true;
|
||||||
|
setTimeout(() => error.value = false, 3000);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
@@ -40,15 +40,15 @@
|
|||||||
const permissionError = ref(false);
|
const permissionError = ref(false);
|
||||||
|
|
||||||
const createNotification = async () => {
|
const createNotification = async () => {
|
||||||
let permissionGranted = await isPermissionGranted();
|
let permissionGranted = await useTauriNotificationIsPermissionGranted();
|
||||||
|
|
||||||
if (!permissionGranted) {
|
if (!permissionGranted) {
|
||||||
const permission = await requestPermission();
|
const permission = await useTauriNotificationRequestPermission();
|
||||||
permissionGranted = permission === "granted";
|
permissionGranted = permission === "granted";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (permissionGranted) {
|
if (permissionGranted) {
|
||||||
sendNotification({
|
useTauriNotificationSendNotification({
|
||||||
title: notificationTitle.value,
|
title: notificationTitle.value,
|
||||||
body: notificationBody.value
|
body: notificationBody.value
|
||||||
});
|
});
|
||||||
|
@@ -14,8 +14,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
const currentPlatform = await platform();
|
const currentPlatform = await useTauriOsPlatform();
|
||||||
const currentArch = await arch();
|
const currentArch = await useTauriOsArch();
|
||||||
const currentVersion = await version();
|
const currentVersion = await useTauriOsVersion();
|
||||||
const currentLocale = await locale() || "Not detectable";
|
const currentLocale = await useTauriOsLocale() || "Not detectable";
|
||||||
</script>
|
</script>
|
||||||
|
4
types/global.d.ts
vendored
4
types/global.d.ts
vendored
@@ -1,3 +1,3 @@
|
|||||||
declare interface MyTest {
|
declare interface ModuleOptions {
|
||||||
text: string
|
prefix: false | string
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user