@stacksjs/cli 0.68.1 → 0.69.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 CHANGED
@@ -1,7 +1,5 @@
1
- export { isCancel } from '@clack/core'
2
- declare type State,
3
- TextPrompt,
4
- } from '@clack/core'
1
+ import type { State } from '@clack/core';
2
+
5
3
  declare const unicode: (...args: any[]) => unknown;
6
4
  declare const S_BAR_START: unknown;
7
5
  declare const S_RADIO_ACTIVE: unknown;
@@ -32,7 +30,9 @@ declare type Primitive = Readonly<string | boolean | number>
32
30
 
33
31
  type Option<Value> = Value extends Primitive
34
32
  ? { value: Value, label?: string, hint?: string }
35
- export declare interface SelectOptions<Value> {
33
+ : { value: Value, label: string, hint?: string }
34
+
35
+ export interface SelectOptions<Value> {
36
36
  message: string
37
37
  options: Option<Value>[]
38
38
  initialValue?: Value
@@ -40,53 +40,13 @@ export declare interface SelectOptions<Value> {
40
40
  }
41
41
  export declare function select<Value>(opts: SelectOptions<Value>): void;
42
42
  export declare function selectKey<Value extends string>(opts: SelectOptions<Value>): void;
43
- export declare interface MultiSelectOptions<Value> {
44
- message: string
45
- options: Option<Value>[]
46
- initialValues?: Value[]
47
- maxItems?: number
48
- required?: boolean
49
- cursorAt?: Value
50
- }
51
43
  export declare function multiselect<Value>(opts: MultiSelectOptions<Value>): void;
52
- export declare interface GroupMultiSelectOptions<Value> {
53
- message: string
54
- options: Record<string, Option<Value>[]>
55
- initialValues?: Value[]
56
- required?: boolean
57
- cursorAt?: Value
58
- }
59
44
  export declare function groupMultiselect<Value>(opts: GroupMultiSelectOptions<Value>): void;
60
- declare const strip: (str: string) => unknown;
61
- export declare function cancel(message = ''): void;
62
- export declare function intro(title = ''): void;
63
- export declare function outro(message = ''): void;
64
- declare interface Spinner {
65
- start: (msg: string) => void
66
- stop: (msg: string, code: number) => void
67
- message: (msg: string) => void
68
- }
45
+ export declare function note(message, title): void;
46
+ export declare function cancel(message): void;
47
+ export declare function intro(title): void;
48
+ export declare function outro(message): void;
69
49
  export declare function spinner(): Spinner;
70
50
  declare function ansiRegex(): void;
71
- export declare type PromptGroupAwaitedReturn<T> = {
72
- [P in keyof T]: Exclude<Awaited<T[P]>, symbol>
73
- }
74
- export declare interface PromptGroupOptions<T> {
75
- onCancel?: (opts: { results: Prettify<Partial<PromptGroupAwaitedReturn<T>>> }) => void
76
- }
77
- declare type Prettify<T> = {
78
- [P in keyof T]: T[P]
79
- } & {}
80
- export declare type PromptGroup<T> = {
81
- [P in keyof T]: (opts: {
82
- results: Prettify<Partial<PromptGroupAwaitedReturn<Omit<T, P>>>>
83
- }) => void | Promise<T[P] | void>
84
- }
85
- export declare function group<T>(prompts: PromptGroup<T>, opts?: PromptGroupOptions<T>): Promise<Prettify<PromptGroupAwaitedReturn<T>>>;
86
- export declare interface Task {
87
- title: string
88
- task: (message: (string: string) => void) => string | Promise<string> | void | Promise<void>
89
51
 
90
- enabled?: boolean
91
- }
92
- export declare function tasks(tasks: Task[]): Promise<void>;
52
+ export { isCancel } from '@clack/core'
package/dist/cli.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  import type { CliOptions } from '@stacksjs/types';
2
2
  import { CAC } from 'cac';
3
3
 
4
- export { CAC }
5
4
  export declare interface ParsedArgv {
6
5
  args: ReadonlyArray<string>
7
6
  options: {
@@ -11,4 +10,6 @@ export declare interface ParsedArgv {
11
10
  declare interface CliOptions {
12
11
  name?: string
13
12
  }
14
- export declare function cli(name?: string | CliOptions, options?: CliOptions): CAC;
13
+ export declare function cli(name?: string | CliOptions, options?: CliOptions): CAC;
14
+
15
+ export { CAC }
package/dist/command.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { CliOptions, Readable } from '@stacksjs/types';
1
+ import type { CliOptions, Readable, Subprocess } from '@stacksjs/types';
2
2
 
3
3
  declare type CommandOptionTuple = [string, string, { default: boolean }]
4
4
  interface CommandOptionObject {
@@ -6,7 +6,7 @@ interface CommandOptionObject {
6
6
  description: string
7
7
  default: boolean | string
8
8
  }
9
- declare type CommandOptions = CommandOptionTuple | CommandOptionObject[]
9
+ type CommandOptions = CommandOptionTuple | CommandOptionObject[]
10
10
  interface Options {
11
11
  name: string
12
12
  description: string
@@ -16,7 +16,8 @@ interface Options {
16
16
  onFail: (error: Error) => void
17
17
  onSuccess: () => void
18
18
  }
19
- export declare class Command {
19
+
20
+ export class Command {
20
21
  name: Options['name']
21
22
  description: Options['description']
22
23
  options: Options['options']
@@ -33,8 +34,19 @@ export declare class Command {
33
34
  this.onSuccess = onSuccess
34
35
  }
35
36
  }
36
- export declare const command: {
37
- run: unknown;
38
- Readable, Readable>, Error>> => {
39
- return await runCommand: () => unknown
40
- };
37
+
38
+ export const command = {
39
+ run: async (
40
+ command: string,
41
+ options?: CliOptions,
42
+ ): Promise<Result<Subprocess<Writable, Readable, Readable>, Error>> => {
43
+ return await runCommand(command, options)
44
+ },
45
+
46
+ runSync: async (
47
+ command: string,
48
+ options?: CliOptions,
49
+ ): Promise<Result<Subprocess<Writable, Readable, Readable>, Error>> => {
50
+ return await runCommand(command, options)
51
+ },
52
+ }
package/dist/console.d.ts CHANGED
@@ -1,5 +1,7 @@
1
+ import prompts from 'prompts';
1
2
  import { log } from '@stacksjs/logging';
2
3
 
4
+
3
5
  export { log, prompts }
4
6
 
5
7
  export default function terminalLink(text: string, url: string, { target = 'stdout', ...options }: { target?: string, fallback?: boolean | Function }): string {
package/dist/exec.d.ts CHANGED
@@ -2,4 +2,4 @@ import type { CliOptions, Subprocess } from '@stacksjs/types';
2
2
 
3
3
  export declare function exec(command: string | string[], options?: CliOptions): Promise<Result<Subprocess, Error>>;
4
4
  export declare function execSync(command: string | string[], options?: CliOptions): Promise<string>;
5
- declare function exitHandler(type: 'spawn' | 'spawnSync', subprocess: Subprocess, exitCode: number | null, signalCode: number | null, error?: Error,): void;
5
+ declare function exitHandler(type: 'spawn' | 'spawnSync', subprocess: Subprocess, exitCode: number | null, signalCode: number | null, error?: Error): void;