electron-cli 0.2.8 → 0.3.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Cargo.lock +266 -0
- package/Cargo.toml +14 -0
- package/LICENSE +15 -14
- package/README.md +60 -51
- package/bin/electron-cli.js +50 -0
- package/package.json +37 -79
- package/rust-toolchain.toml +3 -0
- package/scripts/install.js +101 -0
- package/src/cli.rs +36 -0
- package/src/commands/doctor.rs +355 -0
- package/src/commands/inspect.rs +63 -0
- package/src/commands/mod.rs +3 -0
- package/src/commands/plan.rs +235 -0
- package/src/main.rs +25 -0
- package/src/output.rs +7 -0
- package/src/project.rs +320 -0
- package/tests/fixtures/electron-forge/package-lock.json +23 -0
- package/tests/fixtures/electron-forge/package.json +21 -0
- package/tests/fixtures/electron-forge/src/main.ts +8 -0
- package/.babelrc +0 -14
- package/.eslintrc +0 -7
- package/.npmignore +0 -49
- package/dist/cli.js +0 -15
- package/dist/commands/init.js +0 -286
- package/dist/commands/pack.js +0 -78
- package/dist/commands/start.js +0 -76
- package/dist/commands/stats.js +0 -79
- package/dist/init/dir.js +0 -29
- package/dist/init/git.js +0 -25
- package/dist/init/json.js +0 -31
- package/dist/init/npm.js +0 -17
- package/dist/util/change-dir.js +0 -22
- package/dist/util/get-versions.js +0 -53
- package/dist/util/pack.js +0 -17
- package/dist/util/path-from-cwd.js +0 -13
- package/dist/util/start-electron.js +0 -51
- package/dist/util/terminate.js +0 -25
- package/dist/util/version.js +0 -10
- package/dist/validate/check-system.js +0 -56
- package/dist/validate/name.js +0 -34
- package/gulpfile.js +0 -94
- package/yarn.lock +0 -4118
package/Cargo.lock
ADDED
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
# This file is automatically @generated by Cargo.
|
|
2
|
+
# It is not intended for manual editing.
|
|
3
|
+
version = 4
|
|
4
|
+
|
|
5
|
+
[[package]]
|
|
6
|
+
name = "anstream"
|
|
7
|
+
version = "1.0.0"
|
|
8
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
9
|
+
checksum = "824a212faf96e9acacdbd09febd34438f8f711fb84e09a8916013cd7815ca28d"
|
|
10
|
+
dependencies = [
|
|
11
|
+
"anstyle",
|
|
12
|
+
"anstyle-parse",
|
|
13
|
+
"anstyle-query",
|
|
14
|
+
"anstyle-wincon",
|
|
15
|
+
"colorchoice",
|
|
16
|
+
"is_terminal_polyfill",
|
|
17
|
+
"utf8parse",
|
|
18
|
+
]
|
|
19
|
+
|
|
20
|
+
[[package]]
|
|
21
|
+
name = "anstyle"
|
|
22
|
+
version = "1.0.14"
|
|
23
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
24
|
+
checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000"
|
|
25
|
+
|
|
26
|
+
[[package]]
|
|
27
|
+
name = "anstyle-parse"
|
|
28
|
+
version = "1.0.0"
|
|
29
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
30
|
+
checksum = "52ce7f38b242319f7cabaa6813055467063ecdc9d355bbb4ce0c68908cd8130e"
|
|
31
|
+
dependencies = [
|
|
32
|
+
"utf8parse",
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
[[package]]
|
|
36
|
+
name = "anstyle-query"
|
|
37
|
+
version = "1.1.5"
|
|
38
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
39
|
+
checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc"
|
|
40
|
+
dependencies = [
|
|
41
|
+
"windows-sys",
|
|
42
|
+
]
|
|
43
|
+
|
|
44
|
+
[[package]]
|
|
45
|
+
name = "anstyle-wincon"
|
|
46
|
+
version = "3.0.11"
|
|
47
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
48
|
+
checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d"
|
|
49
|
+
dependencies = [
|
|
50
|
+
"anstyle",
|
|
51
|
+
"once_cell_polyfill",
|
|
52
|
+
"windows-sys",
|
|
53
|
+
]
|
|
54
|
+
|
|
55
|
+
[[package]]
|
|
56
|
+
name = "anyhow"
|
|
57
|
+
version = "1.0.102"
|
|
58
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
59
|
+
checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c"
|
|
60
|
+
|
|
61
|
+
[[package]]
|
|
62
|
+
name = "camino"
|
|
63
|
+
version = "1.2.2"
|
|
64
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
65
|
+
checksum = "e629a66d692cb9ff1a1c664e41771b3dcaf961985a9774c0eb0bd1b51cf60a48"
|
|
66
|
+
dependencies = [
|
|
67
|
+
"serde_core",
|
|
68
|
+
]
|
|
69
|
+
|
|
70
|
+
[[package]]
|
|
71
|
+
name = "clap"
|
|
72
|
+
version = "4.6.1"
|
|
73
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
74
|
+
checksum = "1ddb117e43bbf7dacf0a4190fef4d345b9bad68dfc649cb349e7d17d28428e51"
|
|
75
|
+
dependencies = [
|
|
76
|
+
"clap_builder",
|
|
77
|
+
"clap_derive",
|
|
78
|
+
]
|
|
79
|
+
|
|
80
|
+
[[package]]
|
|
81
|
+
name = "clap_builder"
|
|
82
|
+
version = "4.6.0"
|
|
83
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
84
|
+
checksum = "714a53001bf66416adb0e2ef5ac857140e7dc3a0c48fb28b2f10762fc4b5069f"
|
|
85
|
+
dependencies = [
|
|
86
|
+
"anstream",
|
|
87
|
+
"anstyle",
|
|
88
|
+
"clap_lex",
|
|
89
|
+
"strsim",
|
|
90
|
+
]
|
|
91
|
+
|
|
92
|
+
[[package]]
|
|
93
|
+
name = "clap_derive"
|
|
94
|
+
version = "4.6.1"
|
|
95
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
96
|
+
checksum = "f2ce8604710f6733aa641a2b3731eaa1e8b3d9973d5e3565da11800813f997a9"
|
|
97
|
+
dependencies = [
|
|
98
|
+
"heck",
|
|
99
|
+
"proc-macro2",
|
|
100
|
+
"quote",
|
|
101
|
+
"syn",
|
|
102
|
+
]
|
|
103
|
+
|
|
104
|
+
[[package]]
|
|
105
|
+
name = "clap_lex"
|
|
106
|
+
version = "1.1.0"
|
|
107
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
108
|
+
checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9"
|
|
109
|
+
|
|
110
|
+
[[package]]
|
|
111
|
+
name = "colorchoice"
|
|
112
|
+
version = "1.0.5"
|
|
113
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
114
|
+
checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570"
|
|
115
|
+
|
|
116
|
+
[[package]]
|
|
117
|
+
name = "electron-cli"
|
|
118
|
+
version = "0.3.0-alpha.1"
|
|
119
|
+
dependencies = [
|
|
120
|
+
"anyhow",
|
|
121
|
+
"camino",
|
|
122
|
+
"clap",
|
|
123
|
+
"serde",
|
|
124
|
+
"serde_json",
|
|
125
|
+
]
|
|
126
|
+
|
|
127
|
+
[[package]]
|
|
128
|
+
name = "heck"
|
|
129
|
+
version = "0.5.0"
|
|
130
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
131
|
+
checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
|
|
132
|
+
|
|
133
|
+
[[package]]
|
|
134
|
+
name = "is_terminal_polyfill"
|
|
135
|
+
version = "1.70.2"
|
|
136
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
137
|
+
checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695"
|
|
138
|
+
|
|
139
|
+
[[package]]
|
|
140
|
+
name = "itoa"
|
|
141
|
+
version = "1.0.18"
|
|
142
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
143
|
+
checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682"
|
|
144
|
+
|
|
145
|
+
[[package]]
|
|
146
|
+
name = "memchr"
|
|
147
|
+
version = "2.8.1"
|
|
148
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
149
|
+
checksum = "6b947ae49db0d222b1dbc6b113ce7248a3fc3a6ca21b696717bfc000ba4484d8"
|
|
150
|
+
|
|
151
|
+
[[package]]
|
|
152
|
+
name = "once_cell_polyfill"
|
|
153
|
+
version = "1.70.2"
|
|
154
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
155
|
+
checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe"
|
|
156
|
+
|
|
157
|
+
[[package]]
|
|
158
|
+
name = "proc-macro2"
|
|
159
|
+
version = "1.0.106"
|
|
160
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
161
|
+
checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934"
|
|
162
|
+
dependencies = [
|
|
163
|
+
"unicode-ident",
|
|
164
|
+
]
|
|
165
|
+
|
|
166
|
+
[[package]]
|
|
167
|
+
name = "quote"
|
|
168
|
+
version = "1.0.45"
|
|
169
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
170
|
+
checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924"
|
|
171
|
+
dependencies = [
|
|
172
|
+
"proc-macro2",
|
|
173
|
+
]
|
|
174
|
+
|
|
175
|
+
[[package]]
|
|
176
|
+
name = "serde"
|
|
177
|
+
version = "1.0.228"
|
|
178
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
179
|
+
checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e"
|
|
180
|
+
dependencies = [
|
|
181
|
+
"serde_core",
|
|
182
|
+
"serde_derive",
|
|
183
|
+
]
|
|
184
|
+
|
|
185
|
+
[[package]]
|
|
186
|
+
name = "serde_core"
|
|
187
|
+
version = "1.0.228"
|
|
188
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
189
|
+
checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad"
|
|
190
|
+
dependencies = [
|
|
191
|
+
"serde_derive",
|
|
192
|
+
]
|
|
193
|
+
|
|
194
|
+
[[package]]
|
|
195
|
+
name = "serde_derive"
|
|
196
|
+
version = "1.0.228"
|
|
197
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
198
|
+
checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79"
|
|
199
|
+
dependencies = [
|
|
200
|
+
"proc-macro2",
|
|
201
|
+
"quote",
|
|
202
|
+
"syn",
|
|
203
|
+
]
|
|
204
|
+
|
|
205
|
+
[[package]]
|
|
206
|
+
name = "serde_json"
|
|
207
|
+
version = "1.0.150"
|
|
208
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
209
|
+
checksum = "e8014e44b4736ed0538adeecded0fce2a272f22dc9578a7eb6b2d9993c74cfb9"
|
|
210
|
+
dependencies = [
|
|
211
|
+
"itoa",
|
|
212
|
+
"memchr",
|
|
213
|
+
"serde",
|
|
214
|
+
"serde_core",
|
|
215
|
+
"zmij",
|
|
216
|
+
]
|
|
217
|
+
|
|
218
|
+
[[package]]
|
|
219
|
+
name = "strsim"
|
|
220
|
+
version = "0.11.1"
|
|
221
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
222
|
+
checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f"
|
|
223
|
+
|
|
224
|
+
[[package]]
|
|
225
|
+
name = "syn"
|
|
226
|
+
version = "2.0.117"
|
|
227
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
228
|
+
checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99"
|
|
229
|
+
dependencies = [
|
|
230
|
+
"proc-macro2",
|
|
231
|
+
"quote",
|
|
232
|
+
"unicode-ident",
|
|
233
|
+
]
|
|
234
|
+
|
|
235
|
+
[[package]]
|
|
236
|
+
name = "unicode-ident"
|
|
237
|
+
version = "1.0.24"
|
|
238
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
239
|
+
checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75"
|
|
240
|
+
|
|
241
|
+
[[package]]
|
|
242
|
+
name = "utf8parse"
|
|
243
|
+
version = "0.2.2"
|
|
244
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
245
|
+
checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821"
|
|
246
|
+
|
|
247
|
+
[[package]]
|
|
248
|
+
name = "windows-link"
|
|
249
|
+
version = "0.2.1"
|
|
250
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
251
|
+
checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
|
|
252
|
+
|
|
253
|
+
[[package]]
|
|
254
|
+
name = "windows-sys"
|
|
255
|
+
version = "0.61.2"
|
|
256
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
257
|
+
checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc"
|
|
258
|
+
dependencies = [
|
|
259
|
+
"windows-link",
|
|
260
|
+
]
|
|
261
|
+
|
|
262
|
+
[[package]]
|
|
263
|
+
name = "zmij"
|
|
264
|
+
version = "1.0.21"
|
|
265
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
266
|
+
checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa"
|
package/Cargo.toml
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
[package]
|
|
2
|
+
name = "electron-cli"
|
|
3
|
+
version = "0.3.0-alpha.1"
|
|
4
|
+
edition = "2021"
|
|
5
|
+
description = "Experimental Rust CLI for Electron project diagnostics and workflow automation"
|
|
6
|
+
license = "MIT"
|
|
7
|
+
repository = "https://github.com/Ikana/electron-cli"
|
|
8
|
+
|
|
9
|
+
[dependencies]
|
|
10
|
+
anyhow = "1.0"
|
|
11
|
+
camino = { version = "1.1", features = ["serde1"] }
|
|
12
|
+
clap = { version = "4.6", features = ["derive"] }
|
|
13
|
+
serde = { version = "1.0", features = ["derive"] }
|
|
14
|
+
serde_json = "1.0"
|
package/LICENSE
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
Copyright (c) 2016 Samuel Attard
|
|
1
|
+
MIT License
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
the Software
|
|
9
|
-
|
|
3
|
+
Copyright (c) 2026 Roderik
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
10
11
|
|
|
11
12
|
The above copyright notice and this permission notice shall be included in all
|
|
12
13
|
copies or substantial portions of the Software.
|
|
13
14
|
|
|
14
15
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
-
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
-
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18
|
-
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
19
|
-
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
|
-
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,80 +1,89 @@
|
|
|
1
|
-
electron-cli
|
|
2
|
-
==============================================================================
|
|
1
|
+
# electron-cli
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
[npm-badge-url]: https://www.npmjs.com/package/electron-cli
|
|
3
|
+
`electron-cli` is an experimental Rust CLI for Electron project diagnostics and workflow automation.
|
|
6
4
|
|
|
7
|
-
|
|
8
|
-
[](https://www.npmjs.com/package/electron-cli)
|
|
9
|
-
[](https://www.npmjs.com/package/electron-cli)
|
|
10
|
-
[](https://github.com/Ikana/electron-cli/blob/master/LICENSE)
|
|
5
|
+
This is an independent learning project. It is not affiliated with Electron, Electron Forge, the OpenJS Foundation, or GitHub. The project may wrap existing Electron ecosystem tools while exploring what a Rust-native Electron workflow could feel like.
|
|
11
6
|
|
|
12
|
-
|
|
7
|
+
## Status
|
|
13
8
|
|
|
14
|
-
|
|
9
|
+
This repository is intentionally small and public-learning friendly. The first useful surface area is inspection and diagnostics, because those commands are valuable for humans and easy for agents to consume safely.
|
|
15
10
|
|
|
16
|
-
|
|
17
|
-
------------------------------------------------------------------------------
|
|
11
|
+
Current commands:
|
|
18
12
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
13
|
+
```sh
|
|
14
|
+
electron-cli inspect
|
|
15
|
+
electron-cli doctor
|
|
16
|
+
electron-cli plan
|
|
17
|
+
electron-cli inspect --json
|
|
18
|
+
electron-cli doctor --json
|
|
19
|
+
electron-cli plan --json
|
|
20
|
+
```
|
|
24
21
|
|
|
22
|
+
Planned commands:
|
|
25
23
|
|
|
26
|
-
|
|
24
|
+
```sh
|
|
25
|
+
electron-cli dev
|
|
26
|
+
electron-cli init
|
|
27
|
+
electron-cli package
|
|
28
|
+
electron-cli make
|
|
29
|
+
```
|
|
27
30
|
|
|
28
|
-
|
|
31
|
+
The planned workflow commands may start by wrapping Electron Forge or other established tools. Rust-native implementations can replace narrow pieces over time when there is a clear reason.
|
|
29
32
|
|
|
30
|
-
|
|
31
|
-
npm install -g electron-cli
|
|
32
|
-
electron-cli init new-app
|
|
33
|
-
cd new-app
|
|
34
|
-
electron-cli start
|
|
35
|
-
```
|
|
33
|
+
## Install
|
|
36
34
|
|
|
37
|
-
|
|
38
|
-
------------------------------------------------------------------------------
|
|
35
|
+
During the experimental phase, the npm package downloads a prebuilt binary from GitHub Releases when one is available. If a prebuilt binary is not available for your platform, it falls back to running from Rust source.
|
|
39
36
|
|
|
40
|
-
```
|
|
37
|
+
```sh
|
|
41
38
|
npm install -g electron-cli
|
|
39
|
+
electron-cli doctor
|
|
42
40
|
```
|
|
43
41
|
|
|
44
|
-
|
|
45
|
-
------------------------------------------------------------------------------
|
|
42
|
+
To skip binary download and use the Cargo fallback:
|
|
46
43
|
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
```sh
|
|
45
|
+
ELECTRON_CLI_SKIP_DOWNLOAD=1 npm install -g electron-cli@alpha
|
|
46
|
+
```
|
|
49
47
|
|
|
50
|
-
|
|
48
|
+
For local development:
|
|
51
49
|
|
|
50
|
+
```sh
|
|
51
|
+
npm install
|
|
52
|
+
npm run build
|
|
53
|
+
npm test
|
|
54
|
+
npm run dev -- doctor
|
|
52
55
|
```
|
|
53
|
-
|
|
56
|
+
|
|
57
|
+
Or use Cargo directly:
|
|
58
|
+
|
|
59
|
+
```sh
|
|
60
|
+
cargo run -- doctor
|
|
61
|
+
cargo run -- inspect --json
|
|
54
62
|
```
|
|
55
63
|
|
|
56
|
-
|
|
57
|
-
adds the basic electron quick start project.
|
|
64
|
+
## Design Goals
|
|
58
65
|
|
|
59
|
-
|
|
66
|
+
- Learn Rust through a real developer tool.
|
|
67
|
+
- Make Electron project state easy to inspect.
|
|
68
|
+
- Prefer structured output for agentic workflows.
|
|
69
|
+
- Wrap proven ecosystem tools before replacing them.
|
|
70
|
+
- Keep the project clearly independent and experimental.
|
|
60
71
|
|
|
61
|
-
|
|
62
|
-
electron-cli stats
|
|
63
|
-
```
|
|
64
|
-
This will print the versions of the current installed electron instance
|
|
72
|
+
## Non-Goals
|
|
65
73
|
|
|
66
|
-
|
|
74
|
+
- This is not an official Electron project.
|
|
75
|
+
- This is not an Electron Forge fork or drop-in replacement today.
|
|
76
|
+
- This will not claim Forge parity until the behavior is tested and documented.
|
|
67
77
|
|
|
68
|
-
|
|
69
|
-
electron-cli start --global
|
|
70
|
-
```
|
|
71
|
-
This will run the electron application on the current directory, if you provide the
|
|
72
|
-
global flag it will run the application with the globally installed electron instance.
|
|
78
|
+
## JSON Output
|
|
73
79
|
|
|
74
|
-
|
|
80
|
+
Both initial commands support `--json` so agents and scripts can consume project state without scraping terminal output.
|
|
81
|
+
`plan` is designed around that workflow: it recommends stable commands and reports missing project conventions as structured data.
|
|
75
82
|
|
|
83
|
+
```sh
|
|
84
|
+
electron-cli plan --json
|
|
76
85
|
```
|
|
77
|
-
electron-cli pack
|
|
78
|
-
```
|
|
79
86
|
|
|
80
|
-
|
|
87
|
+
## License
|
|
88
|
+
|
|
89
|
+
MIT
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { spawnSync } = require("node:child_process");
|
|
4
|
+
const fs = require("node:fs");
|
|
5
|
+
const path = require("node:path");
|
|
6
|
+
|
|
7
|
+
const root = path.resolve(__dirname, "..");
|
|
8
|
+
const exe = process.platform === "win32" ? "electron-cli.exe" : "electron-cli";
|
|
9
|
+
const args = process.argv.slice(2);
|
|
10
|
+
const envBinary = process.env.ELECTRON_CLI_BINARY;
|
|
11
|
+
|
|
12
|
+
const candidates = [
|
|
13
|
+
envBinary,
|
|
14
|
+
path.join(root, "bin", "downloaded", exe),
|
|
15
|
+
path.join(root, "target", "release", exe),
|
|
16
|
+
path.join(root, "target", "debug", exe),
|
|
17
|
+
].filter(Boolean);
|
|
18
|
+
|
|
19
|
+
const binary = candidates.find((candidate) => fs.existsSync(candidate));
|
|
20
|
+
|
|
21
|
+
if (binary) {
|
|
22
|
+
exitWith(spawnSync(binary, args, { stdio: "inherit" }));
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const cargo = process.platform === "win32" ? "cargo.exe" : "cargo";
|
|
26
|
+
const manifest = path.join(root, "Cargo.toml");
|
|
27
|
+
|
|
28
|
+
if (!fs.existsSync(manifest)) {
|
|
29
|
+
console.error("electron-cli could not find its Rust sources.");
|
|
30
|
+
console.error("Reinstall the package or build a release binary before running this command.");
|
|
31
|
+
process.exit(1);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
console.error("electron-cli could not find a prebuilt binary for this install.");
|
|
35
|
+
console.error("Building/running through Cargo fallback; install Rust from https://rustup.rs if this fails.");
|
|
36
|
+
|
|
37
|
+
exitWith(
|
|
38
|
+
spawnSync(cargo, ["run", "--quiet", "--manifest-path", manifest, "--", ...args], {
|
|
39
|
+
stdio: "inherit",
|
|
40
|
+
}),
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
function exitWith(result) {
|
|
44
|
+
if (result.error) {
|
|
45
|
+
console.error(result.error.message);
|
|
46
|
+
process.exit(1);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
process.exit(result.status ?? 1);
|
|
50
|
+
}
|
package/package.json
CHANGED
|
@@ -1,89 +1,47 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "electron-cli",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
"
|
|
3
|
+
"version": "0.3.0-alpha.1",
|
|
4
|
+
"description": "Experimental Rust CLI for Electron project diagnostics and workflow automation",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/Ikana/electron-cli.git"
|
|
9
|
+
},
|
|
10
|
+
"homepage": "https://github.com/Ikana/electron-cli#readme",
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/Ikana/electron-cli/issues"
|
|
13
13
|
},
|
|
14
14
|
"bin": {
|
|
15
|
-
"electron-cli": "
|
|
15
|
+
"electron-cli": "bin/electron-cli.js"
|
|
16
16
|
},
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
17
|
+
"files": [
|
|
18
|
+
"bin/electron-cli.js",
|
|
19
|
+
"scripts",
|
|
20
|
+
"src",
|
|
21
|
+
"tests",
|
|
22
|
+
"Cargo.toml",
|
|
23
|
+
"Cargo.lock",
|
|
24
|
+
"rust-toolchain.toml",
|
|
25
|
+
"README.md",
|
|
26
|
+
"LICENSE"
|
|
27
|
+
],
|
|
28
|
+
"scripts": {
|
|
29
|
+
"build": "cargo build --release",
|
|
30
|
+
"dev": "cargo run --",
|
|
31
|
+
"format": "cargo fmt",
|
|
32
|
+
"lint": "cargo fmt --check && cargo clippy --all-targets -- -D warnings",
|
|
33
|
+
"test": "cargo test",
|
|
34
|
+
"postinstall": "node scripts/install.js",
|
|
35
|
+
"prepack": "cargo build --release"
|
|
36
|
+
},
|
|
37
|
+
"engines": {
|
|
38
|
+
"node": ">=18"
|
|
20
39
|
},
|
|
21
|
-
"homepage": "https://github.com/Ikana/electron-cli",
|
|
22
40
|
"keywords": [
|
|
23
41
|
"electron",
|
|
24
42
|
"cli",
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
"license": "MIT",
|
|
30
|
-
"dependencies": {
|
|
31
|
-
"babel-runtime": "^6.18.0",
|
|
32
|
-
"chalk": "^1.1.3",
|
|
33
|
-
"cli-table2": "^0.2.0",
|
|
34
|
-
"configstore": "^2.1.0",
|
|
35
|
-
"denodeify": "^1.2.1",
|
|
36
|
-
"electron-packager": "^8.3.0",
|
|
37
|
-
"exit": "^0.1.2",
|
|
38
|
-
"inquirer": "^1.2.1",
|
|
39
|
-
"jsonfile": "^2.4.0",
|
|
40
|
-
"leek": "0.0.23",
|
|
41
|
-
"mkdirp": "^0.5.1",
|
|
42
|
-
"node-fetch": "^1.6.3",
|
|
43
|
-
"nopt": "^3.0.6",
|
|
44
|
-
"ora": "^0.3.0",
|
|
45
|
-
"resolve": "^1.1.7",
|
|
46
|
-
"semver": "^5.3.0",
|
|
47
|
-
"username": "^2.2.2",
|
|
48
|
-
"validate-npm-package-name": "^2.2.2",
|
|
49
|
-
"yargs": "^5.0.0"
|
|
50
|
-
},
|
|
51
|
-
"devDependencies": {
|
|
52
|
-
"babel-plugin-istanbul": "^3.0.0",
|
|
53
|
-
"babel-plugin-syntax-async-functions": "^6.13.0",
|
|
54
|
-
"babel-plugin-transform-async-to-generator": "^6.16.0",
|
|
55
|
-
"babel-plugin-transform-object-rest-spread": "^6.19.0",
|
|
56
|
-
"babel-plugin-transform-runtime": "^6.15.0",
|
|
57
|
-
"babel-preset-es2015": "^6.18.0",
|
|
58
|
-
"babel-preset-stage-2": "^6.18.0",
|
|
59
|
-
"chai": "^3.5.0",
|
|
60
|
-
"del": "^2.2.2",
|
|
61
|
-
"eslint": "^3.10.0",
|
|
62
|
-
"eslint-config-airbnb-base": "^10.0.1",
|
|
63
|
-
"eslint-config-standard": "^6.2.1",
|
|
64
|
-
"eslint-plugin-import": "^2.2.0",
|
|
65
|
-
"eslint-plugin-promise": "^3.3.2",
|
|
66
|
-
"eslint-plugin-standard": "^2.0.1",
|
|
67
|
-
"gulp": "^3.9.1",
|
|
68
|
-
"gulp-babel": "^6.1.2",
|
|
69
|
-
"gulp-chmod": "^2.0.0",
|
|
70
|
-
"gulp-eslint": "^3.0.1",
|
|
71
|
-
"gulp-mocha": "^3.0.1",
|
|
72
|
-
"gulp-util": "^3.0.7",
|
|
73
|
-
"mocha": "^3.1.0",
|
|
74
|
-
"mock-fs": "^3.12.1",
|
|
75
|
-
"nyc": "^9.0.1",
|
|
76
|
-
"run-sequence": "^1.2.2",
|
|
77
|
-
"stream-combiner2": "^1.1.1"
|
|
78
|
-
},
|
|
79
|
-
"nyc": {
|
|
80
|
-
"include": [
|
|
81
|
-
"src/**/*.js"
|
|
82
|
-
],
|
|
83
|
-
"require": [
|
|
84
|
-
"babel-register"
|
|
85
|
-
],
|
|
86
|
-
"sourceMap": false,
|
|
87
|
-
"instrument": false
|
|
88
|
-
}
|
|
43
|
+
"rust",
|
|
44
|
+
"diagnostics",
|
|
45
|
+
"agentic-engineering"
|
|
46
|
+
]
|
|
89
47
|
}
|