@tauri-apps/cli 1.1.1 → 1.2.1

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,21 @@
1
1
  # Changelog
2
2
 
3
+ ## \[1.2.1]
4
+
5
+ - Fixes injection of Cargo features defined in the configuration file.
6
+ - [1ecaeb29](https://www.github.com/tauri-apps/tauri/commit/1ecaeb29aa798f591f6488dc6c3a7a8d22f6073e) fix(cli): inject config feature flags when features arg is not provided on 2022-11-18
7
+
8
+ ## \[1.2.0]
9
+
10
+ - Detect JSON5 and TOML configuration files in the dev watcher.
11
+ - [e7ccbd85](https://www.github.com/tauri-apps/tauri/commit/e7ccbd8573f6b9124e80c0b67fa2365729c3c196) feat(cli): detect JSON5 and TOML configuration files in the dev watcher ([#5439](https://www.github.com/tauri-apps/tauri/pull/5439)) on 2022-10-19
12
+ - Log dev watcher file change detection.
13
+ - [9076d5d2](https://www.github.com/tauri-apps/tauri/commit/9076d5d2e76d432aef475ba403e9ab5bd3b9d2b0) feat(cli): add prompt information when file changing detected, closes [#5417](https://www.github.com/tauri-apps/tauri/pull/5417) ([#5428](https://www.github.com/tauri-apps/tauri/pull/5428)) on 2022-10-19
14
+ - Fix crash when nodejs binary has the version in its name, for example `node18` or when running through deno.
15
+ - [7a231cd1](https://www.github.com/tauri-apps/tauri/commit/7a231cd1c99101f63354b13bb36223568d2f0a11) fix(cli): detect deno ([#5475](https://www.github.com/tauri-apps/tauri/pull/5475)) on 2022-10-28
16
+ - Changed the project template to not enable all APIs by default.
17
+ - [582c25a0](https://www.github.com/tauri-apps/tauri/commit/582c25a0f0fa2725d786ec4edd0defe7811ad6e8) refactor(cli): disable api-all on templates ([#5538](https://www.github.com/tauri-apps/tauri/pull/5538)) on 2022-11-03
18
+
3
19
  ## \[1.1.1]
4
20
 
5
21
  - Fix wrong cli metadata that caused new projects (created through `tauri init`) fail to build
package/Cargo.toml CHANGED
@@ -8,7 +8,7 @@ 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.9", default-features = false, features = ["napi4"] }
11
+ napi = { version = "2.10", default-features = false, features = ["napi4"] }
12
12
  napi-derive = "2.9"
13
13
  tauri-cli = { path = ".." }
14
14
  log = "0.4.17"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tauri-apps/cli",
3
- "version": "1.1.1",
3
+ "version": "1.2.1",
4
4
  "description": "Command line interface for building Tauri apps",
5
5
  "funding": {
6
6
  "type": "opencollective",
@@ -37,11 +37,11 @@
37
37
  }
38
38
  },
39
39
  "devDependencies": {
40
- "@napi-rs/cli": "2.11.4",
40
+ "@napi-rs/cli": "2.12.0",
41
41
  "cross-env": "7.0.3",
42
42
  "cross-spawn": "7.0.3",
43
43
  "fs-extra": "10.1.0",
44
- "jest": "28.1.3",
44
+ "jest": "29.3.1",
45
45
  "jest-transform-toml": "1.0.0",
46
46
  "prettier": "2.7.1"
47
47
  },
@@ -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.1.1",
68
- "@tauri-apps/cli-darwin-x64": "1.1.1",
69
- "@tauri-apps/cli-linux-x64-gnu": "1.1.1",
70
- "@tauri-apps/cli-darwin-arm64": "1.1.1",
71
- "@tauri-apps/cli-linux-arm64-gnu": "1.1.1",
72
- "@tauri-apps/cli-linux-arm64-musl": "1.1.1",
73
- "@tauri-apps/cli-linux-arm-gnueabihf": "1.1.1",
74
- "@tauri-apps/cli-linux-x64-musl": "1.1.1",
75
- "@tauri-apps/cli-win32-ia32-msvc": "1.1.1"
67
+ "@tauri-apps/cli-win32-x64-msvc": "1.2.1",
68
+ "@tauri-apps/cli-darwin-x64": "1.2.1",
69
+ "@tauri-apps/cli-linux-x64-gnu": "1.2.1",
70
+ "@tauri-apps/cli-darwin-arm64": "1.2.1",
71
+ "@tauri-apps/cli-linux-arm64-gnu": "1.2.1",
72
+ "@tauri-apps/cli-linux-arm64-musl": "1.2.1",
73
+ "@tauri-apps/cli-linux-arm-gnueabihf": "1.2.1",
74
+ "@tauri-apps/cli-linux-x64-musl": "1.2.1",
75
+ "@tauri-apps/cli-win32-ia32-msvc": "1.2.1"
76
76
  }
77
77
  }
package/schema.json CHANGED
@@ -28,6 +28,11 @@
28
28
  "default": {
29
29
  "allowlist": {
30
30
  "all": false,
31
+ "app": {
32
+ "all": false,
33
+ "hide": false,
34
+ "show": false
35
+ },
31
36
  "clipboard": {
32
37
  "all": false,
33
38
  "readText": false,
@@ -108,6 +113,7 @@
108
113
  "setFocus": false,
109
114
  "setFullscreen": false,
110
115
  "setIcon": false,
116
+ "setIgnoreCursorEvents": false,
111
117
  "setMaxSize": false,
112
118
  "setMinSize": false,
113
119
  "setPosition": false,
@@ -207,7 +213,8 @@
207
213
  "type": [
208
214
  "string",
209
215
  "null"
210
- ]
216
+ ],
217
+ "pattern": "^[^/\\:*?\"<>|]+$"
211
218
  },
212
219
  "version": {
213
220
  "description": "App version. It is a semver version number or a path to a `package.json` file containing the `version` field.",
@@ -294,6 +301,11 @@
294
301
  "description": "The allowlist configuration.",
295
302
  "default": {
296
303
  "all": false,
304
+ "app": {
305
+ "all": false,
306
+ "hide": false,
307
+ "show": false
308
+ },
297
309
  "clipboard": {
298
310
  "all": false,
299
311
  "readText": false,
@@ -374,6 +386,7 @@
374
386
  "setFocus": false,
375
387
  "setFullscreen": false,
376
388
  "setIcon": false,
389
+ "setIgnoreCursorEvents": false,
377
390
  "setMaxSize": false,
378
391
  "setMinSize": false,
379
392
  "setPosition": false,
@@ -506,6 +519,13 @@
506
519
  }
507
520
  ]
508
521
  },
522
+ "userAgent": {
523
+ "description": "The user agent for the webview",
524
+ "type": [
525
+ "string",
526
+ "null"
527
+ ]
528
+ },
509
529
  "fileDropEnabled": {
510
530
  "description": "Whether the file drop is enabled or not on the webview. By default it is enabled.\n\nDisabling it is required to use drag and drop on the frontend on Windows.",
511
531
  "default": true,
@@ -592,7 +612,7 @@
592
612
  "type": "boolean"
593
613
  },
594
614
  "focus": {
595
- "description": "Whether the window will be initially hidden or focused.",
615
+ "description": "Whether the window will be initially focused or not.",
596
616
  "default": true,
597
617
  "type": "boolean"
598
618
  },
@@ -622,7 +642,7 @@
622
642
  "type": "boolean"
623
643
  },
624
644
  "skipTaskbar": {
625
- "description": "Whether or not the window icon should be added to the taskbar.",
645
+ "description": "If `true`, hides the window icon from the taskbar on Windows and Linux.",
626
646
  "default": false,
627
647
  "type": "boolean"
628
648
  },
@@ -636,6 +656,32 @@
636
656
  "type": "null"
637
657
  }
638
658
  ]
