electron-cli 0.2.6 → 0.3.0-alpha.0

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 (45) hide show
  1. package/Cargo.lock +266 -0
  2. package/Cargo.toml +14 -0
  3. package/LICENSE +15 -14
  4. package/README.md +55 -52
  5. package/bin/electron-cli.js +47 -0
  6. package/package.json +35 -80
  7. package/rust-toolchain.toml +3 -0
  8. package/src/cli.rs +36 -0
  9. package/src/commands/doctor.rs +355 -0
  10. package/src/commands/inspect.rs +63 -0
  11. package/src/commands/mod.rs +3 -0
  12. package/src/commands/plan.rs +235 -0
  13. package/src/main.rs +25 -0
  14. package/src/output.rs +7 -0
  15. package/src/project.rs +320 -0
  16. package/tests/fixtures/electron-forge/package-lock.json +23 -0
  17. package/tests/fixtures/electron-forge/package.json +21 -0
  18. package/tests/fixtures/electron-forge/src/main.ts +8 -0
  19. package/.babelrc +0 -14
  20. package/.eslintrc +0 -7
  21. package/.npmignore +0 -48
  22. package/dist/cli.js +0 -15
  23. package/dist/commands/init.js +0 -247
  24. package/dist/commands/pack.js +0 -78
  25. package/dist/commands/start.js +0 -76
  26. package/dist/commands/stats.js +0 -79
  27. package/dist/init/dir.js +0 -29
  28. package/dist/init/git.js +0 -25
  29. package/dist/init/json.js +0 -31
  30. package/dist/init/npm.js +0 -17
  31. package/dist/templates/index.html +0 -13
  32. package/dist/templates/main.js +0 -55
  33. package/dist/util/change-dir.js +0 -22
  34. package/dist/util/get-versions.js +0 -53
  35. package/dist/util/pack.js +0 -17
  36. package/dist/util/path-from-cwd.js +0 -13
  37. package/dist/util/start-electron.js +0 -51
  38. package/dist/util/terminate.js +0 -25
  39. package/dist/util/version.js +0 -10
  40. package/dist/validate/check-system.js +0 -56
  41. package/dist/validate/name.js +0 -34
  42. package/gulpfile.js +0 -94
  43. package/templates/index.html +0 -13
  44. package/templates/main.js +0 -55
  45. package/yarn.lock +0 -4158
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.0"
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.0"
4
+ edition = "2021"
5
+ description = "Experimental Rust CLI for Electron project diagnostics and workflow automation"
6
+ license = "MIT"
7
+ repository = "https://github.com/roderik/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
- The MIT License (MIT)
2
- Copyright (c) 2016 Samuel Attard
1
+ MIT License
3
2
 
4
- Permission is hereby granted, free of charge, to any person obtaining a copy of
5
- this software and associated documentation files (the "Software"), to deal in
6
- the Software without restriction, including without limitation the rights to
7
- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
8
- the Software, and to permit persons to whom the Software is furnished to do so,
9
- subject to the following conditions:
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, FITNESS
16
- FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
17
- COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
18
- IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
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,83 @@
1
- electron-cli
2
- ==============================================================================
1
+ # electron-cli
3
2
 
