@reliverse/dler 1.7.121 → 1.7.123
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/bin/impl/auth/impl/init.d.ts +2 -2
- package/bin/impl/build/binary-flow.js +24 -4
- package/bin/impl/build/build-regular.js +12 -9
- package/bin/impl/build/impl.d.ts +1 -1
- package/bin/impl/build/impl.js +23 -7
- package/bin/impl/build/library-flow.js +49 -2
- package/bin/impl/build/providers/build.js +13 -13
- package/bin/impl/build/providers/mkdist/mkdist-impl/make.js +1 -1
- package/bin/impl/build/providers/mkdist/mkdist-mod.js +1 -1
- package/bin/impl/build/regular-flow.js +130 -57
- package/bin/impl/config/create.js +18 -1
- package/bin/impl/config/prepare.js +1 -7
- package/bin/impl/config/repair.d.ts +1 -2
- package/bin/impl/config/repair.js +18 -54
- package/bin/impl/init/use-template/cp-impl.js +1 -1
- package/bin/impl/init/use-template/cp-modules/cli-main-modules/cli-menu-items/showCloneProjectMenu.js +1 -1
- package/bin/impl/init/use-template/cp-modules/compose-env-file/cef-keys.d.ts +16 -25
- package/bin/impl/init/use-template/cp-modules/compose-env-file/cef-keys.js +0 -60
- package/bin/impl/init/use-template/cp-modules/git-deploy-prompts/gdp-mod.js +1 -1
- package/bin/impl/init/use-template/cp-modules/git-deploy-prompts/vercel/vercel-create.js +1 -1
- package/bin/impl/init/use-template/cp-modules/git-deploy-prompts/vercel/vercel-deploy.js +1 -1
- package/bin/impl/merge/mod.js +71 -49
- package/bin/impl/migrate/codemods/anything-bun.js +1 -1
- package/bin/impl/providers/better-t-stack/types.d.ts +6 -6
- package/bin/impl/pub/impl.d.ts +1 -1
- package/bin/impl/pub/impl.js +31 -11
- package/bin/impl/rules/reliverse/missing-deps/formatter.js +1 -1
- package/bin/impl/schema/utils.d.ts +15 -0
- package/bin/impl/schema/utils.js +33 -0
- package/bin/impl/utils/downloading/downloadRepo.js +58 -8
- package/bin/impl/utils/finalize.d.ts +2 -2
- package/bin/impl/utils/finalize.js +10 -11
- package/bin/impl/utils/init/init-tmpl.d.ts +1 -1
- package/bin/impl/utils/init/init-tmpl.js +2 -2
- package/bin/impl/utils/projectRepository.js +2 -3
- package/bin/impl/utils/replacements/reps-keys.d.ts +14 -17
- package/bin/impl/utils/replacements/reps-keys.js +0 -17
- package/bin/impl/utils/schemaMemory.d.ts +17 -31
- package/bin/impl/utils/schemaMemory.js +0 -16
- package/bin/impl/utils/schemaTemplate.d.ts +24 -49
- package/bin/impl/utils/schemaTemplate.js +65 -84
- package/bin/impl/utils/spinner.d.ts +243 -15
- package/bin/impl/utils/spinner.js +362 -46
- package/bin/mod.d.ts +7 -7
- package/bin/mod.js +28 -16
- package/package.json +5 -6
- package/bin/impl/config/impl/typebox.d.ts +0 -8
- package/bin/impl/config/impl/typebox.js +0 -82
|
@@ -1,54 +1,370 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import cliSpinners, { randomSpinner } from "cli-spinners";
|
|
2
|
+
import ora, {
|
|
3
|
+
oraPromise
|
|
4
|
+
} from "ora";
|
|
5
|
+
import prettyBytes from "pretty-bytes";
|
|
6
|
+
import prettyMilliseconds from "pretty-ms";
|
|
7
|
+
function isCIEnvironment() {
|
|
8
|
+
const { CI, GITHUB_ACTIONS, BUILD_NUMBER, RUN_ID } = process.env;
|
|
9
|
+
return CI === "true" || GITHUB_ACTIONS === "true" || typeof BUILD_NUMBER !== "undefined" || typeof RUN_ID !== "undefined";
|
|
10
|
+
}
|
|
11
|
+
const defaultStderr = process.stderr;
|
|
12
|
+
function isInteractive(stream = defaultStderr) {
|
|
13
|
+
return Boolean(stream && stream.isTTY);
|
|
14
|
+
}
|
|
15
|
+
function getDefaultEnabled(stream = defaultStderr) {
|
|
16
|
+
const disabledByEnv = process.env.DLER_NO_SPINNER === "1" || process.env.NO_COLOR === "1";
|
|
17
|
+
if (disabledByEnv) return false;
|
|
18
|
+
if (isCIEnvironment()) return false;
|
|
19
|
+
return isInteractive(stream);
|
|
20
|
+
}
|
|
21
|
+
export const defaultSpinnerOptions = {
|
|
22
|
+
color: "cyan",
|
|
23
|
+
spinner: "dots",
|
|
24
|
+
hideCursor: true,
|
|
25
|
+
indent: 0,
|
|
26
|
+
discardStdin: true,
|
|
27
|
+
respectEnv: true,
|
|
28
|
+
showTiming: false
|
|
29
|
+
};
|
|
30
|
+
export function isSpinnerEnabled(options) {
|
|
31
|
+
const stream = options?.stream ?? defaultStderr;
|
|
32
|
+
const respectEnv = options?.respectEnv !== false;
|
|
33
|
+
if (typeof options?.isEnabled === "boolean") return options.isEnabled;
|
|
34
|
+
return respectEnv ? getDefaultEnabled(stream) : true;
|
|
35
|
+
}
|
|
36
|
+
export function createSpinner(input) {
|
|
37
|
+
const base = typeof input === "string" ? { text: input } : { ...input ?? {} };
|
|
38
|
+
const stream = base.stream ?? defaultStderr;
|
|
39
|
+
const respectEnv = base.respectEnv !== false;
|
|
40
|
+
const isEnabled = base.isEnabled ?? (respectEnv ? getDefaultEnabled(stream) : true);
|
|
41
|
+
const isSilent = base.isSilent ?? false;
|
|
42
|
+
return ora({
|
|
43
|
+
// Defaults chosen to be broadly useful; callers can override
|
|
44
|
+
color: base.color ?? defaultSpinnerOptions.color,
|
|
45
|
+
spinner: base.spinner ?? defaultSpinnerOptions.spinner,
|
|
46
|
+
hideCursor: base.hideCursor ?? defaultSpinnerOptions.hideCursor,
|
|
47
|
+
indent: base.indent ?? defaultSpinnerOptions.indent,
|
|
48
|
+
interval: base.interval,
|
|
49
|
+
prefixText: base.prefixText,
|
|
50
|
+
suffixText: base.suffixText,
|
|
51
|
+
stream,
|
|
52
|
+
text: base.text,
|
|
53
|
+
isEnabled,
|
|
54
|
+
isSilent,
|
|
55
|
+
discardStdin: base.discardStdin ?? defaultSpinnerOptions.discardStdin
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
export async function withSpinnerPromise(action, options) {
|
|
59
|
+
return oraPromise(
|
|
60
|
+
action,
|
|
61
|
+
options
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
export async function withSpinner(textOrOptions, action, onSuccessText, onFailText) {
|
|
65
|
+
const startTime = Date.now();
|
|
66
|
+
const options = typeof textOrOptions === "string" ? { text: textOrOptions } : textOrOptions;
|
|
67
|
+
const spinner = createSpinner(textOrOptions).start();
|
|
68
|
+
try {
|
|
69
|
+
const result = await action(spinner);
|
|
70
|
+
const successMsg = getSuccessMessage(result, onSuccessText, options, startTime);
|
|
71
|
+
spinner.succeed(successMsg);
|
|
72
|
+
return result;
|
|
73
|
+
} catch (error) {
|
|
74
|
+
const err = error;
|
|
75
|
+
const failMsg = getFailMessage(err, onFailText, options);
|
|
76
|
+
spinner.fail(failMsg);
|
|
77
|
+
throw err;
|
|
10
78
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
this.currentFrame = (this.currentFrame + 1) % this.frames.length;
|
|
21
|
-
}, 80);
|
|
22
|
-
return this;
|
|
79
|
+
}
|
|
80
|
+
function getSuccessMessage(result, onSuccessText, options, startTime) {
|
|
81
|
+
let message;
|
|
82
|
+
if (typeof onSuccessText === "function") {
|
|
83
|
+
message = onSuccessText(result);
|
|
84
|
+
} else if (typeof onSuccessText === "string") {
|
|
85
|
+
message = onSuccessText;
|
|
86
|
+
} else if (options.defaultSuccess) {
|
|
87
|
+
message = options.defaultSuccess;
|
|
23
88
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
if (this.interval) {
|
|
29
|
-
clearInterval(this.interval);
|
|
30
|
-
this.interval = void 0;
|
|
31
|
-
}
|
|
32
|
-
this.isSpinning = false;
|
|
33
|
-
process.stdout.write("\r\x1B[K");
|
|
34
|
-
process.stdout.write("\x1B[?25h");
|
|
35
|
-
if (finalMessage) {
|
|
36
|
-
process.stdout.write(`${finalMessage}
|
|
37
|
-
`);
|
|
38
|
-
}
|
|
39
|
-
return this;
|
|
89
|
+
if (options.showTiming && message) {
|
|
90
|
+
const elapsed = Date.now() - startTime;
|
|
91
|
+
const timing = prettyMilliseconds(elapsed, { compact: true });
|
|
92
|
+
message = `${message} (${timing})`;
|
|
40
93
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
94
|
+
return message;
|
|
95
|
+
}
|
|
96
|
+
function getFailMessage(error, onFailText, options) {
|
|
97
|
+
if (typeof onFailText === "function") {
|
|
98
|
+
return onFailText(error);
|
|
99
|
+
} else if (typeof onFailText === "string") {
|
|
100
|
+
return onFailText;
|
|
101
|
+
} else if (options.defaultFail) {
|
|
102
|
+
return options.defaultFail;
|
|
44
103
|
}
|
|
45
|
-
|
|
46
|
-
|
|
104
|
+
}
|
|
105
|
+
export function updateSpinnerText(spinner, text, options) {
|
|
106
|
+
const { prefix, suffix } = options ?? {};
|
|
107
|
+
const fullText = `${prefix ?? ""}${text}${suffix ?? ""}`;
|
|
108
|
+
spinner.text = fullText;
|
|
109
|
+
}
|
|
110
|
+
export function stopAndPersist(spinner, options) {
|
|
111
|
+
spinner.stopAndPersist({
|
|
112
|
+
symbol: options.symbol ?? " ",
|
|
113
|
+
text: options.text ?? spinner.text,
|
|
114
|
+
prefixText: options.prefixText ?? spinner.prefixText,
|
|
115
|
+
suffixText: options.suffixText ?? spinner.suffixText
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
export function createTimedSpinner(input) {
|
|
119
|
+
const startTime = Date.now();
|
|
120
|
+
const options = typeof input === "string" ? { text: input } : { ...input ?? {} };
|
|
121
|
+
const spinner = createSpinner({ ...options, showTiming: true });
|
|
122
|
+
return {
|
|
123
|
+
spinner,
|
|
124
|
+
getElapsed: () => Date.now() - startTime,
|
|
125
|
+
succeedWithTiming: (text) => {
|
|
126
|
+
const elapsed = Date.now() - startTime;
|
|
127
|
+
const timing = prettyMilliseconds(elapsed, { compact: true });
|
|
128
|
+
const message = text ? `${text} (${timing})` : void 0;
|
|
129
|
+
spinner.succeed(message);
|
|
130
|
+
},
|
|
131
|
+
failWithTiming: (text) => {
|
|
132
|
+
const elapsed = Date.now() - startTime;
|
|
133
|
+
const timing = prettyMilliseconds(elapsed, { compact: true });
|
|
134
|
+
const message = text ? `${text} (failed after ${timing})` : void 0;
|
|
135
|
+
spinner.fail(message);
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
export function createSpinnerGroup(options) {
|
|
140
|
+
const { items, concurrent = false, ...baseOptions } = options;
|
|
141
|
+
const spinners2 = items.map((item, index) => {
|
|
142
|
+
const spinnerOptions = {
|
|
143
|
+
...baseOptions,
|
|
144
|
+
text: item,
|
|
145
|
+
indent: (baseOptions.indent ?? 0) + (concurrent ? 0 : index * 2)
|
|
146
|
+
};
|
|
147
|
+
return createSpinner(spinnerOptions);
|
|
148
|
+
});
|
|
149
|
+
return {
|
|
150
|
+
spinners: spinners2,
|
|
151
|
+
updateAll: (text) => {
|
|
152
|
+
for (const spinner of spinners2) {
|
|
153
|
+
spinner.text = text;
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
succeedAll: (text) => {
|
|
157
|
+
for (const spinner of spinners2) {
|
|
158
|
+
spinner.succeed(text);
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
failAll: (text) => {
|
|
162
|
+
for (const spinner of spinners2) {
|
|
163
|
+
spinner.fail(text);
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
stopAll: () => {
|
|
167
|
+
for (const spinner of spinners2) {
|
|
168
|
+
spinner.stop();
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
export async function withEnhancedSpinner(textOrOptions, action) {
|
|
174
|
+
const startTime = Date.now();
|
|
175
|
+
const options = typeof textOrOptions === "string" ? { text: textOrOptions, showTiming: false } : { showTiming: false, ...textOrOptions };
|
|
176
|
+
const baseSpinner = createSpinner(options).start();
|
|
177
|
+
const enhancedSpinner = Object.assign(baseSpinner, {
|
|
178
|
+
updateText: (text, updateOptions) => {
|
|
179
|
+
updateSpinnerText(baseSpinner, text, updateOptions);
|
|
180
|
+
},
|
|
181
|
+
setProgress: (current, total, text) => {
|
|
182
|
+
const progressText = text ? `${text} (${current}/${total})` : `${current}/${total}`;
|
|
183
|
+
baseSpinner.text = progressText;
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
try {
|
|
187
|
+
const result = await action(enhancedSpinner);
|
|
188
|
+
let successText = options.successText;
|
|
189
|
+
if (options.showTiming && successText) {
|
|
190
|
+
const elapsed = Date.now() - startTime;
|
|
191
|
+
const timing = prettyMilliseconds(elapsed, { compact: true });
|
|
192
|
+
successText = `${successText} (${timing})`;
|
|
193
|
+
}
|
|
194
|
+
baseSpinner.succeed(successText);
|
|
195
|
+
return result;
|
|
196
|
+
} catch (error) {
|
|
197
|
+
const err = error;
|
|
198
|
+
let failText = options.failText;
|
|
199
|
+
if (options.showTiming && failText) {
|
|
200
|
+
const elapsed = Date.now() - startTime;
|
|
201
|
+
const timing = prettyMilliseconds(elapsed, { compact: true });
|
|
202
|
+
failText = `${failText} (failed after ${timing})`;
|
|
203
|
+
}
|
|
204
|
+
baseSpinner.fail(failText);
|
|
205
|
+
throw err;
|
|
47
206
|
}
|
|
48
|
-
|
|
49
|
-
|
|
207
|
+
}
|
|
208
|
+
export function isSpinnerRunning(spinner) {
|
|
209
|
+
return spinner.isSpinning;
|
|
210
|
+
}
|
|
211
|
+
export function safeStopSpinner(spinner) {
|
|
212
|
+
if (spinner?.isSpinning) {
|
|
213
|
+
spinner.stop();
|
|
50
214
|
}
|
|
51
215
|
}
|
|
52
|
-
export function
|
|
53
|
-
|
|
216
|
+
export function createBuildSpinner(operation, options) {
|
|
217
|
+
const spinner = createSpinner({ text: operation, ...options }).start();
|
|
218
|
+
return {
|
|
219
|
+
spinner,
|
|
220
|
+
complete: (message) => {
|
|
221
|
+
spinner.succeed(message ?? `${operation} completed successfully!`);
|
|
222
|
+
},
|
|
223
|
+
error: (error) => {
|
|
224
|
+
const errorMessage = typeof error === "string" ? error : error.message;
|
|
225
|
+
spinner.fail(`${operation} failed: ${errorMessage}`);
|
|
226
|
+
},
|
|
227
|
+
updateProgress: (step) => {
|
|
228
|
+
spinner.text = `${operation} - ${step}`;
|
|
229
|
+
}
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
export function createFileProgressSpinner(operation, options) {
|
|
233
|
+
const { totalBytes, showBytes = true, showRate = false, ...spinnerOptions } = options ?? {};
|
|
234
|
+
const startTime = Date.now();
|
|
235
|
+
const spinner = createSpinner({ text: operation, ...spinnerOptions }).start();
|
|
236
|
+
return {
|
|
237
|
+
spinner,
|
|
238
|
+
updateProgress: (bytesProcessed, fileName) => {
|
|
239
|
+
let progressText = operation;
|
|
240
|
+
if (fileName) {
|
|
241
|
+
progressText += ` - ${fileName}`;
|
|
242
|
+
}
|
|
243
|
+
if (showBytes) {
|
|
244
|
+
if (totalBytes) {
|
|
245
|
+
const percentage = Math.round(bytesProcessed / totalBytes * 100);
|
|
246
|
+
progressText += ` (${prettyBytes(bytesProcessed)}/${prettyBytes(totalBytes)} - ${percentage}%)`;
|
|
247
|
+
} else {
|
|
248
|
+
progressText += ` (${prettyBytes(bytesProcessed)})`;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
spinner.text = progressText;
|
|
252
|
+
},
|
|
253
|
+
updateRate: (bytesPerSecond) => {
|
|
254
|
+
if (showRate) {
|
|
255
|
+
const currentText = spinner.text;
|
|
256
|
+
const rateText = `${prettyBytes(bytesPerSecond)}/s`;
|
|
257
|
+
spinner.text = `${currentText} @ ${rateText}`;
|
|
258
|
+
}
|
|
259
|
+
},
|
|
260
|
+
complete: (message) => {
|
|
261
|
+
const elapsed = Date.now() - startTime;
|
|
262
|
+
const timing = prettyMilliseconds(elapsed, { compact: true });
|
|
263
|
+
const successMessage = message ?? `${operation} completed successfully`;
|
|
264
|
+
spinner.succeed(`${successMessage} (${timing})`);
|
|
265
|
+
},
|
|
266
|
+
error: (error) => {
|
|
267
|
+
const elapsed = Date.now() - startTime;
|
|
268
|
+
const timing = prettyMilliseconds(elapsed, { compact: true });
|
|
269
|
+
const errorMessage = typeof error === "string" ? error : error.message;
|
|
270
|
+
spinner.fail(`${operation} failed: ${errorMessage} (after ${timing})`);
|
|
271
|
+
}
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
export function createMultiStepSpinner(operationName, steps, options) {
|
|
275
|
+
const startTime = Date.now();
|
|
276
|
+
let currentStepIndex = 0;
|
|
277
|
+
const totalSteps = steps.length;
|
|
278
|
+
const getStepText = (stepIndex) => {
|
|
279
|
+
const step = steps[stepIndex];
|
|
280
|
+
return `${operationName} - ${step} (${stepIndex + 1}/${totalSteps})`;
|
|
281
|
+
};
|
|
282
|
+
const spinner = createSpinner({ text: getStepText(0), ...options }).start();
|
|
283
|
+
return {
|
|
284
|
+
spinner,
|
|
285
|
+
nextStep: (stepIndex) => {
|
|
286
|
+
if (stepIndex !== void 0) {
|
|
287
|
+
currentStepIndex = Math.min(stepIndex, totalSteps - 1);
|
|
288
|
+
} else {
|
|
289
|
+
currentStepIndex = Math.min(currentStepIndex + 1, totalSteps - 1);
|
|
290
|
+
}
|
|
291
|
+
spinner.text = getStepText(currentStepIndex);
|
|
292
|
+
},
|
|
293
|
+
complete: (message) => {
|
|
294
|
+
const elapsed = Date.now() - startTime;
|
|
295
|
+
const timing = prettyMilliseconds(elapsed, { compact: true });
|
|
296
|
+
const successMessage = message ?? `${operationName} completed successfully`;
|
|
297
|
+
spinner.succeed(`${successMessage} (${timing})`);
|
|
298
|
+
},
|
|
299
|
+
error: (error, stepIndex) => {
|
|
300
|
+
const elapsed = Date.now() - startTime;
|
|
301
|
+
const timing = prettyMilliseconds(elapsed, { compact: true });
|
|
302
|
+
const errorMessage = typeof error === "string" ? error : error.message;
|
|
303
|
+
const stepInfo = stepIndex !== void 0 ? ` at step ${stepIndex + 1}` : "";
|
|
304
|
+
spinner.fail(`${operationName} failed${stepInfo}: ${errorMessage} (after ${timing})`);
|
|
305
|
+
},
|
|
306
|
+
getCurrentStep: () => currentStepIndex
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
export function formatSpinnerTiming(startTime, options) {
|
|
310
|
+
const elapsed = Date.now() - startTime;
|
|
311
|
+
return prettyMilliseconds(elapsed, {
|
|
312
|
+
compact: !options?.verbose,
|
|
313
|
+
verbose: options?.verbose
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
export function formatSpinnerBytes(bytes, options) {
|
|
317
|
+
return prettyBytes(bytes, options);
|
|
318
|
+
}
|
|
319
|
+
export function formatSpinnerElapsed(elapsed, options) {
|
|
320
|
+
return prettyMilliseconds(elapsed, {
|
|
321
|
+
compact: !options?.verbose,
|
|
322
|
+
verbose: options?.verbose
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
export function createTransferSpinner(operation, options) {
|
|
326
|
+
const { totalBytes, showRate = true, ...spinnerOptions } = options ?? {};
|
|
327
|
+
const startTime = Date.now();
|
|
328
|
+
const spinner = createSpinner({ text: operation, ...spinnerOptions }).start();
|
|
329
|
+
return {
|
|
330
|
+
spinner,
|
|
331
|
+
updateBytes: (bytesTransferred, fileName) => {
|
|
332
|
+
let text = operation;
|
|
333
|
+
if (fileName) {
|
|
334
|
+
text += ` - ${fileName}`;
|
|
335
|
+
}
|
|
336
|
+
if (totalBytes) {
|
|
337
|
+
const percentage = Math.round(bytesTransferred / totalBytes * 100);
|
|
338
|
+
text += ` (${prettyBytes(bytesTransferred)}/${prettyBytes(totalBytes)} - ${percentage}%)`;
|
|
339
|
+
} else {
|
|
340
|
+
text += ` (${prettyBytes(bytesTransferred)})`;
|
|
341
|
+
}
|
|
342
|
+
spinner.text = text;
|
|
343
|
+
},
|
|
344
|
+
updateRate: (bytesPerSecond) => {
|
|
345
|
+
if (showRate) {
|
|
346
|
+
const currentText = spinner.text;
|
|
347
|
+
const rateText = `${prettyBytes(bytesPerSecond)}/s`;
|
|
348
|
+
spinner.text = `${currentText} @ ${rateText}`;
|
|
349
|
+
}
|
|
350
|
+
},
|
|
351
|
+
complete: (message, totalBytesTransferred) => {
|
|
352
|
+
const elapsed = Date.now() - startTime;
|
|
353
|
+
const timing = prettyMilliseconds(elapsed, { compact: true });
|
|
354
|
+
let successMessage = message ?? `${operation} completed successfully`;
|
|
355
|
+
if (totalBytesTransferred) {
|
|
356
|
+
successMessage += ` (${prettyBytes(totalBytesTransferred)})`;
|
|
357
|
+
}
|
|
358
|
+
successMessage += ` in ${timing}`;
|
|
359
|
+
spinner.succeed(successMessage);
|
|
360
|
+
},
|
|
361
|
+
error: (error) => {
|
|
362
|
+
const elapsed = Date.now() - startTime;
|
|
363
|
+
const timing = prettyMilliseconds(elapsed, { compact: true });
|
|
364
|
+
const errorMessage = typeof error === "string" ? error : error.message;
|
|
365
|
+
spinner.fail(`${operation} failed: ${errorMessage} (after ${timing})`);
|
|
366
|
+
}
|
|
367
|
+
};
|
|
54
368
|
}
|
|
369
|
+
export const spinners = cliSpinners;
|
|
370
|
+
export { randomSpinner, prettyBytes, prettyMilliseconds };
|
package/bin/mod.d.ts
CHANGED
|
@@ -158,8 +158,8 @@ export { createMobileProject, createWebProject } from "./impl/init/use-template/
|
|
|
158
158
|
export { showCloneProjectMenu } from "./impl/init/use-template/cp-modules/cli-main-modules/cli-menu-items/showCloneProjectMenu";
|
|
159
159
|
export { showAnykeyPrompt } from "./impl/init/use-template/cp-modules/cli-main-modules/modules/showAnykeyPrompt";
|
|
160
160
|
export { copyFromExisting, ensureEnvExists, ensureExampleExists, fetchEnvExampleContent, getEnvPath, getLastEnvFilePath, getMissingKeys, promptAndSetMissingValues, saveLastEnvFilePath, } from "./impl/init/use-template/cp-modules/compose-env-file/cef-impl";
|
|
161
|
-
export type { KeyType, KnownService, } from "./impl/init/use-template/cp-modules/compose-env-file/cef-keys";
|
|
162
|
-
export {
|
|
161
|
+
export type { DashboardUrl, DefaultValue, KeyType, KeyVar, KnownService, ServiceKey, } from "./impl/init/use-template/cp-modules/compose-env-file/cef-keys";
|
|
162
|
+
export { KNOWN_SERVICES } from "./impl/init/use-template/cp-modules/compose-env-file/cef-keys";
|
|
163
163
|
export { composeEnvFile } from "./impl/init/use-template/cp-modules/compose-env-file/cef-mod";
|
|
164
164
|
export { deployProject, selectDeploymentService, } from "./impl/init/use-template/cp-modules/git-deploy-prompts/deploy";
|
|
165
165
|
export { configureGithubRepo, handleGitInit, promptGitDeploy, } from "./impl/init/use-template/cp-modules/git-deploy-prompts/gdp-mod";
|
|
@@ -408,14 +408,14 @@ export { getOrCreateReliverseMemory, updateReliverseMemory } from "./impl/utils/
|
|
|
408
408
|
export type { ReplaceConfig } from "./impl/utils/replacements/reps-impl";
|
|
409
409
|
export { extractRepoInfo, replaceStringsInFiles } from "./impl/utils/replacements/reps-impl";
|
|
410
410
|
export type { Hardcoded, UrlPatterns } from "./impl/utils/replacements/reps-keys";
|
|
411
|
-
export { CommonPatterns, HardcodedStrings,
|
|
411
|
+
export { CommonPatterns, HardcodedStrings, } from "./impl/utils/replacements/reps-keys";
|
|
412
412
|
export { handleReplacements } from "./impl/utils/replacements/reps-mod";
|
|
413
413
|
export { resolveAllCrossLibs } from "./impl/utils/resolve-cross-libs";
|
|
414
|
-
export type { EncryptedDataMemory, ReliverseMemory, UserDataMemory, } from "./impl/utils/schemaMemory";
|
|
415
|
-
export { memorySchema } from "./impl/utils/schemaMemory";
|
|
414
|
+
export type { EncryptedDataMemory, EncryptedDataMemoryShape, ReliverseMemory, UserDataMemory, UserDataMemoryShape, } from "./impl/utils/schemaMemory";
|
|
416
415
|
export type { RepoInfo, ReposConfig } from "./impl/utils/schemaTemplate";
|
|
417
|
-
export { DEFAULT_REPOS_CONFIG, generateReposJsonSchema,
|
|
418
|
-
export {
|
|
416
|
+
export { DEFAULT_REPOS_CONFIG, generateReposJsonSchema, isReposConfig, shouldRegenerateSchema, } from "./impl/utils/schemaTemplate";
|
|
417
|
+
export type { FileProgressOptions, SimpleSpinner, SpinnerGroupOptions, SpinnerOptions, } from "./impl/utils/spinner";
|
|
418
|
+
export { createBuildSpinner, createFileProgressSpinner, createMultiStepSpinner, createSpinner, createSpinnerGroup, createTimedSpinner, createTransferSpinner, defaultSpinnerOptions, formatSpinnerBytes, formatSpinnerElapsed, formatSpinnerTiming, isSpinnerEnabled, isSpinnerRunning, prettyBytes, prettyMilliseconds, randomSpinner, safeStopSpinner, spinners, stopAndPersist, updateSpinnerText, withEnhancedSpinner, withSpinner, withSpinnerPromise, } from "./impl/utils/spinner";
|
|
419
419
|
export { getPkgName, getPkgVersion, readPackageJSON, showEndPrompt, showStartPrompt, } from "./impl/utils/startEndPrompts";
|
|
420
420
|
export { cd, getCurrentWorkingDirectory, handleError, pwd, rm, } from "./impl/utils/terminalHelpers";
|
|
421
421
|
export { setupDevModeIfNeeded } from "./impl/utils/testsRuntime";
|
package/bin/mod.js
CHANGED
|
@@ -380,15 +380,7 @@ export {
|
|
|
380
380
|
promptAndSetMissingValues,
|
|
381
381
|
saveLastEnvFilePath
|
|
382
382
|
} from "./impl/init/use-template/cp-modules/compose-env-file/cef-impl.js";
|
|
383
|
-
export {
|
|
384
|
-
dashboards,
|
|
385
|
-
defaultValues,
|
|
386
|
-
KNOWN_SERVICES,
|
|
387
|
-
keyTypeSchema,
|
|
388
|
-
keyVarsSchema,
|
|
389
|
-
knownServiceSchema,
|
|
390
|
-
serviceKeySchema
|
|
391
|
-
} from "./impl/init/use-template/cp-modules/compose-env-file/cef-keys.js";
|
|
383
|
+
export { KNOWN_SERVICES } from "./impl/init/use-template/cp-modules/compose-env-file/cef-keys.js";
|
|
392
384
|
export { composeEnvFile } from "./impl/init/use-template/cp-modules/compose-env-file/cef-mod.js";
|
|
393
385
|
export {
|
|
394
386
|
deployProject,
|
|
@@ -970,21 +962,41 @@ export { getOrCreateReliverseMemory, updateReliverseMemory } from "./impl/utils/
|
|
|
970
962
|
export { extractRepoInfo, replaceStringsInFiles } from "./impl/utils/replacements/reps-impl.js";
|
|
971
963
|
export {
|
|
972
964
|
CommonPatterns,
|
|
973
|
-
HardcodedStrings
|
|
974
|
-
hardcodedSchema,
|
|
975
|
-
urlPatternsSchema
|
|
965
|
+
HardcodedStrings
|
|
976
966
|
} from "./impl/utils/replacements/reps-keys.js";
|
|
977
967
|
export { handleReplacements } from "./impl/utils/replacements/reps-mod.js";
|
|
978
968
|
export { resolveAllCrossLibs } from "./impl/utils/resolve-cross-libs.js";
|
|
979
|
-
export { memorySchema } from "./impl/utils/schemaMemory.js";
|
|
980
969
|
export {
|
|
981
970
|
DEFAULT_REPOS_CONFIG,
|
|
982
971
|
generateReposJsonSchema,
|
|
983
|
-
|
|
984
|
-
reposSchema,
|
|
972
|
+
isReposConfig,
|
|
985
973
|
shouldRegenerateSchema
|
|
986
974
|
} from "./impl/utils/schemaTemplate.js";
|
|
987
|
-
export {
|
|
975
|
+
export {
|
|
976
|
+
createBuildSpinner,
|
|
977
|
+
createFileProgressSpinner,
|
|
978
|
+
createMultiStepSpinner,
|
|
979
|
+
createSpinner,
|
|
980
|
+
createSpinnerGroup,
|
|
981
|
+
createTimedSpinner,
|
|
982
|
+
createTransferSpinner,
|
|
983
|
+
defaultSpinnerOptions,
|
|
984
|
+
formatSpinnerBytes,
|
|
985
|
+
formatSpinnerElapsed,
|
|
986
|
+
formatSpinnerTiming,
|
|
987
|
+
isSpinnerEnabled,
|
|
988
|
+
isSpinnerRunning,
|
|
989
|
+
prettyBytes,
|
|
990
|
+
prettyMilliseconds,
|
|
991
|
+
randomSpinner,
|
|
992
|
+
safeStopSpinner,
|
|
993
|
+
spinners,
|
|
994
|
+
stopAndPersist,
|
|
995
|
+
updateSpinnerText,
|
|
996
|
+
withEnhancedSpinner,
|
|
997
|
+
withSpinner,
|
|
998
|
+
withSpinnerPromise
|
|
999
|
+
} from "./impl/utils/spinner.js";
|
|
988
1000
|
export {
|
|
989
1001
|
getPkgName,
|
|
990
1002
|
getPkgVersion,
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"@babel/preset-typescript": "^7.27.1",
|
|
6
6
|
"@hookform/resolvers": "^5.2.1",
|
|
7
7
|
"@libsql/client": "^0.15.14",
|
|
8
|
-
"@mendable/firecrawl-js": "^3.
|
|
8
|
+
"@mendable/firecrawl-js": "^3.3.0",
|
|
9
9
|
"@mrleebo/prisma-ast": "^0.13.0",
|
|
10
10
|
"@octokit/plugin-rest-endpoint-methods": "^16.0.0",
|
|
11
11
|
"@octokit/request-error": "^7.0.0",
|
|
@@ -27,13 +27,12 @@
|
|
|
27
27
|
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
28
28
|
"@rollup/plugin-replace": "^6.0.2",
|
|
29
29
|
"@rollup/pluginutils": "^5.2.0",
|
|
30
|
-
"@sinclair/typebox": "^0.34.40",
|
|
31
30
|
"@uploadcare/upload-client": "^6.17.0",
|
|
32
31
|
"@vercel/sdk": "^1.10.6",
|
|
33
32
|
"@volar/typescript": "^2.4.23",
|
|
34
33
|
"@vue/language-core": "^3.0.6",
|
|
35
34
|
"@vue/language-core2.0": "npm:@vue/language-core@2.0.29",
|
|
36
|
-
"ai": "^5.0.
|
|
35
|
+
"ai": "^5.0.26",
|
|
37
36
|
"async-listen": "^3.1.0",
|
|
38
37
|
"autoprefixer": "^10.4.21",
|
|
39
38
|
"better-auth": "^1.3.7",
|
|
@@ -84,7 +83,7 @@
|
|
|
84
83
|
"postcss": "^8.5.6",
|
|
85
84
|
"postcss-nested": "^7.0.2",
|
|
86
85
|
"postgres": "^3.4.7",
|
|
87
|
-
"posthog-node": "^5.8.
|
|
86
|
+
"posthog-node": "^5.8.1",
|
|
88
87
|
"pretty-bytes": "^7.0.1",
|
|
89
88
|
"pretty-ms": "^9.2.0",
|
|
90
89
|
"querystring": "^0.2.1",
|
|
@@ -94,7 +93,7 @@
|
|
|
94
93
|
"react-hook-form": "^7.62.0",
|
|
95
94
|
"registry-auth-token": "^5.1.0",
|
|
96
95
|
"registry-url": "^7.2.0",
|
|
97
|
-
"rollup": "^4.
|
|
96
|
+
"rollup": "^4.49.0",
|
|
98
97
|
"rollup-plugin-dts": "^6.2.3",
|
|
99
98
|
"sass": "^1.91.0",
|
|
100
99
|
"scule": "^1.3.0",
|
|
@@ -124,7 +123,7 @@
|
|
|
124
123
|
"license": "MIT",
|
|
125
124
|
"name": "@reliverse/dler",
|
|
126
125
|
"type": "module",
|
|
127
|
-
"version": "1.7.
|
|
126
|
+
"version": "1.7.123",
|
|
128
127
|
"author": "reliverse",
|
|
129
128
|
"bugs": {
|
|
130
129
|
"email": "blefnk@gmail.com",
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generates a JSON schema file from the TypeBox schema
|
|
3
|
-
*/
|
|
4
|
-
export declare function generateJsonSchema(typeboxSchema: any, outputPath: string): Promise<void>;
|
|
5
|
-
/**
|
|
6
|
-
* Generates the schema.json in the project root
|
|
7
|
-
*/
|
|
8
|
-
export declare function generateSchemaFile(schema: any): Promise<void>;
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import path from "@reliverse/pathkit";
|
|
2
|
-
import fs from "@reliverse/relifso";
|
|
3
|
-
function convertTypeBoxToJsonSchema(schema) {
|
|
4
|
-
if (!schema || typeof schema !== "object") return schema;
|
|
5
|
-
if (schema.type === "string" && schema.enum) {
|
|
6
|
-
return {
|
|
7
|
-
type: "string",
|
|
8
|
-
enum: schema.enum
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
if (schema.anyOf || schema.allOf || schema.oneOf) {
|
|
12
|
-
const variants = schema.anyOf || schema.allOf || schema.oneOf;
|
|
13
|
-
const allLiterals = variants.every((v) => v.const !== void 0);
|
|
14
|
-
if (allLiterals) {
|
|
15
|
-
return {
|
|
16
|
-
type: "string",
|
|
17
|
-
enum: variants.map((v) => v.const)
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
if (schema.type === "object") {
|
|
22
|
-
const result = {
|
|
23
|
-
type: "object",
|
|
24
|
-
properties: {}
|
|
25
|
-
};
|
|
26
|
-
if (schema.required) {
|
|
27
|
-
result.required = schema.required;
|
|
28
|
-
}
|
|
29
|
-
if (schema.properties) {
|
|
30
|
-
for (const [key, value] of Object.entries(schema.properties)) {
|
|
31
|
-
result.properties[key] = convertTypeBoxToJsonSchema(value);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
if (schema.additionalProperties) {
|
|
35
|
-
result.additionalProperties = convertTypeBoxToJsonSchema(schema.additionalProperties);
|
|
36
|
-
}
|
|
37
|
-
if (schema.patternProperties) {
|
|
38
|
-
result.patternProperties = {};
|
|
39
|
-
for (const [pattern, value] of Object.entries(schema.patternProperties)) {
|
|
40
|
-
result.patternProperties[pattern] = convertTypeBoxToJsonSchema(value);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
return result;
|
|
44
|
-
}
|
|
45
|
-
if (schema.type === "array") {
|
|
46
|
-
return {
|
|
47
|
-
type: "array",
|
|
48
|
-
items: convertTypeBoxToJsonSchema(schema.items)
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
if (schema.type) {
|
|
52
|
-
const result = { type: schema.type };
|
|
53
|
-
if (schema.minimum !== void 0) result.minimum = schema.minimum;
|
|
54
|
-
if (schema.maximum !== void 0) result.maximum = schema.maximum;
|
|
55
|
-
if (schema.minLength !== void 0) result.minLength = schema.minLength;
|
|
56
|
-
if (schema.maxLength !== void 0) result.maxLength = schema.maxLength;
|
|
57
|
-
if (schema.pattern !== void 0) result.pattern = schema.pattern;
|
|
58
|
-
if (schema.format !== void 0) result.format = schema.format;
|
|
59
|
-
if (schema.default !== void 0) result.default = schema.default;
|
|
60
|
-
return result;
|
|
61
|
-
}
|
|
62
|
-
return schema;
|
|
63
|
-
}
|
|
64
|
-
export async function generateJsonSchema(typeboxSchema, outputPath) {
|
|
65
|
-
const converted = convertTypeBoxToJsonSchema(typeboxSchema);
|
|
66
|
-
const schema = {
|
|
67
|
-
$schema: "http://json-schema.org/draft-07/schema#",
|
|
68
|
-
title: "rse configuration schema",
|
|
69
|
-
description: "https://docs.reliverse.org",
|
|
70
|
-
type: "object",
|
|
71
|
-
properties: converted.properties,
|
|
72
|
-
required: converted.required
|
|
73
|
-
};
|
|
74
|
-
await fs.writeFile(outputPath, JSON.stringify(schema, null, 2));
|
|
75
|
-
}
|
|
76
|
-
export async function generateSchemaFile(schema) {
|
|
77
|
-
const schemaPath = path.join(process.cwd(), "schema.json");
|
|
78
|
-
if (fs.existsSync(schemaPath)) {
|
|
79
|
-
await fs.remove(schemaPath);
|
|
80
|
-
}
|
|
81
|
-
await generateJsonSchema(schema, schemaPath);
|
|
82
|
-
}
|