@reliverse/rempts 1.7.44 → 1.7.45
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/README.md +1 -1
- package/dist-npm/bin/mod.d.mts +2333 -0
- package/dist-npm/bin/mod.mjs +8236 -0
- package/package.json +84 -42
- package/bin/libs/animate/animate-mod.d.ts +0 -14
- package/bin/libs/animate/animate-mod.js +0 -62
- package/bin/libs/anykey/anykey-mod.d.ts +0 -12
- package/bin/libs/anykey/anykey-mod.js +0 -125
- package/bin/libs/cancel/cancel.d.ts +0 -45
- package/bin/libs/cancel/cancel.js +0 -72
- package/bin/libs/confirm/confirm-alias.d.ts +0 -2
- package/bin/libs/confirm/confirm-alias.js +0 -2
- package/bin/libs/confirm/confirm-mod.d.ts +0 -5
- package/bin/libs/confirm/confirm-mod.js +0 -179
- package/bin/libs/date/date.d.ts +0 -2
- package/bin/libs/date/date.js +0 -236
- package/bin/libs/editor/editor-mod.d.ts +0 -25
- package/bin/libs/editor/editor-mod.js +0 -897
- package/bin/libs/figures/figures-mod.d.ts +0 -461
- package/bin/libs/figures/figures-mod.js +0 -285
- package/bin/libs/group/group-mod.d.ts +0 -33
- package/bin/libs/group/group-mod.js +0 -93
- package/bin/libs/input/input-alias.d.ts +0 -5
- package/bin/libs/input/input-alias.js +0 -4
- package/bin/libs/input/input-mod.d.ts +0 -16
- package/bin/libs/input/input-mod.js +0 -372
- package/bin/libs/intro/intro-alias.d.ts +0 -2
- package/bin/libs/intro/intro-alias.js +0 -3
- package/bin/libs/intro/intro-mod.d.ts +0 -20
- package/bin/libs/intro/intro-mod.js +0 -81
- package/bin/libs/launcher/command-runner.d.ts +0 -18
- package/bin/libs/launcher/command-runner.js +0 -79
- package/bin/libs/launcher/command-typed.d.ts +0 -16
- package/bin/libs/launcher/command-typed.js +0 -60
- package/bin/libs/launcher/launcher-alias.d.ts +0 -2
- package/bin/libs/launcher/launcher-alias.js +0 -2
- package/bin/libs/launcher/launcher-mod.d.ts +0 -162
- package/bin/libs/launcher/launcher-mod.js +0 -1222
- package/bin/libs/launcher/launcher-types.d.ts +0 -159
- package/bin/libs/launcher/launcher-types.js +0 -0
- package/bin/libs/launcher/trpc-orpc-support/completions.d.ts +0 -4
- package/bin/libs/launcher/trpc-orpc-support/completions.js +0 -45
- package/bin/libs/launcher/trpc-orpc-support/errors.d.ts +0 -11
- package/bin/libs/launcher/trpc-orpc-support/errors.js +0 -10
- package/bin/libs/launcher/trpc-orpc-support/index.d.ts +0 -34
- package/bin/libs/launcher/trpc-orpc-support/index.js +0 -641
- package/bin/libs/launcher/trpc-orpc-support/json-schema.d.ts +0 -17
- package/bin/libs/launcher/trpc-orpc-support/json-schema.js +0 -168
- package/bin/libs/launcher/trpc-orpc-support/json.d.ts +0 -44
- package/bin/libs/launcher/trpc-orpc-support/json.js +0 -41
- package/bin/libs/launcher/trpc-orpc-support/logging.d.ts +0 -11
- package/bin/libs/launcher/trpc-orpc-support/logging.js +0 -26
- package/bin/libs/launcher/trpc-orpc-support/parse-procedure.d.ts +0 -2
- package/bin/libs/launcher/trpc-orpc-support/parse-procedure.js +0 -486
- package/bin/libs/launcher/trpc-orpc-support/prompts.d.ts +0 -18
- package/bin/libs/launcher/trpc-orpc-support/prompts.js +0 -534
- package/bin/libs/launcher/trpc-orpc-support/standard-schema/contract.d.ts +0 -53
- package/bin/libs/launcher/trpc-orpc-support/standard-schema/contract.js +0 -0
- package/bin/libs/launcher/trpc-orpc-support/standard-schema/errors.d.ts +0 -9
- package/bin/libs/launcher/trpc-orpc-support/standard-schema/errors.js +0 -47
- package/bin/libs/launcher/trpc-orpc-support/standard-schema/utils.d.ts +0 -3
- package/bin/libs/launcher/trpc-orpc-support/standard-schema/utils.js +0 -6
- package/bin/libs/launcher/trpc-orpc-support/trpc-compat.d.ts +0 -71
- package/bin/libs/launcher/trpc-orpc-support/trpc-compat.js +0 -11
- package/bin/libs/launcher/trpc-orpc-support/types.d.ts +0 -276
- package/bin/libs/launcher/trpc-orpc-support/types.js +0 -0
- package/bin/libs/launcher/trpc-orpc-support/util.d.ts +0 -9
- package/bin/libs/launcher/trpc-orpc-support/util.js +0 -9
- package/bin/libs/log/log-alias.d.ts +0 -1
- package/bin/libs/log/log-alias.js +0 -2
- package/bin/libs/msg-fmt/colors.d.ts +0 -30
- package/bin/libs/msg-fmt/colors.js +0 -42
- package/bin/libs/msg-fmt/logger.d.ts +0 -17
- package/bin/libs/msg-fmt/logger.js +0 -103
- package/bin/libs/msg-fmt/mapping.d.ts +0 -3
- package/bin/libs/msg-fmt/mapping.js +0 -49
- package/bin/libs/msg-fmt/messages.d.ts +0 -35
- package/bin/libs/msg-fmt/messages.js +0 -319
- package/bin/libs/msg-fmt/terminal.d.ts +0 -15
- package/bin/libs/msg-fmt/terminal.js +0 -60
- package/bin/libs/msg-fmt/variants.d.ts +0 -11
- package/bin/libs/msg-fmt/variants.js +0 -52
- package/bin/libs/multiselect/multiselect-alias.d.ts +0 -2
- package/bin/libs/multiselect/multiselect-alias.js +0 -2
- package/bin/libs/multiselect/multiselect-prompt.d.ts +0 -2
- package/bin/libs/multiselect/multiselect-prompt.js +0 -348
- package/bin/libs/next-steps/next-steps.d.ts +0 -14
- package/bin/libs/next-steps/next-steps.js +0 -24
- package/bin/libs/number/number-mod.d.ts +0 -28
- package/bin/libs/number/number-mod.js +0 -194
- package/bin/libs/outro/outro-alias.d.ts +0 -2
- package/bin/libs/outro/outro-alias.js +0 -3
- package/bin/libs/outro/outro-mod.d.ts +0 -8
- package/bin/libs/outro/outro-mod.js +0 -55
- package/bin/libs/results/results.d.ts +0 -7
- package/bin/libs/results/results.js +0 -27
- package/bin/libs/select/nummultiselect-prompt.d.ts +0 -6
- package/bin/libs/select/nummultiselect-prompt.js +0 -105
- package/bin/libs/select/numselect-prompt.d.ts +0 -7
- package/bin/libs/select/numselect-prompt.js +0 -115
- package/bin/libs/select/select-alias.d.ts +0 -9
- package/bin/libs/select/select-alias.js +0 -9
- package/bin/libs/select/select-prompt.d.ts +0 -5
- package/bin/libs/select/select-prompt.js +0 -314
- package/bin/libs/select/toggle-prompt.d.ts +0 -5
- package/bin/libs/select/toggle-prompt.js +0 -209
- package/bin/libs/spinner/spinner-alias.d.ts +0 -1
- package/bin/libs/spinner/spinner-alias.js +0 -2
- package/bin/libs/spinner/spinner-mod.d.ts +0 -106
- package/bin/libs/spinner/spinner-mod.js +0 -265
- package/bin/libs/task/progress.d.ts +0 -2
- package/bin/libs/task/progress.js +0 -57
- package/bin/libs/task/task-spin.d.ts +0 -15
- package/bin/libs/task/task-spin.js +0 -110
- package/bin/libs/utils/colorize.d.ts +0 -2
- package/bin/libs/utils/colorize.js +0 -135
- package/bin/libs/utils/errors.d.ts +0 -1
- package/bin/libs/utils/errors.js +0 -17
- package/bin/libs/utils/prevent.d.ts +0 -8
- package/bin/libs/utils/prevent.js +0 -65
- package/bin/libs/utils/prompt-end.d.ts +0 -8
- package/bin/libs/utils/prompt-end.js +0 -34
- package/bin/libs/utils/stream-text.d.ts +0 -18
- package/bin/libs/utils/stream-text.js +0 -136
- package/bin/libs/utils/system.d.ts +0 -6
- package/bin/libs/utils/system.js +0 -7
- package/bin/libs/utils/validate.d.ts +0 -21
- package/bin/libs/utils/validate.js +0 -17
- package/bin/libs/visual/visual-mod.d.ts +0 -6
- package/bin/libs/visual/visual-mod.js +0 -13
- package/bin/mod.d.ts +0 -69
- package/bin/mod.js +0 -159
- package/bin/types.d.ts +0 -371
- package/bin/types.js +0 -0
package/bin/libs/date/date.js
DELETED
|
@@ -1,236 +0,0 @@
|
|
|
1
|
-
import { re } from "@reliverse/relico";
|
|
2
|
-
import { stdin as input, stdout as output } from "node:process";
|
|
3
|
-
import readline from "node:readline/promises";
|
|
4
|
-
import {
|
|
5
|
-
buildRegExp,
|
|
6
|
-
digit,
|
|
7
|
-
endOfString,
|
|
8
|
-
repeat,
|
|
9
|
-
startOfString
|
|
10
|
-
} from "ts-regex-builder";
|
|
11
|
-
import { fmt, msg, symbols } from "../msg-fmt/messages.js";
|
|
12
|
-
import {
|
|
13
|
-
countLines,
|
|
14
|
-
deleteLastLine,
|
|
15
|
-
deleteLastLines
|
|
16
|
-
} from "../msg-fmt/terminal.js";
|
|
17
|
-
const twoDigits = repeat(digit, 2);
|
|
18
|
-
const fourDigits = repeat(digit, 4);
|
|
19
|
-
const separatorDot = ".";
|
|
20
|
-
const separatorSlash = "/";
|
|
21
|
-
const regexDDMMYYYY = buildRegExp([
|
|
22
|
-
startOfString,
|
|
23
|
-
twoDigits,
|
|
24
|
-
// DD
|
|
25
|
-
separatorDot,
|
|
26
|
-
twoDigits,
|
|
27
|
-
// MM
|
|
28
|
-
separatorDot,
|
|
29
|
-
fourDigits,
|
|
30
|
-
// YYYY
|
|
31
|
-
endOfString
|
|
32
|
-
]);
|
|
33
|
-
const regexMMDDYYYY = buildRegExp([
|
|
34
|
-
startOfString,
|
|
35
|
-
twoDigits,
|
|
36
|
-
// MM
|
|
37
|
-
separatorSlash,
|
|
38
|
-
twoDigits,
|
|
39
|
-
// DD
|
|
40
|
-
separatorSlash,
|
|
41
|
-
fourDigits,
|
|
42
|
-
// YYYY
|
|
43
|
-
endOfString
|
|
44
|
-
]);
|
|
45
|
-
const regexYYYYMMDD = buildRegExp([
|
|
46
|
-
startOfString,
|
|
47
|
-
fourDigits,
|
|
48
|
-
// YYYY
|
|
49
|
-
separatorDot,
|
|
50
|
-
twoDigits,
|
|
51
|
-
// MM
|
|
52
|
-
separatorDot,
|
|
53
|
-
twoDigits,
|
|
54
|
-
// DD
|
|
55
|
-
endOfString
|
|
56
|
-
]);
|
|
57
|
-
export async function datePrompt(opts) {
|
|
58
|
-
const {
|
|
59
|
-
title = "",
|
|
60
|
-
dateFormat,
|
|
61
|
-
dateKind,
|
|
62
|
-
hint,
|
|
63
|
-
hintPlaceholderColor = "blue",
|
|
64
|
-
validate,
|
|
65
|
-
defaultValue = "",
|
|
66
|
-
titleColor = "cyan",
|
|
67
|
-
titleTypography = "none",
|
|
68
|
-
titleVariant,
|
|
69
|
-
content,
|
|
70
|
-
contentColor = "dim",
|
|
71
|
-
contentTypography = "italic",
|
|
72
|
-
contentVariant,
|
|
73
|
-
borderColor = "dim",
|
|
74
|
-
variantOptions,
|
|
75
|
-
endTitle = "",
|
|
76
|
-
endTitleColor = "dim",
|
|
77
|
-
border = true
|
|
78
|
-
} = opts;
|
|
79
|
-
const rl = readline.createInterface({ input, output });
|
|
80
|
-
rl.on("SIGINT", () => {
|
|
81
|
-
rl.close();
|
|
82
|
-
if (endTitle !== "") {
|
|
83
|
-
msg({
|
|
84
|
-
type: "M_END",
|
|
85
|
-
title: endTitle,
|
|
86
|
-
titleColor: endTitleColor,
|
|
87
|
-
titleTypography,
|
|
88
|
-
border,
|
|
89
|
-
borderColor
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
process.exit(0);
|
|
93
|
-
});
|
|
94
|
-
let linesToDelete = 0;
|
|
95
|
-
let errorMessage = "";
|
|
96
|
-
try {
|
|
97
|
-
while (true) {
|
|
98
|
-
if (linesToDelete > 0) {
|
|
99
|
-
deleteLastLines(linesToDelete);
|
|
100
|
-
linesToDelete = 0;
|
|
101
|
-
}
|
|
102
|
-
const { text: questionText } = fmt({
|
|
103
|
-
type: errorMessage !== "" ? "M_ERROR_NULL" : "M_GENERAL_NULL",
|
|
104
|
-
title: `${title} [${dateFormat}]`,
|
|
105
|
-
titleColor,
|
|
106
|
-
titleTypography,
|
|
107
|
-
titleVariant,
|
|
108
|
-
content,
|
|
109
|
-
contentColor,
|
|
110
|
-
contentTypography,
|
|
111
|
-
contentVariant,
|
|
112
|
-
borderColor,
|
|
113
|
-
hint: `${hint ? `${hint} ` : ""}${defaultValue ? `Default: ${defaultValue}` : ""}`,
|
|
114
|
-
hintPlaceholderColor,
|
|
115
|
-
variantOptions,
|
|
116
|
-
errorMessage
|
|
117
|
-
});
|
|
118
|
-
const questionLines = countLines(questionText);
|
|
119
|
-
linesToDelete = questionLines + 1;
|
|
120
|
-
msg({
|
|
121
|
-
type: errorMessage !== "" ? "M_ERROR" : "M_GENERAL",
|
|
122
|
-
title: questionText
|
|
123
|
-
});
|
|
124
|
-
if (errorMessage !== "") {
|
|
125
|
-
deleteLastLine();
|
|
126
|
-
deleteLastLine();
|
|
127
|
-
}
|
|
128
|
-
const answerInput = await rl.question(`${re.dim(symbols.middle)} `);
|
|
129
|
-
if (answerInput === null) {
|
|
130
|
-
rl.close();
|
|
131
|
-
if (endTitle !== "") {
|
|
132
|
-
msg({
|
|
133
|
-
type: "M_END",
|
|
134
|
-
title: endTitle,
|
|
135
|
-
titleColor: endTitleColor,
|
|
136
|
-
titleTypography,
|
|
137
|
-
border,
|
|
138
|
-
borderColor
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
process.exit(0);
|
|
142
|
-
}
|
|
143
|
-
const answer = answerInput.trim() || defaultValue;
|
|
144
|
-
if (errorMessage !== "") {
|
|
145
|
-
deleteLastLine();
|
|
146
|
-
}
|
|
147
|
-
deleteLastLine();
|
|
148
|
-
msg({
|
|
149
|
-
type: "M_MIDDLE",
|
|
150
|
-
title: ` ${answer}`,
|
|
151
|
-
titleColor: "none"
|
|
152
|
-
});
|
|
153
|
-
if (!(regexDDMMYYYY.test(answer) || regexMMDDYYYY.test(answer) || regexYYYYMMDD.test(answer))) {
|
|
154
|
-
if (errorMessage !== "") {
|
|
155
|
-
deleteLastLine();
|
|
156
|
-
deleteLastLine();
|
|
157
|
-
}
|
|
158
|
-
errorMessage = `Please enter a valid date in ${dateFormat} format.`;
|
|
159
|
-
msg({ type: "M_ERROR", title: errorMessage });
|
|
160
|
-
linesToDelete = countLines(errorMessage) + 1;
|
|
161
|
-
continue;
|
|
162
|
-
}
|
|
163
|
-
let matchedFormat = null;
|
|
164
|
-
if (regexDDMMYYYY.test(answer)) {
|
|
165
|
-
matchedFormat = "DD.MM.YYYY";
|
|
166
|
-
} else if (regexMMDDYYYY.test(answer)) {
|
|
167
|
-
matchedFormat = "MM/DD/YYYY";
|
|
168
|
-
} else if (regexYYYYMMDD.test(answer)) {
|
|
169
|
-
matchedFormat = "YYYY.MM.DD";
|
|
170
|
-
}
|
|
171
|
-
if (dateKind === "birthday" && matchedFormat) {
|
|
172
|
-
const parts = answer.split(/[./-]/);
|
|
173
|
-
let date;
|
|
174
|
-
if (matchedFormat === "DD.MM.YYYY") {
|
|
175
|
-
date = new Date(
|
|
176
|
-
Number(parts[2]),
|
|
177
|
-
Number(parts[1]) - 1,
|
|
178
|
-
Number(parts[0])
|
|
179
|
-
);
|
|
180
|
-
} else if (matchedFormat === "MM/DD/YYYY") {
|
|
181
|
-
date = new Date(
|
|
182
|
-
Number(parts[2]),
|
|
183
|
-
Number(parts[0]) - 1,
|
|
184
|
-
Number(parts[1])
|
|
185
|
-
);
|
|
186
|
-
} else if (matchedFormat === "YYYY.MM.DD") {
|
|
187
|
-
date = new Date(
|
|
188
|
-
Number(parts[0]),
|
|
189
|
-
Number(parts[1]) - 1,
|
|
190
|
-
Number(parts[2])
|
|
191
|
-
);
|
|
192
|
-
} else {
|
|
193
|
-
date = new Date(answer);
|
|
194
|
-
}
|
|
195
|
-
if (Number.isNaN(date.getTime()) || date.getFullYear() < 1900 || date > /* @__PURE__ */ new Date()) {
|
|
196
|
-
errorMessage = "Please enter a valid birthday date (e.g., 14.09.1999).";
|
|
197
|
-
msg({ type: "M_ERROR", title: errorMessage });
|
|
198
|
-
linesToDelete = countLines(errorMessage) + 1;
|
|
199
|
-
continue;
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
let isValid = true;
|
|
203
|
-
let gotError = false;
|
|
204
|
-
if (errorMessage !== "") {
|
|
205
|
-
gotError = true;
|
|
206
|
-
}
|
|
207
|
-
errorMessage = "";
|
|
208
|
-
if (validate && isValid) {
|
|
209
|
-
const validation = await validate(answer);
|
|
210
|
-
if (validation !== true) {
|
|
211
|
-
isValid = false;
|
|
212
|
-
errorMessage = typeof validation === "string" ? validation : "Invalid input.";
|
|
213
|
-
msg({ type: "M_ERROR", title: errorMessage });
|
|
214
|
-
gotError = true;
|
|
215
|
-
linesToDelete = countLines(errorMessage) + 1;
|
|
216
|
-
continue;
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
if (isValid) {
|
|
220
|
-
if (gotError) {
|
|
221
|
-
deleteLastLine();
|
|
222
|
-
deleteLastLine();
|
|
223
|
-
msg({ type: "M_MIDDLE", title: ` ${answer}` });
|
|
224
|
-
}
|
|
225
|
-
msg({
|
|
226
|
-
type: "M_BAR",
|
|
227
|
-
borderColor
|
|
228
|
-
});
|
|
229
|
-
rl.close();
|
|
230
|
-
return answer;
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
} finally {
|
|
234
|
-
rl.close();
|
|
235
|
-
}
|
|
236
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { EditorExitResult } from "../../types.js";
|
|
2
|
-
interface EditorConfig {
|
|
3
|
-
syntaxHighlighting?: boolean;
|
|
4
|
-
theme?: "auto" | "light" | "dark";
|
|
5
|
-
defaultAllowSaveAs?: boolean;
|
|
6
|
-
defaultAllowOpen?: boolean;
|
|
7
|
-
defaultAutoCloseOnSave?: boolean;
|
|
8
|
-
defaultReturnContentOnSave?: boolean;
|
|
9
|
-
[key: string]: any;
|
|
10
|
-
}
|
|
11
|
-
interface EditorOptions {
|
|
12
|
-
filename?: string | null;
|
|
13
|
-
initialContent?: string | null;
|
|
14
|
-
onSave?: (content: string, filename: string | null) => Promise<string | boolean | undefined> | string | boolean | undefined;
|
|
15
|
-
onExit?: (content: string | null, saved: boolean, filename: string | null) => Promise<void> | void;
|
|
16
|
-
configOverrides?: Partial<EditorConfig>;
|
|
17
|
-
allowSaveAs?: boolean;
|
|
18
|
-
allowOpen?: boolean;
|
|
19
|
-
autoCloseOnSave?: boolean;
|
|
20
|
-
returnContentOnSave?: boolean;
|
|
21
|
-
mode?: string;
|
|
22
|
-
cwd?: string;
|
|
23
|
-
}
|
|
24
|
-
export declare function startEditor(options?: EditorOptions): Promise<EditorExitResult>;
|
|
25
|
-
export {};
|