659
+ },
660
+ "titleBarStyle": {
661
+ "description": "The style of the macOS title bar.",
662
+ "default": "Visible",
663
+ "allOf": [
664
+ {
665
+ "$ref": "#/definitions/TitleBarStyle"
666
+ }
667
+ ]
668
+ },
669
+ "hiddenTitle": {
670
+ "description": "If `true`, sets the window title to be hidden on macOS.",
671
+ "default": false,
672
+ "type": "boolean"
673
+ },
674
+ "acceptFirstMouse": {
675
+ "description": "Whether clicking an inactive window also clicks through to the webview on macOS.",
676
+ "default": false,
677
+ "type": "boolean"
678
+ },
679
+ "tabbingIdentifier": {
680
+ "description": "Defines the window [tabbing identifier] for macOS.\n\nWindows with matching tabbing identifiers will be grouped together. If the tabbing identifier is not set, automatic tabbing will be disabled.\n\n[tabbing identifier]: <https://developer.apple.com/documentation/appkit/nswindow/1644704-tabbingidentifier>",
681
+ "type": [
682
+ "string",
683
+ "null"
684
+ ]
639
685
  }
640
686
  },
641
687
  "additionalProperties": false
@@ -656,10 +702,47 @@
656
702
  },
657
703
  "Theme": {
658
704
  "description": "System theme.",
659
- "type": "string",
660
- "enum": [
661
- "Light",
662
- "Dark"
705
+ "oneOf": [
706
+ {
707
+ "description": "Light theme.",
708
+ "type": "string",
709
+ "enum": [
710
+ "Light"
711
+ ]
712
+ },
713
+ {
714
+ "description": "Dark theme.",
715
+ "type": "string",
716
+ "enum": [
717
+ "Dark"
718
+ ]
719
+ }
720
+ ]
721
+ },
722
+ "TitleBarStyle": {
723
+ "description": "How the window title bar should be displayed on macOS.",
724
+ "oneOf": [
725
+ {
726
+ "description": "A normal title bar.",
727
+ "type": "string",
728
+ "enum": [
729
+ "Visible"
730
+ ]
731
+ },
732
+ {
733
+ "description": "Makes the title bar transparent, so the window background color is shown instead.\n\nUseful if you don't need to have actual HTML under the title bar. This lets you avoid the caveats of using `TitleBarStyle::Overlay`. Will be more useful when Tauri lets you set a custom window background color.",
734
+ "type": "string",
735
+ "enum": [
736
+ "Transparent"
737
+ ]
738
+ },
739
+ {
740
+ "description": "Shows the title bar as a transparent overlay over the window's content.\n\nKeep in mind: - The height of the title bar is different on different OS versions, which can lead to window the controls and title not being where you don't expect. - You need to define a custom drag region to make your window draggable, however due to a limitation you can't drag the window when it's not in focus <https://github.com/tauri-apps/tauri/issues/4316>. - The color of the window title depends on the system theme.",
741
+ "type": "string",
742
+ "enum": [
743
+ "Overlay"
744
+ ]
745
+ }
663
746
  ]
664
747
  },
665
748
  "CliConfig": {
@@ -933,6 +1016,13 @@
933
1016
  "description": "The application identifier in reverse domain name notation (e.g. `com.tauri.example`). This string must be unique across applications since it is used in system configurations like the bundle ID and path to the webview data directory. This string must contain only alphanumeric characters (A–Z, a–z, and 0–9), hyphens (-), and periods (.).",
934
1017
  "type": "string"
935
1018
  },
1019
+ "publisher": {
1020
+ "description": "The application's publisher. Defaults to the second element in the identifier string. Currently maps to the Manufacturer property of the Windows Installer.",
1021
+ "type": [
1022
+ "string",
1023
+ "null"
1024
+ ]
1025
+ },
936
1026
  "icon": {
937
1027
  "description": "The app's icons",
938
1028
  "default": [],
@@ -1074,14 +1164,49 @@
1074
1164
  },
1075
1165
  "BundleType": {
1076
1166
  "description": "A bundle referenced by tauri-bundler.",
1077
- "type": "string",
1078
- "enum": [
1079
- "deb",
1080
- "appimage",
1081
- "msi",
1082
- "app",
1083
- "dmg",
1084
- "updater"
1167
+ "oneOf": [
1168
+ {
1169
+ "description": "The debian bundle (.deb).",
1170
+ "type": "string",
1171
+ "enum": [
1172
+ "deb"
1173
+ ]
1174
+ },
1175
+ {
1176
+ "description": "The AppImage bundle (.appimage).",
1177
+ "type": "string",
1178
+ "enum": [
1179
+ "appimage"
1180
+ ]
1181
+ },
1182
+ {
1183
+ "description": "The Microsoft Installer bundle (.msi).",
1184
+ "type": "string",
1185
+ "enum": [
1186
+ "msi"
1187
+ ]
1188
+ },
1189
+ {
1190
+ "description": "The macOS application bundle (.app).",
1191
+ "type": "string",
1192
+ "enum": [
1193
+ "app"
1194
+ ]
1195
+ },
1196
+ {
1197
+ "description": "The Apple Disk Image bundle (.dmg).",
1198
+ "type": "string",
1199
+ "enum": [
1200
+ "dmg"
1201
+ ]
1202
+ },
1203
+ {
1204
+ "description": "The Tauri updater bundle.",
1205
+ "type": "string",
1206
+ "enum": [
1207
+ "updater"
1208
+ ]
1209
+ }
1085
1210
  ]
1086
1211
  },
1087
1212
  "AppImageConfig": {
@@ -1544,6 +1669,7 @@
1544
1669
  "setFocus": false,
1545
1670
  "setFullscreen": false,
1546
1671
  "setIcon": false,
1672
+ "setIgnoreCursorEvents": false,
1547
1673
  "setMaxSize": false,
1548
1674
  "setMinSize": false,
1549
1675
  "setPosition": false,
@@ -1689,6 +1815,19 @@
1689
1815
  "$ref": "#/definitions/ClipboardAllowlistConfig"
1690
1816
  }
1691
1817
  ]
1818
+ },
1819
+ "app": {
1820
+ "description": "App APIs allowlist.",
1821
+ "default": {
1822
+ "all": false,
1823
+ "hide": false,
1824
+ "show": false
1825
+ },
1826
+ "allOf": [
1827
+ {
1828
+ "$ref": "#/definitions/AppAllowlistConfig"
1829
+ }
1830
+ ]
1692
1831
  }
