electron-cli 0.3.0-alpha.2 → 0.3.0-alpha.20
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 +5380 -101
- package/Cargo.toml +17 -1
- package/README.md +103 -12
- package/package.json +2 -1
- package/src/cli.rs +226 -4
- package/src/commands/init.rs +443 -27
- package/src/commands/make.rs +3076 -0
- package/src/commands/mod.rs +4 -0
- package/src/commands/package.rs +3238 -0
- package/src/commands/plan.rs +65 -5
- package/src/commands/publish.rs +1832 -0
- package/src/commands/start.rs +287 -0
- package/src/forge_config.rs +547 -0
- package/src/main.rs +5 -0
- package/src/project.rs +52 -1
- package/templates/minimal/gitignore +5 -0
- package/templates/minimal/src/index.html +82 -0
- package/templates/minimal/src/main.js +33 -0
- package/templates/minimal/src/preload.js +6 -0
- package/templates/minimal/src/renderer.js +5 -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.20"
|
|
4
4
|
edition = "2021"
|
|
5
5
|
description = "Experimental Rust CLI for Electron project diagnostics and workflow automation"
|
|
6
6
|
license = "MIT"
|
|
@@ -8,7 +8,23 @@ repository = "https://github.com/Ikana/electron-cli"
|
|
|
8
8
|
|
|
9
9
|
[dependencies]
|
|
10
10
|
anyhow = "1.0"
|
|
11
|
+
app-store-connect = "0.7"
|
|
12
|
+
apple-codesign = { version = "0.29", default-features = false, features = ["notarize"] }
|
|
13
|
+
apple-dmg = "0.5"
|
|
14
|
+
cab = "0.6"
|
|
11
15
|
camino = { version = "1.1", features = ["serde1"] }
|
|
12
16
|
clap = { version = "4.6", features = ["derive"] }
|
|
17
|
+
fatfs = "0.3"
|
|
18
|
+
flate2 = { version = "1.1", default-features = false, features = ["rust_backend"] }
|
|
19
|
+
fscommon = "0.1"
|
|
20
|
+
json5 = "1"
|
|
21
|
+
md5 = "0.7"
|
|
22
|
+
msi = "0.10"
|
|
23
|
+
plist = "1"
|
|
24
|
+
rpm = { version = "0.24", default-features = false, features = ["payload", "gzip-compression"] }
|
|
13
25
|
serde = { version = "1.0", features = ["derive"] }
|
|
14
26
|
serde_json = "1.0"
|
|
27
|
+
tar = "0.4"
|
|
28
|
+
ureq = { version = "3.3", features = ["json"] }
|
|
29
|
+
uuid = { version = "1", features = ["v5"] }
|
|
30
|
+
zip = { version = "8.6.0", default-features = false, features = ["deflate-flate2-zlib-rs"] }
|
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ This is an independent learning project. It is not affiliated with Electron, Ele
|
|
|
6
6
|
|
|
7
7
|
## Status
|
|
8
8
|
|
|
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.
|
|
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. The next surface area is a Rust-owned version of the main Electron Forge flow: initialize, start, package, make, and eventually publish.
|
|
10
10
|
|
|
11
11
|
Current commands:
|
|
12
12
|
|
|
@@ -14,22 +14,99 @@ Current commands:
|
|
|
14
14
|
electron-cli inspect
|
|
15
15
|
electron-cli doctor
|
|
16
16
|
electron-cli plan
|
|
17
|
-
electron-cli init my-app
|
|
17
|
+
electron-cli init my-app
|
|
18
|
+
electron-cli start
|
|
19
|
+
electron-cli package
|
|
20
|
+
electron-cli make
|
|
21
|
+
electron-cli publish
|
|
18
22
|
electron-cli inspect --json
|
|
19
23
|
electron-cli doctor --json
|
|
20
24
|
electron-cli plan --json
|
|
21
25
|
electron-cli init my-app --dry-run --json
|
|
26
|
+
electron-cli start --dry-run --json
|
|
27
|
+
electron-cli package --dry-run --json
|
|
28
|
+
electron-cli make --dry-run --json
|
|
29
|
+
electron-cli publish --dry-run --json
|
|
22
30
|
```
|
|
23
31
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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.
|
|
33
|
+
|
|
34
|
+
The Rust-native flow currently owns:
|
|
35
|
+
|
|
36
|
+
- `init --template minimal`: writes a local Electron starter without Electron Forge.
|
|
37
|
+
- `start`: launches the installed Electron runtime directly.
|
|
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; it reads package metadata from `package.json`, JSON-shaped Forge config, and static Forge config files, and can apply experimental Rust-native ad-hoc macOS bundle signatures.
|
|
39
|
+
- `make`: runs `package` and writes distributables under `out/make/<target>/<platform>/<arch>/`; it reads JSON-shaped `config.forge.makers` / `electronCli.makers` arrays and static Forge config files when `--target` is omitted, and `--target` still forces one maker. 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 distributables to a local directory with a manifest or to GitHub Releases; it reads JSON-shaped `config.forge.publishers` / `electronCli.publishers` arrays and static Forge config files when `--publisher` is omitted, and `--publisher` still forces one publisher.
|
|
41
|
+
|
|
42
|
+
The GitHub publisher creates or reuses a release, uploads selected make artifacts, and can replace an existing asset with `--force`. It reads `GITHUB_TOKEN` or `GH_TOKEN` and can infer `OWNER/REPO` from package metadata, Forge GitHub publisher config, or `package.json` `repository`. You can also pass `--github-repo`.
|
|
43
|
+
|
|
44
|
+
The package command recognizes macOS `packagerConfig.osxSign` and `packagerConfig.osxNotarize` options and reports the signing/notarization plan without serializing credential values. When `osxSign` is enabled on macOS and no certificate identity is configured, or the identity is `"-"`, `package` writes an experimental Rust-native ad-hoc signature for the generated `.app` bundle. When `osxSign.p12File` points at a `.p12`/PFX certificate export, `package` can sign the bundle with that certificate and can request a CMS timestamp token for notarization-compatible signatures. With p12 signing and App Store Connect API key auth, `package` can submit to Apple notarization, wait for the result, and staple the ticket natively in Rust. macOS keychain identity lookup and keychain/Apple ID notarization auth are not implemented yet.
|
|
45
|
+
|
|
46
|
+
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, macOS keychain signing, and additional notarization auth modes are still TODO.
|
|
47
|
+
|
|
48
|
+
Package metadata can be configured in `package.json`:
|
|
49
|
+
|
|
50
|
+
```json
|
|
51
|
+
{
|
|
52
|
+
"productName": "My App",
|
|
53
|
+
"electronCli": {
|
|
54
|
+
"packagerConfig": {
|
|
55
|
+
"appBundleId": "com.example.my-app",
|
|
56
|
+
"appCategoryType": "public.app-category.developer-tools",
|
|
57
|
+
"icon": "assets/icon",
|
|
58
|
+
"extraResource": "assets/config.json",
|
|
59
|
+
"osxSign": {
|
|
60
|
+
"p12File": "certs/developer-id.p12",
|
|
61
|
+
"p12PasswordEnv": "ELECTRON_CLI_P12_PASSWORD",
|
|
62
|
+
"timestamp": true,
|
|
63
|
+
"entitlements": "assets/entitlements.plist",
|
|
64
|
+
"hardenedRuntime": true
|
|
65
|
+
},
|
|
66
|
+
"osxNotarize": {
|
|
67
|
+
"appleApiKey": "certs/AuthKey_ABC123DEFG.p8",
|
|
68
|
+
"appleApiKeyId": "ABC123DEFG",
|
|
69
|
+
"appleApiIssuer": "00000000-0000-0000-0000-000000000000",
|
|
70
|
+
"maxWaitSeconds": 600
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
"makers": [
|
|
74
|
+
{ "name": "@electron-forge/maker-zip" },
|
|
75
|
+
{ "name": "@electron-forge/maker-dmg", "platforms": ["darwin"] },
|
|
76
|
+
{ "name": "@electron-forge/maker-deb", "platforms": ["linux"] },
|
|
77
|
+
{ "name": "@electron-forge/maker-rpm", "platforms": ["linux"] },
|
|
78
|
+
{ "name": "@electron-forge/maker-wix", "platforms": ["win32"] }
|
|
79
|
+
],
|
|
80
|
+
"publishers": [
|
|
81
|
+
{ "name": "local", "config": { "to": "out/publish/local", "channel": "alpha" } },
|
|
82
|
+
{
|
|
83
|
+
"name": "@electron-forge/publisher-github",
|
|
84
|
+
"config": {
|
|
85
|
+
"repository": { "owner": "example", "name": "my-app" },
|
|
86
|
+
"draft": true,
|
|
87
|
+
"prerelease": true
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
]
|
|
91
|
+
},
|
|
92
|
+
"config": {
|
|
93
|
+
"forge": {
|
|
94
|
+
"makers": [
|
|
95
|
+
{ "name": "@electron-forge/maker-zip" }
|
|
96
|
+
],
|
|
97
|
+
"publishers": [
|
|
98
|
+
{ "name": "@electron-forge/publisher-github" }
|
|
99
|
+
]
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
30
103
|
```
|
|
31
104
|
|
|
32
|
-
|
|
105
|
+
Use `p12PasswordEnv`, `p12PasswordFile`, or `p12Password` for the `.p12` password; password values are not serialized in package reports. Set `osxSign.timestamp` to a timestamp server URL, `true` for Apple's default `http://timestamp.apple.com/ts01`, or `"none"` / `false` to disable timestamping. When `osxNotarize` is enabled with p12 signing, `electron-cli` automatically enables notarization-compatible signing and uses Apple's timestamp server unless timestamping is disabled explicitly. Rust-native notarization execution currently requires `appleApiKey`, `appleApiKeyId`, and `appleApiIssuer`; `appleApiKey` may point at the `.p8` file from App Store Connect or a unified API key JSON file. It waits up to `maxWaitSeconds` or 600 seconds by default and staples by default. Set `staple: false` to skip stapling, or set both `staple: false` and `wait: false` to submit without waiting. Set `identity` to a Developer ID certificate name when you want the plan to reflect Forge-style keychain release signing, but this project will report it as not executable until Rust-native keychain lookup exists. Use `identity: "-"` or omit `identity` for the current ad-hoc signing path.
|
|
106
|
+
|
|
107
|
+
The package command also reads JSON-shaped `config.forge.packagerConfig` and `electronPackagerConfig` entries for the same fields. The make command maps JSON-shaped Forge maker names to the Rust-native targets it supports: zip, dmg, deb, rpm, and wix/msi. The publish command maps JSON-shaped publisher names to local and GitHub.
|
|
108
|
+
|
|
109
|
+
Static `forge.config.js`, `forge.config.cjs`, `forge.config.mjs`, and `forge.config.ts` files are parsed in Rust when they export an object literal directly or via a local `const`/`let`/`var` identifier. Dynamic JavaScript config that calls functions, reads environment state, or computes the config at runtime is not evaluated.
|
|
33
110
|
|
|
34
111
|
## Install
|
|
35
112
|
|
|
@@ -60,7 +137,17 @@ Or use Cargo directly:
|
|
|
60
137
|
```sh
|
|
61
138
|
cargo run -- doctor
|
|
62
139
|
cargo run -- inspect --json
|
|
63
|
-
cargo run -- init my-app
|
|
140
|
+
cargo run -- init my-app
|
|
141
|
+
cargo run -- start --dry-run
|
|
142
|
+
cargo run -- package --dry-run
|
|
143
|
+
cargo run -- make --dry-run
|
|
144
|
+
cargo run -- make --target dmg --dry-run
|
|
145
|
+
cargo run -- make --target deb --dry-run
|
|
146
|
+
cargo run -- make --target rpm --dry-run
|
|
147
|
+
cargo run -- make --target msi --platform win32 --dry-run
|
|
148
|
+
cargo run -- publish --dry-run
|
|
149
|
+
cargo run -- publish --publisher github --dry-run
|
|
150
|
+
cargo run -- publish --publisher github --github-repo OWNER/REPO --github-tag v0.1.0
|
|
64
151
|
```
|
|
65
152
|
|
|
66
153
|
## Design Goals
|
|
@@ -68,7 +155,7 @@ cargo run -- init my-app --dry-run
|
|
|
68
155
|
- Learn Rust through a real developer tool.
|
|
69
156
|
- Make Electron project state easy to inspect.
|
|
70
157
|
- Prefer structured output for agentic workflows.
|
|
71
|
-
-
|
|
158
|
+
- Replace the main Forge-style app flow with narrow Rust-owned pieces.
|
|
72
159
|
- Keep the project clearly independent and experimental.
|
|
73
160
|
|
|
74
161
|
## Non-Goals
|
|
@@ -81,7 +168,11 @@ cargo run -- init my-app --dry-run
|
|
|
81
168
|
|
|
82
169
|
The inspection and planning commands support `--json` so agents and scripts can consume project state without scraping terminal output.
|
|
83
170
|
`plan` is designed around that workflow: it recommends stable commands and reports missing project conventions as structured data.
|
|
84
|
-
`init --dry-run --json` shows the
|
|
171
|
+
`init --dry-run --json` shows whether the CLI will write native template files or delegate to `create-electron-app`.
|
|
172
|
+
`start --dry-run --json` shows the Electron executable that will be launched.
|
|
173
|
+
`package --dry-run --json` shows the runtime, app file, metadata, icon, and extra-resource copy plan.
|
|
174
|
+
`make --dry-run --json` shows the package prerequisite and selected maker artifact path.
|
|
175
|
+
`publish --dry-run --json` shows the make prerequisite plus either the local destination/manifest path or the GitHub release/upload plan. When multiple configured makers or publishers apply, the JSON output contains a `publishes` array.
|
|
85
176
|
|
|
86
177
|
```sh
|
|
87
178
|
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.
|
|
3
|
+
"version": "0.3.0-alpha.20",
|
|
4
4
|
"description": "Experimental Rust CLI for Electron project diagnostics and workflow automation",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"bin/electron-cli.js",
|
|
19
19
|
"scripts",
|
|
20
20
|
"src",
|
|
21
|
+
"templates",
|
|
21
22
|
"tests",
|
|
22
23
|
"Cargo.toml",
|
|
23
24
|
"Cargo.lock",
|
package/src/cli.rs
CHANGED
|
@@ -18,12 +18,20 @@ pub struct Cli {
|
|
|
18
18
|
pub enum Commands {
|
|
19
19
|
/// Check whether the current project looks ready for Electron development.
|
|
20
20
|
Doctor(CommandArgs),
|
|
21
|
-
/// Bootstrap a new Electron app
|
|
21
|
+
/// Bootstrap a new Electron app.
|
|
22
22
|
Init(InitArgs),
|
|
23
23
|
/// Print a structured snapshot of the current JavaScript/Electron project.
|
|
24
24
|
Inspect(CommandArgs),
|
|
25
|
+
/// Create distributable artifacts from a packaged Electron app.
|
|
26
|
+
Make(MakeArgs),
|
|
27
|
+
/// Create a local Electron application bundle without Electron Forge.
|
|
28
|
+
Package(PackageArgs),
|
|
25
29
|
/// Recommend next commands and risks from the project snapshot.
|
|
26
30
|
Plan(CommandArgs),
|
|
31
|
+
/// Publish made artifacts to a distribution target.
|
|
32
|
+
Publish(PublishArgs),
|
|
33
|
+
/// Launch the current Electron app without Electron Forge.
|
|
34
|
+
Start(StartArgs),
|
|
27
35
|
}
|
|
28
36
|
|
|
29
37
|
#[derive(Debug, Clone, Args)]
|
|
@@ -47,8 +55,8 @@ pub struct InitArgs {
|
|
|
47
55
|
#[arg(long, default_value = ".", value_name = "PATH")]
|
|
48
56
|
pub cwd: PathBuf,
|
|
49
57
|
|
|
50
|
-
///
|
|
51
|
-
#[arg(long, short = 't', default_value = "
|
|
58
|
+
/// Template to use. "minimal" is native; other names are passed to create-electron-app.
|
|
59
|
+
#[arg(long, short = 't', default_value = "minimal")]
|
|
52
60
|
pub template: String,
|
|
53
61
|
|
|
54
62
|
/// Package manager command strategy to use.
|
|
@@ -80,7 +88,183 @@ pub struct InitArgs {
|
|
|
80
88
|
pub json: bool,
|
|
81
89
|
}
|
|
82
90
|
|
|
83
|
-
#[derive(Debug, Clone,
|
|
91
|
+
#[derive(Debug, Clone, Args)]
|
|
92
|
+
pub struct StartArgs {
|
|
93
|
+
/// Project directory to launch.
|
|
94
|
+
#[arg(long, default_value = ".", value_name = "PATH")]
|
|
95
|
+
pub cwd: PathBuf,
|
|
96
|
+
|
|
97
|
+
/// Print the launch command without starting Electron.
|
|
98
|
+
#[arg(long)]
|
|
99
|
+
pub dry_run: bool,
|
|
100
|
+
|
|
101
|
+
/// Emit machine-readable JSON.
|
|
102
|
+
#[arg(long)]
|
|
103
|
+
pub json: bool,
|
|
104
|
+
|
|
105
|
+
/// Extra arguments passed to Electron after `--`.
|
|
106
|
+
#[arg(last = true, value_name = "ELECTRON_ARG")]
|
|
107
|
+
pub electron_args: Vec<String>,
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
#[derive(Debug, Clone, Args)]
|
|
111
|
+
pub struct PackageArgs {
|
|
112
|
+
/// Project directory to package.
|
|
113
|
+
#[arg(long, default_value = ".", value_name = "PATH")]
|
|
114
|
+
pub cwd: PathBuf,
|
|
115
|
+
|
|
116
|
+
/// Output directory for packaged app bundles.
|
|
117
|
+
#[arg(long, default_value = "out", value_name = "PATH")]
|
|
118
|
+
pub out_dir: PathBuf,
|
|
119
|
+
|
|
120
|
+
/// Override the packaged application name.
|
|
121
|
+
#[arg(long)]
|
|
122
|
+
pub name: Option<String>,
|
|
123
|
+
|
|
124
|
+
/// Target platform label. Defaults to the current platform.
|
|
125
|
+
#[arg(long)]
|
|
126
|
+
pub platform: Option<String>,
|
|
127
|
+
|
|
128
|
+
/// Target architecture label. Defaults to the current architecture.
|
|
129
|
+
#[arg(long)]
|
|
130
|
+
pub arch: Option<String>,
|
|
131
|
+
|
|
132
|
+
/// Overwrite an existing package output directory.
|
|
133
|
+
#[arg(long)]
|
|
134
|
+
pub force: bool,
|
|
135
|
+
|
|
136
|
+
/// Print the package plan without creating files.
|
|
137
|
+
#[arg(long)]
|
|
138
|
+
pub dry_run: bool,
|
|
139
|
+
|
|
140
|
+
/// Emit machine-readable JSON.
|
|
141
|
+
#[arg(long)]
|
|
142
|
+
pub json: bool,
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
#[derive(Debug, Clone, Args)]
|
|
146
|
+
pub struct MakeArgs {
|
|
147
|
+
/// Project directory to make distributables for.
|
|
148
|
+
#[arg(long, default_value = ".", value_name = "PATH")]
|
|
149
|
+
pub cwd: PathBuf,
|
|
150
|
+
|
|
151
|
+
/// Output directory used for package and make artifacts.
|
|
152
|
+
#[arg(long, default_value = "out", value_name = "PATH")]
|
|
153
|
+
pub out_dir: PathBuf,
|
|
154
|
+
|
|
155
|
+
/// Override the application name.
|
|
156
|
+
#[arg(long)]
|
|
157
|
+
pub name: Option<String>,
|
|
158
|
+
|
|
159
|
+
/// Target platform label. Defaults to the current platform.
|
|
160
|
+
#[arg(long)]
|
|
161
|
+
pub platform: Option<String>,
|
|
162
|
+
|
|
163
|
+
/// Target architecture label. Defaults to the current architecture.
|
|
164
|
+
#[arg(long)]
|
|
165
|
+
pub arch: Option<String>,
|
|
166
|
+
|
|
167
|
+
/// Maker target to run. Overrides configured makers when provided.
|
|
168
|
+
#[arg(long, value_enum)]
|
|
169
|
+
pub target: Option<MakeTarget>,
|
|
170
|
+
|
|
171
|
+
/// Reuse an existing package output instead of running package first.
|
|
172
|
+
#[arg(long)]
|
|
173
|
+
pub skip_package: bool,
|
|
174
|
+
|
|
175
|
+
/// Overwrite existing package and make artifacts.
|
|
176
|
+
#[arg(long)]
|
|
177
|
+
pub force: bool,
|
|
178
|
+
|
|
179
|
+
/// Print the make plan without creating files.
|
|
180
|
+
#[arg(long)]
|
|
181
|
+
pub dry_run: bool,
|
|
182
|
+
|
|
183
|
+
/// Emit machine-readable JSON.
|
|
184
|
+
#[arg(long)]
|
|
185
|
+
pub json: bool,
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
#[derive(Debug, Clone, Args)]
|
|
189
|
+
pub struct PublishArgs {
|
|
190
|
+
/// Project directory to publish from.
|
|
191
|
+
#[arg(long, default_value = ".", value_name = "PATH")]
|
|
192
|
+
pub cwd: PathBuf,
|
|
193
|
+
|
|
194
|
+
/// Output directory used for package, make, and publish artifacts.
|
|
195
|
+
#[arg(long, default_value = "out", value_name = "PATH")]
|
|
196
|
+
pub out_dir: PathBuf,
|
|
197
|
+
|
|
198
|
+
/// Override the application name.
|
|
199
|
+
#[arg(long)]
|
|
200
|
+
pub name: Option<String>,
|
|
201
|
+
|
|
202
|
+
/// Target platform label. Defaults to the current platform.
|
|
203
|
+
#[arg(long)]
|
|
204
|
+
pub platform: Option<String>,
|
|
205
|
+
|
|
206
|
+
/// Target architecture label. Defaults to the current architecture.
|
|
207
|
+
#[arg(long)]
|
|
208
|
+
pub arch: Option<String>,
|
|
209
|
+
|
|
210
|
+
/// Maker target whose artifact should be published. Overrides configured makers when provided.
|
|
211
|
+
#[arg(long, value_enum)]
|
|
212
|
+
pub target: Option<MakeTarget>,
|
|
213
|
+
|
|
214
|
+
/// Publisher target to use. Overrides configured publishers when provided.
|
|
215
|
+
#[arg(long, value_enum)]
|
|
216
|
+
pub publisher: Option<PublishTarget>,
|
|
217
|
+
|
|
218
|
+
/// Destination for local published artifacts.
|
|
219
|
+
#[arg(long, value_name = "PATH")]
|
|
220
|
+
pub to: Option<PathBuf>,
|
|
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, value_name = "URL")]
|
|
244
|
+
pub github_api_url: Option<String>,
|
|
245
|
+
|
|
246
|
+
/// Release channel label written into the publish manifest.
|
|
247
|
+
#[arg(long)]
|
|
248
|
+
pub channel: Option<String>,
|
|
249
|
+
|
|
250
|
+
/// Reuse an existing make artifact instead of running package and make first.
|
|
251
|
+
#[arg(long)]
|
|
252
|
+
pub skip_make: bool,
|
|
253
|
+
|
|
254
|
+
/// Overwrite existing publish artifacts.
|
|
255
|
+
#[arg(long)]
|
|
256
|
+
pub force: bool,
|
|
257
|
+
|
|
258
|
+
/// Print the publish plan without creating files.
|
|
259
|
+
#[arg(long)]
|
|
260
|
+
pub dry_run: bool,
|
|
261
|
+
|
|
262
|
+
/// Emit machine-readable JSON.
|
|
263
|
+
#[arg(long)]
|
|
264
|
+
pub json: bool,
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
#[derive(Debug, Clone, Copy, PartialEq, Eq, ValueEnum)]
|
|
84
268
|
#[value(rename_all = "lower")]
|
|
85
269
|
pub enum PackageManager {
|
|
86
270
|
Npm,
|
|
@@ -99,3 +283,41 @@ impl PackageManager {
|
|
|
99
283
|
}
|
|
100
284
|
}
|
|
101
285
|
}
|
|
286
|
+
|
|
287
|
+
#[derive(Debug, Clone, Copy, PartialEq, Eq, ValueEnum)]
|
|
288
|
+
#[value(rename_all = "lower")]
|
|
289
|
+
pub enum MakeTarget {
|
|
290
|
+
Deb,
|
|
291
|
+
Dmg,
|
|
292
|
+
Msi,
|
|
293
|
+
Rpm,
|
|
294
|
+
Zip,
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
impl MakeTarget {
|
|
298
|
+
pub fn as_str(self) -> &'static str {
|
|
299
|
+
match self {
|
|
300
|
+
MakeTarget::Deb => "deb",
|
|
301
|
+
MakeTarget::Dmg => "dmg",
|
|
302
|
+
MakeTarget::Msi => "msi",
|
|
303
|
+
MakeTarget::Rpm => "rpm",
|
|
304
|
+
MakeTarget::Zip => "zip",
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
#[derive(Debug, Clone, Copy, PartialEq, Eq, ValueEnum)]
|
|
310
|
+
#[value(rename_all = "lower")]
|
|
311
|
+
pub enum PublishTarget {
|
|
312
|
+
Github,
|
|
313
|
+
Local,
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
impl PublishTarget {
|
|
317
|
+
pub fn as_str(self) -> &'static str {
|
|
318
|
+
match self {
|
|
319
|
+
PublishTarget::Github => "github",
|
|
320
|
+
PublishTarget::Local => "local",
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
}
|