@ahqstore/cli 0.10.6 → 0.10.7
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 +1 -1
- package/README.md +70 -21
- package/js/cli.js +23 -2
- package/js/download.js +6 -2
- package/js/types.d.ts +0 -0
- package/jsr.json +12 -0
- package/package.json +5 -2
package/Cargo.toml
CHANGED
package/README.md
CHANGED
|
@@ -2,38 +2,87 @@
|
|
|
2
2
|
|
|
3
3
|
Read more about it [here](https://ahqstore.github.io)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
This is the Official AHQ Store CLI and the CLI with the most number of ports.
|
|
6
|
+
The original CLI has been written in rust lang and we're quite excited to tell you how versatile this tool actually is. This tool is **OFFICIALLY** available and mainted for :
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
- [Crates.io (Original)](https://crates.io/crates/ahqstore_cli_rs)
|
|
9
|
+
- [npmjs (Port)](https://www.npmjs.com/package/@ahqstore/cli)
|
|
10
|
+
- [jsr (Port)](https://jsr.io/@ahqstore/cli)
|
|
11
|
+
- [PyPi (Port)](https://pypi.org/project/ahqstore-cli/)
|
|
12
|
+
- [Nuget (Port)](https://www.nuget.org/packages/AHQStoreCLI)
|
|
13
|
+
- [Golang (Port; Not Tested)](https://github.com/ahqstore/cli/tree/main/go)
|
|
8
14
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
- Update Dependencies
|
|
15
|
+
All the platforms use the same codebase (the rust codebase). We're making use of the C-Abi to
|
|
16
|
+
make the CLI compatible to the following languages/runtimes:
|
|
12
17
|
|
|
13
|
-
|
|
18
|
+
- Cargo
|
|
19
|
+
- NodeJS
|
|
20
|
+
- Deno
|
|
21
|
+
- Bun
|
|
22
|
+
- Python
|
|
23
|
+
- .NET C#
|
|
24
|
+
- Golang
|
|
14
25
|
|
|
15
|
-
|
|
26
|
+
# Usage
|
|
16
27
|
|
|
17
|
-
|
|
28
|
+
Head over to https://ahqstore.github.io/guide/cli/ for usage references!
|
|
18
29
|
|
|
19
|
-
|
|
30
|
+
# Installation
|
|
20
31
|
|
|
21
|
-
##
|
|
32
|
+
## Rust
|
|
22
33
|
|
|
23
|
-
|
|
34
|
+
There are two ways to install in Rust Lang, `cargo install` and `cargo binstall`
|
|
24
35
|
|
|
25
|
-
##
|
|
36
|
+
## cargo install (official)
|
|
26
37
|
|
|
27
|
-
|
|
28
|
-
|
|
38
|
+
```sh
|
|
39
|
+
cargo install ahqstore_cli_rs
|
|
40
|
+
```
|
|
29
41
|
|
|
30
|
-
|
|
42
|
+
### cargo binstall
|
|
31
43
|
|
|
32
|
-
|
|
44
|
+
```sh
|
|
45
|
+
cargo binstall ahqstore_cli_rs
|
|
46
|
+
```
|
|
33
47
|
|
|
34
|
-
|
|
48
|
+
## NodeJS
|
|
35
49
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
50
|
+
```sh
|
|
51
|
+
npm i -g @ahqstore/cli
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Deno
|
|
55
|
+
|
|
56
|
+
### Using npmjs
|
|
57
|
+
|
|
58
|
+
```sh
|
|
59
|
+
deno install -g npm:@ahqstore/cli
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Using JSR
|
|
63
|
+
|
|
64
|
+
```sh
|
|
65
|
+
deno install -A -f -g -n ahqstore https://jsr.io/@ahqstore/cli/0.10.7/js/cli.js
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Bun
|
|
69
|
+
|
|
70
|
+
```sh
|
|
71
|
+
bun install -g @ahqstore/cli
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Python
|
|
75
|
+
|
|
76
|
+
```sh
|
|
77
|
+
pip install ahqstore-cli
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## GoLang
|
|
81
|
+
|
|
82
|
+
To be yet figured out
|
|
83
|
+
|
|
84
|
+
## .NET C#
|
|
85
|
+
|
|
86
|
+
```sh
|
|
87
|
+
dotnet tool install --global AHQStoreCLI
|
|
88
|
+
```
|
package/js/cli.js
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
#! /usr/bin/env node
|
|
2
2
|
// @ts-check
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
/* @ts-self-types="./types.d.ts" */
|
|
5
|
+
|
|
6
|
+
import { join, dirname } from "node:path";
|
|
5
7
|
import { existsSync, mkdirSync, rmSync } from "node:fs";
|
|
6
8
|
import { argv, env, platform } from "node:process";
|
|
9
|
+
import { fileURLToPath } from 'node:url';
|
|
7
10
|
|
|
8
11
|
import { downloadModuleWithProgress } from "./download.js";
|
|
9
12
|
|
|
@@ -12,7 +15,12 @@ import c from "ansi-colors";
|
|
|
12
15
|
import koffi from "koffi";
|
|
13
16
|
|
|
14
17
|
import pkg from "../package.json" with { type: "json" };
|
|
18
|
+
import { homedir } from "node:os";
|
|
15
19
|
|
|
20
|
+
/**
|
|
21
|
+
* This function is internal and should not be used
|
|
22
|
+
* @returns {{ prefix: string; suffix: string; }}
|
|
23
|
+
*/
|
|
16
24
|
export function getPrefixSuffix() {
|
|
17
25
|
let prefix = "";
|
|
18
26
|
let suffix = "";
|
|
@@ -39,7 +47,9 @@ export function getPrefixSuffix() {
|
|
|
39
47
|
}
|
|
40
48
|
|
|
41
49
|
/**
|
|
50
|
+
* This function is internal and should not be used
|
|
42
51
|
* @param {string} name
|
|
52
|
+
* @returns {string}
|
|
43
53
|
*/
|
|
44
54
|
function getLibraryFilename(name) {
|
|
45
55
|
const { prefix, suffix } = getPrefixSuffix();
|
|
@@ -47,7 +57,18 @@ function getLibraryFilename(name) {
|
|
|
47
57
|
return `${prefix}${name}${suffix}`;
|
|
48
58
|
}
|
|
49
59
|
|
|
50
|
-
|
|
60
|
+
let __dirname = `${homedir()}/ahqstore-js`;
|
|
61
|
+
|
|
62
|
+
try {
|
|
63
|
+
__dirname = dirname(fileURLToPath(import.meta.url));
|
|
64
|
+
} catch (e) {
|
|
65
|
+
try {
|
|
66
|
+
mkdirSync(`${__dirname}`);
|
|
67
|
+
mkdirSync(`${__dirname}/lib`);
|
|
68
|
+
} catch (e) {}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const dylibDir = join(__dirname, "lib");
|
|
51
72
|
const dylib = join(dylibDir, getLibraryFilename("ahqstore_cli_rs"));
|
|
52
73
|
|
|
53
74
|
if (!(existsSync(dylibDir) && existsSync(dylib))) {
|
package/js/download.js
CHANGED
|
@@ -16,6 +16,10 @@ const bar = new SingleBar({
|
|
|
16
16
|
hideCursor: true,
|
|
17
17
|
});
|
|
18
18
|
|
|
19
|
+
/**
|
|
20
|
+
* This function is internal and should not be used
|
|
21
|
+
* @returns {string}
|
|
22
|
+
*/
|
|
19
23
|
function getDownload() {
|
|
20
24
|
const { prefix, suffix } = getPrefixSuffix();
|
|
21
25
|
|
|
@@ -23,14 +27,14 @@ function getDownload() {
|
|
|
23
27
|
}
|
|
24
28
|
|
|
25
29
|
/**
|
|
26
|
-
*
|
|
30
|
+
* This function is internal and should not be used
|
|
27
31
|
* @param {number} ms
|
|
28
32
|
* @returns {Promise<undefined>}
|
|
29
33
|
*/
|
|
30
34
|
const delay = (ms) => new Promise((resolve) => setTimeout(() => resolve(undefined), ms));
|
|
31
35
|
|
|
32
36
|
/**
|
|
33
|
-
*
|
|
37
|
+
* This function is internal and should not be used
|
|
34
38
|
* @param {string} file
|
|
35
39
|
* @returns {Promise<undefined>}
|
|
36
40
|
*/
|
package/js/types.d.ts
ADDED
|
File without changes
|
package/jsr.json
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ahqstore/cli",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.7",
|
|
4
4
|
"description": "AHQ Store Official CLI, A port of the rust version to NodeJS",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"bin": {
|
|
22
22
|
"ahqstore": "./js/cli.js"
|
|
23
23
|
},
|
|
24
|
-
"readme": "README.md",
|
|
24
|
+
"readme": "./README.md",
|
|
25
25
|
"scripts": {
|
|
26
26
|
"postinstall": "node js/postinstall.js"
|
|
27
27
|
},
|
|
@@ -32,5 +32,8 @@
|
|
|
32
32
|
},
|
|
33
33
|
"engines": {
|
|
34
34
|
"node": ">=22"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"jsr": "^0.13.5"
|
|
35
38
|
}
|
|
36
39
|
}
|