@reliverse/rempts 1.7.34 → 1.7.35

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 CHANGED
@@ -99,17 +99,19 @@ import {
99
99
 
100
100
  To help you migrate from the different CLI frameworks, `@reliverse/rempts` has some aliases for the most popular prompts.
101
101
 
102
- | Prompt | Aliases |
103
- |-----------------------|-----------------|
104
- | `useSpinner` | `spinner` |
105
- | `selectPrompt` | `select` |
106
- | `multiselectPrompt` | `multiselect` |
107
- | `inputPrompt` | `text`, `input` |
108
- | `@reliverse/relinka` | `log` |
109
-
110
- ### Notices
111
-
112
- - `setup`/`cleanup` are now `onCmdInit`/`onCmdExit` (old names still work for now).
102
+ | Prompt | Aliases |
103
+ |-----------------------|------------------|
104
+ | `createCli` | `runMain` |
105
+ | `onCmdInit` | `setup` |
106
+ | `onCmdExit` | `cleanup` |
107
+ | `useSpinner` | `spinner` |
108
+ | `selectPrompt` | `select` |
109
+ | `multiselectPrompt` | `multiselect` |
110
+ | `inputPrompt` | `text`, `input` |
111
+ | `confirmPrompt` | `confirm` |
112
+ | `introPrompt` | `intro`, `start` |
113
+ | `outroPrompt` | `outro`, `end` |
114
+ | `log` | `relinka` |
113
115
 
114
116
  ### Prompts Usage Example
115
117
 
@@ -84,7 +84,7 @@ export async function confirmPrompt(options) {
84
84
  endTitleColor = "dim",
85
85
  border = true
86
86
  } = options;
87
- const finalTitle = message && title ? `${title}: ${message}` : message ?? title;
87
+ const finalTitle = message && title ? `${title}: ${message}` : message ?? title ?? "Confirm";
88
88
  const finalDefaultValue = defaultValue ?? initialValue;
89
89
  const rl = readline.createInterface({ input, output });
90
90
  let errorMessage = "";
@@ -100,7 +100,7 @@ function renderPromptUI(params) {
100
100
  symbolColor
101
101
  });
