vela 0.12.3 → 0.13.0
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 +446 -246
- package/dist/bin.js.map +4 -4
- package/package.json +3 -3
- package/templates/minimal/package.template.json +3 -0
- 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.0",
|
|
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",
|
|
@@ -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
|
|
|
@@ -2666,7 +2667,7 @@ function promptCredentials(options, onCancel2) {
|
|
|
2666
2667
|
}
|
|
2667
2668
|
|
|
2668
2669
|
// src/commands/generate.ts
|
|
2669
|
-
import { Command as
|
|
2670
|
+
import { Command as Command11 } from "commander";
|
|
2670
2671
|
|
|
2671
2672
|
// src/commands/generate/form.ts
|
|
2672
2673
|
import { Command as Command5 } from "commander";
|
|
@@ -2687,7 +2688,7 @@ async function runPattern(slug2, argv, input, report4) {
|
|
|
2687
2688
|
}
|
|
2688
2689
|
checkProviderInput(pattern, argv, input);
|
|
2689
2690
|
const { workspaceRootDir, features } = await getWorkspace();
|
|
2690
|
-
const
|
|
2691
|
+
const log49 = p9.taskLog({ title: report4.task.title });
|
|
2691
2692
|
let result;
|
|
2692
2693
|
try {
|
|
2693
2694
|
result = await pattern.generate({
|
|
@@ -2707,11 +2708,11 @@ async function runPattern(slug2, argv, input, report4) {
|
|
|
2707
2708
|
});
|
|
2708
2709
|
return collections2;
|
|
2709
2710
|
},
|
|
2710
|
-
logger: { info: (message) =>
|
|
2711
|
+
logger: { info: (message) => log49.message(message) }
|
|
2711
2712
|
});
|
|
2712
|
-
|
|
2713
|
+
log49.success(report4.task.success);
|
|
2713
2714
|
} catch (e) {
|
|
2714
|
-
|
|
2715
|
+
log49.error(report4.task.error);
|
|
2715
2716
|
throw e;
|
|
2716
2717
|
}
|
|
2717
2718
|
const rel = (f) => toRelative(workspaceRootDir, f);
|
|
@@ -3253,15 +3254,41 @@ var migration = new Command9("migration").description("generate a migration for
|
|
|
3253
3254
|
)
|
|
3254
3255
|
);
|
|
3255
3256
|
|
|
3257
|
+
// src/commands/generate/workflow.ts
|
|
3258
|
+
import { Command as Command10 } from "commander";
|
|
3259
|
+
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(
|
|
3260
|
+
(name, options, cmd) => runCommand(
|
|
3261
|
+
() => runPattern(
|
|
3262
|
+
"generate-workflow",
|
|
3263
|
+
[name, ...options.cron ? ["--cron", options.cron] : [], ...cmd.args.slice(1)],
|
|
3264
|
+
{},
|
|
3265
|
+
{
|
|
3266
|
+
summary: `Generated the ${name} workflow.`,
|
|
3267
|
+
nextSteps: [
|
|
3268
|
+
"Fill in the steps in the new file under src/lib/workflows/.",
|
|
3269
|
+
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.",
|
|
3270
|
+
"Run `vela test:server` to run its test."
|
|
3271
|
+
],
|
|
3272
|
+
task: {
|
|
3273
|
+
title: "Generating workflow",
|
|
3274
|
+
success: "Generated workflow",
|
|
3275
|
+
error: "Failed to generate workflow"
|
|
3276
|
+
}
|
|
3277
|
+
}
|
|
3278
|
+
),
|
|
3279
|
+
"Failed to generate workflow."
|
|
3280
|
+
)
|
|
3281
|
+
);
|
|
3282
|
+
|
|
3256
3283
|
// src/commands/generate.ts
|
|
3257
|
-
var generate = new
|
|
3284
|
+
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
3285
|
|
|
3259
3286
|
// src/commands/enable.ts
|
|
3260
|
-
import { Command as
|
|
3287
|
+
import { Command as Command28 } from "commander";
|
|
3261
3288
|
|
|
3262
3289
|
// src/commands/enable/analytics.ts
|
|
3263
|
-
import { Command as
|
|
3264
|
-
var analytics = new
|
|
3290
|
+
import { Command as Command12 } from "commander";
|
|
3291
|
+
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
3292
|
(opts, cmd) => runCommand(async () => {
|
|
3266
3293
|
const provider = await resolveProvider("enable-analytics", opts.provider);
|
|
3267
3294
|
const providerEnv = await collectProviderEnv(provider);
|
|
@@ -3291,8 +3318,8 @@ var analytics = new Command11("analytics").description("enable web analytics (Pl
|
|
|
3291
3318
|
);
|
|
3292
3319
|
|
|
3293
3320
|
// src/commands/enable/auth.ts
|
|
3294
|
-
import { Command as
|
|
3295
|
-
var auth = new
|
|
3321
|
+
import { Command as Command13 } from "commander";
|
|
3322
|
+
var auth = new Command13("auth").description("enable authentication (email/password + OAuth scaffold)").allowUnknownOption(true).allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
3296
3323
|
(_opts, cmd) => runCommand(
|
|
3297
3324
|
() => runPattern(
|
|
3298
3325
|
"enable-auth",
|
|
@@ -3317,8 +3344,8 @@ var auth = new Command12("auth").description("enable authentication (email/passw
|
|
|
3317
3344
|
);
|
|
3318
3345
|
|
|
3319
3346
|
// src/commands/enable/api.ts
|
|
3320
|
-
import { Command as
|
|
3321
|
-
var api = new
|
|
3347
|
+
import { Command as Command14 } from "commander";
|
|
3348
|
+
var api = new Command14("api").description("enable the PocketBase REST API").allowUnknownOption(true).allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
3322
3349
|
(_opts, cmd) => runCommand(
|
|
3323
3350
|
() => runPattern(
|
|
3324
3351
|
"enable-api",
|
|
@@ -3343,8 +3370,8 @@ var api = new Command13("api").description("enable the PocketBase REST API").all
|
|
|
3343
3370
|
);
|
|
3344
3371
|
|
|
3345
3372
|
// src/commands/enable/api-keys.ts
|
|
3346
|
-
import { Command as
|
|
3347
|
-
var apiKeys = new
|
|
3373
|
+
import { Command as Command15 } from "commander";
|
|
3374
|
+
var apiKeys = new Command15("api-keys").description("enable API key management").allowUnknownOption(true).allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
3348
3375
|
(_opts, cmd) => runCommand(
|
|
3349
3376
|
() => runPattern(
|
|
3350
3377
|
"enable-api-keys",
|
|
@@ -3369,8 +3396,8 @@ var apiKeys = new Command14("api-keys").description("enable API key management")
|
|
|
3369
3396
|
);
|
|
3370
3397
|
|
|
3371
3398
|
// src/commands/enable/backend.ts
|
|
3372
|
-
import { Command as
|
|
3373
|
-
var backend = new
|
|
3399
|
+
import { Command as Command16 } from "commander";
|
|
3400
|
+
var backend = new Command16("backend").description("enable the PocketBase backend").allowUnknownOption(true).allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
3374
3401
|
(_opts, cmd) => runCommand(
|
|
3375
3402
|
() => runPattern(
|
|
3376
3403
|
"enable-backend",
|
|
@@ -3395,8 +3422,8 @@ var backend = new Command15("backend").description("enable the PocketBase backen
|
|
|
3395
3422
|
);
|
|
3396
3423
|
|
|
3397
3424
|
// src/commands/enable/i18n.ts
|
|
3398
|
-
import { Command as
|
|
3399
|
-
var i18n = new
|
|
3425
|
+
import { Command as Command17 } from "commander";
|
|
3426
|
+
var i18n = new Command17("i18n").description("enable internationalization").allowUnknownOption(true).allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
3400
3427
|
(_opts, cmd) => runCommand(
|
|
3401
3428
|
() => runPattern(
|
|
3402
3429
|
"enable-i18n",
|
|
@@ -3421,8 +3448,8 @@ var i18n = new Command16("i18n").description("enable internationalization").allo
|
|
|
3421
3448
|
);
|
|
3422
3449
|
|
|
3423
3450
|
// src/commands/enable/teams.ts
|
|
3424
|
-
import { Command as
|
|
3425
|
-
var teams = new
|
|
3451
|
+
import { Command as Command18 } from "commander";
|
|
3452
|
+
var teams = new Command18("teams").description("enable team / multi-tenant support").allowUnknownOption(true).allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
3426
3453
|
(_opts, cmd) => runCommand(
|
|
3427
3454
|
() => runPattern(
|
|
3428
3455
|
"enable-teams",
|
|
@@ -3448,10 +3475,10 @@ var teams = new Command17("teams").description("enable team / multi-tenant suppo
|
|
|
3448
3475
|
|
|
3449
3476
|
// src/commands/enable/payments.ts
|
|
3450
3477
|
import process12 from "node:process";
|
|
3451
|
-
import { Command as
|
|
3478
|
+
import { Command as Command19 } from "commander";
|
|
3452
3479
|
import * as p17 from "@clack/prompts";
|
|
3453
3480
|
var PROVIDERS = [{ value: "stripe", label: "Stripe" }];
|
|
3454
|
-
var payments = new
|
|
3481
|
+
var payments = new Command19("payments").description("enable payments").option("--provider <provider>", "payment provider", "stripe").allowUnknownOption(true).allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
3455
3482
|
(opts, cmd) => runCommand(async () => {
|
|
3456
3483
|
const provider = await resolveProvider2(opts.provider, cmd.getOptionValueSource("provider"));
|
|
3457
3484
|
const input = {
|
|
@@ -3548,8 +3575,8 @@ async function promptPassword(message) {
|
|
|
3548
3575
|
}
|
|
3549
3576
|
|
|
3550
3577
|
// src/commands/enable/subscriptions.ts
|
|
3551
|
-
import { Command as
|
|
3552
|
-
var subscriptions = new
|
|
3578
|
+
import { Command as Command20 } from "commander";
|
|
3579
|
+
var subscriptions = new Command20("subscriptions").description("enable Stripe subscriptions (requires auth and payments)").allowUnknownOption(true).allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
3553
3580
|
(_opts, cmd) => runCommand(
|
|
3554
3581
|
() => runPattern(
|
|
3555
3582
|
"enable-subscriptions",
|
|
@@ -3574,8 +3601,8 @@ var subscriptions = new Command19("subscriptions").description("enable Stripe su
|
|
|
3574
3601
|
);
|
|
3575
3602
|
|
|
3576
3603
|
// src/commands/enable/notifications.ts
|
|
3577
|
-
import { Command as
|
|
3578
|
-
var notifications = new
|
|
3604
|
+
import { Command as Command21 } from "commander";
|
|
3605
|
+
var notifications = new Command21("notifications").description("enable in-app notifications with a bell dropdown (requires auth)").allowUnknownOption(true).allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
3579
3606
|
(_opts, cmd) => runCommand(
|
|
3580
3607
|
() => runPattern(
|
|
3581
3608
|
"enable-notifications",
|
|
@@ -3601,7 +3628,7 @@ var notifications = new Command20("notifications").description("enable in-app no
|
|
|
3601
3628
|
|
|
3602
3629
|
// src/commands/enable/s3.ts
|
|
3603
3630
|
import process16 from "node:process";
|
|
3604
|
-
import { Command as
|
|
3631
|
+
import { Command as Command22 } from "commander";
|
|
3605
3632
|
import * as p20 from "@clack/prompts";
|
|
3606
3633
|
import pc8 from "picocolors";
|
|
3607
3634
|
|
|
@@ -4900,7 +4927,7 @@ function hasFile(dir) {
|
|
|
4900
4927
|
|
|
4901
4928
|
// src/commands/enable/s3.ts
|
|
4902
4929
|
var s3 = addTargetOptions(
|
|
4903
|
-
new
|
|
4930
|
+
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
4931
|
"local"
|
|
4905
4932
|
).action(
|
|
4906
4933
|
(raw) => runCommand(() => {
|
|
@@ -5007,9 +5034,9 @@ async function confirm4(message, initialValue) {
|
|
|
5007
5034
|
|
|
5008
5035
|
// src/commands/enable/smtp.ts
|
|
5009
5036
|
import process17 from "node:process";
|
|
5010
|
-
import { Command as
|
|
5037
|
+
import { Command as Command23 } from "commander";
|
|
5011
5038
|
import * as p21 from "@clack/prompts";
|
|
5012
|
-
var smtp = new
|
|
5039
|
+
var smtp = new Command23("smtp").description("configure SMTP for transactional email").configureHelp(helpConfig).action(
|
|
5013
5040
|
() => runCommand(async () => {
|
|
5014
5041
|
const { workspaceRootDir } = await getWorkspace();
|
|
5015
5042
|
const config = await p21.group(
|
|
@@ -5063,10 +5090,10 @@ var smtp = new Command22("smtp").description("configure SMTP for transactional e
|
|
|
5063
5090
|
|
|
5064
5091
|
// src/commands/enable/cms.ts
|
|
5065
5092
|
import process18 from "node:process";
|
|
5066
|
-
import { Command as
|
|
5093
|
+
import { Command as Command24 } from "commander";
|
|
5067
5094
|
import * as p22 from "@clack/prompts";
|
|
5068
5095
|
import pc9 from "picocolors";
|
|
5069
|
-
var cms = new
|
|
5096
|
+
var cms = new Command24("cms").description("enable an inline-editing CMS with an admin bar").option(
|
|
5070
5097
|
"--endpoint <url>",
|
|
5071
5098
|
"read from a hosted CMS at this URL instead of installing the backend in this app"
|
|
5072
5099
|
).allowUnknownOption(true).allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
@@ -5099,8 +5126,8 @@ Run ${pc9.cyan("vela bless")} to add a backend, or point at a hosted CMS with ${
|
|
|
5099
5126
|
);
|
|
5100
5127
|
|
|
5101
5128
|
// src/commands/enable/blog.ts
|
|
5102
|
-
import { Command as
|
|
5103
|
-
var blog = new
|
|
5129
|
+
import { Command as Command25 } from "commander";
|
|
5130
|
+
var blog = new Command25("blog").description("enable an mdsvex blog with posts, tags, and RSS").allowUnknownOption(true).allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
5104
5131
|
(_opts, cmd) => runCommand(
|
|
5105
5132
|
() => runPattern(
|
|
5106
5133
|
"enable-blog",
|
|
@@ -5125,8 +5152,8 @@ var blog = new Command24("blog").description("enable an mdsvex blog with posts,
|
|
|
5125
5152
|
);
|
|
5126
5153
|
|
|
5127
5154
|
// src/commands/enable/content-negotiation.ts
|
|
5128
|
-
import { Command as
|
|
5129
|
-
var contentNegotiation = new
|
|
5155
|
+
import { Command as Command26 } from "commander";
|
|
5156
|
+
var contentNegotiation = new Command26("content-negotiation").description("enable content negotiation (sveltekit-negotiate)").allowUnknownOption(true).allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
5130
5157
|
(_opts, cmd) => runCommand(
|
|
5131
5158
|
() => runPattern(
|
|
5132
5159
|
"enable-content-negotiation",
|
|
@@ -5149,14 +5176,40 @@ var contentNegotiation = new Command25("content-negotiation").description("enabl
|
|
|
5149
5176
|
)
|
|
5150
5177
|
);
|
|
5151
5178
|
|
|
5179
|
+
// src/commands/enable/workflows.ts
|
|
5180
|
+
import { Command as Command27 } from "commander";
|
|
5181
|
+
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(
|
|
5182
|
+
(_opts, cmd) => runCommand(
|
|
5183
|
+
() => runPattern(
|
|
5184
|
+
"enable-workflows",
|
|
5185
|
+
cmd.args,
|
|
5186
|
+
{},
|
|
5187
|
+
{
|
|
5188
|
+
summary: "Enabled workflows.",
|
|
5189
|
+
nextSteps: [
|
|
5190
|
+
"Run `vela generate workflow <name>` to add one to src/lib/workflows/.",
|
|
5191
|
+
"Start a run from server code with `<name>.run(input)`; runs show up under Workflows in the PocketBase dashboard.",
|
|
5192
|
+
"Read src/lib/workflows/README.md for recurring workflows, retries and the worker settings."
|
|
5193
|
+
],
|
|
5194
|
+
task: {
|
|
5195
|
+
title: "Enabling workflows",
|
|
5196
|
+
success: "Enabled workflows",
|
|
5197
|
+
error: "Failed to enable workflows"
|
|
5198
|
+
}
|
|
5199
|
+
}
|
|
5200
|
+
),
|
|
5201
|
+
"Failed to enable workflows."
|
|
5202
|
+
)
|
|
5203
|
+
);
|
|
5204
|
+
|
|
5152
5205
|
// src/commands/enable.ts
|
|
5153
|
-
var enable = new
|
|
5206
|
+
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
5207
|
|
|
5155
5208
|
// src/commands/disable.ts
|
|
5156
|
-
import { Command as
|
|
5209
|
+
import { Command as Command41 } from "commander";
|
|
5157
5210
|
|
|
5158
5211
|
// src/commands/disable/auth.ts
|
|
5159
|
-
import { Command as
|
|
5212
|
+
import { Command as Command29 } from "commander";
|
|
5160
5213
|
|
|
5161
5214
|
// src/commands/disable/_shared.ts
|
|
5162
5215
|
import process19 from "node:process";
|
|
@@ -5176,7 +5229,7 @@ async function runDisable(opts, flags, cmdArgs) {
|
|
|
5176
5229
|
}
|
|
5177
5230
|
|
|
5178
5231
|
// src/commands/disable/auth.ts
|
|
5179
|
-
var auth2 = new
|
|
5232
|
+
var auth2 = new Command29("auth").description("disable authentication").option("-y, --yes", "skip confirmation prompt").allowUnknownOption(true).allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
5180
5233
|
(opts, cmd) => runCommand(
|
|
5181
5234
|
() => runDisable(
|
|
5182
5235
|
{
|
|
@@ -5202,8 +5255,8 @@ var auth2 = new Command27("auth").description("disable authentication").option("
|
|
|
5202
5255
|
);
|
|
5203
5256
|
|
|
5204
5257
|
// src/commands/disable/api.ts
|
|
5205
|
-
import { Command as
|
|
5206
|
-
var api2 = new
|
|
5258
|
+
import { Command as Command30 } from "commander";
|
|
5259
|
+
var api2 = new Command30("api").description("disable the REST API").option("-y, --yes", "skip confirmation prompt").allowUnknownOption(true).allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
5207
5260
|
(opts, cmd) => runCommand(
|
|
5208
5261
|
() => runDisable(
|
|
5209
5262
|
{
|
|
@@ -5226,8 +5279,8 @@ var api2 = new Command28("api").description("disable the REST API").option("-y,
|
|
|
5226
5279
|
);
|
|
5227
5280
|
|
|
5228
5281
|
// src/commands/disable/api-keys.ts
|
|
5229
|
-
import { Command as
|
|
5230
|
-
var apiKeys2 = new
|
|
5282
|
+
import { Command as Command31 } from "commander";
|
|
5283
|
+
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
5284
|
(opts, cmd) => runCommand(
|
|
5232
5285
|
() => runDisable(
|
|
5233
5286
|
{
|
|
@@ -5250,8 +5303,8 @@ var apiKeys2 = new Command29("api-keys").description("disable API key management
|
|
|
5250
5303
|
);
|
|
5251
5304
|
|
|
5252
5305
|
// src/commands/disable/backend.ts
|
|
5253
|
-
import { Command as
|
|
5254
|
-
var backend2 = new
|
|
5306
|
+
import { Command as Command32 } from "commander";
|
|
5307
|
+
var backend2 = new Command32("backend").description("disable the PocketBase backend").option("-y, --yes", "skip confirmation prompt").allowUnknownOption(true).allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
5255
5308
|
(opts, cmd) => runCommand(
|
|
5256
5309
|
() => runDisable(
|
|
5257
5310
|
{
|
|
@@ -5274,8 +5327,8 @@ var backend2 = new Command30("backend").description("disable the PocketBase back
|
|
|
5274
5327
|
);
|
|
5275
5328
|
|
|
5276
5329
|
// src/commands/disable/content-negotiation.ts
|
|
5277
|
-
import { Command as
|
|
5278
|
-
var contentNegotiation2 = new
|
|
5330
|
+
import { Command as Command33 } from "commander";
|
|
5331
|
+
var contentNegotiation2 = new Command33("content-negotiation").description("disable content negotiation").option("-y, --yes", "skip confirmation prompt").allowUnknownOption(true).allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
5279
5332
|
(opts, cmd) => runCommand(
|
|
5280
5333
|
() => runDisable(
|
|
5281
5334
|
{
|
|
@@ -5298,8 +5351,8 @@ var contentNegotiation2 = new Command31("content-negotiation").description("disa
|
|
|
5298
5351
|
);
|
|
5299
5352
|
|
|
5300
5353
|
// src/commands/disable/i18n.ts
|
|
5301
|
-
import { Command as
|
|
5302
|
-
var i18n2 = new
|
|
5354
|
+
import { Command as Command34 } from "commander";
|
|
5355
|
+
var i18n2 = new Command34("i18n").description("disable internationalization").option("-y, --yes", "skip confirmation prompt").allowUnknownOption(true).allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
5303
5356
|
(opts, cmd) => runCommand(
|
|
5304
5357
|
() => runDisable(
|
|
5305
5358
|
{
|
|
@@ -5325,8 +5378,8 @@ var i18n2 = new Command32("i18n").description("disable internationalization").op
|
|
|
5325
5378
|
);
|
|
5326
5379
|
|
|
5327
5380
|
// src/commands/disable/notifications.ts
|
|
5328
|
-
import { Command as
|
|
5329
|
-
var notifications2 = new
|
|
5381
|
+
import { Command as Command35 } from "commander";
|
|
5382
|
+
var notifications2 = new Command35("notifications").description("disable in-app notifications").option("-y, --yes", "skip confirmation prompt").allowUnknownOption(true).allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
5330
5383
|
(opts, cmd) => runCommand(
|
|
5331
5384
|
() => runDisable(
|
|
5332
5385
|
{
|
|
@@ -5352,8 +5405,8 @@ var notifications2 = new Command33("notifications").description("disable in-app
|
|
|
5352
5405
|
);
|
|
5353
5406
|
|
|
5354
5407
|
// src/commands/disable/teams.ts
|
|
5355
|
-
import { Command as
|
|
5356
|
-
var teams2 = new
|
|
5408
|
+
import { Command as Command36 } from "commander";
|
|
5409
|
+
var teams2 = new Command36("teams").description("disable teams").option("-y, --yes", "skip confirmation prompt").allowUnknownOption(true).allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
5357
5410
|
(opts, cmd) => runCommand(
|
|
5358
5411
|
() => runDisable(
|
|
5359
5412
|
{
|
|
@@ -5376,8 +5429,8 @@ var teams2 = new Command34("teams").description("disable teams").option("-y, --y
|
|
|
5376
5429
|
);
|
|
5377
5430
|
|
|
5378
5431
|
// src/commands/disable/payments.ts
|
|
5379
|
-
import { Command as
|
|
5380
|
-
var payments2 = new
|
|
5432
|
+
import { Command as Command37 } from "commander";
|
|
5433
|
+
var payments2 = new Command37("payments").description("disable payments").option("-y, --yes", "skip confirmation prompt").allowUnknownOption(true).allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
5381
5434
|
(opts, cmd) => runCommand(
|
|
5382
5435
|
() => runDisable(
|
|
5383
5436
|
{
|
|
@@ -5404,11 +5457,11 @@ var payments2 = new Command35("payments").description("disable payments").option
|
|
|
5404
5457
|
);
|
|
5405
5458
|
|
|
5406
5459
|
// src/commands/disable/s3.ts
|
|
5407
|
-
import { Command as
|
|
5460
|
+
import { Command as Command38 } from "commander";
|
|
5408
5461
|
import * as p24 from "@clack/prompts";
|
|
5409
5462
|
import pc10 from "picocolors";
|
|
5410
5463
|
var s32 = addTargetOptions(
|
|
5411
|
-
new
|
|
5464
|
+
new Command38("s3").description("disable S3 file storage").option("--backups", "keep backups on the server again, rather than uploads").configureHelp(helpConfig),
|
|
5412
5465
|
"local"
|
|
5413
5466
|
).action(
|
|
5414
5467
|
(raw) => runCommand(() => {
|
|
@@ -5437,8 +5490,8 @@ function label2(filesystem) {
|
|
|
5437
5490
|
}
|
|
5438
5491
|
|
|
5439
5492
|
// src/commands/disable/subscriptions.ts
|
|
5440
|
-
import { Command as
|
|
5441
|
-
var subscriptions2 = new
|
|
5493
|
+
import { Command as Command39 } from "commander";
|
|
5494
|
+
var subscriptions2 = new Command39("subscriptions").description("disable Stripe subscriptions").option("-y, --yes", "skip confirmation prompt").allowUnknownOption(true).allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
5442
5495
|
(opts, cmd) => runCommand(
|
|
5443
5496
|
() => runDisable(
|
|
5444
5497
|
{
|
|
@@ -5465,8 +5518,8 @@ var subscriptions2 = new Command37("subscriptions").description("disable Stripe
|
|
|
5465
5518
|
);
|
|
5466
5519
|
|
|
5467
5520
|
// src/commands/disable/smtp.ts
|
|
5468
|
-
import { Command as
|
|
5469
|
-
var smtp2 = new
|
|
5521
|
+
import { Command as Command40 } from "commander";
|
|
5522
|
+
var smtp2 = new Command40("smtp").description("disable SMTP configuration").configureHelp(helpConfig).action(
|
|
5470
5523
|
() => runCommand(async () => {
|
|
5471
5524
|
const { workspaceRootDir } = await getWorkspace();
|
|
5472
5525
|
await withPocketbase(workspaceRootDir, async (pb) => {
|
|
@@ -5483,13 +5536,13 @@ var smtp2 = new Command38("smtp").description("disable SMTP configuration").conf
|
|
|
5483
5536
|
);
|
|
5484
5537
|
|
|
5485
5538
|
// src/commands/disable.ts
|
|
5486
|
-
var disable = new
|
|
5539
|
+
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
5540
|
|
|
5488
5541
|
// src/commands/destroy.ts
|
|
5489
|
-
import { Command as
|
|
5542
|
+
import { Command as Command47 } from "commander";
|
|
5490
5543
|
|
|
5491
5544
|
// src/commands/destroy/form.ts
|
|
5492
|
-
import { Command as
|
|
5545
|
+
import { Command as Command42 } from "commander";
|
|
5493
5546
|
|
|
5494
5547
|
// src/commands/destroy/_shared.ts
|
|
5495
5548
|
import process20 from "node:process";
|
|
@@ -5506,7 +5559,7 @@ async function runDestroy(slug2, model, confirmMessage, report4, flags) {
|
|
|
5506
5559
|
}
|
|
5507
5560
|
|
|
5508
5561
|
// src/commands/destroy/form.ts
|
|
5509
|
-
var form2 = new
|
|
5562
|
+
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
5563
|
"--route <route>",
|
|
5511
5564
|
"custom route the form was generated at (must match the --route used at generation)"
|
|
5512
5565
|
).allowUnknownOption(true).allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
@@ -5530,8 +5583,8 @@ var form2 = new Command40("form").description("destroy a form generated by `vela
|
|
|
5530
5583
|
);
|
|
5531
5584
|
|
|
5532
5585
|
// src/commands/destroy/schema.ts
|
|
5533
|
-
import { Command as
|
|
5534
|
-
var schema2 = new
|
|
5586
|
+
import { Command as Command43 } from "commander";
|
|
5587
|
+
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
5588
|
(model, opts) => runCommand(
|
|
5536
5589
|
() => runDestroy(
|
|
5537
5590
|
"destroy-schema",
|
|
@@ -5552,8 +5605,8 @@ var schema2 = new Command41("schema").description("destroy a zod schema generate
|
|
|
5552
5605
|
);
|
|
5553
5606
|
|
|
5554
5607
|
// src/commands/destroy/resource.ts
|
|
5555
|
-
import { Command as
|
|
5556
|
-
var resource2 = new
|
|
5608
|
+
import { Command as Command44 } from "commander";
|
|
5609
|
+
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
5610
|
(model, opts) => runCommand(
|
|
5558
5611
|
() => runDestroy(
|
|
5559
5612
|
"destroy-resource",
|
|
@@ -5574,8 +5627,8 @@ var resource2 = new Command42("resource").description("destroy a resource genera
|
|
|
5574
5627
|
);
|
|
5575
5628
|
|
|
5576
5629
|
// src/commands/destroy/scaffold.ts
|
|
5577
|
-
import { Command as
|
|
5578
|
-
var scaffold2 = new
|
|
5630
|
+
import { Command as Command45 } from "commander";
|
|
5631
|
+
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
5632
|
"--route <route>",
|
|
5580
5633
|
"custom route the scaffold was generated at (must match the --route used at generation)"
|
|
5581
5634
|
).allowUnknownOption(true).allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
@@ -5603,7 +5656,7 @@ var scaffold2 = new Command43("scaffold").description("destroy a scaffold genera
|
|
|
5603
5656
|
|
|
5604
5657
|
// src/commands/destroy/deployment.ts
|
|
5605
5658
|
import process21 from "node:process";
|
|
5606
|
-
import { Command as
|
|
5659
|
+
import { Command as Command46 } from "commander";
|
|
5607
5660
|
import * as p28 from "@clack/prompts";
|
|
5608
5661
|
import pc13 from "picocolors";
|
|
5609
5662
|
|
|
@@ -5769,7 +5822,7 @@ ${pc12.dim(err instanceof Error ? err.message : String(err))}`
|
|
|
5769
5822
|
// src/commands/destroy/deployment.ts
|
|
5770
5823
|
var deployment = addLockWaitOption(
|
|
5771
5824
|
addTargetOptions(
|
|
5772
|
-
new
|
|
5825
|
+
new Command46("deployment").description("remove a deployed environment from its server").configureHelp(helpConfig),
|
|
5773
5826
|
"production"
|
|
5774
5827
|
)
|
|
5775
5828
|
).option("--purge", "also delete the database and uploaded files").option("-y, --yes", "skip the confirmation prompt").option(
|
|
@@ -5848,13 +5901,13 @@ async function confirm8(appName, targetName, byName) {
|
|
|
5848
5901
|
}
|
|
5849
5902
|
|
|
5850
5903
|
// src/commands/destroy.ts
|
|
5851
|
-
var destroy = new
|
|
5904
|
+
var destroy = new Command47("destroy").description("destroy scaffolding, or a deployment").configureHelp(helpConfig).addCommand(form2).addCommand(schema2).addCommand(resource2).addCommand(scaffold2).addCommand(deployment);
|
|
5852
5905
|
|
|
5853
5906
|
// src/commands/ui.ts
|
|
5854
|
-
import { Command as
|
|
5907
|
+
import { Command as Command53 } from "commander";
|
|
5855
5908
|
|
|
5856
5909
|
// src/commands/ui/add.ts
|
|
5857
|
-
import { Command as
|
|
5910
|
+
import { Command as Command48 } from "commander";
|
|
5858
5911
|
import * as p29 from "@clack/prompts";
|
|
5859
5912
|
import { installComponents } from "@velastack/patterns";
|
|
5860
5913
|
|
|
@@ -5904,21 +5957,21 @@ function uiAddReport(requested, outcome) {
|
|
|
5904
5957
|
}
|
|
5905
5958
|
|
|
5906
5959
|
// src/commands/ui/add.ts
|
|
5907
|
-
var add = new
|
|
5960
|
+
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
5961
|
(components, options) => runCommand(async () => {
|
|
5909
5962
|
const { workspaceRootDir } = await getWorkspace();
|
|
5910
|
-
const
|
|
5963
|
+
const log49 = p29.taskLog({ title: "Adding UI components..." });
|
|
5911
5964
|
let outcome;
|
|
5912
5965
|
try {
|
|
5913
5966
|
outcome = await installComponents({
|
|
5914
5967
|
root: workspaceRootDir,
|
|
5915
5968
|
components,
|
|
5916
5969
|
overwrite: options.overwrite,
|
|
5917
|
-
logger: { info: (message) =>
|
|
5970
|
+
logger: { info: (message) => log49.message(message) }
|
|
5918
5971
|
});
|
|
5919
|
-
|
|
5972
|
+
log49.success("UI components ready");
|
|
5920
5973
|
} catch (e) {
|
|
5921
|
-
|
|
5974
|
+
log49.error("Could not add UI components");
|
|
5922
5975
|
throw e;
|
|
5923
5976
|
}
|
|
5924
5977
|
reportResult(uiAddReport(components, outcome));
|
|
@@ -5926,19 +5979,19 @@ var add = new Command46("add").description("add ui components (shadcn-svelte ite
|
|
|
5926
5979
|
);
|
|
5927
5980
|
|
|
5928
5981
|
// src/commands/ui/base.ts
|
|
5929
|
-
import { Command as
|
|
5982
|
+
import { Command as Command49 } from "commander";
|
|
5930
5983
|
import * as p30 from "@clack/prompts";
|
|
5931
5984
|
import { applyBaseColor } from "@velastack/patterns";
|
|
5932
|
-
var base = new
|
|
5985
|
+
var base = new Command49("base").description("change the base (gray) palette").argument("<color>", `base color to use (${BASE_COLORS.join(", ")})`).configureHelp(helpConfig).action(
|
|
5933
5986
|
(color) => runCommand(async () => {
|
|
5934
5987
|
const { workspaceRootDir } = await getWorkspace();
|
|
5935
|
-
const
|
|
5988
|
+
const log49 = p30.taskLog({ title: `Applying the ${color} palette...` });
|
|
5936
5989
|
let outcome;
|
|
5937
5990
|
try {
|
|
5938
5991
|
outcome = await applyBaseColor({ root: workspaceRootDir, color });
|
|
5939
|
-
|
|
5992
|
+
log49.success("Palette applied");
|
|
5940
5993
|
} catch (e) {
|
|
5941
|
-
|
|
5994
|
+
log49.error("Could not change the base color");
|
|
5942
5995
|
throw e;
|
|
5943
5996
|
}
|
|
5944
5997
|
reportResult({
|
|
@@ -5954,7 +6007,7 @@ var base = new Command47("base").description("change the base (gray) palette").a
|
|
|
5954
6007
|
);
|
|
5955
6008
|
|
|
5956
6009
|
// src/commands/ui/list.ts
|
|
5957
|
-
import { Command as
|
|
6010
|
+
import { Command as Command50 } from "commander";
|
|
5958
6011
|
import * as p31 from "@clack/prompts";
|
|
5959
6012
|
import { listComponents } from "@velastack/patterns";
|
|
5960
6013
|
|
|
@@ -5986,7 +6039,7 @@ function uiListReport(result) {
|
|
|
5986
6039
|
}
|
|
5987
6040
|
|
|
5988
6041
|
// src/commands/ui/list.ts
|
|
5989
|
-
var list = new
|
|
6042
|
+
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
6043
|
(options) => runCommand(async () => {
|
|
5991
6044
|
const { workspaceRootDir } = await getWorkspace();
|
|
5992
6045
|
if (options.json) {
|
|
@@ -6013,7 +6066,7 @@ Registry components are not listed.`);
|
|
|
6013
6066
|
);
|
|
6014
6067
|
|
|
6015
6068
|
// src/commands/ui/style.ts
|
|
6016
|
-
import { Command as
|
|
6069
|
+
import { Command as Command51 } from "commander";
|
|
6017
6070
|
import * as p32 from "@clack/prompts";
|
|
6018
6071
|
import { switchStyle } from "@velastack/patterns";
|
|
6019
6072
|
|
|
@@ -6040,19 +6093,19 @@ function uiStyleReport(result) {
|
|
|
6040
6093
|
}
|
|
6041
6094
|
|
|
6042
6095
|
// src/commands/ui/style.ts
|
|
6043
|
-
var style = new
|
|
6096
|
+
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
6097
|
(name, options) => runCommand(async () => {
|
|
6045
6098
|
const { workspaceRootDir } = await getWorkspace();
|
|
6046
6099
|
const spinner8 = p32.spinner();
|
|
6047
6100
|
spinner8.start(`Reading the ${name} registry...`);
|
|
6048
|
-
let
|
|
6101
|
+
let log49;
|
|
6049
6102
|
let outcome;
|
|
6050
6103
|
try {
|
|
6051
6104
|
outcome = await switchStyle({
|
|
6052
6105
|
root: workspaceRootDir,
|
|
6053
6106
|
style: name,
|
|
6054
6107
|
font: options.font,
|
|
6055
|
-
logger: { info: (message) =>
|
|
6108
|
+
logger: { info: (message) => log49?.message(message) },
|
|
6056
6109
|
confirm: async (components) => {
|
|
6057
6110
|
spinner8.stop(`Read the ${name} registry`);
|
|
6058
6111
|
if (components.length > 0) {
|
|
@@ -6069,13 +6122,13 @@ ${components.map((c) => `- ${c}`).join("\n")}`
|
|
|
6069
6122
|
const ok = await p32.confirm({ message: `Switch to ${name}?`, initialValue: false });
|
|
6070
6123
|
if (p32.isCancel(ok) || !ok) return false;
|
|
6071
6124
|
}
|
|
6072
|
-
|
|
6125
|
+
log49 = p32.taskLog({ title: `Switching to the ${name} style...` });
|
|
6073
6126
|
return true;
|
|
6074
6127
|
}
|
|
6075
6128
|
});
|
|
6076
6129
|
} catch (e) {
|
|
6077
6130
|
spinner8.stop(`Could not switch to ${name}`);
|
|
6078
|
-
|
|
6131
|
+
log49?.error("Could not switch style");
|
|
6079
6132
|
throw e;
|
|
6080
6133
|
}
|
|
6081
6134
|
spinner8.stop(`Read the ${name} registry`);
|
|
@@ -6087,25 +6140,25 @@ ${components.map((c) => `- ${c}`).join("\n")}`
|
|
|
6087
6140
|
p32.cancel("Operation cancelled.");
|
|
6088
6141
|
return;
|
|
6089
6142
|
}
|
|
6090
|
-
|
|
6143
|
+
log49?.success("Style switched");
|
|
6091
6144
|
reportResult(uiStyleReport(outcome));
|
|
6092
6145
|
}, "Failed to switch style.")
|
|
6093
6146
|
);
|
|
6094
6147
|
|
|
6095
6148
|
// src/commands/ui/theme.ts
|
|
6096
|
-
import { Command as
|
|
6149
|
+
import { Command as Command52 } from "commander";
|
|
6097
6150
|
import * as p33 from "@clack/prompts";
|
|
6098
6151
|
import { applyTheme } from "@velastack/patterns";
|
|
6099
|
-
var theme = new
|
|
6152
|
+
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
6153
|
(accent) => runCommand(async () => {
|
|
6101
6154
|
const { workspaceRootDir } = await getWorkspace();
|
|
6102
|
-
const
|
|
6155
|
+
const log49 = p33.taskLog({ title: `Applying the ${accent} accent...` });
|
|
6103
6156
|
let outcome;
|
|
6104
6157
|
try {
|
|
6105
6158
|
outcome = await applyTheme({ root: workspaceRootDir, theme: accent });
|
|
6106
|
-
|
|
6159
|
+
log49.success("Accent applied");
|
|
6107
6160
|
} catch (e) {
|
|
6108
|
-
|
|
6161
|
+
log49.error("Could not change the accent");
|
|
6109
6162
|
throw e;
|
|
6110
6163
|
}
|
|
6111
6164
|
reportResult({
|
|
@@ -6121,15 +6174,15 @@ var theme = new Command50("theme").description("change the accent color, keeping
|
|
|
6121
6174
|
);
|
|
6122
6175
|
|
|
6123
6176
|
// src/commands/ui.ts
|
|
6124
|
-
var ui = new
|
|
6177
|
+
var ui = new Command53("ui").description("generate ui components").configureHelp(helpConfig).addCommand(add).addCommand(list).addCommand(style).addCommand(base).addCommand(theme);
|
|
6125
6178
|
|
|
6126
6179
|
// src/commands/legal.ts
|
|
6127
|
-
import { Command as
|
|
6180
|
+
import { Command as Command56 } from "commander";
|
|
6128
6181
|
|
|
6129
6182
|
// src/commands/legal/terms.ts
|
|
6130
6183
|
import fs26 from "node:fs";
|
|
6131
6184
|
import path23 from "node:path";
|
|
6132
|
-
import { Command as
|
|
6185
|
+
import { Command as Command54 } from "commander";
|
|
6133
6186
|
import * as p35 from "@clack/prompts";
|
|
6134
6187
|
|
|
6135
6188
|
// src/commands/legal/shared.ts
|
|
@@ -6813,12 +6866,12 @@ async function termsAction() {
|
|
|
6813
6866
|
]
|
|
6814
6867
|
});
|
|
6815
6868
|
}
|
|
6816
|
-
var terms = new
|
|
6869
|
+
var terms = new Command54("terms").description("generate placeholder terms and conditions").configureHelp(helpConfig).action(() => runCommand(termsAction, "Failed to generate terms and conditions."));
|
|
6817
6870
|
|
|
6818
6871
|
// src/commands/legal/privacy.ts
|
|
6819
6872
|
import fs27 from "node:fs";
|
|
6820
6873
|
import path24 from "node:path";
|
|
6821
|
-
import { Command as
|
|
6874
|
+
import { Command as Command55 } from "commander";
|
|
6822
6875
|
import * as p36 from "@clack/prompts";
|
|
6823
6876
|
var mapLabels = {
|
|
6824
6877
|
personalInfo: {
|
|
@@ -7562,16 +7615,16 @@ async function privacyAction() {
|
|
|
7562
7615
|
]
|
|
7563
7616
|
});
|
|
7564
7617
|
}
|
|
7565
|
-
var privacy = new
|
|
7618
|
+
var privacy = new Command55("privacy").description("generate placeholder privacy policy").configureHelp(helpConfig).action(() => runCommand(privacyAction, "Failed to generate privacy policy."));
|
|
7566
7619
|
|
|
7567
7620
|
// src/commands/legal.ts
|
|
7568
|
-
var legal = new
|
|
7621
|
+
var legal = new Command56("legal").description("generate placeholder legal documents").configureHelp(helpConfig).addCommand(terms).addCommand(privacy);
|
|
7569
7622
|
|
|
7570
7623
|
// src/commands/fixtures.ts
|
|
7571
|
-
import { Command as
|
|
7624
|
+
import { Command as Command62 } from "commander";
|
|
7572
7625
|
|
|
7573
7626
|
// src/commands/fixtures/load.ts
|
|
7574
|
-
import { Command as
|
|
7627
|
+
import { Command as Command57 } from "commander";
|
|
7575
7628
|
|
|
7576
7629
|
// src/lib/data.ts
|
|
7577
7630
|
import fs28 from "node:fs";
|
|
@@ -7761,7 +7814,7 @@ async function hasLoadedFixtures(pb) {
|
|
|
7761
7814
|
}
|
|
7762
7815
|
|
|
7763
7816
|
// src/commands/fixtures/load.ts
|
|
7764
|
-
var load = new
|
|
7817
|
+
var load = new Command57("load").description("load fixtures into the database").configureHelp(helpConfig).action(
|
|
7765
7818
|
() => runCommand(async () => {
|
|
7766
7819
|
const { workspaceRootDir } = await getWorkspace();
|
|
7767
7820
|
let loaded = [];
|
|
@@ -7787,8 +7840,8 @@ var load = new Command55("load").description("load fixtures into the database").
|
|
|
7787
7840
|
);
|
|
7788
7841
|
|
|
7789
7842
|
// src/commands/fixtures/clear.ts
|
|
7790
|
-
import { Command as
|
|
7791
|
-
var clear = new
|
|
7843
|
+
import { Command as Command58 } from "commander";
|
|
7844
|
+
var clear = new Command58("clear").description("clear loaded fixtures").configureHelp(helpConfig).action(
|
|
7792
7845
|
() => runCommand(async () => {
|
|
7793
7846
|
const { workspaceRootDir } = await getWorkspace();
|
|
7794
7847
|
let cleared = [];
|
|
@@ -7817,8 +7870,8 @@ var clear = new Command56("clear").description("clear loaded fixtures").configur
|
|
|
7817
7870
|
);
|
|
7818
7871
|
|
|
7819
7872
|
// src/commands/fixtures/reset.ts
|
|
7820
|
-
import { Command as
|
|
7821
|
-
var reset = new
|
|
7873
|
+
import { Command as Command59 } from "commander";
|
|
7874
|
+
var reset = new Command59("reset").description("clear and reload fixtures").configureHelp(helpConfig).action(
|
|
7822
7875
|
() => runCommand(async () => {
|
|
7823
7876
|
const { workspaceRootDir } = await getWorkspace();
|
|
7824
7877
|
let cleared = [];
|
|
@@ -7850,7 +7903,7 @@ var reset = new Command57("reset").description("clear and reload fixtures").conf
|
|
|
7850
7903
|
// src/commands/fixtures/generate.ts
|
|
7851
7904
|
import fs29 from "node:fs";
|
|
7852
7905
|
import path26 from "node:path";
|
|
7853
|
-
import { Command as
|
|
7906
|
+
import { Command as Command60, InvalidArgumentError } from "commander";
|
|
7854
7907
|
import * as p37 from "@clack/prompts";
|
|
7855
7908
|
import { annotate } from "annotate-json-schema";
|
|
7856
7909
|
import { createGenerator } from "json-schema-faker";
|
|
@@ -7961,7 +8014,7 @@ async function generateFixtureFiles(pb, workspaceRootDir, opts) {
|
|
|
7961
8014
|
}
|
|
7962
8015
|
return { writtenFiles, warnings };
|
|
7963
8016
|
}
|
|
7964
|
-
var generate2 = new
|
|
8017
|
+
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
8018
|
(opts) => runCommand(async () => {
|
|
7966
8019
|
const { workspaceRootDir } = await getWorkspace();
|
|
7967
8020
|
const existing = getFixtureFiles(workspaceRootDir);
|
|
@@ -8014,7 +8067,7 @@ var generate2 = new Command58("generate").description("generate fixture data").o
|
|
|
8014
8067
|
);
|
|
8015
8068
|
|
|
8016
8069
|
// src/commands/fixtures/regen.ts
|
|
8017
|
-
import { Command as
|
|
8070
|
+
import { Command as Command61, InvalidArgumentError as InvalidArgumentError2 } from "commander";
|
|
8018
8071
|
import * as p38 from "@clack/prompts";
|
|
8019
8072
|
function parseCount2(value) {
|
|
8020
8073
|
const n = parseInt(value, 10);
|
|
@@ -8030,7 +8083,7 @@ function parseSeed2(value) {
|
|
|
8030
8083
|
}
|
|
8031
8084
|
return n;
|
|
8032
8085
|
}
|
|
8033
|
-
var regen = new
|
|
8086
|
+
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
8087
|
(opts) => runCommand(async () => {
|
|
8035
8088
|
const { workspaceRootDir } = await getWorkspace();
|
|
8036
8089
|
let cleared = [];
|
|
@@ -8059,14 +8112,14 @@ var regen = new Command59("regen").description("clear the database, regenerate f
|
|
|
8059
8112
|
);
|
|
8060
8113
|
|
|
8061
8114
|
// src/commands/fixtures.ts
|
|
8062
|
-
var fixtures = new
|
|
8115
|
+
var fixtures = new Command62("fixtures").description("manage fixture data").configureHelp(helpConfig).addCommand(generate2).addCommand(load).addCommand(clear).addCommand(reset).addCommand(regen);
|
|
8063
8116
|
|
|
8064
8117
|
// src/commands/seeds.ts
|
|
8065
|
-
import { Command as
|
|
8118
|
+
import { Command as Command66 } from "commander";
|
|
8066
8119
|
|
|
8067
8120
|
// src/commands/seeds/load.ts
|
|
8068
|
-
import { Command as
|
|
8069
|
-
var load2 = new
|
|
8121
|
+
import { Command as Command63 } from "commander";
|
|
8122
|
+
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
8123
|
(opts) => runCommand(async () => {
|
|
8071
8124
|
const { workspaceRootDir } = await getWorkspace();
|
|
8072
8125
|
const seedFiles = getSeedFiles(workspaceRootDir);
|
|
@@ -8105,7 +8158,7 @@ var load2 = new Command61("load").description("load seeds into the database").op
|
|
|
8105
8158
|
// src/commands/seeds/save.ts
|
|
8106
8159
|
import fs30 from "node:fs";
|
|
8107
8160
|
import path27 from "node:path";
|
|
8108
|
-
import { Command as
|
|
8161
|
+
import { Command as Command64 } from "commander";
|
|
8109
8162
|
var padZeros2 = (num, length) => num.toString().padStart(length, "0");
|
|
8110
8163
|
function filterSystemFields(record, systemFieldNames) {
|
|
8111
8164
|
const out = {};
|
|
@@ -8116,7 +8169,7 @@ function filterSystemFields(record, systemFieldNames) {
|
|
|
8116
8169
|
}
|
|
8117
8170
|
return out;
|
|
8118
8171
|
}
|
|
8119
|
-
var save = new
|
|
8172
|
+
var save = new Command64("save").description("save the current data as seeds").option("-f, --force", "overwrite existing seed files").configureHelp(helpConfig).action(
|
|
8120
8173
|
(opts) => runCommand(async () => {
|
|
8121
8174
|
const { workspaceRootDir } = await getWorkspace();
|
|
8122
8175
|
const seedsPath = dataDir(workspaceRootDir, "seeds");
|
|
@@ -8188,8 +8241,8 @@ var save = new Command62("save").description("save the current data as seeds").o
|
|
|
8188
8241
|
);
|
|
8189
8242
|
|
|
8190
8243
|
// src/commands/seeds/clear.ts
|
|
8191
|
-
import { Command as
|
|
8192
|
-
var clear2 = new
|
|
8244
|
+
import { Command as Command65 } from "commander";
|
|
8245
|
+
var clear2 = new Command65("clear").description("clear seeded records").configureHelp(helpConfig).action(
|
|
8193
8246
|
() => runCommand(async () => {
|
|
8194
8247
|
const { workspaceRootDir } = await getWorkspace();
|
|
8195
8248
|
const seedFiles = getSeedFiles(workspaceRootDir);
|
|
@@ -8220,13 +8273,13 @@ var clear2 = new Command63("clear").description("clear seeded records").configur
|
|
|
8220
8273
|
);
|
|
8221
8274
|
|
|
8222
8275
|
// src/commands/seeds.ts
|
|
8223
|
-
var seeds = new
|
|
8276
|
+
var seeds = new Command66("seeds").description("manage seed data").configureHelp(helpConfig).addCommand(load2).addCommand(save).addCommand(clear2);
|
|
8224
8277
|
|
|
8225
8278
|
// src/commands/signup.ts
|
|
8226
|
-
import { Command as
|
|
8279
|
+
import { Command as Command67 } from "commander";
|
|
8227
8280
|
import * as p39 from "@clack/prompts";
|
|
8228
8281
|
import makeFetchCookie2 from "fetch-cookie";
|
|
8229
|
-
var signup = new
|
|
8282
|
+
var signup = new Command67("signup").description("signup to velastack.dev").configureHelp(helpConfig).action(
|
|
8230
8283
|
() => runCommand(async () => {
|
|
8231
8284
|
const { email: email3, password: password11, passwordConfirm } = await p39.group({
|
|
8232
8285
|
email: () => p39.text({ message: "Email" }),
|
|
@@ -8261,9 +8314,9 @@ var signup = new Command65("signup").description("signup to velastack.dev").conf
|
|
|
8261
8314
|
);
|
|
8262
8315
|
|
|
8263
8316
|
// src/commands/logout.ts
|
|
8264
|
-
import { Command as
|
|
8317
|
+
import { Command as Command68 } from "commander";
|
|
8265
8318
|
import * as p40 from "@clack/prompts";
|
|
8266
|
-
var logout = new
|
|
8319
|
+
var logout = new Command68("logout").alias("signout").description("logout from velastack.dev").configureHelp(helpConfig).action(
|
|
8267
8320
|
() => runCommand(() => {
|
|
8268
8321
|
if (!readConfig()) {
|
|
8269
8322
|
p40.log.info("Not logged in");
|
|
@@ -8275,9 +8328,9 @@ var logout = new Command66("logout").alias("signout").description("logout from v
|
|
|
8275
8328
|
);
|
|
8276
8329
|
|
|
8277
8330
|
// src/commands/whoami.ts
|
|
8278
|
-
import { Command as
|
|
8331
|
+
import { Command as Command69 } from "commander";
|
|
8279
8332
|
import * as p41 from "@clack/prompts";
|
|
8280
|
-
var whoami = new
|
|
8333
|
+
var whoami = new Command69("whoami").description("show the current user").configureHelp(helpConfig).action(
|
|
8281
8334
|
() => runCommand(async () => {
|
|
8282
8335
|
const apiKey = readConfig()?.apiKey;
|
|
8283
8336
|
if (!apiKey) {
|
|
@@ -8294,10 +8347,10 @@ var whoami = new Command67("whoami").description("show the current user").config
|
|
|
8294
8347
|
);
|
|
8295
8348
|
|
|
8296
8349
|
// src/commands/migrate.ts
|
|
8297
|
-
import { Command as
|
|
8350
|
+
import { Command as Command75 } from "commander";
|
|
8298
8351
|
|
|
8299
8352
|
// src/commands/migrate/up.ts
|
|
8300
|
-
import { Command as
|
|
8353
|
+
import { Command as Command70 } from "commander";
|
|
8301
8354
|
|
|
8302
8355
|
// src/lib/migrate.ts
|
|
8303
8356
|
import path28 from "node:path";
|
|
@@ -8336,10 +8389,10 @@ async function runMigrateUp() {
|
|
|
8336
8389
|
]
|
|
8337
8390
|
});
|
|
8338
8391
|
}
|
|
8339
|
-
var up = new
|
|
8392
|
+
var up = new Command70("up").description("apply all pending migrations").configureHelp(helpConfig).action(() => runCommand(runMigrateUp, "Failed to run migrations."));
|
|
8340
8393
|
|
|
8341
8394
|
// src/commands/migrate/down.ts
|
|
8342
|
-
import { Command as
|
|
8395
|
+
import { Command as Command71, InvalidArgumentError as InvalidArgumentError3 } from "commander";
|
|
8343
8396
|
function parseSteps(value) {
|
|
8344
8397
|
const n = parseInt(value, 10);
|
|
8345
8398
|
if (!Number.isFinite(n) || n <= 0) {
|
|
@@ -8347,7 +8400,7 @@ function parseSteps(value) {
|
|
|
8347
8400
|
}
|
|
8348
8401
|
return n;
|
|
8349
8402
|
}
|
|
8350
|
-
var down = new
|
|
8403
|
+
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
8404
|
(n) => runCommand(async () => {
|
|
8352
8405
|
await runPocketbaseMigrate(["down", String(n)]);
|
|
8353
8406
|
reportResult({
|
|
@@ -8364,8 +8417,8 @@ var down = new Command69("down").alias("rollback").description("revert the last
|
|
|
8364
8417
|
import fs31 from "node:fs";
|
|
8365
8418
|
import path29 from "node:path";
|
|
8366
8419
|
import process24 from "node:process";
|
|
8367
|
-
import { Command as
|
|
8368
|
-
var create2 = new
|
|
8420
|
+
import { Command as Command72 } from "commander";
|
|
8421
|
+
var create2 = new Command72("create").alias("new").description("create a new blank migration").argument("<name>", "migration name (snake_case)").configureHelp(helpConfig).action(
|
|
8369
8422
|
(name) => runCommand(async () => {
|
|
8370
8423
|
const cwd = process24.cwd();
|
|
8371
8424
|
const before = listMigrationFiles(cwd);
|
|
@@ -8392,8 +8445,8 @@ function listMigrationFiles(cwd) {
|
|
|
8392
8445
|
import fs32 from "node:fs";
|
|
8393
8446
|
import path30 from "node:path";
|
|
8394
8447
|
import process25 from "node:process";
|
|
8395
|
-
import { Command as
|
|
8396
|
-
var collections = new
|
|
8448
|
+
import { Command as Command73 } from "commander";
|
|
8449
|
+
var collections = new Command73("collections").alias("snapshot").description("snapshot local collections into a new migration").configureHelp(helpConfig).action(
|
|
8397
8450
|
() => runCommand(async () => {
|
|
8398
8451
|
const cwd = process25.cwd();
|
|
8399
8452
|
const before = listMigrationFiles2(cwd);
|
|
@@ -8424,8 +8477,8 @@ function listMigrationFiles2(cwd) {
|
|
|
8424
8477
|
}
|
|
8425
8478
|
|
|
8426
8479
|
// src/commands/migrate/history-sync.ts
|
|
8427
|
-
import { Command as
|
|
8428
|
-
var historySync = new
|
|
8480
|
+
import { Command as Command74 } from "commander";
|
|
8481
|
+
var historySync = new Command74("history-sync").description("drop _migrations rows whose files no longer exist").configureHelp(helpConfig).action(
|
|
8429
8482
|
() => runCommand(async () => {
|
|
8430
8483
|
await runPocketbaseMigrate(["history-sync"]);
|
|
8431
8484
|
reportResult({
|
|
@@ -8436,14 +8489,14 @@ var historySync = new Command72("history-sync").description("drop _migrations ro
|
|
|
8436
8489
|
);
|
|
8437
8490
|
|
|
8438
8491
|
// src/commands/migrate.ts
|
|
8439
|
-
var migrate = new
|
|
8492
|
+
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
8493
|
|
|
8441
8494
|
// src/commands/dev.ts
|
|
8442
8495
|
import fs33 from "node:fs";
|
|
8443
8496
|
import path32 from "node:path";
|
|
8444
8497
|
import process27 from "node:process";
|
|
8445
8498
|
import { performance } from "node:perf_hooks";
|
|
8446
|
-
import { Command as
|
|
8499
|
+
import { Command as Command76, InvalidArgumentError as InvalidArgumentError4 } from "commander";
|
|
8447
8500
|
import pc15 from "picocolors";
|
|
8448
8501
|
import PocketBase4 from "pocketbase";
|
|
8449
8502
|
|
|
@@ -8492,7 +8545,7 @@ function parsePort(value) {
|
|
|
8492
8545
|
}
|
|
8493
8546
|
return port;
|
|
8494
8547
|
}
|
|
8495
|
-
var dev = new
|
|
8548
|
+
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
8549
|
const cwd = process27.cwd();
|
|
8497
8550
|
process27.env.VELA_DATA_DIR ??= localDataDir(cwd);
|
|
8498
8551
|
const startTime = performance.now();
|
|
@@ -8601,7 +8654,7 @@ async function startWatchingTypes(cwd, pb) {
|
|
|
8601
8654
|
import fs34 from "node:fs";
|
|
8602
8655
|
import path33 from "node:path";
|
|
8603
8656
|
import process29 from "node:process";
|
|
8604
|
-
import { Command as
|
|
8657
|
+
import { Command as Command77 } from "commander";
|
|
8605
8658
|
import * as p42 from "@clack/prompts";
|
|
8606
8659
|
import pc16 from "picocolors";
|
|
8607
8660
|
import { x as x3 } from "tinyexec";
|
|
@@ -8638,7 +8691,7 @@ function splitHosts(value) {
|
|
|
8638
8691
|
|
|
8639
8692
|
// src/commands/build.ts
|
|
8640
8693
|
var PRERENDERED_DIR = path33.join(".svelte-kit", "output", "prerendered");
|
|
8641
|
-
var build = new
|
|
8694
|
+
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
8695
|
const cwd = process29.cwd();
|
|
8643
8696
|
applyBuildEnv(cwd);
|
|
8644
8697
|
const origin = await originForBuild(cwd, options.target);
|
|
@@ -8706,11 +8759,11 @@ Set one with ${pc16.cyan("vela deploy --domain example.com")}, or pass ${pc16.cy
|
|
|
8706
8759
|
// src/commands/preview.ts
|
|
8707
8760
|
import path34 from "node:path";
|
|
8708
8761
|
import process30 from "node:process";
|
|
8709
|
-
import { Command as
|
|
8762
|
+
import { Command as Command78 } from "commander";
|
|
8710
8763
|
import { x as x4 } from "tinyexec";
|
|
8711
8764
|
import { detect as detect6 } from "package-manager-detector";
|
|
8712
8765
|
import { resolveCommand as resolveCommand6 } from "package-manager-detector/commands";
|
|
8713
|
-
var preview = new
|
|
8766
|
+
var preview = new Command78("preview").description("preview the built app").configureHelp(helpConfig).action(async () => {
|
|
8714
8767
|
const cwd = process30.cwd();
|
|
8715
8768
|
process30.env.VELA_DATA_DIR ??= localDataDir(cwd);
|
|
8716
8769
|
let pbProc;
|
|
@@ -8750,8 +8803,8 @@ var preview = new Command76("preview").description("preview the built app").conf
|
|
|
8750
8803
|
|
|
8751
8804
|
// src/commands/sync.ts
|
|
8752
8805
|
import path35 from "node:path";
|
|
8753
|
-
import { Command as
|
|
8754
|
-
var sync = new
|
|
8806
|
+
import { Command as Command79 } from "commander";
|
|
8807
|
+
var sync = new Command79("sync").description("sync types from the database").configureHelp(helpConfig).action(
|
|
8755
8808
|
() => runCommand(async () => {
|
|
8756
8809
|
const { workspaceRootDir } = await getWorkspace();
|
|
8757
8810
|
const typesDir = path35.join(workspaceRootDir, ".svelte-kit", "types");
|
|
@@ -8764,7 +8817,7 @@ var sync = new Command77("sync").description("sync types from the database").con
|
|
|
8764
8817
|
);
|
|
8765
8818
|
|
|
8766
8819
|
// src/commands/provision.ts
|
|
8767
|
-
import { Command as
|
|
8820
|
+
import { Command as Command80 } from "commander";
|
|
8768
8821
|
import * as p43 from "@clack/prompts";
|
|
8769
8822
|
import pc17 from "picocolors";
|
|
8770
8823
|
import * as v7 from "valibot";
|
|
@@ -8774,7 +8827,7 @@ var OptionsSchema2 = v7.object({
|
|
|
8774
8827
|
nodeMajor: v7.optional(v7.string())
|
|
8775
8828
|
});
|
|
8776
8829
|
var provision = addSshOptions(
|
|
8777
|
-
new
|
|
8830
|
+
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
8831
|
).option("--pb-version <version>", "PocketBase version to install").option("--node-major <version>", "Node.js major version to install", "22").action(
|
|
8779
8832
|
(target, raw) => runCommand(async () => {
|
|
8780
8833
|
const options = parseOptions(OptionsSchema2, raw);
|
|
@@ -8818,7 +8871,7 @@ var provision = addSshOptions(
|
|
|
8818
8871
|
// src/commands/deploy.ts
|
|
8819
8872
|
import path38 from "node:path";
|
|
8820
8873
|
import fs37 from "node:fs";
|
|
8821
|
-
import { Command as
|
|
8874
|
+
import { Command as Command81, Option as Option2 } from "commander";
|
|
8822
8875
|
import * as p44 from "@clack/prompts";
|
|
8823
8876
|
import pc18 from "picocolors";
|
|
8824
8877
|
import * as v8 from "valibot";
|
|
@@ -9162,7 +9215,7 @@ var OptionsSchema3 = v8.object({
|
|
|
9162
9215
|
});
|
|
9163
9216
|
var deploy = addLockWaitOption(
|
|
9164
9217
|
addTargetOptions(
|
|
9165
|
-
new
|
|
9218
|
+
new Command81("deploy").description("deploy the app").configureHelp(helpConfig),
|
|
9166
9219
|
"production"
|
|
9167
9220
|
)
|
|
9168
9221
|
).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 +9582,10 @@ async function serverTimeOrLocal(session) {
|
|
|
9529
9582
|
// src/commands/link.ts
|
|
9530
9583
|
import path39 from "node:path";
|
|
9531
9584
|
import process32 from "node:process";
|
|
9532
|
-
import { Command as
|
|
9585
|
+
import { Command as Command82 } from "commander";
|
|
9533
9586
|
import * as p45 from "@clack/prompts";
|
|
9534
9587
|
var CREATE_NEW = "__new__";
|
|
9535
|
-
var link = new
|
|
9588
|
+
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
9589
|
async function linkProject() {
|
|
9537
9590
|
const { workspaceRootDir } = await getWorkspace();
|
|
9538
9591
|
const existing = readProjectConfig(workspaceRootDir);
|
|
@@ -9599,14 +9652,14 @@ function defaultProjectName2(workspaceRootDir) {
|
|
|
9599
9652
|
}
|
|
9600
9653
|
|
|
9601
9654
|
// src/commands/env.ts
|
|
9602
|
-
import { Command as
|
|
9655
|
+
import { Command as Command87 } from "commander";
|
|
9603
9656
|
|
|
9604
9657
|
// src/commands/env/list.ts
|
|
9605
|
-
import { Command as
|
|
9658
|
+
import { Command as Command83 } from "commander";
|
|
9606
9659
|
import * as p46 from "@clack/prompts";
|
|
9607
9660
|
import pc19 from "picocolors";
|
|
9608
9661
|
var envList = addTargetOptions(
|
|
9609
|
-
new
|
|
9662
|
+
new Command83("list").description("list environment variable names").configureHelp(helpConfig),
|
|
9610
9663
|
"local"
|
|
9611
9664
|
).action(
|
|
9612
9665
|
(raw) => runCommand(
|
|
@@ -9640,11 +9693,11 @@ function report(keys, where) {
|
|
|
9640
9693
|
|
|
9641
9694
|
// src/commands/env/set.ts
|
|
9642
9695
|
import process33 from "node:process";
|
|
9643
|
-
import { Command as
|
|
9696
|
+
import { Command as Command84 } from "commander";
|
|
9644
9697
|
import * as p47 from "@clack/prompts";
|
|
9645
9698
|
import pc20 from "picocolors";
|
|
9646
9699
|
var envSet = addTargetOptions(
|
|
9647
|
-
new
|
|
9700
|
+
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
9701
|
"local"
|
|
9649
9702
|
).action(
|
|
9650
9703
|
(key, value, raw) => runCommand(
|
|
@@ -9687,11 +9740,11 @@ async function promptValue(key) {
|
|
|
9687
9740
|
}
|
|
9688
9741
|
|
|
9689
9742
|
// src/commands/env/unset.ts
|
|
9690
|
-
import { Command as
|
|
9743
|
+
import { Command as Command85 } from "commander";
|
|
9691
9744
|
import * as p48 from "@clack/prompts";
|
|
9692
9745
|
import pc21 from "picocolors";
|
|
9693
9746
|
var envUnset = addTargetOptions(
|
|
9694
|
-
new
|
|
9747
|
+
new Command85("unset").description("remove an environment variable").argument("<key>", "variable name").configureHelp(helpConfig),
|
|
9695
9748
|
"local"
|
|
9696
9749
|
).action(
|
|
9697
9750
|
(key, raw) => runCommand(
|
|
@@ -9729,11 +9782,11 @@ var envUnset = addTargetOptions(
|
|
|
9729
9782
|
import fs38 from "node:fs";
|
|
9730
9783
|
import path40 from "node:path";
|
|
9731
9784
|
import process34 from "node:process";
|
|
9732
|
-
import { Command as
|
|
9785
|
+
import { Command as Command86 } from "commander";
|
|
9733
9786
|
import * as p49 from "@clack/prompts";
|
|
9734
9787
|
import pc22 from "picocolors";
|
|
9735
9788
|
var envImport = addTargetOptions(
|
|
9736
|
-
new
|
|
9789
|
+
new Command86("import").description("merge a dotenv file into the environment").argument("<file>", "dotenv file to read").configureHelp(helpConfig),
|
|
9737
9790
|
"local"
|
|
9738
9791
|
).action(
|
|
9739
9792
|
(file, raw) => runCommand(
|
|
@@ -9783,14 +9836,14 @@ function read(resolved, shown) {
|
|
|
9783
9836
|
}
|
|
9784
9837
|
|
|
9785
9838
|
// src/commands/env.ts
|
|
9786
|
-
var env = new
|
|
9839
|
+
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
9840
|
|
|
9788
9841
|
// src/commands/status.ts
|
|
9789
|
-
import { Command as
|
|
9842
|
+
import { Command as Command88 } from "commander";
|
|
9790
9843
|
import * as p50 from "@clack/prompts";
|
|
9791
9844
|
import pc23 from "picocolors";
|
|
9792
9845
|
var status = addTargetOptions(
|
|
9793
|
-
new
|
|
9846
|
+
new Command88("status").description("show what is deployed").configureHelp(helpConfig),
|
|
9794
9847
|
"production"
|
|
9795
9848
|
).option("--all", "show every app on the server, not just this project").option("--json", "print raw JSON").action(
|
|
9796
9849
|
(raw) => runCommand(async () => {
|
|
@@ -9849,12 +9902,12 @@ function describe2(state) {
|
|
|
9849
9902
|
}
|
|
9850
9903
|
|
|
9851
9904
|
// src/commands/rollback.ts
|
|
9852
|
-
import { Command as
|
|
9905
|
+
import { Command as Command89 } from "commander";
|
|
9853
9906
|
import * as p51 from "@clack/prompts";
|
|
9854
9907
|
import pc24 from "picocolors";
|
|
9855
9908
|
var rollback = addLockWaitOption(
|
|
9856
9909
|
addTargetOptions(
|
|
9857
|
-
new
|
|
9910
|
+
new Command89("rollback").description("put the previous release back").configureHelp(helpConfig),
|
|
9858
9911
|
"production"
|
|
9859
9912
|
)
|
|
9860
9913
|
).option("--to <release>", "roll back to a specific release instead of the previous one").action(
|
|
@@ -9893,9 +9946,9 @@ var rollback = addLockWaitOption(
|
|
|
9893
9946
|
);
|
|
9894
9947
|
|
|
9895
9948
|
// src/commands/logs.ts
|
|
9896
|
-
import { Command as
|
|
9949
|
+
import { Command as Command90 } from "commander";
|
|
9897
9950
|
var logs = addTargetOptions(
|
|
9898
|
-
new
|
|
9951
|
+
new Command90("logs").description("tail the logs of a deployed app").configureHelp(helpConfig),
|
|
9899
9952
|
"production"
|
|
9900
9953
|
).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
9954
|
(raw) => runCommand(async () => {
|
|
@@ -9929,16 +9982,16 @@ var logs = addTargetOptions(
|
|
|
9929
9982
|
);
|
|
9930
9983
|
|
|
9931
9984
|
// src/commands/admin.ts
|
|
9932
|
-
import { Command as
|
|
9985
|
+
import { Command as Command92 } from "commander";
|
|
9933
9986
|
|
|
9934
9987
|
// src/commands/admin/create.ts
|
|
9935
9988
|
import process35 from "node:process";
|
|
9936
|
-
import { Command as
|
|
9989
|
+
import { Command as Command91 } from "commander";
|
|
9937
9990
|
import * as p52 from "@clack/prompts";
|
|
9938
9991
|
import pc25 from "picocolors";
|
|
9939
9992
|
var MIN_PASSWORD = 10;
|
|
9940
9993
|
var adminCreate = addTargetOptions(
|
|
9941
|
-
new
|
|
9994
|
+
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
9995
|
"local"
|
|
9943
9996
|
).action(
|
|
9944
9997
|
(email3, raw) => runCommand(
|
|
@@ -10048,15 +10101,15 @@ async function promptPassword2() {
|
|
|
10048
10101
|
}
|
|
10049
10102
|
|
|
10050
10103
|
// src/commands/admin.ts
|
|
10051
|
-
var admin = new
|
|
10104
|
+
var admin = new Command92("admin").description("manage admin panel logins").configureHelp(helpConfig).addCommand(adminCreate);
|
|
10052
10105
|
|
|
10053
10106
|
// src/commands/backup.ts
|
|
10054
|
-
import { Command as
|
|
10107
|
+
import { Command as Command98 } from "commander";
|
|
10055
10108
|
|
|
10056
10109
|
// src/commands/backup/create.ts
|
|
10057
10110
|
import fs39 from "node:fs";
|
|
10058
10111
|
import path41 from "node:path";
|
|
10059
|
-
import { Command as
|
|
10112
|
+
import { Command as Command93 } from "commander";
|
|
10060
10113
|
import * as p53 from "@clack/prompts";
|
|
10061
10114
|
import pc26 from "picocolors";
|
|
10062
10115
|
|
|
@@ -10145,7 +10198,7 @@ async function writeSchedule(pb, cron, maxKeep) {
|
|
|
10145
10198
|
// src/commands/backup/create.ts
|
|
10146
10199
|
var DEFAULT_BACKUP_DIR = "backups";
|
|
10147
10200
|
var backupCreate = addTargetOptions(
|
|
10148
|
-
new
|
|
10201
|
+
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
10202
|
"production"
|
|
10150
10203
|
).action(
|
|
10151
10204
|
(name, raw) => runCommand(() => {
|
|
@@ -10229,11 +10282,11 @@ async function download(ctx, key, outputDir) {
|
|
|
10229
10282
|
}
|
|
10230
10283
|
|
|
10231
10284
|
// src/commands/backup/list.ts
|
|
10232
|
-
import { Command as
|
|
10285
|
+
import { Command as Command94 } from "commander";
|
|
10233
10286
|
import * as p54 from "@clack/prompts";
|
|
10234
10287
|
import pc27 from "picocolors";
|
|
10235
10288
|
var backupList = addTargetOptions(
|
|
10236
|
-
new
|
|
10289
|
+
new Command94("list").description("list the backups on a target").configureHelp(helpConfig),
|
|
10237
10290
|
"production"
|
|
10238
10291
|
).action(
|
|
10239
10292
|
(raw) => runCommand(
|
|
@@ -10261,11 +10314,11 @@ Take one with ${pc27.cyan("vela backup create")}.`
|
|
|
10261
10314
|
// src/commands/backup/download.ts
|
|
10262
10315
|
import fs40 from "node:fs";
|
|
10263
10316
|
import path42 from "node:path";
|
|
10264
|
-
import { Command as
|
|
10317
|
+
import { Command as Command95 } from "commander";
|
|
10265
10318
|
import * as p55 from "@clack/prompts";
|
|
10266
10319
|
import pc28 from "picocolors";
|
|
10267
10320
|
var backupDownload = addTargetOptions(
|
|
10268
|
-
new
|
|
10321
|
+
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
10322
|
"production"
|
|
10270
10323
|
).action(
|
|
10271
10324
|
(key, raw) => runCommand(() => {
|
|
@@ -10313,11 +10366,11 @@ Fetch it from the bucket directly \u2014 vela does not hold its credentials.`
|
|
|
10313
10366
|
|
|
10314
10367
|
// src/commands/backup/delete.ts
|
|
10315
10368
|
import process36 from "node:process";
|
|
10316
|
-
import { Command as
|
|
10369
|
+
import { Command as Command96 } from "commander";
|
|
10317
10370
|
import * as p56 from "@clack/prompts";
|
|
10318
10371
|
import pc29 from "picocolors";
|
|
10319
10372
|
var backupDelete = addTargetOptions(
|
|
10320
|
-
new
|
|
10373
|
+
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
10374
|
"production"
|
|
10322
10375
|
).action(
|
|
10323
10376
|
(key, raw) => runCommand(() => {
|
|
@@ -10348,12 +10401,12 @@ Run ${pc29.cyan("vela backup list")} to see what it does have.`
|
|
|
10348
10401
|
);
|
|
10349
10402
|
|
|
10350
10403
|
// src/commands/backup/schedule.ts
|
|
10351
|
-
import { Command as
|
|
10404
|
+
import { Command as Command97 } from "commander";
|
|
10352
10405
|
import * as p57 from "@clack/prompts";
|
|
10353
10406
|
import pc30 from "picocolors";
|
|
10354
10407
|
var DEFAULT_KEEP = 7;
|
|
10355
10408
|
var backupSchedule = addTargetOptions(
|
|
10356
|
-
new
|
|
10409
|
+
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
10410
|
"production"
|
|
10358
10411
|
).action(
|
|
10359
10412
|
(cron, raw) => runCommand(() => {
|
|
@@ -10397,18 +10450,18 @@ Set one with ${pc30.cyan('vela backup schedule "0 3 * * *"')}.`
|
|
|
10397
10450
|
);
|
|
10398
10451
|
|
|
10399
10452
|
// src/commands/backup.ts
|
|
10400
|
-
var backup = new
|
|
10453
|
+
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
10454
|
|
|
10402
10455
|
// src/commands/restore.ts
|
|
10403
10456
|
import fs41 from "node:fs";
|
|
10404
10457
|
import path43 from "node:path";
|
|
10405
10458
|
import process37 from "node:process";
|
|
10406
|
-
import { Command as
|
|
10459
|
+
import { Command as Command99 } from "commander";
|
|
10407
10460
|
import * as p58 from "@clack/prompts";
|
|
10408
10461
|
import pc31 from "picocolors";
|
|
10409
10462
|
var restore = addLockWaitOption(
|
|
10410
10463
|
addTargetOptions(
|
|
10411
|
-
new
|
|
10464
|
+
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
10465
|
"production"
|
|
10413
10466
|
)
|
|
10414
10467
|
).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 +10603,7 @@ async function confirm13(appName, targetName, envTag, from) {
|
|
|
10550
10603
|
}
|
|
10551
10604
|
|
|
10552
10605
|
// src/commands/targets.ts
|
|
10553
|
-
import { Command as
|
|
10606
|
+
import { Command as Command100 } from "commander";
|
|
10554
10607
|
import * as p59 from "@clack/prompts";
|
|
10555
10608
|
import pc32 from "picocolors";
|
|
10556
10609
|
import * as v9 from "valibot";
|
|
@@ -10560,7 +10613,7 @@ var OptionsSchema4 = v9.object({
|
|
|
10560
10613
|
offline: v9.optional(v9.boolean())
|
|
10561
10614
|
});
|
|
10562
10615
|
var targets = addSshOptions(
|
|
10563
|
-
new
|
|
10616
|
+
new Command100("targets").description("list the targets this project can deploy to").configureHelp(helpConfig)
|
|
10564
10617
|
).option("--json", "print raw JSON").option("--offline", "skip connecting to servers").action(
|
|
10565
10618
|
(raw) => runCommand(async () => {
|
|
10566
10619
|
const options = parseOptions(OptionsSchema4, raw);
|
|
@@ -10640,14 +10693,14 @@ Release and domain are shown from what this project recorded.`
|
|
|
10640
10693
|
// src/commands/test.ts
|
|
10641
10694
|
import path44 from "node:path";
|
|
10642
10695
|
import process38 from "node:process";
|
|
10643
|
-
import { Command as
|
|
10696
|
+
import { Command as Command101 } from "commander";
|
|
10644
10697
|
import PocketBase6 from "pocketbase";
|
|
10645
10698
|
import pc33 from "picocolors";
|
|
10646
10699
|
import { x as x5 } from "tinyexec";
|
|
10647
10700
|
import { detect as detect8 } from "package-manager-detector";
|
|
10648
10701
|
import { resolveCommand as resolveCommand7 } from "package-manager-detector/commands";
|
|
10649
10702
|
import fs42 from "node:fs";
|
|
10650
|
-
var testServer = new
|
|
10703
|
+
var testServer = new Command101("test:server").description("run server tests").allowUnknownOption(true).allowExcessArguments(true).configureHelp(helpConfig).action(async (_opts, cmd) => {
|
|
10651
10704
|
const cwd = process38.cwd();
|
|
10652
10705
|
const email3 = `test-${Math.random().toString(36).slice(2)}@example.com`;
|
|
10653
10706
|
const password11 = "password";
|
|
@@ -10679,6 +10732,7 @@ var testServer = new Command99("test:server").description("run server tests").al
|
|
|
10679
10732
|
};
|
|
10680
10733
|
const cleanup = async () => {
|
|
10681
10734
|
if (cleanedUp) return;
|
|
10735
|
+
process38.emit("sveltekit:shutdown", 0);
|
|
10682
10736
|
await vite?.close().catch(() => {
|
|
10683
10737
|
});
|
|
10684
10738
|
cleanupSync();
|
|
@@ -10746,6 +10800,7 @@ var testServer = new Command99("test:server").description("run server tests").al
|
|
|
10746
10800
|
process38.exitCode = 1;
|
|
10747
10801
|
} finally {
|
|
10748
10802
|
await cleanup();
|
|
10803
|
+
process38.exit(process38.exitCode ?? 0);
|
|
10749
10804
|
}
|
|
10750
10805
|
});
|
|
10751
10806
|
function describeLoadFailure(e) {
|
|
@@ -10776,7 +10831,7 @@ function stubPagesPlugin() {
|
|
|
10776
10831
|
// src/commands/routes.ts
|
|
10777
10832
|
import fs43 from "node:fs";
|
|
10778
10833
|
import path45 from "node:path";
|
|
10779
|
-
import { Command as
|
|
10834
|
+
import { Command as Command102 } from "commander";
|
|
10780
10835
|
var HTTP_METHODS = /* @__PURE__ */ new Set([
|
|
10781
10836
|
"GET",
|
|
10782
10837
|
"POST",
|
|
@@ -10787,7 +10842,7 @@ var HTTP_METHODS = /* @__PURE__ */ new Set([
|
|
|
10787
10842
|
"HEAD",
|
|
10788
10843
|
"fallback"
|
|
10789
10844
|
]);
|
|
10790
|
-
var routes = new
|
|
10845
|
+
var routes = new Command102("routes").description("list routes").configureHelp(helpConfig).action(async () => {
|
|
10791
10846
|
const { workspaceRootDir, routesDir } = await getWorkspace();
|
|
10792
10847
|
const routesRoot = path45.join(workspaceRootDir, routesDir);
|
|
10793
10848
|
const found = walk(routesRoot, routesRoot).filter((r) => r.methods.length > 0);
|
|
@@ -10863,7 +10918,7 @@ function printTable(routes2) {
|
|
|
10863
10918
|
|
|
10864
10919
|
// src/commands/i18n.ts
|
|
10865
10920
|
import process39 from "node:process";
|
|
10866
|
-
import { Command as
|
|
10921
|
+
import { Command as Command103 } from "commander";
|
|
10867
10922
|
import { x as x6 } from "tinyexec";
|
|
10868
10923
|
import { detect as detect9 } from "package-manager-detector";
|
|
10869
10924
|
import { resolveCommand as resolveCommand8 } from "package-manager-detector/commands";
|
|
@@ -10878,11 +10933,11 @@ async function runWuchale(extraArgs) {
|
|
|
10878
10933
|
throwOnError: true
|
|
10879
10934
|
});
|
|
10880
10935
|
}
|
|
10881
|
-
var extract2 = new
|
|
10882
|
-
var watch = new
|
|
10883
|
-
var status2 = new
|
|
10884
|
-
var clean = new
|
|
10885
|
-
var i18n3 = new
|
|
10936
|
+
var extract2 = new Command103("extract").description("extract translatable strings").configureHelp(helpConfig).action(() => runWuchale([]));
|
|
10937
|
+
var watch = new Command103("watch").description("watch and extract translatable strings").configureHelp(helpConfig).action(() => runWuchale(["--watch"]));
|
|
10938
|
+
var status2 = new Command103("status").description("show i18n status").configureHelp(helpConfig).action(() => runWuchale(["status"]));
|
|
10939
|
+
var clean = new Command103("clean").description("clean unused translatable strings").configureHelp(helpConfig).action(() => runWuchale(["--clean"]));
|
|
10940
|
+
var i18n3 = new Command103("i18n").description("i18n utilities").configureHelp(helpConfig).addCommand(extract2, { isDefault: true }).addCommand(watch).addCommand(status2).addCommand(clean);
|
|
10886
10941
|
|
|
10887
10942
|
// src/commands/oauth.ts
|
|
10888
10943
|
var oauth = stubCommand("oauth", "configure OAuth providers");
|
|
@@ -10891,17 +10946,17 @@ var oauth = stubCommand("oauth", "configure OAuth providers");
|
|
|
10891
10946
|
var schemas = stubCommand("schemas", "manage database schemas");
|
|
10892
10947
|
|
|
10893
10948
|
// src/commands/cms.ts
|
|
10894
|
-
import { Command as
|
|
10949
|
+
import { Command as Command109 } from "commander";
|
|
10895
10950
|
|
|
10896
10951
|
// src/commands/cms/deploy.ts
|
|
10897
10952
|
import process40 from "node:process";
|
|
10898
|
-
import { Command as
|
|
10953
|
+
import { Command as Command104 } from "commander";
|
|
10899
10954
|
import * as p60 from "@clack/prompts";
|
|
10900
10955
|
import pc34 from "picocolors";
|
|
10901
10956
|
var POLL_INTERVAL2 = 5e3;
|
|
10902
10957
|
var POLL_TIMEOUT = 30 * 6e4;
|
|
10903
10958
|
var inFlight = (run) => run?.status === "pending" || run?.status === "building";
|
|
10904
|
-
var deploy2 = new
|
|
10959
|
+
var deploy2 = new Command104("deploy").description("rebuild the hosted site with the latest published content").option(
|
|
10905
10960
|
"--project <id>",
|
|
10906
10961
|
"velastack.dev project whose site to rebuild, instead of the linked one"
|
|
10907
10962
|
).option("--no-wait", "return once the build has started instead of waiting for it").configureHelp(helpConfig).action(
|
|
@@ -10990,11 +11045,11 @@ async function waitForRun(apiKey, projectId, runId) {
|
|
|
10990
11045
|
}
|
|
10991
11046
|
|
|
10992
11047
|
// src/commands/cms/editor.ts
|
|
10993
|
-
import { Command as
|
|
11048
|
+
import { Command as Command108 } from "commander";
|
|
10994
11049
|
|
|
10995
11050
|
// src/commands/cms/editor/add.ts
|
|
10996
11051
|
import { randomBytes } from "node:crypto";
|
|
10997
|
-
import { Command as
|
|
11052
|
+
import { Command as Command105 } from "commander";
|
|
10998
11053
|
import * as p61 from "@clack/prompts";
|
|
10999
11054
|
import pc36 from "picocolors";
|
|
11000
11055
|
|
|
@@ -11037,7 +11092,7 @@ async function withCmsBackend(fn, cwd = process41.cwd()) {
|
|
|
11037
11092
|
}
|
|
11038
11093
|
|
|
11039
11094
|
// src/commands/cms/editor/add.ts
|
|
11040
|
-
var editorAdd = new
|
|
11095
|
+
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
11096
|
(email3, options) => runCommand(async () => {
|
|
11042
11097
|
const generated = options.password === void 0;
|
|
11043
11098
|
const password11 = options.password ?? randomBytes(12).toString("base64url");
|
|
@@ -11056,10 +11111,10 @@ var editorAdd = new Command103("add").description("create an editor who can sign
|
|
|
11056
11111
|
);
|
|
11057
11112
|
|
|
11058
11113
|
// src/commands/cms/editor/password.ts
|
|
11059
|
-
import { Command as
|
|
11114
|
+
import { Command as Command106 } from "commander";
|
|
11060
11115
|
import * as p62 from "@clack/prompts";
|
|
11061
11116
|
import pc37 from "picocolors";
|
|
11062
|
-
var editorPassword = new
|
|
11117
|
+
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
11118
|
(email3, password11) => runCommand(async () => {
|
|
11064
11119
|
await withCmsBackend((cms3) => cms3.editors.setPassword(email3, password11));
|
|
11065
11120
|
p62.log.success(
|
|
@@ -11069,10 +11124,10 @@ var editorPassword = new Command104("password").description("set an editor's pas
|
|
|
11069
11124
|
);
|
|
11070
11125
|
|
|
11071
11126
|
// src/commands/cms/editor/list.ts
|
|
11072
|
-
import { Command as
|
|
11127
|
+
import { Command as Command107 } from "commander";
|
|
11073
11128
|
import * as p63 from "@clack/prompts";
|
|
11074
11129
|
import pc38 from "picocolors";
|
|
11075
|
-
var editorList = new
|
|
11130
|
+
var editorList = new Command107("list").description("list editors and the projects they may edit").configureHelp(helpConfig).action(
|
|
11076
11131
|
() => runCommand(async () => {
|
|
11077
11132
|
const rows = await withCmsBackend(
|
|
11078
11133
|
async (cms3) => cms3.editors.list().map((editor2) => ({
|
|
@@ -11096,10 +11151,154 @@ var editorList = new Command105("list").description("list editors and the projec
|
|
|
11096
11151
|
);
|
|
11097
11152
|
|
|
11098
11153
|
// src/commands/cms/editor.ts
|
|
11099
|
-
var editor = new
|
|
11154
|
+
var editor = new Command108("editor").description("manage who can sign in to the admin bar").configureHelp(helpConfig).addCommand(editorAdd).addCommand(editorPassword).addCommand(editorList);
|
|
11100
11155
|
|
|
11101
11156
|
// src/commands/cms.ts
|
|
11102
|
-
var cms2 = new
|
|
11157
|
+
var cms2 = new Command109("cms").description("manage the CMS").configureHelp(helpConfig).addCommand(editor).addCommand(deploy2);
|
|
11158
|
+
|
|
11159
|
+
// src/commands/workflows.ts
|
|
11160
|
+
import { Command as Command113 } from "commander";
|
|
11161
|
+
|
|
11162
|
+
// src/commands/workflows/list.ts
|
|
11163
|
+
import process42 from "node:process";
|
|
11164
|
+
import { Command as Command110, InvalidArgumentError as InvalidArgumentError5 } from "commander";
|
|
11165
|
+
import * as p64 from "@clack/prompts";
|
|
11166
|
+
import pc39 from "picocolors";
|
|
11167
|
+
|
|
11168
|
+
// src/lib/workflows-api.ts
|
|
11169
|
+
var NAMESPACE = "default";
|
|
11170
|
+
var PREFIX = `/api/ow/v1/${NAMESPACE}`;
|
|
11171
|
+
async function listRuns(pb, options = {}) {
|
|
11172
|
+
const query = { limit: options.limit ?? 50 };
|
|
11173
|
+
if (options.status) query.status = options.status;
|
|
11174
|
+
if (options.workflowName) query.workflowName = options.workflowName;
|
|
11175
|
+
const res = await pb.send(`${PREFIX}/runs`, {
|
|
11176
|
+
method: "GET",
|
|
11177
|
+
query,
|
|
11178
|
+
requestKey: null
|
|
11179
|
+
});
|
|
11180
|
+
return res.data;
|
|
11181
|
+
}
|
|
11182
|
+
async function createRun(pb, workflowName, input) {
|
|
11183
|
+
const res = await pb.send(`${PREFIX}/runs`, {
|
|
11184
|
+
method: "POST",
|
|
11185
|
+
body: {
|
|
11186
|
+
workflowName,
|
|
11187
|
+
version: null,
|
|
11188
|
+
idempotencyKey: null,
|
|
11189
|
+
config: {},
|
|
11190
|
+
context: {},
|
|
11191
|
+
input: input ?? null,
|
|
11192
|
+
parentStepAttemptNamespaceId: null,
|
|
11193
|
+
parentStepAttemptId: null,
|
|
11194
|
+
availableAt: null,
|
|
11195
|
+
deadlineAt: null
|
|
11196
|
+
},
|
|
11197
|
+
requestKey: null
|
|
11198
|
+
});
|
|
11199
|
+
return res.run;
|
|
11200
|
+
}
|
|
11201
|
+
async function cancelRun(pb, id) {
|
|
11202
|
+
const res = await pb.send(`${PREFIX}/runs/${id}/cancel`, {
|
|
11203
|
+
method: "POST",
|
|
11204
|
+
body: {},
|
|
11205
|
+
requestKey: null
|
|
11206
|
+
});
|
|
11207
|
+
return res.run;
|
|
11208
|
+
}
|
|
11209
|
+
|
|
11210
|
+
// src/commands/workflows/list.ts
|
|
11211
|
+
var STATUSES = ["pending", "running", "completed", "failed", "canceled"];
|
|
11212
|
+
function parseStatus(value) {
|
|
11213
|
+
if (!STATUSES.includes(value)) {
|
|
11214
|
+
throw new InvalidArgumentError5(`must be one of: ${STATUSES.join(", ")}`);
|
|
11215
|
+
}
|
|
11216
|
+
return value;
|
|
11217
|
+
}
|
|
11218
|
+
function parseLimit(value) {
|
|
11219
|
+
const n = Number(value);
|
|
11220
|
+
if (!Number.isInteger(n) || n < 1 || n > 500) {
|
|
11221
|
+
throw new InvalidArgumentError5("must be a whole number between 1 and 500.");
|
|
11222
|
+
}
|
|
11223
|
+
return n;
|
|
11224
|
+
}
|
|
11225
|
+
var STATUS_COLOR = {
|
|
11226
|
+
pending: pc39.yellow,
|
|
11227
|
+
running: pc39.cyan,
|
|
11228
|
+
completed: pc39.green,
|
|
11229
|
+
failed: pc39.red,
|
|
11230
|
+
canceled: pc39.dim
|
|
11231
|
+
};
|
|
11232
|
+
function formatRun(run, nameWidth) {
|
|
11233
|
+
const status3 = STATUS_COLOR[run.status](run.status.padEnd(9));
|
|
11234
|
+
const when = pc39.dim((run.finishedAt ?? run.updatedAt).replace("T", " ").slice(0, 19));
|
|
11235
|
+
const attempts = run.attempts > 1 ? pc39.dim(` \xD7${run.attempts}`) : "";
|
|
11236
|
+
const error = run.status === "failed" && run.error?.message ? pc39.red(` ${run.error.message}`) : "";
|
|
11237
|
+
return `${run.id} ${run.workflowName.padEnd(nameWidth)} ${status3}${attempts} ${when}${error}`;
|
|
11238
|
+
}
|
|
11239
|
+
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(
|
|
11240
|
+
(options) => runCommand(async () => {
|
|
11241
|
+
await withPocketbase(process42.cwd(), async (pb) => {
|
|
11242
|
+
const runs = await listRuns(pb, {
|
|
11243
|
+
status: options.status,
|
|
11244
|
+
workflowName: options.name,
|
|
11245
|
+
limit: options.limit
|
|
11246
|
+
});
|
|
11247
|
+
if (runs.length === 0) {
|
|
11248
|
+
p64.log.info(
|
|
11249
|
+
`No workflow runs yet.
|
|
11250
|
+
|
|
11251
|
+
Start one from server code with ${pc39.cyan("<workflow>.run(input)")}, or with ${pc39.cyan("vela workflows run <name>")}.`
|
|
11252
|
+
);
|
|
11253
|
+
return;
|
|
11254
|
+
}
|
|
11255
|
+
const width = Math.max(...runs.map((r) => r.workflowName.length));
|
|
11256
|
+
p64.log.message(runs.map((r) => formatRun(r, width)).join("\n"));
|
|
11257
|
+
});
|
|
11258
|
+
}, "Failed to list workflow runs.")
|
|
11259
|
+
);
|
|
11260
|
+
|
|
11261
|
+
// src/commands/workflows/run.ts
|
|
11262
|
+
import process43 from "node:process";
|
|
11263
|
+
import { Command as Command111, InvalidArgumentError as InvalidArgumentError6 } from "commander";
|
|
11264
|
+
import * as p65 from "@clack/prompts";
|
|
11265
|
+
import pc40 from "picocolors";
|
|
11266
|
+
function parseInput(value) {
|
|
11267
|
+
try {
|
|
11268
|
+
return JSON.parse(value);
|
|
11269
|
+
} catch {
|
|
11270
|
+
throw new InvalidArgumentError6(`must be JSON, e.g. '{"userId":"abc"}'.`);
|
|
11271
|
+
}
|
|
11272
|
+
}
|
|
11273
|
+
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(
|
|
11274
|
+
(name, input) => runCommand(async () => {
|
|
11275
|
+
await withPocketbase(process43.cwd(), async (pb) => {
|
|
11276
|
+
const run = await createRun(pb, name, input);
|
|
11277
|
+
p65.log.success(
|
|
11278
|
+
`Queued ${pc40.cyan(name)} as run ${pc40.bold(run.id)}.
|
|
11279
|
+
|
|
11280
|
+
It runs once the app is up (${pc40.cyan("vela dev")}); ${pc40.cyan("vela workflows list")} shows its state.`
|
|
11281
|
+
);
|
|
11282
|
+
});
|
|
11283
|
+
}, "Failed to start the workflow run.")
|
|
11284
|
+
);
|
|
11285
|
+
|
|
11286
|
+
// src/commands/workflows/cancel.ts
|
|
11287
|
+
import process44 from "node:process";
|
|
11288
|
+
import { Command as Command112 } from "commander";
|
|
11289
|
+
import * as p66 from "@clack/prompts";
|
|
11290
|
+
import pc41 from "picocolors";
|
|
11291
|
+
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(
|
|
11292
|
+
(id) => runCommand(async () => {
|
|
11293
|
+
await withPocketbase(process44.cwd(), async (pb) => {
|
|
11294
|
+
const run = await cancelRun(pb, id);
|
|
11295
|
+
p66.log.success(`Canceled run ${pc41.bold(run.id)} of ${pc41.cyan(run.workflowName)}.`);
|
|
11296
|
+
});
|
|
11297
|
+
}, "Failed to cancel the workflow run.")
|
|
11298
|
+
);
|
|
11299
|
+
|
|
11300
|
+
// src/commands/workflows.ts
|
|
11301
|
+
var workflows2 = new Command113("workflows").description("list, start and cancel background workflow runs").configureHelp(helpConfig).addCommand(workflowsList).addCommand(workflowsRun).addCommand(workflowsCancel);
|
|
11103
11302
|
|
|
11104
11303
|
// src/program.ts
|
|
11105
11304
|
var NO_BACKEND_COMMMANDS = /* @__PURE__ */ new Set([
|
|
@@ -11139,10 +11338,10 @@ var NO_BACKEND_COMMMANDS = /* @__PURE__ */ new Set([
|
|
|
11139
11338
|
]);
|
|
11140
11339
|
var BACKEND_OPTIONAL_COMMANDS = /* @__PURE__ */ new Set(["dev", "build", "preview", "deploy"]);
|
|
11141
11340
|
var SELF_CREDENTIALED_COMMANDS = /* @__PURE__ */ new Set(["test:server"]);
|
|
11142
|
-
var program = new
|
|
11341
|
+
var program = new Command114().name(package_default.name).description(package_default.description).version(package_default.version, "-v, --version").configureHelp(helpConfig);
|
|
11143
11342
|
program.hook("preAction", (_thisCommand, actionCommand) => {
|
|
11144
11343
|
if (isStub(actionCommand)) return;
|
|
11145
|
-
const envRoot = findWorkspaceRoot() ??
|
|
11344
|
+
const envRoot = findWorkspaceRoot() ?? process45.cwd();
|
|
11146
11345
|
dotenv2.config({ path: nodePath.join(envRoot, ".env"), quiet: true });
|
|
11147
11346
|
const path47 = getCommandPath(actionCommand);
|
|
11148
11347
|
if (NO_BACKEND_COMMMANDS.has(path47)) return;
|
|
@@ -11150,30 +11349,30 @@ program.hook("preAction", (_thisCommand, actionCommand) => {
|
|
|
11150
11349
|
if (NO_BACKEND_COMMMANDS.has(top)) return;
|
|
11151
11350
|
if (!hasBackend()) {
|
|
11152
11351
|
if (BACKEND_OPTIONAL_COMMANDS.has(top)) return;
|
|
11153
|
-
|
|
11154
|
-
`${
|
|
11352
|
+
p67.log.error(
|
|
11353
|
+
`${pc42.cyan(`vela ${path47}`)} needs a backend, and this project does not have one.
|
|
11155
11354
|
|
|
11156
11355
|
Static projects have no database to talk to.
|
|
11157
11356
|
|
|
11158
|
-
To add a backend to this project, run ${
|
|
11357
|
+
To add a backend to this project, run ${pc42.cyan("vela bless")}.`
|
|
11159
11358
|
);
|
|
11160
|
-
|
|
11161
|
-
|
|
11162
|
-
|
|
11359
|
+
p67.log.message();
|
|
11360
|
+
p67.cancel("Operation failed.");
|
|
11361
|
+
process45.exit(1);
|
|
11163
11362
|
}
|
|
11164
11363
|
if (SELF_CREDENTIALED_COMMANDS.has(path47)) return;
|
|
11165
|
-
if (!
|
|
11166
|
-
|
|
11364
|
+
if (!process45.env.POCKETBASE_SUPERUSER_EMAIL || !process45.env.POCKETBASE_SUPERUSER_PASSWORD) {
|
|
11365
|
+
p67.log.error(
|
|
11167
11366
|
`PocketBase superuser credentials are required.
|
|
11168
11367
|
|
|
11169
|
-
Set ${
|
|
11368
|
+
Set ${pc42.cyan("POCKETBASE_SUPERUSER_EMAIL")} and ${pc42.cyan("POCKETBASE_SUPERUSER_PASSWORD")} in your .env file.
|
|
11170
11369
|
|
|
11171
|
-
To set up a new project, run ${
|
|
11172
|
-
To set up an existing project, run ${
|
|
11370
|
+
To set up a new project, run ${pc42.cyan("vela create")}.
|
|
11371
|
+
To set up an existing project, run ${pc42.cyan("vela bless")}.`
|
|
11173
11372
|
);
|
|
11174
|
-
|
|
11175
|
-
|
|
11176
|
-
|
|
11373
|
+
p67.log.message();
|
|
11374
|
+
p67.cancel("Operation failed.");
|
|
11375
|
+
process45.exit(1);
|
|
11177
11376
|
}
|
|
11178
11377
|
});
|
|
11179
11378
|
function getCommandPath(cmd) {
|
|
@@ -11221,11 +11420,12 @@ for (const command of [
|
|
|
11221
11420
|
i18n3,
|
|
11222
11421
|
oauth,
|
|
11223
11422
|
schemas,
|
|
11224
|
-
cms2
|
|
11423
|
+
cms2,
|
|
11424
|
+
workflows2
|
|
11225
11425
|
]) {
|
|
11226
11426
|
program.addCommand(command);
|
|
11227
11427
|
}
|
|
11228
11428
|
|
|
11229
11429
|
// src/bin.ts
|
|
11230
|
-
program.parse(normalizeArgv(
|
|
11430
|
+
program.parse(normalizeArgv(process46.argv.slice(2)), { from: "user" });
|
|
11231
11431
|
//# sourceMappingURL=bin.js.map
|