1693
1832
  },
1694
1833
  "additionalProperties": false
@@ -1760,7 +1899,7 @@
1760
1899
  "additionalProperties": false
1761
1900
  },
1762
1901
  "FsAllowlistScope": {
1763
- "description": "Filesystem scope definition. It is a list of glob patterns that restrict the API access from the webview.\n\nEach pattern can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`.",
1902
+ "description": "Filesystem scope definition. It is a list of glob patterns that restrict the API access from the webview.\n\nEach pattern can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.",
1764
1903
  "anyOf": [
1765
1904
  {
1766
1905
  "description": "A list of paths that are allowed by this scope.",
@@ -1932,6 +2071,11 @@
1932
2071
  "default": false,
1933
2072
  "type": "boolean"
1934
2073
  },
2074
+ "setIgnoreCursorEvents": {
2075
+ "description": "Allows ignoring cursor events.",
2076
+ "default": false,
2077
+ "type": "boolean"
2078
+ },
1935
2079
  "startDragging": {
1936
2080
  "description": "Allows start dragging on the window.",
1937
2081
  "default": false,
@@ -2004,7 +2148,7 @@
2004
2148
  "type": "string"
2005
2149
  },
2006
2150
  "cmd": {
2007
- "description": "The command name. It can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`.",
2151
+ "description": "The command name. It can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.",
2008
2152
  "default": "",
2009
2153
  "type": "string"
2010
2154
  },
@@ -2270,6 +2414,28 @@
2270
2414
  },
2271
2415
  "additionalProperties": false
2272
2416
  },
