@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.
@@ -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>[]>;
@@ -0,0 +1,2 @@
1
+ import ora from "ora";
2
+ export declare const spinner: typeof ora;
@@ -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.64.6",
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
- "contributors": [
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 --bun build.ts",
56
- "typecheck": "bun --bun tsc --noEmit",
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": "latest",
63
- "@stacksjs/config": "latest",
64
- "@stacksjs/error-handling": "latest",
65
- "@stacksjs/logging": "latest",
66
- "@stacksjs/path": "latest",
67
- "@stacksjs/types": "latest",
68
- "@stacksjs/utils": "latest",
69
- "@stacksjs/validation": "latest",
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": "latest",
70
+ "@stacksjs/development": "0.67.0",
78
71
  "@types/prompts": "^2.4.9"
79
72
  }
80
73
  }