@tauri-apps/cli 1.0.0-beta.7 → 1.0.0-rc.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.
Files changed (48) hide show
  1. package/.github-example/workflows/CI.yml +469 -0
  2. package/CHANGELOG.md +25 -292
  3. package/Cargo.toml +16 -0
  4. package/README.md +1 -1
  5. package/build.rs +7 -0
  6. package/index.d.ts +12 -0
  7. package/index.js +241 -0
  8. package/jest.config.js +14 -0
  9. package/package.json +45 -86
  10. package/src/lib.rs +10 -0
  11. package/tauri.js +50 -0
  12. package/test/jest/__tests__/template.spec.js +41 -0
  13. package/test/jest/fixtures/app/dist/index.html +140 -0
  14. package/test/jest/fixtures/app/index.js +53 -0
  15. package/test/jest/fixtures/app/package.json +22 -0
  16. package/test/jest/fixtures/app/src-tauri/Cargo.toml +34 -0
  17. package/test/jest/fixtures/app/src-tauri/build.rs +7 -0
  18. package/test/jest/fixtures/app/src-tauri/icons/128x128.png +0 -0
  19. package/test/jest/fixtures/app/src-tauri/icons/128x128@2x.png +0 -0
  20. package/test/jest/fixtures/app/src-tauri/icons/32x32.png +0 -0
  21. package/test/jest/fixtures/app/src-tauri/icons/icon.icns +0 -0
  22. package/test/jest/fixtures/app/src-tauri/icons/icon.ico +0 -0
  23. package/test/jest/fixtures/app/src-tauri/icons/icon.png +0 -0
  24. package/test/jest/fixtures/app/src-tauri/src/main.rs +20 -0
  25. package/test/jest/fixtures/app/src-tauri/tauri.conf.json +28 -0
  26. package/test/jest/fixtures/app-test-setup.js +86 -0
  27. package/test/jest/fixtures/empty/dist/index.html +6 -0
  28. package/test/jest/fixtures/empty/package.json +1 -0
  29. package/test/jest/helpers/logger.js +25 -0
  30. package/test/jest/helpers/spawn.js +73 -0
  31. package/test/jest/jest.setup.js +6 -0
  32. package/LICENSE_APACHE-2.0 +0 -177
  33. package/LICENSE_MIT +0 -21
  34. package/bin/tauri-deps.js +0 -26
  35. package/bin/tauri-icon.js +0 -61
  36. package/bin/tauri.js +0 -101
  37. package/dist/api/cli.js +0 -2
  38. package/dist/api/cli.js.map +0 -1
  39. package/dist/api/dependency-manager.js +0 -2
  40. package/dist/api/dependency-manager.js.map +0 -1
  41. package/dist/api/tauricon.js +0 -2
  42. package/dist/api/tauricon.js.map +0 -1
  43. package/dist/helpers/download-binary.js +0 -2
  44. package/dist/helpers/download-binary.js.map +0 -1
  45. package/dist/helpers/rust-cli.js +0 -2
  46. package/dist/helpers/rust-cli.js.map +0 -1
  47. package/dist/helpers/spawn.js +0 -2
  48. package/dist/helpers/spawn.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,294 +1,27 @@
1
1
  # Changelog
2
2
 
