@tauri-apps/cli 1.0.0-beta.9 → 1.0.0-rc.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,304 +1,51 @@
1
1
  # Changelog
2
2
 
3
- ## \[1.0.0-beta.9]
4
-
5
- - The CLI is now an ES module and requires at least Node.js v12.20. Fixed previous releases by using Rollup instead of Webpack.
6
- - [8d1fe0ea](https://www.github.com/tauri-apps/tauri/commit/8d1fe0ea056f4ef0ab0a90c89c6391f3e3185bc7) feat(cli.js): readd ESM distribution ([#2468](https://www.github.com/tauri-apps/tauri/pull/2468)) on 2021-08-17
7
-
8
- ## \[1.0.0-beta.8]
9
-
10
- - Reverts ESM distribution.
11
- - [01ad2925](https://www.github.com/tauri-apps/tauri/commit/01ad29257ca0a0d5b56d93dab4f68f4521aa30a6) fix(cli.js): revert ESM distribution ([#2457](https://www.github.com/tauri-apps/tauri/pull/2457)) on 2021-08-16
12
-
13
- ## \[1.0.0-beta.7]
14
-
15
- - Force Cargo manifest update when running the `deps update` command and fix the version that is written to the file.
16
- - [c544cea8](https://www.github.com/tauri-apps/tauri/commit/c544cea8c971a4f133dc48b4700b86684bcec5f8) fix(cli.js): force version update on Cargo manifest ([#2419](https://www.github.com/tauri-apps/tauri/pull/2419)) on 2021-08-13
17
- - The CLI is now a ES module and requires at least Node.js v12.20.
18
- - [5f6e135f](https://www.github.com/tauri-apps/tauri/commit/5f6e135f23b370e008fc5e1849be0fcb78fc87e2) refactor(cli.js): package as ES module, closes [#2256](https://www.github.com/tauri-apps/tauri/pull/2256) ([#2392](https://www.github.com/tauri-apps/tauri/pull/2392)) on 2021-08-11
19
- - Adds support to HTTPS proxy set with the `HTTPS_PROXY` environment variable.
20
- - [9c4032ba](https://www.github.com/tauri-apps/tauri/commit/9c4032ba10d800bccc307f7afcc8e00f282b041e) fix(cli.js): usage with HTTPS_PROXY, closes [#2237](https://www.github.com/tauri-apps/tauri/pull/2237) ([#2381](https://www.github.com/tauri-apps/tauri/pull/2381)) on 2021-08-10
21
- - Adjust check for `dev` mode and switch CTA test to a script runner. The script gives us more control and better output into any failures.
22
- - [c410e034](https://www.github.com/tauri-apps/tauri/commit/c410e034f74d0624c8465b1f30bb7af58eb98b34) convert jest tests to child_process run script ([#2308](https://www.github.com/tauri-apps/tauri/pull/2308)) on 2021-08-08
23
-
24
- ## \[1.0.0-beta.6]
25
-
26
- - Run powershell commands with `-NoProfile` flag
27
- - [3e6f3416](https://www.github.com/tauri-apps/tauri/commit/3e6f34160deab4f774d90aba28122e5b6b6f9db2) fix(cli.rs): run powershell kill command without profile ([#2130](https://www.github.com/tauri-apps/tauri/pull/2130)) on 2021-06-30
28
- - Throw error on `cli.rs` download failure instead of silent exit.
29
- - [fd033464](https://www.github.com/tauri-apps/tauri/commit/fd0334645b415b8be574d44256194f601227cb40) fix: tauri init may failed with no error message. (fix [#2079](https://www.github.com/tauri-apps/tauri/pull/2079)) ([#2117](https://www.github.com/tauri-apps/tauri/pull/2117)) on 2021-06-30
30
-
31
- ## \[1.0.0-beta.5]
32
-
33
- - Improve error message when the product name is invalid.
34
- - Bumped due to a bump in cli.rs.
35
- - [1a41e9f0](https://www.github.com/tauri-apps/tauri/commit/1a41e9f040cfa18b6cc1380dfe21251d56e3f973) feat(cli.rs): improve error message on app rename, closes [#2101](https://www.github.com/tauri-apps/tauri/pull/2101) ([#2114](https://www.github.com/tauri-apps/tauri/pull/2114)) on 2021-06-28
36
-
37
- ## \[1.0.0-beta.4]
38
-
39
- - Properly detect target platform's architecture.
40
- - Bumped due to a bump in cli.rs.
41
- - [628a53eb](https://www.github.com/tauri-apps/tauri/commit/628a53eb6176f811d22d7730f08a99e5c370dbf4) fix(cli): properly detect target architecture, closes [#2040](https://www.github.com/tauri-apps/tauri/pull/2040) ([#2102](https://www.github.com/tauri-apps/tauri/pull/2102)) on 2021-06-28
42
- - Fixes `build` command when the `target` arg is set.
43
- - Bumped due to a bump in cli.rs.
44
- - [8e238701](https://www.github.com/tauri-apps/tauri/commit/8e2387018940e9e1421948d74a82156661ce2e4b) fix(cli.rs): fix out dir detection when target arg is set, closes [#2040](https://www.github.com/tauri-apps/tauri/pull/2040) ([#2098](https://www.github.com/tauri-apps/tauri/pull/2098)) on 2021-06-27
45
-
46
- ## \[1.0.0-beta.3]
47
-
48
- - Allow empty argument when running `cli.rs`.
49
- - [8be35ced](https://www.github.com/tauri-apps/tauri/commit/8be35ced78658de732360e3b20d7d70108c9b32d) fix(cli.rs): `tauri.conf.json > tauri > bundle > targets` being ignored ([#1945](https://www.github.com/tauri-apps/tauri/pull/1945)) on 2021-06-04
50
-
51
- ## \[1.0.0-beta.2]
52
-
53
- - Packages are checked with `!=` instead of `semver` for beta releases.
54
- - [66b6136](https://www.github.com/tauri-apps/tauri/commit/66b6136e06053e839b936ab17051d61748fa4f4e) Disable version check with semver for now ([#1810](https://www.github.com/tauri-apps/tauri/pull/1810)) on 2021-05-13
55
-
56
- ## \[1.0.0-beta.1]
57
-
58
- - Add `'self'` to default CSP because otherwise no joy on macOS.
59
- - Bumped due to a bump in cli.rs.
60
- - [12268e6](https://www.github.com/tauri-apps/tauri/commit/12268e6e69dc9a7034652f50316d3545cac687c7) fix(csp): add 'self' ([#1794](https://www.github.com/tauri-apps/tauri/pull/1794)) on 2021-05-12
61
- - Fix a typo that would result in bundle arg being ignored.
62
- - Bumped due to a bump in cli.rs.
63
- - [71f6a5e](https://www.github.com/tauri-apps/tauri/commit/71f6a5ed442a43bf1008043c95a1a90effdd2f81) fix(cli.rs/build): fix typo getting bundle arg ([#1783](https://www.github.com/tauri-apps/tauri/pull/1783)) on 2021-05-12
64
-
65
- ## \[1.0.0-beta.0]
66
-
67
- - Fixes `UnhandledPromiseRejectionWarning` when the Rust CLI call fails.
68
- - [8845487](https://www.github.com/tauri-apps/tauri/commit/8845487f9d2791a47b5368d08c152f65abe98835) fix(cli.js): handle cli.rs promise rejection ([#1689](https://www.github.com/tauri-apps/tauri/pull/1689)) on 2021-05-03
69
-
70
- - Download `rustup` script on runtime instead of shipping it.
71
- - [862e33a](https://www.github.com/tauri-apps/tauri/commit/862e33a0f652cca1fa313f3749a0445e811b2e3b) refactor(cli.js): download rustup binary ([#1711](https://www.github.com/tauri-apps/tauri/pull/1711)) on 2021-05-05
72
-
73
- - Adds `pnpm` support.
74
- - [908b703](https://www.github.com/tauri-apps/tauri/commit/908b703246ca9ed1959e8aac0c3df898b72d1e59) feat(cli.js): package managers interface, add pnpm support ([#1743](https://www.github.com/tauri-apps/tauri/pull/1743)) on 2021-05-09
75
-
76
- - Updates to `tauri icon`
77
-
78
- - detect if icon is NOT transparent via metadata
79
-
80
- - detect again on pixel level
81
-
82
- - remove pngquant as a waste of space
83
-
84
- - make optipng default
85
-
86
- - relax optipng settings
87
-
88
- - [82a580e](https://www.github.com/tauri-apps/tauri/commit/82a580ec4585e96ea31fe0f36f3238e34d46e599) feat(tauricon): fix transparency ([#1678](https://www.github.com/tauri-apps/tauri/pull/1678)) on 2021-05-03
89
-
90
- ## \[1.0.0-beta-rc.4]
91
-
92
- - Fixes the Message `command` name value on plugin invoke handler.
93
- - Bumped due to a bump in cli.rs.
94
- - [422dd5e](https://www.github.com/tauri-apps/tauri/commit/422dd5e2a0a03bb1556915c78f110bfab092c874) fix(core): command name on plugin invoke handler ([#1577](https://www.github.com/tauri-apps/tauri/pull/1577)) on 2021-04-21
95
- - [f575aaa](https://www.github.com/tauri-apps/tauri/commit/f575aaad71f23d44b2f89cf9ee5d84817dc3bb7a) fix: change files not referencing core packages ([#1619](https://www.github.com/tauri-apps/tauri/pull/1619)) on 2021-04-25
96
- - The package info APIs now checks the `package` object on `tauri.conf.json`.
97
- - Bumped due to a bump in cli.rs.
98
- - [8fd1baf](https://www.github.com/tauri-apps/tauri/commit/8fd1baf69b14bb81d7be9d31605ed7f02058b392) fix(core): pull package info from tauri.conf.json if set ([#1581](https://www.github.com/tauri-apps/tauri/pull/1581)) on 2021-04-22
99
- - [f575aaa](https://www.github.com/tauri-apps/tauri/commit/f575aaad71f23d44b2f89cf9ee5d84817dc3bb7a) fix: change files not referencing core packages ([#1619](https://www.github.com/tauri-apps/tauri/pull/1619)) on 2021-04-25
100
-
101
- ## \[1.0.0-beta-rc.3]
102
-
103
- - Remove Rust CLI download file if the download fails or the prpocess is killed.
104
- - [8a32d0e](https://www.github.com/tauri-apps/tauri/commit/8a32d0ec39ea87383e286516ab3ee5ab7cdefc8e) fix(cli.js): remove cli file if the download fails or process is killed ([#1592](https://www.github.com/tauri-apps/tauri/pull/1592)) on 2021-04-22
105
- - The `tauri deps` command now properly detects `beta-rc` crate updates.
106
- - [07eb6ce](https://www.github.com/tauri-apps/tauri/commit/07eb6cec8b60420e034b56c80f5fdca4a5aeb3e3) fix(cli.js): use `cargo search` on crate latest version detection ([#1563](https://www.github.com/tauri-apps/tauri/pull/1563)) on 2021-04-21
107
- - Update minimum Node.js version to v12.13.0
108
- - [1f089fb](https://www.github.com/tauri-apps/tauri/commit/1f089fb4f964c673dcab5784bdf1da2833487a7c) chore: update minimum nodejs version to 12.13.0 ([#1562](https://www.github.com/tauri-apps/tauri/pull/1562)) on 2021-04-21
109
- - The `tauri icon` command now accepts the icon path as the first positional argument instead of `--icon PATH`.
110
- - [1e0b41e](https://www.github.com/tauri-apps/tauri/commit/1e0b41e155355aee82983a2cb3040fd4dd84572e) refactor(cli.js): `tauri icon` with positional arg for icon path ([#1600](https://www.github.com/tauri-apps/tauri/pull/1600)) on 2021-04-23
111
- - Do not prompt to install dependencies on `tauri init` when the `--ci` argument is passed.
112
- - [941585c](https://www.github.com/tauri-apps/tauri/commit/941585c0c54710df552d8437f7252d67783558e7) fix(cli.js): skip installing deps when `--ci` is passed on `tauri init` ([#1603](https://www.github.com/tauri-apps/tauri/pull/1603)) on 2021-04-23
113
-
114
- ## \[1.0.0-beta-rc.2]
115
-
116
- - Add missing camelcase rename for config
117
- - Bumped due to a bump in cli.rs.
118
- - [bdf7072](https://www.github.com/tauri-apps/tauri/commit/bdf707285e3d307ab083009c274ccb56d5053ff2) fix(cli.rs/info): add missing camelCase rename ([#1505](https://www.github.com/tauri-apps/tauri/pull/1505)) on 2021-04-14
119
- - Fix `tauri info`
120
- - Properly detect `yarn` and `npm` versions on windows.
121
- - Fix a panic caused by a wrong field name in `metadata.json`
122
- - Bumped due to a bump in cli.rs.
123
- - [71666e9](https://www.github.com/tauri-apps/tauri/commit/71666e9f9cfb5499a727b3f95182e89073f67d7b) fix(cli.rs): fix panic & use `cmd` to run `yarn`&`npm` on windows ([#1511](https://www.github.com/tauri-apps/tauri/pull/1511)) on 2021-04-17
124
- - Sync `metadata.json` via script to update version reference to cli.js, tauri (core) and tauri-build.
125
- - Bumped due to a bump in cli.rs.
126
- - [1f64927](https://www.github.com/tauri-apps/tauri/commit/1f64927362ef20761d7cd3591281519eb292aa33) chore: sync cli.rs metadata.json file versions ([#1534](https://www.github.com/tauri-apps/tauri/pull/1534)) on 2021-04-19
127
-
128
- ## \[1.0.0-beta-rc.1]
129
-
130
- - Missing the `files` property in the package.json which mean that the `dist` directory was not published and used.
131
- - Bumped due to a bump in cli.rs.
132
- - [b2569a7](https://www.github.com/tauri-apps/tauri/commit/b2569a729a3caa88bdba62abc31f0665e1323aaa) fix(js-api): dist ([#1498](https://www.github.com/tauri-apps/tauri/pull/1498)) on 2021-04-15
133
-
134
- ## \[1.0.0-beta-rc.0]
135
-
136
- - Fixed missing 'App' variant & string promise instead of void promise.
137
- - [44fc65c](https://www.github.com/tauri-apps/tauri/commit/44fc65c723f638f2a1b2ecafb79b32d509ed2f35) Fixing TS API typings ([#1451](https://www.github.com/tauri-apps/tauri/pull/1451)) on 2021-04-11
138
- - [aea6145](https://www.github.com/tauri-apps/tauri/commit/aea614587bddab930d552512b54e18624fbf573e) refactor(repo): add /tooling folder ([#1457](https://www.github.com/tauri-apps/tauri/pull/1457)) on 2021-04-12
139
- - Update all code files to have our license header.
140
- - [bf82136](https://www.github.com/tauri-apps/tauri/commit/bf8213646689175f8a158b956911f3a43e360690) feat(license): SPDX Headers ([#1449](https://www.github.com/tauri-apps/tauri/pull/1449)) on 2021-04-11
141
- - [a6def70](https://www.github.com/tauri-apps/tauri/commit/a6def7066eec19c889b0f14cc1e475bf209a332e) Refactor(tauri): move tauri-api and tauri-updater to tauri ([#1455](https://www.github.com/tauri-apps/tauri/pull/1455)) on 2021-04-11
142
- - [aea6145](https://www.github.com/tauri-apps/tauri/commit/aea614587bddab930d552512b54e18624fbf573e) refactor(repo): add /tooling folder ([#1457](https://www.github.com/tauri-apps/tauri/pull/1457)) on 2021-04-12
143
- - JS CLI now downloads prebuilt Rust CLI.
144
- - [df305b2](https://www.github.com/tauri-apps/tauri/commit/df305b234bfe487f429949df90e522c1b0ce85c9) feat(cli/tauri.js): download prebuilt cli ([#1452](https://www.github.com/tauri-apps/tauri/pull/1452)) on 2021-04-13
145
- - The `info` command was rewritten in Rust.
146
- - [c3e06ee](https://www.github.com/tauri-apps/tauri/commit/c3e06ee9e88b3631da6eeb17d61ddd41cd5c6fe9) refactor(cli): rewrite info in Rust ([#1389](https://www.github.com/tauri-apps/tauri/pull/1389)) on 2021-03-25
147
- - [aea6145](https://www.github.com/tauri-apps/tauri/commit/aea614587bddab930d552512b54e18624fbf573e) refactor(repo): add /tooling folder ([#1457](https://www.github.com/tauri-apps/tauri/pull/1457)) on 2021-04-12
148
- - The `init` command was rewritten in Rust.
149
- - [f72b93b](https://www.github.com/tauri-apps/tauri/commit/f72b93b676ba8c48fd9273c187de3dbbc410fa0f) refactor(cli): rewrite init command in Rust ([#1382](https://www.github.com/tauri-apps/tauri/pull/1382)) on 2021-03-24
150
- - [aea6145](https://www.github.com/tauri-apps/tauri/commit/aea614587bddab930d552512b54e18624fbf573e) refactor(repo): add /tooling folder ([#1457](https://www.github.com/tauri-apps/tauri/pull/1457)) on 2021-04-12
151
- - Removed the `no-server` mode, the `inliner`, the `dev` server proxy and the `loadAsset` API.
152
- - [84d7cda](https://www.github.com/tauri-apps/tauri/commit/84d7cdae632eeb02a66f8d1d7577adfa65917a34) refactor(core): remove `no-server` and its APIs ([#1215](https://www.github.com/tauri-apps/tauri/pull/1215)) on 2021-02-11
153
- - [aea6145](https://www.github.com/tauri-apps/tauri/commit/aea614587bddab930d552512b54e18624fbf573e) refactor(repo): add /tooling folder ([#1457](https://www.github.com/tauri-apps/tauri/pull/1457)) on 2021-04-12
154
- - Revert `tauri create` deletion and shift remaining pieces that weren't deleted to `create-tauri-app`.
155
- - [4ec20a4](https://www.github.com/tauri-apps/tauri/commit/4ec20a4a28823614186365c5a90512d77170cff2) feat: shift tauri create \[not wired up] ([#1330](https://www.github.com/tauri-apps/tauri/pull/1330)) on 2021-03-07
156
- - [aea6145](https://www.github.com/tauri-apps/tauri/commit/aea614587bddab930d552512b54e18624fbf573e) refactor(repo): add /tooling folder ([#1457](https://www.github.com/tauri-apps/tauri/pull/1457)) on 2021-04-12
157
- - The Tauri API interface is now shipped with the `@tauri-apps/api` package instead of the deprecated `tauri` package.
158
- To use the new API package, delete the old `tauri` from your `package.json` and install the new package:
159
- `$ yarn remove tauri && yarn add @tauri-apps/api` or `$ npm uninstall tauri && npm install @tauri-apps/api`.
160
- And change all `import { someApi } from 'tauri/api` to `import { someApi } from '@tauri-apps/api'`.
161
- - [3e8abe3](https://www.github.com/tauri-apps/tauri/commit/3e8abe376407bb0ca8893602590ed9edf7aa71a1) feat(cli) rewrite the core CLI in Rust ([#851](https://www.github.com/tauri-apps/tauri/pull/851)) on 2021-01-30
162
- - [aea6145](https://www.github.com/tauri-apps/tauri/commit/aea614587bddab930d552512b54e18624fbf573e) refactor(repo): add /tooling folder ([#1457](https://www.github.com/tauri-apps/tauri/pull/1457)) on 2021-04-12
163
- - The Tauri Node.js CLI package is now `@tauri-apps/cli`.
164
- - [3e8abe3](https://www.github.com/tauri-apps/tauri/commit/3e8abe376407bb0ca8893602590ed9edf7aa71a1) feat(cli) rewrite the core CLI in Rust ([#851](https://www.github.com/tauri-apps/tauri/pull/851)) on 2021-01-30
165
- - [e02c941](https://www.github.com/tauri-apps/tauri/commit/e02c9419cb8c66f4e43ed598d2fc74d4b19384ec) refactor(tauri): support for building without environmental variables ([#850](https://www.github.com/tauri-apps/tauri/pull/850)) on 2021-02-09
166
- - [aea6145](https://www.github.com/tauri-apps/tauri/commit/aea614587bddab930d552512b54e18624fbf573e) refactor(repo): add /tooling folder ([#1457](https://www.github.com/tauri-apps/tauri/pull/1457)) on 2021-04-12
167
- - All the arguments passed after `tauri dev --` are now propagated to the binary.
168
- - [4e9d31c](https://www.github.com/tauri-apps/tauri/commit/4e9d31c70ba13f1cabe830c6519a1b5f4789fd7b) feat(cli): propagate args passed after `dev --`, closes [#1406](https://www.github.com/tauri-apps/tauri/pull/1406) ([#1407](https://www.github.com/tauri-apps/tauri/pull/1407)) on 2021-03-30
169
- - [aea6145](https://www.github.com/tauri-apps/tauri/commit/aea614587bddab930d552512b54e18624fbf573e) refactor(repo): add /tooling folder ([#1457](https://www.github.com/tauri-apps/tauri/pull/1457)) on 2021-04-12
170
- - Eliminate the dead code in cli.js. Also removed some unused dependencies and updated the publish config that we are not publishing the Typescript files (since this is now primarily a CLI).
171
- - [c718bd2](https://www.github.com/tauri-apps/tauri/commit/c718bd2382a289666cd665bb356a39193c06deb6) chore: tauri.js dead code elim ([#1422](https://www.github.com/tauri-apps/tauri/pull/1422)) on 2021-04-01
172
- - [aea6145](https://www.github.com/tauri-apps/tauri/commit/aea614587bddab930d552512b54e18624fbf573e) refactor(repo): add /tooling folder ([#1457](https://www.github.com/tauri-apps/tauri/pull/1457)) on 2021-04-12
173
-
174
- ## \[0.14.1]
175
-
176
- - Fixed a TypeScript issue where it didn't allow you to put the "recursive" option in the directory functions.
177
- - [2fd1067](https://www.github.com/tauri-apps/tauri/commit/2fd1067a4c7ef86dda074867b6a6702527962829) Fix: add recursive option to directory APIs ([#1141](https://www.github.com/tauri-apps/tauri/pull/1141)) on 2021-01-12
178
-
179
- ## \[0.14.0]
180
-
181
- - Update the tauri template to properly set the app icon id on Windows so the webview can load the executable icon.
182
- To use it on old projects, update your `src-tauri/src/build.rs` file, replacing `res.set_icon("icons/icon.ico");` with `res.set_icon_with_id("icons/icon.ico", "32512");`.
183
- \- [f887320](https://www.github.com/tauri-apps/tauri/commit/f887320df35e44b56e437355ee0ff05507a83173) fix(template) default windows icon id should be 32512, fixes [#1099](https://www.github.com/tauri-apps/tauri/pull/1099) ([#1107](https://www.github.com/tauri-apps/tauri/pull/1107)) on 2020-12-05
184
- - Fixes `tauri deps` command usage when `npm` is not installed.
185
- - [8da495f](https://www.github.com/tauri-apps/tauri/commit/8da495f78c34780b76d0b1201f622edcbba00229) fix(tauri.js) `deps` cmd usage when `npm` is not installed, closes [#1037](https://www.github.com/tauri-apps/tauri/pull/1037) ([#1053](https://www.github.com/tauri-apps/tauri/pull/1053)) on 2020-12-05
186
- - Match writeBinaryFile command name between js and rust
187
- - [486bd92](https://www.github.com/tauri-apps/tauri/commit/486bd920f899905bec0f690092aa1e3cac2c78f3) Fix: writeBinaryFile to call the correct command (fix [#1133](https://www.github.com/tauri-apps/tauri/pull/1133)) ([#1136](https://www.github.com/tauri-apps/tauri/pull/1136)) on 2021-01-06
188
-
189
- ## \[0.13.0]
190
-
191
- - Fixes `Reflect.deleteProperty` on promisified API calls failing with `Unable to delete property` by making it configurable.
192
- - [c8b167a](https://www.github.com/tauri-apps/tauri/commit/c8b167adb3561db182bc8f6e4d8753ce1ae3f450) fix(tauri.js) promisified API fails on Reflect.deleteProperty, fix [#1038](https://www.github.com/tauri-apps/tauri/pull/1038) ([#1056](https://www.github.com/tauri-apps/tauri/pull/1056)) on 2020-10-17
193
- - [72996be](https://www.github.com/tauri-apps/tauri/commit/72996be1bd3eb878c4cf30bfec79058071c26d7a) apply version updates ([#1024](https://www.github.com/tauri-apps/tauri/pull/1024)) on 2020-10-21
194
- - Adds a path resolution API (e.g. getting the download directory or resolving a path to the home directory).
195
- - [771e401](https://www.github.com/tauri-apps/tauri/commit/771e4019b8cfd1973015ffa632c9d6c6b82c5657) feat: Port path api to js ([#1006](https://www.github.com/tauri-apps/tauri/pull/1006)) on 2020-09-24
196
- - [72996be](https://www.github.com/tauri-apps/tauri/commit/72996be1bd3eb878c4cf30bfec79058071c26d7a) apply version updates ([#1024](https://www.github.com/tauri-apps/tauri/pull/1024)) on 2020-10-21
197
-
198
- ## \[0.12.0]
199
-
200
- - Break out TauriBuildConfig interface from TauriConfig build property
201
- - [43a8c4d](https://www.github.com/tauri-apps/tauri/commit/43a8c4d2bcc2461232e2ddfdf2506d3b4d68471d) fix [#920](https://www.github.com/tauri-apps/tauri/pull/920): Create recipes ([#930](https://www.github.com/tauri-apps/tauri/pull/930)) on 2020-08-17
202
- - Create recipes. A recipe:
203
- - Updates the TauriBuildConfig during the init process
204
- - Specifies npm dev and production dependencies to be installed
205
- - Runs extra installation scripts
206
- - [43a8c4d](https://www.github.com/tauri-apps/tauri/commit/43a8c4d2bcc2461232e2ddfdf2506d3b4d68471d) fix [#920](https://www.github.com/tauri-apps/tauri/pull/920): Create recipes ([#930](https://www.github.com/tauri-apps/tauri/pull/930)) on 2020-08-17
207
- - Create React JS and React TS recipes
208
- - [43a8c4d](https://www.github.com/tauri-apps/tauri/commit/43a8c4d2bcc2461232e2ddfdf2506d3b4d68471d) fix [#920](https://www.github.com/tauri-apps/tauri/pull/920): Create recipes ([#930](https://www.github.com/tauri-apps/tauri/pull/930)) on 2020-08-17
209
- - Add new top level command `create`, which accepts a recipe as a CLI, or runs interactively, prompting for a recipe out of a menu of choices defined by `api/recipes/index`
210
- - [43a8c4d](https://www.github.com/tauri-apps/tauri/commit/43a8c4d2bcc2461232e2ddfdf2506d3b4d68471d) fix [#920](https://www.github.com/tauri-apps/tauri/pull/920): Create recipes ([#930](https://www.github.com/tauri-apps/tauri/pull/930)) on 2020-08-17
211
- - Refactor `init` command so that it is just an alias for `create` with no recipe
212
- - [43a8c4d](https://www.github.com/tauri-apps/tauri/commit/43a8c4d2bcc2461232e2ddfdf2506d3b4d68471d) fix [#920](https://www.github.com/tauri-apps/tauri/pull/920): Create recipes ([#930](https://www.github.com/tauri-apps/tauri/pull/930)) on 2020-08-17
213
- - Bump all deps as noted in #975, #976, #977, #978, and #979.
214
- - [06dd75b](https://www.github.com/tauri-apps/tauri/commit/06dd75b68a15d388808c51ae2bf50554ae761d9d) chore: bump all js/rust deps ([#983](https://www.github.com/tauri-apps/tauri/pull/983)) on 2020-08-20
215
- - Make interactive prompt not ask for app name supplied as cli arg
216
- - [59e0de7](https://www.github.com/tauri-apps/tauri/commit/59e0de765046a240d6c9ff3ddcd7a98e8f765512) Fix cli no prompt for app-name cli arg ([#980](https://www.github.com/tauri-apps/tauri/pull/980)) on 2020-08-19
217
- - Change `String` to `string` type for `open` and `save` methods
218
- - [0a5bac1](https://www.github.com/tauri-apps/tauri/commit/0a5bac1dd641792a64f79ec90e2a357f18280776) fix(tauri.js): fix typings for open and save dialogs ([#926](https://www.github.com/tauri-apps/tauri/pull/926)) on 2020-08-08
219
- - Format all code with prettier. This technically should only affect code styles, but noting for posterity.
220
- - [6a21965](https://www.github.com/tauri-apps/tauri/commit/6a21965ff302940bcbdefa16490249ec7d0c1f2e) chore: add prettier for js formatting ([#937](https://www.github.com/tauri-apps/tauri/pull/937)) on 2020-08-18
221
- - Set correct promise resolve type which returns from `readBinaryFile`
222
- - [f98d4b9](https://www.github.com/tauri-apps/tauri/commit/f98d4b9076b51a7fc9eca12b4bed2cd3b466c6bc) fix(tauri.js): fix return type for `readBinaryFile` api method ([#927](https://www.github.com/tauri-apps/tauri/pull/927)) on 2020-08-08
223
- - Add types to JSDoc annotations
224
- - [f98d4b9](https://www.github.com/tauri-apps/tauri/commit/f98d4b9076b51a7fc9eca12b4bed2cd3b466c6bc) fix(tauri.js): fix return type for `readBinaryFile` api method ([#927](https://www.github.com/tauri-apps/tauri/pull/927)) on 2020-08-08
225
-
226
- ## \[0.11.1]
227
-
228
- - Fix command line arguments -W (window title) and -P (dev server uri) to work as intended.
229
- - [e1fd626](https://www.github.com/tauri-apps/tauri/commit/e1fd626453bf6310b18e48472aa831c367212290) Fix typos referring to CLI args in init command ([#921](https://www.github.com/tauri-apps/tauri/pull/921)) on 2020-08-03
230
-
231
- ## \[0.11.0]
232
-
233
- - Fixes the Webview initialization on Windows.
234
- - [4abd12c](https://www.github.com/tauri-apps/tauri/commit/4abd12c2a42b5ace8527114ab64da38f4486754f) fix(tauri) webview initialization on windows, fixes [#879](https://www.github.com/tauri-apps/tauri/pull/879) ([#885](https://www.github.com/tauri-apps/tauri/pull/885)) on 2020-07-23
235
-
236
- ## \[0.10.0]
237
-
238
- - Fixes the `writeFile` and `writeBinaryFile` usage.
239
- - [cbd14c3](https://www.github.com/tauri-apps/tauri/commit/cbd14c307753449d2d8a9cd4d4b29d30af6a7097) fix(tauri.js) `writeFile` and `writeBinaryFile` API ([#857](https://www.github.com/tauri-apps/tauri/pull/857)) on 2020-07-19
240
- - The notification's `body` is now optional, closes #793.
241
- - [dac1db3](https://www.github.com/tauri-apps/tauri/commit/dac1db39831ecbcf23c630351d5753af01ccd500) fix(tauri) notification body optional, requestPermission() regression, closes [#793](https://www.github.com/tauri-apps/tauri/pull/793) ([#844](https://www.github.com/tauri-apps/tauri/pull/844)) on 2020-07-16
242
- - Fixes a memory leak on the `promisified` helper usage.
243
- - [42a8bb0](https://www.github.com/tauri-apps/tauri/commit/42a8bb0e096548f2f9d6da2ba3699260e6cda18e) fix(api) `promisified` not cleaning up transformed callbacks, fixes [#852](https://www.github.com/tauri-apps/tauri/pull/852) ([#853](https://www.github.com/tauri-apps/tauri/pull/853)) on 2020-07-18
244
- - Prevent running the `dev` pipeline when running with administrator privileges.
245
- - [1780057](https://www.github.com/tauri-apps/tauri/commit/17800571fe417b5250aa1bd7052340a1c93918a8) fix(tauri.js) exit dev when running as admin, fixes [#781](https://www.github.com/tauri-apps/tauri/pull/781) ([#839](https://www.github.com/tauri-apps/tauri/pull/839)) on 2020-07-15
246
- - Print outdated dependencies information on `tauri info`.
247
- - [f0ce94f](https://www.github.com/tauri-apps/tauri/commit/f0ce94fc8e38642f2ba479311370dc1ca54799c7) feat(tauri.js) print outdated deps information on `tauri info` ([#841](https://www.github.com/tauri-apps/tauri/pull/841)) on 2020-07-15
248
- - Convert the `--app-name` value to kebab case.
249
- - [da99f63](https://www.github.com/tauri-apps/tauri/commit/da99f632f0c8a6b3b7fc5dfecaffb04b74537f0f) fix(tauri.js) app name as kebab case ([#856](https://www.github.com/tauri-apps/tauri/pull/856)) on 2020-07-19
250
- - Do not require a `package.json` file on the app root.
251
- - [45d3de6](https://www.github.com/tauri-apps/tauri/commit/45d3de6d97f060659e72e0cc0dc56d4f33f4a2f9) fix(tauri.js) do not require a package.json ([#855](https://www.github.com/tauri-apps/tauri/pull/855)) on 2020-07-19
252
- - Adds a dependency manager command to the Node.js CLI (`tauri deps`). The manager is able to install and update Rust and the Tauri ecosystem dependencies (npm package, crates, cargo subcommands).
253
- Usage: `tauri deps install` and `tauri deps update`. - [77282c1](https://www.github.com/tauri-apps/tauri/commit/77282c1e513227fe379f916cd21249b44faa8756) feat(tauri.js) add dependency manager command ([#829](https://www.github.com/tauri-apps/tauri/pull/829)) on 2020-07-15
254
- - Run the dependency manager's install script after `tauri init` succeeds.
255
- - [0591f1f](https://www.github.com/tauri-apps/tauri/commit/0591f1f945420ec4bc53919d05a8f8de014b3823) feat(tauri.js) run `deps install` after `tauri init` ([#842](https://www.github.com/tauri-apps/tauri/pull/842)) on 2020-07-15
256
- - Move types exported in the `tauri` js api into the modules that use them. For
257
- example, `Event` is now available from `tauri/api/event` instead of
258
- `tauri/api/types/event`. - [660a2d8](https://www.github.com/tauri-apps/tauri/commit/660a2d87d6acf0abf6be70c01e6402cb5aba96c7) feat(tauri.js) move exported api types into api modules (fix [#807](https://www.github.com/tauri-apps/tauri/pull/807)) ([#809](https://www.github.com/tauri-apps/tauri/pull/809)) on 2020-07-12
259
-
260
- ## \[0.9.1]
261
-
262
- - Fixes Edge blank screen on Windows when running tauri dev (Tauri crashing window due to Edge reloading app because of missing Content-Type header).
263
- - Bumped due to a bump in tauri-api.
264
- - [fedee83](https://www.github.com/tauri-apps/tauri/commit/fedee835e36daa4363b91aabd43143e8033c9a5c) fix(tauri.js) windows Edge blank screen on tauri dev ([#808](https://www.github.com/tauri-apps/tauri/pull/808)) on 2020-07-11
265
- - Improve the tauri info output on Windows, including the Microsoft Edge version.
266
- - [0d6235e](https://www.github.com/tauri-apps/tauri/commit/0d6235e427c0f8241d1068bdd1e34903eb9298f9) feat(tauri.js) add microsoft edge version to the info output ([#810](https://www.github.com/tauri-apps/tauri/pull/810)) on 2020-07-12
267
-
268
- ## \[0.9.0]
269
-
270
- - Fixes a race condition on the beforeDevCommand usage (starting Tauri before the devServer is ready).
271
- - [a26cffc](https://www.github.com/tauri-apps/tauri/commit/a26cffc575bee224a6beb5b7b0565d5583c0131f) fix(tauri.js) beforeDevCommand race condition ([#801](https://www.github.com/tauri-apps/tauri/pull/801)) on 2020-07-10
272
- - Revert a nullish coalescing operator that changed embedded server/inliner behavior.
273
- - [e7b4951](https://www.github.com/tauri-apps/tauri/commit/e7b495133fe9f4e9f576bb9805bec98b967783eb) fix(tauri.js) revert nullish coalesce addition ([#799](https://www.github.com/tauri-apps/tauri/pull/799)) on 2020-07-10
274
- - Fixes tauri init not generating tauri.conf.json on the Vue CLI Plugin.
275
- - [f208a68](https://www.github.com/tauri-apps/tauri/commit/f208a68e40c804daf41d54539d3a5951679e8a64) fix(tauri.js) do not swallow init errors, fix conf inject ([#802](https://www.github.com/tauri-apps/tauri/pull/802)) on 2020-07-10
276
- - tauri init now prompt for default values such as window title, app name, dist dir and dev path. You can use --ci to skip the prompts.
277
- - [ee8724b](https://www.github.com/tauri-apps/tauri/commit/ee8724b90a63f281292c6eb174773b905ba52e32) feat(tauri.js/init): prompt for default values (fix [#422](https://www.github.com/tauri-apps/tauri/pull/422)/[#162](https://www.github.com/tauri-apps/tauri/pull/162)) ([#472](https://www.github.com/tauri-apps/tauri/pull/472)) on 2020-07-10
278
-
279
- ## \[0.8.4]
280
-
281
- - Bump lodash to 4.17.19
282
-
283
- ## \[0.8.3]
284
-
285
- - Fixes the wrong cli value on the template that's used by tauri init.
286
- Also fixes the template test.
287
- - Fixes the tauri icon usage with the --icon flag. Previously, only the -i flag worked.
288
-
289
- ## \[0.8.2]
290
-
291
- - Adds tauri.conf.json schema validation to the CLI.
292
-
293
- ## \[0.8.1]
294
-
295
- - Transpile the TS API to ES5.
296
- Expose CJS as .js and ESM as .mjs.
297
- - Fixes the assets embedding into the binary.
298
-
299
- ## \[0.8.0]
300
-
301
- - Create UMD, ESM and CJS artifacts for the JavaScript API entry point from TS source using rollup.
302
- - Renaming `window.tauri` to `window.__TAURI__`, closing #435.
303
- The **Tauri** object now follows the TypeScript API structure (e.g. `window.tauri.readTextFile` is now `window.__TAURI__.fs.readTextFile`).
304
- If you want to keep the `window.tauri` object for a while, you can add a [mapping object](https://gist.github.com/lucasfernog/8f7b29cadd91d92ee2cf816a20c2ef01) to your code.
3
+ ## \[1.0.0-rc.4]
4
+
5
+ - Change the `run` function to take a callback and run asynchronously instead of blocking the event loop.
6
+ - [cd9a20b9](https://www.github.com/tauri-apps/tauri/commit/cd9a20b9ab013759b4bdb742f358988022450795) refactor(cli.js): run on separate thread ([#3436](https://www.github.com/tauri-apps/tauri/pull/3436)) on 2022-02-13
7
+ - Improve error message when the dev runner command fails.
8
+ - [759d1afb](https://www.github.com/tauri-apps/tauri/commit/759d1afb86f3657f6071a2ae39c9be21e20ed22c) feat(cli): improve error message when dev runner command fails ([#3447](https://www.github.com/tauri-apps/tauri/pull/3447)) on 2022-02-13
9
+ - Show full error message from `cli.rs` instead of just the outermost underlying error message.
10
+ - [63826010](https://www.github.com/tauri-apps/tauri/commit/63826010d1f38544f36afd3aac67c45d4608d15b) feat(cli.js): show full error message ([#3442](https://www.github.com/tauri-apps/tauri/pull/3442)) on 2022-02-13
11
+ - Increase `tauri.conf.json` directory lookup depth to `3` and allow changing it with the `TAURI_PATH_DEPTH` environment variable.
12
+ - [c6031c70](https://www.github.com/tauri-apps/tauri/commit/c6031c7070c6bb7539bbfdfe42cb73012829c910) feat(cli): increase lookup depth, add env var option ([#3451](https://www.github.com/tauri-apps/tauri/pull/3451)) on 2022-02-13
13
+ - Added `tauri-build`, `tao` and `wry` version to the `info` command output.
14
+ - [16f1173f](https://www.github.com/tauri-apps/tauri/commit/16f1173f456b1db543d0160df2c9828708bfc68a) feat(cli): add tao and wry version to the `info` output ([#3443](https://www.github.com/tauri-apps/tauri/pull/3443)) on 2022-02-13
15
+
16
+ ## \[1.0.0-rc.3]
17
+
18
+ - Change default value for the `freezePrototype` configuration to `false`.
19
+ - Bumped due to a bump in cli.rs.
20
+ - [3a4c0160](https://www.github.com/tauri-apps/tauri/commit/3a4c01606184be762adee055ddac803de0d28527) fix(core): change default `freezePrototype` to false, closes [#3416](https://www.github.com/tauri-apps/tauri/pull/3416) [#3406](https://www.github.com/tauri-apps/tauri/pull/3406) ([#3423](https://www.github.com/tauri-apps/tauri/pull/3423)) on 2022-02-12
21
+
22
+ ## \[1.0.0-rc.2]
23
+
24
+ - Fixes Tauri path resolution on projects without Git or a `.gitignore` file.
25
+ - [d8acbe11](https://www.github.com/tauri-apps/tauri/commit/d8acbe11492bd990e6983c7e63e0f1a8f1ea5c7c) fix(cli.rs): app path resolution on projects without git, closes [#3409](https://www.github.com/tauri-apps/tauri/pull/3409) ([#3410](https://www.github.com/tauri-apps/tauri/pull/3410)) on 2022-02-11
26
+
27
+ ## \[1.0.0-rc.1]
28
+
29
+ - Fix `init` command prompting for values even if the argument has been provided on the command line.
30
+ - [def76840](https://www.github.com/tauri-apps/tauri/commit/def76840257a1447723ecda13c807cf0c881f083) fix(cli.rs): do not prompt for `init` values if arg set ([#3400](https://www.github.com/tauri-apps/tauri/pull/3400)) on 2022-02-11
31
+ - [41052dee](https://www.github.com/tauri-apps/tauri/commit/41052deeda2a00ee2b8ec2041c9c87c11de82ab2) fix(covector): add cli.js to change files on 2022-02-11
32
+ - Fixes CLI freezing when running `light.exe` on Windows without the `--verbose` flag.
33
+ - [8beab636](https://www.github.com/tauri-apps/tauri/commit/8beab6363491e2a8757cc9fc0fa1eccc98ece916) fix(cli): build freezing on Windows, closes [#3399](https://www.github.com/tauri-apps/tauri/pull/3399) ([#3402](https://www.github.com/tauri-apps/tauri/pull/3402)) on 2022-02-11
34
+ - Respect `.gitignore` configuration when looking for the folder with the `tauri.conf.json` file.
35
+ - [9c6c5a8c](https://www.github.com/tauri-apps/tauri/commit/9c6c5a8c52c6460d0b0a1a55300e1828262994ba) perf(cli.rs): improve performance of tauri dir lookup reading .gitignore ([#3405](https://www.github.com/tauri-apps/tauri/pull/3405)) on 2022-02-11
36
+ - [41052dee](https://www.github.com/tauri-apps/tauri/commit/41052deeda2a00ee2b8ec2041c9c87c11de82ab2) fix(covector): add cli.js to change files on 2022-02-11
37
+
38
+ ## \[1.0.0-rc.0]
39
+
40
+ - Do not force Tauri application code on `src-tauri` folder and use a glob pattern to look for a subfolder with a `tauri.conf.json` file.
41
+ - [a8cff6b3](https://www.github.com/tauri-apps/tauri/commit/a8cff6b3bc3288a53d7cdc5b3cb95d371309d2d6) feat(cli): do not enforce `src-tauri` folder structure, closes [#2643](https://www.github.com/tauri-apps/tauri/pull/2643) ([#2654](https://www.github.com/tauri-apps/tauri/pull/2654)) on 2021-09-27
42
+ - Added CommonJS output to the `dist` folder.
43
+ - [205b0dc8](https://www.github.com/tauri-apps/tauri/commit/205b0dc8f30bf70902979a2c0a08c8bc8c8e5360) feat(cli.js): add CommonJS dist files ([#2646](https://www.github.com/tauri-apps/tauri/pull/2646)) on 2021-09-23
44
+ - Fixes `.ico` icon generation.
45
+ - [11db96e4](https://www.github.com/tauri-apps/tauri/commit/11db96e440e6cadc1c70992d07bfea3c448208b1) fix(cli.js): `.ico` icon generation, closes [#2692](https://www.github.com/tauri-apps/tauri/pull/2692) ([#2694](https://www.github.com/tauri-apps/tauri/pull/2694)) on 2021-10-02
46
+ - Automatically unplug `@tauri-apps/cli` in yarn 2+ installations to fix the download of the rust-cli.
47
+ - [1e336b68](https://www.github.com/tauri-apps/tauri/commit/1e336b6872c3b78caf7c2c6e71e03016c6abdacf) fix(cli.js): Fix package installation on yarn 2+ ([#3012](https://www.github.com/tauri-apps/tauri/pull/3012)) on 2021-12-09
48
+ - Read `package.json` and check for a `tauri` object containing the `appPath` string, which points to the tauri crate path.
49
+ - [fb2b9a52](https://www.github.com/tauri-apps/tauri/commit/fb2b9a52f594830c0a68ea40ea429a09892f7ba7) feat(cli.js): allow configuring tauri app path on package.json [#2752](https://www.github.com/tauri-apps/tauri/pull/2752) ([#3035](https://www.github.com/tauri-apps/tauri/pull/3035)) on 2021-12-09
50
+ - Removed the `icon` command, now exposed as a separate package, see https://github.com/tauri-apps/tauricon.
51
+ - [58030172](https://www.github.com/tauri-apps/tauri/commit/58030172eddb2403a84b56a21b5bdcebca42c265) feat(tauricon): remove from cli ([#3293](https://www.github.com/tauri-apps/tauri/pull/3293)) on 2022-02-07
package/Cargo.toml ADDED
@@ -0,0 +1,16 @@
1
+ [package]
2
+ edition = "2021"
3
+ name = "tauri-cli-node"
4
+ version = "0.0.0"
5
+
6
+ [lib]
7
+ crate-type = ["cdylib"]
8
+
9
+ [dependencies]
10
+ # Default enable napi4 feature, see https://nodejs.org/api/n-api.html#node-api-version-matrix
11
+ napi = { version = "2.0", default-features = false, features = ["napi4"] }
12
+ napi-derive = "2.0"
13
+ tauri-cli = { path = ".." }
14
+
15
+ [build-dependencies]
16
+ napi-build = "1.2"
package/README.md CHANGED
@@ -21,7 +21,7 @@ Tauri is a polyglot and generic system that is very composable and allows engine
21
21
 
22
22
  Tauri apps can have custom menus and have tray-type interfaces. They can be updated, and are managed by the user's operating system as expected. They are very small, because they use the system's webview. They do not ship a runtime, since the final binary is compiled from rust. This makes the reversing of Tauri apps not a trivial task.
23
23
  ## This module
24
- Written in Typescript and packaged such that it can be used with `npm`, `pnpm`, and `yarn`, this library provides a node.js runner for common tasks when using Tauri, like `yarn tauri dev`. For the most part it is a wrapper around [cli.rs](https://github.com/tauri-apps/tauri/blob/dev/tooling/cli.rs).
24
+ Written in Typescript and packaged such that it can be used with `npm`, `pnpm`, and `yarn`, this library provides a node.js runner for common tasks when using Tauri, like `yarn tauri dev`. For the most part it is a wrapper around [cli.rs](https://github.com/tauri-apps/tauri/blob/dev/tooling/cli).
25
25
 
26
26
  To learn more about the details of how all of these pieces fit together, please consult this [ARCHITECTURE.md](https://github.com/tauri-apps/tauri/blob/dev/ARCHITECTURE.md) document.
27
27
 
package/build.rs ADDED
@@ -0,0 +1,7 @@
1
+ // Copyright 2019-2021 Tauri Programme within The Commons Conservancy
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ // SPDX-License-Identifier: MIT
4
+
5
+ fn main() {
6
+ ::napi_build::setup();
7
+ }
package/index.d.ts ADDED
@@ -0,0 +1,12 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+
4
+ /* auto-generated by NAPI-RS */
5
+
6
+ export class ExternalObject<T> {
7
+ readonly '': {
8
+ readonly '': unique symbol
9
+ [K: symbol]: T
10
+ }
11
+ }
12
+ export function run(args: Array<string>, binName: string | undefined | null, callback: (...args: any[]) => any): void
package/index.js ADDED
@@ -0,0 +1,241 @@
1
+ const { existsSync, readFileSync } = require('fs')
2
+ const { join } = require('path')
3
+
4
+ const { platform, arch } = process
5
+
6
+ let nativeBinding = null
7
+ let localFileExisted = false
8
+ let loadError = null
9
+
10
+ function isMusl() {
11
+ // For Node 10
12
+ if (!process.report || typeof process.report.getReport !== 'function') {
13
+ try {
14
+ return readFileSync('/usr/bin/ldd', 'utf8').includes('musl')
15
+ } catch (e) {
16
+ return true
17
+ }
18
+ } else {
19
+ const { glibcVersionRuntime } = process.report.getReport().header
20
+ return !glibcVersionRuntime
21
+ }
22
+ }
23
+
24
+ switch (platform) {
25
+ case 'android':
26
+ switch (arch) {
27
+ case 'arm64':
28
+ localFileExisted = existsSync(join(__dirname, 'cli.android-arm64.node'))
29
+ try {
30
+ if (localFileExisted) {
31
+ nativeBinding = require('./cli.android-arm64.node')
32
+ } else {
33
+ nativeBinding = require('@tauri-apps/cli-android-arm64')
34
+ }
35
+ } catch (e) {
36
+ loadError = e
37
+ }
38
+ break
39
+ case 'arm':
40
+ localFileExisted = existsSync(join(__dirname, 'cli.android-arm-eabi.node'))
41
+ try {
42
+ if (localFileExisted) {
43
+ nativeBinding = require('./cli.android-arm-eabi.node')
44
+ } else {
45
+ nativeBinding = require('@tauri-apps/cli-android-arm-eabi')
46
+ }
47
+ } catch (e) {
48
+ loadError = e
49
+ }
50
+ break
51
+ default:
52
+ throw new Error(`Unsupported architecture on Android ${arch}`)
53
+ }
54
+ break
55
+ case 'win32':
56
+ switch (arch) {
57
+ case 'x64':
58
+ localFileExisted = existsSync(
59
+ join(__dirname, 'cli.win32-x64-msvc.node')
60
+ )
61
+ try {
62
+ if (localFileExisted) {
63
+ nativeBinding = require('./cli.win32-x64-msvc.node')
64
+ } else {
65
+ nativeBinding = require('@tauri-apps/cli-win32-x64-msvc')
66
+ }
67
+ } catch (e) {
68
+ loadError = e
69
+ }
70
+ break
71
+ case 'ia32':
72
+ localFileExisted = existsSync(
73
+ join(__dirname, 'cli.win32-ia32-msvc.node')
74
+ )
75
+ try {
76
+ if (localFileExisted) {
77
+ nativeBinding = require('./cli.win32-ia32-msvc.node')
78
+ } else {
79
+ nativeBinding = require('@tauri-apps/cli-win32-ia32-msvc')
80
+ }
81
+ } catch (e) {
82
+ loadError = e
83
+ }
84
+ break
85
+ case 'arm64':
86
+ localFileExisted = existsSync(
87
+ join(__dirname, 'cli.win32-arm64-msvc.node')
88
+ )
89
+ try {
90
+ if (localFileExisted) {
91
+ nativeBinding = require('./cli.win32-arm64-msvc.node')
92
+ } else {
93
+ nativeBinding = require('@tauri-apps/cli-win32-arm64-msvc')
94
+ }
95
+ } catch (e) {
96
+ loadError = e
97
+ }
98
+ break
99
+ default:
100
+ throw new Error(`Unsupported architecture on Windows: ${arch}`)
101
+ }
102
+ break
103
+ case 'darwin':
104
+ switch (arch) {
105
+ case 'x64':
106
+ localFileExisted = existsSync(join(__dirname, 'cli.darwin-x64.node'))
107
+ try {
108
+ if (localFileExisted) {
109
+ nativeBinding = require('./cli.darwin-x64.node')
110
+ } else {
111
+ nativeBinding = require('@tauri-apps/cli-darwin-x64')
112
+ }
113
+ } catch (e) {
114
+ loadError = e
115
+ }
116
+ break
117
+ case 'arm64':
118
+ localFileExisted = existsSync(
119
+ join(__dirname, 'cli.darwin-arm64.node')
120
+ )
121
+ try {
122
+ if (localFileExisted) {
123
+ nativeBinding = require('./cli.darwin-arm64.node')
124
+ } else {
125
+ nativeBinding = require('@tauri-apps/cli-darwin-arm64')
126
+ }
127
+ } catch (e) {
128
+ loadError = e
129
+ }
130
+ break
131
+ default:
132
+ throw new Error(`Unsupported architecture on macOS: ${arch}`)
133
+ }
134
+ break
135
+ case 'freebsd':
136
+ if (arch !== 'x64') {
137
+ throw new Error(`Unsupported architecture on FreeBSD: ${arch}`)
138
+ }
139
+ localFileExisted = existsSync(join(__dirname, 'cli.freebsd-x64.node'))
140
+ try {
141
+ if (localFileExisted) {
142
+ nativeBinding = require('./cli.freebsd-x64.node')
143
+ } else {
144
+ nativeBinding = require('@tauri-apps/cli-freebsd-x64')
145
+ }
146
+ } catch (e) {
147
+ loadError = e
148
+ }
149
+ break
150
+ case 'linux':
151
+ switch (arch) {
152
+ case 'x64':
153
+ if (isMusl()) {
154
+ localFileExisted = existsSync(
155
+ join(__dirname, 'cli.linux-x64-musl.node')
156
+ )
157
+ try {
158
+ if (localFileExisted) {
159
+ nativeBinding = require('./cli.linux-x64-musl.node')
160
+ } else {
161
+ nativeBinding = require('@tauri-apps/cli-linux-x64-musl')
162
+ }
163
+ } catch (e) {
164
+ loadError = e
165
+ }
166
+ } else {
167
+ localFileExisted = existsSync(
168
+ join(__dirname, 'cli.linux-x64-gnu.node')
169
+ )
170
+ try {
171
+ if (localFileExisted) {
172
+ nativeBinding = require('./cli.linux-x64-gnu.node')
173
+ } else {
174
+ nativeBinding = require('@tauri-apps/cli-linux-x64-gnu')
175
+ }
176
+ } catch (e) {
177
+ loadError = e
178
+ }
179
+ }
180
+ break
181
+ case 'arm64':
182
+ if (isMusl()) {
183
+ localFileExisted = existsSync(
184
+ join(__dirname, 'cli.linux-arm64-musl.node')
185
+ )
186
+ try {
187
+ if (localFileExisted) {
188
+ nativeBinding = require('./cli.linux-arm64-musl.node')
189
+ } else {
190
+ nativeBinding = require('@tauri-apps/cli-linux-arm64-musl')
191
+ }
192
+ } catch (e) {
193
+ loadError = e
194
+ }
195
+ } else {
196
+ localFileExisted = existsSync(
197
+ join(__dirname, 'cli.linux-arm64-gnu.node')
198
+ )
199
+ try {
200
+ if (localFileExisted) {
201
+ nativeBinding = require('./cli.linux-arm64-gnu.node')
202
+ } else {
203
+ nativeBinding = require('@tauri-apps/cli-linux-arm64-gnu')
204
+ }
205
+ } catch (e) {
206
+ loadError = e
207
+ }
208
+ }
209
+ break
210
+ case 'arm':
211
+ localFileExisted = existsSync(
212
+ join(__dirname, 'cli.linux-arm-gnueabihf.node')
213
+ )
214
+ try {
215
+ if (localFileExisted) {
216
+ nativeBinding = require('./cli.linux-arm-gnueabihf.node')
217
+ } else {
218
+ nativeBinding = require('@tauri-apps/cli-linux-arm-gnueabihf')
219
+ }
220
+ } catch (e) {
221
+ loadError = e
222
+ }
223
+ break
224
+ default:
225
+ throw new Error(`Unsupported architecture on Linux: ${arch}`)
226
+ }
227
+ break
228
+ default:
229
+ throw new Error(`Unsupported OS: ${platform}, architecture: ${arch}`)
230
+ }
231
+
232
+ if (!nativeBinding) {
233
+ if (loadError) {
234
+ throw loadError
235
+ }
236
+ throw new Error(`Failed to load native binding`)
237
+ }
238
+
239
+ const { run } = nativeBinding
240
+
241
+ module.exports.run = run
package/jest.config.js ADDED
@@ -0,0 +1,14 @@
1
+ module.exports = {
2
+ setupFilesAfterEnv: ['<rootDir>/test/jest/jest.setup.js'],
3
+ testMatch: [
4
+ '<rootDir>/test/jest/__tests__/**/*.spec.js',
5
+ '<rootDir>/test/jest/__tests__/**/*.test.js'
6
+ ],
7
+ moduleFileExtensions: ['ts', 'js', 'json'],
8
+ moduleNameMapper: {
9
+ '^~/(.*)$': '<rootDir>/$1'
10
+ },
11
+ transform: {
12
+ '\\.toml$': 'jest-transform-toml'
13
+ }
14
+ }
package/main.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+
4
+ export function run(args: Array<string>, binName: string | undefined | null): Promise<void>
package/main.js ADDED
@@ -0,0 +1,13 @@
1
+ const { run } = require('./index')
2
+
3
+ module.exports.run = (args, binName) => {
4
+ return new Promise((resolve, reject) => {
5
+ run(args, binName, res => {
6
+ if (res instanceof Error) {
7
+ reject(res)
8
+ } else {
9
+ resolve(res)
10
+ }
11
+ })
12
+ })
13
+ }
package/package.json CHANGED
@@ -1,33 +1,11 @@
1
1
  {
2
2
  "name": "@tauri-apps/cli",
3
- "version": "1.0.0-beta.9",
3
+ "version": "1.0.0-rc.4",
4
4
  "description": "Command line interface for building Tauri apps",
5
- "type": "module",
6
- "bin": {
7
- "tauri": "./bin/tauri.js"
8
- },
9
- "files": [
10
- "bin",
11
- "dist",
12
- "scripts"
13
- ],
14
5
  "funding": {
15
6
  "type": "opencollective",
16
7
  "url": "https://opencollective.com/tauri"
17
8
  },
18
- "scripts": {
19
- "build": "rimraf ./dist && rollup -c --silent",
20
- "build-release": "rimraf ./dist && cross-env NODE_ENV=production rollup -c",
21
- "test": "cross-env NODE_OPTIONS=--experimental-vm-modules jest --runInBand --forceExit --no-cache --testPathIgnorePatterns=\"(build|dev)\"",
22
- "pretest": "yarn build",
23
- "prepublishOnly": "yarn build-release",
24
- "test:local": "cross-env NODE_OPTIONS=--experimental-vm-modules jest --runInBand --forceExit",
25
- "lint": "eslint --ext ts \"./src/**/*.ts\"",
26
- "lint-fix": "eslint --fix --ext ts \"./src/**/*.ts\"",
27
- "lint:lockfile": "lockfile-lint --path yarn.lock --type yarn --validate-https --allowed-hosts npm yarn",
28
- "format": "prettier --write --end-of-line=auto \"./**/*.{cjs,js,jsx,ts,tsx,html,css,json}\" --ignore-path .gitignore",
29
- "format:check": "prettier --check --end-of-line=auto \"./**/*.{cjs,js,jsx,ts,tsx,html,css,json}\" --ignore-path .gitignore"
30
- },
31
9
  "repository": {
32
10
  "type": "git",
33
11
  "url": "git+https://github.com/tauri-apps/tauri.git"
@@ -43,75 +21,53 @@
43
21
  "publishConfig": {
44
22
  "access": "public"
45
23
  },
46
- "engines": {
47
- "node": ">= 12.20.0",
48
- "npm": ">= 6.6.0",
49
- "yarn": ">= 1.19.1"
24
+ "main": "main.js",
25
+ "types": "main.d.ts",
26
+ "napi": {
27
+ "name": "cli",
28
+ "triples": {
29
+ "additional": [
30
+ "aarch64-apple-darwin",
31
+ "aarch64-unknown-linux-gnu",
32
+ "aarch64-unknown-linux-musl",
33
+ "armv7-unknown-linux-gnueabihf",
34
+ "x86_64-unknown-linux-musl"
35
+ ]
36
+ }
50
37
  },
51
- "dependencies": {
52
- "@tauri-apps/toml": "2.2.4",
53
- "chalk": "4.1.2",
54
- "cross-env": "7.0.3",
38
+ "devDependencies": {
39
+ "@napi-rs/cli": "2.4.2",
55
40
  "cross-spawn": "7.0.3",
56
41
  "fs-extra": "10.0.0",
57
- "global-agent": "3.0.0",
58
- "got": "11.8.2",
59
- "imagemin": "8.0.1",
60
- "imagemin-optipng": "8.0.0",
61
- "imagemin-zopfli": "7.0.0",
62
- "inquirer": "8.1.2",
63
- "is-png": "3.0.0",
64
- "minimist": "1.2.5",
65
- "ms": "2.1.3",
66
- "png2icons": "2.0.1",
67
- "read-chunk": "3.2.0",
68
- "semver": "7.3.5",
69
- "sharp": "0.28.3",
70
- "update-notifier": "5.1.0"
71
- },
72
- "devDependencies": {
73
- "@babel/core": "7.15.0",
74
- "@babel/preset-env": "7.15.0",
75
- "@babel/preset-typescript": "7.15.0",
76
- "@jest/globals": "27.0.6",
77
- "@rollup/plugin-babel": "5.3.0",
78
- "@rollup/plugin-commonjs": "20.0.0",
79
- "@rollup/plugin-node-resolve": "13.0.4",
80
- "@rollup/plugin-replace": "^3.0.0",
81
- "@rollup/plugin-typescript": "8.2.5",
82
- "@types/cross-spawn": "6.0.2",
83
- "@types/fs-extra": "9.0.12",
84
- "@types/global-agent": "2.1.1",
85
- "@types/imagemin": "7.0.1",
86
- "@types/imagemin-optipng": "5.2.1",
87
- "@types/inquirer": "7.3.3",
88
- "@types/ms": "0.7.31",
89
- "@types/semver": "7.3.8",
90
- "@types/sharp": "0.28.5",
91
- "@typescript-eslint/eslint-plugin": "4.29.1",
92
- "@typescript-eslint/parser": "4.29.1",
93
- "babel-jest": "27.0.6",
94
- "eslint": "7.32.0",
95
- "eslint-config-prettier": "8.3.0",
96
- "eslint-config-standard-with-typescript": "20.0.0",
97
- "eslint-plugin-import": "2.24.0",
98
- "eslint-plugin-lodash-template": "0.19.0",
99
- "eslint-plugin-node": "11.1.0",
100
- "eslint-plugin-promise": "5.1.0",
101
- "eslint-plugin-security": "1.4.0",
102
- "is-running": "2.1.0",
103
- "jest": "27.0.6",
42
+ "jest": "27.5.1",
104
43
  "jest-transform-toml": "1.0.0",
105
- "lockfile-lint": "4.6.2",
106
- "prettier": "2.3.2",
107
- "promise": "8.1.0",
108
- "rimraf": "3.0.2",
109
- "rollup": "2.56.2",
110
- "rollup-plugin-terser": "7.0.2",
111
- "tslib": "2.3.1",
112
- "typescript": "4.3.5"
44
+ "prettier": "2.5.1"
45
+ },
46
+ "engines": {
47
+ "node": ">= 10"
48
+ },
49
+ "bin": {
50
+ "tauri": "./tauri.js"
51
+ },
52
+ "scripts": {
53
+ "artifacts": "napi artifacts",
54
+ "build": "napi build --platform --release",
55
+ "build:debug": "napi build --platform",
56
+ "prepublishOnly": "napi prepublish -t npm",
57
+ "test": "jest --runInBand --forceExit --no-cache",
58
+ "version": "napi version",
59
+ "tauri": "node ./tauri.js",
60
+ "format": "prettier --write ./package.json ./tauri.js",
61
+ "format:check": "prettier --check ./package.json ./tauri.js"
113
62
  },
114
- "resolutions": {
115
- "**/trim-newlines": "4.0.2"
63
+ "optionalDependencies": {
64
+ "@tauri-apps/cli-win32-x64-msvc": "1.0.0-rc.4",
65
+ "@tauri-apps/cli-darwin-x64": "1.0.0-rc.4",
66
+ "@tauri-apps/cli-linux-x64-gnu": "1.0.0-rc.4",
67
+ "@tauri-apps/cli-darwin-arm64": "1.0.0-rc.4",
68
+ "@tauri-apps/cli-linux-arm64-gnu": "1.0.0-rc.4",
69
+ "@tauri-apps/cli-linux-arm64-musl": "1.0.0-rc.4",
70
+ "@tauri-apps/cli-linux-arm-gnueabihf": "1.0.0-rc.4",
71
+ "@tauri-apps/cli-linux-x64-musl": "1.0.0-rc.4"
116
72
  }
117
- }
73
+ }
package/src/lib.rs ADDED
@@ -0,0 +1,23 @@
1
+ // Copyright 2019-2021 Tauri Programme within The Commons Conservancy
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ // SPDX-License-Identifier: MIT
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
+ std::thread::spawn(move || match tauri_cli::run(args, bin_name) {
16
+ Ok(_) => function.call(Ok(true), ThreadsafeFunctionCallMode::Blocking),
17
+ Err(e) => function.call(
18
+ Err(Error::new(Status::GenericFailure, format!("{:#}", e))),
19
+ ThreadsafeFunctionCallMode::Blocking,
20
+ ),
21
+ });
22
+ Ok(())
23
+ }
package/tauri.js ADDED
@@ -0,0 +1,49 @@
1
+ #!/usr/bin/env node
2
+
3
+ const cli = require('./main')
4
+ const path = require('path')
5
+
6
+ const [bin, script, ...arguments] = process.argv
7
+ const binStem = path.parse(bin).name.toLowerCase()
8
+
9
+ // We want to make a helpful binary name for the underlying CLI helper, if we
10
+ // can successfully detect what command likely started the execution.
11
+ let binName
12
+
13
+ // Even if started by a package manager, the binary will be NodeJS.
14
+ // Some distribution still use "nodejs" as the binary name.
15
+ if (binStem === 'node' || binStem === 'nodejs') {
16
+ const managerStem = process.env.npm_execpath
17
+ ? path.parse(process.env.npm_execpath).name.toLowerCase()
18
+ : null
19
+ if (managerStem) {
20
+ let manager
21
+ switch (managerStem) {
22
+ // Only supported package manager that has a different filename is npm.
23
+ case 'npm-cli':
24
+ manager = 'npm'
25
+ break
26
+
27
+ // Yarn and pnpm have the same stem name as their bin.
28
+ // We assume all unknown package managers do as well.
29
+ default:
30
+ manager = managerStem
31
+ break
32
+ }
33
+
34
+ binName = `${manager} run ${process.env.npm_lifecycle_event}`
35
+ } else {
36
+ // Assume running NodeJS if we didn't detect a manager from the env.
37
+ // We normalize the path to prevent the script's absolute path being used.
38
+ const scriptNormal = path.normalize(path.relative(process.cwd(), script))
39
+ binName = `${binStem} ${scriptNormal}`
40
+ }
41
+ } else {
42
+ // We don't know what started it, assume it's already stripped.
43
+ arguments.unshift(bin)
44
+ }
45
+
46
+ cli.run(arguments, binName).catch((err) => {
47
+ console.log(`Error running CLI: ${err.message}`)
48
+ process.exit(1)
49
+ })
package/bin/tauri-deps.js DELETED
@@ -1,26 +0,0 @@
1
- // Copyright 2019-2021 Tauri Programme within The Commons Conservancy
2
- // SPDX-License-Identifier: Apache-2.0
3
- // SPDX-License-Identifier: MIT
4
-
5
- import {
6
- installDependencies,
7
- updateDependencies
8
- } from '../dist/api/dependency-manager.js'
9
-
10
- async function run() {
11
- const choice = process.argv[2]
12
- if (choice === 'install') {
13
- await installDependencies()
14
- } else if (choice === 'update') {
15
- await updateDependencies()
16
- } else {
17
- console.log(`
18
- Description
19
- Tauri dependency management script
20
- Usage
21
- $ tauri deps [install|update]
22
- `)
23
- }
24
- }
25
-
26
- run()
package/bin/tauri-icon.js DELETED
@@ -1,61 +0,0 @@
1
- // Copyright 2019-2021 Tauri Programme within The Commons Conservancy
2
- // SPDX-License-Identifier: Apache-2.0
3
- // SPDX-License-Identifier: MIT
4
-
5
- import parseArgs from 'minimist'
6
- import tauricon from '../dist/api/tauricon.js'
7
-
8
- /**
9
- * @type {object}
10
- * @property {boolean} h
11
- * @property {boolean} help
12
- * @property {string|boolean} f
13
- * @property {string|boolean} force
14
- * @property {boolean} l
15
- * @property {boolean} log
16
- * @property {boolean} c
17
- * @property {boolean} config
18
- * @property {boolean} s
19
- * @property {boolean} source
20
- * @property {boolean} t
21
- * @property {boolean} target
22
- */
23
- const argv = parseArgs(process.argv.slice(2), {
24
- alias: {
25
- h: 'help',
26
- l: 'log',
27
- c: 'config',
28
- t: 'target'
29
- },
30
- boolean: ['h', 'l']
31
- })
32
-
33
- if (argv.help) {
34
- console.log(`
35
- Description
36
- Create all the icons you need for your Tauri app.
37
- The icon path is the source icon (png, 1240x1240 with transparency).
38
-
39
- Usage
40
- $ tauri icon [ICON-PATH]
41
-
42
- Options
43
- --help, -h Displays this message
44
- --log, l Logging [boolean]
45
- --target, t Target folder (default: 'src-tauri/icons')
46
- --compression, c Compression type [optipng|zopfli]
47
- --ci Runs the script in CI mode
48
- `)
49
- process.exit(0)
50
- }
51
-
52
- tauricon
53
- .make(argv._[0], argv.t, argv.c || 'optipng')
54
- .then(() => {
55
- // TODO: use logger module for prettier output
56
- console.log('app:tauri (tauricon) Completed')
57
- })
58
- .catch((e) => {
59
- // TODO: use logger module for prettier output
60
- console.error('app:tauri (icon)', e)
61
- })
package/bin/tauri.js DELETED
@@ -1,101 +0,0 @@
1
- #!/usr/bin/env node
2
- // Copyright 2019-2021 Tauri Programme within The Commons Conservancy
3
- // SPDX-License-Identifier: Apache-2.0
4
- // SPDX-License-Identifier: MIT
5
-
6
- import chalk from 'chalk'
7
- import updateNotifier from 'update-notifier'
8
- import { createRequire } from 'module'
9
- const require = createRequire(import.meta.url)
10
- const pkg = require('../package.json')
11
-
12
- const cmds = ['icon', 'deps']
13
- const rustCliCmds = ['dev', 'build', 'init', 'info', 'sign']
14
-
15
- const cmd = process.argv[2]
16
- /**
17
- * @description This is the bootstrapper that in turn calls subsequent
18
- * Tauri Commands
19
- *
20
- * @param {string|array} command
21
- */
22
- const tauri = async function (command) {
23
- // notifying updates.
24
- if (!process.argv.some((arg) => arg === '--no-update-notifier')) {
25
- updateNotifier({
26
- pkg,
27
- updateCheckInterval: 0
28
- }).notify()
29
- }
30
-
31
- if (typeof command === 'object') {
32
- // technically we just care about an array
33
- command = command[0]
34
- }
35
-
36
- const help =
37
- !command || command === '-h' || command === '--help' || command === 'help'
38
- if (help) {
39
- console.log(`
40
- ${chalk.cyan(`
41
- :oooodddoooo; ;oddl, ,ol, ,oc, ,ldoooooooc, ,oc,
42
- ';;;cxOx:;;;' ;xOxxko' :kx: lkd, :xkl;;;;:okx: lkd,
43
- 'dOo' 'oOd;:xkc :kx: lkd, :xx: ;xkc lkd,
44
- 'dOo' ckx: lkx; :kx: lkd, :xx: :xkc lkd,
45
- 'dOo' ;xkl ,dko' :kx: lkd, :xx:.....xko, lkd,
46
- 'dOo' 'oOd, :xkc :kx: lkd, :xx:,;cokko' lkd,
47
- 'dOo' ckk: lkx; :kx: lkd, :xx: ckkc lkd,
48
- 'dOo' ;xOl lko; :xkl;,....;oOd, :xx: :xkl' lkd,
49
- 'okl' 'kd' 'xx' 'dxxxddddxxo' :dd; ;dxc 'xo'`)}
50
-
51
- ${chalk.yellow('Description')}
52
- This is the Tauri CLI
53
- ${chalk.yellow('Usage')}
54
- $ tauri ${[...rustCliCmds, ...cmds].join('|')}
55
- ${chalk.yellow('Options')}
56
- --help, -h Displays this message
57
- --version, -v Displays the Tauri CLI version
58
- `)
59
-
60
- process.exit(0)
61
- // eslint-disable-next-line no-unreachable
62
- return false // do this for node consumers and tests
63
- } else if (command === '-v' || command === '--version') {
64
- console.log(`${pkg.version}`)
65
- return false // do this for node consumers and tests
66
- } else if (cmds.includes(command)) {
67
- if (process.argv && process.env.NODE_ENV !== 'test') {
68
- process.argv.splice(2, 1)
69
- }
70
- console.log(`[tauri]: running ${command}`)
71
- await import(`./tauri-${command}.js`)
72
- } else {
73
- const { runOnRustCli } = await import('../dist/helpers/rust-cli.js')
74
- if (process.argv && process.env.NODE_ENV !== 'test') {
75
- process.argv.splice(0, 3)
76
- }
77
- ;(
78
- await runOnRustCli(
79
- command,
80
- (process.argv || []).filter((v) => v !== '--no-update-notifier')
81
- )
82
- ).promise
83
- .then(() => {
84
- if (command === 'init' && !process.argv.some((arg) => arg === '--ci')) {
85
- return import('../dist/api/dependency-manager.js').then(
86
- ({ installDependencies }) => installDependencies()
87
- )
88
- }
89
- })
90
- .catch(() => process.exit(1))
91
- }
92
- }
93
-
94
- export default tauri
95
-
96
- // on test we use the module.exports
97
- if (process.env.NODE_ENV !== 'test') {
98
- tauri(cmd).catch((e) => {
99
- throw e
100
- })
101
- }
package/dist/api/cli.js DELETED
@@ -1 +0,0 @@
1
- import{_ as t,a as r}from"../tslib.es6-753a81cf.js";import{runOnRustCli as e}from"../helpers/rust-cli.js";import"fs";import"path";import"../helpers/spawn.js";import"cross-spawn";import"../logger-27e93e7d.js";import"chalk";import"ms";import"../helpers/download-binary.js";import"util";import"stream";import"global-agent";import"url";import"module";function i(i,n){return t(this,void 0,void 0,(function(){var t,o,s,u,a,c;return r(this,(function(r){switch(r.label){case 0:for(t=[],o=0,s=Object.entries(null!=n?n:{});o<s.length;o++)u=s[o],a=u[0],!1!==(c=u[1])&&(t.push("--"+a.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/\s+/g,"-").toLowerCase()),!0!==c&&t.push("string"==typeof c?c:JSON.stringify(c)));return[4,e(i,t)];case 1:return[2,r.sent()]}}))}))}var n=function(e){return t(void 0,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,i("init",e)];case 1:return[2,t.sent()]}}))}))},o=function(e){return t(void 0,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,i("dev",e)];case 1:return[2,t.sent()]}}))}))},s=function(e){return t(void 0,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,i("build",e)];case 1:return[2,t.sent()]}}))}))};export{s as build,o as dev,n as init};
@@ -1 +0,0 @@
1
- import{b as t,_ as e,a as n,c as r}from"../tslib.es6-753a81cf.js";import{l as a}from"../logger-27e93e7d.js";import{spawnSync as i}from"../helpers/spawn.js";import{sync as s}from"cross-spawn";import{downloadRustup as o}from"../helpers/download-binary.js";import{existsSync as u,readFileSync as c,writeFileSync as l}from"fs";import{dirname as p,resolve as d}from"path";import{platform as f}from"os";import"https";import{fileURLToPath as g}from"url";import{a as v,r as m,t as h}from"../app-paths-46150e8b.js";import w from"inquirer";import{createRequire as y}from"module";import"chalk";import"ms";import"util";import"stream";import"global-agent";var b;!function(t){t[t.Install=0]="Install",t[t.InstallDev=1]="InstallDev",t[t.Update=2]="Update"}(b||(b={}));var k=p(g(import.meta.url)),I=a("dependency:rust");function P(){return e(this,void 0,void 0,(function(){var t,e;return n(this,(function(n){switch(n.label){case 0:return t="win32"===f()?"rustup-init.exe":"rustup-init.sh",e=d(k,"../../bin/"+t),u(e)?[3,2]:[4,o()];case 1:n.sent(),n.label=2;case 2:return"win32"===f()?[2,i("powershell",["-NoProfile",e],process.cwd())]:[2,i("/bin/sh",[e],process.cwd())]}}))}))}function S(r){return e(this,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return null!==function(e,n){void 0===n&&(n=[]);try{var r=s(e,t(t([],n),["--version"]));return 0===r.status?String(r.output[1]).replace(/\n/g,""):null}catch(t){return null}}("rustup")?[3,2]:(I("Installing rustup..."),[4,P()]);case 1:e.sent(),e.label=2;case 2:return r===b.Update&&i("rustup",["update"],process.cwd()),[2]}}))}))}function U(){return e(this,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,S(b.Install)];case 1:return[2,t.sent()]}}))}))}function D(){return e(this,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,S(b.Update)];case 1:return[2,t.sent()]}}))}))}var x=function(){function t(){this.type="yarn"}return t.prototype.installPackage=function(t){i("yarn",["add",t],v)},t.prototype.installDevPackage=function(t){i("yarn",["add",t,"--dev"],v)},t.prototype.updatePackage=function(t){i("yarn",["upgrade",t,"--latest"],v)},t.prototype.getPackageVersion=function(t){var e=s("yarn",["list","--pattern",t,"--depth","0"],{cwd:v}),n=String(e.output[1]),r=new RegExp(t+"@(\\S+)","g").exec(n);return(null==r?void 0:r[1])?r[1]:null},t.prototype.getLatestVersion=function(t){var e=s("yarn",["info",t,"version","--json"],{cwd:v}),n=String(e.output[1]);return JSON.parse(n).data},t}(),V=function(){function t(){this.type="npm"}return t.prototype.installPackage=function(t){i("npm",["install",t],v)},t.prototype.installDevPackage=function(t){i("npm",["install",t,"--save-dev"],v)},t.prototype.updatePackage=function(t){i("npm",["install",t+"@latest"],v)},t.prototype.getPackageVersion=function(t){var e=s("npm",["list",t,"version","--depth","0"],{cwd:v}),n=String(e.output[1]),r=new RegExp(t+"@(\\S+)","g").exec(n);return(null==r?void 0:r[1])?r[1]:null},t.prototype.getLatestVersion=function(t){var e=s("npm",["show",t,"version"],{cwd:v});return String(e.output[1]).replace("\n","")},t}(),j=function(){function t(){this.type="pnpm"}return t.prototype.installPackage=function(t){i("pnpm",["add",t],v)},t.prototype.installDevPackage=function(t){i("pnpm",["add",t,"--save-dev"],v)},t.prototype.updatePackage=function(t){i("pnpm",["add",t+"@latest"],v)},t.prototype.getPackageVersion=function(t){var e=s("pnpm",["list",t,"version","--depth","0"],{cwd:v}),n=String(e.output[1]),r=new RegExp(t+" (\\S+)","g").exec(n);return(null==r?void 0:r[1])?r[1]:null},t.prototype.getLatestVersion=function(t){var e=s("pnpm",["info",t,"version"],{cwd:v});return String(e.output[1]).replace("\n","")},t}(),C=function(){return u(m.app("yarn.lock"))?new x:u(m.app("pnpm-lock.yaml"))?new j:new V};function E(t){var e=s("cargo",["search",t,"--limit","1"]),n=String(e.output[1]),r=new RegExp(t+' = "(\\S+)"',"g").exec(n);return(null==r?void 0:r[1])?r[1]:null}function R(t,e){return t!==e}var L=y(import.meta.url)("@tauri-apps/toml"),M=a("dependency:crates"),N=["tauri"];function q(t){if(u(t)){var e=c(t).toString();return L.parse(e)}return null}function A(t,e){return"string"==typeof t?e:r(r({},t),{version:e})}function J(r){return e(this,void 0,void 0,(function(){var e,a,s,o,c,p,d,f,g,v;return n(this,(function(y){switch(y.label){case 0:if(e=[],a=[],s=new Map,null===(o=q(m.tauri("Cargo.toml"))))return M("Cargo.toml not found. Skipping crates check..."),[2,s];c=m.tauri("Cargo.lock"),u(c)||i("cargo",["generate-lockfile"],h),p=q(c),d=function(t){var i,s,u,c;return n(this,(function(n){switch(n.label){case 0:return i=p?p.package.filter((function(e){return e.name===t})):[],s=o.dependencies[t],void 0!==(u=1===i.length?i[0].version:"string"==typeof s?s:null==s?void 0:s.version)?[3,1]:(M("Installing "+t+"..."),null!==(c=E(t))&&(o.dependencies[t]=A(o.dependencies[t],c)),e.push(t),[3,6]);case 1:return r!==b.Update?[3,5]:null===(c=E(t))?[3,4]:R(u,c)?[4,w.prompt([{type:"confirm",name:"answer",message:'[CRATES] "'+t+'" latest version is '+c+". Do you want to update?",default:!1}])]:[3,3];case 2:return n.sent().answer&&(M("Updating "+t+"..."),o.dependencies[t]=A(o.dependencies[t],c),a.push(t)),[3,4];case 3:o.dependencies[t]=A(o.dependencies[t],c),a.push(t),M('"'+t+'" is up to date'),n.label=4;case 4:return[3,6];case 5:M('"'+t+'" is already installed'),n.label=6;case 6:return[2]}}))},f=0,g=N,y.label=1;case 1:return f<g.length?(v=g[f],[5,d(v)]):[3,4];case 2:y.sent(),y.label=3;case 3:return f++,[3,1];case 4:return(e.length||a.length)&&l(m.tauri("Cargo.toml"),L.stringify(o)),a.length&&(u(m.tauri("Cargo.lock"))||i("cargo",["generate-lockfile"],h),i("cargo",t(["update","--aggressive"],a.reduce((function(e,n){return t(t([],e),["-p",n])}),[])),h)),s.set(b.Install,e),s.set(b.Update,a),[2,s]}}))}))}function O(){return e(this,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,J(b.Install)];case 1:return[2,t.sent()]}}))}))}function T(){return e(this,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,J(b.Update)];case 1:return[2,t.sent()]}}))}))}var _=a("dependency:npm-packages");function z(t,r){var a,i,o;return e(this,void 0,void 0,(function(){var e,c,l,p,d,f,g,v,h,y,k,I,P;return n(this,(function(n){switch(n.label){case 0:if(e=[],c=[],l=s("npm",["--version"]),p=s("yarn",["--version"]),d=s("pnpm",["--version"]),(null!==(a=l.status)&&void 0!==a?a:l.error)&&(null!==(i=p.status)&&void 0!==i?i:p.error)&&(null!==(o=d.status)&&void 0!==o?o:d.error))throw new Error("must have installed one of the following package managers `npm`, `yarn`, `pnpm` to manage dependenices");if(!u(m.app("package.json")))return[3,10];f=0,g=r,n.label=1;case 1:return f<g.length?(v=g[f],S=v,h=C().getPackageVersion(S),y=C().type.toUpperCase(),null!==h?[3,4]:(_("Installing "+v+"..."),t!==b.Install&&t!==b.InstallDev?[3,3]:(k=t===b.InstallDev?" as dev-dependency":"",[4,w.prompt([{type:"confirm",name:"answer",message:"["+y+']: "Do you want to install '+v+k+'?"',default:!1}])]))):[3,10];case 2:n.sent().answer&&(t===b.Install?function(t){C().installPackage(t)}(v):t===b.InstallDev&&function(t){C().installDevPackage(t)}(v),e.push(v)),n.label=3;case 3:return[3,9];case 4:return t!==b.Update?[3,8]:(I=function(t){return C().getLatestVersion(t)}(v),R(h,I)?[4,w.prompt([{type:"confirm",name:"answer",message:"["+y+']: "'+v+'" latest version is '+I+". Do you want to update?",default:!1}])]:[3,6]);case 5:return n.sent().answer&&(_("Updating "+v+"..."),function(t){C().updatePackage(t)}(v),c.push(v)),[3,7];case 6:_('"'+v+'" is up to date'),n.label=7;case 7:return[3,9];case 8:_('"'+v+'" is already installed'),n.label=9;case 9:return f++,[3,1];case 10:return(P=new Map).set(b.Install,e),P.set(b.Update,c),[2,P]}var S}))}))}var B=["@tauri-apps/api","@tauri-apps/cli"];function F(){return e(this,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,z(b.Install,B)];case 1:return[2,t.sent()]}}))}))}function G(){return e(this,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,z(b.Update,B)];case 1:return[2,t.sent()]}}))}))}var H=a("dependency:manager");function K(){return e(this,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return H("Installing missing dependencies..."),[4,U()];case 1:return t.sent(),[4,O()];case 2:return t.sent(),[4,F()];case 3:return t.sent(),[2]}}))}))}function Q(){return e(this,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return H("Updating dependencies..."),[4,D()];case 1:return t.sent(),[4,T()];case 2:return t.sent(),[4,G()];case 3:return t.sent(),[2]}}))}))}export{K as installDependencies,Q as updateDependencies};
@@ -1 +0,0 @@
1
- import{_ as e,a as r}from"../tslib.es6-753a81cf.js";import*as t from"fs-extra";import n from"imagemin";import i from"imagemin-optipng";import s from"imagemin-zopfli";import o from"is-png";import a from"path";import*as c from"png2icons";import u from"read-chunk";import f from"sharp";import{t as l,a as p}from"../app-paths-46150e8b.js";import{l as d}from"../logger-27e93e7d.js";import h from"chalk";import{createRequire as g}from"module";import"fs";import"ms";var b={background_color:"#000074",theme_color:"#02aa9b",sharp:"kernel: sharp.kernel.lanczos3",minify:{batch:!1,overwrite:!0,available:["optipng","zopfli"],type:"optipng",optipngOptions:{optimizationLevel:4,paletteReduction:!0},zopfliOptions:{transparent:!0,more:!0}},splash_type:"generate",tauri:{linux:{folder:".",prefix:"",infix:!0,suffix:".png",sizes:[32,128]},linux_2x:{folder:".",prefix:"128x128@2x",infix:!1,suffix:".png",sizes:[256]},defaults:{folder:".",prefix:"icon",infix:!1,suffix:".png",sizes:[512]},appx_logo:{folder:".",prefix:"StoreLogo",infix:!1,suffix:".png",sizes:[50]},appx_square:{folder:".",prefix:"Square",infix:!0,suffix:"Logo.png",sizes:[30,44,71,89,107,142,150,284,310]}}},m=t.default,v=m.access,x=m.ensureDir,w=m.ensureFileSync,y=m.writeFileSync,k=g(import.meta.url)("../../package.json").version,z=d("app:spawn"),I=d("app:spawn",h.red),R=!1,S=null,_=function(t){return e(this,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,v(t)];case 1:return e.sent(),[2,!0];case 2:return e.sent(),[2,!1];case 3:return[2]}}))}))},O=function(t){return e(void 0,void 0,void 0,(function(){var e,n;return r(this,(function(r){switch(r.label){case 0:return!1===R?[3,1]:[2,R];case 1:return[4,_(t)];case 2:return r.sent()?[3,3]:(R=!1,S&&clearInterval(S),I("[ERROR] Source image for tauricon not found"),process.exit(1),[3,8]);case 3:return[4,u(t,0,8)];case 4:return e=r.sent(),o(e)?[4,(R=f(t)).metadata()]:[3,7];case 5:return(n=r.sent()).hasAlpha&&4===n.channels||(S&&clearInterval(S),I("[ERROR] Source png for tauricon is not transparent"),process.exit(1)),[4,R.stats()];case 6:return r.sent().isOpaque&&(S&&clearInterval(S),I("[ERROR] Source png for tauricon could not be detected as transparent"),process.exit(1)),[2,R];case 7:R=!1,S&&clearInterval(S),I("[ERROR] Source image for tauricon is not a png"),process.exit(1),r.label=8;case 8:return[2]}}))}))},j=function(e){var r=[];for(var t in e){var n=e[String(t)];n.folder&&r.push(n.folder)}return r=r.sort().filter((function(e,r,t){return!r||e!==t[r-1]}))},E=function(e){e=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(e,r,t,n){return r+r+t+t+n+n}));var r=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return r?{r:parseInt(r[1],16),g:parseInt(r[2],16),b:parseInt(r[3],16)}:void 0},B=function(t,n){return e(void 0,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return void 0===n?[3,2]:[4,x(n)];case 1:e.sent(),e.label=2;case 2:return[4,O(t)];case 3:return[2,e.sent()]}}))}))},C=function(e){process.stdout.write(" "+e+" \r")},F={validate:function(t,n){return e(this,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,B(t,n)];case 1:return e.sent(),[2,"object"==typeof R]}}))}))},version:function(){return k},make:function(t,n,i,s){return void 0===n&&(n=a.resolve(l,"icons")),e(this,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return t||(t=a.resolve(p,"app-icon.png")),S="CI"in process.env||process.argv.some((function(e){return"--ci"===e}))?null:setInterval((function(){process.stdout.write("/ \r"),setTimeout((function(){process.stdout.write("- \r"),setTimeout((function(){process.stdout.write("\\ \r"),setTimeout((function(){process.stdout.write("| \r")}),100)}),100)}),100)}),500),s=s||b.tauri,C('Building Tauri icns and ico from "'+t+'"'),[4,this.validate(t,n)];case 1:return e.sent(),[4,this.icns(t,n,s,i)];case 2:return e.sent(),C("Building Tauri png icons"),[4,this.build(t,n,s)];case 3:return e.sent(),i?(C("Minifying assets with "+i),[4,this.minify(n,s,i,"batch")]):[3,5];case 4:return e.sent(),[3,6];case 5:z("no minify strategy"),e.label=6;case 6:return C("Tauricon Finished"),S&&clearInterval(S),[2,!0]}}))}))},build:function(t,n,i){return e(this,void 0,void 0,(function(){var s,o,c,u,l,p,d,h,g,b,m,v,w,y,k,z,R,S;return r(this,(function(_){switch(_.label){case 0:return[4,this.validate(t,n)];case 1:for(l in _.sent(),s=f(t),o=function(t){return e(this,void 0,void 0,(function(){var e,n,o;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),e=s.resize(t[1],t[1]),t[2]&&(n=E(i.background_color)||{r:void 0,g:void 0,b:void 0},e.flatten({background:{r:n.r,g:n.g,b:n.b,alpha:1}})),e.png(),[4,e.toFile(t[0])];case 1:return r.sent(),[3,3];case 2:return o=r.sent(),I(o),[3,3];case 3:return[2]}}))}))},u=j(i))p=u[Number(l)],x(""+n+a.sep+p);for(h in d=[],i)d.push(h);g=0,_.label=2;case 2:if(!(g<d.length))return[3,7];for(w in b=d[g],m=i[String(b)],v=[],m.sizes)v.push(w);y=0,_.label=3;case 3:return y<v.length?(k=v[y],z=m.sizes[String(k)],m.splash?[3,5]:(R=n+"/"+m.folder,c=!0===m.infix?""+R+a.sep+m.prefix+z+"x"+z+m.suffix:""+R+a.sep+m.prefix+m.suffix,S=[c,z,m.background],[4,o(S)])):[3,6];case 4:_.sent(),_.label=5;case 5:return y++,[3,3];case 6:return g++,[3,2];case 7:return[2]}}))}))},splash:function(t,n,i,s){return e(this,void 0,void 0,(function(){var e,o,c,u,l,p,d,h,g,b,m,v,w,y,k,z,I;return r(this,(function(r){switch(r.label){case 0:return o=!1,c=E(s.background_color)||{r:void 0,g:void 0,b:void 0},n===t&&(o=!0),o||"generate"===s.splashscreen_type?[4,this.validate(t,i)]:[3,2];case 1:return r.sent(),R||process.exit(1),(u=f(t)).extend({top:726,bottom:726,left:726,right:726,background:{r:c.r,g:c.g,b:c.b,alpha:1}}).flatten({background:{r:c.r,g:c.g,b:c.b,alpha:1}}),[3,3];case 2:if("overlay"===s.splashscreen_type)u=f(n).flatten({background:{r:c.r,g:c.g,b:c.b,alpha:1}}).composite([{input:t}]);else{if("pure"!==s.splashscreen_type)throw new Error("unknown options.splashscreen_type: "+s.splashscreen_type);u=f(n).flatten({background:{r:c.r,g:c.g,b:c.b,alpha:1}})}r.label=3;case 3:return[4,u.toBuffer()];case 4:for(d in l=r.sent(),p=[],s)p.push(d);h=0,r.label=5;case 5:if(!(h<p.length))return[3,11];for(v in g=p[h],b=s[String(g)],m=[],b.sizes)m.push(v);w=0,r.label=6;case 6:return w<m.length?(y=m[w],k=b.sizes[String(y)],b.splash?(z=""+i+a.sep+b.folder,[4,x(z)]):[3,9]):[3,10];case 7:return r.sent(),e=!0===b.infix?""+z+a.sep+b.prefix+k+"x"+k+b.suffix:""+z+a.sep+b.prefix+b.suffix,I=[e,k],[4,f(l).resize(I[1][0],I[1][1]).toFile(I[0])];case 8:r.sent(),r.label=9;case 9:return w++,[3,6];case 10:return h++,[3,5];case 11:return[2]}}))}))},minify:function(t,o,c,u){return e(this,void 0,void 0,(function(){var f,l,p,d,h,g,m,v,x,w=this;return r(this,(function(y){switch(y.label){case 0:switch((l=b.minify).available.find((function(e){return e===c}))||(c=l.type),c){case"optipng":f=i(l.optipngOptions);break;case"zopfli":f=s(l.zopfliOptions);break;default:throw new Error("unknown strategy"+c)}switch(p=function(t,i){return e(w,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,n([t[0]],{destination:t[1],plugins:[i]}).catch((function(e){I(e)}))];case 1:return e.sent(),[2]}}))}))},u){case"singlefile":return[3,1];case"batch":return[3,3]}return[3,8];case 1:return[4,p([t,a.dirname(t)],f)];case 2:return y.sent(),[3,9];case 3:for(g in d=j(o),h=[],d)h.push(g);m=0,y.label=4;case 4:return m<h.length?(v=h[m],x=d[Number(v)],z("batch minify:"+String(x)),[4,p([""+t+a.sep+x+a.sep+"*.png",""+t+a.sep+x],f)]):[3,7];case 5:y.sent(),y.label=6;case 6:return m++,[3,4];case 7:return[3,9];case 8:I("[ERROR] Minify mode must be one of [ singlefile | batch]"),process.exit(1),y.label=9;case 9:return[2,"minified"]}}))}))},icns:function(t,n,i,s){return e(this,void 0,void 0,(function(){var e,i,s,o;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),R||process.exit(1),[4,this.validate(t,n)];case 1:return r.sent(),[4,f(t).toBuffer()];case 2:if(e=r.sent(),null===(i=c.createICNS(e,c.BICUBIC,0)))throw new Error("Failed to create icon.icns");if(w(a.join(n,"/icon.icns")),y(a.join(n,"/icon.icns"),i),null===(s=c.createICO(e,c.BICUBIC,0,!0)))throw new Error("Failed to create icon.ico");return w(a.join(n,"/icon.ico")),y(a.join(n,"/icon.ico"),s),[3,4];case 3:throw o=r.sent(),console.error(o),o;case 4:return[2]}}))}))}};export{F as default};
@@ -1 +0,0 @@
1
- import{existsSync as r}from"fs";import{resolve as t,sep as o,join as e,normalize as a,isAbsolute as n}from"path";import{l as i}from"./logger-27e93e7d.js";import s from"chalk";var u=i("tauri",s.red);function c(r,o){return o&&n(o)?o:t(r,o)}var f=function(){for(var t,n=null!==(t=process.env.__TAURI_TEST_APP_DIR)&&void 0!==t?t:process.cwd(),i=0;n.length>0&&!n.endsWith(o)&&i<=2;){if(r(e(n,"src-tauri","tauri.conf.json")))return n;i++,n=a(e(n,".."))}u("Couldn't recognize the current folder as a part of a Tauri project"),process.exit(1)}(),p=t(f,"src-tauri"),l={app:function(r){return c(f,r)},tauri:function(r){return c(p,r)}};export{f as a,l as r,p as t};
@@ -1 +0,0 @@
1
- import{_ as r,a as t}from"../tslib.es6-753a81cf.js";import{promisify as o}from"util";import n from"stream";import i from"fs";import e from"path";import{bootstrap as s}from"global-agent";import{fileURLToPath as a}from"url";import{createRequire as c}from"module";var u=e.dirname(a(import.meta.url)),l=c(import.meta.url)("got"),p=o(n.pipeline),m={};function f(o,n,e){return r(this,void 0,void 0,(function(){var r,a;return t(this,(function(t){switch(t.label){case 0:return r="https://github.com/tauri-apps/binary-releases/releases/download/"+o+"/"+n,a=function(){try{r in m||i.unlinkSync(e)}finally{process.exit()}},process.on("exit",a),process.on("SIGINT",a),process.on("SIGTERM",a),process.on("SIGHUP",a),process.on("SIGBREAK",a),s({environmentVariableNamespace:""}),[4,p(l.stream(r),i.createWriteStream(e)).catch((function(r){try{i.unlinkSync(e)}catch(r){}throw r}))];case 1:return t.sent(),m[r]=!0,i.chmodSync(e,448),console.log("Download Complete"),[2]}}))}))}function d(){return r(this,void 0,void 0,(function(){var r,o,n;return t(this,(function(t){switch(t.label){case 0:if("win32"===(r=process.platform))r="windows";else if("linux"===r)r="linux";else{if("darwin"!==r)throw Error("Unsupported platform");r="macos"}return o="windows"===r?".exe":"",n=e.join(u,"../../bin/tauri-cli"+o),console.log("Downloading Rust CLI..."),[4,f("tauri-cli-v1.0.0-beta.6","tauri-cli_"+r+o,n)];case 1:return t.sent(),[2]}}))}))}function h(){return r(this,void 0,void 0,(function(){var r;return t(this,(function(t){switch(t.label){case 0:return r="win32"===process.platform?"rustup-init.exe":"rustup-init.sh",console.log("Downloading Rustup..."),[4,f("rustup",r,e.join(u,"../../bin/"+r))];case 1:return[2,t.sent()]}}))}))}export{d as downloadCli,h as downloadRustup};
@@ -1 +0,0 @@
1
- import{_ as r,a as t,b as o}from"../tslib.es6-753a81cf.js";import{existsSync as i}from"fs";import{dirname as e,resolve as s,join as a}from"path";import{spawnSync as c,spawn as n}from"./spawn.js";import{downloadCli as m}from"./download-binary.js";import{fileURLToPath as p}from"url";import"cross-spawn";import"../logger-27e93e7d.js";import"chalk";import"ms";import"util";import"stream";import"global-agent";import"module";var u=e(p(import.meta.url));function l(e,p){return r(this,void 0,void 0,(function(){var r,l,f,d,w,b,g,h,v;return t(this,(function(t){switch(t.label){case 0:return r=s(u,"../.."),l=a(r,"bin/tauri-cli"+("win32"===process.platform?".exe":"")),b=new Promise((function(r,t){f=r,d=function(){return t(new Error)}})),g=function(r,t){0===r?f():d()},i(l)?(w=n(l,o(["tauri",e],p),process.cwd(),g),[3,4]):[3,1];case 1:return[4,m()];case 2:return t.sent(),w=n(l,o(["tauri",e],p),process.cwd(),g),[3,4];case 3:i(s(r,"test"))?(h=s(r,"../cli.rs"),c("cargo",["build","--release"],h),v=s(r,"../cli.rs/target/release/cargo-tauri"),w=n(v,o(["tauri",e],p),process.cwd(),g)):(c("cargo",["install","--root",r,"tauri-cli","--version","1.0.0-beta.6"],process.cwd()),w=n(l,o(["tauri",e],p),process.cwd(),g)),t.label=4;case 4:return[2,{pid:w,promise:b}]}}))}))}export{l as runOnRustCli};
@@ -1 +0,0 @@
1
- import n from"cross-spawn";import{l as i}from"../logger-27e93e7d.js";import o from"chalk";import"ms";var r=i("app:spawn"),s=i("app:spawn",o.red),t=function(i,o,s,t){var e;r('Running "'+i+" "+o.join(" ")+'"'),r();var a=n(i,o,{stdio:"inherit",cwd:s,env:process.env});return a.on("close",(function(n){var o;r(),n&&r('Command "'+i+'" failed with exit code: '+n),t&&t(null!=n?n:0,null!==(o=a.pid)&&void 0!==o?o:0)})),null!==(e=a.pid)&&void 0!==e?e:0},e=function(i,o,t,e){r('[sync] Running "'+i+" "+o.join(" ")+'"'),r();var a=n.sync(i,o,{stdio:"inherit",cwd:t});(a.status||a.error)&&(s(),s('⚠️ Command "'+i+'" failed with exit code: '+a.status),null===a.status&&s('⚠️ Please globally install "'+i+'"'),e&&e(),process.exit(1))};export{t as spawn,e as spawnSync};
@@ -1 +0,0 @@
1
- import o from"chalk";import r from"ms";var n,e=function(e,t){return void 0===t&&(t=o.green),function(i){var l=+new Date,a=l-(n||l);n=l,i?console.log(" "+t(String(e))+" "+i+" "+o.green("+"+r(a))):console.log()}};export{e as l};
@@ -1 +0,0 @@
1
- var n=function(){return(n=Object.assign||function(n){for(var t,e=1,r=arguments.length;e<r;e++)for(var o in t=arguments[e])Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o]);return n}).apply(this,arguments)};function t(n,t,e,r){return new(e||(e=Promise))((function(o,a){function l(n){try{i(r.next(n))}catch(n){a(n)}}function c(n){try{i(r.throw(n))}catch(n){a(n)}}function i(n){var t;n.done?o(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(l,c)}i((r=r.apply(n,t||[])).next())}))}function e(n,t){var e,r,o,a,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function c(a){return function(c){return function(a){if(e)throw new TypeError("Generator is already executing.");for(;l;)try{if(e=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return l.label++,{value:a[1],done:!1};case 5:l.label++,r=a[1],a=[0];continue;case 7:a=l.ops.pop(),l.trys.pop();continue;default:if(!(o=l.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){l=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){l.label=a[1];break}if(6===a[0]&&l.label<o[1]){l.label=o[1],o=a;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(a);break}o[2]&&l.ops.pop(),l.trys.pop();continue}a=t.call(n,l)}catch(n){a=[6,n],r=0}finally{e=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}function r(n,t,e){if(e||2===arguments.length)for(var r,o=0,a=t.length;o<a;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return n.concat(r||Array.prototype.slice.call(t))}export{t as _,e as a,r as b,n as c};