@stacksjs/cli 0.67.0 → 0.68.1
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/dist/app.d.ts +81 -89
- package/dist/cli.d.ts +12 -8
- package/dist/command.d.ts +33 -25
- package/dist/console.d.ts +15 -3
- package/dist/exec.d.ts +3 -38
- package/dist/helpers.d.ts +3 -8
- package/dist/index.d.ts +10 -10
- package/dist/index.js +311 -590
- package/dist/install.d.ts +13 -0
- package/dist/parse.d.ts +11 -11
- package/dist/run.d.ts +3 -60
- package/dist/spinner.d.ts +1 -2
- package/dist/utils.d.ts +6 -5
- package/package.json +7 -7
- package/dist/actions/index.d.ts +0 -1
- package/dist/actions/install.d.ts +0 -26
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { installPackage as installPkg } from '@antfu/install-pkg';
|
|
2
|
+
|
|
3
|
+
declare interface InstallPackageOptions {
|
|
4
|
+
cwd?: string
|
|
5
|
+
dev?: boolean
|
|
6
|
+
silent?: boolean
|
|
7
|
+
packageManager?: string
|
|
8
|
+
packageManagerVersion?: string
|
|
9
|
+
preferOffline?: boolean
|
|
10
|
+
additionalArgs?: string[]
|
|
11
|
+
}
|
|
12
|
+
export declare function installPackage(name: string, options?: InstallPackageOptions): Promise<any>;
|
|
13
|
+
export declare function installStack(name: string, options?: InstallPackageOptions): Promise<any>;
|
package/dist/parse.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
interface ParsedArgv {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
declare interface ParsedArgv {
|
|
2
|
+
args: string[]
|
|
3
|
+
options: {
|
|
4
|
+
[k: string]: string | boolean | number
|
|
5
|
+
}
|
|
4
6
|
}
|
|
7
|
+
declare function isLongOption(arg?: string): boolean;
|
|
8
|
+
declare function isShortOption(arg: string): boolean;
|
|
9
|
+
declare function parseValue(value: string): string | boolean | number;
|
|
10
|
+
declare function parseLongOption(arg: string, argv: string[], index: number, options: { [k: string]: string | boolean | number },): number;
|
|
11
|
+
declare function parseShortOption(arg: string, argv: string[], index: number, options: { [k: string]: string | boolean | number },): number;
|
|
5
12
|
export declare function parseArgv(argv?: string[]): ParsedArgv;
|
|
6
13
|
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
14
|
export declare function parseOptions(options?: CliOptions): CliOptions;
|
|
14
|
-
export declare function buddyOptions(options?: string[] | Record<string, any>): string;
|
|
15
|
-
export {};
|
|
15
|
+
export declare function buddyOptions(options?: string[] | Record<string, any>): string;
|
package/dist/run.d.ts
CHANGED
|
@@ -1,63 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
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
|
-
*/
|
|
1
|
+
import type { CliOptions, CommandError, Readable, Subprocess } from '@stacksjs/types';
|
|
2
|
+
|
|
28
3
|
export declare function runCommand(command: string, options?: CliOptions): Promise<Result<Subprocess, CommandError>>;
|
|
29
4
|
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
5
|
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>[]>;
|
|
6
|
+
export declare function runCommands(commands: string[], options?: CliOptions,): Promise<Ok<Subprocess<Writable, Readable, Readable>, Error>[]>;
|
package/dist/spinner.d.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const spinner: typeof ora;
|
|
1
|
+
export declare const spinner: typeof ora;
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
export {
|
|
5
|
-
export
|
|
1
|
+
import type { Collection } from '@stacksjs/collections';
|
|
2
|
+
|
|
3
|
+
export {
|
|
4
|
+
export {
|
|
5
|
+
export * as kolorist from 'kolorist'
|
|
6
|
+
export declare let quotes: Collection<string[]>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/cli",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.68.1",
|
|
5
5
|
"description": "TypeScript framework for CLI artisans. Build beautiful console apps with ease.",
|
|
6
6
|
"author": "Chris Breuer",
|
|
7
7
|
"contributors": ["Chris Breuer <chris@stacksjs.org>"],
|
|
@@ -49,25 +49,25 @@
|
|
|
49
49
|
"test": "bun test",
|
|
50
50
|
"prepublishOnly": "bun run build"
|
|
51
51
|
},
|
|
52
|
-
"
|
|
52
|
+
"devDependencies": {
|
|
53
53
|
"@antfu/install-pkg": "^0.4.1",
|
|
54
54
|
"@clack/core": "^0.3.4",
|
|
55
55
|
"@stacksjs/collections": "0.67.0",
|
|
56
56
|
"@stacksjs/config": "0.67.0",
|
|
57
|
+
"@stacksjs/development": "0.67.0",
|
|
57
58
|
"@stacksjs/error-handling": "0.67.0",
|
|
58
59
|
"@stacksjs/logging": "0.67.0",
|
|
59
60
|
"@stacksjs/path": "0.67.0",
|
|
60
61
|
"@stacksjs/types": "0.67.0",
|
|
61
62
|
"@stacksjs/utils": "0.67.0",
|
|
62
63
|
"@stacksjs/validation": "0.67.0",
|
|
64
|
+
"@types/prompts": "^2.4.9",
|
|
65
|
+
"ansi-escapes": "^7.0.0",
|
|
63
66
|
"cac": "^6.7.14",
|
|
64
67
|
"consola": "^3.2.3",
|
|
65
68
|
"kolorist": "1.8.0",
|
|
66
69
|
"ora": "^8.1.0",
|
|
67
|
-
"prompts": "^2.4.2"
|
|
68
|
-
|
|
69
|
-
"devDependencies": {
|
|
70
|
-
"@stacksjs/development": "0.67.0",
|
|
71
|
-
"@types/prompts": "^2.4.9"
|
|
70
|
+
"prompts": "^2.4.2",
|
|
71
|
+
"supports-hyperlinks": "^3.1.0"
|
|
72
72
|
}
|
|
73
73
|
}
|
package/dist/actions/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./install";
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
interface InstallPackageOptions {
|
|
2
|
-
cwd?: string;
|
|
3
|
-
dev?: boolean;
|
|
4
|
-
silent?: boolean;
|
|
5
|
-
packageManager?: string;
|
|
6
|
-
packageManagerVersion?: string;
|
|
7
|
-
preferOffline?: boolean;
|
|
8
|
-
additionalArgs?: string[];
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Install an npm package.
|
|
12
|
-
*
|
|
13
|
-
* @param name - The package name to install.
|
|
14
|
-
* @param options - The options to pass to the install.The options to pass to the install.
|
|
15
|
-
* @returns The result of the install.
|
|
16
|
-
*/
|
|
17
|
-
export declare function installPackage(name: string, options?: InstallPackageOptions): Promise<any>;
|
|
18
|
-
/**
|
|
19
|
-
* Install a Stack into your project.
|
|
20
|
-
*
|
|
21
|
-
* @param name - The Stack name to install.
|
|
22
|
-
* @param options - The options to pass to the install.
|
|
23
|
-
* @returns The result of the install.
|
|
24
|
-
*/
|
|
25
|
-
export declare function installStack(name: string, options?: InstallPackageOptions): Promise<any>;
|
|
26
|
-
export {};
|