@reliverse/rempts 1.6.2 → 1.7.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/LICENSE +1 -1
- package/README.md +311 -77
- package/bin/{core-impl → components}/anykey/anykey-mod.d.ts +1 -1
- package/bin/{core-impl → components}/anykey/anykey-mod.js +1 -1
- package/bin/{core-impl → components}/date/date.d.ts +1 -1
- package/bin/{core-impl → components}/editor/editor-mod.d.ts +1 -1
- package/bin/{core-impl → components}/editor/editor-mod.js +7 -7
- package/bin/{core-impl → components}/input/confirm-prompt.d.ts +1 -1
- package/bin/{core-impl → components}/input/confirm-prompt.js +1 -1
- package/bin/{core-impl → components}/input/input-prompt.d.ts +1 -1
- package/bin/{core-impl → components}/input/input-prompt.js +3 -7
- package/bin/{core-impl → components}/launcher/deprecated/_parser.ts.txt +1 -1
- package/bin/{core-impl → components}/launcher/deprecated/_utils.ts.txt +1 -1
- package/bin/{core-impl → components}/launcher/deprecated/args.ts.txt +1 -1
- package/bin/{core-impl → components}/launcher/deprecated/command.ts.txt +1 -1
- package/bin/{core-impl → components}/launcher/deprecated/launcher-mod.ts.txt +1 -1
- package/bin/{core-impl → components}/launcher/deprecated/usage.ts.txt +1 -1
- package/bin/components/launcher/launcher-mod.d.ts +177 -0
- package/bin/components/launcher/launcher-mod.js +626 -0
- package/bin/{core-impl → components}/msg-fmt/colors.d.ts +1 -1
- package/bin/{core-impl → components}/msg-fmt/logger.d.ts +1 -1
- package/bin/{core-impl → components}/msg-fmt/logger.js +1 -4
- package/bin/{core-impl → components}/msg-fmt/mapping.d.ts +1 -1
- package/bin/{core-impl → components}/msg-fmt/messages.d.ts +1 -1
- package/bin/{core-impl → components}/msg-fmt/variants.d.ts +1 -1
- package/bin/{core-impl → components}/next-steps/next-steps.d.ts +2 -2
- package/bin/{core-impl → components}/number/number-mod.d.ts +1 -1
- package/bin/{core-impl → components}/select/multiselect-prompt.d.ts +1 -1
- package/bin/{core-impl → components}/select/multiselect-prompt.js +1 -1
- package/bin/{core-impl → components}/select/nummultiselect-prompt.d.ts +1 -1
- package/bin/{core-impl → components}/select/numselect-prompt.d.ts +1 -1
- package/bin/{core-impl → components}/select/numselect-prompt.js +1 -1
- package/bin/{core-impl → components}/select/select-prompt.d.ts +1 -1
- package/bin/{core-impl → components}/select/select-prompt.js +2 -2
- package/bin/{core-impl → components}/select/toggle-prompt.d.ts +1 -1
- package/bin/{core-impl → components}/select/toggle-prompt.js +1 -1
- package/bin/{core-impl → components}/st-end/end.d.ts +1 -1
- package/bin/{core-impl → components}/st-end/start.d.ts +1 -1
- package/bin/{core-impl → components}/st-end/start.js +2 -2
- package/bin/{core-impl → components}/task/progress.d.ts +1 -1
- package/bin/{core-impl → components}/visual/animate/animate.d.ts +1 -1
- package/bin/hooks/spinner/spinner-mod.d.ts +20 -0
- package/bin/hooks/spinner/spinner-mod.js +26 -0
- package/bin/mod.d.ts +37 -0
- package/bin/mod.js +88 -0
- package/bin/{core-impl/utils → utils}/colorize.d.ts +1 -1
- package/bin/{core-impl/utils → utils}/prevent.d.ts +1 -1
- package/bin/{core-impl/utils → utils}/prevent.js +2 -2
- package/bin/{core-impl/utils → utils}/prompt-end.d.ts +1 -1
- package/bin/{core-impl/utils → utils}/prompt-end.js +2 -2
- package/bin/{core-impl/utils → utils}/stream-text.d.ts +1 -1
- package/bin/{core-impl/utils → utils}/stream-text.js +2 -2
- package/package.json +46 -24
- package/bin/core-impl/figures/figures.test.d.ts +0 -1
- package/bin/core-impl/figures/figures.test.js +0 -474
- package/bin/core-impl/launcher/launcher-mod.d.ts +0 -92
- package/bin/core-impl/launcher/launcher-mod.js +0 -371
- package/bin/main.d.ts +0 -36
- package/bin/main.js +0 -86
- /package/bin/{core-impl → components}/date/date.js +0 -0
- /package/bin/{core-impl → components}/figures/figures-mod.d.ts +0 -0
- /package/bin/{core-impl → components}/figures/figures-mod.js +0 -0
- /package/bin/{core-impl → components}/msg-fmt/colors.js +0 -0
- /package/bin/{core-impl → components}/msg-fmt/mapping.js +0 -0
- /package/bin/{core-impl → components}/msg-fmt/messages.js +0 -0
- /package/bin/{core-impl → components}/msg-fmt/terminal.d.ts +0 -0
- /package/bin/{core-impl → components}/msg-fmt/terminal.js +0 -0
- /package/bin/{core-impl → components}/msg-fmt/variants.js +0 -0
- /package/bin/{core-impl → components}/next-steps/next-steps.js +0 -0
- /package/bin/{core-impl → components}/number/number-mod.js +0 -0
- /package/bin/{core-impl → components}/results/results.d.ts +0 -0
- /package/bin/{core-impl → components}/results/results.js +0 -0
- /package/bin/{core-impl → components}/select/nummultiselect-prompt.js +0 -0
- /package/bin/{core-impl → components}/st-end/end.js +0 -0
- /package/bin/{core-impl → components}/task/progress.js +0 -0
- /package/bin/{core-impl → components}/task/spinner.d.ts +0 -0
- /package/bin/{core-impl → components}/task/spinner.js +0 -0
- /package/bin/{core-impl → components}/visual/animate/animate.js +0 -0
- /package/bin/{core-impl → components}/visual/ascii-art/ascii-art.d.ts +0 -0
- /package/bin/{core-impl → components}/visual/ascii-art/ascii-art.js +0 -0
- /package/bin/{core-types.d.ts → types.d.ts} +0 -0
- /package/bin/{core-types.js → types.js} +0 -0
- /package/bin/{core-impl/utils → utils}/colorize.js +0 -0
- /package/bin/{core-impl/utils → utils}/errors.d.ts +0 -0
- /package/bin/{core-impl/utils → utils}/errors.js +0 -0
- /package/bin/{core-impl/utils → utils}/system.d.ts +0 -0
- /package/bin/{core-impl/utils → utils}/system.js +0 -0
- /package/bin/{core-impl/utils → utils}/validate.d.ts +0 -0
- /package/bin/{core-impl/utils → utils}/validate.js +0 -0
|
@@ -4,7 +4,7 @@ import { stdin as input, stdout as output } from "node:process";
|
|
|
4
4
|
import readline from "node:readline";
|
|
5
5
|
import { msg, symbols } from "../msg-fmt/messages.js";
|
|
6
6
|
import { deleteLastLine } from "../msg-fmt/terminal.js";
|
|
7
|
-
import { completePrompt } from "
|
|
7
|
+
import { completePrompt } from "../../utils/prompt-end.js";
|
|
8
8
|
function isSelectOption(option) {
|
|
9
9
|
return !("separator" in option);
|
|
10
10
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BorderColorName, ColorName, SelectOption, TypographyName, VariantName } from "../../
|
|
1
|
+
import type { BorderColorName, ColorName, SelectOption, TypographyName, VariantName } from "../../types.js";
|
|
2
2
|
import { symbols } from "../msg-fmt/messages.js";
|
|
3
3
|
type SeparatorOption = {
|
|
4
4
|
separator: true;
|
|
@@ -4,8 +4,8 @@ import { stdin as input, stdout as output } from "node:process";
|
|
|
4
4
|
import readline from "node:readline";
|
|
5
5
|
import { msg, symbols } from "../msg-fmt/messages.js";
|
|
6
6
|
import { deleteLastLine } from "../msg-fmt/terminal.js";
|
|
7
|
-
import { completePrompt } from "
|
|
8
|
-
import { streamText } from "
|
|
7
|
+
import { completePrompt } from "../../utils/prompt-end.js";
|
|
8
|
+
import { streamText } from "../../utils/stream-text.js";
|
|
9
9
|
function isSelectOption(option) {
|
|
10
10
|
return !("separator" in option);
|
|
11
11
|
}
|
|
@@ -4,7 +4,7 @@ import { stdin as input, stdout as output } from "node:process";
|
|
|
4
4
|
import readline from "node:readline";
|
|
5
5
|
import { msg } from "../msg-fmt/messages.js";
|
|
6
6
|
import { deleteLastLine } from "../msg-fmt/terminal.js";
|
|
7
|
-
import { completePrompt } from "
|
|
7
|
+
import { completePrompt } from "../../utils/prompt-end.js";
|
|
8
8
|
function renderTogglePrompt(params) {
|
|
9
9
|
const {
|
|
10
10
|
title,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { PromptOptions } from "../../
|
|
1
|
+
import type { PromptOptions } from "../../types.js";
|
|
2
2
|
export declare function endPrompt({ title, titleColor, titleTypography, titleVariant, titleAnimation, titleAnimationDelay, border, borderColor, horizontalLineLength, }: PromptOptions): Promise<void>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PreventWrongTerminalSizeOptions, PromptOptions } from "../../
|
|
1
|
+
import type { PreventWrongTerminalSizeOptions, PromptOptions } from "../../types.js";
|
|
2
2
|
type StartPromptOptions = PromptOptions & {
|
|
3
3
|
clearConsole?: boolean;
|
|
4
4
|
horizontalLine?: boolean;
|
|
@@ -10,8 +10,8 @@ import {
|
|
|
10
10
|
preventWrongTerminalSize,
|
|
11
11
|
preventWindowsHomeDirRoot,
|
|
12
12
|
preventUnsupportedTTY
|
|
13
|
-
} from "
|
|
14
|
-
import { pm, reliversePrompts } from "
|
|
13
|
+
} from "../../utils/prevent.js";
|
|
14
|
+
import { pm, reliversePrompts } from "../../utils/system.js";
|
|
15
15
|
export async function startPrompt({
|
|
16
16
|
title = "",
|
|
17
17
|
titleColor = "inverse",
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ProgressBar, ProgressBarOptions } from "../../
|
|
1
|
+
import type { ProgressBar, ProgressBarOptions } from "../../types.js";
|
|
2
2
|
export declare function progressTaskPrompt(options: ProgressBarOptions): Promise<ProgressBar>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Animation, type AnimationName } from "@figliolia/chalk-animation";
|
|
2
|
-
import type { BorderColorName, ColorName, MsgType, TypographyName } from "../../../
|
|
2
|
+
import type { BorderColorName, ColorName, MsgType, TypographyName } from "../../../types.js";
|
|
3
3
|
export declare const animationMap: Record<AnimationName, (text: string) => Animation>;
|
|
4
4
|
export declare function animateText({ title, anim, delay, type, titleColor, titleTypography, border, borderColor, horizontalLineLength, }: {
|
|
5
5
|
title: string;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
type SpinnerOptions = {
|
|
2
|
+
text: string;
|
|
3
|
+
};
|
|
4
|
+
type SpinnerControls = {
|
|
5
|
+
start: () => SpinnerControls;
|
|
6
|
+
stop: () => void;
|
|
7
|
+
setText: (text: string) => void;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Creates a terminal spinner.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* \`\`\`typescript
|
|
14
|
+
* const spinner = useSpinner({ text: "preparing something..." }).start();
|
|
15
|
+
* // user's code
|
|
16
|
+
* spinner.stop();
|
|
17
|
+
* \`\`\`
|
|
18
|
+
*/
|
|
19
|
+
export declare function useSpinner(options: SpinnerOptions): SpinnerControls;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import ora from "ora";
|
|
2
|
+
export function useSpinner(options) {
|
|
3
|
+
let spinnerInstance = null;
|
|
4
|
+
const controls = {
|
|
5
|
+
start: () => {
|
|
6
|
+
if (!spinnerInstance) {
|
|
7
|
+
spinnerInstance = ora(options.text);
|
|
8
|
+
}
|
|
9
|
+
spinnerInstance.start();
|
|
10
|
+
return controls;
|
|
11
|
+
},
|
|
12
|
+
stop: () => {
|
|
13
|
+
if (spinnerInstance) {
|
|
14
|
+
spinnerInstance.stop();
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
setText: (text) => {
|
|
18
|
+
if (spinnerInstance) {
|
|
19
|
+
spinnerInstance.text = text;
|
|
20
|
+
} else {
|
|
21
|
+
options.text = text;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
return controls;
|
|
26
|
+
}
|
package/bin/mod.d.ts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export { anykeyPrompt } from "./components/anykey/anykey-mod.js";
|
|
2
|
+
export { datePrompt } from "./components/date/date.js";
|
|
3
|
+
export { startEditor } from "./components/editor/editor-mod.js";
|
|
4
|
+
export { mainSymbols, fallbackSymbols, } from "./components/figures/figures-mod.js";
|
|
5
|
+
export { confirmPrompt } from "./components/input/confirm-prompt.js";
|
|
6
|
+
export { inputPrompt } from "./components/input/input-prompt.js";
|
|
7
|
+
export type { ArgDefinition, ArgDefinitions, SubCommandsMap, Command, InferArgTypes, FileBasedCmdsOptions, } from "./components/launcher/launcher-mod.js";
|
|
8
|
+
export { defineCommand, defineArgs, showUsage, runMain, } from "./components/launcher/launcher-mod.js";
|
|
9
|
+
export { toBaseColor, toSolidColor } from "./components/msg-fmt/colors.js";
|
|
10
|
+
export { relinkaByRemptsDeprecated, relinkaAsyncByRemptsDeprecated, throwError, } from "./components/msg-fmt/logger.js";
|
|
11
|
+
export { colorMap, typographyMap } from "./components/msg-fmt/mapping.js";
|
|
12
|
+
export { symbols, bar, fmt, msg, msgUndo, msgUndoAll, printLineBar, } from "./components/msg-fmt/messages.js";
|
|
13
|
+
export { getTerminalHeight, getExactTerminalWidth, getTerminalWidth, breakLines, removeCursor, restoreCursor, deleteLastLine, deleteLastLines, countLines, } from "./components/msg-fmt/terminal.js";
|
|
14
|
+
export { variantMap, isValidVariant, applyVariant, } from "./components/msg-fmt/variants.js";
|
|
15
|
+
export { nextStepsPrompt } from "./components/next-steps/next-steps.js";
|
|
16
|
+
export { numberPrompt } from "./components/number/number-mod.js";
|
|
17
|
+
export type { ResultsType } from "./components/results/results.js";
|
|
18
|
+
export { resultPrompt } from "./components/results/results.js";
|
|
19
|
+
export { multiselectPrompt } from "./components/select/multiselect-prompt.js";
|
|
20
|
+
export { numMultiSelectPrompt } from "./components/select/nummultiselect-prompt.js";
|
|
21
|
+
export { numSelectPrompt } from "./components/select/numselect-prompt.js";
|
|
22
|
+
export { selectPrompt } from "./components/select/select-prompt.js";
|
|
23
|
+
export { togglePrompt } from "./components/select/toggle-prompt.js";
|
|
24
|
+
export { endPrompt } from "./components/st-end/end.js";
|
|
25
|
+
export { startPrompt } from "./components/st-end/start.js";
|
|
26
|
+
export { progressTaskPrompt } from "./components/task/progress.js";
|
|
27
|
+
export { spinnerTaskPrompt } from "./components/task/spinner.js";
|
|
28
|
+
export { colorize } from "./utils/colorize.js";
|
|
29
|
+
export { errorHandler } from "./utils/errors.js";
|
|
30
|
+
export { preventUnsupportedTTY, preventWindowsHomeDirRoot, preventWrongTerminalSize, } from "./utils/prevent.js";
|
|
31
|
+
export { completePrompt, renderEndLine, renderEndLineInput, } from "./utils/prompt-end.js";
|
|
32
|
+
export { streamText, streamTextBox, streamTextWithSpinner, } from "./utils/stream-text.js";
|
|
33
|
+
export { pm, reliversePrompts } from "./utils/system.js";
|
|
34
|
+
export { isTerminalInteractive, isValidName, normalizeName, } from "./utils/validate.js";
|
|
35
|
+
export { animationMap, animateText, } from "./components/visual/animate/animate.js";
|
|
36
|
+
export { createAsciiArt } from "./components/visual/ascii-art/ascii-art.js";
|
|
37
|
+
export { useSpinner } from "./hooks/spinner/spinner-mod.js";
|
package/bin/mod.js
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
export { anykeyPrompt } from "./components/anykey/anykey-mod.js";
|
|
2
|
+
export { datePrompt } from "./components/date/date.js";
|
|
3
|
+
export { startEditor } from "./components/editor/editor-mod.js";
|
|
4
|
+
export {
|
|
5
|
+
mainSymbols,
|
|
6
|
+
fallbackSymbols
|
|
7
|
+
} from "./components/figures/figures-mod.js";
|
|
8
|
+
export { confirmPrompt } from "./components/input/confirm-prompt.js";
|
|
9
|
+
export { inputPrompt } from "./components/input/input-prompt.js";
|
|
10
|
+
export {
|
|
11
|
+
defineCommand,
|
|
12
|
+
defineArgs,
|
|
13
|
+
showUsage,
|
|
14
|
+
runMain
|
|
15
|
+
} from "./components/launcher/launcher-mod.js";
|
|
16
|
+
export { toBaseColor, toSolidColor } from "./components/msg-fmt/colors.js";
|
|
17
|
+
export {
|
|
18
|
+
relinkaByRemptsDeprecated,
|
|
19
|
+
relinkaAsyncByRemptsDeprecated,
|
|
20
|
+
throwError
|
|
21
|
+
} from "./components/msg-fmt/logger.js";
|
|
22
|
+
export { colorMap, typographyMap } from "./components/msg-fmt/mapping.js";
|
|
23
|
+
export {
|
|
24
|
+
symbols,
|
|
25
|
+
bar,
|
|
26
|
+
fmt,
|
|
27
|
+
msg,
|
|
28
|
+
msgUndo,
|
|
29
|
+
msgUndoAll,
|
|
30
|
+
printLineBar
|
|
31
|
+
} from "./components/msg-fmt/messages.js";
|
|
32
|
+
export {
|
|
33
|
+
getTerminalHeight,
|
|
34
|
+
getExactTerminalWidth,
|
|
35
|
+
getTerminalWidth,
|
|
36
|
+
breakLines,
|
|
37
|
+
removeCursor,
|
|
38
|
+
restoreCursor,
|
|
39
|
+
deleteLastLine,
|
|
40
|
+
deleteLastLines,
|
|
41
|
+
countLines
|
|
42
|
+
} from "./components/msg-fmt/terminal.js";
|
|
43
|
+
export {
|
|
44
|
+
variantMap,
|
|
45
|
+
isValidVariant,
|
|
46
|
+
applyVariant
|
|
47
|
+
} from "./components/msg-fmt/variants.js";
|
|
48
|
+
export { nextStepsPrompt } from "./components/next-steps/next-steps.js";
|
|
49
|
+
export { numberPrompt } from "./components/number/number-mod.js";
|
|
50
|
+
export { resultPrompt } from "./components/results/results.js";
|
|
51
|
+
export { multiselectPrompt } from "./components/select/multiselect-prompt.js";
|
|
52
|
+
export { numMultiSelectPrompt } from "./components/select/nummultiselect-prompt.js";
|
|
53
|
+
export { numSelectPrompt } from "./components/select/numselect-prompt.js";
|
|
54
|
+
export { selectPrompt } from "./components/select/select-prompt.js";
|
|
55
|
+
export { togglePrompt } from "./components/select/toggle-prompt.js";
|
|
56
|
+
export { endPrompt } from "./components/st-end/end.js";
|
|
57
|
+
export { startPrompt } from "./components/st-end/start.js";
|
|
58
|
+
export { progressTaskPrompt } from "./components/task/progress.js";
|
|
59
|
+
export { spinnerTaskPrompt } from "./components/task/spinner.js";
|
|
60
|
+
export { colorize } from "./utils/colorize.js";
|
|
61
|
+
export { errorHandler } from "./utils/errors.js";
|
|
62
|
+
export {
|
|
63
|
+
preventUnsupportedTTY,
|
|
64
|
+
preventWindowsHomeDirRoot,
|
|
65
|
+
preventWrongTerminalSize
|
|
66
|
+
} from "./utils/prevent.js";
|
|
67
|
+
export {
|
|
68
|
+
completePrompt,
|
|
69
|
+
renderEndLine,
|
|
70
|
+
renderEndLineInput
|
|
71
|
+
} from "./utils/prompt-end.js";
|
|
72
|
+
export {
|
|
73
|
+
streamText,
|
|
74
|
+
streamTextBox,
|
|
75
|
+
streamTextWithSpinner
|
|
76
|
+
} from "./utils/stream-text.js";
|
|
77
|
+
export { pm, reliversePrompts } from "./utils/system.js";
|
|
78
|
+
export {
|
|
79
|
+
isTerminalInteractive,
|
|
80
|
+
isValidName,
|
|
81
|
+
normalizeName
|
|
82
|
+
} from "./utils/validate.js";
|
|
83
|
+
export {
|
|
84
|
+
animationMap,
|
|
85
|
+
animateText
|
|
86
|
+
} from "./components/visual/animate/animate.js";
|
|
87
|
+
export { createAsciiArt } from "./components/visual/ascii-art/ascii-art.js";
|
|
88
|
+
export { useSpinner } from "./hooks/spinner/spinner-mod.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ColorName, TypographyName } from "
|
|
1
|
+
import type { ColorName, TypographyName } from "../types.js";
|
|
2
2
|
export declare function colorize(text: string, colorName?: ColorName, typography?: TypographyName): string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PreventWrongTerminalSizeOptions } from "
|
|
1
|
+
import type { PreventWrongTerminalSizeOptions } from "../types.js";
|
|
2
2
|
export declare function preventUnsupportedTTY(): void;
|
|
3
3
|
/**
|
|
4
4
|
* Prevents EISDIR errors when trying to read Windows home directory as a file
|
|
@@ -2,11 +2,11 @@ import { re } from "@reliverse/relico";
|
|
|
2
2
|
import { relinka } from "@reliverse/relinka";
|
|
3
3
|
import { homedir } from "node:os";
|
|
4
4
|
import terminalSize from "terminal-size";
|
|
5
|
-
import { msg } from "../msg-fmt/messages.js";
|
|
5
|
+
import { msg } from "../components/msg-fmt/messages.js";
|
|
6
6
|
import {
|
|
7
7
|
getExactTerminalWidth,
|
|
8
8
|
getTerminalWidth
|
|
9
|
-
} from "../msg-fmt/terminal.js";
|
|
9
|
+
} from "../components/msg-fmt/terminal.js";
|
|
10
10
|
export function preventUnsupportedTTY() {
|
|
11
11
|
if (!process.stdout.isTTY) {
|
|
12
12
|
relinka(
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BorderColorName, ColorName, TypographyName, VariantName } from "
|
|
1
|
+
import type { BorderColorName, ColorName, TypographyName, VariantName } from "../types.js";
|
|
2
2
|
/**
|
|
3
3
|
* Ends the prompt by optionally displaying an end message and running the action if confirmed.
|
|
4
4
|
* Preserves the last prompt state unless there's an endTitle.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { re } from "@reliverse/relico";
|
|
2
2
|
import { relinka } from "@reliverse/relinka";
|
|
3
|
-
import { msg, symbols } from "../msg-fmt/messages.js";
|
|
4
|
-
import { getExactTerminalWidth } from "../msg-fmt/terminal.js";
|
|
3
|
+
import { msg, symbols } from "../components/msg-fmt/messages.js";
|
|
4
|
+
import { getExactTerminalWidth } from "../components/msg-fmt/terminal.js";
|
|
5
5
|
export async function completePrompt(prompt, isCtrlC, _endTitle = "", _endTitleColor = "dim", _titleTypography = "none", _titleVariant = void 0, _border = true, borderColor = "dim", action, value) {
|
|
6
6
|
if (action && value) {
|
|
7
7
|
await action();
|
|
@@ -4,8 +4,8 @@ import ora from "ora";
|
|
|
4
4
|
import { cursor } from "sisteransi";
|
|
5
5
|
import terminalSize from "terminal-size";
|
|
6
6
|
import wrapAnsi from "wrap-ansi";
|
|
7
|
-
import { toBaseColor } from "../msg-fmt/colors.js";
|
|
8
|
-
import { msg } from "../msg-fmt/messages.js";
|
|
7
|
+
import { toBaseColor } from "../components/msg-fmt/colors.js";
|
|
8
|
+
import { msg } from "../components/msg-fmt/messages.js";
|
|
9
9
|
function getTerminalWidth() {
|
|
10
10
|
return terminalSize().columns;
|
|
11
11
|
}
|
package/package.json
CHANGED
|
@@ -1,27 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
"description": "@reliverse/rempts is a prompt library built with developer joy in mind. File-based commands. Flexible. Fast. Forget the clutter, it just works. This is a typesafe toolkit for building delightful CLI experiences.",
|
|
3
|
-
"license": "MIT",
|
|
4
|
-
"name": "@reliverse/rempts",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"version": "1.6.2",
|
|
7
|
-
"author": "reliverse",
|
|
8
|
-
"bugs": {
|
|
9
|
-
"email": "blefnk@gmail.com",
|
|
10
|
-
"url": "https://github.com/reliverse/rempts-cli/issues"
|
|
11
|
-
},
|
|
12
|
-
"keywords": [
|
|
13
|
-
"reliverse",
|
|
14
|
-
"prompts"
|
|
15
|
-
],
|
|
16
|
-
"repository": {
|
|
17
|
-
"type": "git",
|
|
18
|
-
"url": "git+https://github.com/reliverse/rempts-cli.git"
|
|
19
|
-
},
|
|
20
2
|
"dependencies": {
|
|
21
3
|
"@figliolia/chalk-animation": "^1.0.4",
|
|
22
4
|
"@reliverse/reliarg": "^1.0.3",
|
|
23
|
-
"@reliverse/relico": "^1.1.
|
|
24
|
-
"@reliverse/relinka": "^1.4.
|
|
5
|
+
"@reliverse/relico": "^1.1.1",
|
|
6
|
+
"@reliverse/relinka": "^1.4.3",
|
|
25
7
|
"@reliverse/runtime": "^1.0.3",
|
|
26
8
|
"ansi-escapes": "^7.0.0",
|
|
27
9
|
"c12": "^3.0.3",
|
|
@@ -34,15 +16,55 @@
|
|
|
34
16
|
"node-emoji": "^2.2.0",
|
|
35
17
|
"ora": "^8.2.0",
|
|
36
18
|
"pathe": "^2.0.3",
|
|
19
|
+
"pkg-types": "^2.1.0",
|
|
37
20
|
"sisteransi": "^1.0.5",
|
|
38
21
|
"terminal-kit": "^3.1.2",
|
|
39
22
|
"terminal-size": "^4.0.0",
|
|
40
23
|
"ts-regex-builder": "^1.8.2",
|
|
41
24
|
"wrap-ansi": "^9.0.0"
|
|
42
25
|
},
|
|
43
|
-
"
|
|
26
|
+
"description": "@reliverse/rempts is a modern, type-safe toolkit for building delightful cli experiences. it's fast, flexible, and made for developer happiness. file-based commands keep things simple.",
|
|
27
|
+
"homepage": "https://docs.reliverse.org",
|
|
28
|
+
"license": "MIT",
|
|
29
|
+
"name": "@reliverse/rempts",
|
|
30
|
+
"type": "module",
|
|
31
|
+
"version": "1.7.1",
|
|
32
|
+
"author": "reliverse",
|
|
33
|
+
"bugs": {
|
|
34
|
+
"email": "blefnk@gmail.com",
|
|
35
|
+
"url": "https://github.com/reliverse/rempts/issues"
|
|
36
|
+
},
|
|
37
|
+
"keywords": [
|
|
38
|
+
"reliverse"
|
|
39
|
+
],
|
|
40
|
+
"repository": {
|
|
41
|
+
"type": "git",
|
|
42
|
+
"url": "git+https://github.com/reliverse/rempts.git"
|
|
43
|
+
},
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"@biomejs/biome": "1.9.4",
|
|
46
|
+
"@eslint/js": "^9.26.0",
|
|
47
|
+
"@reliverse/dler": "^1.2.2",
|
|
48
|
+
"@reliverse/relidler-cfg": "^1.1.3",
|
|
49
|
+
"@stylistic/eslint-plugin": "^4.2.0",
|
|
50
|
+
"@total-typescript/ts-reset": "^0.6.1",
|
|
51
|
+
"@types/bun": "^1.2.13",
|
|
52
|
+
"@types/figlet": "^1.7.0",
|
|
53
|
+
"@types/fs-extra": "^11.0.4",
|
|
54
|
+
"@types/node": "^22.15.18",
|
|
55
|
+
"@types/terminal-kit": "^2.5.7",
|
|
56
|
+
"@types/wrap-ansi": "^8.1.0",
|
|
57
|
+
"eslint": "^9.26.0",
|
|
58
|
+
"eslint-plugin-no-relative-import-paths": "^1.6.1",
|
|
59
|
+
"eslint-plugin-perfectionist": "^4.13.0",
|
|
60
|
+
"jiti": "^2.4.2",
|
|
61
|
+
"knip": "^5.55.1",
|
|
62
|
+
"typescript": "^5.8.3",
|
|
63
|
+
"typescript-eslint": "^8.32.1",
|
|
64
|
+
"vitest": "^3.1.3"
|
|
65
|
+
},
|
|
44
66
|
"exports": {
|
|
45
|
-
".": "./bin/
|
|
67
|
+
".": "./bin/mod.js"
|
|
46
68
|
},
|
|
47
69
|
"files": [
|
|
48
70
|
"bin",
|
|
@@ -50,8 +72,8 @@
|
|
|
50
72
|
"README.md",
|
|
51
73
|
"LICENSE"
|
|
52
74
|
],
|
|
53
|
-
"main": "./bin/
|
|
54
|
-
"module": "./bin/
|
|
75
|
+
"main": "./bin/mod.js",
|
|
76
|
+
"module": "./bin/mod.js",
|
|
55
77
|
"publishConfig": {
|
|
56
78
|
"access": "public"
|
|
57
79
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|