@sorrell/cli-utilities 1.0.29 → 1.0.30
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/Distribution/English/English.Types.d.ts +18 -0
- package/Distribution/English/English.Types.d.ts.map +1 -0
- package/Distribution/English/English.Types.js +7 -0
- package/Distribution/English/English.Types.js.map +1 -0
- package/Distribution/English/English.d.ts +2 -0
- package/Distribution/English/English.d.ts.map +1 -0
- package/Distribution/English/English.js +7 -0
- package/Distribution/English/English.js.map +1 -0
- package/Distribution/English/index.d.ts +3 -0
- package/Distribution/English/index.d.ts.map +1 -0
- package/Distribution/English/index.js +8 -0
- package/Distribution/English/index.js.map +1 -0
- package/Distribution/English.Types.d.ts +2 -0
- package/Distribution/English.Types.d.ts.map +1 -0
- package/Distribution/English.Types.js +8 -0
- package/Distribution/English.Types.js.map +1 -0
- package/Distribution/English.d.ts +2 -0
- package/Distribution/English.d.ts.map +1 -0
- package/Distribution/English.js +2 -0
- package/Distribution/English.js.map +1 -0
- package/Distribution/Format/Format.Internal.Types.d.ts +4 -0
- package/Distribution/Format/Format.Internal.Types.d.ts.map +1 -0
- package/Distribution/Format/Format.Internal.Types.js +7 -0
- package/Distribution/Format/Format.Internal.Types.js.map +1 -0
- package/Distribution/Format/Format.Internal.d.ts +14 -0
- package/Distribution/Format/Format.Internal.d.ts.map +1 -0
- package/Distribution/Format/Format.Internal.js +78 -0
- package/Distribution/Format/Format.Internal.js.map +1 -0
- package/Distribution/Format/Format.Types.d.ts +13 -0
- package/Distribution/Format/Format.Types.d.ts.map +1 -0
- package/Distribution/Format/Format.Types.js +7 -0
- package/Distribution/Format/Format.Types.js.map +1 -0
- package/Distribution/Format/Format.d.ts +42 -0
- package/Distribution/Format/Format.d.ts.map +1 -0
- package/Distribution/Format/Format.js +95 -0
- package/Distribution/Format/Format.js.map +1 -0
- package/Distribution/Format/index.d.ts +3 -0
- package/Distribution/Format/index.d.ts.map +1 -0
- package/Distribution/Format/index.js +8 -0
- package/Distribution/Format/index.js.map +1 -0
- package/Distribution/Inquirer/Confirm.Types.d.ts +9 -0
- package/Distribution/Inquirer/Confirm.Types.d.ts.map +1 -0
- package/Distribution/Inquirer/Confirm.Types.js +7 -0
- package/Distribution/Inquirer/Confirm.Types.js.map +1 -0
- package/Distribution/Inquirer/Confirm.d.ts +11 -0
- package/Distribution/Inquirer/Confirm.d.ts.map +1 -0
- package/Distribution/Inquirer/Confirm.js +64 -0
- package/Distribution/Inquirer/Confirm.js.map +1 -0
- package/Distribution/Inquirer/FileSelector.Types.d.ts +9 -0
- package/Distribution/Inquirer/FileSelector.Types.d.ts.map +1 -0
- package/Distribution/Inquirer/FileSelector.Types.js +7 -0
- package/Distribution/Inquirer/FileSelector.Types.js.map +1 -0
- package/Distribution/Inquirer/FileSelector.d.ts +15 -0
- package/Distribution/Inquirer/FileSelector.d.ts.map +1 -0
- package/Distribution/Inquirer/FileSelector.js +57 -0
- package/Distribution/Inquirer/FileSelector.js.map +1 -0
- package/Distribution/Inquirer/index.d.ts +5 -0
- package/Distribution/Inquirer/index.d.ts.map +1 -0
- package/Distribution/Inquirer/index.js +10 -0
- package/Distribution/Inquirer/index.js.map +1 -0
- package/Distribution/Listr/Listr.Types.d.ts +42 -0
- package/Distribution/Listr/Listr.Types.d.ts.map +1 -0
- package/Distribution/Listr/Listr.Types.js +7 -0
- package/Distribution/Listr/Listr.Types.js.map +1 -0
- package/Distribution/Listr/Listr.d.ts +31 -0
- package/Distribution/Listr/Listr.d.ts.map +1 -0
- package/Distribution/Listr/Listr.js +148 -0
- package/Distribution/Listr/Listr.js.map +1 -0
- package/Distribution/Listr/index.d.ts +3 -0
- package/Distribution/Listr/index.d.ts.map +1 -0
- package/Distribution/Listr/index.js +8 -0
- package/Distribution/Listr/index.js.map +1 -0
- package/Distribution/Ora/Ora.Types.d.ts +10 -0
- package/Distribution/Ora/Ora.Types.d.ts.map +1 -0
- package/Distribution/Ora/Ora.Types.js +7 -0
- package/Distribution/Ora/Ora.Types.js.map +1 -0
- package/Distribution/Ora/Ora.d.ts +27 -0
- package/Distribution/Ora/Ora.d.ts.map +1 -0
- package/Distribution/Ora/Ora.js +75 -0
- package/Distribution/Ora/Ora.js.map +1 -0
- package/Distribution/Ora/index.d.ts +3 -0
- package/Distribution/Ora/index.d.ts.map +1 -0
- package/Distribution/Ora/index.js +8 -0
- package/Distribution/Ora/index.js.map +1 -0
- package/Distribution/PseudoTerminal/PseudoTerminal.Types.d.ts +2 -0
- package/Distribution/PseudoTerminal/PseudoTerminal.Types.d.ts.map +1 -0
- package/Distribution/PseudoTerminal/PseudoTerminal.Types.js +7 -0
- package/Distribution/PseudoTerminal/PseudoTerminal.Types.js.map +1 -0
- package/Distribution/PseudoTerminal/PseudoTerminal.d.ts +2 -0
- package/Distribution/PseudoTerminal/PseudoTerminal.d.ts.map +1 -0
- package/Distribution/PseudoTerminal/PseudoTerminal.js +10 -0
- package/Distribution/PseudoTerminal/PseudoTerminal.js.map +1 -0
- package/Distribution/PseudoTerminal/index.d.ts +3 -0
- package/Distribution/PseudoTerminal/index.d.ts.map +1 -0
- package/Distribution/PseudoTerminal/index.js +8 -0
- package/Distribution/PseudoTerminal/index.js.map +1 -0
- package/Distribution/index.d.ts +5 -9
- package/Distribution/index.d.ts.map +1 -1
- package/Distribution/index.js +5 -9
- package/Distribution/index.js.map +1 -1
- package/package.json +35 -3
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/* File: FileSelector.ts
|
|
2
|
+
* Author: Gage Sorrell <gage@sorrell.sh>
|
|
3
|
+
* Copyright: (c) 2026 Gage Sorrell
|
|
4
|
+
* License: MIT
|
|
5
|
+
*/
|
|
6
|
+
import { fileSelector } from "@sorrell/inquirer-file-selector";
|
|
7
|
+
/**
|
|
8
|
+
* Create an {@link https://www.npmjs.com/package/@inquirer/prompts | Inquirer} prompt for
|
|
9
|
+
* browsing and selecting a file or directory.
|
|
10
|
+
*
|
|
11
|
+
* This wraps {@link https://www.npmjs.com/package/inquirer-file-selector | inquirer-file-selector}.
|
|
12
|
+
*
|
|
13
|
+
* @deprecated An enquirer-based alternative needs to be found or built.
|
|
14
|
+
*
|
|
15
|
+
* @param Config - The options for the prompt.
|
|
16
|
+
* @returns The `Item` selected by the user via the prompt.
|
|
17
|
+
*/
|
|
18
|
+
export async function FileSelector(Config) {
|
|
19
|
+
const { theme: InTheme, ...RemainingConfig } = Config;
|
|
20
|
+
const InThemeKeys = InTheme?.labels?.keys;
|
|
21
|
+
const BaseThemeKeys = {
|
|
22
|
+
back: "←",
|
|
23
|
+
down: "↓",
|
|
24
|
+
forward: "→",
|
|
25
|
+
up: "↑"
|
|
26
|
+
};
|
|
27
|
+
const keys = InThemeKeys === undefined
|
|
28
|
+
? BaseThemeKeys
|
|
29
|
+
: { ...BaseThemeKeys, ...InThemeKeys };
|
|
30
|
+
/* eslint-disable-next-line @typescript-eslint/no-unused-vars */
|
|
31
|
+
const { keys: _Keys, ...RemainingInLabels } = InTheme?.labels || { labels: {} };
|
|
32
|
+
const theme = {
|
|
33
|
+
labels: {
|
|
34
|
+
keys,
|
|
35
|
+
...RemainingInLabels
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
const BaseConfig = {
|
|
39
|
+
keybinds: {
|
|
40
|
+
back: ["left"],
|
|
41
|
+
confirm: ["enter", "return"],
|
|
42
|
+
down: ["down"],
|
|
43
|
+
forward: ["right"],
|
|
44
|
+
up: ["up"]
|
|
45
|
+
},
|
|
46
|
+
loop: false,
|
|
47
|
+
multiple: false,
|
|
48
|
+
theme,
|
|
49
|
+
type: "directory"
|
|
50
|
+
};
|
|
51
|
+
const MergedConfig = {
|
|
52
|
+
...BaseConfig,
|
|
53
|
+
...RemainingConfig
|
|
54
|
+
};
|
|
55
|
+
return await fileSelector(MergedConfig);
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=FileSelector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileSelector.js","sourceRoot":"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AAM,YAAY,CAAC,YAAY,CAAC,CAAC;AAC5C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../Source/Inquirer/index.ts"],"names":[],"mappings":"AAMA,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/* File: index.ts
|
|
2
|
+
* Author: Gage Sorrell <gage@sorrell.sh>
|
|
3
|
+
* Copyright: (c) 2026 Gage Sorrell
|
|
4
|
+
* License: MIT
|
|
5
|
+
*/
|
|
6
|
+
export * from "./Confirm.js";
|
|
7
|
+
export * from "./Confirm.Types.js";
|
|
8
|
+
export * from "./FileSelector.js";
|
|
9
|
+
export * from "./FileSelector.Types.js";
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../Source/Inquirer/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { DefaultRenderer, ListrDefaultRenderer, ListrGetRendererClassFromValue, ListrTask, ListrTaskObject as ListrTaskObjectOriginal, ListrTaskResult, ListrTaskWrapper as ListrTaskWrapperOriginal } from "listr2";
|
|
2
|
+
export type ListrTaskWrapper<ContextType> = ListrTaskWrapperOriginal<ContextType, ListrDefaultRenderer, ListrDefaultRenderer>;
|
|
3
|
+
export type ListrConstructorTask<ContextType> = ListrTask<ContextType, ListrGetRendererClassFromValue<typeof DefaultRenderer>, ListrGetRendererClassFromValue<typeof DefaultRenderer>> | Array<ListrTask<ContextType, ListrGetRendererClassFromValue<typeof DefaultRenderer>, ListrGetRendererClassFromValue<typeof DefaultRenderer>>>;
|
|
4
|
+
export type TensedTitle = `${string}ing ${string}.`;
|
|
5
|
+
export type ListrTaskTensedCallback<ContextType> = {
|
|
6
|
+
(Result?: ListrTaskResult<ContextType>): ListrTaskTensedReturnType<ContextType>;
|
|
7
|
+
};
|
|
8
|
+
export type ListrTaskTensedCallbackExit<ContextType> = {
|
|
9
|
+
(Title: string, Result?: ListrTaskResult<ContextType>): ListrTaskTensedReturnType<ContextType>;
|
|
10
|
+
};
|
|
11
|
+
export type ListrTaskTensedReturnType<ContextType> = {
|
|
12
|
+
Result: ListrTaskResult<ContextType> | undefined;
|
|
13
|
+
Success: boolean;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* The callbacks provided to a task wrapped by {@link ListrTaskTensed:function} to
|
|
17
|
+
* describe the state of your task when it completes (returns).
|
|
18
|
+
*
|
|
19
|
+
* @property Exit - The callback that tells {@link ListrTaskTensed:function} that
|
|
20
|
+
* your task completed in a state other than a simple success or failure, and carries
|
|
21
|
+
* the result of your task (if one exists).
|
|
22
|
+
*
|
|
23
|
+
* @property Fail - The callback that tells {@link ListrTaskTensed:function} that
|
|
24
|
+
* your task failed, and carries the result of your task (if one exists).
|
|
25
|
+
*
|
|
26
|
+
* @property Succeed - The callback that tells {@link ListrTaskTensed:function} that
|
|
27
|
+
* your task succeeded, and carries the result of your task (if one exists).
|
|
28
|
+
*/
|
|
29
|
+
export type ListrTaskTensedCallbacks<ContextType> = {
|
|
30
|
+
Exit: ListrTaskTensedCallbackExit<ContextType>;
|
|
31
|
+
Fail: ListrTaskTensedCallback<ContextType>;
|
|
32
|
+
Succeed: ListrTaskTensedCallback<ContextType>;
|
|
33
|
+
};
|
|
34
|
+
export type ListrTaskTensedFunction<ContextType> = {
|
|
35
|
+
(Context: ContextType, Task: ListrTaskWrapper<ContextType>, Callbacks: ListrTaskTensedCallbacks<ContextType>): Promise<ListrTaskTensedReturnType<ContextType>>;
|
|
36
|
+
};
|
|
37
|
+
export type ListrTaskTensed<ContextType> = Omit<ListrTask<ContextType, ListrDefaultRenderer, ListrDefaultRenderer>, "task" | "title"> & {
|
|
38
|
+
task: ListrTaskTensedFunction<ContextType>;
|
|
39
|
+
title: TensedTitle;
|
|
40
|
+
};
|
|
41
|
+
export type ListrTaskObject<ContextType> = ListrTaskObjectOriginal<ContextType, typeof DefaultRenderer, typeof DefaultRenderer>;
|
|
42
|
+
//# sourceMappingURL=Listr.Types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Listr.Types.d.ts","sourceRoot":"","sources":["../../Source/Listr/Listr.Types.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACR,eAAe,EACf,oBAAoB,EACpB,8BAA8B,EAC9B,SAAS,EACT,eAAe,IAAI,uBAAuB,EAC1C,eAAe,EACf,gBAAgB,IAAI,wBAAwB,EAAE,MAAM,QAAQ,CAAC;AAEjE,MAAM,MAAM,gBAAgB,CAAC,WAAW,IAAI,wBAAwB,CAChE,WAAW,EACX,oBAAoB,EACpB,oBAAoB,CACvB,CAAC;AAEF,MAAM,MAAM,oBAAoB,CAAC,WAAW,IACtC,SAAS,CACP,WAAW,EACX,8BAA8B,CAAC,OAAO,eAAe,CAAC,EACtD,8BAA8B,CAAC,OAAO,eAAe,CAAC,CAAC,GACzD,KAAK,CAAC,SAAS,CACb,WAAW,EACX,8BAA8B,CAAC,OAAO,eAAe,CAAC,EACtD,8BAA8B,CAAC,OAAO,eAAe,CAAC,CAAC,CAC1D,CAAC;AAEN,MAAM,MAAM,WAAW,GAAG,GAAI,MAAO,OAAQ,MAAO,GAAG,CAAC;AAExD,MAAM,MAAM,uBAAuB,CAAC,WAAW,IAC3C;IACI,CAAC,MAAM,CAAC,EAAE,eAAe,CAAC,WAAW,CAAC,GAAG,yBAAyB,CAAC,WAAW,CAAC,CAAC;CACnF,CAAC;AAEN,MAAM,MAAM,2BAA2B,CAAC,WAAW,IAC/C;IACI,CAAC,K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|
|
|
1
|
+
import { type DefaultRenderer, type ListrBaseClassOptions, type ListrTask } from "listr2";
|
|
2
|
+
import type { ListrConstructorTask, ListrTaskObject, ListrTaskTensed } from "./Listr.Types.js";
|
|
3
|
+
/** A string-only {@link Error} used by {@link Listr} to show nicely-formatted errors. */
|
|
4
|
+
export declare class SimpleError extends Error {
|
|
5
|
+
constructor(Message: string);
|
|
6
|
+
TheMessage: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* A wrapper for `new Listr` that handles errors nicely.
|
|
10
|
+
*
|
|
11
|
+
* @deprecated A new function is being written.
|
|
12
|
+
*
|
|
13
|
+
* @typeParam ContextType - The type of the `listr2` context used by the {@link Task}.
|
|
14
|
+
*
|
|
15
|
+
* @param Task - The task(s) to run.
|
|
16
|
+
* @param GenericErrorMessage - The error message that is shown if the {@link Task | task(s)} throw(s)
|
|
17
|
+
* something other than a {@link SimpleError}.
|
|
18
|
+
* @param Options - *(Optional)* The {@link ListrBaseClassOptions} used to customize the
|
|
19
|
+
* {@link Task | task(s)}.
|
|
20
|
+
* @param ParentTask - *(Optional)* The {@link ListrTaskObject | parent task} of which the
|
|
21
|
+
* {@link Task | task(s)} are (a) descendant(s).
|
|
22
|
+
*/
|
|
23
|
+
export declare function RunListr<ContextType = unknown>(Task: ListrConstructorTask<ContextType>, GenericErrorMessage: string, Options?: ListrBaseClassOptions<ContextType, typeof DefaultRenderer, typeof DefaultRenderer>, ParentTask?: ListrTaskObject<unknown>): Promise<void>;
|
|
24
|
+
/**
|
|
25
|
+
* @TODO Write this comment.
|
|
26
|
+
*
|
|
27
|
+
* @typeParam ContextType -
|
|
28
|
+
* @param Task -
|
|
29
|
+
*/
|
|
30
|
+
export declare function NewListrTaskTensed<ContextType = unknown>(Task: ListrTaskTensed<ContextType>): ListrTask<ContextType>;
|
|
31
|
+
//# sourceMappingURL=Listr.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Listr.d.ts","sourceRoot":"","sources":["../../Source/Listr/Listr.ts"],"names":[],"mappings":"AAMA,OAAO,EACH,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,SAAS,EAEU,MAAM,QAAQ,CAAC;AAC3C,OAAO,KAAK,EACR,oBAAoB,EACpB,eAAe,EACf,eAAe,EAEG,MAAM,kBAAkB,CAAC;AAG/C,yFAAyF;AACzF,qBAAa,WAAY,SAAQ,KAAK;gBAEf,OAAO,EAAE,MAAM;IAM3B,UAAU,EAAE,MAAM,CAAC;CAC7B;AA0BD;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,QAAQ,CAAC,WAAW,GAAG,OAAO,EAChD,IAAI,EAAE,oBAAoB,CAAC,WAAW,CAAC,EACvC,mBAAmB,EAAE,MAAM,EAC3B,OAAO,CAAC,EAAE,qBAAqB,CAAC,WAAW,EAAE,OAAO,eAAe,EAAE,OAAO,eAAe,CAAC,EAC5F,UAAU,CAAC,EAAE,eAAe,CAAC,OAAO,CAAC,GACtC,OAAO,CAAC,IAAI,CAAC,CAkBf;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,GAAG,OAAO,EACpD,IAAI,EAAE,eAAe,CAAC,WAAW,CAAC,GACnC,SAAS,CAAC,WAAW,CAAC,CAAA"}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
/* File: Listr.ts
|
|
2
|
+
* Author: Gage Sorrell <gage@sorrell.sh>
|
|
3
|
+
* Copyright: (c) 2026 Gage Sorrell
|
|
4
|
+
* License: MIT
|
|
5
|
+
*/
|
|
6
|
+
import { Listr as OriginalListr } from "listr2";
|
|
7
|
+
import { Inflectors } from "en-inflectors";
|
|
8
|
+
/** A string-only {@link Error} used by {@link Listr} to show nicely-formatted errors. */
|
|
9
|
+
export class SimpleError extends Error {
|
|
10
|
+
constructor(Message) {
|
|
11
|
+
super();
|
|
12
|
+
this.TheMessage = Message;
|
|
13
|
+
}
|
|
14
|
+
TheMessage;
|
|
15
|
+
}
|
|
16
|
+
;
|
|
17
|
+
class Listr extends OriginalListr {
|
|
18
|
+
constructor(Task, Options, ParentTask) {
|
|
19
|
+
if (Options === undefined && ParentTask === undefined) {
|
|
20
|
+
super(Task);
|
|
21
|
+
}
|
|
22
|
+
else if (Options !== undefined && ParentTask === undefined) {
|
|
23
|
+
super(Task, Options);
|
|
24
|
+
}
|
|
25
|
+
else if (Options !== undefined && ParentTask !== undefined) {
|
|
26
|
+
super(Task, Options, ParentTask);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
;
|
|
31
|
+
/**
|
|
32
|
+
* A wrapper for `new Listr` that handles errors nicely.
|
|
33
|
+
*
|
|
34
|
+
* @deprecated A new function is being written.
|
|
35
|
+
*
|
|
36
|
+
* @typeParam ContextType - The type of the `listr2` context used by the {@link Task}.
|
|
37
|
+
*
|
|
38
|
+
* @param Task - The task(s) to run.
|
|
39
|
+
* @param GenericErrorMessage - The error message that is shown if the {@link Task | task(s)} throw(s)
|
|
40
|
+
* something other than a {@link SimpleError}.
|
|
41
|
+
* @param Options - *(Optional)* The {@link ListrBaseClassOptions} used to customize the
|
|
42
|
+
* {@link Task | task(s)}.
|
|
43
|
+
* @param ParentTask - *(Optional)* The {@link ListrTaskObject | parent task} of which the
|
|
44
|
+
* {@link Task | task(s)} are (a) descendant(s).
|
|
45
|
+
*/
|
|
46
|
+
export async function RunListr(Task, GenericErrorMessage, Options, ParentTask) {
|
|
47
|
+
try {
|
|
48
|
+
await new Listr(Task, Options, ParentTask);
|
|
49
|
+
}
|
|
50
|
+
catch (ListrError) {
|
|
51
|
+
if (ListrError instanceof SimpleError) {
|
|
52
|
+
console.error(`🚨 ${ListrError.TheMessage}`);
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
console.dir(ListrError);
|
|
56
|
+
console.error(`\n🚨 ${GenericErrorMessage}. The error is printed above.`);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
export function NewListrTaskTensed(InTask) {
|
|
61
|
+
/* eslint-disable-next-line jsdoc/require-jsdoc */
|
|
62
|
+
function GetResultTitle(Success) {
|
|
63
|
+
/** `{@link InTask.title}.split(" ").length > 0` is guaranteed by the {@link TensedTitle} type. */
|
|
64
|
+
const Words = InTask.title.split(" ");
|
|
65
|
+
const [TitlePresentParticiple, ...TitleTail] = Words;
|
|
66
|
+
if (TitlePresentParticiple === undefined) {
|
|
67
|
+
return "";
|
|
68
|
+
}
|
|
69
|
+
if (Success) {
|
|
70
|
+
const TitleVerb = new Inflectors(TitlePresentParticiple).toPast();
|
|
71
|
+
return [TitleVerb, TitleTail].join(" ");
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
const TitleVerb = new Inflectors(TitlePresentParticiple).toPresent();
|
|
75
|
+
const TitleVerbUncapitalized = TitleVerb[0]?.toLowerCase() + TitleVerb.slice(1);
|
|
76
|
+
return ["Failed to", TitleVerbUncapitalized, TitleTail].join(" ");
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
;
|
|
80
|
+
const TaskWrapper = (Context, Task) => {
|
|
81
|
+
/**
|
|
82
|
+
* Return a call to this function from your {@link InTask | Task} to tell
|
|
83
|
+
* {@link ListrTaskTensed:function} that your task *failed*. The `title` of the task
|
|
84
|
+
* returned by {@link ListrTaskTensed:function} will update to convey that your task failed.
|
|
85
|
+
*
|
|
86
|
+
* @param Result - The result of the function. Omit for your task to not return anything.
|
|
87
|
+
* This is returned by the task returned by {@link ListrTaskTensed:function}.
|
|
88
|
+
*
|
|
89
|
+
* @returns An object describing to {@link ListrTaskTensed:function} whether your task succeeded, and
|
|
90
|
+
* what the result of your task was.
|
|
91
|
+
*/
|
|
92
|
+
function Fail(Result) {
|
|
93
|
+
Task.title = GetResultTitle(false);
|
|
94
|
+
return {
|
|
95
|
+
Result,
|
|
96
|
+
Success: false
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Return a call to this function from your {@link InTask | Task} to tell
|
|
101
|
+
* {@link ListrTaskTensed:function} that your task *succeeded*. The `title` of the task
|
|
102
|
+
* returned by {@link ListrTaskTensed:function} will update to convey that your task succeeded.
|
|
103
|
+
*
|
|
104
|
+
* @param Result - The result of the function. Omit for your task to not return anything.
|
|
105
|
+
* This is returned by the task returned by {@link ListrTaskTensed:function}.
|
|
106
|
+
*
|
|
107
|
+
* @returns An object describing to {@link ListrTaskTensed:function} whether your task succeeded, and
|
|
108
|
+
* what the result of your task was.
|
|
109
|
+
*/
|
|
110
|
+
function Succeed(Result) {
|
|
111
|
+
Task.title = GetResultTitle(true);
|
|
112
|
+
return {
|
|
113
|
+
Result,
|
|
114
|
+
Success: true
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Return a call to this function from your {@link InTask | Task} to tell
|
|
119
|
+
* {@link ListrTaskTensed:function} that your task completed, but in a state that is not a simple
|
|
120
|
+
* success or failure. The `title` of the task returned by {@link ListrTaskTensed:function}
|
|
121
|
+
* will update to the given {@link ExitTitle}.
|
|
122
|
+
*
|
|
123
|
+
* @param ExitTitle - The title that the task returned by {@link ListrTaskTensed:function} will have
|
|
124
|
+
* upon this function being returned by your task. It should describe the nontrivial state of
|
|
125
|
+
* your task (that is—this function should be used iff your task did not complete in either of the
|
|
126
|
+
* expected success or failure).
|
|
127
|
+
*
|
|
128
|
+
* @param Result - The result of the function. Omit for your task to not return anything.
|
|
129
|
+
* This is returned by the task returned by {@link ListrTaskTensed:function}.
|
|
130
|
+
*
|
|
131
|
+
* @returns An object describing to {@link ListrTaskTensed:function} whether your task succeeded, and
|
|
132
|
+
* what the result of your task was.
|
|
133
|
+
*/
|
|
134
|
+
function Exit(ExitTitle, Result) {
|
|
135
|
+
Task.title = ExitTitle;
|
|
136
|
+
return {
|
|
137
|
+
Result,
|
|
138
|
+
Success: true
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
InTask.task(Context, Task, { Exit, Fail, Succeed });
|
|
142
|
+
};
|
|
143
|
+
return {
|
|
144
|
+
...InTask,
|
|
145
|
+
task: TaskWrapper
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
//# sourceMappingURL=Listr.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Listr.js","sourceRoot":"","sources":["../../Source/Listr/Listr.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAKH,KAAK,IAAI,aAAa,EAAE,MAAM,QAAQ,CAAC;AAO3C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,yFAAyF;AACzF,MAAM,OAAO,WAAY,SAAQ,KAAK;IAElC,YAAmB,OAAe;QAE9B,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC;IAC9B,CAAC;IAEM,UAAU,CAAS;CAC7B;AAAA,CAAC;AAEF,MAAM,KACF,SAAQ,aAA0E;IAElF,YACI,IAAuC,EACvC,OAA4F,EAC5F,UAAqC;QAGrC,IAAI,OAAO,KAAK,SAAS,IAAI,UAAU,KAAK,SAAS,EACrD,CAAC;YACG,KAAK,CAAC,IAAI,CAAC,CAAC;QAChB,CAAC;aACI,IAAI,OAAO,KAAK,SAAS,IAAI,UAAU,KAAK,SAAS,EAC1D,CAAC;YACG,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACzB,CAAC;aACI,IAAI,OAAO,KAAK,SAAS,IAAI,UAAU,KAAK,SAAS,EAC1D,CAAC;YACG,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;QACrC,CAAC;IACL,CAAC;CACJ;AAAA,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ,CAC1B,IAAuC,EACvC,mBAA2B,EAC3B,OAA4F,EAC5F,UAAqC;IAGrC,IACA,CAAC;QACG,MAAM,IAAI,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,UAAU,CAAC,CA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EACpB,IAAmC,EACA,EAAE;QAErC;;;;;;;;;;WAUG;QACH,SAAS,IAAI,CAAC,MAAqC;YAE/C,IAAI,CAAC,KAAK,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;YAEnC,OAAO;gBACH,MAAM;gBACN,OAAO,EAAE,KAAK;aACjB,CAAC;QACN,CAAC;QAED;;;;;;;;;;WAUG;QACH,SAAS,OAAO,CAAC,MAAqC;YAElD,IAAI,CAAC,KAAK,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC;YAElC,OAAO;gBACH,MAAM;gBACN,OAAO,EAAE,IAAI;aAChB,CAAC;QACN,CAAC;QAED;;;;;;;;;;;;;;;;WAgBG;QACH,SAAS,IAAI,CACT,SAAiB,EACjB,MAAqC;YAGrC,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC;YAEvB,OAAO;gBACH,MAAM;gBACN,OAAO,EAAE,IAAI;aAChB,CAAC;QACN,CAAC;QAED,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;IACxD,CAAC,CAAC;IAEF,OAAO;QACH,GAAG,MAAM;QACT,IAAI,EAAE,WAAW;KACpB,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../Source/Listr/index.ts"],"names":[],"mappings":"AAMA,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../Source/Listr/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type ora from "ora";
|
|
2
|
+
/** The options object of {@link Ora}. */
|
|
3
|
+
export type FOraOptions = Extract<Parameters<typeof ora>[0], object>;
|
|
4
|
+
/**
|
|
5
|
+
* The `async` function or `Promise` passed to {@link Ora}.
|
|
6
|
+
*
|
|
7
|
+
* @typeParam Type - The type of the value returned by the task.
|
|
8
|
+
*/
|
|
9
|
+
export type TOraTaskArgument<Type> = (() => Promise<Type>) | Promise<Type> | ((SetPersistText: ((In: string) => void)) => Promise<Type>);
|
|
10
|
+
//# sourceMappingURL=Ora.Types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Ora.Types.d.ts","sourceRoot":"","sources":["../../Source/Ora/Ora.Types.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAE3B,yCAAyC;AACzC,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;AAErE;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,CAAC,IAAI,IAC3B,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,GACrB,OAAO,CAAC,IAAI,CAAC,GACb,CAAC,CAAC,cAAc,EAAE,CAAC,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Ora.Types.js","sourceRoot":"","sources":["../../Source/Ora/Ora.Types.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { FOraOptions, TOraTaskArgument } from "./Ora.Types.js";
|
|
2
|
+
import { type TTryResult } from "@sorrell/utilities/async";
|
|
3
|
+
import { type Ora as IOra } from "ora";
|
|
4
|
+
/**
|
|
5
|
+
* Creates and starts an `Ora` instance with the given {@link Argument}.
|
|
6
|
+
*
|
|
7
|
+
* @param Argument - The options object.
|
|
8
|
+
*
|
|
9
|
+
* @returns An `Ora` instance with the specified options.
|
|
10
|
+
*/
|
|
11
|
+
export declare function Ora(Argument: FOraOptions): IOra;
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated Use {@link DoTask} instead.
|
|
14
|
+
*
|
|
15
|
+
* Executes an `async` function or `Promise` with a progress indicator.
|
|
16
|
+
*
|
|
17
|
+
* @typeParam Type - The type of the data to which the given {@link AsyncSource} resolves.
|
|
18
|
+
*
|
|
19
|
+
* @param AsyncSource - The `async` function or `Promise` whose state is conveyed
|
|
20
|
+
* by the returned instance of `Ora`.
|
|
21
|
+
* @param TaskDescription - The text to display in the `Ora` instance while the
|
|
22
|
+
* {@link AsyncSource} is pending.
|
|
23
|
+
*
|
|
24
|
+
* @returns The result of the {@link AsyncSource}, as a {@link TTryResult}.
|
|
25
|
+
*/
|
|
26
|
+
export declare function OraTask<Type>(AsyncSource: TOraTaskArgument<Type>, TaskDescription: string): Promise<TTryResult<Type>>;
|
|
27
|
+
//# sourceMappingURL=Ora.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Ora.d.ts","sourceRoot":"","sources":["../../Source/Ora/Ora.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAE,KAAK,UAAU,EAAoC,MAAM,0BAA0B,CAAC;AAC7F,OAAY,EAAE,KAAK,GAAG,IAAI,IAAI,EAAE,MAAM,KAAK,CAAC;AAE5C;;;;;;GAMG;AACH,wBAAgB,GAAG,CAAC,QAAQ,EAAE,WAAW,GAAG,IAAI,CAoB/C;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,OAAO,CAAC,IAAI,EAC9B,WAAW,EAAE,gBAAgB,CAAC,IAAI,CAAC,EACnC,eAAe,EAAE,MAAM,GACxB,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CA2C3B"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/* File: Ora.ts
|
|
2
|
+
* Author: Gage Sorrell <gage@sorrell.sh>
|
|
3
|
+
* Copyright: (c) 2026 Gage Sorrell
|
|
4
|
+
* License: MIT
|
|
5
|
+
*/
|
|
6
|
+
import { Try as TryAsync } from "@sorrell/utilities/async";
|
|
7
|
+
import ora from "ora";
|
|
8
|
+
/**
|
|
9
|
+
* Creates and starts an `Ora` instance with the given {@link Argument}.
|
|
10
|
+
*
|
|
11
|
+
* @param Argument - The options object.
|
|
12
|
+
*
|
|
13
|
+
* @returns An `Ora` instance with the specified options.
|
|
14
|
+
*/
|
|
15
|
+
export function Ora(Argument) {
|
|
16
|
+
const DefaultOptions = {
|
|
17
|
+
hideCursor: true
|
|
18
|
+
};
|
|
19
|
+
const EnforcedOptions = {
|
|
20
|
+
spinner: "point"
|
|
21
|
+
};
|
|
22
|
+
const Options = {
|
|
23
|
+
...DefaultOptions,
|
|
24
|
+
...Argument,
|
|
25
|
+
...EnforcedOptions
|
|
26
|
+
};
|
|
27
|
+
return ora(Options).start();
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* @deprecated Use {@link DoTask} instead.
|
|
31
|
+
*
|
|
32
|
+
* Executes an `async` function or `Promise` with a progress indicator.
|
|
33
|
+
*
|
|
34
|
+
* @typeParam Type - The type of the data to which the given {@link AsyncSource} resolves.
|
|
35
|
+
*
|
|
36
|
+
* @param AsyncSource - The `async` function or `Promise` whose state is conveyed
|
|
37
|
+
* by the returned instance of `Ora`.
|
|
38
|
+
* @param TaskDescription - The text to display in the `Ora` instance while the
|
|
39
|
+
* {@link AsyncSource} is pending.
|
|
40
|
+
*
|
|
41
|
+
* @returns The result of the {@link AsyncSource}, as a {@link TTryResult}.
|
|
42
|
+
*/
|
|
43
|
+
export async function OraTask(AsyncSource, TaskDescription) {
|
|
44
|
+
const ThisOra = Ora({ text: TaskDescription });
|
|
45
|
+
let PersistText = undefined;
|
|
46
|
+
const SetPersistText = (In) => {
|
|
47
|
+
PersistText = In;
|
|
48
|
+
};
|
|
49
|
+
const OutAsyncSource = typeof AsyncSource === "function"
|
|
50
|
+
? (AsyncSource.length > 0)
|
|
51
|
+
? () => AsyncSource(SetPersistText)
|
|
52
|
+
: AsyncSource
|
|
53
|
+
: AsyncSource;
|
|
54
|
+
const Result = await TryAsync(OutAsyncSource);
|
|
55
|
+
if (Result.Error === undefined) {
|
|
56
|
+
if (PersistText !== undefined) {
|
|
57
|
+
ThisOra.succeed(PersistText);
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
ThisOra.succeed();
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
if (PersistText !== undefined) {
|
|
65
|
+
ThisOra.fail(PersistText);
|
|
66
|
+
console.error(Result.Error);
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
ThisOra.fail();
|
|
70
|
+
console.error(Result.Error);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return Result;
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=Ora.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Ora.js","sourceRoot":"","sources":["../../Source/Ora/Ora.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAoC,GAAG,IAAI,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAC7F,OAAO,GAAyB,MAAM,KAAK,CAAC;AAE5C;;;;;;GAMG;AACH,MAAM,UAAU,GAAG,CAAC,QAAqB;IAErC,MAAM,cAAc,GAChB;QACI,UAAU,EAAE,IAAI;KACnB,CAAC;IAEN,MAAM,eAAe,GACjB;QACI,OAAO,EAAE,OAAO;KACnB,CAAC;IAEN,MAAM,OAAO,GACT;QACI,GAAG,cAAc;QACjB,GAAG,QAAQ;QACX,GAAG,eAAe;KACrB,CAAC;IAEN,OAAO,GAAG,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,CAAC;AAChC,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,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U,CAAC;AACzB,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../Source/Ora/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PseudoTerminal.Types.d.ts","sourceRoot":"","sources":["../../Source/PseudoTerminal/PseudoTerminal.Types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PseudoTerminal.Types.js","sourceRoot":"","sources":["../../Source/PseudoTerminal/PseudoTerminal.Types.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PseudoTerminal.d.ts","sourceRoot":"","sources":["../../Source/PseudoTerminal/PseudoTerminal.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,GAAG,EAAE,KAAsB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/* File: PseudoTerminal.ts
|
|
2
|
+
* Author: Gage Sorrell <gage@sorrell.sh>
|
|
3
|
+
* Copyright: (c) 2026 Gage Sorrell
|
|
4
|
+
* License: MIT
|
|
5
|
+
*/
|
|
6
|
+
export const Foo = "Foo";
|
|
7
|
+
// export function Spawn(Command: TMaybeArray<string>, ): Promise<>
|
|
8
|
+
// {
|
|
9
|
+
// }
|
|
10
|
+
//# sourceMappingURL=PseudoTerminal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PseudoTerminal.js","sourceRoot":"","sources":["../../Source/PseudoTerminal/PseudoTerminal.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,CAAC,MAAM,GAAG,GAAU,KAAc,CAAC;AACzC,mEAAmE;AACnE,IAAI;AAEJ,IAAI"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../Source/PseudoTerminal/index.ts"],"names":[],"mappings":"AAMA,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../Source/PseudoTerminal/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC"}
|
package/Distribution/index.d.ts
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
export * from "./Confirm.js";
|
|
2
|
-
export * from "./
|
|
3
|
-
export * from "./
|
|
4
|
-
export * from "./
|
|
5
|
-
export * from "./
|
|
6
|
-
export * from "./FileSelector.Types.js";
|
|
7
|
-
export * from "./Print/index.js";
|
|
8
|
-
export * from "./Ora.js";
|
|
9
|
-
export * from "./Ora.Types.js";
|
|
1
|
+
export * from "./Inquirer/Confirm.js";
|
|
2
|
+
export * as Listr from "./Listr/index.js";
|
|
3
|
+
export * as Inquirer from "./Inquirer/index.js";
|
|
4
|
+
export * as Format from "./Format/index.js";
|
|
5
|
+
export * as Ora from "./Ora/index.js";
|
|
10
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../Source/index.ts"],"names":[],"mappings":"AAMA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../Source/index.ts"],"names":[],"mappings":"AAMA,cAAc,uBAAuB,CAAC;AACtC,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAC;AAC1C,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAC;AAChD,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAC5C,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAC"}
|
package/Distribution/index.js
CHANGED
|
@@ -3,13 +3,9 @@
|
|
|
3
3
|
* Copyright: (c) 2026 Gage Sorrell
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
6
|
-
export * from "./Confirm.js";
|
|
7
|
-
export * from "./
|
|
8
|
-
export * from "./
|
|
9
|
-
export * from "./
|
|
10
|
-
export * from "./
|
|
11
|
-
export * from "./FileSelector.Types.js";
|
|
12
|
-
export * from "./Print/index.js";
|
|
13
|
-
export * from "./Ora.js";
|
|
14
|
-
export * from "./Ora.Types.js";
|
|
6
|
+
export * from "./Inquirer/Confirm.js";
|
|
7
|
+
export * as Listr from "./Listr/index.js";
|
|
8
|
+
export * as Inquirer from "./Inquirer/index.js";
|
|
9
|
+
export * as Format from "./Format/index.js";
|
|
10
|
+
export * as Ora from "./Ora/index.js";
|
|
15
11
|
//# sourceMappingURL=index.js.map
|