veryfront 0.1.1021 → 0.1.1022
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/esm/cli/commands/open/command-help.d.ts.map +1 -1
- package/esm/cli/commands/open/command-help.js +5 -0
- package/esm/cli/commands/pull/command-help.d.ts.map +1 -1
- package/esm/cli/commands/pull/command-help.js +7 -1
- package/esm/cli/commands/pull/command.d.ts.map +1 -1
- package/esm/cli/commands/pull/command.js +106 -15
- package/esm/cli/commands/push/command-help.d.ts.map +1 -1
- package/esm/cli/commands/push/command-help.js +5 -0
- package/esm/cli/shared/args.d.ts.map +1 -1
- package/esm/cli/shared/args.js +4 -0
- package/esm/cli/shared/types.d.ts +1 -1
- package/esm/cli/shared/types.d.ts.map +1 -1
- package/esm/cli/utils/index.d.ts +4 -0
- package/esm/cli/utils/index.d.ts.map +1 -1
- package/esm/cli/utils/index.js +11 -3
- package/esm/deno.js +1 -1
- package/esm/src/utils/version-constant.d.ts +1 -1
- package/esm/src/utils/version-constant.js +1 -1
- package/package.json +4 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-help.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/open/command-help.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,eAAO,MAAM,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"command-help.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/open/command-help.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,eAAO,MAAM,QAAQ,EAAE,WAqBtB,CAAC"}
|
|
@@ -4,12 +4,17 @@ export const openHelp = {
|
|
|
4
4
|
description: "Open project URLs in the browser",
|
|
5
5
|
usage: "veryfront open [options]",
|
|
6
6
|
options: [
|
|
7
|
+
{
|
|
8
|
+
flag: "-p, --project-slug <slug>",
|
|
9
|
+
description: "Project slug to open (overrides inferred project)",
|
|
10
|
+
},
|
|
7
11
|
{ flag: "--env <name>", description: "Open a specific environment URL" },
|
|
8
12
|
{ flag: "--studio", description: "Open Veryfront Studio" },
|
|
9
13
|
{ flag: "--json", description: "Output URL as JSON instead of opening" },
|
|
10
14
|
],
|
|
11
15
|
examples: [
|
|
12
16
|
"veryfront open",
|
|
17
|
+
"veryfront open -p my-project",
|
|
13
18
|
"veryfront open --env staging",
|
|
14
19
|
"veryfront open --studio",
|
|
15
20
|
"veryfront open --json",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-help.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/pull/command-help.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,eAAO,MAAM,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"command-help.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/pull/command-help.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,eAAO,MAAM,QAAQ,EAAE,WA2DtB,CAAC"}
|
|
@@ -2,8 +2,12 @@ export const pullHelp = {
|
|
|
2
2
|
name: "pull",
|
|
3
3
|
category: "deploy",
|
|
4
4
|
description: "Download project files from Veryfront remote",
|
|
5
|
-
usage: "veryfront pull [options]",
|
|
5
|
+
usage: "veryfront pull [project-slug] [options]",
|
|
6
6
|
options: [
|
|
7
|
+
{
|
|
8
|
+
flag: "-p, --project-slug <slug>",
|
|
9
|
+
description: "Project slug to pull (overrides inferred project)",
|
|
10
|
+
},
|
|
7
11
|
{
|
|
8
12
|
flag: "--projects <slugs>",
|
|
9
13
|
description: "Comma-separated list of project slugs to pull",
|
|
@@ -35,6 +39,8 @@ export const pullHelp = {
|
|
|
35
39
|
],
|
|
36
40
|
examples: [
|
|
37
41
|
"veryfront pull",
|
|
42
|
+
"veryfront pull veryfront-based-38c7d03a",
|
|
43
|
+
"veryfront pull -p veryfront-based-38c7d03a --dir ./veryfront-based",
|
|
38
44
|
"veryfront pull --dir ./my-project",
|
|
39
45
|
"veryfront pull --branch feature-header",
|
|
40
46
|
"veryfront pull --env production",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/pull/command.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AAM3E,OAAO,EACL,eAAe,EAIhB,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/pull/command.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AAM3E,OAAO,EACL,eAAe,EAIhB,MAAM,wBAAwB,CAAC;AAgBhC;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;GAY7B,CAAC;AAEF,eAAO,MAAM,cAAc;;;;;;;;;;GAAgC,CAAC;AAE5D,MAAM,MAAM,QAAQ,GAAG,WAAW,CAAC,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC,CAAC;AAEzE;;GAEG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;GAUxB,CAAC;AAEH;;GAEG;AACH,MAAM,MAAM,UAAU,GAClB;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAChB;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAChC;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACrC;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAEzC;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,gCAAgC;IAChC,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,EACZ,MAAM,EAAE,UAAU,GACjB,OAAO,CAAC,MAAM,CAAC,CAQjB;AAwND;;GAEG;AACH,wBAAgB,WAAW,CAAC,OAAO,GAAE,WAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CA8IpE"}
|
|
@@ -13,9 +13,11 @@ import { resolveCliApiUrl } from "../../shared/constants.js";
|
|
|
13
13
|
import { cwd } from "../../../src/platform/index.js";
|
|
14
14
|
import { createFileSystem } from "../../../src/platform/index.js";
|
|
15
15
|
import { createApiClient, readConfigFile, resolveConfigWithAuth, } from "../../shared/config.js";
|
|
16
|
-
import { confirmPrompt, logInfo, logSuccess, logWarning } from "../../utils/index.js";
|
|
16
|
+
import { confirmPrompt, isTTY, logInfo, logSuccess, logWarning } from "../../utils/index.js";
|
|
17
17
|
import { createNoopSpinner, createSpinner } from "../../ui/index.js";
|
|
18
|
+
import { isInteractive } from "../../shared/interactive.js";
|
|
18
19
|
import { getApiTokenEnv, getEnvironmentConfig } from "../../../src/config/index.js";
|
|
20
|
+
import { ERROR_REGISTRY, getErrorBySlug, INVALID_ARGUMENT, RESOURCE_NOT_FOUND, VeryfrontError, } from "../../../src/errors/index.js";
|
|
19
21
|
import { withSpan } from "../../../src/observability/tracing/otlp-setup.js";
|
|
20
22
|
import { CommonArgs, createArgParser } from "../../shared/args.js";
|
|
21
23
|
/**
|
|
@@ -195,6 +197,41 @@ function formatPullSource(source) {
|
|
|
195
197
|
return "main";
|
|
196
198
|
}
|
|
197
199
|
}
|
|
200
|
+
function describeError(error) {
|
|
201
|
+
return error instanceof Error ? error.message : String(error);
|
|
202
|
+
}
|
|
203
|
+
function errorStatus(error) {
|
|
204
|
+
const status = error?.status;
|
|
205
|
+
return typeof status === "number" ? status : undefined;
|
|
206
|
+
}
|
|
207
|
+
function errorSlug(error) {
|
|
208
|
+
const slug = error?.slug;
|
|
209
|
+
return typeof slug === "string" ? slug : undefined;
|
|
210
|
+
}
|
|
211
|
+
function pullProjectListError(projectSlug, sourceLabel, error) {
|
|
212
|
+
const message = [
|
|
213
|
+
`Failed to list files for project "${projectSlug}" from ${sourceLabel}: ${describeError(error)}.`,
|
|
214
|
+
"Check that the project slug is exact, the selected branch/env/release exists, and your token has access.",
|
|
215
|
+
].join(" ");
|
|
216
|
+
const status = errorStatus(error);
|
|
217
|
+
if (status === 404) {
|
|
218
|
+
return RESOURCE_NOT_FOUND.create({ detail: message, cause: error, status });
|
|
219
|
+
}
|
|
220
|
+
const wrapped = new Error(message, { cause: error });
|
|
221
|
+
if (typeof status === "number") {
|
|
222
|
+
wrapped.status = status;
|
|
223
|
+
}
|
|
224
|
+
return wrapped;
|
|
225
|
+
}
|
|
226
|
+
async function confirmPullWrite(projectDir) {
|
|
227
|
+
if (isInteractive() && !isTTY()) {
|
|
228
|
+
throw INVALID_ARGUMENT.create({
|
|
229
|
+
detail: `Pull requires confirmation before writing files, but no interactive prompt is available. ` +
|
|
230
|
+
`Re-run with --force to write into ${projectDir} without prompting.`,
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
return await confirmPrompt(`This will overwrite local files in ${projectDir}. Continue?`, false);
|
|
234
|
+
}
|
|
198
235
|
async function pullSingleProject(projectSlug, projectDir, source, force, dryRun, config, quiet = false) {
|
|
199
236
|
const sourceLabel = formatPullSource(source);
|
|
200
237
|
let spinner = quiet
|
|
@@ -205,13 +242,16 @@ async function pullSingleProject(projectSlug, projectDir, source, force, dryRun,
|
|
|
205
242
|
try {
|
|
206
243
|
files = await listAllFiles(client, projectSlug, source);
|
|
207
244
|
}
|
|
245
|
+
catch (error) {
|
|
246
|
+
throw pullProjectListError(projectSlug, sourceLabel, error);
|
|
247
|
+
}
|
|
208
248
|
finally {
|
|
209
249
|
spinner.stop();
|
|
210
250
|
}
|
|
211
251
|
if (files.length === 0) {
|
|
212
252
|
if (!quiet)
|
|
213
253
|
logInfo(`No files to pull from ${projectSlug}.`);
|
|
214
|
-
return { written: 0, skipped: 0 };
|
|
254
|
+
return { written: 0, skipped: 0, cancelled: false };
|
|
215
255
|
}
|
|
216
256
|
const writeOps = [];
|
|
217
257
|
for (const file of files) {
|
|
@@ -227,10 +267,10 @@ async function pullSingleProject(projectSlug, projectDir, source, force, dryRun,
|
|
|
227
267
|
cliLogger.info(`\nFound ${files.length} files to ${dryRun ? "pull" : "write"} from ${projectSlug}.`);
|
|
228
268
|
}
|
|
229
269
|
if (!force && !dryRun) {
|
|
230
|
-
const confirmed = await
|
|
270
|
+
const confirmed = await confirmPullWrite(projectDir);
|
|
231
271
|
if (!confirmed) {
|
|
232
272
|
cliLogger.info("Pull cancelled.");
|
|
233
|
-
return { written: 0, skipped: 0 };
|
|
273
|
+
return { written: 0, skipped: 0, cancelled: true };
|
|
234
274
|
}
|
|
235
275
|
}
|
|
236
276
|
spinner = quiet ? createNoopSpinner() : createSpinner(`Writing files to ${projectDir}...`);
|
|
@@ -246,7 +286,31 @@ async function pullSingleProject(projectSlug, projectDir, source, force, dryRun,
|
|
|
246
286
|
logWarning(`Skipped ${result.skipped} files due to errors.`);
|
|
247
287
|
}
|
|
248
288
|
}
|
|
249
|
-
return result;
|
|
289
|
+
return { ...result, cancelled: false };
|
|
290
|
+
}
|
|
291
|
+
function formatProjectCount(count) {
|
|
292
|
+
return `${count} project${count === 1 ? "" : "s"}`;
|
|
293
|
+
}
|
|
294
|
+
function failedProjectsDetail(failedProjects) {
|
|
295
|
+
const names = failedProjects.map(({ project }) => project).join(", ");
|
|
296
|
+
const details = failedProjects.map(({ project, message }) => `${project}: ${message}`).join(" ");
|
|
297
|
+
return `Failed to pull ${formatProjectCount(failedProjects.length)}: ${names}. ${details}`;
|
|
298
|
+
}
|
|
299
|
+
function isErrorSlug(slug) {
|
|
300
|
+
return typeof slug === "string" && slug in ERROR_REGISTRY;
|
|
301
|
+
}
|
|
302
|
+
function structuredFailureAggregate(failedProjects, detail) {
|
|
303
|
+
if (failedProjects.length === 1) {
|
|
304
|
+
const error = failedProjects[0]?.error;
|
|
305
|
+
if (error instanceof VeryfrontError)
|
|
306
|
+
return error;
|
|
307
|
+
}
|
|
308
|
+
const slug = failedProjects[0]?.slug;
|
|
309
|
+
if (!isErrorSlug(slug))
|
|
310
|
+
return null;
|
|
311
|
+
if (!failedProjects.every((failure) => failure.slug === slug))
|
|
312
|
+
return null;
|
|
313
|
+
return getErrorBySlug(slug).create({ detail });
|
|
250
314
|
}
|
|
251
315
|
/**
|
|
252
316
|
* Pull files from Veryfront API
|
|
@@ -285,23 +349,30 @@ export function pullCommand(options = {}) {
|
|
|
285
349
|
await pullSingleProject(config.projectSlug, projectDir, source, force, dryRun, config, quiet);
|
|
286
350
|
return;
|
|
287
351
|
}
|
|
288
|
-
const fs = createFileSystem();
|
|
289
352
|
let totalWritten = 0;
|
|
290
|
-
let
|
|
353
|
+
let totalSkippedFiles = 0;
|
|
354
|
+
const failedProjects = [];
|
|
355
|
+
const cancelledProjects = [];
|
|
291
356
|
for (const project of projects) {
|
|
292
357
|
const targetDir = join(projectDir, project);
|
|
293
|
-
if (!dryRun)
|
|
294
|
-
await fs.mkdir(targetDir, { recursive: true });
|
|
295
358
|
if (!quiet)
|
|
296
359
|
cliLogger.info(`\n--- Pulling ${project} into ${targetDir} ---`);
|
|
297
360
|
try {
|
|
298
361
|
const result = await pullSingleProject(project, targetDir, source, force, dryRun, config, quiet);
|
|
299
362
|
totalWritten += result.written;
|
|
300
|
-
|
|
363
|
+
totalSkippedFiles += result.skipped;
|
|
364
|
+
if (result.cancelled)
|
|
365
|
+
cancelledProjects.push(project);
|
|
301
366
|
}
|
|
302
367
|
catch (error) {
|
|
303
|
-
cliLogger.error(`Failed to pull ${project}
|
|
304
|
-
|
|
368
|
+
cliLogger.error(`Failed to pull ${project}: ${describeError(error)}`);
|
|
369
|
+
failedProjects.push({
|
|
370
|
+
project,
|
|
371
|
+
message: describeError(error),
|
|
372
|
+
status: errorStatus(error),
|
|
373
|
+
slug: errorSlug(error),
|
|
374
|
+
error,
|
|
375
|
+
});
|
|
305
376
|
}
|
|
306
377
|
}
|
|
307
378
|
if (!quiet) {
|
|
@@ -309,11 +380,31 @@ export function pullCommand(options = {}) {
|
|
|
309
380
|
if (dryRun) {
|
|
310
381
|
logInfo(`Dry run complete. Would write ${totalWritten} files total across ${projects.length} projects.`);
|
|
311
382
|
}
|
|
312
|
-
else {
|
|
383
|
+
else if (totalWritten > 0) {
|
|
313
384
|
logSuccess(`Pulled ${totalWritten} files total across ${projects.length} projects.`);
|
|
314
|
-
if (totalSkipped > 0)
|
|
315
|
-
logWarning(`Skipped ${totalSkipped} files due to errors.`);
|
|
316
385
|
}
|
|
386
|
+
else {
|
|
387
|
+
logInfo(`No files were pulled across ${projects.length} projects.`);
|
|
388
|
+
}
|
|
389
|
+
if (cancelledProjects.length > 0) {
|
|
390
|
+
logWarning(`Cancelled ${formatProjectCount(cancelledProjects.length)}: ${cancelledProjects.join(", ")}.`);
|
|
391
|
+
}
|
|
392
|
+
if (failedProjects.length > 0) {
|
|
393
|
+
logWarning(`Failed to pull ${formatProjectCount(failedProjects.length)}: ${failedProjects.map(({ project }) => project).join(", ")}.`);
|
|
394
|
+
}
|
|
395
|
+
if (totalSkippedFiles > 0) {
|
|
396
|
+
logWarning(`Skipped ${totalSkippedFiles} files due to write errors.`);
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
if (failedProjects.length > 0) {
|
|
400
|
+
const detail = failedProjectsDetail(failedProjects);
|
|
401
|
+
if (failedProjects.every((failure) => failure.slug === "resource-not-found" || failure.status === 404)) {
|
|
402
|
+
throw RESOURCE_NOT_FOUND.create({ detail });
|
|
403
|
+
}
|
|
404
|
+
const structuredError = structuredFailureAggregate(failedProjects, detail);
|
|
405
|
+
if (structuredError)
|
|
406
|
+
throw structuredError;
|
|
407
|
+
throw new Error(detail);
|
|
317
408
|
}
|
|
318
409
|
}, { "cli.dryRun": options.dryRun ?? false, "cli.source_type": source.type });
|
|
319
410
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-help.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/push/command-help.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,eAAO,MAAM,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"command-help.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/push/command-help.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,eAAO,MAAM,QAAQ,EAAE,WAyCtB,CAAC"}
|
|
@@ -8,6 +8,10 @@ export const pushHelp = {
|
|
|
8
8
|
flag: "-d, --dir <path>",
|
|
9
9
|
description: "Source directory (default: current directory)",
|
|
10
10
|
},
|
|
11
|
+
{
|
|
12
|
+
flag: "-p, --project-slug <slug>",
|
|
13
|
+
description: "Project slug to push to (overrides inferred project)",
|
|
14
|
+
},
|
|
11
15
|
{
|
|
12
16
|
flag: "-b, --branch <name>",
|
|
13
17
|
description: "Branch name (default: cli/push-<timestamp>, use 'main' for direct push)",
|
|
@@ -23,6 +27,7 @@ export const pushHelp = {
|
|
|
23
27
|
],
|
|
24
28
|
examples: [
|
|
25
29
|
"veryfront push",
|
|
30
|
+
"veryfront push -p my-project",
|
|
26
31
|
"veryfront push --dir ./my-project",
|
|
27
32
|
"veryfront push --branch feature-header",
|
|
28
33
|
"veryfront push --branch main # Push directly to main",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"args.d.ts","sourceRoot":"","sources":["../../../src/cli/shared/args.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AACnE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C,gFAAgF;AAChF,MAAM,MAAM,eAAe,CAAC,CAAC,IACzB;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,CAAC,CAAC;IAAC,KAAK,CAAC,EA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ChB,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,GAChB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAWzB;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAC/B,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,EACjB,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,GAChB,CAAC,IAAI,EAAE,UAAU,KAAK,eAAe,CAAC,CAAC,CAAC,CAU1C;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAChC,MAAM,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,eAAe,CAAC,CAAC,CAAC,EAChD,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,UAAU,GACf,CAAC,CAQH;AAED;;GAEG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAaY,CAAC;AAuFpC,kFAAkF;AAClF,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,UAAU,CAgBvD"}
|
package/esm/cli/shared/args.js
CHANGED
|
@@ -168,10 +168,14 @@ function parse(args, options = {}) {
|
|
|
168
168
|
const next = args[i + 1];
|
|
169
169
|
if (isValue(next)) {
|
|
170
170
|
setValue(key, next);
|
|
171
|
+
if (key !== short)
|
|
172
|
+
setValue(short, next);
|
|
171
173
|
i++;
|
|
172
174
|
continue;
|
|
173
175
|
}
|
|
174
176
|
setValue(key, true);
|
|
177
|
+
if (key !== short)
|
|
178
|
+
setValue(short, true);
|
|
175
179
|
continue;
|
|
176
180
|
}
|
|
177
181
|
result._.push(arg);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/cli/shared/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAExE,eAAO,MAAM,mBAAmB,o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C;IACZ,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,CAAC,CAAC,EAAE,OAAO,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,CAAC,CAAC,EAAE,OAAO,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC;IACb,4DAA4D;IAC5D,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,CAAC,CAAC,EAAE,UAAU,CAAC;IACf,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB"}
|
package/esm/cli/utils/index.d.ts
CHANGED
|
@@ -28,6 +28,10 @@ export declare function promptUser(message: string): Promise<string>;
|
|
|
28
28
|
*/
|
|
29
29
|
export declare function promptPassword(message: string): string;
|
|
30
30
|
export declare function confirmPrompt(message: string, defaultValue?: boolean): Promise<boolean>;
|
|
31
|
+
export declare function ensureConfirmPromptAvailable(options: {
|
|
32
|
+
interactive: boolean;
|
|
33
|
+
stdoutTTY: boolean;
|
|
34
|
+
}): void;
|
|
31
35
|
/** Exit the process with the given code. */
|
|
32
36
|
export declare function exitProcess(code: number): void;
|
|
33
37
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/index.ts"],"names":[],"mappings":"AAwBA,KAAK,YAAY,GAAG,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;AAMjD,eAAO,MAAM,SAAS,EAAE;IACtB,KAAK,EAAE,YAAY,CAAC;IACpB,IAAI,EAAE,YAAY,CAAC;IACnB,IAAI,EAAE,YAAY,CAAC;IACnB,KAAK,EAAE,YAAY,CAAC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,OAAO,CAAC,CAclB;AAED,wBAAgB,4BAA4B,CAAC,OAAO,EAAE;IACpD,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;CACpB,GAAG,IAAI,CAOP;AAED,4CAA4C;AAC5C,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAE9C"}
|
package/esm/cli/utils/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import denoConfig from "../../deno.js";
|
|
2
|
+
import { INVALID_ARGUMENT } from "../../src/errors/index.js";
|
|
2
3
|
import { exit, getEnv, isStdoutTTY, onSignal, promptSync, readStdinByteSync, setRawMode, writeStdout, } from "../../src/platform/index.js";
|
|
3
4
|
import { DEFAULT_DEV_PORT } from "../shared/constants.js";
|
|
4
5
|
import { bold, brand, dim, error as errorColor, muted, shouldUseColor, success as successColor, warning as warningColor, } from "../ui/colors.js";
|
|
@@ -154,10 +155,10 @@ export function promptPassword(message) {
|
|
|
154
155
|
}
|
|
155
156
|
export async function confirmPrompt(message, defaultValue = false) {
|
|
156
157
|
const { isInteractive } = await import("../shared/interactive.js");
|
|
157
|
-
|
|
158
|
+
const interactive = isInteractive();
|
|
159
|
+
if (!interactive)
|
|
158
160
|
return true;
|
|
159
|
-
|
|
160
|
-
return defaultValue;
|
|
161
|
+
ensureConfirmPromptAvailable({ interactive, stdoutTTY: isTTY() });
|
|
161
162
|
const hint = defaultValue ? "[Y/n]" : "[y/N]";
|
|
162
163
|
const response = await promptUser(`${message} ${hint} `);
|
|
163
164
|
if (!response)
|
|
@@ -165,6 +166,13 @@ export async function confirmPrompt(message, defaultValue = false) {
|
|
|
165
166
|
const normalized = response.toLowerCase().trim();
|
|
166
167
|
return normalized === "y" || normalized === "yes";
|
|
167
168
|
}
|
|
169
|
+
export function ensureConfirmPromptAvailable(options) {
|
|
170
|
+
if (!options.interactive || options.stdoutTTY)
|
|
171
|
+
return;
|
|
172
|
+
throw INVALID_ARGUMENT.create({
|
|
173
|
+
detail: "Confirmation required but no interactive prompt is available. Re-run with --yes to confirm without prompting, or use --force when the command supports it.",
|
|
174
|
+
});
|
|
175
|
+
}
|
|
168
176
|
/** Exit the process with the given code. */
|
|
169
177
|
export function exitProcess(code) {
|
|
170
178
|
exit(code);
|
package/esm/deno.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "veryfront",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1022",
|
|
4
4
|
"description": "The simplest way to build AI-powered apps",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -326,7 +326,9 @@
|
|
|
326
326
|
"@types/react": "19.2.14",
|
|
327
327
|
"@types/react-dom": "19.2.3",
|
|
328
328
|
"ws": "8.21.0",
|
|
329
|
-
"@veryfront/ext-bundler-esbuild": "0.1.
|
|
329
|
+
"@veryfront/ext-bundler-esbuild": "0.1.1022",
|
|
330
|
+
"@veryfront/ext-content-mdx": "0.1.1022",
|
|
331
|
+
"@veryfront/ext-css-tailwind": "0.1.1022"
|
|
330
332
|
},
|
|
331
333
|
"devDependencies": {
|
|
332
334
|
"@types/node": "20.9.0"
|