@hot-updater/cli-tools 0.28.0 → 0.29.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/chunk-BEJ448es.mjs +35 -0
- package/dist/index.cjs +11222 -54750
- package/dist/index.d.cts +591 -6
- package/dist/index.d.mts +830 -0
- package/dist/index.mjs +47758 -0
- package/package.json +141 -22
- package/dist/index.d.ts +0 -247
- package/dist/index.js +0 -91305
package/dist/index.d.cts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { Readable } from "stream";
|
|
2
|
-
import colors from "picocolors";
|
|
3
2
|
import { ConfigInput, Platform, RequiredDeep } from "@hot-updater/plugin-core";
|
|
4
|
-
import
|
|
3
|
+
import { Key as Key$1 } from "node:readline";
|
|
4
|
+
import { Readable as Readable$1, Writable } from "node:stream";
|
|
5
5
|
|
|
6
|
+
//#region \0rolldown/runtime.js
|
|
7
|
+
//#endregion
|
|
6
8
|
//#region src/BuildLogger.d.ts
|
|
7
9
|
type LinePattern = string | RegExp;
|
|
8
10
|
interface BuildLoggerConfig {
|
|
@@ -79,6 +81,58 @@ declare class ConfigBuilder implements IConfigBuilder {
|
|
|
79
81
|
getResult(): string;
|
|
80
82
|
}
|
|
81
83
|
//#endregion
|
|
84
|
+
//#region ../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/types.d.ts
|
|
85
|
+
type Formatter = (input: string | number | null | undefined) => string;
|
|
86
|
+
interface Colors {
|
|
87
|
+
isColorSupported: boolean;
|
|
88
|
+
reset: Formatter;
|
|
89
|
+
bold: Formatter;
|
|
90
|
+
dim: Formatter;
|
|
91
|
+
italic: Formatter;
|
|
92
|
+
underline: Formatter;
|
|
93
|
+
inverse: Formatter;
|
|
94
|
+
hidden: Formatter;
|
|
95
|
+
strikethrough: Formatter;
|
|
96
|
+
black: Formatter;
|
|
97
|
+
red: Formatter;
|
|
98
|
+
green: Formatter;
|
|
99
|
+
yellow: Formatter;
|
|
100
|
+
blue: Formatter;
|
|
101
|
+
magenta: Formatter;
|
|
102
|
+
cyan: Formatter;
|
|
103
|
+
white: Formatter;
|
|
104
|
+
gray: Formatter;
|
|
105
|
+
bgBlack: Formatter;
|
|
106
|
+
bgRed: Formatter;
|
|
107
|
+
bgGreen: Formatter;
|
|
108
|
+
bgYellow: Formatter;
|
|
109
|
+
bgBlue: Formatter;
|
|
110
|
+
bgMagenta: Formatter;
|
|
111
|
+
bgCyan: Formatter;
|
|
112
|
+
bgWhite: Formatter;
|
|
113
|
+
blackBright: Formatter;
|
|
114
|
+
redBright: Formatter;
|
|
115
|
+
greenBright: Formatter;
|
|
116
|
+
yellowBright: Formatter;
|
|
117
|
+
blueBright: Formatter;
|
|
118
|
+
magentaBright: Formatter;
|
|
119
|
+
cyanBright: Formatter;
|
|
120
|
+
whiteBright: Formatter;
|
|
121
|
+
bgBlackBright: Formatter;
|
|
122
|
+
bgRedBright: Formatter;
|
|
123
|
+
bgGreenBright: Formatter;
|
|
124
|
+
bgYellowBright: Formatter;
|
|
125
|
+
bgBlueBright: Formatter;
|
|
126
|
+
bgMagentaBright: Formatter;
|
|
127
|
+
bgCyanBright: Formatter;
|
|
128
|
+
bgWhiteBright: Formatter;
|
|
129
|
+
}
|
|
130
|
+
//#endregion
|
|
131
|
+
//#region ../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.d.ts
|
|
132
|
+
declare const picocolors: Colors & {
|
|
133
|
+
createColors: (enabled?: boolean) => Colors;
|
|
134
|
+
};
|
|
135
|
+
//#endregion
|
|
82
136
|
//#region src/copyDirToTmp.d.ts
|
|
83
137
|
declare const copyDirToTmp: (dir: string, childDirname?: string) => Promise<{
|
|
84
138
|
tmpDir: string;
|
|
@@ -204,7 +258,6 @@ type HotUpdaterConfigOptions = {
|
|
|
204
258
|
} | null;
|
|
205
259
|
type ConfigResponse = RequiredDeep<ConfigInput>;
|
|
206
260
|
declare const loadConfig: (options: HotUpdaterConfigOptions) => Promise<ConfigResponse>;
|
|
207
|
-
declare const loadConfigSync: (options: HotUpdaterConfigOptions) => ConfigResponse;
|
|
208
261
|
//#endregion
|
|
209
262
|
//#region src/log.d.ts
|
|
210
263
|
declare const log: {
|
|
@@ -223,9 +276,541 @@ type EnvVarValue = string | {
|
|
|
223
276
|
};
|
|
224
277
|
declare const makeEnv: (newEnvVars: Record<string, EnvVarValue>, filePath?: string) => Promise<string>;
|
|
225
278
|
//#endregion
|
|
279
|
+
//#region ../../node_modules/.pnpm/@clack+core@1.0.1/node_modules/@clack/core/dist/index.d.mts
|
|
280
|
+
declare const actions: readonly ["up", "down", "left", "right", "space", "enter", "cancel"];
|
|
281
|
+
type Action = (typeof actions)[number];
|
|
282
|
+
/** Global settings for Clack programs, stored in memory */
|
|
283
|
+
interface InternalClackSettings {
|
|
284
|
+
actions: Set<Action>;
|
|
285
|
+
aliases: Map<string, Action>;
|
|
286
|
+
messages: {
|
|
287
|
+
cancel: string;
|
|
288
|
+
error: string;
|
|
289
|
+
};
|
|
290
|
+
withGuide: boolean;
|
|
291
|
+
}
|
|
292
|
+
declare const settings: InternalClackSettings;
|
|
293
|
+
interface ClackSettings {
|
|
294
|
+
/**
|
|
295
|
+
* Set custom global aliases for the default actions.
|
|
296
|
+
* This will not overwrite existing aliases, it will only add new ones!
|
|
297
|
+
*
|
|
298
|
+
* @param aliases - An object that maps aliases to actions
|
|
299
|
+
* @default { k: 'up', j: 'down', h: 'left', l: 'right', '\x03': 'cancel', 'escape': 'cancel' }
|
|
300
|
+
*/
|
|
301
|
+
aliases?: Record<string, Action>;
|
|
302
|
+
/**
|
|
303
|
+
* Custom messages for prompts
|
|
304
|
+
*/
|
|
305
|
+
messages?: {
|
|
306
|
+
/**
|
|
307
|
+
* Custom message to display when a spinner is cancelled
|
|
308
|
+
* @default "Canceled"
|
|
309
|
+
*/
|
|
310
|
+
cancel?: string;
|
|
311
|
+
/**
|
|
312
|
+
* Custom message to display when a spinner encounters an error
|
|
313
|
+
* @default "Something went wrong"
|
|
314
|
+
*/
|
|
315
|
+
error?: string;
|
|
316
|
+
};
|
|
317
|
+
withGuide?: boolean;
|
|
318
|
+
}
|
|
319
|
+
declare function updateSettings(updates: ClackSettings): void;
|
|
320
|
+
/**
|
|
321
|
+
* The state of the prompt
|
|
322
|
+
*/
|
|
323
|
+
type ClackState = 'initial' | 'active' | 'cancel' | 'submit' | 'error';
|
|
324
|
+
/**
|
|
325
|
+
* Typed event emitter for clack
|
|
326
|
+
*/
|
|
327
|
+
interface ClackEvents<TValue> {
|
|
328
|
+
initial: (value?: any) => void;
|
|
329
|
+
active: (value?: any) => void;
|
|
330
|
+
cancel: (value?: any) => void;
|
|
331
|
+
submit: (value?: any) => void;
|
|
332
|
+
error: (value?: any) => void;
|
|
333
|
+
cursor: (key?: Action) => void;
|
|
334
|
+
key: (key: string | undefined, info: Key$1) => void;
|
|
335
|
+
value: (value?: TValue) => void;
|
|
336
|
+
userInput: (value: string) => void;
|
|
337
|
+
confirm: (value?: boolean) => void;
|
|
338
|
+
finalize: () => void;
|
|
339
|
+
beforePrompt: () => void;
|
|
340
|
+
}
|
|
341
|
+
interface PromptOptions<TValue, Self extends Prompt<TValue>> {
|
|
342
|
+
render(this: Omit<Self, 'prompt'>): string | undefined;
|
|
343
|
+
initialValue?: any;
|
|
344
|
+
initialUserInput?: string;
|
|
345
|
+
validate?: ((value: TValue | undefined) => string | Error | undefined) | undefined;
|
|
346
|
+
input?: Readable$1;
|
|
347
|
+
output?: Writable;
|
|
348
|
+
debug?: boolean;
|
|
349
|
+
signal?: AbortSignal;
|
|
350
|
+
}
|
|
351
|
+
declare class Prompt<TValue> {
|
|
352
|
+
protected input: Readable$1;
|
|
353
|
+
protected output: Writable;
|
|
354
|
+
private _abortSignal?;
|
|
355
|
+
private rl;
|
|
356
|
+
private opts;
|
|
357
|
+
private _render;
|
|
358
|
+
private _track;
|
|
359
|
+
private _prevFrame;
|
|
360
|
+
private _subscribers;
|
|
361
|
+
protected _cursor: number;
|
|
362
|
+
state: ClackState;
|
|
363
|
+
error: string;
|
|
364
|
+
value: TValue | undefined;
|
|
365
|
+
userInput: string;
|
|
366
|
+
constructor(options: PromptOptions<TValue, Prompt<TValue>>, trackValue?: boolean);
|
|
367
|
+
/**
|
|
368
|
+
* Unsubscribe all listeners
|
|
369
|
+
*/
|
|
370
|
+
protected unsubscribe(): void;
|
|
371
|
+
/**
|
|
372
|
+
* Set a subscriber with opts
|
|
373
|
+
* @param event - The event name
|
|
374
|
+
*/
|
|
375
|
+
private setSubscriber;
|
|
376
|
+
/**
|
|
377
|
+
* Subscribe to an event
|
|
378
|
+
* @param event - The event name
|
|
379
|
+
* @param cb - The callback
|
|
380
|
+
*/
|
|
381
|
+
on<T extends keyof ClackEvents<TValue>>(event: T, cb: ClackEvents<TValue>[T]): void;
|
|
382
|
+
/**
|
|
383
|
+
* Subscribe to an event once
|
|
384
|
+
* @param event - The event name
|
|
385
|
+
* @param cb - The callback
|
|
386
|
+
*/
|
|
387
|
+
once<T extends keyof ClackEvents<TValue>>(event: T, cb: ClackEvents<TValue>[T]): void;
|
|
388
|
+
/**
|
|
389
|
+
* Emit an event with data
|
|
390
|
+
* @param event - The event name
|
|
391
|
+
* @param data - The data to pass to the callback
|
|
392
|
+
*/
|
|
393
|
+
emit<T extends keyof ClackEvents<TValue>>(event: T, ...data: Parameters<ClackEvents<TValue>[T]>): void;
|
|
394
|
+
prompt(): Promise<symbol | TValue | undefined>;
|
|
395
|
+
protected _isActionKey(char: string | undefined, _key: Key$1): boolean;
|
|
396
|
+
protected _setValue(value: TValue | undefined): void;
|
|
397
|
+
protected _setUserInput(value: string | undefined, write?: boolean): void;
|
|
398
|
+
protected _clearUserInput(): void;
|
|
399
|
+
private onKeypress;
|
|
400
|
+
protected close(): void;
|
|
401
|
+
private restoreCursor;
|
|
402
|
+
private render;
|
|
403
|
+
}
|
|
404
|
+
interface OptionLike$1 {
|
|
405
|
+
value: unknown;
|
|
406
|
+
label?: string;
|
|
407
|
+
disabled?: boolean;
|
|
408
|
+
}
|
|
409
|
+
type FilterFunction<T extends OptionLike$1> = (search: string, opt: T) => boolean;
|
|
410
|
+
interface AutocompleteOptions$1<T extends OptionLike$1> extends PromptOptions<T['value'] | T['value'][], AutocompletePrompt<T>> {
|
|
411
|
+
options: T[] | ((this: AutocompletePrompt<T>) => T[]);
|
|
412
|
+
filter?: FilterFunction<T>;
|
|
413
|
+
multiple?: boolean;
|
|
414
|
+
}
|
|
415
|
+
declare class AutocompletePrompt<T extends OptionLike$1> extends Prompt<T['value'] | T['value'][]> {
|
|
416
|
+
#private;
|
|
417
|
+
filteredOptions: T[];
|
|
418
|
+
multiple: boolean;
|
|
419
|
+
isNavigating: boolean;
|
|
420
|
+
selectedValues: Array<T['value']>;
|
|
421
|
+
focusedValue: T['value'] | undefined;
|
|
422
|
+
get cursor(): number;
|
|
423
|
+
get userInputWithCursor(): string;
|
|
424
|
+
get options(): T[];
|
|
425
|
+
constructor(opts: AutocompleteOptions$1<T>);
|
|
426
|
+
protected _isActionKey(char: string | undefined, key: Key$1): boolean;
|
|
427
|
+
deselectAll(): void;
|
|
428
|
+
toggleSelected(value: T['value']): void;
|
|
429
|
+
}
|
|
430
|
+
declare function isCancel(value: unknown): value is symbol;
|
|
431
|
+
declare namespace index_d_exports {
|
|
432
|
+
export { AutocompleteMultiSelectOptions, AutocompleteOptions, BoxAlignment, BoxOptions, ClackSettings, CommonOptions, ConfirmOptions, GroupMultiSelectOptions, LimitOptionsParams, LogMessageOptions, MultiSelectOptions, NoteOptions, Option, PasswordOptions, PathOptions, ProgressOptions, ProgressResult, PromptGroup, PromptGroupAwaitedReturn, PromptGroupOptions, S_BAR, S_BAR_END, S_BAR_END_RIGHT, S_BAR_H, S_BAR_START, S_BAR_START_RIGHT, S_CHECKBOX_ACTIVE, S_CHECKBOX_INACTIVE, S_CHECKBOX_SELECTED, S_CONNECT_LEFT, S_CORNER_BOTTOM_LEFT, S_CORNER_BOTTOM_RIGHT, S_CORNER_TOP_LEFT, S_CORNER_TOP_RIGHT, S_ERROR, S_INFO, S_PASSWORD_MASK, S_RADIO_ACTIVE, S_RADIO_INACTIVE, S_STEP_ACTIVE, S_STEP_CANCEL, S_STEP_ERROR, S_STEP_SUBMIT, S_SUCCESS, S_WARN, SelectKeyOptions, SelectOptions, SpinnerOptions, SpinnerResult, Task, TaskLogCompletionOptions, TaskLogMessageOptions, TaskLogOptions, TextOptions, autocomplete, autocompleteMultiselect, box, cancel, confirm, group, groupMultiselect, intro, isCI, isCancel, isTTY, limitOptions, log$1 as log, multiselect, note, outro, password, path, progress, select, selectKey, settings, spinner, stream, symbol, symbolBar, taskLog, tasks, text, unicode, unicodeOr, updateSettings };
|
|
433
|
+
}
|
|
434
|
+
declare const unicode: boolean;
|
|
435
|
+
declare const isCI: () => boolean;
|
|
436
|
+
declare const isTTY: (output: Writable) => boolean;
|
|
437
|
+
declare const unicodeOr: (c: string, fallback: string) => string;
|
|
438
|
+
declare const S_STEP_ACTIVE: string;
|
|
439
|
+
declare const S_STEP_CANCEL: string;
|
|
440
|
+
declare const S_STEP_ERROR: string;
|
|
441
|
+
declare const S_STEP_SUBMIT: string;
|
|
442
|
+
declare const S_BAR_START: string;
|
|
443
|
+
declare const S_BAR: string;
|
|
444
|
+
declare const S_BAR_END: string;
|
|
445
|
+
declare const S_BAR_START_RIGHT: string;
|
|
446
|
+
declare const S_BAR_END_RIGHT: string;
|
|
447
|
+
declare const S_RADIO_ACTIVE: string;
|
|
448
|
+
declare const S_RADIO_INACTIVE: string;
|
|
449
|
+
declare const S_CHECKBOX_ACTIVE: string;
|
|
450
|
+
declare const S_CHECKBOX_SELECTED: string;
|
|
451
|
+
declare const S_CHECKBOX_INACTIVE: string;
|
|
452
|
+
declare const S_PASSWORD_MASK: string;
|
|
453
|
+
declare const S_BAR_H: string;
|
|
454
|
+
declare const S_CORNER_TOP_RIGHT: string;
|
|
455
|
+
declare const S_CONNECT_LEFT: string;
|
|
456
|
+
declare const S_CORNER_BOTTOM_RIGHT: string;
|
|
457
|
+
declare const S_CORNER_BOTTOM_LEFT: string;
|
|
458
|
+
declare const S_CORNER_TOP_LEFT: string;
|
|
459
|
+
declare const S_INFO: string;
|
|
460
|
+
declare const S_SUCCESS: string;
|
|
461
|
+
declare const S_WARN: string;
|
|
462
|
+
declare const S_ERROR: string;
|
|
463
|
+
declare const symbol: (state: ClackState) => string;
|
|
464
|
+
declare const symbolBar: (state: ClackState) => string;
|
|
465
|
+
interface CommonOptions {
|
|
466
|
+
input?: Readable$1;
|
|
467
|
+
output?: Writable;
|
|
468
|
+
signal?: AbortSignal;
|
|
469
|
+
withGuide?: boolean;
|
|
470
|
+
}
|
|
471
|
+
type Primitive = Readonly<string | boolean | number>;
|
|
472
|
+
type Option<Value> = Value extends Primitive ? {
|
|
473
|
+
/**
|
|
474
|
+
* Internal data for this option.
|
|
475
|
+
*/
|
|
476
|
+
value: Value;
|
|
477
|
+
/**
|
|
478
|
+
* The optional, user-facing text for this option.
|
|
479
|
+
*
|
|
480
|
+
* By default, the `value` is converted to a string.
|
|
481
|
+
*/
|
|
482
|
+
label?: string;
|
|
483
|
+
/**
|
|
484
|
+
* An optional hint to display to the user when
|
|
485
|
+
* this option might be selected.
|
|
486
|
+
*
|
|
487
|
+
* By default, no `hint` is displayed.
|
|
488
|
+
*/
|
|
489
|
+
hint?: string;
|
|
490
|
+
/**
|
|
491
|
+
* Whether this option is disabled.
|
|
492
|
+
* Disabled options are visible but cannot be selected.
|
|
493
|
+
*
|
|
494
|
+
* By default, options are not disabled.
|
|
495
|
+
*/
|
|
496
|
+
disabled?: boolean;
|
|
497
|
+
} : {
|
|
498
|
+
/**
|
|
499
|
+
* Internal data for this option.
|
|
500
|
+
*/
|
|
501
|
+
value: Value;
|
|
502
|
+
/**
|
|
503
|
+
* Required. The user-facing text for this option.
|
|
504
|
+
*/
|
|
505
|
+
label: string;
|
|
506
|
+
/**
|
|
507
|
+
* An optional hint to display to the user when
|
|
508
|
+
* this option might be selected.
|
|
509
|
+
*
|
|
510
|
+
* By default, no `hint` is displayed.
|
|
511
|
+
*/
|
|
512
|
+
hint?: string;
|
|
513
|
+
/**
|
|
514
|
+
* Whether this option is disabled.
|
|
515
|
+
* Disabled options are visible but cannot be selected.
|
|
516
|
+
*
|
|
517
|
+
* By default, options are not disabled.
|
|
518
|
+
*/
|
|
519
|
+
disabled?: boolean;
|
|
520
|
+
};
|
|
521
|
+
interface SelectOptions<Value> extends CommonOptions {
|
|
522
|
+
message: string;
|
|
523
|
+
options: Option<Value>[];
|
|
524
|
+
initialValue?: Value;
|
|
525
|
+
maxItems?: number;
|
|
526
|
+
}
|
|
527
|
+
declare const select: <Value>(opts: SelectOptions<Value>) => Promise<Value | symbol>;
|
|
528
|
+
interface AutocompleteSharedOptions<Value> extends CommonOptions {
|
|
529
|
+
/**
|
|
530
|
+
* The message to display to the user.
|
|
531
|
+
*/
|
|
532
|
+
message: string;
|
|
533
|
+
/**
|
|
534
|
+
* Available options for the autocomplete prompt.
|
|
535
|
+
*/
|
|
536
|
+
options: Option<Value>[] | ((this: AutocompletePrompt<Option<Value>>) => Option<Value>[]);
|
|
537
|
+
/**
|
|
538
|
+
* Maximum number of items to display at once.
|
|
539
|
+
*/
|
|
540
|
+
maxItems?: number;
|
|
541
|
+
/**
|
|
542
|
+
* Placeholder text to display when no input is provided.
|
|
543
|
+
*/
|
|
544
|
+
placeholder?: string;
|
|
545
|
+
/**
|
|
546
|
+
* Validates the value
|
|
547
|
+
*/
|
|
548
|
+
validate?: (value: Value | Value[] | undefined) => string | Error | undefined;
|
|
549
|
+
/**
|
|
550
|
+
* Custom filter function to match options against search input.
|
|
551
|
+
* If not provided, a default filter that matches label, hint, and value is used.
|
|
552
|
+
*/
|
|
553
|
+
filter?: (search: string, option: Option<Value>) => boolean;
|
|
554
|
+
}
|
|
555
|
+
interface AutocompleteOptions<Value> extends AutocompleteSharedOptions<Value> {
|
|
556
|
+
/**
|
|
557
|
+
* The initial selected value.
|
|
558
|
+
*/
|
|
559
|
+
initialValue?: Value;
|
|
560
|
+
/**
|
|
561
|
+
* The initial user input
|
|
562
|
+
*/
|
|
563
|
+
initialUserInput?: string;
|
|
564
|
+
}
|
|
565
|
+
declare const autocomplete: <Value>(opts: AutocompleteOptions<Value>) => Promise<Value | symbol>;
|
|
566
|
+
interface AutocompleteMultiSelectOptions<Value> extends AutocompleteSharedOptions<Value> {
|
|
567
|
+
/**
|
|
568
|
+
* The initial selected values
|
|
569
|
+
*/
|
|
570
|
+
initialValues?: Value[];
|
|
571
|
+
/**
|
|
572
|
+
* If true, at least one option must be selected
|
|
573
|
+
*/
|
|
574
|
+
required?: boolean;
|
|
575
|
+
}
|
|
576
|
+
/**
|
|
577
|
+
* Integrated autocomplete multiselect - combines type-ahead filtering with multiselect in one UI
|
|
578
|
+
*/
|
|
579
|
+
declare const autocompleteMultiselect: <Value>(opts: AutocompleteMultiSelectOptions<Value>) => Promise<Value[] | symbol>;
|
|
580
|
+
type BoxAlignment = 'left' | 'center' | 'right';
|
|
581
|
+
interface BoxOptions extends CommonOptions {
|
|
582
|
+
contentAlign?: BoxAlignment;
|
|
583
|
+
titleAlign?: BoxAlignment;
|
|
584
|
+
width?: number | 'auto';
|
|
585
|
+
titlePadding?: number;
|
|
586
|
+
contentPadding?: number;
|
|
587
|
+
rounded?: boolean;
|
|
588
|
+
formatBorder?: (text: string) => string;
|
|
589
|
+
}
|
|
590
|
+
declare const box: (message?: string, title?: string, opts?: BoxOptions) => void;
|
|
591
|
+
interface ConfirmOptions extends CommonOptions {
|
|
592
|
+
message: string;
|
|
593
|
+
active?: string;
|
|
594
|
+
inactive?: string;
|
|
595
|
+
initialValue?: boolean;
|
|
596
|
+
vertical?: boolean;
|
|
597
|
+
}
|
|
598
|
+
declare const confirm: (opts: ConfirmOptions) => Promise<boolean | symbol>;
|
|
599
|
+
type Prettify<T> = { [P in keyof T]: T[P] } & {};
|
|
600
|
+
type PromptGroupAwaitedReturn<T> = { [P in keyof T]: Exclude<Awaited<T[P]>, symbol> };
|
|
601
|
+
interface PromptGroupOptions<T> {
|
|
602
|
+
/**
|
|
603
|
+
* Control how the group can be canceled
|
|
604
|
+
* if one of the prompts is canceled.
|
|
605
|
+
*/
|
|
606
|
+
onCancel?: (opts: {
|
|
607
|
+
results: Prettify<Partial<PromptGroupAwaitedReturn<T>>>;
|
|
608
|
+
}) => void;
|
|
609
|
+
}
|
|
610
|
+
type PromptGroup<T> = { [P in keyof T]: (opts: {
|
|
611
|
+
results: Prettify<Partial<PromptGroupAwaitedReturn<Omit<T, P>>>>;
|
|
612
|
+
}) => undefined | Promise<T[P] | undefined> };
|
|
613
|
+
/**
|
|
614
|
+
* Define a group of prompts to be displayed
|
|
615
|
+
* and return a results of objects within the group
|
|
616
|
+
*/
|
|
617
|
+
declare const group: <T>(prompts: PromptGroup<T>, opts?: PromptGroupOptions<T>) => Promise<Prettify<PromptGroupAwaitedReturn<T>>>;
|
|
618
|
+
interface GroupMultiSelectOptions<Value> extends CommonOptions {
|
|
619
|
+
message: string;
|
|
620
|
+
options: Record<string, Option<Value>[]>;
|
|
621
|
+
initialValues?: Value[];
|
|
622
|
+
required?: boolean;
|
|
623
|
+
cursorAt?: Value;
|
|
624
|
+
selectableGroups?: boolean;
|
|
625
|
+
groupSpacing?: number;
|
|
626
|
+
}
|
|
627
|
+
declare const groupMultiselect: <Value>(opts: GroupMultiSelectOptions<Value>) => Promise<Value[] | symbol>;
|
|
628
|
+
interface LimitOptionsParams<TOption> extends CommonOptions {
|
|
629
|
+
options: TOption[];
|
|
630
|
+
maxItems: number | undefined;
|
|
631
|
+
cursor: number;
|
|
632
|
+
style: (option: TOption, active: boolean) => string;
|
|
633
|
+
columnPadding?: number;
|
|
634
|
+
rowPadding?: number;
|
|
635
|
+
}
|
|
636
|
+
declare const limitOptions: <TOption>(params: LimitOptionsParams<TOption>) => string[];
|
|
637
|
+
interface LogMessageOptions extends CommonOptions {
|
|
638
|
+
symbol?: string;
|
|
639
|
+
spacing?: number;
|
|
640
|
+
secondarySymbol?: string;
|
|
641
|
+
}
|
|
642
|
+
declare const log$1: {
|
|
643
|
+
message: (message?: string | string[], {
|
|
644
|
+
symbol,
|
|
645
|
+
secondarySymbol,
|
|
646
|
+
output,
|
|
647
|
+
spacing,
|
|
648
|
+
withGuide
|
|
649
|
+
}?: LogMessageOptions) => void;
|
|
650
|
+
info: (message: string, opts?: LogMessageOptions) => void;
|
|
651
|
+
success: (message: string, opts?: LogMessageOptions) => void;
|
|
652
|
+
step: (message: string, opts?: LogMessageOptions) => void;
|
|
653
|
+
warn: (message: string, opts?: LogMessageOptions) => void; /** alias for `log.warn()`. */
|
|
654
|
+
warning: (message: string, opts?: LogMessageOptions) => void;
|
|
655
|
+
error: (message: string, opts?: LogMessageOptions) => void;
|
|
656
|
+
};
|
|
657
|
+
declare const cancel: (message?: string, opts?: CommonOptions) => void;
|
|
658
|
+
declare const intro: (title?: string, opts?: CommonOptions) => void;
|
|
659
|
+
declare const outro: (message?: string, opts?: CommonOptions) => void;
|
|
660
|
+
interface MultiSelectOptions<Value> extends CommonOptions {
|
|
661
|
+
message: string;
|
|
662
|
+
options: Option<Value>[];
|
|
663
|
+
initialValues?: Value[];
|
|
664
|
+
maxItems?: number;
|
|
665
|
+
required?: boolean;
|
|
666
|
+
cursorAt?: Value;
|
|
667
|
+
}
|
|
668
|
+
declare const multiselect: <Value>(opts: MultiSelectOptions<Value>) => Promise<Value[] | symbol>;
|
|
669
|
+
type FormatFn = (line: string) => string;
|
|
670
|
+
interface NoteOptions extends CommonOptions {
|
|
671
|
+
format?: FormatFn;
|
|
672
|
+
}
|
|
673
|
+
declare const note: (message?: string, title?: string, opts?: NoteOptions) => void;
|
|
674
|
+
interface PasswordOptions extends CommonOptions {
|
|
675
|
+
message: string;
|
|
676
|
+
mask?: string;
|
|
677
|
+
validate?: (value: string | undefined) => string | Error | undefined;
|
|
678
|
+
clearOnError?: boolean;
|
|
679
|
+
}
|
|
680
|
+
declare const password: (opts: PasswordOptions) => Promise<string | symbol>;
|
|
681
|
+
interface PathOptions extends CommonOptions {
|
|
682
|
+
root?: string;
|
|
683
|
+
directory?: boolean;
|
|
684
|
+
initialValue?: string;
|
|
685
|
+
message: string;
|
|
686
|
+
validate?: (value: string | undefined) => string | Error | undefined;
|
|
687
|
+
}
|
|
688
|
+
declare const path: (opts: PathOptions) => Promise<string | symbol>;
|
|
689
|
+
interface SpinnerOptions extends CommonOptions {
|
|
690
|
+
indicator?: 'dots' | 'timer';
|
|
691
|
+
onCancel?: () => void;
|
|
692
|
+
cancelMessage?: string;
|
|
693
|
+
errorMessage?: string;
|
|
694
|
+
frames?: string[];
|
|
695
|
+
delay?: number;
|
|
696
|
+
styleFrame?: (frame: string) => string;
|
|
697
|
+
}
|
|
698
|
+
interface SpinnerResult {
|
|
699
|
+
start(msg?: string): void;
|
|
700
|
+
stop(msg?: string): void;
|
|
701
|
+
cancel(msg?: string): void;
|
|
702
|
+
error(msg?: string): void;
|
|
703
|
+
message(msg?: string): void;
|
|
704
|
+
clear(): void;
|
|
705
|
+
readonly isCancelled: boolean;
|
|
706
|
+
}
|
|
707
|
+
declare const spinner: ({
|
|
708
|
+
indicator,
|
|
709
|
+
onCancel,
|
|
710
|
+
output,
|
|
711
|
+
cancelMessage,
|
|
712
|
+
errorMessage,
|
|
713
|
+
frames,
|
|
714
|
+
delay,
|
|
715
|
+
signal,
|
|
716
|
+
...opts
|
|
717
|
+
}?: SpinnerOptions) => SpinnerResult;
|
|
718
|
+
interface ProgressOptions extends SpinnerOptions {
|
|
719
|
+
style?: 'light' | 'heavy' | 'block';
|
|
720
|
+
max?: number;
|
|
721
|
+
size?: number;
|
|
722
|
+
}
|
|
723
|
+
interface ProgressResult extends SpinnerResult {
|
|
724
|
+
advance(step?: number, msg?: string): void;
|
|
725
|
+
}
|
|
726
|
+
declare function progress({
|
|
727
|
+
style,
|
|
728
|
+
max: userMax,
|
|
729
|
+
size: userSize,
|
|
730
|
+
...spinnerOptions
|
|
731
|
+
}?: ProgressOptions): ProgressResult;
|
|
732
|
+
interface SelectKeyOptions<Value extends string> extends CommonOptions {
|
|
733
|
+
message: string;
|
|
734
|
+
options: Option<Value>[];
|
|
735
|
+
initialValue?: Value;
|
|
736
|
+
caseSensitive?: boolean;
|
|
737
|
+
}
|
|
738
|
+
declare const selectKey: <Value extends string>(opts: SelectKeyOptions<Value>) => Promise<Value | symbol>;
|
|
739
|
+
declare const stream: {
|
|
740
|
+
message: (iterable: Iterable<string> | AsyncIterable<string>, {
|
|
741
|
+
symbol
|
|
742
|
+
}?: LogMessageOptions) => Promise<void>;
|
|
743
|
+
info: (iterable: Iterable<string> | AsyncIterable<string>) => Promise<void>;
|
|
744
|
+
success: (iterable: Iterable<string> | AsyncIterable<string>) => Promise<void>;
|
|
745
|
+
step: (iterable: Iterable<string> | AsyncIterable<string>) => Promise<void>;
|
|
746
|
+
warn: (iterable: Iterable<string> | AsyncIterable<string>) => Promise<void>; /** alias for `log.warn()`. */
|
|
747
|
+
warning: (iterable: Iterable<string> | AsyncIterable<string>) => Promise<void>;
|
|
748
|
+
error: (iterable: Iterable<string> | AsyncIterable<string>) => Promise<void>;
|
|
749
|
+
};
|
|
750
|
+
type Task = {
|
|
751
|
+
/**
|
|
752
|
+
* Task title
|
|
753
|
+
*/
|
|
754
|
+
title: string;
|
|
755
|
+
/**
|
|
756
|
+
* Task function
|
|
757
|
+
*/
|
|
758
|
+
task: (message: (string: string) => void) => string | Promise<string> | void | Promise<void>;
|
|
759
|
+
/**
|
|
760
|
+
* If enabled === false the task will be skipped
|
|
761
|
+
*/
|
|
762
|
+
enabled?: boolean;
|
|
763
|
+
};
|
|
764
|
+
/**
|
|
765
|
+
* Define a group of tasks to be executed
|
|
766
|
+
*/
|
|
767
|
+
declare const tasks: (tasks: Task[], opts?: CommonOptions) => Promise<void>;
|
|
768
|
+
interface TaskLogOptions extends CommonOptions {
|
|
769
|
+
title: string;
|
|
770
|
+
limit?: number;
|
|
771
|
+
spacing?: number;
|
|
772
|
+
retainLog?: boolean;
|
|
773
|
+
}
|
|
774
|
+
interface TaskLogMessageOptions {
|
|
775
|
+
raw?: boolean;
|
|
776
|
+
}
|
|
777
|
+
interface TaskLogCompletionOptions {
|
|
778
|
+
showLog?: boolean;
|
|
779
|
+
}
|
|
780
|
+
/**
|
|
781
|
+
* Renders a log which clears on success and remains on failure
|
|
782
|
+
*/
|
|
783
|
+
declare const taskLog: (opts: TaskLogOptions) => {
|
|
784
|
+
message(msg: string, mopts?: TaskLogMessageOptions): void;
|
|
785
|
+
group(name: string): {
|
|
786
|
+
message(msg: string, mopts?: TaskLogMessageOptions): void;
|
|
787
|
+
error(message: string): void;
|
|
788
|
+
success(message: string): void;
|
|
789
|
+
};
|
|
790
|
+
error(message: string, opts?: TaskLogCompletionOptions): void;
|
|
791
|
+
success(message: string, opts?: TaskLogCompletionOptions): void;
|
|
792
|
+
};
|
|
793
|
+
interface TextOptions extends CommonOptions {
|
|
794
|
+
message: string;
|
|
795
|
+
placeholder?: string;
|
|
796
|
+
defaultValue?: string;
|
|
797
|
+
initialValue?: string;
|
|
798
|
+
validate?: (value: string | undefined) => string | Error | undefined;
|
|
799
|
+
}
|
|
800
|
+
declare const text: (opts: TextOptions) => Promise<string | symbol>;
|
|
801
|
+
//#endregion
|
|
226
802
|
//#region src/prompts.d.ts
|
|
227
|
-
type PromptProgress = ReturnType<typeof
|
|
228
|
-
type PromptSpinner = ReturnType<typeof
|
|
803
|
+
type PromptProgress = ReturnType<typeof progress>;
|
|
804
|
+
type PromptSpinner = ReturnType<typeof spinner>;
|
|
805
|
+
//#endregion
|
|
806
|
+
//#region src/resolvePackageVersion.d.ts
|
|
807
|
+
declare const HOT_UPDATER_SERVER_PACKAGE_VERSION_ENV = "HOT_UPDATER_SERVER_PACKAGE_VERSION";
|
|
808
|
+
declare const resolvePackageVersion: (packageName: string, options?: {
|
|
809
|
+
searchFrom?: string;
|
|
810
|
+
}) => string;
|
|
811
|
+
declare const resolveHotUpdaterServerVersion: (currentPackageName: string, options?: {
|
|
812
|
+
searchFrom?: string;
|
|
813
|
+
}) => string;
|
|
229
814
|
//#endregion
|
|
230
815
|
//#region src/transformEnv.d.ts
|
|
231
816
|
declare const transformEnv: <T extends Record<string, string>>(filename: string, env: T) => string;
|
|
@@ -244,4 +829,4 @@ type TransformTemplateArgs<T extends string> = { [Key in ExtractPlaceholders<T>]
|
|
|
244
829
|
*/
|
|
245
830
|
declare function transformTemplate<T extends string>(templateString: T, values: TransformTemplateArgs<T>): string;
|
|
246
831
|
//#endregion
|
|
247
|
-
export { BuildLogger, BuildLoggerConfig, BuildType, ConfigBuilder, ConfigResponse, HotUpdaterConfigOptions, HotUpdaterLogWriter, IConfigBuilder, ImportInfo, PromptProgress, PromptSpinner, ProviderConfig, ReactNativeMetadata, banner, colors, copyDirToTmp, createLogWriter, createTarBr, createTarBrTargetFiles, createTarGz, createTarGzTargetFiles, createZip, createZipTargetFiles, decryptJson, encryptJson, ensureInstallPackages, getAndroidSdkPath, getCwd, getPackageManager, getReactNativeMetadatas, link, loadConfig,
|
|
832
|
+
export { BuildLogger, BuildLoggerConfig, BuildType, ConfigBuilder, ConfigResponse, HOT_UPDATER_SERVER_PACKAGE_VERSION_ENV, HotUpdaterConfigOptions, HotUpdaterLogWriter, IConfigBuilder, ImportInfo, PromptProgress, PromptSpinner, ProviderConfig, ReactNativeMetadata, banner, picocolors as colors, copyDirToTmp, createLogWriter, createTarBr, createTarBrTargetFiles, createTarGz, createTarGzTargetFiles, createZip, createZipTargetFiles, decryptJson, encryptJson, ensureInstallPackages, getAndroidSdkPath, getCwd, getPackageManager, getReactNativeMetadatas, link, loadConfig, log, makeEnv, index_d_exports as p, printBanner, resolveHotUpdaterServerVersion, resolvePackageVersion, stripAnsi, transformEnv, transformTemplate };
|