2417
+ "AppAllowlistConfig": {
2418
+ "description": "Allowlist for the app APIs.",
2419
+ "type": "object",
2420
+ "properties": {
2421
+ "all": {
2422
+ "description": "Use this flag to enable all app APIs.",
2423
+ "default": false,
2424
+ "type": "boolean"
2425
+ },
2426
+ "show": {
2427
+ "description": "Enables the app's `show` API.",
2428
+ "default": false,
2429
+ "type": "boolean"
2430
+ },
2431
+ "hide": {
2432
+ "description": "Enables the app's `hide` API.",
2433
+ "default": false,
2434
+ "type": "boolean"
2435
+ }
2436
+ },
2437
+ "additionalProperties": false
2438
+ },
2273
2439
  "SecurityConfig": {
2274
2440
  "description": "Security configuration.",
2275
2441
  "type": "object",
@@ -2427,11 +2593,28 @@
2427
2593
  },
2428
2594
  "WindowsUpdateInstallMode": {
2429
2595
  "description": "Install modes for the Windows update.",
2430
- "type": "string",
2431
- "enum": [
2432
- "basicUi",
2433
- "quiet",
2434
- "passive"
2596
+ "oneOf": [
2597
+ {
2598
+ "description": "Specifies there's a basic UI during the installation process, including a final dialog box at the end.",
2599
+ "type": "string",
2600
+ "enum": [
2601
+ "basicUi"
2602
+ ]
2603
+ },
2604
+ {
2605
+ "description": "The quiet mode means there's no user interaction required. Requires admin privileges if the installer does.",
2606
+ "type": "string",
2607
+ "enum": [
2608
+ "quiet"
2609
+ ]
2610
+ },
2611
+ {
2612
+ "description": "Specifies unattended mode, which means the installation only shows a progress bar.",
2613
+ "type": "string",
2614
+ "enum": [
2615
+ "passive"
2616
+ ]
2617
+ }
2435
2618
  ]
2436
2619
  },
2437
2620
  "SystemTrayConfig": {
@@ -2454,6 +2637,13 @@
2454
2637
  "description": "A Boolean value that determines whether the menu should appear when the tray icon receives a left click on macOS.",
2455
2638
  "default": true,
2456
2639
  "type": "boolean"
2640
+ },
2641
+ "title": {
2642
+ "description": "Title for MacOS tray",
2643
+ "type": [
2644
+ "string",
2645
+ "null"
2646
+ ]
2457
2647
  }
2458
2648
  },
2459
2649
  "additionalProperties": false
package/tauri.js CHANGED
@@ -10,9 +10,13 @@ const binStem = path.parse(bin).name.toLowerCase()
10
10
  // can successfully detect what command likely started the execution.
11
11
  let binName
12
12
 
13
+ // deno run -A --unstable --node-modules-dir npm:@tauri-apps/cli
14
+ if (bin === '@tauri-apps/cli') {
15
+ binName = '@tauri-apps/cli'
16
+ }
13
17
  // Even if started by a package manager, the binary will be NodeJS.
14
18
  // Some distribution still use "nodejs" as the binary name.
15
- if (binStem === 'node' || binStem === 'nodejs') {
19
+ else if (binStem.match(/(nodejs|node)([1-9]*)*$/g)) {
16
20
  const managerStem = process.env.npm_execpath
17
21
  ? path.parse(process.env.npm_execpath).name.toLowerCase()
18
22
  : null