@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.
@@ -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
- }
@@ -1,10 +0,0 @@
1
- use std::env::args;
2
-
3
- mod app;
4
-
5
- fn main() {
6
- let mut arg = args().collect::<Vec<String>>();
7
- arg.remove(0);
8
-
9
- app::start(arg, std::env::var("GH_ACTION").is_ok());
10
- }
@@ -1,2 +0,0 @@
1
- node = "./dist/index.node"
2
- snake_case_naming = "methods"