4
- [npm-badge]: https://img.shields.io/npm/v/ember-cli.svg
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
- [![Latest NPM release][npm-badge]][npm-badge-url]
8
- [![npm version](https://badge.fury.io/js/electron-cli.svg)](https://www.npmjs.com/package/electron-cli)
9
- [![npm](https://img.shields.io/npm/dt/electron-cli.svg?maxAge=2592000)](https://www.npmjs.com/package/electron-cli)
10
- [![license](https://img.shields.io/github/license/electron-userland/electron-forge.svg)](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
- An [electron](http://electron.atom.io/) command line utility.
7
+ ## Status
13
8
 
14
- [Repo](https://github.com/Ikana/electron-cli)
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
- Features
17
- ------------------------------------------------------------------------------
11
+ Current commands:
18
12
 
19
- * [done] Create new project
20
- * [done] Get useful electron info such as(version numbers of Chromium, Node.js , and electron-cli)
21
- * [done] Run the electron app on the current directory either with the locally installed electron or the global one
22
- * [done] Pack the application for distribution
23
- * [wip] Build native node modules
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
- # Getting Started
24
+ ```sh
25
+ electron-cli dev
26
+ electron-cli init
27
+ electron-cli package
28
+ electron-cli make
29
+ ```
27
30
 
28
- **Note**: Electron Cli requires Node 6 or above, plus git installed.
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
- ```bash
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
- Installation
38
- ------------------------------------------------------------------------------
35
+ During the experimental phase, the npm package runs from Rust source when a prebuilt binary is not available. You need Node.js and Rust installed.
39
36
 
40
- ```
37
+ ```sh
41
38
  npm install -g electron-cli
39
+ electron-cli doctor
42
40
  ```
43
41
 
44
- Usage
45
- ------------------------------------------------------------------------------
42
+ For local development:
46
43
 
47
- After installation the `electron` CLI tool will be available to you. It is the
48
- entrypoint for all the functionality marked as done above.
44
+ ```sh
45
+ npm install
46
+ npm run build
47
+ npm test
48
+ npm run dev -- doctor
49
+ ```
49
50
 
50
- ### Create a new project
51
+ Or use Cargo directly:
51
52
 
52
- ```
53
- electron-cli init my-new-app
53
+ ```sh
54
+ cargo run -- doctor
55
+ cargo run -- inspect --json
54
56
  ```
55
57
 
56
- This will create a new folder `my-new-app`, initialize a Git project in it and
57
- adds the basic electron quick start project.
58
+ ## Design Goals
58
59
 
59
- ### Get Info of current installed electron
60
+ - Learn Rust through a real developer tool.
61
+ - Make Electron project state easy to inspect.
62
+ - Prefer structured output for agentic workflows.
63
+ - Wrap proven ecosystem tools before replacing them.
64
+ - Keep the project clearly independent and experimental.
60
65
 
61
- ```
62
- electron-cli stats
63
- ```
64
- This will print the versions of the current installed electron instance
66
+ ## Non-Goals
65
67
 
66
- ### Start electron application
68
+ - This is not an official Electron project.
69
+ - This is not an Electron Forge fork or drop-in replacement today.
70
+ - This will not claim Forge parity until the behavior is tested and documented.
67
71
 
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.
72
+ ## JSON Output
73
73
 
74
- ### Pack electron application
74
+ Both initial commands support `--json` so agents and scripts can consume project state without scraping terminal output.
75
+ `plan` is designed around that workflow: it recommends stable commands and reports missing project conventions as structured data.
75
76
 
77
+ ```sh
78
+ electron-cli plan --json
76
79
  ```
77
- electron-cli pack
78
- ```
79
80
 
80
- This will pack the application on the current directory with `electron-packager`
81
+ ## License
82
+
83
+ MIT
@@ -0,0 +1,47 @@
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
+
11
+ const candidates = [
12
+ path.join(root, "target", "release", exe),
13
+ path.join(root, "target", "debug", exe),
14
+ ];
15
+
16
+ const binary = candidates.find((candidate) => fs.existsSync(candidate));
17
+
18
+ if (binary) {
19
+ exitWith(spawnSync(binary, args, { stdio: "inherit" }));
20
+ }
21
+
22
+ const cargo = process.platform === "win32" ? "cargo.exe" : "cargo";
23
+ const manifest = path.join(root, "Cargo.toml");
24
+
25
+ if (!fs.existsSync(manifest)) {
26
+ console.error("electron-cli could not find its Rust sources.");
27
+ console.error("Reinstall the package or build a release binary before running this command.");
28
+ process.exit(1);
29
+ }
30
+
31
+ console.error("electron-cli is experimental and needs Rust to run from npm source packages.");
32
+ console.error("Building/running through cargo; install Rust from https://rustup.rs if this fails.");
33
+
34
+ exitWith(
35
+ spawnSync(cargo, ["run", "--quiet", "--manifest-path", manifest, "--", ...args], {
36
+ stdio: "inherit",
37
+ }),
38
+ );
39
+
40
+ function exitWith(result) {
41
+ if (result.error) {
42
+ console.error(result.error.message);
43
+ process.exit(1);
44
+ }
45
+
46
+ process.exit(result.status ?? 1);
47
+ }
package/package.json CHANGED
@@ -1,90 +1,45 @@
1
1
  {
2
2
  "name": "electron-cli",
3
- "version": "0.2.6",
4
- "description": "Command line tool for developing useful electron apps",
5
- "main": "dist/cli.js",
6
- "scripts": {
7
- "test": "gulp mocha",
8
- "start": "./dist/cli.js",
9
- "dev": "gulp dev",
10
- "lint": "gulp lint",
11
- "deploy": "gulp deploy",
12
- "coverage": "nyc --reporter=lcov --all --reporter=text-lcov npm test"
3
+ "version": "0.3.0-alpha.0",
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/roderik/electron-cli.git"
9
+ },
10
+ "homepage": "https://github.com/roderik/electron-cli#readme",
11
+ "bugs": {
12
+ "url": "https://github.com/roderik/electron-cli/issues"
13
13
  },
14
14
  "bin": {
15
- "electron-cli": "dist/cli.js"
15
+ "electron-cli": "bin/electron-cli.js"
16
16
  },
17
- "repository": {
18
- "type": "git",
19
- "url": "git@github.com:Ikana/electron-cli.git"
17
+ "files": [
18
+ "bin",
19
+ "src",
20
+ "tests",
21
+ "Cargo.toml",
22
+ "Cargo.lock",
23
+ "rust-toolchain.toml",
24
+ "README.md",
25
+ "LICENSE"
26
+ ],
27
+ "scripts": {
28
+ "build": "cargo build --release",
29
+ "dev": "cargo run --",
30
+ "format": "cargo fmt",
31
+ "lint": "cargo fmt --check && cargo clippy --all-targets -- -D warnings",
32
+ "test": "cargo test",
33
+ "prepack": "cargo build --release"
34
+ },
35
+ "engines": {
36
+ "node": ">=18"
20
37
  },
21
- "homepage": "https://github.com/Ikana/electron-cli",
22
38
  "keywords": [
23
39
  "electron",
24
40
  "cli",
25
- "app",
26
- "kit"
27
- ],
28
- "author": "Rodrigo Quezada",
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
- "cpy": "^4.0.1",
36
- "denodeify": "^1.2.1",
37
- "electron-packager": "^8.3.0",
38
- "exit": "^0.1.2",
39
- "inquirer": "^1.2.1",
40
- "jsonfile": "^2.4.0",
41
- "leek": "0.0.23",
42
- "mkdirp": "^0.5.1",
43
- "node-fetch": "^1.6.3",
44
- "nopt": "^3.0.6",
45
- "ora": "^0.3.0",
46
- "resolve": "^1.1.7",
47
- "semver": "^5.3.0",
48
- "username": "^2.2.2",
49
- "validate-npm-package-name": "^2.2.2",
50
- "yargs": "^5.0.0"
51
- },
52
- "devDependencies": {
53
- "babel-plugin-istanbul": "^3.0.0",
54
- "babel-plugin-syntax-async-functions": "^6.13.0",
55
- "babel-plugin-transform-async-to-generator": "^6.16.0",
56
- "babel-plugin-transform-object-rest-spread": "^6.19.0",
57
- "babel-plugin-transform-runtime": "^6.15.0",
58
- "babel-preset-es2015": "^6.18.0",
59
- "babel-preset-stage-2": "^6.18.0",
60
- "chai": "^3.5.0",
61
- "del": "^2.2.2",
62
- "eslint": "^3.10.0",
63
- "eslint-config-airbnb-base": "^10.0.1",
64
- "eslint-config-standard": "^6.2.1",
65
- "eslint-plugin-import": "^2.2.0",
66
- "eslint-plugin-promise": "^3.3.2",
67
- "eslint-plugin-standard": "^2.0.1",
68
- "gulp": "^3.9.1",
69
- "gulp-babel": "^6.1.2",
70
- "gulp-chmod": "^2.0.0",
71
- "gulp-eslint": "^3.0.1",
72
- "gulp-mocha": "^3.0.1",
73
- "gulp-util": "^3.0.7",
74
- "mocha": "^3.1.0",
75
- "mock-fs": "^3.12.1",
76
- "nyc": "^9.0.1",
77
- "run-sequence": "^1.2.2",
78
- "stream-combiner2": "^1.1.1"
79
- },
80
- "nyc": {
81
- "include": [
82
- "src/**/*.js"
83
- ],
84
- "require": [
85
- "babel-register"
86
- ],
87
- "sourceMap": false,
88
- "instrument": false
89
- }
41
+ "rust",
42
+ "diagnostics",
43
+ "agentic-engineering"
44
+ ]
90
45
  }
@@ -0,0 +1,3 @@
1
+ [toolchain]
2
+ channel = "stable"
3
+ components = ["clippy", "rustfmt"]
package/src/cli.rs ADDED
@@ -0,0 +1,36 @@
1
+ use std::path::PathBuf;
2
+
3
+ use clap::{Args, Parser, Subcommand};
4
+
5
+ #[derive(Debug, Parser)]
6
+ #[command(
7
+ name = "electron-cli",
8
+ version,
9
+ about = "Experimental Rust CLI for Electron project diagnostics and workflow automation",
10
+ long_about = "electron-cli is an independent learning project for exploring Rust-native Electron tooling. It is not affiliated with Electron or Electron Forge."
11
+ )]
12
+ pub struct Cli {
13
+ #[command(subcommand)]
14
+ pub command: Commands,
15
+ }
16
+
17
+ #[derive(Debug, Subcommand)]
18
+ pub enum Commands {
19
+ /// Check whether the current project looks ready for Electron development.
20
+ Doctor(CommandArgs),
21
+ /// Print a structured snapshot of the current JavaScript/Electron project.
22
+ Inspect(CommandArgs),
23
+ /// Recommend next commands and risks from the project snapshot.
24
+ Plan(CommandArgs),
25
+ }
26
+
27
+ #[derive(Debug, Clone, Args)]
28
+ pub struct CommandArgs {
29
+ /// Project directory to inspect.
30
+ #[arg(long, default_value = ".", value_name = "PATH")]
31
+ pub cwd: PathBuf,
32
+
33
+ /// Emit machine-readable JSON.
34
+ #[arg(long)]
35
+ pub json: bool,
36
+ }