vela 0.12.3 → 0.13.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/bin.js +452 -248
- package/dist/bin.js.map +4 -4
- package/package.json +4 -4
- package/templates/minimal/package.template.json +4 -4
- package/templates/minimal/src/hooks.server.ts +5 -0
- package/templates/minimal/src/lib/server/workflows.ts +172 -0
- package/templates/minimal/src/lib/workflows/README.md +52 -0
package/dist/bin.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
// src/bin.ts
|
|
4
|
-
import
|
|
4
|
+
import process46 from "node:process";
|
|
5
5
|
|
|
6
6
|
// src/lib/argv.ts
|
|
7
7
|
function normalizeArgv(argv) {
|
|
@@ -11,17 +11,17 @@ function normalizeArgv(argv) {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
// src/program.ts
|
|
14
|
-
import
|
|
15
|
-
import * as
|
|
16
|
-
import { Command as
|
|
14
|
+
import process45 from "node:process";
|
|
15
|
+
import * as p67 from "@clack/prompts";
|
|
16
|
+
import { Command as Command114 } from "commander";
|
|
17
17
|
import nodePath from "node:path";
|
|
18
18
|
import dotenv2 from "dotenv";
|
|
19
|
-
import
|
|
19
|
+
import pc42 from "picocolors";
|
|
20
20
|
|
|
21
21
|
// package.json
|
|
22
22
|
var package_default = {
|
|
23
23
|
name: "vela",
|
|
24
|
-
version: "0.
|
|
24
|
+
version: "0.13.1",
|
|
25
25
|
type: "module",
|
|
26
26
|
description: "A CLI for creating and updating SvelteKit projects",
|
|
27
27
|
license: "MIT",
|
|
@@ -57,7 +57,7 @@ var package_default = {
|
|
|
57
57
|
dependencies: {
|
|
58
58
|
"@clack/prompts": "^1.7.0",
|
|
59
59
|
"@faker-js/faker": "^10.6.0",
|
|
60
|
-
"@velastack/patterns": "^0.2.
|
|
60
|
+
"@velastack/patterns": "^0.2.8",
|
|
61
61
|
"@velastack/pocketbase-codegen": "^0.1.0",
|
|
62
62
|
"annotate-json-schema": "^0.1.0",
|
|
63
63
|
commander: "^13.1.0",
|
|
@@ -70,7 +70,7 @@ var package_default = {
|
|
|
70
70
|
"package-manager-detector": "^1.8.0",
|
|
71
71
|
picocolors: "^1.1.1",
|
|
72
72
|
pocketbase: "^0.28.0",
|
|
73
|
-
"pocketbase-server": "^0.
|
|
73
|
+
"pocketbase-server": "^0.40.4",
|
|
74
74
|
stripe: "^19.3.0",
|
|
75
75
|
svelte: "^5.56.10",
|
|
76
76
|
tar: "^7.5.22",
|
|
@@ -86,7 +86,7 @@ var package_default = {
|
|
|
86
86
|
shellcheck: "^4.1.0",
|
|
87
87
|
typescript: "^5.6.0",
|
|
88
88
|
vite: "^8.2.2",
|
|
89
|
-
vitest: "^
|
|
89
|
+
vitest: "^5.0.1"
|
|
90
90
|
},
|
|
91
91
|
peerDependencies: {
|
|
92
92
|
"@sveltejs/kit": "^2.57.1",
|
|
@@ -417,7 +417,8 @@ function detectFeatures(root, { isAppMode, isPaymentsMode }) {
|
|
|
417
417
|
payments: isPaymentsMode,
|
|
418
418
|
blog: hasDep("mdsvex"),
|
|
419
419
|
contentNegotiation: hasDep("sveltekit-negotiate"),
|
|
420
|
-
cms: hasDep("@velastack/cms")
|
|
420
|
+
cms: hasDep("@velastack/cms"),
|
|
421
|
+
workflows: has("src/lib/server/workflows.ts")
|
|
421
422
|
};
|
|
422
423
|
}
|
|
423
424
|
|
|
@@ -1647,7 +1648,11 @@ var VELA_ONLY_FILES = [
|
|
|
1647
1648
|
adds: "the shadcn-svelte config (vega style, lucide icons) that `vela ui add` reads"
|
|
1648
1649
|
},
|
|
1649
1650
|
{ path: ".npmrc", adds: "engine-strict=true" },
|
|
1650
|
-
{ path: ".ignore", adds: "search ignores for generated files" }
|
|
1651
|
+
{ path: ".ignore", adds: "search ignores for generated files" },
|
|
1652
|
+
{
|
|
1653
|
+
path: "vitest.config.ts",
|
|
1654
|
+
adds: "the server test project `vela test:server` runs \u2014 without it test/setup.ts never loads"
|
|
1655
|
+
}
|
|
1651
1656
|
];
|
|
1652
1657
|
var VELA_ONLY_DIRS = ["src/lib/components", "data", "test", "static"];
|
|
1653
1658
|
var bless = new Command2("bless").description("upgrade a vanilla SvelteKit project into a VelaStack project").argument("[path]", "path to the existing SvelteKit project").option("--template <type>", "template to scaffold from", "minimal").option("--email <email>", "email of the admin user").option("--password <password>", "password of the admin user").option("--no-install", "skip installing dependencies").addOption(installOption).option("--skip-routes", "preserve src/routes even if it looks untouched").option("--force-routes", "replace src/routes with the vela template without detection").configureHelp(helpConfig).action((projectPath, rawOpts) => {
|
|
@@ -2666,7 +2671,7 @@ function promptCredentials(options, onCancel2) {
|
|
|
2666
2671
|
}
|
|
2667
2672
|
|
|
2668
2673
|
// src/commands/generate.ts
|
|
2669
|
-
import { Command as
|
|
2674
|
+
import { Command as Command11 } from "commander";
|
|
2670
2675
|
|
|
2671
2676
|
// src/commands/generate/form.ts
|
|
2672
2677
|
import { Command as Command5 } from "commander";
|
|
@@ -2687,7 +2692,7 @@ async function runPattern(slug2, argv, input, report4) {
|
|
|
2687
2692
|
}
|
|
2688
2693
|
checkProviderInput(pattern, argv, input);
|
|
2689
2694
|
const { workspaceRootDir, features } = await getWorkspace();
|
|
2690
|
-
const
|
|
2695
|
+
const log49 = p9.taskLog({ title: report4.task.title });
|
|
2691
2696
|
let result;
|
|
2692
2697
|
try {
|
|
2693
2698
|
result = await pattern.generate({
|
|
@@ -2707,11 +2712,11 @@ async function runPattern(slug2, argv, input, report4) {
|
|
|
2707
2712
|
});
|
|
2708
2713
|
return collections2;
|
|
2709
2714
|
},
|
|
2710
|
-
logger: { info: (message) =>
|
|
2715
|
+
logger: { info: (message) => log49.message(message) }
|
|
2711
2716
|
});
|
|
2712
|
-
|
|
2717
|
+
log49.success(report4.task.success);
|
|
2713
2718
|
} catch (e) {
|
|
2714
|
-
|
|
2719
|
+
log49.error(report4.task.error);
|
|
2715
2720
|
throw e;
|
|
2716
2721
|
}
|
|
2717
2722
|
const rel = (f) => toRelative(workspaceRootDir, f);
|
|
@@ -3253,15 +3258,41 @@ var migration = new Command9("migration").description("generate a migration for
|
|
|
3253
3258
|
)
|
|
3254
3259
|
);
|
|
3255
3260
|
|
|
3261
|
+
// src/commands/generate/workflow.ts
|
|
3262
|
+
import { Command as Command10 } from "commander";
|
|
3263
|
+
var workflow = new Command10("workflow").description("generate a background workflow in src/lib/workflows").argument("<name>", "workflow name, e.g. send-welcome-email").option("--cron <schedule>", 'run on a schedule, e.g. "*/5 * * * *"').allowUnknownOption(true).allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
3264
|
+
(name, options, cmd) => runCommand(
|
|
3265
|
+
() => runPattern(
|
|
3266
|
+
"generate-workflow",
|
|
3267
|
+
[name, ...options.cron ? ["--cron", options.cron] : [], ...cmd.args.slice(1)],
|
|
3268
|
+
{},
|
|
3269
|
+
{
|
|
3270
|
+
summary: `Generated the ${name} workflow.`,
|
|
3271
|
+
nextSteps: [
|
|
3272
|
+
"Fill in the steps in the new file under src/lib/workflows/.",
|
|
3273
|
+
options.cron ? "It starts on its schedule whenever the app is running; `.run()` starts an extra run." : "Start a run from server code with `.run(input)`; runs show up under Workflows in the PocketBase dashboard.",
|
|
3274
|
+
"Run `vela test:server` to run its test."
|
|
3275
|
+
],
|
|
3276
|
+
task: {
|
|
3277
|
+
title: "Generating workflow",
|
|
3278
|
+
success: "Generated workflow",
|
|
3279
|
+
error: "Failed to generate workflow"
|
|
3280
|
+
}
|
|
3281
|
+
}
|
|
3282
|
+
),
|
|
3283
|
+
"Failed to generate workflow."
|
|
3284
|
+
)
|
|
3285
|
+
);
|
|
3286
|
+
|
|
3256
3287
|
// src/commands/generate.ts
|
|
3257
|
-
var generate = new
|
|
3288
|
+
var generate = new Command11("generate").description("generate scaffolding for database models and forms").configureHelp(helpConfig).addCommand(form).addCommand(schema).addCommand(resource).addCommand(scaffold).addCommand(migration).addCommand(workflow);
|
|
3258
3289
|
|
|
3259
3290
|
// src/commands/enable.ts
|
|
3260
|
-
import { Command as
|
|
3291
|
+
import { Command as Command28 } from "commander";
|
|
3261
3292
|
|
|
3262
3293
|
// src/commands/enable/analytics.ts
|
|
3263
|
-
import { Command as
|
|
3264
|
-
var analytics = new
|
|
3294
|
+
import { Command as Command12 } from "commander";
|
|
3295
|
+
var analytics = new Command12("analytics").description("enable web analytics (Plausible, Google Analytics or PostHog)").option("--provider <provider>", "analytics provider: plausible, google or posthog").allowUnknownOption(true).allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
3265
3296
|
(opts, cmd) => runCommand(async () => {
|
|
3266
3297
|
const provider = await resolveProvider("enable-analytics", opts.provider);
|
|
3267
3298
|
const providerEnv = await collectProviderEnv(provider);
|
|
@@ -3291,8 +3322,8 @@ var analytics = new Command11("analytics").description("enable web analytics (Pl
|
|
|
3291
3322
|
);
|
|
3292
3323
|
|
|
3293
3324
|
// src/commands/enable/auth.ts
|
|
3294
|
-
import { Command as
|
|
3295
|
-
var auth = new
|
|
3325
|
+
import { Command as Command13 } from "commander";
|
|
3326
|
+
var auth = new Command13("auth").description("enable authentication (email/password + OAuth scaffold)").allowUnknownOption(true).allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
3296
3327
|
(_opts, cmd) => runCommand(
|
|
3297
3328
|
() => runPattern(
|
|
3298
3329
|
"enable-auth",
|
|
@@ -3317,8 +3348,8 @@ var auth = new Command12("auth").description("enable authentication (email/passw
|
|
|
3317
3348
|
);
|
|
3318
3349
|
|
|
3319
3350
|
// src/commands/enable/api.ts
|
|
3320
|
-
import { Command as
|
|
3321
|
-
var api = new
|
|
3351
|
+
import { Command as Command14 } from "commander";
|
|
3352
|
+
var api = new Command14("api").description("enable the PocketBase REST API").allowUnknownOption(true).allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
3322
3353
|
(_opts, cmd) => runCommand(
|
|
3323
3354
|
() => runPattern(
|
|
3324
3355
|
"enable-api",
|
|
@@ -3343,8 +3374,8 @@ var api = new Command13("api").description("enable the PocketBase REST API").all
|
|
|
3343
3374
|
);
|
|
3344
3375
|
|
|
3345
3376
|
// src/commands/enable/api-keys.ts
|
|
3346
|
-
import { Command as
|
|
3347
|
-
var apiKeys = new
|
|
3377
|
+
import { Command as Command15 } from "commander";
|
|
3378
|
+
var apiKeys = new Command15("api-keys").description("enable API key management").allowUnknownOption(true).allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
3348
3379
|
(_opts, cmd) => runCommand(
|
|
3349
3380
|
() => runPattern(
|
|
3350
3381
|
"enable-api-keys",
|
|
@@ -3369,8 +3400,8 @@ var apiKeys = new Command14("api-keys").description("enable API key management")
|
|
|
3369
3400
|
);
|
|
3370
3401
|
|
|
3371
3402
|
// src/commands/enable/backend.ts
|
|
3372
|
-
import { Command as
|
|
3373
|
-
var backend = new
|
|
3403
|
+
import { Command as Command16 } from "commander";
|
|
3404
|
+
var backend = new Command16("backend").description("enable the PocketBase backend").allowUnknownOption(true).allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
3374
3405
|
(_opts, cmd) => runCommand(
|
|
3375
3406
|
() => runPattern(
|
|
3376
3407
|
"enable-backend",
|
|
@@ -3395,8 +3426,8 @@ var backend = new Command15("backend").description("enable the PocketBase backen
|
|
|
3395
3426
|
);
|
|
3396
3427
|
|
|
3397
3428
|
// src/commands/enable/i18n.ts
|
|
3398
|
-
import { Command as
|
|
3399
|
-
var i18n = new
|
|
3429
|
+
import { Command as Command17 } from "commander";
|
|
3430
|
+
var i18n = new Command17("i18n").description("enable internationalization").allowUnknownOption(true).allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
3400
3431
|
(_opts, cmd) => runCommand(
|
|
3401
3432
|
() => runPattern(
|
|
3402
3433
|
"enable-i18n",
|
|
@@ -3421,8 +3452,8 @@ var i18n = new Command16("i18n").description("enable internationalization").allo
|
|
|
3421
3452
|
);
|
|
3422
3453
|
|
|
3423
3454
|
// src/commands/enable/teams.ts
|
|
3424
|
-
import { Command as
|
|
3425
|
-
var teams = new
|
|
3455
|
+
import { Command as Command18 } from "commander";
|
|
3456
|
+
var teams = new Command18("teams").description("enable team / multi-tenant support").allowUnknownOption(true).allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
3426
3457
|
(_opts, cmd) => runCommand(
|
|
3427
3458
|
() => runPattern(
|
|
3428
3459
|
"enable-teams",
|
|
@@ -3448,10 +3479,10 @@ var teams = new Command17("teams").description("enable team / multi-tenant suppo
|
|
|
3448
3479
|
|
|
3449
3480
|
// src/commands/enable/payments.ts
|
|
3450
3481
|
import process12 from "node:process";
|
|
3451
|
-
import { Command as
|
|
3482
|
+
import { Command as Command19 } from "commander";
|
|
3452
3483
|
import * as p17 from "@clack/prompts";
|
|
3453
3484
|
var PROVIDERS = [{ value: "stripe", label: "Stripe" }];
|
|
3454
|
-
var payments = new
|
|
3485
|
+
var payments = new Command19("payments").description("enable payments").option("--provider <provider>", "payment provider", "stripe").allowUnknownOption(true).allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
3455
3486
|
(opts, cmd) => runCommand(async () => {
|
|
3456
3487
|
const provider = await resolveProvider2(opts.provider, cmd.getOptionValueSource("provider"));
|
|
3457
3488
|
const input = {
|
|
@@ -3548,8 +3579,8 @@ async function promptPassword(message) {
|
|
|
3548
3579
|
}
|
|
3549
3580
|
|
|
3550
3581
|
// src/commands/enable/subscriptions.ts
|
|
3551
|
-
import { Command as
|
|
3552
|
-
var subscriptions = new
|
|
3582
|
+
import { Command as Command20 } from "commander";
|
|
3583
|
+
var subscriptions = new Command20("subscriptions").description("enable Stripe subscriptions (requires auth and payments)").allowUnknownOption(true).allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
3553
3584
|
(_opts, cmd) => runCommand(
|
|
3554
3585
|
() => runPattern(
|
|
3555
3586
|
"enable-subscriptions",
|
|
@@ -3574,8 +3605,8 @@ var subscriptions = new Command19("subscriptions").description("enable Stripe su
|
|
|
3574
3605
|
);
|
|
3575
3606
|
|
|
3576
3607
|
// src/commands/enable/notifications.ts
|
|
3577
|
-
import { Command as
|
|
3578
|
-
var notifications = new
|
|
3608
|
+
import { Command as Command21 } from "commander";
|
|
3609
|
+
var notifications = new Command21("notifications").description("enable in-app notifications with a bell dropdown (requires auth)").allowUnknownOption(true).allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
3579
3610
|
(_opts, cmd) => runCommand(
|
|
3580
3611
|
() => runPattern(
|
|
3581
3612
|
"enable-notifications",
|
|
@@ -3601,7 +3632,7 @@ var notifications = new Command20("notifications").description("enable in-app no
|
|
|
3601
3632
|
|
|
3602
3633
|
// src/commands/enable/s3.ts
|
|
3603
3634
|
import process16 from "node:process";
|
|
3604
|
-
import { Command as
|
|
3635
|
+
import { Command as Command22 } from "commander";
|
|
3605
3636
|
import * as p20 from "@clack/prompts";
|
|
3606
3637
|
import pc8 from "picocolors";
|
|
3607
3638
|
|
|
@@ -4900,7 +4931,7 @@ function hasFile(dir) {
|
|
|
4900
4931
|
|
|
4901
4932
|
// src/commands/enable/s3.ts
|
|
4902
4933
|
var s3 = addTargetOptions(
|
|
4903
|
-
new
|
|
4934
|
+
new Command22("s3").description("enable S3 file storage").option("--backups", "configure where backups are kept, not where uploads go").option("--endpoint <url>", "S3 endpoint URL").option("--bucket <name>", "S3 bucket name").option("--region <region>", "S3 region").option("--access-key <key>", "S3 access key").option("--secret <secret>", "S3 secret key \u2014 prefer VELA_S3_SECRET").option("--force-path-style", "address the bucket in the path (MinIO, Ceph)").option("--no-force-path-style", "address the bucket as a subdomain (AWS, R2)").option("--force", "enable it even though uploads already exist on disk").configureHelp(helpConfig),
|
|
4904
4935
|
"local"
|
|
4905
4936
|
).action(
|
|
4906
4937
|
(raw) => runCommand(() => {
|
|
@@ -5007,9 +5038,9 @@ async function confirm4(message, initialValue) {
|
|
|
5007
5038
|
|
|
5008
5039
|
// src/commands/enable/smtp.ts
|
|
5009
5040
|
import process17 from "node:process";
|
|
5010
|
-
import { Command as
|
|
5041
|
+
import { Command as Command23 } from "commander";
|
|
5011
5042
|
import * as p21 from "@clack/prompts";
|
|
5012
|
-
var smtp = new
|
|
5043
|
+
var smtp = new Command23("smtp").description("configure SMTP for transactional email").configureHelp(helpConfig).action(
|
|
5013
5044
|
() => runCommand(async () => {
|
|
5014
5045
|
const { workspaceRootDir } = await getWorkspace();
|
|
5015
5046
|
const config = await p21.group(
|
|
@@ -5063,10 +5094,10 @@ var smtp = new Command22("smtp").description("configure SMTP for transactional e
|
|
|
5063
5094
|
|
|
5064
5095
|
// src/commands/enable/cms.ts
|
|
5065
5096
|
import process18 from "node:process";
|
|
5066
|
-
import { Command as
|
|
5097
|
+
import { Command as Command24 } from "commander";
|
|
5067
5098
|
import * as p22 from "@clack/prompts";
|
|
5068
5099
|
import pc9 from "picocolors";
|
|
5069
|
-
var cms = new
|
|
5100
|
+
var cms = new Command24("cms").description("enable an inline-editing CMS with an admin bar").option(
|
|
5070
5101
|
"--endpoint <url>",
|
|
5071
5102
|
"read from a hosted CMS at this URL instead of installing the backend in this app"
|
|
5072
5103
|
).allowUnknownOption(true).allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
@@ -5099,8 +5130,8 @@ Run ${pc9.cyan("vela bless")} to add a backend, or point at a hosted CMS with ${
|
|
|
5099
5130
|
);
|
|
5100
5131
|
|
|
5101
5132
|
// src/commands/enable/blog.ts
|
|
5102
|
-
import { Command as
|
|
5103
|
-
var blog = new
|
|
5133
|
+
import { Command as Command25 } from "commander";
|
|
5134
|
+
var blog = new Command25("blog").description("enable an mdsvex blog with posts, tags, and RSS").allowUnknownOption(true).allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
5104
5135
|
(_opts, cmd) => runCommand(
|
|
5105
5136
|
() => runPattern(
|
|
5106
5137
|
"enable-blog",
|
|
@@ -5125,8 +5156,8 @@ var blog = new Command24("blog").description("enable an mdsvex blog with posts,
|
|
|
5125
5156
|
);
|
|
5126
5157
|
|
|
5127
5158
|
// src/commands/enable/content-negotiation.ts
|
|
5128
|
-
import { Command as
|
|
5129
|
-
var contentNegotiation = new
|
|
5159
|
+
import { Command as Command26 } from "commander";
|
|
5160
|
+
var contentNegotiation = new Command26("content-negotiation").description("enable content negotiation (sveltekit-negotiate)").allowUnknownOption(true).allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
5130
5161
|
(_opts, cmd) => runCommand(
|
|
5131
5162
|
() => runPattern(
|
|
5132
5163
|
"enable-content-negotiation",
|
|
@@ -5149,14 +5180,40 @@ var contentNegotiation = new Command25("content-negotiation").description("enabl
|
|
|
5149
5180
|
)
|
|
5150
5181
|
);
|
|
5151
5182
|
|
|
5183
|
+
// src/commands/enable/workflows.ts
|
|
5184
|
+
import { Command as Command27 } from "commander";
|
|
5185
|
+
var workflows = new Command27("workflows").description("add background workflows to a project created before they were built in").allowUnknownOption(true).allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
5186
|
+
(_opts, cmd) => runCommand(
|
|
5187
|
+
() => runPattern(
|
|
5188
|
+
"enable-workflows",
|
|
5189
|
+
cmd.args,
|
|
5190
|
+
{},
|
|
5191
|
+
{
|
|
5192
|
+
summary: "Enabled workflows.",
|
|
5193
|
+
nextSteps: [
|
|
5194
|
+
"Run `vela generate workflow <name>` to add one to src/lib/workflows/.",
|
|
5195
|
+
"Start a run from server code with `<name>.run(input)`; runs show up under Workflows in the PocketBase dashboard.",
|
|
5196
|
+
"Read src/lib/workflows/README.md for recurring workflows, retries and the worker settings."
|
|
5197
|
+
],
|
|
5198
|
+
task: {
|
|
5199
|
+
title: "Enabling workflows",
|
|
5200
|
+
success: "Enabled workflows",
|
|
5201
|
+
error: "Failed to enable workflows"
|
|
5202
|
+
}
|
|
5203
|
+
}
|
|
5204
|
+
),
|
|
5205
|
+
"Failed to enable workflows."
|
|
5206
|
+
)
|
|
5207
|
+
);
|
|
5208
|
+
|
|
5152
5209
|
// src/commands/enable.ts
|
|
5153
|
-
var enable = new
|
|
5210
|
+
var enable = new Command28("enable").description("enable features").configureHelp(helpConfig).addCommand(analytics).addCommand(auth).addCommand(api).addCommand(apiKeys).addCommand(backend).addCommand(contentNegotiation).addCommand(i18n).addCommand(teams).addCommand(payments).addCommand(subscriptions).addCommand(notifications).addCommand(s3).addCommand(smtp).addCommand(cms).addCommand(blog).addCommand(workflows);
|
|
5154
5211
|
|
|
5155
5212
|
// src/commands/disable.ts
|
|
5156
|
-
import { Command as
|
|
5213
|
+
import { Command as Command41 } from "commander";
|
|
5157
5214
|
|
|
5158
5215
|
// src/commands/disable/auth.ts
|
|
5159
|
-
import { Command as
|
|
5216
|
+
import { Command as Command29 } from "commander";
|
|
5160
5217
|
|
|
5161
5218
|
// src/commands/disable/_shared.ts
|
|
5162
5219
|
import process19 from "node:process";
|
|
@@ -5176,7 +5233,7 @@ async function runDisable(opts, flags, cmdArgs) {
|
|
|
5176
5233
|
}
|
|
5177
5234
|
|
|
5178
5235
|
// src/commands/disable/auth.ts
|
|
5179
|
-
var auth2 = new
|
|
5236
|
+
var auth2 = new Command29("auth").description("disable authentication").option("-y, --yes", "skip confirmation prompt").allowUnknownOption(true).allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
5180
5237
|
(opts, cmd) => runCommand(
|
|
5181
5238
|
() => runDisable(
|
|
5182
5239
|
{
|
|
@@ -5202,8 +5259,8 @@ var auth2 = new Command27("auth").description("disable authentication").option("
|
|
|
5202
5259
|
);
|
|
5203
5260
|
|
|
5204
5261
|
// src/commands/disable/api.ts
|
|
5205
|
-
import { Command as
|
|
5206
|
-
var api2 = new
|
|
5262
|
+
import { Command as Command30 } from "commander";
|
|
5263
|
+
var api2 = new Command30("api").description("disable the REST API").option("-y, --yes", "skip confirmation prompt").allowUnknownOption(true).allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
5207
5264
|
(opts, cmd) => runCommand(
|
|
5208
5265
|
() => runDisable(
|
|
5209
5266
|
{
|
|
@@ -5226,8 +5283,8 @@ var api2 = new Command28("api").description("disable the REST API").option("-y,
|
|
|
5226
5283
|
);
|
|
5227
5284
|
|
|
5228
5285
|
// src/commands/disable/api-keys.ts
|
|
5229
|
-
import { Command as
|
|
5230
|
-
var apiKeys2 = new
|
|
5286
|
+
import { Command as Command31 } from "commander";
|
|
5287
|
+
var apiKeys2 = new Command31("api-keys").description("disable API key management").option("-y, --yes", "skip confirmation prompt").allowUnknownOption(true).allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
5231
5288
|
(opts, cmd) => runCommand(
|
|
5232
5289
|
() => runDisable(
|
|
5233
5290
|
{
|
|
@@ -5250,8 +5307,8 @@ var apiKeys2 = new Command29("api-keys").description("disable API key management
|
|
|
5250
5307
|
);
|
|
5251
5308
|
|
|
5252
5309
|
// src/commands/disable/backend.ts
|
|
5253
|
-
import { Command as
|
|
5254
|
-
var backend2 = new
|
|
5310
|
+
import { Command as Command32 } from "commander";
|
|
5311
|
+
var backend2 = new Command32("backend").description("disable the PocketBase backend").option("-y, --yes", "skip confirmation prompt").allowUnknownOption(true).allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
5255
5312
|
(opts, cmd) => runCommand(
|
|
5256
5313
|
() => runDisable(
|
|
5257
5314
|
{
|
|
@@ -5274,8 +5331,8 @@ var backend2 = new Command30("backend").description("disable the PocketBase back
|
|
|
5274
5331
|
);
|
|
5275
5332
|
|
|
5276
5333
|
// src/commands/disable/content-negotiation.ts
|
|
5277
|
-
import { Command as
|
|
5278
|
-
var contentNegotiation2 = new
|
|
5334
|
+
import { Command as Command33 } from "commander";
|
|
5335
|
+
var contentNegotiation2 = new Command33("content-negotiation").description("disable content negotiation").option("-y, --yes", "skip confirmation prompt").allowUnknownOption(true).allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
5279
5336
|
(opts, cmd) => runCommand(
|
|
5280
5337
|
() => runDisable(
|
|
5281
5338
|
{
|
|
@@ -5298,8 +5355,8 @@ var contentNegotiation2 = new Command31("content-negotiation").description("disa
|
|
|
5298
5355
|
);
|
|
5299
5356
|
|
|
5300
5357
|
// src/commands/disable/i18n.ts
|
|
5301
|
-
import { Command as
|
|
5302
|
-
var i18n2 = new
|
|
5358
|
+
import { Command as Command34 } from "commander";
|
|
5359
|
+
var i18n2 = new Command34("i18n").description("disable internationalization").option("-y, --yes", "skip confirmation prompt").allowUnknownOption(true).allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
5303
5360
|
(opts, cmd) => runCommand(
|
|
5304
5361
|
() => runDisable(
|
|
5305
5362
|
{
|
|
@@ -5325,8 +5382,8 @@ var i18n2 = new Command32("i18n").description("disable internationalization").op
|
|
|
5325
5382
|
);
|
|
5326
5383
|
|
|
5327
5384
|
// src/commands/disable/notifications.ts
|
|
5328
|
-
import { Command as
|
|
5329
|
-
var notifications2 = new
|
|
5385
|
+
import { Command as Command35 } from "commander";
|
|
5386
|
+
var notifications2 = new Command35("notifications").description("disable in-app notifications").option("-y, --yes", "skip confirmation prompt").allowUnknownOption(true).allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
5330
5387
|
(opts, cmd) => runCommand(
|
|
5331
5388
|
() => runDisable(
|
|
5332
5389
|
{
|
|
@@ -5352,8 +5409,8 @@ var notifications2 = new Command33("notifications").description("disable in-app
|
|
|
5352
5409
|
);
|
|
5353
5410
|
|
|
5354
5411
|
// src/commands/disable/teams.ts
|
|
5355
|
-
import { Command as
|
|
5356
|
-
var teams2 = new
|
|
5412
|
+
import { Command as Command36 } from "commander";
|
|
5413
|
+
var teams2 = new Command36("teams").description("disable teams").option("-y, --yes", "skip confirmation prompt").allowUnknownOption(true).allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
5357
5414
|
(opts, cmd) => runCommand(
|
|
5358
5415
|
() => runDisable(
|
|
5359
5416
|
{
|
|
@@ -5376,8 +5433,8 @@ var teams2 = new Command34("teams").description("disable teams").option("-y, --y
|
|
|
5376
5433
|
);
|
|
5377
5434
|
|
|
5378
5435
|
// src/commands/disable/payments.ts
|
|
5379
|
-
import { Command as
|
|
5380
|
-
var payments2 = new
|
|
5436
|
+
import { Command as Command37 } from "commander";
|
|
5437
|
+
var payments2 = new Command37("payments").description("disable payments").option("-y, --yes", "skip confirmation prompt").allowUnknownOption(true).allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
5381
5438
|
(opts, cmd) => runCommand(
|
|
5382
5439
|
() => runDisable(
|
|
5383
5440
|
{
|
|
@@ -5404,11 +5461,11 @@ var payments2 = new Command35("payments").description("disable payments").option
|
|
|
5404
5461
|
);
|
|
5405
5462
|
|
|
5406
5463
|
// src/commands/disable/s3.ts
|
|
5407
|
-
import { Command as
|
|
5464
|
+
import { Command as Command38 } from "commander";
|
|
5408
5465
|
import * as p24 from "@clack/prompts";
|
|
5409
5466
|
import pc10 from "picocolors";
|
|
5410
5467
|
var s32 = addTargetOptions(
|
|
5411
|
-
new
|
|
5468
|
+
new Command38("s3").description("disable S3 file storage").option("--backups", "keep backups on the server again, rather than uploads").configureHelp(helpConfig),
|
|
5412
5469
|
"local"
|
|
5413
5470
|
).action(
|
|
5414
5471
|
(raw) => runCommand(() => {
|
|
@@ -5437,8 +5494,8 @@ function label2(filesystem) {
|
|
|
5437
5494
|
}
|
|
5438
5495
|
|
|
5439
5496
|
// src/commands/disable/subscriptions.ts
|
|
5440
|
-
import { Command as
|
|
5441
|
-
var subscriptions2 = new
|
|
5497
|
+
import { Command as Command39 } from "commander";
|
|
5498
|
+
var subscriptions2 = new Command39("subscriptions").description("disable Stripe subscriptions").option("-y, --yes", "skip confirmation prompt").allowUnknownOption(true).allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
5442
5499
|
(opts, cmd) => runCommand(
|
|
5443
5500
|
() => runDisable(
|
|
5444
5501
|
{
|
|
@@ -5465,8 +5522,8 @@ var subscriptions2 = new Command37("subscriptions").description("disable Stripe
|
|
|
5465
5522
|
);
|
|
5466
5523
|
|
|
5467
5524
|
// src/commands/disable/smtp.ts
|
|
5468
|
-
import { Command as
|
|
5469
|
-
var smtp2 = new
|
|
5525
|
+
import { Command as Command40 } from "commander";
|
|
5526
|
+
var smtp2 = new Command40("smtp").description("disable SMTP configuration").configureHelp(helpConfig).action(
|
|
5470
5527
|
() => runCommand(async () => {
|
|
5471
5528
|
const { workspaceRootDir } = await getWorkspace();
|
|
5472
5529
|
await withPocketbase(workspaceRootDir, async (pb) => {
|
|
@@ -5483,13 +5540,13 @@ var smtp2 = new Command38("smtp").description("disable SMTP configuration").conf
|
|
|
5483
5540
|
);
|
|
5484
5541
|
|
|
5485
5542
|
// src/commands/disable.ts
|
|
5486
|
-
var disable = new
|
|
5543
|
+
var disable = new Command41("disable").description("disable features").configureHelp(helpConfig).addCommand(auth2).addCommand(api2).addCommand(apiKeys2).addCommand(backend2).addCommand(contentNegotiation2).addCommand(i18n2).addCommand(notifications2).addCommand(teams2).addCommand(payments2).addCommand(subscriptions2).addCommand(s32).addCommand(smtp2);
|
|
5487
5544
|
|
|
5488
5545
|
// src/commands/destroy.ts
|
|
5489
|
-
import { Command as
|
|
5546
|
+
import { Command as Command47 } from "commander";
|
|
5490
5547
|
|
|
5491
5548
|
// src/commands/destroy/form.ts
|
|
5492
|
-
import { Command as
|
|
5549
|
+
import { Command as Command42 } from "commander";
|
|
5493
5550
|
|
|
5494
5551
|
// src/commands/destroy/_shared.ts
|
|
5495
5552
|
import process20 from "node:process";
|
|
@@ -5506,7 +5563,7 @@ async function runDestroy(slug2, model, confirmMessage, report4, flags) {
|
|
|
5506
5563
|
}
|
|
5507
5564
|
|
|
5508
5565
|
// src/commands/destroy/form.ts
|
|
5509
|
-
var form2 = new
|
|
5566
|
+
var form2 = new Command42("form").description("destroy a form generated by `vela generate form`").argument("<model>", "model name used when the form was generated (e.g., contact, login)").option("-y, --yes", "skip confirmation prompt").option(
|
|
5510
5567
|
"--route <route>",
|
|
5511
5568
|
"custom route the form was generated at (must match the --route used at generation)"
|
|
5512
5569
|
).allowUnknownOption(true).allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
@@ -5530,8 +5587,8 @@ var form2 = new Command40("form").description("destroy a form generated by `vela
|
|
|
5530
5587
|
);
|
|
5531
5588
|
|
|
5532
5589
|
// src/commands/destroy/schema.ts
|
|
5533
|
-
import { Command as
|
|
5534
|
-
var schema2 = new
|
|
5590
|
+
import { Command as Command43 } from "commander";
|
|
5591
|
+
var schema2 = new Command43("schema").description("destroy a zod schema generated by `vela generate schema`").argument("<model>", "schema model name (e.g., contact, login)").option("-y, --yes", "skip confirmation prompt").allowUnknownOption(true).allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
5535
5592
|
(model, opts) => runCommand(
|
|
5536
5593
|
() => runDestroy(
|
|
5537
5594
|
"destroy-schema",
|
|
@@ -5552,8 +5609,8 @@ var schema2 = new Command41("schema").description("destroy a zod schema generate
|
|
|
5552
5609
|
);
|
|
5553
5610
|
|
|
5554
5611
|
// src/commands/destroy/resource.ts
|
|
5555
|
-
import { Command as
|
|
5556
|
-
var resource2 = new
|
|
5612
|
+
import { Command as Command44 } from "commander";
|
|
5613
|
+
var resource2 = new Command44("resource").description("destroy a resource generated by `vela generate resource`").argument("<model>", "model path used when the resource was generated (e.g., contacts, articles)").option("-y, --yes", "skip confirmation prompt").allowUnknownOption(true).allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
5557
5614
|
(model, opts) => runCommand(
|
|
5558
5615
|
() => runDestroy(
|
|
5559
5616
|
"destroy-resource",
|
|
@@ -5574,8 +5631,8 @@ var resource2 = new Command42("resource").description("destroy a resource genera
|
|
|
5574
5631
|
);
|
|
5575
5632
|
|
|
5576
5633
|
// src/commands/destroy/scaffold.ts
|
|
5577
|
-
import { Command as
|
|
5578
|
-
var scaffold2 = new
|
|
5634
|
+
import { Command as Command45 } from "commander";
|
|
5635
|
+
var scaffold2 = new Command45("scaffold").description("destroy a scaffold generated by `vela generate scaffold`").argument("<model>", "model name used when the scaffold was generated (e.g., contact, todo)").option("-y, --yes", "skip confirmation prompt").option(
|
|
5579
5636
|
"--route <route>",
|
|
5580
5637
|
"custom route the scaffold was generated at (must match the --route used at generation)"
|
|
5581
5638
|
).allowUnknownOption(true).allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
@@ -5603,7 +5660,7 @@ var scaffold2 = new Command43("scaffold").description("destroy a scaffold genera
|
|
|
5603
5660
|
|
|
5604
5661
|
// src/commands/destroy/deployment.ts
|
|
5605
5662
|
import process21 from "node:process";
|
|
5606
|
-
import { Command as
|
|
5663
|
+
import { Command as Command46 } from "commander";
|
|
5607
5664
|
import * as p28 from "@clack/prompts";
|
|
5608
5665
|
import pc13 from "picocolors";
|
|
5609
5666
|
|
|
@@ -5769,7 +5826,7 @@ ${pc12.dim(err instanceof Error ? err.message : String(err))}`
|
|
|
5769
5826
|
// src/commands/destroy/deployment.ts
|
|
5770
5827
|
var deployment = addLockWaitOption(
|
|
5771
5828
|
addTargetOptions(
|
|
5772
|
-
new
|
|
5829
|
+
new Command46("deployment").description("remove a deployed environment from its server").configureHelp(helpConfig),
|
|
5773
5830
|
"production"
|
|
5774
5831
|
)
|
|
5775
5832
|
).option("--purge", "also delete the database and uploaded files").option("-y, --yes", "skip the confirmation prompt").option(
|
|
@@ -5848,13 +5905,13 @@ async function confirm8(appName, targetName, byName) {
|
|
|
5848
5905
|
}
|
|
5849
5906
|
|
|
5850
5907
|
// src/commands/destroy.ts
|
|
5851
|
-
var destroy = new
|
|
5908
|
+
var destroy = new Command47("destroy").description("destroy scaffolding, or a deployment").configureHelp(helpConfig).addCommand(form2).addCommand(schema2).addCommand(resource2).addCommand(scaffold2).addCommand(deployment);
|
|
5852
5909
|
|
|
5853
5910
|
// src/commands/ui.ts
|
|
5854
|
-
import { Command as
|
|
5911
|
+
import { Command as Command53 } from "commander";
|
|
5855
5912
|
|
|
5856
5913
|
// src/commands/ui/add.ts
|
|
5857
|
-
import { Command as
|
|
5914
|
+
import { Command as Command48 } from "commander";
|
|
5858
5915
|
import * as p29 from "@clack/prompts";
|
|
5859
5916
|
import { installComponents } from "@velastack/patterns";
|
|
5860
5917
|
|
|
@@ -5904,21 +5961,21 @@ function uiAddReport(requested, outcome) {
|
|
|
5904
5961
|
}
|
|
5905
5962
|
|
|
5906
5963
|
// src/commands/ui/add.ts
|
|
5907
|
-
var add = new
|
|
5964
|
+
var add = new Command48("add").description("add ui components (shadcn-svelte items and vela components such as data-table)").argument("<components...>", "the components to add").option("--overwrite", "replace components that already exist", false).configureHelp(helpConfig).action(
|
|
5908
5965
|
(components, options) => runCommand(async () => {
|
|
5909
5966
|
const { workspaceRootDir } = await getWorkspace();
|
|
5910
|
-
const
|
|
5967
|
+
const log49 = p29.taskLog({ title: "Adding UI components..." });
|
|
5911
5968
|
let outcome;
|
|
5912
5969
|
try {
|
|
5913
5970
|
outcome = await installComponents({
|
|
5914
5971
|
root: workspaceRootDir,
|
|
5915
5972
|
components,
|
|
5916
5973
|
overwrite: options.overwrite,
|
|
5917
|
-
logger: { info: (message) =>
|
|
5974
|
+
logger: { info: (message) => log49.message(message) }
|
|
5918
5975
|
});
|
|
5919
|
-
|
|
5976
|
+
log49.success("UI components ready");
|
|
5920
5977
|
} catch (e) {
|
|
5921
|
-
|
|
5978
|
+
log49.error("Could not add UI components");
|
|
5922
5979
|
throw e;
|
|
5923
5980
|
}
|
|
5924
5981
|
reportResult(uiAddReport(components, outcome));
|
|
@@ -5926,19 +5983,19 @@ var add = new Command46("add").description("add ui components (shadcn-svelte ite
|
|
|
5926
5983
|
);
|
|
5927
5984
|
|
|
5928
5985
|
// src/commands/ui/base.ts
|
|
5929
|
-
import { Command as
|
|
5986
|
+
import { Command as Command49 } from "commander";
|
|
5930
5987
|
import * as p30 from "@clack/prompts";
|
|
5931
5988
|
import { applyBaseColor } from "@velastack/patterns";
|
|
5932
|
-
var base = new
|
|
5989
|
+
var base = new Command49("base").description("change the base (gray) palette").argument("<color>", `base color to use (${BASE_COLORS.join(", ")})`).configureHelp(helpConfig).action(
|
|
5933
5990
|
(color) => runCommand(async () => {
|
|
5934
5991
|
const { workspaceRootDir } = await getWorkspace();
|
|
5935
|
-
const
|
|
5992
|
+
const log49 = p30.taskLog({ title: `Applying the ${color} palette...` });
|
|
5936
5993
|
let outcome;
|
|
5937
5994
|
try {
|
|
5938
5995
|
outcome = await applyBaseColor({ root: workspaceRootDir, color });
|
|
5939
|
-
|
|
5996
|
+
log49.success("Palette applied");
|
|
5940
5997
|
} catch (e) {
|
|
5941
|
-
|
|
5998
|
+
log49.error("Could not change the base color");
|
|
5942
5999
|
throw e;
|
|
5943
6000
|
}
|
|
5944
6001
|
reportResult({
|
|
@@ -5954,7 +6011,7 @@ var base = new Command47("base").description("change the base (gray) palette").a
|
|
|
5954
6011
|
);
|
|
5955
6012
|
|
|
5956
6013
|
// src/commands/ui/list.ts
|
|
5957
|
-
import { Command as
|
|
6014
|
+
import { Command as Command50 } from "commander";
|
|
5958
6015
|
import * as p31 from "@clack/prompts";
|
|
5959
6016
|
import { listComponents } from "@velastack/patterns";
|
|
5960
6017
|
|
|
@@ -5986,7 +6043,7 @@ function uiListReport(result) {
|
|
|
5986
6043
|
}
|
|
5987
6044
|
|
|
5988
6045
|
// src/commands/ui/list.ts
|
|
5989
|
-
var list = new
|
|
6046
|
+
var list = new Command50("list").description("list installed ui components, vela components and the style registry").option("--json", "print the result as JSON", false).configureHelp(helpConfig).action(
|
|
5990
6047
|
(options) => runCommand(async () => {
|
|
5991
6048
|
const { workspaceRootDir } = await getWorkspace();
|
|
5992
6049
|
if (options.json) {
|
|
@@ -6013,7 +6070,7 @@ Registry components are not listed.`);
|
|
|
6013
6070
|
);
|
|
6014
6071
|
|
|
6015
6072
|
// src/commands/ui/style.ts
|
|
6016
|
-
import { Command as
|
|
6073
|
+
import { Command as Command51 } from "commander";
|
|
6017
6074
|
import * as p32 from "@clack/prompts";
|
|
6018
6075
|
import { switchStyle } from "@velastack/patterns";
|
|
6019
6076
|
|
|
@@ -6040,19 +6097,19 @@ function uiStyleReport(result) {
|
|
|
6040
6097
|
}
|
|
6041
6098
|
|
|
6042
6099
|
// src/commands/ui/style.ts
|
|
6043
|
-
var style = new
|
|
6100
|
+
var style = new Command51("style").description("switch the shadcn-svelte style, re-adding its components").argument("<style>", `style to switch to (${STYLES.join(", ")})`).option("-y, --yes", "skip the confirmation prompt").option("--no-font", "keep the current font instead of applying the style's").configureHelp(helpConfig).action(
|
|
6044
6101
|
(name, options) => runCommand(async () => {
|
|
6045
6102
|
const { workspaceRootDir } = await getWorkspace();
|
|
6046
6103
|
const spinner8 = p32.spinner();
|
|
6047
6104
|
spinner8.start(`Reading the ${name} registry...`);
|
|
6048
|
-
let
|
|
6105
|
+
let log49;
|
|
6049
6106
|
let outcome;
|
|
6050
6107
|
try {
|
|
6051
6108
|
outcome = await switchStyle({
|
|
6052
6109
|
root: workspaceRootDir,
|
|
6053
6110
|
style: name,
|
|
6054
6111
|
font: options.font,
|
|
6055
|
-
logger: { info: (message) =>
|
|
6112
|
+
logger: { info: (message) => log49?.message(message) },
|
|
6056
6113
|
confirm: async (components) => {
|
|
6057
6114
|
spinner8.stop(`Read the ${name} registry`);
|
|
6058
6115
|
if (components.length > 0) {
|
|
@@ -6069,13 +6126,13 @@ ${components.map((c) => `- ${c}`).join("\n")}`
|
|
|
6069
6126
|
const ok = await p32.confirm({ message: `Switch to ${name}?`, initialValue: false });
|
|
6070
6127
|
if (p32.isCancel(ok) || !ok) return false;
|
|
6071
6128
|
}
|
|
6072
|
-
|
|
6129
|
+
log49 = p32.taskLog({ title: `Switching to the ${name} style...` });
|
|
6073
6130
|
return true;
|
|
6074
6131
|
}
|
|
6075
6132
|
});
|
|
6076
6133
|
} catch (e) {
|
|
6077
6134
|
spinner8.stop(`Could not switch to ${name}`);
|
|
6078
|
-
|
|
6135
|
+
log49?.error("Could not switch style");
|
|
6079
6136
|
throw e;
|
|
6080
6137
|
}
|
|
6081
6138
|
spinner8.stop(`Read the ${name} registry`);
|
|
@@ -6087,25 +6144,25 @@ ${components.map((c) => `- ${c}`).join("\n")}`
|
|
|
6087
6144
|
p32.cancel("Operation cancelled.");
|
|
6088
6145
|
return;
|
|
6089
6146
|
}
|
|
6090
|
-
|
|
6147
|
+
log49?.success("Style switched");
|
|
6091
6148
|
reportResult(uiStyleReport(outcome));
|
|
6092
6149
|
}, "Failed to switch style.")
|
|
6093
6150
|
);
|
|
6094
6151
|
|
|
6095
6152
|
// src/commands/ui/theme.ts
|
|
6096
|
-
import { Command as
|
|
6153
|
+
import { Command as Command52 } from "commander";
|
|
6097
6154
|
import * as p33 from "@clack/prompts";
|
|
6098
6155
|
import { applyTheme } from "@velastack/patterns";
|
|
6099
|
-
var theme = new
|
|
6156
|
+
var theme = new Command52("theme").description("change the accent color, keeping the base palette").argument("<accent>", `accent to use (${THEMES.join(", ")})`).configureHelp(helpConfig).action(
|
|
6100
6157
|
(accent) => runCommand(async () => {
|
|
6101
6158
|
const { workspaceRootDir } = await getWorkspace();
|
|
6102
|
-
const
|
|
6159
|
+
const log49 = p33.taskLog({ title: `Applying the ${accent} accent...` });
|
|
6103
6160
|
let outcome;
|
|
6104
6161
|
try {
|
|
6105
6162
|
outcome = await applyTheme({ root: workspaceRootDir, theme: accent });
|
|
6106
|
-
|
|
6163
|
+
log49.success("Accent applied");
|
|
6107
6164
|
} catch (e) {
|
|
6108
|
-
|
|
6165
|
+
log49.error("Could not change the accent");
|
|
6109
6166
|
throw e;
|
|
6110
6167
|
}
|
|
6111
6168
|
reportResult({
|
|
@@ -6121,15 +6178,15 @@ var theme = new Command50("theme").description("change the accent color, keeping
|
|
|
6121
6178
|
);
|
|
6122
6179
|
|
|
6123
6180
|
// src/commands/ui.ts
|
|
6124
|
-
var ui = new
|
|
6181
|
+
var ui = new Command53("ui").description("generate ui components").configureHelp(helpConfig).addCommand(add).addCommand(list).addCommand(style).addCommand(base).addCommand(theme);
|
|
6125
6182
|
|
|
6126
6183
|
// src/commands/legal.ts
|
|
6127
|
-
import { Command as
|
|
6184
|
+
import { Command as Command56 } from "commander";
|
|
6128
6185
|
|
|
6129
6186
|
// src/commands/legal/terms.ts
|
|
6130
6187
|
import fs26 from "node:fs";
|
|
6131
6188
|
import path23 from "node:path";
|
|
6132
|
-
import { Command as
|
|
6189
|
+
import { Command as Command54 } from "commander";
|
|
6133
6190
|
import * as p35 from "@clack/prompts";
|
|
6134
6191
|
|
|
6135
6192
|
// src/commands/legal/shared.ts
|
|
@@ -6813,12 +6870,12 @@ async function termsAction() {
|
|
|
6813
6870
|
]
|
|
6814
6871
|
});
|
|
6815
6872
|
}
|
|
6816
|
-
var terms = new
|
|
6873
|
+
var terms = new Command54("terms").description("generate placeholder terms and conditions").configureHelp(helpConfig).action(() => runCommand(termsAction, "Failed to generate terms and conditions."));
|
|
6817
6874
|
|
|
6818
6875
|
// src/commands/legal/privacy.ts
|
|
6819
6876
|
import fs27 from "node:fs";
|
|
6820
6877
|
import path24 from "node:path";
|
|
6821
|
-
import { Command as
|
|
6878
|
+
import { Command as Command55 } from "commander";
|
|
6822
6879
|
import * as p36 from "@clack/prompts";
|
|
6823
6880
|
var mapLabels = {
|
|
6824
6881
|
personalInfo: {
|
|
@@ -7562,16 +7619,16 @@ async function privacyAction() {
|
|
|
7562
7619
|
]
|
|
7563
7620
|
});
|
|
7564
7621
|
}
|
|
7565
|
-
var privacy = new
|
|
7622
|
+
var privacy = new Command55("privacy").description("generate placeholder privacy policy").configureHelp(helpConfig).action(() => runCommand(privacyAction, "Failed to generate privacy policy."));
|
|
7566
7623
|
|
|
7567
7624
|
// src/commands/legal.ts
|
|
7568
|
-
var legal = new
|
|
7625
|
+
var legal = new Command56("legal").description("generate placeholder legal documents").configureHelp(helpConfig).addCommand(terms).addCommand(privacy);
|
|
7569
7626
|
|
|
7570
7627
|
// src/commands/fixtures.ts
|
|
7571
|
-
import { Command as
|
|
7628
|
+
import { Command as Command62 } from "commander";
|
|
7572
7629
|
|
|
7573
7630
|
// src/commands/fixtures/load.ts
|
|
7574
|
-
import { Command as
|
|
7631
|
+
import { Command as Command57 } from "commander";
|
|
7575
7632
|
|
|
7576
7633
|
// src/lib/data.ts
|
|
7577
7634
|
import fs28 from "node:fs";
|
|
@@ -7761,7 +7818,7 @@ async function hasLoadedFixtures(pb) {
|
|
|
7761
7818
|
}
|
|
7762
7819
|
|
|
7763
7820
|
// src/commands/fixtures/load.ts
|
|
7764
|
-
var load = new
|
|
7821
|
+
var load = new Command57("load").description("load fixtures into the database").configureHelp(helpConfig).action(
|
|
7765
7822
|
() => runCommand(async () => {
|
|
7766
7823
|
const { workspaceRootDir } = await getWorkspace();
|
|
7767
7824
|
let loaded = [];
|
|
@@ -7787,8 +7844,8 @@ var load = new Command55("load").description("load fixtures into the database").
|
|
|
7787
7844
|
);
|
|
7788
7845
|
|
|
7789
7846
|
// src/commands/fixtures/clear.ts
|
|
7790
|
-
import { Command as
|
|
7791
|
-
var clear = new
|
|
7847
|
+
import { Command as Command58 } from "commander";
|
|
7848
|
+
var clear = new Command58("clear").description("clear loaded fixtures").configureHelp(helpConfig).action(
|
|
7792
7849
|
() => runCommand(async () => {
|
|
7793
7850
|
const { workspaceRootDir } = await getWorkspace();
|
|
7794
7851
|
let cleared = [];
|
|
@@ -7817,8 +7874,8 @@ var clear = new Command56("clear").description("clear loaded fixtures").configur
|
|
|
7817
7874
|
);
|
|
7818
7875
|
|
|
7819
7876
|
// src/commands/fixtures/reset.ts
|
|
7820
|
-
import { Command as
|
|
7821
|
-
var reset = new
|
|
7877
|
+
import { Command as Command59 } from "commander";
|
|
7878
|
+
var reset = new Command59("reset").description("clear and reload fixtures").configureHelp(helpConfig).action(
|
|
7822
7879
|
() => runCommand(async () => {
|
|
7823
7880
|
const { workspaceRootDir } = await getWorkspace();
|
|
7824
7881
|
let cleared = [];
|
|
@@ -7850,7 +7907,7 @@ var reset = new Command57("reset").description("clear and reload fixtures").conf
|
|
|
7850
7907
|
// src/commands/fixtures/generate.ts
|
|
7851
7908
|
import fs29 from "node:fs";
|
|
7852
7909
|
import path26 from "node:path";
|
|
7853
|
-
import { Command as
|
|
7910
|
+
import { Command as Command60, InvalidArgumentError } from "commander";
|
|
7854
7911
|
import * as p37 from "@clack/prompts";
|
|
7855
7912
|
import { annotate } from "annotate-json-schema";
|
|
7856
7913
|
import { createGenerator } from "json-schema-faker";
|
|
@@ -7961,7 +8018,7 @@ async function generateFixtureFiles(pb, workspaceRootDir, opts) {
|
|
|
7961
8018
|
}
|
|
7962
8019
|
return { writtenFiles, warnings };
|
|
7963
8020
|
}
|
|
7964
|
-
var generate2 = new
|
|
8021
|
+
var generate2 = new Command60("generate").description("generate fixture data").option("-c, --count <count>", "number of records per collection", parseCount, 10).option("-s, --seed <seed>", "seed for deterministic output", parseSeed).option("-f, --force", "overwrite existing fixture files and clear loaded fixtures").configureHelp(helpConfig).action(
|
|
7965
8022
|
(opts) => runCommand(async () => {
|
|
7966
8023
|
const { workspaceRootDir } = await getWorkspace();
|
|
7967
8024
|
const existing = getFixtureFiles(workspaceRootDir);
|
|
@@ -8014,7 +8071,7 @@ var generate2 = new Command58("generate").description("generate fixture data").o
|
|
|
8014
8071
|
);
|
|
8015
8072
|
|
|
8016
8073
|
// src/commands/fixtures/regen.ts
|
|
8017
|
-
import { Command as
|
|
8074
|
+
import { Command as Command61, InvalidArgumentError as InvalidArgumentError2 } from "commander";
|
|
8018
8075
|
import * as p38 from "@clack/prompts";
|
|
8019
8076
|
function parseCount2(value) {
|
|
8020
8077
|
const n = parseInt(value, 10);
|
|
@@ -8030,7 +8087,7 @@ function parseSeed2(value) {
|
|
|
8030
8087
|
}
|
|
8031
8088
|
return n;
|
|
8032
8089
|
}
|
|
8033
|
-
var regen = new
|
|
8090
|
+
var regen = new Command61("regen").description("clear the database, regenerate fixture files, and reload them").option("-c, --count <count>", "number of records per collection", parseCount2, 10).option("-s, --seed <seed>", "seed for deterministic output", parseSeed2).configureHelp(helpConfig).action(
|
|
8034
8091
|
(opts) => runCommand(async () => {
|
|
8035
8092
|
const { workspaceRootDir } = await getWorkspace();
|
|
8036
8093
|
let cleared = [];
|
|
@@ -8059,14 +8116,14 @@ var regen = new Command59("regen").description("clear the database, regenerate f
|
|
|
8059
8116
|
);
|
|
8060
8117
|
|
|
8061
8118
|
// src/commands/fixtures.ts
|
|
8062
|
-
var fixtures = new
|
|
8119
|
+
var fixtures = new Command62("fixtures").description("manage fixture data").configureHelp(helpConfig).addCommand(generate2).addCommand(load).addCommand(clear).addCommand(reset).addCommand(regen);
|
|
8063
8120
|
|
|
8064
8121
|
// src/commands/seeds.ts
|
|
8065
|
-
import { Command as
|
|
8122
|
+
import { Command as Command66 } from "commander";
|
|
8066
8123
|
|
|
8067
8124
|
// src/commands/seeds/load.ts
|
|
8068
|
-
import { Command as
|
|
8069
|
-
var load2 = new
|
|
8125
|
+
import { Command as Command63 } from "commander";
|
|
8126
|
+
var load2 = new Command63("load").description("load seeds into the database").option("-f, --force", "load even if target collections already have records").configureHelp(helpConfig).action(
|
|
8070
8127
|
(opts) => runCommand(async () => {
|
|
8071
8128
|
const { workspaceRootDir } = await getWorkspace();
|
|
8072
8129
|
const seedFiles = getSeedFiles(workspaceRootDir);
|
|
@@ -8105,7 +8162,7 @@ var load2 = new Command61("load").description("load seeds into the database").op
|
|
|
8105
8162
|
// src/commands/seeds/save.ts
|
|
8106
8163
|
import fs30 from "node:fs";
|
|
8107
8164
|
import path27 from "node:path";
|
|
8108
|
-
import { Command as
|
|
8165
|
+
import { Command as Command64 } from "commander";
|
|
8109
8166
|
var padZeros2 = (num, length) => num.toString().padStart(length, "0");
|
|
8110
8167
|
function filterSystemFields(record, systemFieldNames) {
|
|
8111
8168
|
const out = {};
|
|
@@ -8116,7 +8173,7 @@ function filterSystemFields(record, systemFieldNames) {
|
|
|
8116
8173
|
}
|
|
8117
8174
|
return out;
|
|
8118
8175
|
}
|
|
8119
|
-
var save = new
|
|
8176
|
+
var save = new Command64("save").description("save the current data as seeds").option("-f, --force", "overwrite existing seed files").configureHelp(helpConfig).action(
|
|
8120
8177
|
(opts) => runCommand(async () => {
|
|
8121
8178
|
const { workspaceRootDir } = await getWorkspace();
|
|
8122
8179
|
const seedsPath = dataDir(workspaceRootDir, "seeds");
|
|
@@ -8188,8 +8245,8 @@ var save = new Command62("save").description("save the current data as seeds").o
|
|
|
8188
8245
|
);
|
|
8189
8246
|
|
|
8190
8247
|
// src/commands/seeds/clear.ts
|
|
8191
|
-
import { Command as
|
|
8192
|
-
var clear2 = new
|
|
8248
|
+
import { Command as Command65 } from "commander";
|
|
8249
|
+
var clear2 = new Command65("clear").description("clear seeded records").configureHelp(helpConfig).action(
|
|
8193
8250
|
() => runCommand(async () => {
|
|
8194
8251
|
const { workspaceRootDir } = await getWorkspace();
|
|
8195
8252
|
const seedFiles = getSeedFiles(workspaceRootDir);
|
|
@@ -8220,13 +8277,13 @@ var clear2 = new Command63("clear").description("clear seeded records").configur
|
|
|
8220
8277
|
);
|
|
8221
8278
|
|
|
8222
8279
|
// src/commands/seeds.ts
|
|
8223
|
-
var seeds = new
|
|
8280
|
+
var seeds = new Command66("seeds").description("manage seed data").configureHelp(helpConfig).addCommand(load2).addCommand(save).addCommand(clear2);
|
|
8224
8281
|
|
|
8225
8282
|
// src/commands/signup.ts
|
|
8226
|
-
import { Command as
|
|
8283
|
+
import { Command as Command67 } from "commander";
|
|
8227
8284
|
import * as p39 from "@clack/prompts";
|
|
8228
8285
|
import makeFetchCookie2 from "fetch-cookie";
|
|
8229
|
-
var signup = new
|
|
8286
|
+
var signup = new Command67("signup").description("signup to velastack.dev").configureHelp(helpConfig).action(
|
|
8230
8287
|
() => runCommand(async () => {
|
|
8231
8288
|
const { email: email3, password: password11, passwordConfirm } = await p39.group({
|
|
8232
8289
|
email: () => p39.text({ message: "Email" }),
|
|
@@ -8261,9 +8318,9 @@ var signup = new Command65("signup").description("signup to velastack.dev").conf
|
|
|
8261
8318
|
);
|
|
8262
8319
|
|
|
8263
8320
|
// src/commands/logout.ts
|
|
8264
|
-
import { Command as
|
|
8321
|
+
import { Command as Command68 } from "commander";
|
|
8265
8322
|
import * as p40 from "@clack/prompts";
|
|
8266
|
-
var logout = new
|
|
8323
|
+
var logout = new Command68("logout").alias("signout").description("logout from velastack.dev").configureHelp(helpConfig).action(
|
|
8267
8324
|
() => runCommand(() => {
|
|
8268
8325
|
if (!readConfig()) {
|
|
8269
8326
|
p40.log.info("Not logged in");
|
|
@@ -8275,9 +8332,9 @@ var logout = new Command66("logout").alias("signout").description("logout from v
|
|
|
8275
8332
|
);
|
|
8276
8333
|
|
|
8277
8334
|
// src/commands/whoami.ts
|
|
8278
|
-
import { Command as
|
|
8335
|
+
import { Command as Command69 } from "commander";
|
|
8279
8336
|
import * as p41 from "@clack/prompts";
|
|
8280
|
-
var whoami = new
|
|
8337
|
+
var whoami = new Command69("whoami").description("show the current user").configureHelp(helpConfig).action(
|
|
8281
8338
|
() => runCommand(async () => {
|
|
8282
8339
|
const apiKey = readConfig()?.apiKey;
|
|
8283
8340
|
if (!apiKey) {
|
|
@@ -8294,10 +8351,10 @@ var whoami = new Command67("whoami").description("show the current user").config
|
|
|
8294
8351
|
);
|
|
8295
8352
|
|
|
8296
8353
|
// src/commands/migrate.ts
|
|
8297
|
-
import { Command as
|
|
8354
|
+
import { Command as Command75 } from "commander";
|
|
8298
8355
|
|
|
8299
8356
|
// src/commands/migrate/up.ts
|
|
8300
|
-
import { Command as
|
|
8357
|
+
import { Command as Command70 } from "commander";
|
|
8301
8358
|
|
|
8302
8359
|
// src/lib/migrate.ts
|
|
8303
8360
|
import path28 from "node:path";
|
|
@@ -8336,10 +8393,10 @@ async function runMigrateUp() {
|
|
|
8336
8393
|
]
|
|
8337
8394
|
});
|
|
8338
8395
|
}
|
|
8339
|
-
var up = new
|
|
8396
|
+
var up = new Command70("up").description("apply all pending migrations").configureHelp(helpConfig).action(() => runCommand(runMigrateUp, "Failed to run migrations."));
|
|
8340
8397
|
|
|
8341
8398
|
// src/commands/migrate/down.ts
|
|
8342
|
-
import { Command as
|
|
8399
|
+
import { Command as Command71, InvalidArgumentError as InvalidArgumentError3 } from "commander";
|
|
8343
8400
|
function parseSteps(value) {
|
|
8344
8401
|
const n = parseInt(value, 10);
|
|
8345
8402
|
if (!Number.isFinite(n) || n <= 0) {
|
|
@@ -8347,7 +8404,7 @@ function parseSteps(value) {
|
|
|
8347
8404
|
}
|
|
8348
8405
|
return n;
|
|
8349
8406
|
}
|
|
8350
|
-
var down = new
|
|
8407
|
+
var down = new Command71("down").alias("rollback").description("revert the last N applied migrations").argument("[number]", "how many migrations to revert", parseSteps, 1).configureHelp(helpConfig).action(
|
|
8351
8408
|
(n) => runCommand(async () => {
|
|
8352
8409
|
await runPocketbaseMigrate(["down", String(n)]);
|
|
8353
8410
|
reportResult({
|
|
@@ -8364,8 +8421,8 @@ var down = new Command69("down").alias("rollback").description("revert the last
|
|
|
8364
8421
|
import fs31 from "node:fs";
|
|
8365
8422
|
import path29 from "node:path";
|
|
8366
8423
|
import process24 from "node:process";
|
|
8367
|
-
import { Command as
|
|
8368
|
-
var create2 = new
|
|
8424
|
+
import { Command as Command72 } from "commander";
|
|
8425
|
+
var create2 = new Command72("create").alias("new").description("create a new blank migration").argument("<name>", "migration name (snake_case)").configureHelp(helpConfig).action(
|
|
8369
8426
|
(name) => runCommand(async () => {
|
|
8370
8427
|
const cwd = process24.cwd();
|
|
8371
8428
|
const before = listMigrationFiles(cwd);
|
|
@@ -8392,8 +8449,8 @@ function listMigrationFiles(cwd) {
|
|
|
8392
8449
|
import fs32 from "node:fs";
|
|
8393
8450
|
import path30 from "node:path";
|
|
8394
8451
|
import process25 from "node:process";
|
|
8395
|
-
import { Command as
|
|
8396
|
-
var collections = new
|
|
8452
|
+
import { Command as Command73 } from "commander";
|
|
8453
|
+
var collections = new Command73("collections").alias("snapshot").description("snapshot local collections into a new migration").configureHelp(helpConfig).action(
|
|
8397
8454
|
() => runCommand(async () => {
|
|
8398
8455
|
const cwd = process25.cwd();
|
|
8399
8456
|
const before = listMigrationFiles2(cwd);
|
|
@@ -8424,8 +8481,8 @@ function listMigrationFiles2(cwd) {
|
|
|
8424
8481
|
}
|
|
8425
8482
|
|
|
8426
8483
|
// src/commands/migrate/history-sync.ts
|
|
8427
|
-
import { Command as
|
|
8428
|
-
var historySync = new
|
|
8484
|
+
import { Command as Command74 } from "commander";
|
|
8485
|
+
var historySync = new Command74("history-sync").description("drop _migrations rows whose files no longer exist").configureHelp(helpConfig).action(
|
|
8429
8486
|
() => runCommand(async () => {
|
|
8430
8487
|
await runPocketbaseMigrate(["history-sync"]);
|
|
8431
8488
|
reportResult({
|
|
@@ -8436,14 +8493,14 @@ var historySync = new Command72("history-sync").description("drop _migrations ro
|
|
|
8436
8493
|
);
|
|
8437
8494
|
|
|
8438
8495
|
// src/commands/migrate.ts
|
|
8439
|
-
var migrate = new
|
|
8496
|
+
var migrate = new Command75("migrate").description("manage database migrations").configureHelp(helpConfig).action(() => runCommand(runMigrateUp, "Failed to run migrations.")).addCommand(up).addCommand(down).addCommand(create2).addCommand(collections).addCommand(historySync);
|
|
8440
8497
|
|
|
8441
8498
|
// src/commands/dev.ts
|
|
8442
8499
|
import fs33 from "node:fs";
|
|
8443
8500
|
import path32 from "node:path";
|
|
8444
8501
|
import process27 from "node:process";
|
|
8445
8502
|
import { performance } from "node:perf_hooks";
|
|
8446
|
-
import { Command as
|
|
8503
|
+
import { Command as Command76, InvalidArgumentError as InvalidArgumentError4 } from "commander";
|
|
8447
8504
|
import pc15 from "picocolors";
|
|
8448
8505
|
import PocketBase4 from "pocketbase";
|
|
8449
8506
|
|
|
@@ -8492,7 +8549,7 @@ function parsePort(value) {
|
|
|
8492
8549
|
}
|
|
8493
8550
|
return port;
|
|
8494
8551
|
}
|
|
8495
|
-
var dev = new
|
|
8552
|
+
var dev = new Command76("dev").description("start the development server").option("--open [path]", "open the app in a browser once the server is ready").option("--host [host]", "expose the server on the network").option("--port <port>", "port to listen on", parsePort).option("--strictPort", "exit if the port is already in use instead of taking the next one").option("--cors", "enable CORS").option("--force", "re-bundle dependencies, ignoring the optimizer cache").configureHelp(helpConfig).action(async (options) => {
|
|
8496
8553
|
const cwd = process27.cwd();
|
|
8497
8554
|
process27.env.VELA_DATA_DIR ??= localDataDir(cwd);
|
|
8498
8555
|
const startTime = performance.now();
|
|
@@ -8601,7 +8658,7 @@ async function startWatchingTypes(cwd, pb) {
|
|
|
8601
8658
|
import fs34 from "node:fs";
|
|
8602
8659
|
import path33 from "node:path";
|
|
8603
8660
|
import process29 from "node:process";
|
|
8604
|
-
import { Command as
|
|
8661
|
+
import { Command as Command77 } from "commander";
|
|
8605
8662
|
import * as p42 from "@clack/prompts";
|
|
8606
8663
|
import pc16 from "picocolors";
|
|
8607
8664
|
import { x as x3 } from "tinyexec";
|
|
@@ -8638,7 +8695,7 @@ function splitHosts(value) {
|
|
|
8638
8695
|
|
|
8639
8696
|
// src/commands/build.ts
|
|
8640
8697
|
var PRERENDERED_DIR = path33.join(".svelte-kit", "output", "prerendered");
|
|
8641
|
-
var build = new
|
|
8698
|
+
var build = new Command77("build").description("build the app").configureHelp(helpConfig).option("-t, --target <target>", "which copy of the app to build for", PRODUCTION_TARGET).action(async (options) => {
|
|
8642
8699
|
const cwd = process29.cwd();
|
|
8643
8700
|
applyBuildEnv(cwd);
|
|
8644
8701
|
const origin = await originForBuild(cwd, options.target);
|
|
@@ -8706,11 +8763,11 @@ Set one with ${pc16.cyan("vela deploy --domain example.com")}, or pass ${pc16.cy
|
|
|
8706
8763
|
// src/commands/preview.ts
|
|
8707
8764
|
import path34 from "node:path";
|
|
8708
8765
|
import process30 from "node:process";
|
|
8709
|
-
import { Command as
|
|
8766
|
+
import { Command as Command78 } from "commander";
|
|
8710
8767
|
import { x as x4 } from "tinyexec";
|
|
8711
8768
|
import { detect as detect6 } from "package-manager-detector";
|
|
8712
8769
|
import { resolveCommand as resolveCommand6 } from "package-manager-detector/commands";
|
|
8713
|
-
var preview = new
|
|
8770
|
+
var preview = new Command78("preview").description("preview the built app").configureHelp(helpConfig).action(async () => {
|
|
8714
8771
|
const cwd = process30.cwd();
|
|
8715
8772
|
process30.env.VELA_DATA_DIR ??= localDataDir(cwd);
|
|
8716
8773
|
let pbProc;
|
|
@@ -8750,8 +8807,8 @@ var preview = new Command76("preview").description("preview the built app").conf
|
|
|
8750
8807
|
|
|
8751
8808
|
// src/commands/sync.ts
|
|
8752
8809
|
import path35 from "node:path";
|
|
8753
|
-
import { Command as
|
|
8754
|
-
var sync = new
|
|
8810
|
+
import { Command as Command79 } from "commander";
|
|
8811
|
+
var sync = new Command79("sync").description("sync types from the database").configureHelp(helpConfig).action(
|
|
8755
8812
|
() => runCommand(async () => {
|
|
8756
8813
|
const { workspaceRootDir } = await getWorkspace();
|
|
8757
8814
|
const typesDir = path35.join(workspaceRootDir, ".svelte-kit", "types");
|
|
@@ -8764,7 +8821,7 @@ var sync = new Command77("sync").description("sync types from the database").con
|
|
|
8764
8821
|
);
|
|
8765
8822
|
|
|
8766
8823
|
// src/commands/provision.ts
|
|
8767
|
-
import { Command as
|
|
8824
|
+
import { Command as Command80 } from "commander";
|
|
8768
8825
|
import * as p43 from "@clack/prompts";
|
|
8769
8826
|
import pc17 from "picocolors";
|
|
8770
8827
|
import * as v7 from "valibot";
|
|
@@ -8774,7 +8831,7 @@ var OptionsSchema2 = v7.object({
|
|
|
8774
8831
|
nodeMajor: v7.optional(v7.string())
|
|
8775
8832
|
});
|
|
8776
8833
|
var provision = addSshOptions(
|
|
8777
|
-
new
|
|
8834
|
+
new Command80("provision").description("prepare a server to host vela apps").argument("<target>", "SSH target \u2014 an alias from ~/.ssh/config, or user@host").configureHelp(helpConfig)
|
|
8778
8835
|
).option("--pb-version <version>", "PocketBase version to install").option("--node-major <version>", "Node.js major version to install", "22").action(
|
|
8779
8836
|
(target, raw) => runCommand(async () => {
|
|
8780
8837
|
const options = parseOptions(OptionsSchema2, raw);
|
|
@@ -8818,7 +8875,7 @@ var provision = addSshOptions(
|
|
|
8818
8875
|
// src/commands/deploy.ts
|
|
8819
8876
|
import path38 from "node:path";
|
|
8820
8877
|
import fs37 from "node:fs";
|
|
8821
|
-
import { Command as
|
|
8878
|
+
import { Command as Command81, Option as Option2 } from "commander";
|
|
8822
8879
|
import * as p44 from "@clack/prompts";
|
|
8823
8880
|
import pc18 from "picocolors";
|
|
8824
8881
|
import * as v8 from "valibot";
|
|
@@ -9162,7 +9219,7 @@ var OptionsSchema3 = v8.object({
|
|
|
9162
9219
|
});
|
|
9163
9220
|
var deploy = addLockWaitOption(
|
|
9164
9221
|
addTargetOptions(
|
|
9165
|
-
new
|
|
9222
|
+
new Command81("deploy").description("deploy the app").configureHelp(helpConfig),
|
|
9166
9223
|
"production"
|
|
9167
9224
|
)
|
|
9168
9225
|
).option("--project <name>", "override the project name").option("--domain <hosts>", "hostname(s) to serve on, comma separated").option("--health-path <path>", "path the health check requests").option("--keep <count>", "how many old releases to keep on the server").option("--pb-version <version>", "PocketBase version to run").option("--no-build", "deploy the existing build output without rebuilding").addOption(
|
|
@@ -9529,10 +9586,10 @@ async function serverTimeOrLocal(session) {
|
|
|
9529
9586
|
// src/commands/link.ts
|
|
9530
9587
|
import path39 from "node:path";
|
|
9531
9588
|
import process32 from "node:process";
|
|
9532
|
-
import { Command as
|
|
9589
|
+
import { Command as Command82 } from "commander";
|
|
9533
9590
|
import * as p45 from "@clack/prompts";
|
|
9534
9591
|
var CREATE_NEW = "__new__";
|
|
9535
|
-
var link = new
|
|
9592
|
+
var link = new Command82("link").description("link this project to a velastack.dev project").configureHelp(helpConfig).action(() => runCommand(linkProject, "Failed to link the project."));
|
|
9536
9593
|
async function linkProject() {
|
|
9537
9594
|
const { workspaceRootDir } = await getWorkspace();
|
|
9538
9595
|
const existing = readProjectConfig(workspaceRootDir);
|
|
@@ -9599,14 +9656,14 @@ function defaultProjectName2(workspaceRootDir) {
|
|
|
9599
9656
|
}
|
|
9600
9657
|
|
|
9601
9658
|
// src/commands/env.ts
|
|
9602
|
-
import { Command as
|
|
9659
|
+
import { Command as Command87 } from "commander";
|
|
9603
9660
|
|
|
9604
9661
|
// src/commands/env/list.ts
|
|
9605
|
-
import { Command as
|
|
9662
|
+
import { Command as Command83 } from "commander";
|
|
9606
9663
|
import * as p46 from "@clack/prompts";
|
|
9607
9664
|
import pc19 from "picocolors";
|
|
9608
9665
|
var envList = addTargetOptions(
|
|
9609
|
-
new
|
|
9666
|
+
new Command83("list").description("list environment variable names").configureHelp(helpConfig),
|
|
9610
9667
|
"local"
|
|
9611
9668
|
).action(
|
|
9612
9669
|
(raw) => runCommand(
|
|
@@ -9640,11 +9697,11 @@ function report(keys, where) {
|
|
|
9640
9697
|
|
|
9641
9698
|
// src/commands/env/set.ts
|
|
9642
9699
|
import process33 from "node:process";
|
|
9643
|
-
import { Command as
|
|
9700
|
+
import { Command as Command84 } from "commander";
|
|
9644
9701
|
import * as p47 from "@clack/prompts";
|
|
9645
9702
|
import pc20 from "picocolors";
|
|
9646
9703
|
var envSet = addTargetOptions(
|
|
9647
|
-
new
|
|
9704
|
+
new Command84("set").description("set an environment variable").argument("<key>", "variable name").argument("[value]", "value \u2014 prompted for, without echo, when omitted").configureHelp(helpConfig),
|
|
9648
9705
|
"local"
|
|
9649
9706
|
).action(
|
|
9650
9707
|
(key, value, raw) => runCommand(
|
|
@@ -9687,11 +9744,11 @@ async function promptValue(key) {
|
|
|
9687
9744
|
}
|
|
9688
9745
|
|
|
9689
9746
|
// src/commands/env/unset.ts
|
|
9690
|
-
import { Command as
|
|
9747
|
+
import { Command as Command85 } from "commander";
|
|
9691
9748
|
import * as p48 from "@clack/prompts";
|
|
9692
9749
|
import pc21 from "picocolors";
|
|
9693
9750
|
var envUnset = addTargetOptions(
|
|
9694
|
-
new
|
|
9751
|
+
new Command85("unset").description("remove an environment variable").argument("<key>", "variable name").configureHelp(helpConfig),
|
|
9695
9752
|
"local"
|
|
9696
9753
|
).action(
|
|
9697
9754
|
(key, raw) => runCommand(
|
|
@@ -9729,11 +9786,11 @@ var envUnset = addTargetOptions(
|
|
|
9729
9786
|
import fs38 from "node:fs";
|
|
9730
9787
|
import path40 from "node:path";
|
|
9731
9788
|
import process34 from "node:process";
|
|
9732
|
-
import { Command as
|
|
9789
|
+
import { Command as Command86 } from "commander";
|
|
9733
9790
|
import * as p49 from "@clack/prompts";
|
|
9734
9791
|
import pc22 from "picocolors";
|
|
9735
9792
|
var envImport = addTargetOptions(
|
|
9736
|
-
new
|
|
9793
|
+
new Command86("import").description("merge a dotenv file into the environment").argument("<file>", "dotenv file to read").configureHelp(helpConfig),
|
|
9737
9794
|
"local"
|
|
9738
9795
|
).action(
|
|
9739
9796
|
(file, raw) => runCommand(
|
|
@@ -9783,14 +9840,14 @@ function read(resolved, shown) {
|
|
|
9783
9840
|
}
|
|
9784
9841
|
|
|
9785
9842
|
// src/commands/env.ts
|
|
9786
|
-
var env = new
|
|
9843
|
+
var env = new Command87("env").description("manage environment variables, locally or on a target").configureHelp(helpConfig).addCommand(envList).addCommand(envSet).addCommand(envUnset).addCommand(envImport);
|
|
9787
9844
|
|
|
9788
9845
|
// src/commands/status.ts
|
|
9789
|
-
import { Command as
|
|
9846
|
+
import { Command as Command88 } from "commander";
|
|
9790
9847
|
import * as p50 from "@clack/prompts";
|
|
9791
9848
|
import pc23 from "picocolors";
|
|
9792
9849
|
var status = addTargetOptions(
|
|
9793
|
-
new
|
|
9850
|
+
new Command88("status").description("show what is deployed").configureHelp(helpConfig),
|
|
9794
9851
|
"production"
|
|
9795
9852
|
).option("--all", "show every app on the server, not just this project").option("--json", "print raw JSON").action(
|
|
9796
9853
|
(raw) => runCommand(async () => {
|
|
@@ -9849,12 +9906,12 @@ function describe2(state) {
|
|
|
9849
9906
|
}
|
|
9850
9907
|
|
|
9851
9908
|
// src/commands/rollback.ts
|
|
9852
|
-
import { Command as
|
|
9909
|
+
import { Command as Command89 } from "commander";
|
|
9853
9910
|
import * as p51 from "@clack/prompts";
|
|
9854
9911
|
import pc24 from "picocolors";
|
|
9855
9912
|
var rollback = addLockWaitOption(
|
|
9856
9913
|
addTargetOptions(
|
|
9857
|
-
new
|
|
9914
|
+
new Command89("rollback").description("put the previous release back").configureHelp(helpConfig),
|
|
9858
9915
|
"production"
|
|
9859
9916
|
)
|
|
9860
9917
|
).option("--to <release>", "roll back to a specific release instead of the previous one").action(
|
|
@@ -9893,9 +9950,9 @@ var rollback = addLockWaitOption(
|
|
|
9893
9950
|
);
|
|
9894
9951
|
|
|
9895
9952
|
// src/commands/logs.ts
|
|
9896
|
-
import { Command as
|
|
9953
|
+
import { Command as Command90 } from "commander";
|
|
9897
9954
|
var logs = addTargetOptions(
|
|
9898
|
-
new
|
|
9955
|
+
new Command90("logs").description("tail the logs of a deployed app").configureHelp(helpConfig),
|
|
9899
9956
|
"production"
|
|
9900
9957
|
).option("-f, --follow", "keep streaming new output").option("-n, --lines <count>", "how many lines of history to show", "100").option("--pocketbase", "show the PocketBase service instead of the app").action(
|
|
9901
9958
|
(raw) => runCommand(async () => {
|
|
@@ -9929,16 +9986,16 @@ var logs = addTargetOptions(
|
|
|
9929
9986
|
);
|
|
9930
9987
|
|
|
9931
9988
|
// src/commands/admin.ts
|
|
9932
|
-
import { Command as
|
|
9989
|
+
import { Command as Command92 } from "commander";
|
|
9933
9990
|
|
|
9934
9991
|
// src/commands/admin/create.ts
|
|
9935
9992
|
import process35 from "node:process";
|
|
9936
|
-
import { Command as
|
|
9993
|
+
import { Command as Command91 } from "commander";
|
|
9937
9994
|
import * as p52 from "@clack/prompts";
|
|
9938
9995
|
import pc25 from "picocolors";
|
|
9939
9996
|
var MIN_PASSWORD = 10;
|
|
9940
9997
|
var adminCreate = addTargetOptions(
|
|
9941
|
-
new
|
|
9998
|
+
new Command91("create").description("create a login for the admin panel").argument("[email]", "email to sign in with \u2014 prompted for when omitted").configureHelp(helpConfig),
|
|
9942
9999
|
"local"
|
|
9943
10000
|
).action(
|
|
9944
10001
|
(email3, raw) => runCommand(
|
|
@@ -10048,15 +10105,15 @@ async function promptPassword2() {
|
|
|
10048
10105
|
}
|
|
10049
10106
|
|
|
10050
10107
|
// src/commands/admin.ts
|
|
10051
|
-
var admin = new
|
|
10108
|
+
var admin = new Command92("admin").description("manage admin panel logins").configureHelp(helpConfig).addCommand(adminCreate);
|
|
10052
10109
|
|
|
10053
10110
|
// src/commands/backup.ts
|
|
10054
|
-
import { Command as
|
|
10111
|
+
import { Command as Command98 } from "commander";
|
|
10055
10112
|
|
|
10056
10113
|
// src/commands/backup/create.ts
|
|
10057
10114
|
import fs39 from "node:fs";
|
|
10058
10115
|
import path41 from "node:path";
|
|
10059
|
-
import { Command as
|
|
10116
|
+
import { Command as Command93 } from "commander";
|
|
10060
10117
|
import * as p53 from "@clack/prompts";
|
|
10061
10118
|
import pc26 from "picocolors";
|
|
10062
10119
|
|
|
@@ -10145,7 +10202,7 @@ async function writeSchedule(pb, cron, maxKeep) {
|
|
|
10145
10202
|
// src/commands/backup/create.ts
|
|
10146
10203
|
var DEFAULT_BACKUP_DIR = "backups";
|
|
10147
10204
|
var backupCreate = addTargetOptions(
|
|
10148
|
-
new
|
|
10205
|
+
new Command93("create").description("take a backup of the database and uploads").argument("[name]", "name for the archive \u2014 generated when omitted").option("-o, --output <dir>", "where to save the archive", DEFAULT_BACKUP_DIR).option("--no-download", "leave the archive on the server").configureHelp(helpConfig),
|
|
10149
10206
|
"production"
|
|
10150
10207
|
).action(
|
|
10151
10208
|
(name, raw) => runCommand(() => {
|
|
@@ -10229,11 +10286,11 @@ async function download(ctx, key, outputDir) {
|
|
|
10229
10286
|
}
|
|
10230
10287
|
|
|
10231
10288
|
// src/commands/backup/list.ts
|
|
10232
|
-
import { Command as
|
|
10289
|
+
import { Command as Command94 } from "commander";
|
|
10233
10290
|
import * as p54 from "@clack/prompts";
|
|
10234
10291
|
import pc27 from "picocolors";
|
|
10235
10292
|
var backupList = addTargetOptions(
|
|
10236
|
-
new
|
|
10293
|
+
new Command94("list").description("list the backups on a target").configureHelp(helpConfig),
|
|
10237
10294
|
"production"
|
|
10238
10295
|
).action(
|
|
10239
10296
|
(raw) => runCommand(
|
|
@@ -10261,11 +10318,11 @@ Take one with ${pc27.cyan("vela backup create")}.`
|
|
|
10261
10318
|
// src/commands/backup/download.ts
|
|
10262
10319
|
import fs40 from "node:fs";
|
|
10263
10320
|
import path42 from "node:path";
|
|
10264
|
-
import { Command as
|
|
10321
|
+
import { Command as Command95 } from "commander";
|
|
10265
10322
|
import * as p55 from "@clack/prompts";
|
|
10266
10323
|
import pc28 from "picocolors";
|
|
10267
10324
|
var backupDownload = addTargetOptions(
|
|
10268
|
-
new
|
|
10325
|
+
new Command95("download").description("save a backup off the server").argument("<key>", "archive to download, as shown by `vela backup list`").option("-o, --output <dir>", "where to save the archive", DEFAULT_BACKUP_DIR).configureHelp(helpConfig),
|
|
10269
10326
|
"production"
|
|
10270
10327
|
).action(
|
|
10271
10328
|
(key, raw) => runCommand(() => {
|
|
@@ -10313,11 +10370,11 @@ Fetch it from the bucket directly \u2014 vela does not hold its credentials.`
|
|
|
10313
10370
|
|
|
10314
10371
|
// src/commands/backup/delete.ts
|
|
10315
10372
|
import process36 from "node:process";
|
|
10316
|
-
import { Command as
|
|
10373
|
+
import { Command as Command96 } from "commander";
|
|
10317
10374
|
import * as p56 from "@clack/prompts";
|
|
10318
10375
|
import pc29 from "picocolors";
|
|
10319
10376
|
var backupDelete = addTargetOptions(
|
|
10320
|
-
new
|
|
10377
|
+
new Command96("delete").description("remove a backup from a target").argument("<key>", "archive to delete, as shown by `vela backup list`").option("-y, --yes", "skip the confirmation").configureHelp(helpConfig),
|
|
10321
10378
|
"production"
|
|
10322
10379
|
).action(
|
|
10323
10380
|
(key, raw) => runCommand(() => {
|
|
@@ -10348,12 +10405,12 @@ Run ${pc29.cyan("vela backup list")} to see what it does have.`
|
|
|
10348
10405
|
);
|
|
10349
10406
|
|
|
10350
10407
|
// src/commands/backup/schedule.ts
|
|
10351
|
-
import { Command as
|
|
10408
|
+
import { Command as Command97 } from "commander";
|
|
10352
10409
|
import * as p57 from "@clack/prompts";
|
|
10353
10410
|
import pc30 from "picocolors";
|
|
10354
10411
|
var DEFAULT_KEEP = 7;
|
|
10355
10412
|
var backupSchedule = addTargetOptions(
|
|
10356
|
-
new
|
|
10413
|
+
new Command97("schedule").description("back up automatically on a schedule").argument("[cron]", "when to run, as a cron expression \u2014 shows the current one when omitted").option("--keep <n>", "how many scheduled archives to keep", String(DEFAULT_KEEP)).option("--off", "stop backing up automatically").configureHelp(helpConfig),
|
|
10357
10414
|
"production"
|
|
10358
10415
|
).action(
|
|
10359
10416
|
(cron, raw) => runCommand(() => {
|
|
@@ -10397,18 +10454,18 @@ Set one with ${pc30.cyan('vela backup schedule "0 3 * * *"')}.`
|
|
|
10397
10454
|
);
|
|
10398
10455
|
|
|
10399
10456
|
// src/commands/backup.ts
|
|
10400
|
-
var backup = new
|
|
10457
|
+
var backup = new Command98("backup").description("back up the database and uploads, locally or on a target").configureHelp(helpConfig).addCommand(backupCreate).addCommand(backupList).addCommand(backupDownload).addCommand(backupDelete).addCommand(backupSchedule);
|
|
10401
10458
|
|
|
10402
10459
|
// src/commands/restore.ts
|
|
10403
10460
|
import fs41 from "node:fs";
|
|
10404
10461
|
import path43 from "node:path";
|
|
10405
10462
|
import process37 from "node:process";
|
|
10406
|
-
import { Command as
|
|
10463
|
+
import { Command as Command99 } from "commander";
|
|
10407
10464
|
import * as p58 from "@clack/prompts";
|
|
10408
10465
|
import pc31 from "picocolors";
|
|
10409
10466
|
var restore = addLockWaitOption(
|
|
10410
10467
|
addTargetOptions(
|
|
10411
|
-
new
|
|
10468
|
+
new Command99("restore").description("replace a deployment\u2019s database and uploads from a backup").argument("[source]", "a backup key on the target, or a path to a local archive").configureHelp(helpConfig),
|
|
10412
10469
|
"production"
|
|
10413
10470
|
)
|
|
10414
10471
|
).option("-y, --yes", "skip the confirmation prompt").option("--no-migrate", "do not run migrations against the restored database").option("--keep-previous <n>", "how many replaced databases to keep", "1").action(
|
|
@@ -10550,7 +10607,7 @@ async function confirm13(appName, targetName, envTag, from) {
|
|
|
10550
10607
|
}
|
|
10551
10608
|
|
|
10552
10609
|
// src/commands/targets.ts
|
|
10553
|
-
import { Command as
|
|
10610
|
+
import { Command as Command100 } from "commander";
|
|
10554
10611
|
import * as p59 from "@clack/prompts";
|
|
10555
10612
|
import pc32 from "picocolors";
|
|
10556
10613
|
import * as v9 from "valibot";
|
|
@@ -10560,7 +10617,7 @@ var OptionsSchema4 = v9.object({
|
|
|
10560
10617
|
offline: v9.optional(v9.boolean())
|
|
10561
10618
|
});
|
|
10562
10619
|
var targets = addSshOptions(
|
|
10563
|
-
new
|
|
10620
|
+
new Command100("targets").description("list the targets this project can deploy to").configureHelp(helpConfig)
|
|
10564
10621
|
).option("--json", "print raw JSON").option("--offline", "skip connecting to servers").action(
|
|
10565
10622
|
(raw) => runCommand(async () => {
|
|
10566
10623
|
const options = parseOptions(OptionsSchema4, raw);
|
|
@@ -10640,14 +10697,14 @@ Release and domain are shown from what this project recorded.`
|
|
|
10640
10697
|
// src/commands/test.ts
|
|
10641
10698
|
import path44 from "node:path";
|
|
10642
10699
|
import process38 from "node:process";
|
|
10643
|
-
import { Command as
|
|
10700
|
+
import { Command as Command101 } from "commander";
|
|
10644
10701
|
import PocketBase6 from "pocketbase";
|
|
10645
10702
|
import pc33 from "picocolors";
|
|
10646
10703
|
import { x as x5 } from "tinyexec";
|
|
10647
10704
|
import { detect as detect8 } from "package-manager-detector";
|
|
10648
10705
|
import { resolveCommand as resolveCommand7 } from "package-manager-detector/commands";
|
|
10649
10706
|
import fs42 from "node:fs";
|
|
10650
|
-
var testServer = new
|
|
10707
|
+
var testServer = new Command101("test:server").description("run server tests").allowUnknownOption(true).allowExcessArguments(true).configureHelp(helpConfig).action(async (_opts, cmd) => {
|
|
10651
10708
|
const cwd = process38.cwd();
|
|
10652
10709
|
const email3 = `test-${Math.random().toString(36).slice(2)}@example.com`;
|
|
10653
10710
|
const password11 = "password";
|
|
@@ -10679,6 +10736,7 @@ var testServer = new Command99("test:server").description("run server tests").al
|
|
|
10679
10736
|
};
|
|
10680
10737
|
const cleanup = async () => {
|
|
10681
10738
|
if (cleanedUp) return;
|
|
10739
|
+
process38.emit("sveltekit:shutdown", 0);
|
|
10682
10740
|
await vite?.close().catch(() => {
|
|
10683
10741
|
});
|
|
10684
10742
|
cleanupSync();
|
|
@@ -10746,6 +10804,7 @@ var testServer = new Command99("test:server").description("run server tests").al
|
|
|
10746
10804
|
process38.exitCode = 1;
|
|
10747
10805
|
} finally {
|
|
10748
10806
|
await cleanup();
|
|
10807
|
+
process38.exit(process38.exitCode ?? 0);
|
|
10749
10808
|
}
|
|
10750
10809
|
});
|
|
10751
10810
|
function describeLoadFailure(e) {
|
|
@@ -10776,7 +10835,7 @@ function stubPagesPlugin() {
|
|
|
10776
10835
|
// src/commands/routes.ts
|
|
10777
10836
|
import fs43 from "node:fs";
|
|
10778
10837
|
import path45 from "node:path";
|
|
10779
|
-
import { Command as
|
|
10838
|
+
import { Command as Command102 } from "commander";
|
|
10780
10839
|
var HTTP_METHODS = /* @__PURE__ */ new Set([
|
|
10781
10840
|
"GET",
|
|
10782
10841
|
"POST",
|
|
@@ -10787,7 +10846,7 @@ var HTTP_METHODS = /* @__PURE__ */ new Set([
|
|
|
10787
10846
|
"HEAD",
|
|
10788
10847
|
"fallback"
|
|
10789
10848
|
]);
|
|
10790
|
-
var routes = new
|
|
10849
|
+
var routes = new Command102("routes").description("list routes").configureHelp(helpConfig).action(async () => {
|
|
10791
10850
|
const { workspaceRootDir, routesDir } = await getWorkspace();
|
|
10792
10851
|
const routesRoot = path45.join(workspaceRootDir, routesDir);
|
|
10793
10852
|
const found = walk(routesRoot, routesRoot).filter((r) => r.methods.length > 0);
|
|
@@ -10863,7 +10922,7 @@ function printTable(routes2) {
|
|
|
10863
10922
|
|
|
10864
10923
|
// src/commands/i18n.ts
|
|
10865
10924
|
import process39 from "node:process";
|
|
10866
|
-
import { Command as
|
|
10925
|
+
import { Command as Command103 } from "commander";
|
|
10867
10926
|
import { x as x6 } from "tinyexec";
|
|
10868
10927
|
import { detect as detect9 } from "package-manager-detector";
|
|
10869
10928
|
import { resolveCommand as resolveCommand8 } from "package-manager-detector/commands";
|
|
@@ -10878,11 +10937,11 @@ async function runWuchale(extraArgs) {
|
|
|
10878
10937
|
throwOnError: true
|
|
10879
10938
|
});
|
|
10880
10939
|
}
|
|
10881
|
-
var extract2 = new
|
|
10882
|
-
var watch = new
|
|
10883
|
-
var status2 = new
|
|
10884
|
-
var clean = new
|
|
10885
|
-
var i18n3 = new
|
|
10940
|
+
var extract2 = new Command103("extract").description("extract translatable strings").configureHelp(helpConfig).action(() => runWuchale([]));
|
|
10941
|
+
var watch = new Command103("watch").description("watch and extract translatable strings").configureHelp(helpConfig).action(() => runWuchale(["--watch"]));
|
|
10942
|
+
var status2 = new Command103("status").description("show i18n status").configureHelp(helpConfig).action(() => runWuchale(["status"]));
|
|
10943
|
+
var clean = new Command103("clean").description("clean unused translatable strings").configureHelp(helpConfig).action(() => runWuchale(["--clean"]));
|
|
10944
|
+
var i18n3 = new Command103("i18n").description("i18n utilities").configureHelp(helpConfig).addCommand(extract2, { isDefault: true }).addCommand(watch).addCommand(status2).addCommand(clean);
|
|
10886
10945
|
|
|
10887
10946
|
// src/commands/oauth.ts
|
|
10888
10947
|
var oauth = stubCommand("oauth", "configure OAuth providers");
|
|
@@ -10891,17 +10950,17 @@ var oauth = stubCommand("oauth", "configure OAuth providers");
|
|
|
10891
10950
|
var schemas = stubCommand("schemas", "manage database schemas");
|
|
10892
10951
|
|
|
10893
10952
|
// src/commands/cms.ts
|
|
10894
|
-
import { Command as
|
|
10953
|
+
import { Command as Command109 } from "commander";
|
|
10895
10954
|
|
|
10896
10955
|
// src/commands/cms/deploy.ts
|
|
10897
10956
|
import process40 from "node:process";
|
|
10898
|
-
import { Command as
|
|
10957
|
+
import { Command as Command104 } from "commander";
|
|
10899
10958
|
import * as p60 from "@clack/prompts";
|
|
10900
10959
|
import pc34 from "picocolors";
|
|
10901
10960
|
var POLL_INTERVAL2 = 5e3;
|
|
10902
10961
|
var POLL_TIMEOUT = 30 * 6e4;
|
|
10903
10962
|
var inFlight = (run) => run?.status === "pending" || run?.status === "building";
|
|
10904
|
-
var deploy2 = new
|
|
10963
|
+
var deploy2 = new Command104("deploy").description("rebuild the hosted site with the latest published content").option(
|
|
10905
10964
|
"--project <id>",
|
|
10906
10965
|
"velastack.dev project whose site to rebuild, instead of the linked one"
|
|
10907
10966
|
).option("--no-wait", "return once the build has started instead of waiting for it").configureHelp(helpConfig).action(
|
|
@@ -10990,11 +11049,11 @@ async function waitForRun(apiKey, projectId, runId) {
|
|
|
10990
11049
|
}
|
|
10991
11050
|
|
|
10992
11051
|
// src/commands/cms/editor.ts
|
|
10993
|
-
import { Command as
|
|
11052
|
+
import { Command as Command108 } from "commander";
|
|
10994
11053
|
|
|
10995
11054
|
// src/commands/cms/editor/add.ts
|
|
10996
11055
|
import { randomBytes } from "node:crypto";
|
|
10997
|
-
import { Command as
|
|
11056
|
+
import { Command as Command105 } from "commander";
|
|
10998
11057
|
import * as p61 from "@clack/prompts";
|
|
10999
11058
|
import pc36 from "picocolors";
|
|
11000
11059
|
|
|
@@ -11037,7 +11096,7 @@ async function withCmsBackend(fn, cwd = process41.cwd()) {
|
|
|
11037
11096
|
}
|
|
11038
11097
|
|
|
11039
11098
|
// src/commands/cms/editor/add.ts
|
|
11040
|
-
var editorAdd = new
|
|
11099
|
+
var editorAdd = new Command105("add").description("create an editor who can sign in to the admin bar").argument("<email>", "email the editor signs in with").option("--password <password>", "password to set \u2014 generated and shown once when omitted").option("--project <id>", "project the editor may edit", DEFAULT_PROJECT).configureHelp(helpConfig).action(
|
|
11041
11100
|
(email3, options) => runCommand(async () => {
|
|
11042
11101
|
const generated = options.password === void 0;
|
|
11043
11102
|
const password11 = options.password ?? randomBytes(12).toString("base64url");
|
|
@@ -11056,10 +11115,10 @@ var editorAdd = new Command103("add").description("create an editor who can sign
|
|
|
11056
11115
|
);
|
|
11057
11116
|
|
|
11058
11117
|
// src/commands/cms/editor/password.ts
|
|
11059
|
-
import { Command as
|
|
11118
|
+
import { Command as Command106 } from "commander";
|
|
11060
11119
|
import * as p62 from "@clack/prompts";
|
|
11061
11120
|
import pc37 from "picocolors";
|
|
11062
|
-
var editorPassword = new
|
|
11121
|
+
var editorPassword = new Command106("password").description("set an editor's password").argument("<email>", "email of the editor").argument("<password>", "new password").configureHelp(helpConfig).action(
|
|
11063
11122
|
(email3, password11) => runCommand(async () => {
|
|
11064
11123
|
await withCmsBackend((cms3) => cms3.editors.setPassword(email3, password11));
|
|
11065
11124
|
p62.log.success(
|
|
@@ -11069,10 +11128,10 @@ var editorPassword = new Command104("password").description("set an editor's pas
|
|
|
11069
11128
|
);
|
|
11070
11129
|
|
|
11071
11130
|
// src/commands/cms/editor/list.ts
|
|
11072
|
-
import { Command as
|
|
11131
|
+
import { Command as Command107 } from "commander";
|
|
11073
11132
|
import * as p63 from "@clack/prompts";
|
|
11074
11133
|
import pc38 from "picocolors";
|
|
11075
|
-
var editorList = new
|
|
11134
|
+
var editorList = new Command107("list").description("list editors and the projects they may edit").configureHelp(helpConfig).action(
|
|
11076
11135
|
() => runCommand(async () => {
|
|
11077
11136
|
const rows = await withCmsBackend(
|
|
11078
11137
|
async (cms3) => cms3.editors.list().map((editor2) => ({
|
|
@@ -11096,10 +11155,154 @@ var editorList = new Command105("list").description("list editors and the projec
|
|
|
11096
11155
|
);
|
|
11097
11156
|
|
|
11098
11157
|
// src/commands/cms/editor.ts
|
|
11099
|
-
var editor = new
|
|
11158
|
+
var editor = new Command108("editor").description("manage who can sign in to the admin bar").configureHelp(helpConfig).addCommand(editorAdd).addCommand(editorPassword).addCommand(editorList);
|
|
11100
11159
|
|
|
11101
11160
|
// src/commands/cms.ts
|
|
11102
|
-
var cms2 = new
|
|
11161
|
+
var cms2 = new Command109("cms").description("manage the CMS").configureHelp(helpConfig).addCommand(editor).addCommand(deploy2);
|
|
11162
|
+
|
|
11163
|
+
// src/commands/workflows.ts
|
|
11164
|
+
import { Command as Command113 } from "commander";
|
|
11165
|
+
|
|
11166
|
+
// src/commands/workflows/list.ts
|
|
11167
|
+
import process42 from "node:process";
|
|
11168
|
+
import { Command as Command110, InvalidArgumentError as InvalidArgumentError5 } from "commander";
|
|
11169
|
+
import * as p64 from "@clack/prompts";
|
|
11170
|
+
import pc39 from "picocolors";
|
|
11171
|
+
|
|
11172
|
+
// src/lib/workflows-api.ts
|
|
11173
|
+
var NAMESPACE = "default";
|
|
11174
|
+
var PREFIX = `/api/ow/v1/${NAMESPACE}`;
|
|
11175
|
+
async function listRuns(pb, options = {}) {
|
|
11176
|
+
const query = { limit: options.limit ?? 50 };
|
|
11177
|
+
if (options.status) query.status = options.status;
|
|
11178
|
+
if (options.workflowName) query.workflowName = options.workflowName;
|
|
11179
|
+
const res = await pb.send(`${PREFIX}/runs`, {
|
|
11180
|
+
method: "GET",
|
|
11181
|
+
query,
|
|
11182
|
+
requestKey: null
|
|
11183
|
+
});
|
|
11184
|
+
return res.data;
|
|
11185
|
+
}
|
|
11186
|
+
async function createRun(pb, workflowName, input) {
|
|
11187
|
+
const res = await pb.send(`${PREFIX}/runs`, {
|
|
11188
|
+
method: "POST",
|
|
11189
|
+
body: {
|
|
11190
|
+
workflowName,
|
|
11191
|
+
version: null,
|
|
11192
|
+
idempotencyKey: null,
|
|
11193
|
+
config: {},
|
|
11194
|
+
context: {},
|
|
11195
|
+
input: input ?? null,
|
|
11196
|
+
parentStepAttemptNamespaceId: null,
|
|
11197
|
+
parentStepAttemptId: null,
|
|
11198
|
+
availableAt: null,
|
|
11199
|
+
deadlineAt: null
|
|
11200
|
+
},
|
|
11201
|
+
requestKey: null
|
|
11202
|
+
});
|
|
11203
|
+
return res.run;
|
|
11204
|
+
}
|
|
11205
|
+
async function cancelRun(pb, id) {
|
|
11206
|
+
const res = await pb.send(`${PREFIX}/runs/${id}/cancel`, {
|
|
11207
|
+
method: "POST",
|
|
11208
|
+
body: {},
|
|
11209
|
+
requestKey: null
|
|
11210
|
+
});
|
|
11211
|
+
return res.run;
|
|
11212
|
+
}
|
|
11213
|
+
|
|
11214
|
+
// src/commands/workflows/list.ts
|
|
11215
|
+
var STATUSES = ["pending", "running", "completed", "failed", "canceled"];
|
|
11216
|
+
function parseStatus(value) {
|
|
11217
|
+
if (!STATUSES.includes(value)) {
|
|
11218
|
+
throw new InvalidArgumentError5(`must be one of: ${STATUSES.join(", ")}`);
|
|
11219
|
+
}
|
|
11220
|
+
return value;
|
|
11221
|
+
}
|
|
11222
|
+
function parseLimit(value) {
|
|
11223
|
+
const n = Number(value);
|
|
11224
|
+
if (!Number.isInteger(n) || n < 1 || n > 500) {
|
|
11225
|
+
throw new InvalidArgumentError5("must be a whole number between 1 and 500.");
|
|
11226
|
+
}
|
|
11227
|
+
return n;
|
|
11228
|
+
}
|
|
11229
|
+
var STATUS_COLOR = {
|
|
11230
|
+
pending: pc39.yellow,
|
|
11231
|
+
running: pc39.cyan,
|
|
11232
|
+
completed: pc39.green,
|
|
11233
|
+
failed: pc39.red,
|
|
11234
|
+
canceled: pc39.dim
|
|
11235
|
+
};
|
|
11236
|
+
function formatRun(run, nameWidth) {
|
|
11237
|
+
const status3 = STATUS_COLOR[run.status](run.status.padEnd(9));
|
|
11238
|
+
const when = pc39.dim((run.finishedAt ?? run.updatedAt).replace("T", " ").slice(0, 19));
|
|
11239
|
+
const attempts = run.attempts > 1 ? pc39.dim(` \xD7${run.attempts}`) : "";
|
|
11240
|
+
const error = run.status === "failed" && run.error?.message ? pc39.red(` ${run.error.message}`) : "";
|
|
11241
|
+
return `${run.id} ${run.workflowName.padEnd(nameWidth)} ${status3}${attempts} ${when}${error}`;
|
|
11242
|
+
}
|
|
11243
|
+
var workflowsList = new Command110("list").description("list recent workflow runs").option("--status <status>", `only runs in this state (${STATUSES.join(", ")})`, parseStatus).option("--name <workflow>", "only runs of this workflow").option("--limit <n>", "how many to show", parseLimit, 50).configureHelp(helpConfig).action(
|
|
11244
|
+
(options) => runCommand(async () => {
|
|
11245
|
+
await withPocketbase(process42.cwd(), async (pb) => {
|
|
11246
|
+
const runs = await listRuns(pb, {
|
|
11247
|
+
status: options.status,
|
|
11248
|
+
workflowName: options.name,
|
|
11249
|
+
limit: options.limit
|
|
11250
|
+
});
|
|
11251
|
+
if (runs.length === 0) {
|
|
11252
|
+
p64.log.info(
|
|
11253
|
+
`No workflow runs yet.
|
|
11254
|
+
|
|
11255
|
+
Start one from server code with ${pc39.cyan("<workflow>.run(input)")}, or with ${pc39.cyan("vela workflows run <name>")}.`
|
|
11256
|
+
);
|
|
11257
|
+
return;
|
|
11258
|
+
}
|
|
11259
|
+
const width = Math.max(...runs.map((r) => r.workflowName.length));
|
|
11260
|
+
p64.log.message(runs.map((r) => formatRun(r, width)).join("\n"));
|
|
11261
|
+
});
|
|
11262
|
+
}, "Failed to list workflow runs.")
|
|
11263
|
+
);
|
|
11264
|
+
|
|
11265
|
+
// src/commands/workflows/run.ts
|
|
11266
|
+
import process43 from "node:process";
|
|
11267
|
+
import { Command as Command111, InvalidArgumentError as InvalidArgumentError6 } from "commander";
|
|
11268
|
+
import * as p65 from "@clack/prompts";
|
|
11269
|
+
import pc40 from "picocolors";
|
|
11270
|
+
function parseInput(value) {
|
|
11271
|
+
try {
|
|
11272
|
+
return JSON.parse(value);
|
|
11273
|
+
} catch {
|
|
11274
|
+
throw new InvalidArgumentError6(`must be JSON, e.g. '{"userId":"abc"}'.`);
|
|
11275
|
+
}
|
|
11276
|
+
}
|
|
11277
|
+
var workflowsRun = new Command111("run").description("start a run of a workflow; the running app picks it up").argument("<name>", "the workflow name, as in its defineWorkflow spec").argument("[input]", "the run input as JSON", parseInput).configureHelp(helpConfig).action(
|
|
11278
|
+
(name, input) => runCommand(async () => {
|
|
11279
|
+
await withPocketbase(process43.cwd(), async (pb) => {
|
|
11280
|
+
const run = await createRun(pb, name, input);
|
|
11281
|
+
p65.log.success(
|
|
11282
|
+
`Queued ${pc40.cyan(name)} as run ${pc40.bold(run.id)}.
|
|
11283
|
+
|
|
11284
|
+
It runs once the app is up (${pc40.cyan("vela dev")}); ${pc40.cyan("vela workflows list")} shows its state.`
|
|
11285
|
+
);
|
|
11286
|
+
});
|
|
11287
|
+
}, "Failed to start the workflow run.")
|
|
11288
|
+
);
|
|
11289
|
+
|
|
11290
|
+
// src/commands/workflows/cancel.ts
|
|
11291
|
+
import process44 from "node:process";
|
|
11292
|
+
import { Command as Command112 } from "commander";
|
|
11293
|
+
import * as p66 from "@clack/prompts";
|
|
11294
|
+
import pc41 from "picocolors";
|
|
11295
|
+
var workflowsCancel = new Command112("cancel").description("cancel a pending or running workflow run").argument("<run-id>", "the run id from `vela workflows list`").configureHelp(helpConfig).action(
|
|
11296
|
+
(id) => runCommand(async () => {
|
|
11297
|
+
await withPocketbase(process44.cwd(), async (pb) => {
|
|
11298
|
+
const run = await cancelRun(pb, id);
|
|
11299
|
+
p66.log.success(`Canceled run ${pc41.bold(run.id)} of ${pc41.cyan(run.workflowName)}.`);
|
|
11300
|
+
});
|
|
11301
|
+
}, "Failed to cancel the workflow run.")
|
|
11302
|
+
);
|
|
11303
|
+
|
|
11304
|
+
// src/commands/workflows.ts
|
|
11305
|
+
var workflows2 = new Command113("workflows").description("list, start and cancel background workflow runs").configureHelp(helpConfig).addCommand(workflowsList).addCommand(workflowsRun).addCommand(workflowsCancel);
|
|
11103
11306
|
|
|
11104
11307
|
// src/program.ts
|
|
11105
11308
|
var NO_BACKEND_COMMMANDS = /* @__PURE__ */ new Set([
|
|
@@ -11139,10 +11342,10 @@ var NO_BACKEND_COMMMANDS = /* @__PURE__ */ new Set([
|
|
|
11139
11342
|
]);
|
|
11140
11343
|
var BACKEND_OPTIONAL_COMMANDS = /* @__PURE__ */ new Set(["dev", "build", "preview", "deploy"]);
|
|
11141
11344
|
var SELF_CREDENTIALED_COMMANDS = /* @__PURE__ */ new Set(["test:server"]);
|
|
11142
|
-
var program = new
|
|
11345
|
+
var program = new Command114().name(package_default.name).description(package_default.description).version(package_default.version, "-v, --version").configureHelp(helpConfig);
|
|
11143
11346
|
program.hook("preAction", (_thisCommand, actionCommand) => {
|
|
11144
11347
|
if (isStub(actionCommand)) return;
|
|
11145
|
-
const envRoot = findWorkspaceRoot() ??
|
|
11348
|
+
const envRoot = findWorkspaceRoot() ?? process45.cwd();
|
|
11146
11349
|
dotenv2.config({ path: nodePath.join(envRoot, ".env"), quiet: true });
|
|
11147
11350
|
const path47 = getCommandPath(actionCommand);
|
|
11148
11351
|
if (NO_BACKEND_COMMMANDS.has(path47)) return;
|
|
@@ -11150,30 +11353,30 @@ program.hook("preAction", (_thisCommand, actionCommand) => {
|
|
|
11150
11353
|
if (NO_BACKEND_COMMMANDS.has(top)) return;
|
|
11151
11354
|
if (!hasBackend()) {
|
|
11152
11355
|
if (BACKEND_OPTIONAL_COMMANDS.has(top)) return;
|
|
11153
|
-
|
|
11154
|
-
`${
|
|
11356
|
+
p67.log.error(
|
|
11357
|
+
`${pc42.cyan(`vela ${path47}`)} needs a backend, and this project does not have one.
|
|
11155
11358
|
|
|
11156
11359
|
Static projects have no database to talk to.
|
|
11157
11360
|
|
|
11158
|
-
To add a backend to this project, run ${
|
|
11361
|
+
To add a backend to this project, run ${pc42.cyan("vela bless")}.`
|
|
11159
11362
|
);
|
|
11160
|
-
|
|
11161
|
-
|
|
11162
|
-
|
|
11363
|
+
p67.log.message();
|
|
11364
|
+
p67.cancel("Operation failed.");
|
|
11365
|
+
process45.exit(1);
|
|
11163
11366
|
}
|
|
11164
11367
|
if (SELF_CREDENTIALED_COMMANDS.has(path47)) return;
|
|
11165
|
-
if (!
|
|
11166
|
-
|
|
11368
|
+
if (!process45.env.POCKETBASE_SUPERUSER_EMAIL || !process45.env.POCKETBASE_SUPERUSER_PASSWORD) {
|
|
11369
|
+
p67.log.error(
|
|
11167
11370
|
`PocketBase superuser credentials are required.
|
|
11168
11371
|
|
|
11169
|
-
Set ${
|
|
11372
|
+
Set ${pc42.cyan("POCKETBASE_SUPERUSER_EMAIL")} and ${pc42.cyan("POCKETBASE_SUPERUSER_PASSWORD")} in your .env file.
|
|
11170
11373
|
|
|
11171
|
-
To set up a new project, run ${
|
|
11172
|
-
To set up an existing project, run ${
|
|
11374
|
+
To set up a new project, run ${pc42.cyan("vela create")}.
|
|
11375
|
+
To set up an existing project, run ${pc42.cyan("vela bless")}.`
|
|
11173
11376
|
);
|
|
11174
|
-
|
|
11175
|
-
|
|
11176
|
-
|
|
11377
|
+
p67.log.message();
|
|
11378
|
+
p67.cancel("Operation failed.");
|
|
11379
|
+
process45.exit(1);
|
|
11177
11380
|
}
|
|
11178
11381
|
});
|
|
11179
11382
|
function getCommandPath(cmd) {
|
|
@@ -11221,11 +11424,12 @@ for (const command of [
|
|
|
11221
11424
|
i18n3,
|
|
11222
11425
|
oauth,
|
|
11223
11426
|
schemas,
|
|
11224
|
-
cms2
|
|
11427
|
+
cms2,
|
|
11428
|
+
workflows2
|
|
11225
11429
|
]) {
|
|
11226
11430
|
program.addCommand(command);
|
|
11227
11431
|
}
|
|
11228
11432
|
|
|
11229
11433
|
// src/bin.ts
|
|
11230
|
-
program.parse(normalizeArgv(
|
|
11434
|
+
program.parse(normalizeArgv(process46.argv.slice(2)), { from: "user" });
|
|
11231
11435
|
//# sourceMappingURL=bin.js.map
|