Update to tauri v2

This commit is contained in:
Nicola Spadari
2024-06-16 02:29:59 +02:00
parent 93877e5f1f
commit 7b71c8bca9
14 changed files with 6114 additions and 1269 deletions

View File

@@ -1,3 +1,8 @@
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",
@@ -15,9 +20,6 @@ export default defineNuxtConfig({
bodyAttrs: { bodyAttrs: {
class: "font-text antialiased" class: "font-text antialiased"
}, },
link: [
{ rel: "shortcut-icon", href: "/favicon.svg" }
],
noscript: [ noscript: [
{ children: "JavaScript is required to run this project" } { children: "JavaScript is required to run this project" }
] ]
@@ -36,15 +38,15 @@ export default defineNuxtConfig({
imports: ["getName", "getVersion", "getTauriVersion"] imports: ["getName", "getVersion", "getTauriVersion"]
}, },
{ {
from: "@tauri-apps/api/shell", from: "@tauri-apps/plugin-shell",
imports: ["Command"] imports: ["Command"]
}, },
{ {
from: "@tauri-apps/api/os", from: "@tauri-apps/plugin-os",
imports: ["platform"] imports: ["platform"]
}, },
{ {
from: "@tauri-apps/api/notification", from: "@tauri-apps/plugin-notification",
imports: ["sendNotification", "requestPermission", "isPermissionGranted"] imports: ["sendNotification", "requestPermission", "isPermissionGranted"]
} }
] ]
@@ -54,11 +56,11 @@ export default defineNuxtConfig({
envPrefix: ["VITE_", "TAURI_"], envPrefix: ["VITE_", "TAURI_"],
server: { server: {
strictPort: true, strictPort: true,
hmr: { hmr: mobile ? {
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/**"]
} }

View File

@@ -20,21 +20,25 @@
"tauri:build": "tauri build" "tauri:build": "tauri build"
}, },
"dependencies": { "dependencies": {
"@tauri-apps/api": "^1" "@tauri-apps/api": ">=2.0.0-beta.13",
"@tauri-apps/plugin-notification": "2.0.0-beta.5",
"@tauri-apps/plugin-os": "2.0.0-beta.5",
"@tauri-apps/plugin-shell": "2.0.0-beta.6"
}, },
"devDependencies": { "devDependencies": {
"@antfu/eslint-config": "^2.21.1", "@antfu/eslint-config": "^2.21.1",
"@iconify-json/heroicons-solid": "^1.1.11", "@iconify-json/heroicons-solid": "^1.1.11",
"@nuxt/eslint": "^0.3.13",
"@tauri-apps/cli": ">=2.0.0-beta.20",
"@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",
"eslint": "8.57.0", "eslint": "8.57.0",
"@nuxt/eslint": "^0.3.13", "internal-ip": "^8.0.0",
"nuxt": "^3.12.1", "nuxt": "^3.12.1",
"sass": "^1.77.5", "sass": "^1.77.5",
"typescript": "^5.4.5", "typescript": "^5.4.5",
"unplugin-auto-import": "^0.17.6", "unplugin-auto-import": "^0.17.6"
"@tauri-apps/cli": "^1"
} }
} }

200
pnpm-lock.yaml generated
View File

@@ -9,8 +9,17 @@ importers:
.: .:
dependencies: dependencies:
'@tauri-apps/api': '@tauri-apps/api':
specifier: ^1 specifier: '>=2.0.0-beta.0'
version: 1.5.6 version: 2.0.0-beta.13
'@tauri-apps/plugin-notification':
specifier: 2.0.0-beta.5
version: 2.0.0-beta.5
'@tauri-apps/plugin-os':
specifier: 2.0.0-beta.5
version: 2.0.0-beta.5
'@tauri-apps/plugin-shell':
specifier: 2.0.0-beta.6
version: 2.0.0-beta.6
devDependencies: devDependencies:
'@antfu/eslint-config': '@antfu/eslint-config':
specifier: ^2.21.1 specifier: ^2.21.1
@@ -22,8 +31,8 @@ importers:
specifier: ^0.3.13 specifier: ^0.3.13
version: 0.3.13(eslint@8.57.0)(nuxt@3.12.1(@parcel/watcher@2.4.1)(@types/node@20.12.7)(@unocss/reset@0.61.0)(encoding@0.1.13)(eslint@8.57.0)(floating-vue@5.2.2(@nuxt/kit@3.12.1(rollup@4.14.3))(vue@3.4.29(typescript@5.4.5)))(ioredis@5.3.2)(optionator@0.9.3)(rollup@4.14.3)(sass@1.77.5)(terser@5.30.3)(typescript@5.4.5)(unocss@0.61.0(@unocss/webpack@0.61.0(rollup@4.14.3)(webpack@5.91.0(esbuild@0.21.5)))(postcss@8.4.38)(rollup@4.14.3)(vite@5.3.1(@types/node@20.12.7)(sass@1.77.5)(terser@5.30.3)))(vite@5.3.1(@types/node@20.12.7)(sass@1.77.5)(terser@5.30.3)))(rollup@4.14.3)(typescript@5.4.5)(vite@5.3.1(@types/node@20.12.7)(sass@1.77.5)(terser@5.30.3)) version: 0.3.13(eslint@8.57.0)(nuxt@3.12.1(@parcel/watcher@2.4.1)(@types/node@20.12.7)(@unocss/reset@0.61.0)(encoding@0.1.13)(eslint@8.57.0)(floating-vue@5.2.2(@nuxt/kit@3.12.1(rollup@4.14.3))(vue@3.4.29(typescript@5.4.5)))(ioredis@5.3.2)(optionator@0.9.3)(rollup@4.14.3)(sass@1.77.5)(terser@5.30.3)(typescript@5.4.5)(unocss@0.61.0(@unocss/webpack@0.61.0(rollup@4.14.3)(webpack@5.91.0(esbuild@0.21.5)))(postcss@8.4.38)(rollup@4.14.3)(vite@5.3.1(@types/node@20.12.7)(sass@1.77.5)(terser@5.30.3)))(vite@5.3.1(@types/node@20.12.7)(sass@1.77.5)(terser@5.30.3)))(rollup@4.14.3)(typescript@5.4.5)(vite@5.3.1(@types/node@20.12.7)(sass@1.77.5)(terser@5.30.3))
'@tauri-apps/cli': '@tauri-apps/cli':
specifier: ^1 specifier: '>=2.0.0-beta.0'
version: 1.5.14 version: 2.0.0-beta.20
'@unocss/eslint-plugin': '@unocss/eslint-plugin':
specifier: ^0.61.0 specifier: ^0.61.0
version: 0.61.0(eslint@8.57.0)(typescript@5.4.5) version: 0.61.0(eslint@8.57.0)(typescript@5.4.5)
@@ -39,6 +48,9 @@ importers:
eslint: eslint:
specifier: 8.57.0 specifier: 8.57.0
version: 8.57.0 version: 8.57.0
internal-ip:
specifier: ^7.0.0
version: 7.0.0
nuxt: nuxt:
specifier: ^3.12.1 specifier: ^3.12.1
version: 3.12.1(@parcel/watcher@2.4.1)(@types/node@20.12.7)(@unocss/reset@0.61.0)(encoding@0.1.13)(eslint@8.57.0)(floating-vue@5.2.2(@nuxt/kit@3.12.1(rollup@4.14.3))(vue@3.4.29(typescript@5.4.5)))(ioredis@5.3.2)(optionator@0.9.3)(rollup@4.14.3)(sass@1.77.5)(terser@5.30.3)(typescript@5.4.5)(unocss@0.61.0(@unocss/webpack@0.61.0(rollup@4.14.3)(webpack@5.91.0(esbuild@0.21.5)))(postcss@8.4.38)(rollup@4.14.3)(vite@5.3.1(@types/node@20.12.7)(sass@1.77.5)(terser@5.30.3)))(vite@5.3.1(@types/node@20.12.7)(sass@1.77.5)(terser@5.30.3)) version: 3.12.1(@parcel/watcher@2.4.1)(@types/node@20.12.7)(@unocss/reset@0.61.0)(encoding@0.1.13)(eslint@8.57.0)(floating-vue@5.2.2(@nuxt/kit@3.12.1(rollup@4.14.3))(vue@3.4.29(typescript@5.4.5)))(ioredis@5.3.2)(optionator@0.9.3)(rollup@4.14.3)(sass@1.77.5)(terser@5.30.3)(typescript@5.4.5)(unocss@0.61.0(@unocss/webpack@0.61.0(rollup@4.14.3)(webpack@5.91.0(esbuild@0.21.5)))(postcss@8.4.38)(rollup@4.14.3)(vite@5.3.1(@types/node@20.12.7)(sass@1.77.5)(terser@5.30.3)))(vite@5.3.1(@types/node@20.12.7)(sass@1.77.5)(terser@5.30.3))
@@ -1304,75 +1316,84 @@ packages:
peerDependencies: peerDependencies:
eslint: '>=8.40.0' eslint: '>=8.40.0'
'@tauri-apps/api@1.5.6': '@tauri-apps/api@2.0.0-beta.13':
resolution: {integrity: sha512-LH5ToovAHnDVe5Qa9f/+jW28I6DeMhos8bNDtBOmmnaDpPmJmYLyHdeDblAWWWYc7KKRDg9/66vMuKyq0WIeFA==} resolution: {integrity: sha512-Np1opKANzRMF3lgJ9gDquBCB9SxlE2lRmNpVx1+L6RyzAmigkuh0ZulT5jMnDA3JLsuSDU135r/s4t/Pmx4atg==}
engines: {node: '>= 14.6.0', npm: '>= 6.6.0', yarn: '>= 1.19.1'} engines: {node: '>= 18', npm: '>= 6.6.0', yarn: '>= 1.19.1'}
'@tauri-apps/cli-darwin-arm64@1.5.14': '@tauri-apps/cli-darwin-arm64@2.0.0-beta.20':
resolution: {integrity: sha512-lxoSOp3KKSqzHJa7iT32dukPGMlfsTuja1xXSgwR8o/fqzpYJY7FY/3ZxesP8HR66FcK+vtqa//HNqeOQ0mHkA==} resolution: {integrity: sha512-oCJOCib7GuYkwkBXx+ekamR8NZZU+2i3MLP+DHpDxK5gS2uhCE+CBkamJkNt6y1x6xdVnwyqZOm5RvN4SRtyIA==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
cpu: [arm64] cpu: [arm64]
os: [darwin] os: [darwin]
'@tauri-apps/cli-darwin-x64@1.5.14': '@tauri-apps/cli-darwin-x64@2.0.0-beta.20':
resolution: {integrity: sha512-EXSwN1n5spfG8FoXuyc90ACtmDJXzaZ1gxyENaq9xEpQoo7j/Q1vb6qXxmr6azKr8zmqY4h08ZFbv3exh93xJg==} resolution: {integrity: sha512-lC5QSnRExedYN4Ds6ZlSvC2PxP8qfIYBJQ5ktf+PJI5gQALdNeVtd6YnTG1ODCEklfLq9WKkGwp7JdALTU5wDA==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
cpu: [x64] cpu: [x64]
os: [darwin] os: [darwin]
'@tauri-apps/cli-linux-arm-gnueabihf@1.5.14': '@tauri-apps/cli-linux-arm-gnueabihf@2.0.0-beta.20':
resolution: {integrity: sha512-Yb8BH/KYR7Tl+de40sZPfrqbhcU3Jlu+UPIrnXt05sjn48xqIps74Xjz8zzVp0TuHxUp8FmIGtCVhQgsbrsvvg==} resolution: {integrity: sha512-nZCeBMHHye5DLOJV5k2w658hnCS+LYaOZ8y/G9l3ei+g0L/HBjlSy6r4simsAT5TG8+l3oCZzLBngfTMdDS/YA==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
cpu: [arm] cpu: [arm]
os: [linux] os: [linux]
'@tauri-apps/cli-linux-arm64-gnu@1.5.14': '@tauri-apps/cli-linux-arm64-gnu@2.0.0-beta.20':
resolution: {integrity: sha512-QrKHP4gRaHiup478rPBZ+BmNd88yze9jMmheoNy9mN1K/aECRmTHO+tWhsxv5moFHZzRhO0QDWxxvTtiaPXaGg==} resolution: {integrity: sha512-B79ISVLPVBgwnCchVqwTKU+vxnFYqxKomcR4rmsvxfs0NVtT5QuNzE1k4NUQnw3966yjwhYR3mnHsSJQSB4Eyw==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
cpu: [arm64] cpu: [arm64]
os: [linux] os: [linux]
'@tauri-apps/cli-linux-arm64-musl@1.5.14': '@tauri-apps/cli-linux-arm64-musl@2.0.0-beta.20':
resolution: {integrity: sha512-Hb1C1VMxmUcyGjW/K/INKF87zzzgLEVRmWZZnQd7M1P4uue4xPyIwUELSdX12Z2jREPgmLW4AXPD0m6wsNu7iw==} resolution: {integrity: sha512-ojIkv/1uZHhcrgfIN8xgn4BBeo/Xg+bnV0wer6lD78zyxkUMWeEZ+u3mae1ejCJNhhaZOxNaUQ67MvDOiGyr5Q==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
cpu: [arm64] cpu: [arm64]
os: [linux] os: [linux]
'@tauri-apps/cli-linux-x64-gnu@1.5.14': '@tauri-apps/cli-linux-x64-gnu@2.0.0-beta.20':
resolution: {integrity: sha512-kD9v/UwPDuhIgq2TJj/s2/7rqk+vmExVV6xHPKI8vVbIvlNAOZqmx3fpxjej1241vhJ/piGd/m6q6YMWGsL0oQ==} resolution: {integrity: sha512-xBy1FNbHKlc7T6pOmFQQPECxJaI5A9QWX7Kb9N64cNVusoOGlvc3xHYkXMS4PTr7xXOT0yiE1Ww2OwDRJ3lYsg==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
cpu: [x64] cpu: [x64]
os: [linux] os: [linux]
'@tauri-apps/cli-linux-x64-musl@1.5.14': '@tauri-apps/cli-linux-x64-musl@2.0.0-beta.20':
resolution: {integrity: sha512-204Drgg9Zx0+THKndqASz4+iPCwqA3gQVF9C0CDIArNXrjPyJjVvW8VP5CHiZYaTNWxlz/ltyxluM6UFWbXNFw==} resolution: {integrity: sha512-+O6zq5jmtUxA1FUAAwF2ywPysy4NRo2Y6G+ESZDkY9XosRwdt5OUjqAsYktZA3AxDMZVei8r9buwTqUwi9ny/g==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
cpu: [x64] cpu: [x64]
os: [linux] os: [linux]
'@tauri-apps/cli-win32-arm64-msvc@1.5.14': '@tauri-apps/cli-win32-arm64-msvc@2.0.0-beta.20':
resolution: {integrity: sha512-sqPSni2MnWNCm+8YZnLdWCclxfSHaYqKuPFSz8q7Tn1G1m/cA9gyPoC1G0esHftY7bu/ZM5lB4kM3I4U0KlLiA==} resolution: {integrity: sha512-RswgMbWyOQcv53CHvIuiuhAh4kKDqaGyZfWD4VlxqX/XhkoF5gsNgr0MxzrY7pmoL+89oVI+fiGVJz4nOQE5vA==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
cpu: [arm64] cpu: [arm64]
os: [win32] os: [win32]
'@tauri-apps/cli-win32-ia32-msvc@1.5.14': '@tauri-apps/cli-win32-ia32-msvc@2.0.0-beta.20':
resolution: {integrity: sha512-8xN8W0zTs8oFsQmvYLxHFeqhzVI7oTaPK1xQMc5gbpFP45jN41c21aCXfjnvzT+h90EfCHUF9EWj2HTEJSb7Iw==} resolution: {integrity: sha512-5lgWmDVXhX3SBGbiv5SduM1yajiRnUEJClWhSdRrEEJeXdsxpCsBEhxYnUnDCEzPKxLLn5fdBv3VrVctJ03csQ==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
cpu: [ia32] cpu: [ia32]
os: [win32] os: [win32]
'@tauri-apps/cli-win32-x64-msvc@1.5.14': '@tauri-apps/cli-win32-x64-msvc@2.0.0-beta.20':
resolution: {integrity: sha512-U0slee5tNM2PYECBpPHavLSwkT3szGMZ+qhcikQQbDan84bQdLn/kHWjyXOgLJs4KSve4+KxcrN+AVqj0VyHnw==} resolution: {integrity: sha512-SuSiiVQTQPSzWlsxQp/NMzWbzDS9TdVDOw7CCfgiG5wnT2GsxzrcIAVN6i7ILsVFLxrjr0bIgPldSJcdcH84Yw==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
cpu: [x64] cpu: [x64]
os: [win32] os: [win32]
'@tauri-apps/cli@1.5.14': '@tauri-apps/cli@2.0.0-beta.20':
resolution: {integrity: sha512-JOSMKymlg116UdEXSj69eg5p1OtZnQkUE0qIGbtNDO1sk3X/KgBN6+oHBW0BzPStp/W0AjBgrMWCqjHPwEpOug==} resolution: {integrity: sha512-707q9uIc2oNrYHd2dtMvxTrpZXVpart5EIktnRymNOpphkLlB6WUBjHD+ga45WqTU6cNGKbYvkKqTNfshNul9Q==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
hasBin: true hasBin: true
'@tauri-apps/plugin-notification@2.0.0-beta.5':
resolution: {integrity: sha512-5zYK2aT1ZvR+LnuwsnTvg28iEhI7FiZSPvBqQ8y6fj28T4oIHVox19Pk4YRyTyfyJN1nZclXxVAqWLSXLI9SKQ==}
'@tauri-apps/plugin-os@2.0.0-beta.5':
resolution: {integrity: sha512-Qfs/clZ9R05J+OVOGkko+9OaYaL+xJaGICeQ1G5CnLFpUdTfMV10D+1nBBauxDdiLU4ay5I0iprJ5aG5GJBunQ==}
'@tauri-apps/plugin-shell@2.0.0-beta.6':
resolution: {integrity: sha512-g3nM9cQQGl7Iv4MvyFuco/aPTiwOI/MixcoKso3VQIg5Aqd64NqR0r+GfsB0qx52txItqzSXwmeaj1eZjO9Q6Q==}
'@trysound/sax@0.2.0': '@trysound/sax@0.2.0':
resolution: {integrity: sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA==} resolution: {integrity: sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA==}
engines: {node: '>=10.13.0'} engines: {node: '>=10.13.0'}
@@ -2366,6 +2387,10 @@ packages:
resolution: {integrity: sha512-WY/3TUME0x3KPYdRRxEJJvXRHV4PyPoUsxtZa78lwItwRQRHhd2U9xOscaT/YTf8uCXIAjeJOFBVEh/7FtD8Xg==} resolution: {integrity: sha512-WY/3TUME0x3KPYdRRxEJJvXRHV4PyPoUsxtZa78lwItwRQRHhd2U9xOscaT/YTf8uCXIAjeJOFBVEh/7FtD8Xg==}
engines: {node: '>=18'} engines: {node: '>=18'}
default-gateway@6.0.3:
resolution: {integrity: sha512-fwSOJsbbNzZ/CUFpqFBqYfYNLj1NbMPm8MMCIzHjC83iSJRBEGmDUxU+WP661BaBQImeC2yHwXtz+P/O9o+XEg==}
engines: {node: '>= 10'}
define-lazy-prop@2.0.0: define-lazy-prop@2.0.0:
resolution: {integrity: sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==} resolution: {integrity: sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==}
engines: {node: '>=8'} engines: {node: '>=8'}
@@ -3112,6 +3137,10 @@ packages:
resolution: {integrity: sha512-QQnnxNyfvmHFIsj7gkPcYymR8Jdw/o7mp5ZFihxn6h8Ci6fh3Dx4E1gPjpQEpIuPo9XVNY/ZUwh4BPMjGyL01g==} resolution: {integrity: sha512-QQnnxNyfvmHFIsj7gkPcYymR8Jdw/o7mp5ZFihxn6h8Ci6fh3Dx4E1gPjpQEpIuPo9XVNY/ZUwh4BPMjGyL01g==}
engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0}
internal-ip@7.0.0:
resolution: {integrity: sha512-qE4TeD4brqC45Vq/+VASeMiS1KRyfBkR6HT2sh9pZVVCzSjPkaCEfKFU+dL0PRv7NHJtvoKN2r82G6wTfzorkw==}
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
ioredis@5.3.2: ioredis@5.3.2:
resolution: {integrity: sha512-1DKMMzlIHM02eBBVOFQ1+AolGjs6+xEcM4PDL7NqOS6szq7H9jSaEkIUH6/a5Hl241LzW6JLSiAbNvTQjUupUA==} resolution: {integrity: sha512-1DKMMzlIHM02eBBVOFQ1+AolGjs6+xEcM4PDL7NqOS6szq7H9jSaEkIUH6/a5Hl241LzW6JLSiAbNvTQjUupUA==}
engines: {node: '>=12.22.0'} engines: {node: '>=12.22.0'}
@@ -3120,6 +3149,14 @@ packages:
resolution: {integrity: sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g==} resolution: {integrity: sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g==}
engines: {node: '>= 12'} engines: {node: '>= 12'}
ip-regex@4.3.0:
resolution: {integrity: sha512-B9ZWJxHHOHUhUjCPrMpLD4xEq35bUTClHM1S6CBU5ixQnkZmwipwgc96vAd7AAGM9TGHvJR+Uss+/Ak6UphK+Q==}
engines: {node: '>=8'}
ipaddr.js@2.2.0:
resolution: {integrity: sha512-Ag3wB2o37wslZS19hZqorUnrnzSkpOVy+IiiDEiTqNubEYpYuHWIf6K4psgN2ZWKExS4xhVCrRVfb/wfW8fWJA==}
engines: {node: '>= 10'}
iron-webcrypto@1.1.0: iron-webcrypto@1.1.0:
resolution: {integrity: sha512-5vgYsCakNlaQub1orZK5QmNYhwYtcllTkZBp5sfIaCqY93Cf6l+v2rtE+E4TMbcfjxDMCdrO8wmp7+ZvhDECLA==} resolution: {integrity: sha512-5vgYsCakNlaQub1orZK5QmNYhwYtcllTkZBp5sfIaCqY93Cf6l+v2rtE+E4TMbcfjxDMCdrO8wmp7+ZvhDECLA==}
@@ -3180,6 +3217,10 @@ packages:
resolution: {integrity: sha512-K55T22lfpQ63N4KEN57jZUAaAYqYHEe8veb/TycJRk9DdSCLLcovXz/mL6mOnhQaZsQGwPhuFopdQIlqGSEjiQ==} resolution: {integrity: sha512-K55T22lfpQ63N4KEN57jZUAaAYqYHEe8veb/TycJRk9DdSCLLcovXz/mL6mOnhQaZsQGwPhuFopdQIlqGSEjiQ==}
engines: {node: '>=18'} engines: {node: '>=18'}
is-ip@3.1.0:
resolution: {integrity: sha512-35vd5necO7IitFPjd/YBeqwWnyDWbuLH9ZXQdMfDA8TEo7pv5X8yfrvVO3xbJbLUlERCMvf6X0hTUamQxCYJ9Q==}
engines: {node: '>=8'}
is-lambda@1.0.1: is-lambda@1.0.1:
resolution: {integrity: sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ==} resolution: {integrity: sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ==}
@@ -3783,6 +3824,14 @@ packages:
resolution: {integrity: sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==} resolution: {integrity: sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==}
engines: {node: '>= 0.8.0'} engines: {node: '>= 0.8.0'}
p-event@4.2.0:
resolution: {integrity: sha512-KXatOjCRXXkSePPb1Nbi0p0m+gQAwdlbhi4wQKJPI1HsMQS9g+Sqp2o+QHziPr7eYJyOZet836KoHEVM1mwOrQ==}
engines: {node: '>=8'}
p-finally@1.0.0:
resolution: {integrity: sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow==}
engines: {node: '>=4'}
p-limit@2.3.0: p-limit@2.3.0:
resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==} resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==}
engines: {node: '>=6'} engines: {node: '>=6'}
@@ -3811,6 +3860,10 @@ packages:
resolution: {integrity: sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==} resolution: {integrity: sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==}
engines: {node: '>=10'} engines: {node: '>=10'}
p-timeout@3.2.0:
resolution: {integrity: sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg==}
engines: {node: '>=8'}
p-try@2.2.0: p-try@2.2.0:
resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==} resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==}
engines: {node: '>=6'} engines: {node: '>=6'}
@@ -6651,50 +6704,62 @@ snapshots:
- supports-color - supports-color
- typescript - typescript
'@tauri-apps/api@1.5.6': {} '@tauri-apps/api@2.0.0-beta.13': {}
'@tauri-apps/cli-darwin-arm64@1.5.14': '@tauri-apps/cli-darwin-arm64@2.0.0-beta.20':
optional: true optional: true
'@tauri-apps/cli-darwin-x64@1.5.14': '@tauri-apps/cli-darwin-x64@2.0.0-beta.20':
optional: true optional: true
'@tauri-apps/cli-linux-arm-gnueabihf@1.5.14': '@tauri-apps/cli-linux-arm-gnueabihf@2.0.0-beta.20':
optional: true optional: true
'@tauri-apps/cli-linux-arm64-gnu@1.5.14': '@tauri-apps/cli-linux-arm64-gnu@2.0.0-beta.20':
optional: true optional: true
'@tauri-apps/cli-linux-arm64-musl@1.5.14': '@tauri-apps/cli-linux-arm64-musl@2.0.0-beta.20':
optional: true optional: true
'@tauri-apps/cli-linux-x64-gnu@1.5.14': '@tauri-apps/cli-linux-x64-gnu@2.0.0-beta.20':
optional: true optional: true
'@tauri-apps/cli-linux-x64-musl@1.5.14': '@tauri-apps/cli-linux-x64-musl@2.0.0-beta.20':
optional: true optional: true
'@tauri-apps/cli-win32-arm64-msvc@1.5.14': '@tauri-apps/cli-win32-arm64-msvc@2.0.0-beta.20':
optional: true optional: true
'@tauri-apps/cli-win32-ia32-msvc@1.5.14': '@tauri-apps/cli-win32-ia32-msvc@2.0.0-beta.20':
optional: true optional: true
'@tauri-apps/cli-win32-x64-msvc@1.5.14': '@tauri-apps/cli-win32-x64-msvc@2.0.0-beta.20':
optional: true optional: true
'@tauri-apps/cli@1.5.14': '@tauri-apps/cli@2.0.0-beta.20':
optionalDependencies: optionalDependencies:
'@tauri-apps/cli-darwin-arm64': 1.5.14 '@tauri-apps/cli-darwin-arm64': 2.0.0-beta.20
'@tauri-apps/cli-darwin-x64': 1.5.14 '@tauri-apps/cli-darwin-x64': 2.0.0-beta.20
'@tauri-apps/cli-linux-arm-gnueabihf': 1.5.14 '@tauri-apps/cli-linux-arm-gnueabihf': 2.0.0-beta.20
'@tauri-apps/cli-linux-arm64-gnu': 1.5.14 '@tauri-apps/cli-linux-arm64-gnu': 2.0.0-beta.20
'@tauri-apps/cli-linux-arm64-musl': 1.5.14 '@tauri-apps/cli-linux-arm64-musl': 2.0.0-beta.20
'@tauri-apps/cli-linux-x64-gnu': 1.5.14 '@tauri-apps/cli-linux-x64-gnu': 2.0.0-beta.20
'@tauri-apps/cli-linux-x64-musl': 1.5.14 '@tauri-apps/cli-linux-x64-musl': 2.0.0-beta.20
'@tauri-apps/cli-win32-arm64-msvc': 1.5.14 '@tauri-apps/cli-win32-arm64-msvc': 2.0.0-beta.20
'@tauri-apps/cli-win32-ia32-msvc': 1.5.14 '@tauri-apps/cli-win32-ia32-msvc': 2.0.0-beta.20
'@tauri-apps/cli-win32-x64-msvc': 1.5.14 '@tauri-apps/cli-win32-x64-msvc': 2.0.0-beta.20
'@tauri-apps/plugin-notification@2.0.0-beta.5':
dependencies:
'@tauri-apps/api': 2.0.0-beta.13
'@tauri-apps/plugin-os@2.0.0-beta.5':
dependencies:
'@tauri-apps/api': 2.0.0-beta.13
'@tauri-apps/plugin-shell@2.0.0-beta.6':
dependencies:
'@tauri-apps/api': 2.0.0-beta.13
'@trysound/sax@0.2.0': {} '@trysound/sax@0.2.0': {}
@@ -6707,7 +6772,7 @@ snapshots:
'@types/eslint-scope@3.7.7': '@types/eslint-scope@3.7.7':
dependencies: dependencies:
'@types/eslint': 8.56.9 '@types/eslint': 8.56.10
'@types/estree': 1.0.5 '@types/estree': 1.0.5
'@types/eslint@8.56.10': '@types/eslint@8.56.10':
@@ -8018,6 +8083,10 @@ snapshots:
bundle-name: 4.1.0 bundle-name: 4.1.0
default-browser-id: 5.0.0 default-browser-id: 5.0.0
default-gateway@6.0.3:
dependencies:
execa: 5.1.1
define-lazy-prop@2.0.0: {} define-lazy-prop@2.0.0: {}
define-lazy-prop@3.0.0: {} define-lazy-prop@3.0.0: {}
@@ -8919,6 +8988,13 @@ snapshots:
ini@4.1.1: {} ini@4.1.1: {}
internal-ip@7.0.0:
dependencies:
default-gateway: 6.0.3
ipaddr.js: 2.2.0
is-ip: 3.1.0
p-event: 4.2.0
ioredis@5.3.2: ioredis@5.3.2:
dependencies: dependencies:
'@ioredis/commands': 1.2.0 '@ioredis/commands': 1.2.0
@@ -8938,6 +9014,10 @@ snapshots:
jsbn: 1.1.0 jsbn: 1.1.0
sprintf-js: 1.1.3 sprintf-js: 1.1.3
ip-regex@4.3.0: {}
ipaddr.js@2.2.0: {}
iron-webcrypto@1.1.0: {} iron-webcrypto@1.1.0: {}
is-alphabetical@1.0.4: {} is-alphabetical@1.0.4: {}
@@ -8986,6 +9066,10 @@ snapshots:
global-directory: 4.0.1 global-directory: 4.0.1
is-path-inside: 4.0.0 is-path-inside: 4.0.0
is-ip@3.1.0:
dependencies:
ip-regex: 4.3.0
is-lambda@1.0.1: {} is-lambda@1.0.1: {}
is-module@1.0.0: {} is-module@1.0.0: {}
@@ -9767,6 +9851,12 @@ snapshots:
prelude-ls: 1.2.1 prelude-ls: 1.2.1
type-check: 0.4.0 type-check: 0.4.0
p-event@4.2.0:
dependencies:
p-timeout: 3.2.0
p-finally@1.0.0: {}
p-limit@2.3.0: p-limit@2.3.0:
dependencies: dependencies:
p-try: 2.2.0 p-try: 2.2.0
@@ -9795,6 +9885,10 @@ snapshots:
dependencies: dependencies:
aggregate-error: 3.1.0 aggregate-error: 3.1.0
p-timeout@3.2.0:
dependencies:
p-finally: 1.0.0
p-try@2.2.0: {} p-try@2.2.0: {}
pacote@18.0.6: pacote@18.0.6:
@@ -11070,7 +11164,7 @@ snapshots:
acorn-import-assertions: 1.9.0(acorn@8.11.3) acorn-import-assertions: 1.9.0(acorn@8.11.3)
browserslist: 4.23.0 browserslist: 4.23.0
chrome-trace-event: 1.0.3 chrome-trace-event: 1.0.3
enhanced-resolve: 5.16.0 enhanced-resolve: 5.17.0
es-module-lexer: 1.5.0 es-module-lexer: 1.5.0
eslint-scope: 5.1.1 eslint-scope: 5.1.1
events: 3.3.0 events: 3.3.0

2112
src-tauri/Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -7,13 +7,15 @@ license = "MIT"
repository = "https://github.com/NicolaSpadari/nuxtor" repository = "https://github.com/NicolaSpadari/nuxtor"
edition = "2021" edition = "2021"
[lib]
name = "nuxtor_lib"
crate-type = ["staticlib", "cdylib", "rlib", "lib"]
[build-dependencies] [build-dependencies]
tauri-build = { version = "1", features = [] } tauri-build = { version = "2.0.0-beta", features = [] }
[dependencies] [dependencies]
tauri = { version = "1", features = ["notification-all", "shell-all", "system-tray"] } tauri = { version = "2.0.0-beta", features = ["tray-icon"] }
tauri-plugin-shell = "2.0.0-beta"
serde = { version = "1", features = ["derive"] } serde = { version = "1", features = ["derive"] }
serde_json = "1" serde_json = "1"
[features]
custom-protocol = [ "tauri/custom-protocol" ]

View File

@@ -0,0 +1,32 @@
{
"$schema": "../gen/schemas/desktop-schema.json",
"identifier": "main",
"description": "Capabilities for the main window",
"windows": [
"main"
],
"permissions": [
"path:default",
"event:default",
"window:default",
"app:default",
"resources:default",
"menu:default",
{
"identifier": "shell:allow-execute",
"allow": [
{
"name": "exec-sh",
"cmd": "sh",
"args": [
"-c",
{
"validator": "\\S+"
}
],
"sidecar": false
}
]
}
]
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +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",{"identifier":"shell:allow-execute","allow":[{"args":["-c",{"validator":"\\S+"}],"cmd":"sh","name":"exec-sh","sidecar":false}]}]}}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

8
src-tauri/src/lib.rs Normal file
View File

@@ -0,0 +1,8 @@
#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
tauri::Builder::default()
.plugin(tauri_plugin_shell::init())
.run(tauri::generate_context!())
.expect("error while running tauri application");
}

View File

@@ -1,28 +1,5 @@
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
use tauri::{CustomMenuItem, SystemTray, SystemTrayMenu, SystemTrayEvent};
fn main() { fn main() {
let opt_quit = CustomMenuItem::new("quit", "Quit"); nuxtor_lib::run();
let tray_menu = SystemTrayMenu::new()
.add_item(opt_quit);
let system_tray = SystemTray::new()
.with_menu(tray_menu);
tauri::Builder::default()
.system_tray(system_tray)
.on_system_tray_event(| _app, event | match event {
SystemTrayEvent::MenuItemClick { id, .. } => {
match id.as_str() {
"quit" => {
std::process::exit(0)
}
_ => {}
}
}
_ => {}
})
.run(tauri::generate_context!())
.expect("error while running tauri application");
} }

View File

@@ -1,23 +1,12 @@
{ {
"package": {
"productName": "nuxtor",
"version": "1.0.0"
},
"build": {
"distDir": "../dist",
"devPath": "http://localhost:3000",
"beforeDevCommand": "pnpm dev",
"beforeBuildCommand": "pnpm generate"
},
"tauri": {
"systemTray": {
"iconPath": "./icons/icon.png",
"iconAsTemplate": true
},
"bundle": { "bundle": {
"active": true, "active": true,
"targets": "all", "targets": "all",
"identifier": "com.nicolaspadari.nuxtor", "windows": {
"certificateThumbprint": null,
"digestAlgorithm": "sha256",
"timestampUrl": ""
},
"icon": [ "icon": [
"icons/32x32.png", "icons/32x32.png",
"icons/128x128.png", "icons/128x128.png",
@@ -31,38 +20,22 @@
"category": "DeveloperTool", "category": "DeveloperTool",
"shortDescription": "", "shortDescription": "",
"longDescription": "", "longDescription": "",
"deb": {},
"macOS": {}, "macOS": {},
"windows": { "linux": {
"certificateThumbprint": null, "deb": {}
"digestAlgorithm": "sha256",
"timestampUrl": ""
} }
}, },
"updater": { "build": {
"active": false "beforeBuildCommand": "pnpm generate",
}, "frontendDist": "../dist",
"allowlist": { "beforeDevCommand": "pnpm dev",
"shell": { "devUrl": "http://localhost:3000"
"all": true,
"open": true,
"scope": [
{
"name": "cmd",
"cmd": "cmd",
"args": ["/C", { "validator": "\\S+" }]
},
{
"name": "pwsh",
"cmd": "pwsh",
"args": ["-Command", { "validator": "\\S+" }]
}
]
},
"notification": {
"all": true
}
}, },
"productName": "nuxtor",
"version": "1.0.0",
"identifier": "com.nicolaspadari.nuxtor",
"plugins": {},
"app": {
"windows": [ "windows": [
{ {
"title": "Nuxtor", "title": "Nuxtor",
@@ -74,6 +47,10 @@
], ],
"security": { "security": {
"csp": null "csp": null
},
"trayIcon": {
"iconPath": "./icons/icon.png",
"iconAsTemplate": true
} }
} }
} }

View File

@@ -1,9 +1,16 @@
<template> <template>
<div text-center space-y-5> <div text-center space-y-5>
Hello from Nuxtor {{ version }} Hello from Nuxtor - Tauri v{{ version }}
<p>Shell command result: {{ result }}</p>
</div> </div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
const version = await getTauriVersion(); const version = await getTauriVersion();
const result = await Command.create('exec-sh', [
'-c',
"echo 'Hello World!'",
]).execute();
</script> </script>