electron-cli 0.3.0-alpha.10 → 0.3.0-alpha.12
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 +607 -5
- package/Cargo.toml +5 -1
- package/README.md +9 -10
- package/package.json +1 -1
- package/src/cli.rs +28 -0
- package/src/commands/make.rs +897 -0
- package/src/commands/plan.rs +1 -0
- package/src/commands/publish.rs +738 -44
- package/src/project.rs +45 -0
package/Cargo.toml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[package]
|
|
2
2
|
name = "electron-cli"
|
|
3
|
-
version = "0.3.0-alpha.
|
|
3
|
+
version = "0.3.0-alpha.12"
|
|
4
4
|
edition = "2021"
|
|
5
5
|
description = "Experimental Rust CLI for Electron project diagnostics and workflow automation"
|
|
6
6
|
license = "MIT"
|
|
@@ -9,15 +9,19 @@ repository = "https://github.com/Ikana/electron-cli"
|
|
|
9
9
|
[dependencies]
|
|
10
10
|
anyhow = "1.0"
|
|
11
11
|
apple-dmg = "0.5"
|
|
12
|
+
cab = "0.6"
|
|
12
13
|
camino = { version = "1.1", features = ["serde1"] }
|
|
13
14
|
clap = { version = "4.6", features = ["derive"] }
|
|
14
15
|
fatfs = "0.3"
|
|
15
16
|
flate2 = { version = "1.1", default-features = false, features = ["rust_backend"] }
|
|
16
17
|
fscommon = "0.1"
|
|
17
18
|
md5 = "0.7"
|
|
19
|
+
msi = "0.10"
|
|
18
20
|
plist = "1"
|
|
19
21
|
rpm = { version = "0.24", default-features = false, features = ["payload", "gzip-compression"] }
|
|
20
22
|
serde = { version = "1.0", features = ["derive"] }
|
|
21
23
|
serde_json = "1.0"
|
|
22
24
|
tar = "0.4"
|
|
25
|
+
ureq = { version = "3.3", features = ["json"] }
|
|
26
|
+
uuid = { version = "1", features = ["v5"] }
|
|
23
27
|
zip = { version = "8.6.0", default-features = false, features = ["deflate-flate2-zlib-rs"] }
|
package/README.md
CHANGED
|
@@ -29,12 +29,6 @@ electron-cli make --dry-run --json
|
|
|
29
29
|
electron-cli publish --dry-run --json
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
-
Planned commands:
|
|
33
|
-
|
|
34
|
-
```sh
|
|
35
|
-
electron-cli publish --publisher github
|
|
36
|
-
```
|
|
37
|
-
|
|
38
32
|
The default `init` template is `minimal`, a built-in starter written by this project. Non-native template names are still passed to `create-electron-app` as an escape hatch while this project grows.
|
|
39
33
|
|
|
40
34
|
The Rust-native flow currently owns:
|
|
@@ -42,10 +36,12 @@ The Rust-native flow currently owns:
|
|
|
42
36
|
- `init --template minimal`: writes a local Electron starter without Electron Forge.
|
|
43
37
|
- `start`: launches the installed Electron runtime directly.
|
|
44
38
|
- `package`: copies the installed Electron runtime, app files, installed production dependency closure, app metadata, macOS icon, and extra resources into a local app bundle for the current platform and architecture.
|
|
45
|
-
- `make`: runs `package` and writes a distributable under `out/make/<target>/<platform>/<arch>/`; ZIP works on all platforms, `--target dmg` writes a basic macOS disk image,
|
|
46
|
-
- `publish`: runs `make` and publishes the distributable to a local directory with a manifest.
|
|
39
|
+
- `make`: runs `package` and writes a distributable under `out/make/<target>/<platform>/<arch>/`; ZIP works on all platforms, `--target dmg` writes a basic macOS disk image, `--target deb` / `--target rpm` write Linux packages, and `--target msi` writes a basic Windows Installer package.
|
|
40
|
+
- `publish`: runs `make` and publishes the distributable to a local directory with a manifest or to GitHub Releases.
|
|
41
|
+
|
|
42
|
+
The GitHub publisher creates or reuses a release, uploads the selected make artifact, and can replace an existing asset with `--force`. It reads `GITHUB_TOKEN` or `GH_TOKEN` and can infer `OWNER/REPO` from `package.json` `repository`, or you can pass `--github-repo`.
|
|
47
43
|
|
|
48
|
-
|
|
44
|
+
The DMG maker is currently a pure-Rust FAT32 image with the app bundle and an Applications entry. The MSI maker writes a compressed embedded CAB, Windows Installer database tables, and a Start Menu shortcut when the packaged executable is present. HFS+/APFS DMG layout customization, installer UI customization, Windows/Linux icon embedding, signing, and notarization are still TODO.
|
|
49
45
|
|
|
50
46
|
Package metadata can be configured in `package.json`:
|
|
51
47
|
|
|
@@ -101,7 +97,10 @@ cargo run -- make --dry-run
|
|
|
101
97
|
cargo run -- make --target dmg --dry-run
|
|
102
98
|
cargo run -- make --target deb --dry-run
|
|
103
99
|
cargo run -- make --target rpm --dry-run
|
|
100
|
+
cargo run -- make --target msi --platform win32 --dry-run
|
|
104
101
|
cargo run -- publish --dry-run
|
|
102
|
+
cargo run -- publish --publisher github --dry-run
|
|
103
|
+
cargo run -- publish --publisher github --github-repo OWNER/REPO --github-tag v0.1.0
|
|
105
104
|
```
|
|
106
105
|
|
|
107
106
|
## Design Goals
|
|
@@ -126,7 +125,7 @@ The inspection and planning commands support `--json` so agents and scripts can
|
|
|
126
125
|
`start --dry-run --json` shows the Electron executable that will be launched.
|
|
127
126
|
`package --dry-run --json` shows the runtime, app file, metadata, icon, and extra-resource copy plan.
|
|
128
127
|
`make --dry-run --json` shows the package prerequisite and selected maker artifact path.
|
|
129
|
-
`publish --dry-run --json` shows the make prerequisite
|
|
128
|
+
`publish --dry-run --json` shows the make prerequisite plus either the local destination/manifest path or the GitHub release/upload plan.
|
|
130
129
|
|
|
131
130
|
```sh
|
|
132
131
|
electron-cli plan --json
|
package/package.json
CHANGED
package/src/cli.rs
CHANGED
|
@@ -219,6 +219,30 @@ pub struct PublishArgs {
|
|
|
219
219
|
#[arg(long, default_value = "out/publish/local", value_name = "PATH")]
|
|
220
220
|
pub to: PathBuf,
|
|
221
221
|
|
|
222
|
+
/// GitHub repository to publish to, in OWNER/REPO form.
|
|
223
|
+
#[arg(long, value_name = "OWNER/REPO")]
|
|
224
|
+
pub github_repo: Option<String>,
|
|
225
|
+
|
|
226
|
+
/// GitHub release tag. Defaults to v<package version>, then channel.
|
|
227
|
+
#[arg(long)]
|
|
228
|
+
pub github_tag: Option<String>,
|
|
229
|
+
|
|
230
|
+
/// GitHub release name. Defaults to the release tag.
|
|
231
|
+
#[arg(long)]
|
|
232
|
+
pub github_release_name: Option<String>,
|
|
233
|
+
|
|
234
|
+
/// Mark a newly created GitHub release as draft.
|
|
235
|
+
#[arg(long)]
|
|
236
|
+
pub github_draft: bool,
|
|
237
|
+
|
|
238
|
+
/// Mark a newly created GitHub release as prerelease.
|
|
239
|
+
#[arg(long)]
|
|
240
|
+
pub github_prerelease: bool,
|
|
241
|
+
|
|
242
|
+
/// GitHub API base URL, useful for GitHub Enterprise.
|
|
243
|
+
#[arg(long, default_value = "https://api.github.com", value_name = "URL")]
|
|
244
|
+
pub github_api_url: String,
|
|
245
|
+
|
|
222
246
|
/// Release channel label written into the publish manifest.
|
|
223
247
|
#[arg(long, default_value = "default")]
|
|
224
248
|
pub channel: String,
|
|
@@ -265,6 +289,7 @@ impl PackageManager {
|
|
|
265
289
|
pub enum MakeTarget {
|
|
266
290
|
Deb,
|
|
267
291
|
Dmg,
|
|
292
|
+
Msi,
|
|
268
293
|
Rpm,
|
|
269
294
|
Zip,
|
|
270
295
|
}
|
|
@@ -274,6 +299,7 @@ impl MakeTarget {
|
|
|
274
299
|
match self {
|
|
275
300
|
MakeTarget::Deb => "deb",
|
|
276
301
|
MakeTarget::Dmg => "dmg",
|
|
302
|
+
MakeTarget::Msi => "msi",
|
|
277
303
|
MakeTarget::Rpm => "rpm",
|
|
278
304
|
MakeTarget::Zip => "zip",
|
|
279
305
|
}
|
|
@@ -283,12 +309,14 @@ impl MakeTarget {
|
|
|
283
309
|
#[derive(Debug, Clone, Copy, ValueEnum)]
|
|
284
310
|
#[value(rename_all = "lower")]
|
|
285
311
|
pub enum PublishTarget {
|
|
312
|
+
Github,
|
|
286
313
|
Local,
|
|
287
314
|
}
|
|
288
315
|
|
|
289
316
|
impl PublishTarget {
|
|
290
317
|
pub fn as_str(self) -> &'static str {
|
|
291
318
|
match self {
|
|
319
|
+
PublishTarget::Github => "github",
|
|
292
320
|
PublishTarget::Local => "local",
|
|
293
321
|
}
|
|
294
322
|
}
|