@stacksjs/cli 0.64.6 → 0.67.0
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/README.md +29 -28
- package/dist/actions/index.d.ts +1 -0
- package/dist/actions/install.d.ts +26 -0
- package/dist/app.d.ts +100 -0
- package/dist/cli.d.ts +10 -0
- package/dist/command.d.ts +32 -0
- package/dist/console.d.ts +3 -0
- package/dist/exec.d.ts +40 -0
- package/dist/helpers.d.ts +9 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +21640 -12
- package/dist/parse.d.ts +15 -0
- package/dist/run.d.ts +63 -0
- package/dist/spinner.d.ts +2 -0
- package/dist/utils.d.ts +5 -0
- package/package.json +15 -22
- package/dist/index.js.map +0 -120
- package/src/actions/index.ts +0 -1
- package/src/actions/install.ts +0 -38
- package/src/app.ts +0 -773
- package/src/cli.ts +0 -30
- package/src/command.ts +0 -47
- package/src/console.ts +0 -4
- package/src/exec.ts +0 -122
- package/src/helpers.ts +0 -69
- package/src/index.ts +0 -10
- package/src/parse.ts +0 -170
- package/src/run.ts +0 -108
- package/src/spinner.ts +0 -3
- package/src/utils.ts +0 -83
package/dist/parse.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
interface ParsedArgv {
|
|
2
|
+
args: string[];
|
|
3
|
+
options: { [k: string]: string | boolean | number };
|
|
4
|
+
}
|
|
5
|
+
export declare function parseArgv(argv?: string[]): ParsedArgv;
|
|
6
|
+
export declare function parseArgs(argv?: string[]): string[];
|
|
7
|
+
interface CliOptions {
|
|
8
|
+
dryRun?: boolean;
|
|
9
|
+
quiet?: boolean;
|
|
10
|
+
verbose?: boolean;
|
|
11
|
+
[k: string]: string | boolean | number | undefined;
|
|
12
|
+
}
|
|
13
|
+
export declare function parseOptions(options?: CliOptions): CliOptions;
|
|
14
|
+
export declare function buddyOptions(options?: string[] | Record<string, any>): string;
|
|
15
|
+
export {};
|
package/dist/run.d.ts
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { Ok, Result } from "@stacksjs/error-handling";
|
|
2
|
+
import type { CliOptions, CommandError, Readable, Subprocess, Writable } from "@stacksjs/types";
|
|
3
|
+
/**
|
|
4
|
+
* Run a command.
|
|
5
|
+
*
|
|
6
|
+
* @param command The command to run.
|
|
7
|
+
* @param options The options to pass to the command.
|
|
8
|
+
* @returns The result of the command.
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* const result = await runCommand('ls')
|
|
12
|
+
*
|
|
13
|
+
* if (result.isErr())
|
|
14
|
+
* console.error(result.error)
|
|
15
|
+
* else
|
|
16
|
+
* console.log(result)
|
|
17
|
+
* ```
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* const result = await runCommand('ls', { cwd: '/home' })
|
|
21
|
+
*
|
|
22
|
+
* if (result.isErr())
|
|
23
|
+
* console.error(result.error)
|
|
24
|
+
* else
|
|
25
|
+
* console.log(result)
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export declare function runCommand(command: string, options?: CliOptions): Promise<Result<Subprocess, CommandError>>;
|
|
29
|
+
export declare function runProcess(command: string, options?: CliOptions): Promise<Result<Subprocess, CommandError>>;
|
|
30
|
+
/**
|
|
31
|
+
* Run a command.
|
|
32
|
+
*
|
|
33
|
+
* @param command The command to run.
|
|
34
|
+
* @param options The options to pass to the command.
|
|
35
|
+
* @returns The result of the command.
|
|
36
|
+
* @example
|
|
37
|
+
* ```ts
|
|
38
|
+
* const result = runCommandSync('ls')
|
|
39
|
+
*
|
|
40
|
+
* if (result.isErr())
|
|
41
|
+
* console.error(result.error)
|
|
42
|
+
* else
|
|
43
|
+
* console.log(result)
|
|
44
|
+
* ```
|
|
45
|
+
* @example
|
|
46
|
+
* ```ts
|
|
47
|
+
* const result = runCommandSync('ls', { cwd: '/home' })
|
|
48
|
+
*
|
|
49
|
+
* if (result.isErr())
|
|
50
|
+
* console.error(result.error)
|
|
51
|
+
* else
|
|
52
|
+
* console.log(result)
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
export declare function runCommandSync(command: string, options?: CliOptions): Promise<string>;
|
|
56
|
+
/**
|
|
57
|
+
* Run many commands.
|
|
58
|
+
*
|
|
59
|
+
* @param commands The command to run.
|
|
60
|
+
* @param options The options to pass to the command.
|
|
61
|
+
* @returns The result of the command.
|
|
62
|
+
*/
|
|
63
|
+
export declare function runCommands(commands: string[], options?: CliOptions): Promise<Ok<Subprocess<Writable, Readable, Readable>, Error>[]>;
|
package/dist/utils.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type Collection } from "@stacksjs/collections";
|
|
2
|
+
export { align, box, centerAlign, colorize, colors, getColor, leftAlign, rightAlign, stripAnsi } from "consola/utils";
|
|
3
|
+
export * as kolorist from "kolorist";
|
|
4
|
+
export { ansi256, ansi256Bg, bgBlack, bgBlue, bgCyan, bgGray, bgGreen, bgLightBlue, bgLightCyan, bgLightGray, bgLightGreen, bgLightMagenta, bgLightRed, bgLightYellow, bgMagenta, bgRed, bgWhite, bgYellow, black, blue, bold, cyan, dim, gray, green, hidden, inverse, italic, lightBlue, lightCyan, lightGray, lightGreen, lightMagenta, lightRed, lightYellow, link, magenta, red, reset, strikethrough, stripColors, trueColor, trueColorBg, underline, white, yellow } from "kolorist";
|
|
5
|
+
export declare const quotes: Collection<string[]>;
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/cli",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.67.0",
|
|
5
5
|
"description": "TypeScript framework for CLI artisans. Build beautiful console apps with ease.",
|
|
6
6
|
"author": "Chris Breuer",
|
|
7
|
+
"contributors": ["Chris Breuer <chris@stacksjs.org>"],
|
|
7
8
|
"license": "MIT",
|
|
8
9
|
"funding": "https://github.com/sponsors/chrisbbreuer",
|
|
9
10
|
"homepage": "https://github.com/stacksjs/stacks/tree/main/storage/framework/core/cli#readme",
|
|
@@ -33,40 +34,32 @@
|
|
|
33
34
|
],
|
|
34
35
|
"exports": {
|
|
35
36
|
".": {
|
|
36
|
-
"bun": "./src/index.ts",
|
|
37
37
|
"import": "./dist/index.js"
|
|
38
38
|
},
|
|
39
39
|
"./*": {
|
|
40
|
-
"bun": "./*",
|
|
41
40
|
"import": "./dist/*"
|
|
42
41
|
}
|
|
43
42
|
},
|
|
44
43
|
"module": "dist/index.js",
|
|
45
44
|
"types": "dist/index.d.ts",
|
|
46
|
-
"
|
|
47
|
-
"Chris Breuer <chris@stacksjs.org>"
|
|
48
|
-
],
|
|
49
|
-
"files": [
|
|
50
|
-
"README.md",
|
|
51
|
-
"dist",
|
|
52
|
-
"src"
|
|
53
|
-
],
|
|
45
|
+
"files": ["README.md", "dist"],
|
|
54
46
|
"scripts": {
|
|
55
|
-
"build": "bun
|
|
56
|
-
"typecheck": "bun
|
|
47
|
+
"build": "bun build.ts",
|
|
48
|
+
"typecheck": "bun tsc --noEmit",
|
|
49
|
+
"test": "bun test",
|
|
57
50
|
"prepublishOnly": "bun run build"
|
|
58
51
|
},
|
|
59
52
|
"dependencies": {
|
|
60
53
|
"@antfu/install-pkg": "^0.4.1",
|
|
61
54
|
"@clack/core": "^0.3.4",
|
|
62
|
-
"@stacksjs/collections": "
|
|
63
|
-
"@stacksjs/config": "
|
|
64
|
-
"@stacksjs/error-handling": "
|
|
65
|
-
"@stacksjs/logging": "
|
|
66
|
-
"@stacksjs/path": "
|
|
67
|
-
"@stacksjs/types": "
|
|
68
|
-
"@stacksjs/utils": "
|
|
69
|
-
"@stacksjs/validation": "
|
|
55
|
+
"@stacksjs/collections": "0.67.0",
|
|
56
|
+
"@stacksjs/config": "0.67.0",
|
|
57
|
+
"@stacksjs/error-handling": "0.67.0",
|
|
58
|
+
"@stacksjs/logging": "0.67.0",
|
|
59
|
+
"@stacksjs/path": "0.67.0",
|
|
60
|
+
"@stacksjs/types": "0.67.0",
|
|
61
|
+
"@stacksjs/utils": "0.67.0",
|
|
62
|
+
"@stacksjs/validation": "0.67.0",
|
|
70
63
|
"cac": "^6.7.14",
|
|
71
64
|
"consola": "^3.2.3",
|
|
72
65
|
"kolorist": "1.8.0",
|
|
@@ -74,7 +67,7 @@
|
|
|
74
67
|
"prompts": "^2.4.2"
|
|
75
68
|
},
|
|
76
69
|
"devDependencies": {
|
|
77
|
-
"@stacksjs/development": "
|
|
70
|
+
"@stacksjs/development": "0.67.0",
|
|
78
71
|
"@types/prompts": "^2.4.9"
|
|
79
72
|
}
|
|
80
73
|
}
|