102
102
  void streamText({
103
- text: title,
103
+ text: title || "",
104
104
  delay: streamDelay,
105
105
  color: titleColor,
106
106
  newline: false
@@ -229,7 +229,7 @@ export async function inputPrompt(options) {
229
229
  shouldStream = false,
230
230
  streamDelay = 20
231
231
  } = options;
232
- const finalTitle = message && title ? `${title}: ${message}` : message ?? title;
232
+ const finalTitle = message && title ? `${title}: ${message}` : message ?? title ?? "Input";
233
233
  const finalDefaultValue = defaultValue ?? initialValue;
234
234
  const terminal = readline.createInterface({
235
235
  input: process.stdin,
@@ -114,7 +114,7 @@ export async function multiselectPrompt(params) {
114
114
  maxSelect,
115
115
  selectAll = false
116
116
  } = params;
117
- const finalTitle = message && title ? `${title}: ${message}` : message ?? title;
117
+ const finalTitle = message && title ? `${title}: ${message}` : message ?? title ?? "Select options";
118
118
  const finalDefaultValue = defaultValue ?? initialValue;
119
119
  let pointer = finalDefaultValue.length > 0 ? options.findIndex(
120
120
  (opt) => opt && isSelectOption(opt) && finalDefaultValue.includes(opt.value) && !opt.disabled
@@ -132,7 +132,7 @@ export async function selectPrompt(params) {
132
132
  shouldStream = false,
133
133
  streamDelay = 20
134
134
  } = params;
135
- const finalTitle = message && title ? `${title}: ${message}` : message ?? title;
135
+ const finalTitle = message && title ? `${title}: ${message}` : message ?? title ?? "Select option";
136
136
  const finalDefaultValue = defaultValue ?? initialValue;
137
137
  let selectedIndex = finalDefaultValue ? options.findIndex(
138
138
  (option) => isSelectOption(option) && option.value === finalDefaultValue && !option.disabled
package/bin/mod.d.ts CHANGED
@@ -46,7 +46,7 @@ export { endPrompt, outro } from "./libs/outro/outro-alias.js";
46
46
  export { outroPrompt } from "./libs/outro/outro-mod.js";
47
47
  export type { ResultsType } from "./libs/results/results.js";
48
48
  export { resultPrompt } from "./libs/results/results.js";
49
- export { select } from "./libs/select/aliases-alias.js";
49
+ export { select } from "./libs/select/select-alias.js";
50
50
  export { numMultiSelectPrompt } from "./libs/select/nummultiselect-prompt.js";
51
51
  export { numSelectPrompt } from "./libs/select/numselect-prompt.js";
52
52
  export { selectPrompt } from "./libs/select/select-prompt.js";
package/bin/mod.js CHANGED
@@ -117,7 +117,7 @@ export { numberPrompt } from "./libs/number/number-mod.js";
117
117
  export { endPrompt, outro } from "./libs/outro/outro-alias.js";
118
118
  export { outroPrompt } from "./libs/outro/outro-mod.js";
119
119
  export { resultPrompt } from "./libs/results/results.js";
120
- export { select } from "./libs/select/aliases-alias.js";
120
+ export { select } from "./libs/select/select-alias.js";
121
121
  export { numMultiSelectPrompt } from "./libs/select/nummultiselect-prompt.js";
122
122
  export { numSelectPrompt } from "./libs/select/numselect-prompt.js";
123
123
  export { selectPrompt } from "./libs/select/select-prompt.js";
package/bin/types.d.ts CHANGED
@@ -115,7 +115,7 @@ export interface ProgressBar {
115
115
  */
116
116
  export type PromptType = "input" | "inputmasked" | "select" | "multiselect" | "nummultiselect" | "numselect" | "toggle" | "confirm" | "spinner" | "progressbar" | "results" | "nextsteps" | "animatedtext" | "date" | "end";
117
117
  export interface ConfirmPromptOptions {
118
- title: string;
118
+ title?: string;
119
119
  message?: string;
120
120
  defaultValue?: boolean;
121
121
  initialValue?: boolean;
@@ -213,7 +213,7 @@ export type InputPromptOptions = {
213
213
  streamDelay?: number;
214
214
  symbol?: SymbolName;
215
215
  symbolColor?: ColorName;
216
- title: string;
216
+ title?: string;
217
217
  titleColor?: ColorName;
218
218
  titleTypography?: TypographyName;
219
219
  titleVariant?: VariantName;
@@ -235,7 +235,7 @@ export interface RenderParams {
235
235
  placeholder?: string;
236
236
  symbol?: SymbolName;
237
237
  symbolColor?: ColorName;
238
- title: string;
238
+ title?: string;
239
239
  titleColor?: ColorName;
240
240
  titleTypography?: TypographyName;
241
241
  titleVariant?: VariantName;
@@ -285,10 +285,12 @@ export interface FmtMsgOptions {
285
285
  noNewLine?: boolean;
286
286
  }
287
287
  export interface TogglePromptParams<T extends string> {
288
- title: string;
288
+ title?: string;
289
+ message?: string;
289
290
  content?: string;
290
291
  options?: [T, T];
291
292
  defaultValue?: T;
293
+ initialValue?: T;
292
294
  borderColor?: BorderColorName;
293
295
  titleColor?: ColorName;
294
296
  titleTypography?: TypographyName;
@@ -330,7 +332,7 @@ export interface SelectPromptParams<T extends string> {
330
332
  streamDelay?: number;
331
333
  }
332
334
  export interface MultiselectPromptParams<T extends string> {
333
- title: string;
335
+ title?: string;
334
336
  message?: string;
335
337
  content?: string;
336
338
  options: (SelectOption<T> | SeparatorOption)[];
package/package.json CHANGED
@@ -44,7 +44,7 @@
44
44
  "license": "MIT",
45
45
  "name": "@reliverse/rempts",
46
46
  "type": "module",
47
- "version": "1.7.34",
47
+ "version": "1.7.35",
48
48
  "author": "reliverse",
49
49
  "bugs": {
50
50
  "email": "blefnk@gmail.com",