diff --git a/examples/api/yarn.lock b/examples/api/yarn.lock index 8e91be287012..785baaed62bb 100644 --- a/examples/api/yarn.lock +++ b/examples/api/yarn.lock @@ -23,9 +23,9 @@ svelte-hmr "^0.14.7" "@tauri-apps/api@../../tooling/api/dist": - version "1.0.0-rc.0" + version "1.0.0-rc.1" dependencies: - type-fest "2.8.0" + type-fest "2.12.0" debug@^4.3.2: version "4.3.3" @@ -262,10 +262,10 @@ svelte@3.35.0: resolved "https://registry.yarnpkg.com/svelte/-/svelte-3.35.0.tgz#e0d0ba60c4852181c2b4fd851194be6fda493e65" integrity sha512-gknlZkR2sXheu/X+B7dDImwANVvK1R0QGQLd8CNIfxxGPeXBmePnxfzb6fWwTQRsYQG7lYkZXvpXJvxvpsoB7g== -type-fest@2.8.0: - version "2.8.0" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-2.8.0.tgz#39d7c9f9c508df8d6ce1cf5a966b0e6568dcc50d" - integrity sha512-O+V9pAshf9C6loGaH0idwsmugI2LxVNR7DtS40gVo2EXZVYFgz9OuNtOhgHLdHdapOEWNdvz9Ob/eeuaWwwlxA== +type-fest@2.12.0: + version "2.12.0" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-2.12.0.tgz#ce342f58cab9114912f54b493d60ab39c3fc82b6" + integrity sha512-Qe5GRT+n/4GoqCNGGVp5Snapg1Omq3V7irBJB3EaKsp7HWDo5Gv2d/67gfNyV+d5EXD+x/RF5l1h4yJ7qNkcGA== vite@^2.6.4: version "2.6.14" diff --git a/tooling/bundler/Cargo.toml b/tooling/bundler/Cargo.toml index be1e934d19ce..fb0541b934ea 100644 --- a/tooling/bundler/Cargo.toml +++ b/tooling/bundler/Cargo.toml @@ -26,6 +26,7 @@ tauri-utils = { version = "1.0.0-rc.2", path = "../../core/tauri-utils", feature ar = "0.9.0" icns = "0.3" image = "0.24.1" +png = "=0.17.3" libflate = "1.1" md5 = "0.7.0" anyhow = "1.0" diff --git a/tooling/cli/Cargo.lock b/tooling/cli/Cargo.lock index 4159421c7f52..8d5d6afec5a4 100644 --- a/tooling/cli/Cargo.lock +++ b/tooling/cli/Cargo.lock @@ -60,9 +60,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.53" +version = "1.0.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94a45b455c14666b85fc40a019e8ab9eb75e3a124e05494f5397122bc9eb06e0" +checksum = "159bb86af3a200e19a068f4224eae4c8bb2d0fa054c7e5d1cacd5cef95e684cd" [[package]] name = "ar" @@ -224,9 +224,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.72" +version = "1.0.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22a9137b95ea06864e018375b72adfb7db6e6f68cfc8df5a04d00288050485ee" +checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" [[package]] name = "cfg-if" @@ -270,9 +270,9 @@ dependencies = [ [[package]] name = "clap" -version = "3.0.14" +version = "3.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b63edc3f163b3c71ec8aa23f9bd6070f77edbf3d1d198b164afa90ff00e4ec62" +checksum = "5177fac1ab67102d8989464efd043c6ff44191b1557ec1ddd489b4f7e1447e77" dependencies = [ "atty", "bitflags", @@ -287,9 +287,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "3.0.14" +version = "3.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a1132dc3944b31c20dd8b906b3a9f0a5d0243e092d59171414969657ac6aa85" +checksum = "01d42c94ce7c2252681b5fed4d3627cc807b13dfc033246bd05d5b252399000e" dependencies = [ "heck", "proc-macro-error", @@ -835,9 +835,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418d37c8b1d42553c93648be529cb70f920d3baf8ef469b74b9638df426e0b4c" +checksum = "d39cd93900197114fa1fcb7ae84ca742095eed9442088988ae74fa744e930e77" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -934,9 +934,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hmac" -version = "0.12.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddca131f3e7f2ce2df364b57949a9d47915cfbd35e46cfee355ccebbf794d6a2" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ "digest 0.10.3", ] @@ -1250,9 +1250,9 @@ checksum = "7efd1d698db0759e6ef11a7cd44407407399a910c774dd804c64c032da7826ff" [[package]] name = "libc" -version = "0.2.118" +version = "0.2.119" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06e509672465a0504304aa87f9f176f2b2b716ed8fb105ebe5c02dc6dce96a94" +checksum = "1bf2e165bb3457c8e098ea76f3e3bc9db55f87aa90d52d0e6be741470916aaa4" [[package]] name = "libflate" @@ -1351,7 +1351,7 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43935b78ea0886357ab9259bd227879a54b12a83de261c3270aad584500cba2f" dependencies = [ - "getrandom 0.2.4", + "getrandom 0.2.5", "rpassword", "scrypt", ] @@ -1433,7 +1433,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "729eb334247daa1803e0a094d0a5c55711b85571179f5ec6e53eccfdf7008958" dependencies = [ - "getrandom 0.2.4", + "getrandom 0.2.5", ] [[package]] @@ -1670,9 +1670,9 @@ dependencies = [ [[package]] name = "os_pipe" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e3492ebca331b895fe23ed427dce2013d9b2e00c45964f12040b0db38b8ab27" +checksum = "2c92f2b54f081d635c77e7120862d48db8e91f7f21cef23ab1b4fe9971c59f55" dependencies = [ "libc", "winapi 0.3.9", @@ -1714,9 +1714,9 @@ dependencies = [ [[package]] name = "pbkdf2" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4628cc3cf953b82edcd3c1388c5715401420ce5524fedbab426bd5aba017434" +checksum = "271779f35b581956db91a3e55737327a03aa051e90b1c47aeb189508533adfd7" dependencies = [ "digest 0.10.3", ] @@ -2066,7 +2066,7 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" dependencies = [ - "getrandom 0.2.4", + "getrandom 0.2.5", ] [[package]] @@ -2127,7 +2127,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64" dependencies = [ - "getrandom 0.2.4", + "getrandom 0.2.5", "redox_syscall", ] @@ -2199,9 +2199,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.20.3" +version = "0.20.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b323592e3164322f5b193dc4302e4e36cd8d37158a712d664efae1a5c2791700" +checksum = "4fbfeb8d0ddb84706bc597a5574ab8912817c52a397f819e5b614e2265206921" dependencies = [ "log", "ring", @@ -2353,9 +2353,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.5" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0486718e92ec9a68fbed73bb5ef687d71103b142595b406835649bebd33f72c7" +checksum = "a4a3381e03edd24287172047536f20cabde766e2cd3e65e6b00fb3af51c4f38d" [[package]] name = "serde" @@ -2483,9 +2483,9 @@ checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012" [[package]] name = "sha2" -version = "0.10.1" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99c3bd8169c58782adad9290a9af5939994036b76187f7b4f0e6de91dbbfc0ec" +checksum = "55deaec60f81eefe3cce0dc50bda92d6d8e88f2a27df7c5033b42afeb1ed2676" dependencies = [ "cfg-if 1.0.0", "cpufeatures", @@ -2632,6 +2632,7 @@ dependencies = [ "libflate", "md5", "os_pipe", + "png 0.17.3", "regex", "serde", "serde_json", @@ -3015,7 +3016,7 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" dependencies = [ - "getrandom 0.2.4", + "getrandom 0.2.5", "sha1", ] @@ -3287,9 +3288,9 @@ dependencies = [ [[package]] name = "zeroize" -version = "1.5.2" +version = "1.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c88870063c39ee00ec285a2f8d6a966e5b6fb2becc4e8dac77ed0d370ed6006" +checksum = "50344758e2f40e3a1fcfc8f6f91aa57b5f8ebd8d27919fe6451f15aaaf9ee608" [[package]] name = "zip" diff --git a/tooling/cli/Cargo.toml b/tooling/cli/Cargo.toml index e59537bfb662..20b0e3f93f95 100644 --- a/tooling/cli/Cargo.toml +++ b/tooling/cli/Cargo.toml @@ -27,7 +27,7 @@ name = "cargo-tauri" path = "src/main.rs" [dependencies] -clap = { version = "3", features = [ "derive" ] } +clap = { version = "3.1", features = [ "derive" ] } anyhow = "1.0" tauri-bundler = { version = "1.0.0-rc.2", path = "../bundler" } colored = "2.0" diff --git a/tooling/cli/node/index.d.ts b/tooling/cli/node/index.d.ts index f88b00cb59a2..bdc000f04c5f 100644 --- a/tooling/cli/node/index.d.ts +++ b/tooling/cli/node/index.d.ts @@ -3,10 +3,4 @@ /* auto-generated by NAPI-RS */ -export class ExternalObject { - readonly '': { - readonly '': unique symbol - [K: symbol]: T - } -} export function run(args: Array, binName: string | undefined | null, callback: (...args: any[]) => any): void diff --git a/tooling/cli/src/dev.rs b/tooling/cli/src/dev.rs index 1f2dbb88b3df..587cd0b6bfb6 100644 --- a/tooling/cli/src/dev.rs +++ b/tooling/cli/src/dev.rs @@ -12,7 +12,7 @@ use crate::{ }, CommandExt, Result, }; -use clap::{AppSettings, Parser}; +use clap::Parser; use anyhow::Context; use notify::{watcher, DebouncedEvent, RecursiveMode, Watcher}; @@ -33,8 +33,7 @@ use std::{ static BEFORE_DEV: OnceCell>> = OnceCell::new(); #[derive(Debug, Parser)] -#[clap(about = "Tauri dev")] -#[clap(setting(AppSettings::TrailingVarArg))] +#[clap(about = "Tauri dev", trailing_var_arg(true))] pub struct Options { /// Binary to use to run the application #[clap(short, long)] diff --git a/tooling/cli/src/lib.rs b/tooling/cli/src/lib.rs index c64af10d18e4..8c894b2d1550 100644 --- a/tooling/cli/src/lib.rs +++ b/tooling/cli/src/lib.rs @@ -13,7 +13,7 @@ mod interface; mod plugin; mod signer; -use clap::{AppSettings, FromArgMatches, IntoApp, Parser, Subcommand}; +use clap::{FromArgMatches, IntoApp, Parser, Subcommand}; use std::ffi::OsString; @@ -37,11 +37,16 @@ pub struct VersionMetadata { } #[derive(Parser)] -#[clap(author, version, about, bin_name("cargo-tauri"))] -#[clap(global_setting(AppSettings::PropagateVersion))] -#[clap(global_setting(AppSettings::UseLongFormatForHelpSubcommand))] -#[clap(global_setting(AppSettings::NoBinaryName))] -#[clap(setting(AppSettings::SubcommandRequiredElseHelp))] +#[clap( + author, + version, + about, + bin_name("cargo-tauri"), + subcommand_required(true), + arg_required_else_help(true), + propagate_version(true), + no_binary_name(true) +)] struct Cli { #[clap(subcommand)] command: Commands, @@ -58,7 +63,7 @@ enum Commands { } fn format_error(err: clap::Error) -> clap::Error { - let mut app = I::into_app(); + let mut app = I::command(); err.format(&mut app) } @@ -80,8 +85,8 @@ where A: Into + Clone, { let matches = match bin_name { - Some(bin_name) => Cli::into_app().bin_name(bin_name), - None => Cli::into_app(), + Some(bin_name) => Cli::command().bin_name(bin_name), + None => Cli::command(), } .get_matches_from(args); diff --git a/tooling/cli/src/main.rs b/tooling/cli/src/main.rs index 0f088c4a6483..298e8c6eb7fb 100644 --- a/tooling/cli/src/main.rs +++ b/tooling/cli/src/main.rs @@ -8,7 +8,7 @@ use std::path::Path; use std::process::exit; fn main() -> tauri_cli::Result<()> { - let mut args = args_os(); + let mut args = args_os().peekable(); let bin_name = match args .next() .as_deref() @@ -17,7 +17,9 @@ fn main() -> tauri_cli::Result<()> { .and_then(OsStr::to_str) { Some("cargo-tauri") => { - if args.by_ref().peekable().peek().and_then(|s| s.to_str()) == Some("tauri") { + if args.peek().and_then(|s| s.to_str()) == Some("tauri") { + // remove the extra cargo subcommand + args.next(); Some("cargo tauri".into()) } else { Some("cargo-tauri".into()) diff --git a/tooling/cli/src/plugin.rs b/tooling/cli/src/plugin.rs index dcb3c23fbb5a..b27ff7e8da85 100644 --- a/tooling/cli/src/plugin.rs +++ b/tooling/cli/src/plugin.rs @@ -2,15 +2,20 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -use clap::{AppSettings, Parser, Subcommand}; +use clap::{Parser, Subcommand}; use crate::Result; mod init; #[derive(Parser)] -#[clap(author, version, about = "Manage Tauri plugins")] -#[clap(setting(AppSettings::SubcommandRequiredElseHelp))] +#[clap( + author, + version, + about = "Manage Tauri plugins", + subcommand_required(true), + arg_required_else_help(true) +)] pub struct Cli { #[clap(subcommand)] command: Commands, diff --git a/tooling/cli/src/plugin/init.rs b/tooling/cli/src/plugin/init.rs index 3ae7f7287b85..28445e22c8af 100644 --- a/tooling/cli/src/plugin/init.rs +++ b/tooling/cli/src/plugin/init.rs @@ -8,7 +8,7 @@ use crate::{ VersionMetadata, }; use anyhow::Context; -use clap::{ArgSettings, Parser}; +use clap::Parser; use handlebars::{to_json, Handlebars}; use heck::{ToKebabCase, ToSnakeCase}; use include_dir::{include_dir, Dir}; @@ -28,7 +28,6 @@ pub struct Options { api: bool, /// Initializes a Tauri core plugin (internal usage) #[clap(long, hide(true))] - #[clap(setting(ArgSettings::Hidden))] tauri: bool, /// Set target directory for init #[clap(short, long)] diff --git a/tooling/cli/src/signer.rs b/tooling/cli/src/signer.rs index 78c212e1d971..271923041b46 100644 --- a/tooling/cli/src/signer.rs +++ b/tooling/cli/src/signer.rs @@ -3,14 +3,19 @@ // SPDX-License-Identifier: MIT use crate::Result; -use clap::{AppSettings, Parser, Subcommand}; +use clap::{Parser, Subcommand}; mod generate; mod sign; #[derive(Parser)] -#[clap(author, version, about = "Tauri updater signer")] -#[clap(setting(AppSettings::SubcommandRequiredElseHelp))] +#[clap( + author, + version, + about = "Tauri updater signer", + subcommand_required(true), + arg_required_else_help(true) +)] pub struct Cli { #[clap(subcommand)] command: Commands,