electron-cli 0.3.0-alpha.10 → 0.3.0-alpha.11

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.toml CHANGED
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "electron-cli"
3
- version = "0.3.0-alpha.10"
3
+ version = "0.3.0-alpha.11"
4
4
  edition = "2021"
5
5
  description = "Experimental Rust CLI for Electron project diagnostics and workflow automation"
6
6
  license = "MIT"
@@ -20,4 +20,5 @@ rpm = { version = "0.24", default-features = false, features = ["payload", "gzip
20
20
  serde = { version = "1.0", features = ["derive"] }
21
21
  serde_json = "1.0"
22
22
  tar = "0.4"
23
+ ureq = { version = "3.3", features = ["json"] }
23
24
  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:
@@ -43,9 +37,11 @@ The Rust-native flow currently owns:
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
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, and `--target deb` / `--target rpm` write Linux packages.
46
- - `publish`: runs `make` and publishes the distributable to a local directory with a manifest.
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
- Remote publishers such as GitHub Releases are not implemented yet. The DMG maker is currently a pure-Rust FAT32 image with the app bundle and an Applications entry; HFS+/APFS layout customization, Windows installers, Windows/Linux icon embedding, signing, and notarization are still TODO.
44
+ The DMG maker is currently a pure-Rust FAT32 image with the app bundle and an Applications entry. HFS+/APFS layout customization, Windows installers, Windows/Linux icon embedding, signing, and notarization are still TODO.
49
45
 
50
46
  Package metadata can be configured in `package.json`:
51
47
 
@@ -102,6 +98,8 @@ 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
104
100
  cargo run -- publish --dry-run
101
+ cargo run -- publish --publisher github --dry-run
102
+ cargo run -- publish --publisher github --github-repo OWNER/REPO --github-tag v0.1.0
105
103
  ```
106
104
 
107
105
  ## Design Goals
@@ -126,7 +124,7 @@ The inspection and planning commands support `--json` so agents and scripts can
126
124
  `start --dry-run --json` shows the Electron executable that will be launched.
127
125
  `package --dry-run --json` shows the runtime, app file, metadata, icon, and extra-resource copy plan.
128
126
  `make --dry-run --json` shows the package prerequisite and selected maker artifact path.
129
- `publish --dry-run --json` shows the make prerequisite, destination artifact, and manifest path.
127
+ `publish --dry-run --json` shows the make prerequisite plus either the local destination/manifest path or the GitHub release/upload plan.
130
128
 
131
129
  ```sh
132
130
  electron-cli plan --json
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "electron-cli",
3
- "version": "0.3.0-alpha.10",
3
+ "version": "0.3.0-alpha.11",
4
4
  "description": "Experimental Rust CLI for Electron project diagnostics and workflow automation",
5
5
  "license": "MIT",
6
6
  "repository": {
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,
@@ -283,12 +307,14 @@ impl MakeTarget {
283
307
  #[derive(Debug, Clone, Copy, ValueEnum)]
284
308
  #[value(rename_all = "lower")]
285
309
  pub enum PublishTarget {
310
+ Github,
286
311
  Local,
287
312
  }
288
313
 
289
314
  impl PublishTarget {
290
315
  pub fn as_str(self) -> &'static str {
291
316
  match self {
317
+ PublishTarget::Github => "github",
292
318
  PublishTarget::Local => "local",
293
319
  }
294
320
  }
@@ -252,6 +252,7 @@ mod tests {
252
252
  package_json: Some(camino::Utf8PathBuf::from("/tmp/native-app/package.json")),
253
253
  name: Some("native-app".to_string()),
254
254
  version: Some("0.1.0".to_string()),
255
+ repository: None,
255
256
  license: None,
256
257
  main: Some("src/main.js".to_string()),
257
258
  package_manager: Some("npm".to_string()),