3
- ## \[1.0.0-beta.7]
4
-
5
- - Force Cargo manifest update when running the `deps update` command and fix the version that is written to the file.
6
- - [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
7
- - The CLI is now a ES module and requires at least Node.js v12.20.
8
- - [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
9
- - Adds support to HTTPS proxy set with the `HTTPS_PROXY` environment variable.
10
- - [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
11
- - 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.
12
- - [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
13
-
14
- ## \[1.0.0-beta.6]
15
-
16
- - Run powershell commands with `-NoProfile` flag
17
- - [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
18
- - Throw error on `cli.rs` download failure instead of silent exit.
19
- - [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
20
-
21
- ## \[1.0.0-beta.5]
22
-
23
- - Improve error message when the product name is invalid.
24
- - Bumped due to a bump in cli.rs.
25
- - [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
26
-
27
- ## \[1.0.0-beta.4]
28
-
29
- - Properly detect target platform's architecture.
30
- - Bumped due to a bump in cli.rs.
31
- - [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
32
- - Fixes `build` command when the `target` arg is set.
33
- - Bumped due to a bump in cli.rs.
34
- - [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
35
-
36
- ## \[1.0.0-beta.3]
37
-
38
- - Allow empty argument when running `cli.rs`.
39
- - [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
40
-
41
- ## \[1.0.0-beta.2]
42
-
43
- - Packages are checked with `!=` instead of `semver` for beta releases.
44
- - [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
45
-
46
- ## \[1.0.0-beta.1]
47
-
48
- - Add `'self'` to default CSP because otherwise no joy on macOS.
49
- - Bumped due to a bump in cli.rs.
50
- - [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
51
- - Fix a typo that would result in bundle arg being ignored.
52
- - Bumped due to a bump in cli.rs.
53
- - [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
54
-
55
- ## \[1.0.0-beta.0]
56
-
57
- - Fixes `UnhandledPromiseRejectionWarning` when the Rust CLI call fails.
58
- - [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
59
-
60
- - Download `rustup` script on runtime instead of shipping it.
61
- - [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
62
-
63
- - Adds `pnpm` support.
64
- - [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
65
-
66
- - Updates to `tauri icon`
67
-
68
- - detect if icon is NOT transparent via metadata
69
-
70
- - detect again on pixel level
71
-
72
- - remove pngquant as a waste of space
73
-
74
- - make optipng default
75
-
76
- - relax optipng settings
77
-
78
- - [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
79
-
80
- ## \[1.0.0-beta-rc.4]
81
-
82
- - Fixes the Message `command` name value on plugin invoke handler.
83
- - Bumped due to a bump in cli.rs.
84
- - [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
85
- - [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
86
- - The package info APIs now checks the `package` object on `tauri.conf.json`.
87
- - Bumped due to a bump in cli.rs.
88
- - [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
89
- - [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
90
-
91
- ## \[1.0.0-beta-rc.3]
92
-
93
- - Remove Rust CLI download file if the download fails or the prpocess is killed.
94
- - [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
95
- - The `tauri deps` command now properly detects `beta-rc` crate updates.
96
- - [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
97
- - Update minimum Node.js version to v12.13.0
98
- - [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
99
- - The `tauri icon` command now accepts the icon path as the first positional argument instead of `--icon PATH`.
100
- - [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
101
- - Do not prompt to install dependencies on `tauri init` when the `--ci` argument is passed.
102
- - [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
103
-
104
- ## \[1.0.0-beta-rc.2]
105
-
106
- - Add missing camelcase rename for config
107
- - Bumped due to a bump in cli.rs.
108
- - [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
109
- - Fix `tauri info`
110
- - Properly detect `yarn` and `npm` versions on windows.
111
- - Fix a panic caused by a wrong field name in `metadata.json`
112
- - Bumped due to a bump in cli.rs.
113
- - [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
114
- - Sync `metadata.json` via script to update version reference to cli.js, tauri (core) and tauri-build.
115
- - Bumped due to a bump in cli.rs.
116
- - [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
117
-
118
- ## \[1.0.0-beta-rc.1]
119
-
120
- - Missing the `files` property in the package.json which mean that the `dist` directory was not published and used.
121
- - Bumped due to a bump in cli.rs.
122
- - [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
123
-
124
- ## \[1.0.0-beta-rc.0]
125
-
126
- - Fixed missing 'App' variant & string promise instead of void promise.
127
- - [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
128
- - [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
129
- - Update all code files to have our license header.
130
- - [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
131
- - [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
132
- - [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
133
- - JS CLI now downloads prebuilt Rust CLI.
134
- - [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
135
- - The `info` command was rewritten in Rust.
136
- - [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
137
- - [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
138
- - The `init` command was rewritten in Rust.
139
- - [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
140
- - [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
141
- - Removed the `no-server` mode, the `inliner`, the `dev` server proxy and the `loadAsset` API.
142
- - [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
143
- - [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
144
- - Revert `tauri create` deletion and shift remaining pieces that weren't deleted to `create-tauri-app`.
145
- - [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
146
- - [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
147
- - The Tauri API interface is now shipped with the `@tauri-apps/api` package instead of the deprecated `tauri` package.
148
- To use the new API package, delete the old `tauri` from your `package.json` and install the new package:
149
- `$ yarn remove tauri && yarn add @tauri-apps/api` or `$ npm uninstall tauri && npm install @tauri-apps/api`.
150
- And change all `import { someApi } from 'tauri/api` to `import { someApi } from '@tauri-apps/api'`.
151
- - [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
152
- - [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
153
- - The Tauri Node.js CLI package is now `@tauri-apps/cli`.
154
- - [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
155
- - [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
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
- - All the arguments passed after `tauri dev --` are now propagated to the binary.
158
- - [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
159
- - [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
160
- - 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).
161
- - [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
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
-
164
- ## \[0.14.1]
165
-
166
- - Fixed a TypeScript issue where it didn't allow you to put the "recursive" option in the directory functions.
167
- - [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
168
-
169
- ## \[0.14.0]
170
-
171
- - Update the tauri template to properly set the app icon id on Windows so the webview can load the executable icon.
172
- 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");`.
173
- \- [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
174
- - Fixes `tauri deps` command usage when `npm` is not installed.
175
- - [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
176
- - Match writeBinaryFile command name between js and rust
177
- - [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
178
-
179
- ## \[0.13.0]
180
-
181
- - Fixes `Reflect.deleteProperty` on promisified API calls failing with `Unable to delete property` by making it configurable.
182
- - [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
183
- - [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
184
- - Adds a path resolution API (e.g. getting the download directory or resolving a path to the home directory).
185
- - [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
186
- - [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
187
-
188
- ## \[0.12.0]
189
-
190
- - Break out TauriBuildConfig interface from TauriConfig build property
191
- - [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
192
- - Create recipes. A recipe:
193
- - Updates the TauriBuildConfig during the init process
194
- - Specifies npm dev and production dependencies to be installed
195
- - Runs extra installation scripts
196
- - [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
197
- - Create React JS and React TS recipes
198
- - [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
199
- - 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`
200
- - [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
201
- - Refactor `init` command so that it is just an alias for `create` with no recipe
202
- - [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
203
- - Bump all deps as noted in #975, #976, #977, #978, and #979.
204
- - [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
205
- - Make interactive prompt not ask for app name supplied as cli arg
206
- - [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
207
- - Change `String` to `string` type for `open` and `save` methods
208
- - [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
209
- - Format all code with prettier. This technically should only affect code styles, but noting for posterity.
210
- - [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
211
- - Set correct promise resolve type which returns from `readBinaryFile`
212
- - [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
213
- - Add types to JSDoc annotations
214
- - [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
215
-
216
- ## \[0.11.1]
217
-
218
- - Fix command line arguments -W (window title) and -P (dev server uri) to work as intended.
219
- - [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
220
-
221
- ## \[0.11.0]
222
-
223
- - Fixes the Webview initialization on Windows.
224
- - [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
225
-
226
- ## \[0.10.0]
227
-
228
- - Fixes the `writeFile` and `writeBinaryFile` usage.
229
- - [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
230
- - The notification's `body` is now optional, closes #793.
231
- - [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
232
- - Fixes a memory leak on the `promisified` helper usage.
233
- - [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
234
- - Prevent running the `dev` pipeline when running with administrator privileges.
235
- - [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
236
- - Print outdated dependencies information on `tauri info`.
237
- - [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
238
- - Convert the `--app-name` value to kebab case.
239
- - [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
240
- - Do not require a `package.json` file on the app root.
241
- - [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
242
- - 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).
243
- 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
244
- - Run the dependency manager's install script after `tauri init` succeeds.
245
- - [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
246
- - Move types exported in the `tauri` js api into the modules that use them. For
247
- example, `Event` is now available from `tauri/api/event` instead of
248
- `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
249
-
250
- ## \[0.9.1]
251
-
252
- - Fixes Edge blank screen on Windows when running tauri dev (Tauri crashing window due to Edge reloading app because of missing Content-Type header).
253
- - Bumped due to a bump in tauri-api.
254
- - [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
255
- - Improve the tauri info output on Windows, including the Microsoft Edge version.
256
- - [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
257
-
258
- ## \[0.9.0]
259
-
260
- - Fixes a race condition on the beforeDevCommand usage (starting Tauri before the devServer is ready).
261
- - [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
262
- - Revert a nullish coalescing operator that changed embedded server/inliner behavior.
263
- - [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
264
- - Fixes tauri init not generating tauri.conf.json on the Vue CLI Plugin.
265
- - [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
266
- - 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.
267
- - [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
268
-
269
- ## \[0.8.4]
270
-
271
- - Bump lodash to 4.17.19
272
-
273
- ## \[0.8.3]
274
-
275
- - Fixes the wrong cli value on the template that's used by tauri init.
276
- Also fixes the template test.
277
- - Fixes the tauri icon usage with the --icon flag. Previously, only the -i flag worked.
278
-
279
- ## \[0.8.2]
280
-
281
- - Adds tauri.conf.json schema validation to the CLI.
282
-
283
- ## \[0.8.1]
284
-
285
- - Transpile the TS API to ES5.
286
- Expose CJS as .js and ESM as .mjs.
287
- - Fixes the assets embedding into the binary.
288
-
289
- ## \[0.8.0]
290
-
291
- - Create UMD, ESM and CJS artifacts for the JavaScript API entry point from TS source using rollup.
292
- - Renaming `window.tauri` to `window.__TAURI__`, closing #435.
293
- The **Tauri** object now follows the TypeScript API structure (e.g. `window.tauri.readTextFile` is now `window.__TAURI__.fs.readTextFile`).
294
- 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.1]
4
+
5
+ - Fix `init` command prompting for values even if the argument has been provided on the command line.
6
+ - [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
7
+ - [41052dee](https://www.github.com/tauri-apps/tauri/commit/41052deeda2a00ee2b8ec2041c9c87c11de82ab2) fix(covector): add cli.js to change files on 2022-02-11
8
+ - Fixes CLI freezing when running `light.exe` on Windows without the `--verbose` flag.
9
+ - [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
10
+ - Respect `.gitignore` configuration when looking for the folder with the `tauri.conf.json` file.
11
+ - [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
12
+ - [41052dee](https://www.github.com/tauri-apps/tauri/commit/41052deeda2a00ee2b8ec2041c9c87c11de82ab2) fix(covector): add cli.js to change files on 2022-02-11
13
+
14
+ ## \[1.0.0-rc.0]
15
+
16
+ - 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.
17
+ - [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
18
+ - Added CommonJS output to the `dist` folder.
19
+ - [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
20
+ - Fixes `.ico` icon generation.
21
+ - [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
22
+ - Automatically unplug `@tauri-apps/cli` in yarn 2+ installations to fix the download of the rust-cli.
23
+ - [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
24
+ - Read `package.json` and check for a `tauri` object containing the `appPath` string, which points to the tauri crate path.
25
+ - [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
26
+ - Removed the `icon` command, now exposed as a separate package, see https://github.com/tauri-apps/tauricon.
27
+ - [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): 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