@ahqstore/cli 0.3.4 → 0.3.5
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 +10 -5
- package/index.js +82 -159
- package/package.json +11 -13
- package/cli-rs/Cargo.toml +0 -45
- package/cli-rs/README.md +0 -41
- package/cli-rs/build.rs +0 -4
- package/cli-rs/finalize.js +0 -25
- package/cli-rs/rust-toolchain.toml +0 -2
- package/cli-rs/src/app/build/config.rs +0 -54
- package/cli-rs/src/app/build/icon.rs +0 -48
- package/cli-rs/src/app/build/mod.rs +0 -217
- package/cli-rs/src/app/build/release.rs +0 -50
- package/cli-rs/src/app/create/icon.png +0 -0
- package/cli-rs/src/app/create/inquire.rs +0 -189
- package/cli-rs/src/app/create/mod.rs +0 -74
- package/cli-rs/src/app/create/readme.md +0 -71
- package/cli-rs/src/app/help.rs +0 -77
- package/cli-rs/src/app/mod.rs +0 -39
- package/cli-rs/src/app/shared/file_sorter.rs +0 -34
- package/cli-rs/src/app/shared/mod.rs +0 -62
- package/cli-rs/src/app/shared/platforms.rs +0 -69
- package/cli-rs/src/lib.rs +0 -13
- package/cli-rs/src/main.rs +0 -10
- package/cli-rs/tslink.toml +0 -2
package/cli-rs/src/app/mod.rs
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
use chalk_rs::Chalk;
|
|
2
|
-
use lazy_static::lazy_static;
|
|
3
|
-
|
|
4
|
-
mod build;
|
|
5
|
-
mod create;
|
|
6
|
-
mod help;
|
|
7
|
-
pub mod shared;
|
|
8
|
-
|
|
9
|
-
lazy_static! {
|
|
10
|
-
static ref INFO: Chalk = {
|
|
11
|
-
let mut chalk = Chalk::new();
|
|
12
|
-
chalk.blue().bold();
|
|
13
|
-
chalk
|
|
14
|
-
};
|
|
15
|
-
static ref WARN: Chalk = {
|
|
16
|
-
let mut chalk = Chalk::new();
|
|
17
|
-
chalk.yellow().bold();
|
|
18
|
-
chalk
|
|
19
|
-
};
|
|
20
|
-
static ref ERR: Chalk = {
|
|
21
|
-
let mut chalk = Chalk::new();
|
|
22
|
-
chalk.red().bold();
|
|
23
|
-
chalk
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
pub fn start(args: Vec<String>, gh: bool) {
|
|
28
|
-
if args.len() >= 1 {
|
|
29
|
-
match args[0].as_str() {
|
|
30
|
-
"create" => create::create(args.len() > 1 && (&args[1] == "--force" || &args[1] == "-f")),
|
|
31
|
-
"build" => build::build_config(false, false),
|
|
32
|
-
"upload" => build::build_config(true, gh),
|
|
33
|
-
"help" => println!("{}", help::main_help()),
|
|
34
|
-
a => println!("{}", help::not_found(a)),
|
|
35
|
-
}
|
|
36
|
-
} else {
|
|
37
|
-
println!("{}", help::main_help());
|
|
38
|
-
}
|
|
39
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
use serde::{Deserialize, Serialize};
|
|
2
|
-
|
|
3
|
-
#[derive(Debug, Serialize, Deserialize)]
|
|
4
|
-
#[allow(non_snake_case)]
|
|
5
|
-
pub struct FileFinder<'a> {
|
|
6
|
-
#[serde(borrow)]
|
|
7
|
-
pub windowsFinder: Option<Finder<'a>>,
|
|
8
|
-
#[serde(borrow)]
|
|
9
|
-
pub linuxFinder: Option<Finder<'a>>,
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
#[derive(Debug, Serialize, Deserialize)]
|
|
13
|
-
#[allow(non_snake_case)]
|
|
14
|
-
pub struct Finder<'a> {
|
|
15
|
-
#[serde(borrow)]
|
|
16
|
-
pub startsWith: Option<&'a str>,
|
|
17
|
-
#[serde(borrow)]
|
|
18
|
-
pub contains: Option<&'a str>,
|
|
19
|
-
#[serde(borrow)]
|
|
20
|
-
pub endsWith: Option<&'a str>,
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
impl<'a> FileFinder<'a> {
|
|
24
|
-
pub fn new() -> Self {
|
|
25
|
-
Self {
|
|
26
|
-
windowsFinder: Some(Finder {
|
|
27
|
-
startsWith: Some("This-is"),
|
|
28
|
-
contains: Some("an"),
|
|
29
|
-
endsWith: Some(".example"),
|
|
30
|
-
}),
|
|
31
|
-
linuxFinder: None,
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
use serde::{Deserialize, Serialize};
|
|
2
|
-
use std::collections::HashMap;
|
|
3
|
-
|
|
4
|
-
use ahqstore_types::AppRepo;
|
|
5
|
-
|
|
6
|
-
pub type Str = String;
|
|
7
|
-
pub type Config<'a> = HashMap<String, IMetadata<'a>>;
|
|
8
|
-
|
|
9
|
-
mod file_sorter;
|
|
10
|
-
mod platforms;
|
|
11
|
-
pub use file_sorter::*;
|
|
12
|
-
pub use platforms::*;
|
|
13
|
-
|
|
14
|
-
#[derive(Debug, Serialize, Deserialize)]
|
|
15
|
-
#[allow(non_snake_case)]
|
|
16
|
-
pub struct IMetadata<'a> {
|
|
17
|
-
pub appId: Str,
|
|
18
|
-
pub appShortcutName: Str,
|
|
19
|
-
pub appDisplayName: Str,
|
|
20
|
-
pub authorId: Str,
|
|
21
|
-
pub description: Str,
|
|
22
|
-
pub repo: AppRepo,
|
|
23
|
-
#[serde[borrow]]
|
|
24
|
-
pub platform: IPlatform<'a>,
|
|
25
|
-
#[serde[borrow]]
|
|
26
|
-
pub finder: FileFinder<'a>,
|
|
27
|
-
pub site: Option<Str>,
|
|
28
|
-
pub redistributed: Option<Str>,
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
impl<'a> IMetadata<'a> {
|
|
32
|
-
#[allow(non_snake_case)]
|
|
33
|
-
pub fn new(
|
|
34
|
-
appId: Str,
|
|
35
|
-
appShortcutName: Str,
|
|
36
|
-
appDisplayName: Str,
|
|
37
|
-
authorId: Str,
|
|
38
|
-
description: Str,
|
|
39
|
-
repo: AppRepo,
|
|
40
|
-
platform: IPlatform<'a>,
|
|
41
|
-
) -> Config {
|
|
42
|
-
let mut config = Config::new();
|
|
43
|
-
|
|
44
|
-
config.insert(
|
|
45
|
-
appId.clone(),
|
|
46
|
-
Self {
|
|
47
|
-
appId,
|
|
48
|
-
appShortcutName,
|
|
49
|
-
appDisplayName,
|
|
50
|
-
authorId,
|
|
51
|
-
description,
|
|
52
|
-
repo,
|
|
53
|
-
platform,
|
|
54
|
-
finder: FileFinder::new(),
|
|
55
|
-
site: None,
|
|
56
|
-
redistributed: None
|
|
57
|
-
},
|
|
58
|
-
);
|
|
59
|
-
|
|
60
|
-
config
|
|
61
|
-
}
|
|
62
|
-
}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
use ahqstore_types::{InstallType, InstallerFormat, Win32Deps};
|
|
2
|
-
use serde::{Deserialize, Serialize};
|
|
3
|
-
|
|
4
|
-
#[derive(Debug, Serialize, Deserialize)]
|
|
5
|
-
#[allow(non_snake_case)]
|
|
6
|
-
pub struct IPlatform<'a> {
|
|
7
|
-
pub installType: InstallType,
|
|
8
|
-
pub win32Platform: Option<InstallerFormat>,
|
|
9
|
-
pub linuxPlatform: Option<InstallerFormat>,
|
|
10
|
-
#[serde(borrow)]
|
|
11
|
-
pub win32Options: Option<IOWin32<'a>>,
|
|
12
|
-
pub linuxOptions: Option<IOLinux>,
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
#[derive(Debug, Serialize, Deserialize)]
|
|
16
|
-
pub struct IOWin32<'a> {
|
|
17
|
-
pub deps: Vec<Win32Deps>,
|
|
18
|
-
#[serde(borrow)]
|
|
19
|
-
pub zip_file_exec: Option<&'a str>,
|
|
20
|
-
#[serde(borrow)]
|
|
21
|
-
pub exe_installer_args: Option<Vec<&'a str>>,
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
#[derive(Debug, Serialize, Deserialize)]
|
|
25
|
-
pub struct IOLinux {
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
impl<'a> IPlatform<'a> {
|
|
30
|
-
pub fn new(platforms: Vec<InstallerFormat>) -> Self {
|
|
31
|
-
let win32 = own(
|
|
32
|
-
platforms
|
|
33
|
-
.iter()
|
|
34
|
-
.find(|p| !matches!(&p, &&&InstallerFormat::LinuxAppImage)),
|
|
35
|
-
);
|
|
36
|
-
|
|
37
|
-
let linux = own(
|
|
38
|
-
platforms
|
|
39
|
-
.iter()
|
|
40
|
-
.find(|p| matches!(&p, &&&InstallerFormat::LinuxAppImage)),
|
|
41
|
-
);
|
|
42
|
-
|
|
43
|
-
Self {
|
|
44
|
-
installType: InstallType::Computer,
|
|
45
|
-
win32Platform: win32,
|
|
46
|
-
linuxPlatform: linux,
|
|
47
|
-
win32Options: Some(IOWin32 {
|
|
48
|
-
deps: vec![],
|
|
49
|
-
exe_installer_args: Some(vec![]),
|
|
50
|
-
zip_file_exec: None,
|
|
51
|
-
}),
|
|
52
|
-
linuxOptions: Some(IOLinux { }),
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
fn own(val: Option<&InstallerFormat>) -> Option<InstallerFormat> {
|
|
58
|
-
if let Some(v) = val {
|
|
59
|
-
Some(match &v {
|
|
60
|
-
&&InstallerFormat::LinuxAppImage => InstallerFormat::LinuxAppImage,
|
|
61
|
-
&&InstallerFormat::WindowsInstallerExe => InstallerFormat::WindowsInstallerExe,
|
|
62
|
-
&&InstallerFormat::WindowsZip => InstallerFormat::WindowsZip,
|
|
63
|
-
&&InstallerFormat::WindowsInstallerMsi => InstallerFormat::WindowsInstallerMsi,
|
|
64
|
-
&&InstallerFormat::WindowsUWPMsix => InstallerFormat::WindowsUWPMsix,
|
|
65
|
-
})
|
|
66
|
-
} else {
|
|
67
|
-
None
|
|
68
|
-
}
|
|
69
|
-
}
|
package/cli-rs/src/lib.rs
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
#[cfg(feature = "node")]
|
|
2
|
-
mod app;
|
|
3
|
-
#[cfg(feature = "node")]
|
|
4
|
-
use node_bindgen::derive::node_bindgen;
|
|
5
|
-
#[cfg(feature = "node")]
|
|
6
|
-
use tslink::tslink;
|
|
7
|
-
|
|
8
|
-
#[cfg(feature = "node")]
|
|
9
|
-
#[tslink]
|
|
10
|
-
#[node_bindgen]
|
|
11
|
-
pub fn node_entrypoint(args: Vec<String>, gh: bool) {
|
|
12
|
-
app::start(args, gh);
|
|
13
|
-
}
|
package/cli-rs/src/main.rs
DELETED
package/cli-rs/tslink.toml
DELETED