@reliverse/rempts 1.7.43 → 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 -76
- 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
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
import type { AnyRouter } from "./trpc-orpc-support/trpc-compat.js";
|
|
2
|
-
export type EmptyArgs = Record<string, never>;
|
|
3
|
-
export interface BaseArgProps {
|
|
4
|
-
description?: string;
|
|
5
|
-
required?: boolean;
|
|
6
|
-
allowed?: string[];
|
|
7
|
-
}
|
|
8
|
-
export interface BaseArgDefinition {
|
|
9
|
-
type: string;
|
|
10
|
-
description?: string;
|
|
11
|
-
required?: boolean;
|
|
12
|
-
default?: any;
|
|
13
|
-
allowed?: any[];
|
|
14
|
-
dependencies?: string[];
|
|
15
|
-
}
|
|
16
|
-
export type PositionalArgDefinition = BaseArgDefinition & {
|
|
17
|
-
type: "positional";
|
|
18
|
-
default?: string;
|
|
19
|
-
};
|
|
20
|
-
export type BooleanArgDefinition = BaseArgDefinition & {
|
|
21
|
-
type: "boolean";
|
|
22
|
-
default?: boolean;
|
|
23
|
-
allowed?: boolean[];
|
|
24
|
-
alias?: string;
|
|
25
|
-
};
|
|
26
|
-
export type StringArgDefinition = BaseArgDefinition & {
|
|
27
|
-
type: "string";
|
|
28
|
-
default?: string;
|
|
29
|
-
alias?: string;
|
|
30
|
-
};
|
|
31
|
-
export type NumberArgDefinition = BaseArgDefinition & {
|
|
32
|
-
type: "number";
|
|
33
|
-
default?: number;
|
|
34
|
-
allowed?: number[];
|
|
35
|
-
alias?: string;
|
|
36
|
-
};
|
|
37
|
-
export type ArrayArgDefinition = BaseArgDefinition & {
|
|
38
|
-
type: "array";
|
|
39
|
-
default?: string | readonly string[];
|
|
40
|
-
alias?: string;
|
|
41
|
-
};
|
|
42
|
-
export type ArgDefinition = PositionalArgDefinition | BooleanArgDefinition | StringArgDefinition | NumberArgDefinition | ArrayArgDefinition;
|
|
43
|
-
export type ArgDefinitions = Record<string, ArgDefinition>;
|
|
44
|
-
export interface CommandMeta {
|
|
45
|
-
name: string;
|
|
46
|
-
version?: string;
|
|
47
|
-
description?: string;
|
|
48
|
-
hidden?: boolean;
|
|
49
|
-
aliases?: string[];
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* A subcommand can be either:
|
|
53
|
-
* 1) A string path to a module with a default export of type Command.
|
|
54
|
-
* 2) A lazy import function returning a Promise that resolves to
|
|
55
|
-
* { default: Command<any> } or directly to a Command instance.
|
|
56
|
-
*/
|
|
57
|
-
export type CommandSpec = string | (() => Promise<{
|
|
58
|
-
default: Command<any>;
|
|
59
|
-
} | Command<any>>);
|
|
60
|
-
export type CommandsMap = Record<string, CommandSpec>;
|
|
61
|
-
export interface CommandContext<ARGS> {
|
|
62
|
-
args: ARGS;
|
|
63
|
-
raw: string[];
|
|
64
|
-
}
|
|
65
|
-
export type CommandRun<ARGS> = (ctx: CommandContext<ARGS>) => void | Promise<void>;
|
|
66
|
-
export type CommandHook<ARGS> = (ctx: CommandContext<ARGS>) => void | Promise<void>;
|
|
67
|
-
export interface DefineCommandOptions<A extends ArgDefinitions = EmptyArgs> {
|
|
68
|
-
meta?: CommandMeta;
|
|
69
|
-
args?: A;
|
|
70
|
-
run?: CommandRun<InferArgTypes<A>>;
|
|
71
|
-
/**
|
|
72
|
-
* Object subcommands for this command.
|
|
73
|
-
*/
|
|
74
|
-
commands?: CommandsMap;
|
|
75
|
-
/**
|
|
76
|
-
* @deprecated Use `commands` instead. Will be removed in a future major version.
|
|
77
|
-
*/
|
|
78
|
-
subCommands?: CommandsMap;
|
|
79
|
-
/**
|
|
80
|
-
* Called before the command runs. Receives `{ args, raw }` (parsed args and raw argv).
|
|
81
|
-
*/
|
|
82
|
-
onCmdInit?: CommandHook<InferArgTypes<A>>;
|
|
83
|
-
/**
|
|
84
|
-
* Called after the command finishes. Receives `{ args, raw }` (parsed args and raw argv).
|
|
85
|
-
*/
|
|
86
|
-
onCmdExit?: CommandHook<InferArgTypes<A>>;
|
|
87
|
-
/**
|
|
88
|
-
* @deprecated Use onCmdInit instead
|
|
89
|
-
*/
|
|
90
|
-
setup?: CommandHook<InferArgTypes<A>>;
|
|
91
|
-
/**
|
|
92
|
-
* @deprecated Use onCmdExit instead
|
|
93
|
-
*/
|
|
94
|
-
cleanup?: CommandHook<InferArgTypes<A>>;
|
|
95
|
-
/**
|
|
96
|
-
* Called once per CLI process, before any command/run() is executed
|
|
97
|
-
*/
|
|
98
|
-
onLauncherInit?: () => void | Promise<void>;
|
|
99
|
-
/**
|
|
100
|
-
* Called once per CLI process, after all command/run() logic is finished
|
|
101
|
-
*/
|
|
102
|
-
onLauncherExit?: () => void | Promise<void>;
|
|
103
|
-
/**
|
|
104
|
-
* tRPC/oRPC router for RPC mode. When provided, the command will automatically
|
|
105
|
-
* switch to RPC mode and use the router's procedures as CLI commands.
|
|
106
|
-
*/
|
|
107
|
-
router?: AnyRouter;
|
|
108
|
-
}
|
|
109
|
-
export interface Command<A extends ArgDefinitions = EmptyArgs> {
|
|
110
|
-
meta?: CommandMeta;
|
|
111
|
-
args: A;
|
|
112
|
-
run?: CommandRun<InferArgTypes<A>>;
|
|
113
|
-
/**
|
|
114
|
-
* Object subcommands for this command.
|
|
115
|
-
*/
|
|
116
|
-
commands?: CommandsMap;
|
|
117
|
-
/**
|
|
118
|
-
* @deprecated Use `commands` instead. Will be removed in a future major version.
|
|
119
|
-
*/
|
|
120
|
-
subCommands?: CommandsMap;
|
|
121
|
-
/**
|
|
122
|
-
* Called before the command runs. Receives `{ args, raw }` (parsed args and raw argv).
|
|
123
|
-
*/
|
|
124
|
-
onCmdInit?: CommandHook<InferArgTypes<A>>;
|
|
125
|
-
/**
|
|
126
|
-
* Called after the command finishes. Receives `{ args, raw }` (parsed args and raw argv).
|
|
127
|
-
*/
|
|
128
|
-
onCmdExit?: CommandHook<InferArgTypes<A>>;
|
|
129
|
-
/**
|
|
130
|
-
* @deprecated Use onCmdInit instead
|
|
131
|
-
*/
|
|
132
|
-
setup?: CommandHook<InferArgTypes<A>>;
|
|
133
|
-
/**
|
|
134
|
-
* @deprecated Use onCmdExit instead
|
|
135
|
-
*/
|
|
136
|
-
cleanup?: CommandHook<InferArgTypes<A>>;
|
|
137
|
-
/**
|
|
138
|
-
* Called once per CLI process, before any command/run() is executed
|
|
139
|
-
*/
|
|
140
|
-
onLauncherInit?: () => void | Promise<void>;
|
|
141
|
-
/**
|
|
142
|
-
* Called once per CLI process, after all command/run() logic is finished
|
|
143
|
-
*/
|
|
144
|
-
onLauncherExit?: () => void | Promise<void>;
|
|
145
|
-
/**
|
|
146
|
-
* tRPC/oRPC router for RPC mode. When provided, the command will automatically
|
|
147
|
-
* switch to RPC mode and use the router's procedures as CLI commands.
|
|
148
|
-
*/
|
|
149
|
-
router?: AnyRouter;
|
|
150
|
-
}
|
|
151
|
-
export type InferArgTypes<A extends ArgDefinitions> = {
|
|
152
|
-
[K in keyof A]: A[K] extends PositionalArgDefinition ? string : A[K] extends BooleanArgDefinition ? boolean : A[K] extends StringArgDefinition ? string : A[K] extends NumberArgDefinition ? number : A[K] extends {
|
|
153
|
-
type: "array";
|
|
154
|
-
} ? string[] : never;
|
|
155
|
-
};
|
|
156
|
-
export interface FileBasedOptions {
|
|
157
|
-
enable: boolean;
|
|
158
|
-
cmdsRootPath: string;
|
|
159
|
-
}
|
|
File without changes
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
export function addCompletions(program, completion) {
|
|
2
|
-
const commandSymbol = Symbol("command");
|
|
3
|
-
const cTree = {};
|
|
4
|
-
function addCommandCompletions(command, cTreeNode) {
|
|
5
|
-
command.commands.forEach((c) => {
|
|
6
|
-
const node = cTreeNode[c.name()] ||= {};
|
|
7
|
-
Object.defineProperty(node, commandSymbol, {
|
|
8
|
-
value: c,
|
|
9
|
-
enumerable: false
|
|
10
|
-
});
|
|
11
|
-
addCommandCompletions(c, node);
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
addCommandCompletions(program, cTree);
|
|
15
|
-
completion.on("complete", (fragment, params) => {
|
|
16
|
-
const segments = params.line.split(/ +/).slice(1, params.fragment);
|
|
17
|
-
const last = segments.at(-1);
|
|
18
|
-
let node = cTree;
|
|
19
|
-
const existingFlags = /* @__PURE__ */ new Set();
|
|
20
|
-
for (const segment of segments) {
|
|
21
|
-
if (segment.startsWith("-")) {
|
|
22
|
-
existingFlags.add(segment);
|
|
23
|
-
continue;
|
|
24
|
-
}
|
|
25
|
-
if (existingFlags.size > 0) continue;
|
|
26
|
-
node = node[segment];
|
|
27
|
-
if (!node) return;
|
|
28
|
-
}
|
|
29
|
-
const correspondingCommand = node[commandSymbol];
|
|
30
|
-
if (correspondingCommand?.options?.length) {
|
|
31
|
-
const suggestions = [];
|
|
32
|
-
for (const o of correspondingCommand.options) {
|
|
33
|
-
if (last === o.long || last === o.short) {
|
|
34
|
-
if (o.argChoices) suggestions.push(...o.argChoices);
|
|
35
|
-
if (!o.isBoolean()) break;
|
|
36
|
-
}
|
|
37
|
-
if (existingFlags.has(o.long)) continue;
|
|
38
|
-
if (existingFlags.has(o.short)) continue;
|
|
39
|
-
suggestions.push(o.long);
|
|
40
|
-
}
|
|
41
|
-
return params.reply(suggestions);
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
completion.tree(cTree).init();
|
|
45
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/** An error thrown when the trpc procedure results in a bad request */
|
|
2
|
-
export declare class CliValidationError extends Error {
|
|
3
|
-
}
|
|
4
|
-
/** An error which is only thrown when a custom \`process\` parameter is used. Under normal circumstances, this should not be used, even internally. */
|
|
5
|
-
export declare class FailedToExitError extends Error {
|
|
6
|
-
readonly exitCode: number;
|
|
7
|
-
constructor(message: string, { exitCode, cause }: {
|
|
8
|
-
exitCode: number;
|
|
9
|
-
cause: unknown;
|
|
10
|
-
});
|
|
11
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export class CliValidationError extends Error {
|
|
2
|
-
}
|
|
3
|
-
export class FailedToExitError extends Error {
|
|
4
|
-
exitCode;
|
|
5
|
-
constructor(message, { exitCode, cause }) {
|
|
6
|
-
const fullMessage = `${message}. The process was expected to exit with exit code ${exitCode} but did not. This may be because a custom \`process\` parameter was used. The exit reason is in the \`cause\` property.`;
|
|
7
|
-
super(fullMessage, { cause });
|
|
8
|
-
this.exitCode = exitCode;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { Command as BaseCommand } from "commander";
|
|
2
|
-
import type { AnyRouter } from "./trpc-compat";
|
|
3
|
-
import type { ParsedProcedure, TrpcCli, TrpcCliMeta, TrpcCliParams } from "./types";
|
|
4
|
-
export * from "./types";
|
|
5
|
-
export { z } from "zod/v4";
|
|
6
|
-
export * as zod from "zod";
|
|
7
|
-
export * as trpcServer from "@trpc/server";
|
|
8
|
-
export declare class TrpcCommand extends BaseCommand {
|
|
9
|
-
/** @internal track the commands that have been run, so that we can find the `__result` of the last command */
|
|
10
|
-
__ran: TrpcCommand[];
|
|
11
|
-
__input?: unknown;
|
|
12
|
-
/** @internal stash the return value of the underlying procedure on the command so to pass to `FailedToExitError` for use in a pinch */
|
|
13
|
-
__result?: unknown;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* @internal takes a trpc router and returns an object that you **could** use to build a CLI, or UI, or a bunch of other things with.
|
|
17
|
-
* Officially, just internal for building a CLI. GLHF.
|
|
18
|
-
*/
|
|
19
|
-
export declare const parseRouter: <R extends AnyRouter>({ router, ...params }: TrpcCliParams<R>) => [string, ProcedureInfo][];
|
|
20
|
-
interface ProcedureInfo {
|
|
21
|
-
meta: TrpcCliMeta;
|
|
22
|
-
parsedProcedure: ParsedProcedure;
|
|
23
|
-
incompatiblePairs: [string, string][];
|
|
24
|
-
procedure: {};
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Run a trpc router as a CLI.
|
|
28
|
-
*
|
|
29
|
-
* @param router A trpc router
|
|
30
|
-
* @param context The context to use when calling the procedures - needed if your router requires a context
|
|
31
|
-
* @param trpcServer The trpc server module to use. Only needed if using trpc v10.
|
|
32
|
-
* @returns A CLI object with a `run` method that can be called to run the CLI. The `run` method will parse the command line arguments, call the appropriate trpc procedure, log the result and exit the process. On error, it will log the error and exit with a non-zero exit code.
|
|
33
|
-
*/
|
|
34
|
-
export declare function createRpcCli<R extends AnyRouter>({ router, ...params }: TrpcCliParams<R>): TrpcCli;
|