@tauri-apps/cli 1.0.1 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,34 @@
1
1
  # Changelog
2
2
 
3
+ ## \[1.0.4]
4
+
5
+ - Do not capture and force colors of `cargo build` output.
6
+ - [c635a0da](https://www.github.com/tauri-apps/tauri/commit/c635a0dad437860d54109adffaf245b7c21bc684) refactor(cli): do not capture and force colors of cargo build output ([#4627](https://www.github.com/tauri-apps/tauri/pull/4627)) on 2022-07-12
7
+ - Reduce the amount of allocations when converting cases.
8
+ - [bc370e32](https://www.github.com/tauri-apps/tauri/commit/bc370e326810446e15b1f50fb962b980114ba16b) feat: reduce the amount of `heck`-related allocations ([#4634](https://www.github.com/tauri-apps/tauri/pull/4634)) on 2022-07-11
9
+
10
+ ## \[1.0.3]
11
+
12
+ - Changed the app template to not set the default app menu as it is now set automatically on macOS which is the platform that needs a menu to function properly.
13
+ - [91055883](https://www.github.com/tauri-apps/tauri/commit/9105588373cc8401bd9ad79bdef26f509b2d76b7) feat: add implicit default menu for macOS only, closes [#4551](https://www.github.com/tauri-apps/tauri/pull/4551) ([#4570](https://www.github.com/tauri-apps/tauri/pull/4570)) on 2022-07-04
14
+ - Improved bundle identifier validation showing the exact source of the configuration value.
15
+ - [8e3e7fc6](https://www.github.com/tauri-apps/tauri/commit/8e3e7fc64641afc7a6833bc93205e6f525562545) feat(cli): improve bundle identifier validation, closes [#4589](https://www.github.com/tauri-apps/tauri/pull/4589) ([#4596](https://www.github.com/tauri-apps/tauri/pull/4596)) on 2022-07-05
16
+ - Improve configuration deserialization error messages.
17
+ - [9170c920](https://www.github.com/tauri-apps/tauri/commit/9170c9207044fa561535f624916dfdbaa41ff79d) feat(core): improve config deserialization error messages ([#4607](https://www.github.com/tauri-apps/tauri/pull/4607)) on 2022-07-06
18
+ - Revert the `run` command to run in a separate thread.
19
+ - [f65eb4f8](https://www.github.com/tauri-apps/tauri/commit/f65eb4f84d8e511cd30d01d20a8223a297f7e584) fix(cli.js): revert `run` command to be nonblocking on 2022-07-04
20
+ - Skip the static link of the `vcruntime140.dll` if the `STATIC_VCRUNTIME` environment variable is set to `false`.
21
+ - [2e61abaa](https://www.github.com/tauri-apps/tauri/commit/2e61abaa9ae5d7a41ca1fa6505b5d6c368625ce5) feat(cli): allow dynamic link vcruntime, closes [#4565](https://www.github.com/tauri-apps/tauri/pull/4565) ([#4601](https://www.github.com/tauri-apps/tauri/pull/4601)) on 2022-07-06
22
+ - The `TAURI_CONFIG` environment variable now represents the configuration to be merged instead of the entire JSON.
23
+ - [fa028ebf](https://www.github.com/tauri-apps/tauri/commit/fa028ebf3c8ca7b43a70d283a01dbea86217594f) refactor: do not pass entire config from CLI to core, send patch instead ([#4598](https://www.github.com/tauri-apps/tauri/pull/4598)) on 2022-07-06
24
+ - Watch for Cargo workspace members in the `dev` file watcher.
25
+ - [dbb8c87b](https://www.github.com/tauri-apps/tauri/commit/dbb8c87b96dec9942b1bf877b29bafb8246514d4) feat(cli): watch Cargo workspaces in the dev command, closes [#4222](https://www.github.com/tauri-apps/tauri/pull/4222) ([#4572](https://www.github.com/tauri-apps/tauri/pull/4572)) on 2022-07-03
26
+
27
+ ## \[1.0.2]
28
+
29
+ - Fixes a crash on the `signer sign` command.
30
+ - [8e808fec](https://www.github.com/tauri-apps/tauri/commit/8e808fece95f2e506acf2c446d37b9913fd67d50) fix(cli.rs): conflicts_with arg doesn't exist closes ([#4538](https://www.github.com/tauri-apps/tauri/pull/4538)) on 2022-06-30
31
+
3
32
  ## \[1.0.1]
4
33
 
5
34
  - No longer adds the `pkg-config` dependency to `.deb` packages when the `systemTray` is used.
package/Cargo.toml CHANGED
@@ -8,9 +8,10 @@ crate-type = ["cdylib"]
8
8
 
9
9
  [dependencies]
10
10
  # Default enable napi4 feature, see https://nodejs.org/api/n-api.html#node-api-version-matrix
11
- napi = { version = "2.5", default-features = false, features = ["napi4"] }
12
- napi-derive = "2.5"
11
+ napi = { version = "2.6", default-features = false, features = ["napi4"] }
12
+ napi-derive = "2.6"
13
13
  tauri-cli = { path = ".." }
14
+ log = "0.4.17"
14
15
 
15
16
  [build-dependencies]
16
17
  napi-build = "2.0"
package/index.d.ts CHANGED
@@ -3,4 +3,5 @@
3
3
 
4
4
  /* auto-generated by NAPI-RS */
5
5
 
6
- export function run(args: Array<string>, binName?: string | undefined | null): void
6
+ export function run(args: Array<string>, binName: string | undefined | null, callback: (...args: any[]) => any): void
7
+ export function logError(error: string): void
package/index.js CHANGED
@@ -236,6 +236,7 @@ if (!nativeBinding) {
236
236
  throw new Error(`Failed to load native binding`)
237
237
  }
238
238
 
239
- const { run } = nativeBinding
239
+ const { run, logError } = nativeBinding
240
240
 
241
241
  module.exports.run = run
242
+ module.exports.logError = logError
package/main.js CHANGED
@@ -1,4 +1,4 @@
1
- const { run } = require('./index')
1
+ const { run, logError } = require('./index')
2
2
 
3
3
  module.exports.run = (args, binName) => {
4
4
  return new Promise((resolve, reject) => {
@@ -11,3 +11,5 @@ module.exports.run = (args, binName) => {
11
11
  })
12
12
  })
13
13
  }
14
+
15
+ module.exports.logError = logError
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tauri-apps/cli",
3
- "version": "1.0.1",
3
+ "version": "1.0.4",
4
4
  "description": "Command line interface for building Tauri apps",
5
5
  "funding": {
6
6
  "type": "opencollective",
@@ -37,7 +37,7 @@
37
37
  }
38
38
  },
39
39
  "devDependencies": {
40
- "@napi-rs/cli": "2.10.0",
40
+ "@napi-rs/cli": "2.10.1",
41
41
  "cross-env": "7.0.3",
42
42
  "cross-spawn": "7.0.3",
43
43
  "fs-extra": "10.1.0",
@@ -64,14 +64,14 @@
64
64
  "format:check": "prettier --check ./package.json ./tauri.js"
65
65
  },
66
66
  "optionalDependencies": {
67
- "@tauri-apps/cli-win32-x64-msvc": "1.0.1",
68
- "@tauri-apps/cli-darwin-x64": "1.0.1",
69
- "@tauri-apps/cli-linux-x64-gnu": "1.0.1",
70
- "@tauri-apps/cli-darwin-arm64": "1.0.1",
71
- "@tauri-apps/cli-linux-arm64-gnu": "1.0.1",
72
- "@tauri-apps/cli-linux-arm64-musl": "1.0.1",
73
- "@tauri-apps/cli-linux-arm-gnueabihf": "1.0.1",
74
- "@tauri-apps/cli-linux-x64-musl": "1.0.1",
75
- "@tauri-apps/cli-win32-ia32-msvc": "1.0.1"
67
+ "@tauri-apps/cli-win32-x64-msvc": "1.0.4",
68
+ "@tauri-apps/cli-darwin-x64": "1.0.4",
69
+ "@tauri-apps/cli-linux-x64-gnu": "1.0.4",
70
+ "@tauri-apps/cli-darwin-arm64": "1.0.4",
71
+ "@tauri-apps/cli-linux-arm64-gnu": "1.0.4",
72
+ "@tauri-apps/cli-linux-arm64-musl": "1.0.4",
73
+ "@tauri-apps/cli-linux-arm-gnueabihf": "1.0.4",
74
+ "@tauri-apps/cli-linux-x64-musl": "1.0.4",
75
+ "@tauri-apps/cli-win32-ia32-msvc": "1.0.4"
76
76
  }
77
77
  }
package/schema.json CHANGED
@@ -2409,6 +2409,11 @@
2409
2409
  "description": "A Boolean value that determines whether the image represents a [template](https://developer.apple.com/documentation/appkit/nsimage/1520017-template?language=objc) image on macOS.",
2410
2410
  "default": false,
2411
2411
  "type": "boolean"
2412
+ },
2413
+ "menuOnLeftClick": {
2414
+ "description": "A Boolean value that determines whether the menu should appear when the tray icon receives a left click on macOS.",
2415
+ "default": true,
2416
+ "type": "boolean"
2412
2417
  }
2413
2418
  },
2414
2419
  "additionalProperties": false
package/src/lib.rs CHANGED
@@ -2,7 +2,30 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  // SPDX-License-Identifier: MIT
4
4
 
5
+ use napi::{
6
+ threadsafe_function::{ErrorStrategy, ThreadsafeFunction, ThreadsafeFunctionCallMode},
7
+ Error, JsFunction, Result, Status,
8
+ };
9
+
10
+ #[napi_derive::napi]
11
+ pub fn run(args: Vec<String>, bin_name: Option<String>, callback: JsFunction) -> Result<()> {
12
+ let function: ThreadsafeFunction<bool, ErrorStrategy::CalleeHandled> = callback
13
+ .create_threadsafe_function(0, |ctx| ctx.env.get_boolean(ctx.value).map(|v| vec![v]))?;
14
+
15
+ // we need to run in a separate thread so Node.js (e.g. vue-cli-plugin-tauri) consumers
16
+ // can do work while `tauri dev` is running.
17
+ std::thread::spawn(move || match tauri_cli::try_run(args, bin_name) {
18
+ Ok(_) => function.call(Ok(true), ThreadsafeFunctionCallMode::Blocking),
19
+ Err(e) => function.call(
20
+ Err(Error::new(Status::GenericFailure, format!("{:#}", e))),
21
+ ThreadsafeFunctionCallMode::Blocking,
22
+ ),
23
+ });
24
+
25
+ Ok(())
26
+ }
27
+
5
28
  #[napi_derive::napi]
6
- pub fn run(args: Vec<String>, bin_name: Option<String>) {
7
- tauri_cli::run(args, bin_name);
29
+ pub fn log_error(error: String) {
30
+ log::error!("{}", error);
8
31
  }
package/tauri.js CHANGED
@@ -43,4 +43,7 @@ if (binStem === 'node' || binStem === 'nodejs') {
43
43
  arguments.unshift(bin)
44
44
  }
45
45
 
46
- cli.run(arguments, binName)
46
+ cli.run(arguments, binName).catch((err) => {
47
+ cli.logError(err.message)
48
+ process.exit(1)
49
+ })