vela 0.17.0 → 0.18.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/README.md +1 -1
- package/dist/bin.js +475 -374
- package/dist/bin.js.map +4 -4
- package/package.json +3 -3
package/dist/bin.js
CHANGED
|
@@ -13,14 +13,14 @@ function normalizeArgv(argv) {
|
|
|
13
13
|
// src/program.ts
|
|
14
14
|
import process54 from "node:process";
|
|
15
15
|
import * as p74 from "@clack/prompts";
|
|
16
|
-
import { Command as
|
|
16
|
+
import { Command as Command120 } from "commander";
|
|
17
17
|
import nodePath from "node:path";
|
|
18
18
|
import dotenv2 from "dotenv";
|
|
19
19
|
|
|
20
20
|
// package.json
|
|
21
21
|
var package_default = {
|
|
22
22
|
name: "vela",
|
|
23
|
-
version: "0.
|
|
23
|
+
version: "0.18.0",
|
|
24
24
|
type: "module",
|
|
25
25
|
description: "A CLI for creating and updating SvelteKit projects",
|
|
26
26
|
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.
|
|
60
|
+
"@velastack/patterns": "^0.7.0",
|
|
61
61
|
"@velastack/pocketbase-codegen": "^0.1.0",
|
|
62
62
|
"@velastack/schema": "^0.3.0",
|
|
63
63
|
"@velastack/schema-ui": "^0.3.1",
|
|
@@ -72,7 +72,7 @@ var package_default = {
|
|
|
72
72
|
"package-manager-detector": "^1.8.0",
|
|
73
73
|
picocolors: "^1.1.1",
|
|
74
74
|
pocketbase: "^0.28.0",
|
|
75
|
-
"pocketbase-server": "^0.40.6-beta.
|
|
75
|
+
"pocketbase-server": "^0.40.6-beta.5",
|
|
76
76
|
stripe: "^22.6.2",
|
|
77
77
|
sv: "~1.1.1",
|
|
78
78
|
svelte: "^5.56.10",
|
|
@@ -406,9 +406,9 @@ function minOfComparatorSet(set) {
|
|
|
406
406
|
if (upperOnly) return { major: 0, minor: 0, patch: 0, prerelease: [] };
|
|
407
407
|
return floor;
|
|
408
408
|
}
|
|
409
|
-
function parseVersionPart(
|
|
410
|
-
if (
|
|
411
|
-
const match =
|
|
409
|
+
function parseVersionPart(text18) {
|
|
410
|
+
if (text18 === "" || text18 === "*" || text18 === "x" || text18 === "X") return null;
|
|
411
|
+
const match = text18.match(VERSION_PART);
|
|
412
412
|
if (!match) return null;
|
|
413
413
|
const nums = [match[1], match[2], match[3]];
|
|
414
414
|
const firstWild = nums.findIndex((n) => n === void 0 || /^[xX*]$/.test(n));
|
|
@@ -594,6 +594,8 @@ function detectFeatures(root, { isAppMode }) {
|
|
|
594
594
|
// The code page, not src/lib/server/whatsapp.ts, which goes once the
|
|
595
595
|
// PocketBase SDK has WhatsApp.
|
|
596
596
|
whatsapp: has("src/routes/(public)/(auth)/whatsapp"),
|
|
597
|
+
// The cart store every provider's ecommerce files share a path for.
|
|
598
|
+
ecommerce: has("src/lib/cart.svelte.ts"),
|
|
597
599
|
ui: detectUi(root)
|
|
598
600
|
};
|
|
599
601
|
}
|
|
@@ -899,10 +901,10 @@ function writeCachedIndex(cached2) {
|
|
|
899
901
|
fs6.mkdirSync(cacheRoot(), { recursive: true });
|
|
900
902
|
fs6.writeFileSync(indexCachePath(), JSON.stringify(cached2, null, 2));
|
|
901
903
|
}
|
|
902
|
-
function parseTemplateIndex(
|
|
904
|
+
function parseTemplateIndex(text18, url) {
|
|
903
905
|
let parsed;
|
|
904
906
|
try {
|
|
905
|
-
parsed = JSON.parse(
|
|
907
|
+
parsed = JSON.parse(text18);
|
|
906
908
|
} catch (e) {
|
|
907
909
|
throw new Error(`Template index at ${url} is not valid JSON: ${e.message}`);
|
|
908
910
|
}
|
|
@@ -1852,8 +1854,8 @@ async function readSite(root) {
|
|
|
1852
1854
|
if (!property || !Node6.isPropertyAssignment(property)) continue;
|
|
1853
1855
|
const value = property.getInitializer();
|
|
1854
1856
|
if (Node6.isStringLiteral(value) || Node6.isNoSubstitutionTemplateLiteral(value)) {
|
|
1855
|
-
const
|
|
1856
|
-
if (
|
|
1857
|
+
const text18 = value.getLiteralValue().trim();
|
|
1858
|
+
if (text18) info[key] = text18;
|
|
1857
1859
|
}
|
|
1858
1860
|
}
|
|
1859
1861
|
return info;
|
|
@@ -2192,11 +2194,11 @@ function mergeOriginConfig(root, options = {}) {
|
|
|
2192
2194
|
if (target) setOriginComment(target);
|
|
2193
2195
|
}
|
|
2194
2196
|
if (orphaned.length > 0) {
|
|
2195
|
-
let
|
|
2197
|
+
let text18 = vite.sourceFile.getFullText();
|
|
2196
2198
|
for (const comment of orphaned) {
|
|
2197
|
-
|
|
2199
|
+
text18 = text18.replace(new RegExp(String.raw`\n[\t ]*${escapeRegExp2(comment)}[\t ]*(?=\n)`), "");
|
|
2198
2200
|
}
|
|
2199
|
-
vite.sourceFile.replaceWithText(
|
|
2201
|
+
vite.sourceFile.replaceWithText(text18);
|
|
2200
2202
|
}
|
|
2201
2203
|
vite.sourceFile.saveSync();
|
|
2202
2204
|
const moved = hasPathsOrigin ? "removed prerender.origin, which SvelteKit 3 no longer accepts; kept the existing paths.origin" : "moved prerender.origin to paths.origin";
|
|
@@ -2228,8 +2230,8 @@ var ORIGIN_COMMENT = [
|
|
|
2228
2230
|
"baked in at build time. It is left unset for a deploy that serves more",
|
|
2229
2231
|
"than one host, where each request's own origin is used instead."
|
|
2230
2232
|
];
|
|
2231
|
-
function escapeRegExp2(
|
|
2232
|
-
return
|
|
2233
|
+
function escapeRegExp2(text18) {
|
|
2234
|
+
return text18.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
2233
2235
|
}
|
|
2234
2236
|
function mentionsPrerender(node) {
|
|
2235
2237
|
return node.getLeadingCommentRanges().some((c) => /prerender/i.test(c.getText()));
|
|
@@ -2526,7 +2528,7 @@ function detectJsonIndent(source) {
|
|
|
2526
2528
|
var PRINT_WIDTH = 100;
|
|
2527
2529
|
function stringifyJson(value, indent, level = 0, prefix = 0) {
|
|
2528
2530
|
const pad2 = (n) => indent.repeat(n);
|
|
2529
|
-
const width = (
|
|
2531
|
+
const width = (text18) => text18.replaceAll(" ", " ").length;
|
|
2530
2532
|
if (Array.isArray(value)) {
|
|
2531
2533
|
if (value.length === 0) return "[]";
|
|
2532
2534
|
const scalars = value.every((v14) => v14 === null || typeof v14 !== "object");
|
|
@@ -4380,10 +4382,10 @@ var npmViewLookup = (name, range, cwd) => new Promise((resolve2, reject) => {
|
|
|
4380
4382
|
(error, stdout, stderr) => {
|
|
4381
4383
|
if (error && /\bE404\b/.test(`${stderr}${error.message}`)) return resolve2(null);
|
|
4382
4384
|
if (error) return reject(error);
|
|
4383
|
-
const
|
|
4384
|
-
if (!
|
|
4385
|
+
const text18 = stdout.trim();
|
|
4386
|
+
if (!text18) return resolve2(null);
|
|
4385
4387
|
try {
|
|
4386
|
-
resolve2(newest(JSON.parse(
|
|
4388
|
+
resolve2(newest(JSON.parse(text18)));
|
|
4387
4389
|
} catch (e) {
|
|
4388
4390
|
reject(e);
|
|
4389
4391
|
}
|
|
@@ -4840,14 +4842,14 @@ function skipString(source, start) {
|
|
|
4840
4842
|
}
|
|
4841
4843
|
return -1;
|
|
4842
4844
|
}
|
|
4843
|
-
function splitTopLevel(
|
|
4845
|
+
function splitTopLevel(text18) {
|
|
4844
4846
|
const parts = [];
|
|
4845
4847
|
let depth = 0;
|
|
4846
4848
|
let partStart = 0;
|
|
4847
|
-
for (let i = 0; i <
|
|
4848
|
-
const c =
|
|
4849
|
+
for (let i = 0; i < text18.length; i++) {
|
|
4850
|
+
const c = text18[i];
|
|
4849
4851
|
if (c === '"' || c === "'" || c === "`") {
|
|
4850
|
-
const end = skipString(
|
|
4852
|
+
const end = skipString(text18, i);
|
|
4851
4853
|
if (end === -1) break;
|
|
4852
4854
|
i = end;
|
|
4853
4855
|
continue;
|
|
@@ -4855,12 +4857,12 @@ function splitTopLevel(text19) {
|
|
|
4855
4857
|
if (c === "(" || c === "{" || c === "[") depth++;
|
|
4856
4858
|
else if (c === ")" || c === "}" || c === "]") depth--;
|
|
4857
4859
|
else if (c === "," && depth === 0) {
|
|
4858
|
-
parts.push({ start: partStart, end: i, text:
|
|
4860
|
+
parts.push({ start: partStart, end: i, text: text18.slice(partStart, i) });
|
|
4859
4861
|
partStart = i + 1;
|
|
4860
4862
|
}
|
|
4861
4863
|
}
|
|
4862
|
-
if (
|
|
4863
|
-
parts.push({ start: partStart, end:
|
|
4864
|
+
if (text18.slice(partStart).trim()) {
|
|
4865
|
+
parts.push({ start: partStart, end: text18.length, text: text18.slice(partStart) });
|
|
4864
4866
|
}
|
|
4865
4867
|
return parts;
|
|
4866
4868
|
}
|
|
@@ -4977,8 +4979,8 @@ function rewriteGotoOptions(inner) {
|
|
|
4977
4979
|
if (!joined.startsWith(lead)) joined = lead + joined.trimStart();
|
|
4978
4980
|
return { inner: joined + tail, summary: summary.join("; ") };
|
|
4979
4981
|
}
|
|
4980
|
-
function escapeRegExp3(
|
|
4981
|
-
return
|
|
4982
|
+
function escapeRegExp3(text18) {
|
|
4983
|
+
return text18.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
4982
4984
|
}
|
|
4983
4985
|
function rewriteInvalidateAll(source) {
|
|
4984
4986
|
const outcome = { edits: [], changes: [], tasks: [] };
|
|
@@ -5063,9 +5065,9 @@ function addTaskComments(source, file, tasks) {
|
|
|
5063
5065
|
const lineStart2 = code2.lastIndexOf("\n", index - 1) + 1;
|
|
5064
5066
|
const lineEnd = code2.indexOf("\n", index);
|
|
5065
5067
|
const excerpt = code2.slice(lineStart2, lineEnd === -1 ? void 0 : lineEnd).trim().replace(/--/g, "- -").slice(0, 80);
|
|
5066
|
-
const
|
|
5067
|
-
if (code2.includes(
|
|
5068
|
-
code2 = `<!-- ${
|
|
5068
|
+
const text18 = `${MIGRATION_TASK_MARKER} \`${excerpt}\`: ${message}`;
|
|
5069
|
+
if (code2.includes(text18)) continue;
|
|
5070
|
+
code2 = `<!-- ${text18} -->
|
|
5069
5071
|
${code2}`;
|
|
5070
5072
|
added.push(`line ${line}: ${message}`);
|
|
5071
5073
|
continue;
|
|
@@ -5459,8 +5461,8 @@ function svArgs(root, tasks, exclude) {
|
|
|
5459
5461
|
}
|
|
5460
5462
|
var ANSI = /\u001b\[[0-9;?]*[A-Za-z]/g;
|
|
5461
5463
|
function parseSvFailure(output) {
|
|
5462
|
-
const
|
|
5463
|
-
const match =
|
|
5464
|
+
const text18 = output.replace(ANSI, "");
|
|
5465
|
+
const match = text18.match(/Task '([^']+)' failed: ([^\n]*)/);
|
|
5464
5466
|
if (!match) return null;
|
|
5465
5467
|
const message = match[2].trim();
|
|
5466
5468
|
const file = message.match(/Unable to process '([^']+)'/)?.[1];
|
|
@@ -5550,9 +5552,9 @@ function originFixup(root, capture, sv) {
|
|
|
5550
5552
|
${outcome.snippet}`);
|
|
5551
5553
|
}
|
|
5552
5554
|
const lost = Boolean(carry && !outcome.applied && outcome.snippet);
|
|
5553
|
-
for (const
|
|
5554
|
-
if (carry && !lost && carry.text.endsWith(
|
|
5555
|
-
sv.dropped.push({ file: capture.file, text:
|
|
5555
|
+
for (const text18 of capture?.spreads ?? []) {
|
|
5556
|
+
if (carry && !lost && carry.text.endsWith(text18)) continue;
|
|
5557
|
+
sv.dropped.push({ file: capture.file, text: text18 });
|
|
5556
5558
|
}
|
|
5557
5559
|
return f;
|
|
5558
5560
|
}
|
|
@@ -5863,10 +5865,10 @@ function belowFloor(project, key, entry) {
|
|
|
5863
5865
|
return Boolean(floor && locked && compareVersions(locked, floor) < 0);
|
|
5864
5866
|
}
|
|
5865
5867
|
function readJson(file) {
|
|
5866
|
-
const
|
|
5868
|
+
const text18 = fs29.readFileSync(file, "utf8");
|
|
5867
5869
|
return {
|
|
5868
|
-
data: JSON.parse(
|
|
5869
|
-
indent:
|
|
5870
|
+
data: JSON.parse(text18),
|
|
5871
|
+
indent: text18.match(/^[{[]\s*\n([\t ]+)/)?.[1] ?? " "
|
|
5870
5872
|
};
|
|
5871
5873
|
}
|
|
5872
5874
|
function writeJson(file, data, indent) {
|
|
@@ -5973,13 +5975,13 @@ function previousFollowUps(root, pattern) {
|
|
|
5973
5975
|
const end = content.indexOf("\n## ", start + FOLLOW_UPS_HEADING.length);
|
|
5974
5976
|
return content.slice(start, end === -1 ? void 0 : end).split("\n").filter((line) => line.startsWith("- [") && pattern.test(line)).map((line) => line.replace(/^- \[[ x]\] /, ""));
|
|
5975
5977
|
}
|
|
5976
|
-
function code(
|
|
5977
|
-
const fence =
|
|
5978
|
-
const pad2 =
|
|
5979
|
-
return `${fence}${pad2}${
|
|
5978
|
+
function code(text18) {
|
|
5979
|
+
const fence = text18.includes("`") ? "``" : "`";
|
|
5980
|
+
const pad2 = text18.startsWith("`") || text18.endsWith("`") ? " " : "";
|
|
5981
|
+
return `${fence}${pad2}${text18}${pad2}${fence}`;
|
|
5980
5982
|
}
|
|
5981
|
-
function escape(
|
|
5982
|
-
return
|
|
5983
|
+
function escape(text18) {
|
|
5984
|
+
return text18.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
5983
5985
|
}
|
|
5984
5986
|
function writeFollowUps(root, items, generic) {
|
|
5985
5987
|
const file = path28.join(root, MIGRATION_TASKS_FILE);
|
|
@@ -6121,8 +6123,8 @@ function findRepeaterImport(dir) {
|
|
|
6121
6123
|
for (const entry of entries) {
|
|
6122
6124
|
if (!entry.isFile() || !SOURCE_FILE.test(entry.name)) continue;
|
|
6123
6125
|
const file = path29.join(entry.parentPath, entry.name);
|
|
6124
|
-
const
|
|
6125
|
-
if (
|
|
6126
|
+
const text18 = fs30.readFileSync(file, "utf8");
|
|
6127
|
+
if (text18.includes("CmsRepeater") && REPEATER_IMPORT.test(text18)) {
|
|
6126
6128
|
return path29.relative(dir, file);
|
|
6127
6129
|
}
|
|
6128
6130
|
}
|
|
@@ -6512,7 +6514,7 @@ function hasScript(directory, name) {
|
|
|
6512
6514
|
}
|
|
6513
6515
|
|
|
6514
6516
|
// src/commands/generate.ts
|
|
6515
|
-
import { Command as
|
|
6517
|
+
import { Command as Command11 } from "commander";
|
|
6516
6518
|
|
|
6517
6519
|
// src/commands/generate/form.ts
|
|
6518
6520
|
import { Command as Command4 } from "commander";
|
|
@@ -6539,6 +6541,7 @@ Then run this again.`
|
|
|
6539
6541
|
|
|
6540
6542
|
// src/lib/require-features.ts
|
|
6541
6543
|
import {
|
|
6544
|
+
blockingFeatures,
|
|
6542
6545
|
bySlug as bySlug2,
|
|
6543
6546
|
unmetRequirements
|
|
6544
6547
|
} from "@velastack/patterns";
|
|
@@ -6553,7 +6556,21 @@ var ENABLE_COMMAND = {
|
|
|
6553
6556
|
blog: "vela enable blog",
|
|
6554
6557
|
contentNegotiation: "vela enable content-negotiation",
|
|
6555
6558
|
cms: "vela enable cms",
|
|
6556
|
-
workflows: "vela enable workflows"
|
|
6559
|
+
workflows: "vela enable workflows",
|
|
6560
|
+
ecommerce: "vela enable ecommerce"
|
|
6561
|
+
};
|
|
6562
|
+
var DISABLE_COMMAND = {
|
|
6563
|
+
auth: "vela disable auth",
|
|
6564
|
+
api: "vela disable api",
|
|
6565
|
+
apiKeys: "vela disable api-keys",
|
|
6566
|
+
backend: "vela disable backend",
|
|
6567
|
+
i18n: "vela disable i18n",
|
|
6568
|
+
teams: "vela disable teams",
|
|
6569
|
+
payments: "vela disable payments",
|
|
6570
|
+
blog: "vela disable blog",
|
|
6571
|
+
contentNegotiation: "vela disable content-negotiation",
|
|
6572
|
+
cms: "vela disable cms",
|
|
6573
|
+
ecommerce: "vela disable ecommerce"
|
|
6557
6574
|
};
|
|
6558
6575
|
var FEATURE_NAME = {
|
|
6559
6576
|
apiKeys: "API keys",
|
|
@@ -6608,9 +6625,23 @@ function unmetMessage(command, unmet) {
|
|
|
6608
6625
|
...notes.length > 0 ? ["", ...notes] : []
|
|
6609
6626
|
].join("\n");
|
|
6610
6627
|
}
|
|
6628
|
+
function blockedMessage(command, blocking) {
|
|
6629
|
+
const names = blocking.map((feature) => FEATURE_NAME[feature] ?? feature);
|
|
6630
|
+
const steps = blocking.flatMap((feature) => DISABLE_COMMAND[feature] ?? []);
|
|
6631
|
+
const they = blocking.length > 1 ? "they depend" : "it depends";
|
|
6632
|
+
return [
|
|
6633
|
+
`\`${command}\` can't run while this project has ${names.join(", ")}: ${they} on what it removes.`,
|
|
6634
|
+
"",
|
|
6635
|
+
"Nothing was changed. To take it out first:",
|
|
6636
|
+
...steps.map((step, i) => ` ${i + 1}. ${step}`),
|
|
6637
|
+
"Then run this again."
|
|
6638
|
+
].join("\n");
|
|
6639
|
+
}
|
|
6611
6640
|
function assertRequires(command, pattern, context) {
|
|
6612
6641
|
const unmet = unmetRequirements(pattern, context);
|
|
6613
6642
|
if (unmet.length > 0) throw new Error(unmetMessage(command, unmet));
|
|
6643
|
+
const blocking = blockingFeatures(pattern, context.features);
|
|
6644
|
+
if (blocking.length > 0) throw new Error(blockedMessage(command, blocking));
|
|
6614
6645
|
}
|
|
6615
6646
|
async function assertPatternRequires(slug2, provider) {
|
|
6616
6647
|
const pattern = bySlug2[slug2];
|
|
@@ -7296,15 +7327,55 @@ var workflow = new Command9("workflow").description("generate a background workf
|
|
|
7296
7327
|
)
|
|
7297
7328
|
);
|
|
7298
7329
|
|
|
7330
|
+
// src/commands/generate/shop.ts
|
|
7331
|
+
import { Command as Command10 } from "commander";
|
|
7332
|
+
var shop = new Command10("shop").description("generate a product listing and product pages for the project's cart").option("--provider <provider>", "must match the payments provider: stripe, shopify or whatsapp").allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
7333
|
+
(opts, cmd) => runCommand(async () => {
|
|
7334
|
+
const { detected } = await detectWorkspace();
|
|
7335
|
+
const provider = await resolveProvider("generate-shop", opts.provider, detected.providers);
|
|
7336
|
+
await assertPatternRequires("generate-shop", provider.id);
|
|
7337
|
+
if (provider.id === "stripe") assertBackendReady("vela generate shop");
|
|
7338
|
+
await runPattern(
|
|
7339
|
+
"generate-shop",
|
|
7340
|
+
cmd.args,
|
|
7341
|
+
{ provider: provider.id },
|
|
7342
|
+
{
|
|
7343
|
+
summary: `Generated a ${provider.label} shop.`,
|
|
7344
|
+
nextSteps: [
|
|
7345
|
+
"Run `vela dev` and visit /shop.",
|
|
7346
|
+
...NEXT_STEPS[provider.id],
|
|
7347
|
+
"The pages are yours to edit; `vela destroy shop` removes them."
|
|
7348
|
+
],
|
|
7349
|
+
task: {
|
|
7350
|
+
title: "Generating the shop",
|
|
7351
|
+
success: "Generated the shop",
|
|
7352
|
+
error: "Failed to generate the shop"
|
|
7353
|
+
}
|
|
7354
|
+
}
|
|
7355
|
+
);
|
|
7356
|
+
}, "Failed to generate the shop.")
|
|
7357
|
+
);
|
|
7358
|
+
var NEXT_STEPS = {
|
|
7359
|
+
stripe: [
|
|
7360
|
+
"Products and prices come from your Stripe dashboard; the catalog syncs every ten minutes. Set `metadata.slug` on a product for a readable URL."
|
|
7361
|
+
],
|
|
7362
|
+
shopify: [
|
|
7363
|
+
"Products live in Shopify admin; publish them to the Headless channel the Storefront token belongs to."
|
|
7364
|
+
],
|
|
7365
|
+
whatsapp: [
|
|
7366
|
+
"Edit the products in src/lib/catalog.ts; prices are in `site.currency` (src/lib/site.ts). With the CMS, open /shop with `?edit` instead."
|
|
7367
|
+
]
|
|
7368
|
+
};
|
|
7369
|
+
|
|
7299
7370
|
// src/commands/generate.ts
|
|
7300
|
-
var generate = new
|
|
7371
|
+
var generate = new Command11("generate").description("generate scaffolding for database models and forms").configureHelp(helpConfig).addCommand(form).addCommand(schema).addCommand(resource).addCommand(scaffold).addCommand(shop).addCommand(migration).addCommand(workflow);
|
|
7301
7372
|
|
|
7302
7373
|
// src/commands/enable.ts
|
|
7303
|
-
import { Command as
|
|
7374
|
+
import { Command as Command29 } from "commander";
|
|
7304
7375
|
|
|
7305
7376
|
// src/commands/enable/ai.ts
|
|
7306
|
-
import { Command as
|
|
7307
|
-
var ai = new
|
|
7377
|
+
import { Command as Command12 } from "commander";
|
|
7378
|
+
var ai = new Command12("ai").description("enable AI chat with the Vercel AI SDK (Vercel AI Gateway, OpenAI or Anthropic)").option("--provider <provider>", "AI provider: gateway, openai or anthropic").allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
7308
7379
|
(opts, cmd) => runCommand(async () => {
|
|
7309
7380
|
const provider = await resolveProvider("enable-ai", opts.provider);
|
|
7310
7381
|
const providerEnv = await collectProviderEnv(provider);
|
|
@@ -7336,8 +7407,8 @@ var ai = new Command11("ai").description("enable AI chat with the Vercel AI SDK
|
|
|
7336
7407
|
);
|
|
7337
7408
|
|
|
7338
7409
|
// src/commands/enable/analytics.ts
|
|
7339
|
-
import { Command as
|
|
7340
|
-
var analytics = new
|
|
7410
|
+
import { Command as Command13 } from "commander";
|
|
7411
|
+
var analytics = new Command13("analytics").description("enable web analytics (Plausible, Google Analytics or PostHog)").option("--provider <provider>", "analytics provider: plausible, google or posthog").allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
7341
7412
|
(opts, cmd) => runCommand(async () => {
|
|
7342
7413
|
const provider = await resolveProvider("enable-analytics", opts.provider);
|
|
7343
7414
|
const providerEnv = await collectProviderEnv(provider);
|
|
@@ -7367,8 +7438,8 @@ var analytics = new Command12("analytics").description("enable web analytics (Pl
|
|
|
7367
7438
|
);
|
|
7368
7439
|
|
|
7369
7440
|
// src/commands/enable/auth.ts
|
|
7370
|
-
import { Command as
|
|
7371
|
-
var auth = new
|
|
7441
|
+
import { Command as Command14 } from "commander";
|
|
7442
|
+
var auth = new Command14("auth").description("enable authentication (email/password + OAuth scaffold)").option(
|
|
7372
7443
|
"--remote",
|
|
7373
7444
|
"generate the auth forms with SvelteKit remote functions instead of form actions and superforms"
|
|
7374
7445
|
).allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
@@ -7400,8 +7471,8 @@ var auth = new Command13("auth").description("enable authentication (email/passw
|
|
|
7400
7471
|
);
|
|
7401
7472
|
|
|
7402
7473
|
// src/commands/enable/api.ts
|
|
7403
|
-
import { Command as
|
|
7404
|
-
var api = new
|
|
7474
|
+
import { Command as Command15 } from "commander";
|
|
7475
|
+
var api = new Command15("api").description("enable the PocketBase REST API").allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
7405
7476
|
(_opts, cmd) => runCommand(
|
|
7406
7477
|
() => runPattern(
|
|
7407
7478
|
"enable-api",
|
|
@@ -7426,8 +7497,8 @@ var api = new Command14("api").description("enable the PocketBase REST API").all
|
|
|
7426
7497
|
);
|
|
7427
7498
|
|
|
7428
7499
|
// src/commands/enable/api-keys.ts
|
|
7429
|
-
import { Command as
|
|
7430
|
-
var apiKeys = new
|
|
7500
|
+
import { Command as Command16 } from "commander";
|
|
7501
|
+
var apiKeys = new Command16("api-keys").description("enable API key management").allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
7431
7502
|
(_opts, cmd) => runCommand(
|
|
7432
7503
|
() => runPattern(
|
|
7433
7504
|
"enable-api-keys",
|
|
@@ -7454,14 +7525,14 @@ var apiKeys = new Command15("api-keys").description("enable API key management")
|
|
|
7454
7525
|
// src/commands/enable/backend.ts
|
|
7455
7526
|
import process18 from "node:process";
|
|
7456
7527
|
import * as v6 from "valibot";
|
|
7457
|
-
import { Command as
|
|
7528
|
+
import { Command as Command17 } from "commander";
|
|
7458
7529
|
import * as p20 from "@clack/prompts";
|
|
7459
7530
|
import pc7 from "picocolors";
|
|
7460
7531
|
var optionsSchema3 = v6.strictObject({
|
|
7461
7532
|
email: emailFlag,
|
|
7462
7533
|
password: passwordFlag
|
|
7463
7534
|
});
|
|
7464
|
-
var backend = new
|
|
7535
|
+
var backend = new Command17("backend").description("enable the PocketBase backend").option("--email <email>", "email of the admin user").option("--password <password>", "password of the admin user").allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
7465
7536
|
(rawOpts, cmd) => runCommand(async () => {
|
|
7466
7537
|
const options = parseOptions(optionsSchema3, rawOpts);
|
|
7467
7538
|
const { workspaceRootDir, features } = await getWorkspace();
|
|
@@ -7532,8 +7603,8 @@ async function resolveCredentials(options) {
|
|
|
7532
7603
|
}
|
|
7533
7604
|
|
|
7534
7605
|
// src/commands/enable/i18n.ts
|
|
7535
|
-
import { Command as
|
|
7536
|
-
var i18n = new
|
|
7606
|
+
import { Command as Command18 } from "commander";
|
|
7607
|
+
var i18n = new Command18("i18n").description("enable internationalization").allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
7537
7608
|
(_opts, cmd) => runCommand(
|
|
7538
7609
|
() => runPattern(
|
|
7539
7610
|
"enable-i18n",
|
|
@@ -7558,8 +7629,8 @@ var i18n = new Command17("i18n").description("enable internationalization").allo
|
|
|
7558
7629
|
);
|
|
7559
7630
|
|
|
7560
7631
|
// src/commands/enable/teams.ts
|
|
7561
|
-
import { Command as
|
|
7562
|
-
var teams = new
|
|
7632
|
+
import { Command as Command19 } from "commander";
|
|
7633
|
+
var teams = new Command19("teams").description("enable team / multi-tenant support").allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
7563
7634
|
(_opts, cmd) => runCommand(
|
|
7564
7635
|
() => runPattern(
|
|
7565
7636
|
"enable-teams",
|
|
@@ -7587,7 +7658,7 @@ var teams = new Command18("teams").description("enable team / multi-tenant suppo
|
|
|
7587
7658
|
import fs35 from "node:fs";
|
|
7588
7659
|
import path35 from "node:path";
|
|
7589
7660
|
import process19 from "node:process";
|
|
7590
|
-
import { Command as
|
|
7661
|
+
import { Command as Command20 } from "commander";
|
|
7591
7662
|
import * as p21 from "@clack/prompts";
|
|
7592
7663
|
|
|
7593
7664
|
// src/lib/order-form.ts
|
|
@@ -7647,7 +7718,7 @@ async function ensureOrderForm(root, deps = { readApiKey, createForms: createPro
|
|
|
7647
7718
|
}
|
|
7648
7719
|
|
|
7649
7720
|
// src/commands/enable/payments.ts
|
|
7650
|
-
var payments = new
|
|
7721
|
+
var payments = new Command20("payments").description("enable payments (Stripe, Shopify or WhatsApp)").option("--provider <provider>", "payment provider: stripe, shopify or whatsapp").option(
|
|
7651
7722
|
"--currency <code>",
|
|
7652
7723
|
"WhatsApp: the business's currency, an ISO 4217 code such as MXN (kept in src/lib/site.ts)"
|
|
7653
7724
|
).allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
@@ -7672,7 +7743,7 @@ var payments = new Command19("payments").description("enable payments (Stripe, S
|
|
|
7672
7743
|
nextSteps: [
|
|
7673
7744
|
...blank.map((key) => `Set ${key} in .env.`),
|
|
7674
7745
|
...orderForm,
|
|
7675
|
-
...
|
|
7746
|
+
...NEXT_STEPS2[provider.id],
|
|
7676
7747
|
"Set the same variables on each deploy target with `vela env set`."
|
|
7677
7748
|
],
|
|
7678
7749
|
task: {
|
|
@@ -7684,7 +7755,7 @@ var payments = new Command19("payments").description("enable payments (Stripe, S
|
|
|
7684
7755
|
);
|
|
7685
7756
|
}, "Failed to enable payments.")
|
|
7686
7757
|
);
|
|
7687
|
-
var
|
|
7758
|
+
var NEXT_STEPS2 = {
|
|
7688
7759
|
stripe: [
|
|
7689
7760
|
"Forward Stripe webhooks locally with `stripe listen --forward-to localhost:5173/webhooks/stripe`.",
|
|
7690
7761
|
"Run `vela dev` and visit /payment to run through the checkout flow.",
|
|
@@ -7762,25 +7833,29 @@ async function askDemoId(provider) {
|
|
|
7762
7833
|
}
|
|
7763
7834
|
|
|
7764
7835
|
// src/commands/enable/ecommerce.ts
|
|
7765
|
-
import
|
|
7766
|
-
|
|
7767
|
-
import * as p22 from "@clack/prompts";
|
|
7768
|
-
var ecommerce = new Command20("ecommerce").description("enable a cart and checkout on the project's payments provider").option("--provider <provider>", "must match the payments provider: stripe, shopify or whatsapp").allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
7836
|
+
import { Command as Command21 } from "commander";
|
|
7837
|
+
var ecommerce = new Command21("ecommerce").description("enable a cart and checkout on the project's payments provider").option("--provider <provider>", "must match the payments provider: stripe, shopify or whatsapp").allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
7769
7838
|
(opts, cmd) => runCommand(async () => {
|
|
7770
|
-
const { detected } = await detectWorkspace();
|
|
7839
|
+
const { detected, features } = await detectWorkspace();
|
|
7840
|
+
if (features.ecommerce) {
|
|
7841
|
+
throw new Error(
|
|
7842
|
+
[
|
|
7843
|
+
"This project already has a cart (src/lib/cart.svelte.ts). Nothing was changed.",
|
|
7844
|
+
"To start over, run `vela disable ecommerce` first, then this again."
|
|
7845
|
+
].join("\n")
|
|
7846
|
+
);
|
|
7847
|
+
}
|
|
7771
7848
|
const provider = await resolveProvider("enable-ecommerce", opts.provider, detected.providers);
|
|
7772
7849
|
await assertPatternRequires("enable-ecommerce", provider.id);
|
|
7773
|
-
const demoId = provider.id === "whatsapp" ? "" : await askDemoId2(provider);
|
|
7774
7850
|
await runPattern(
|
|
7775
7851
|
"enable-ecommerce",
|
|
7776
7852
|
cmd.args,
|
|
7777
|
-
{ provider: provider.id
|
|
7853
|
+
{ provider: provider.id },
|
|
7778
7854
|
{
|
|
7779
7855
|
summary: `Enabled a ${provider.label} cart.`,
|
|
7780
7856
|
nextSteps: [
|
|
7781
|
-
|
|
7782
|
-
|
|
7783
|
-
...NEXT_STEPS2[provider.id]
|
|
7857
|
+
"Run `vela generate shop` for a product listing and product pages, or put `<AddToCart>` (src/lib/components/cart/add-to-cart.svelte) on your own pages.",
|
|
7858
|
+
...NEXT_STEPS3[provider.id]
|
|
7784
7859
|
],
|
|
7785
7860
|
task: {
|
|
7786
7861
|
title: "Enabling ecommerce",
|
|
@@ -7791,7 +7866,7 @@ var ecommerce = new Command20("ecommerce").description("enable a cart and checko
|
|
|
7791
7866
|
);
|
|
7792
7867
|
}, "Failed to enable ecommerce.")
|
|
7793
7868
|
);
|
|
7794
|
-
var
|
|
7869
|
+
var NEXT_STEPS3 = {
|
|
7795
7870
|
stripe: [
|
|
7796
7871
|
"Checkout is Stripe Checkout: payment methods, tax and shipping are set in the Stripe dashboard."
|
|
7797
7872
|
],
|
|
@@ -7801,22 +7876,10 @@ var NEXT_STEPS2 = {
|
|
|
7801
7876
|
"Checkout opens WhatsApp with the order; the business confirms it and takes payment in the chat."
|
|
7802
7877
|
]
|
|
7803
7878
|
};
|
|
7804
|
-
async function askDemoId2(provider) {
|
|
7805
|
-
if (!isInteractive()) return "";
|
|
7806
|
-
const value = await p22.text({
|
|
7807
|
-
message: provider.id === "stripe" ? "Stripe price_id for a demo /shop page (price_...)" : "Shopify product variant for a demo /shop page (gid://shopify/ProductVariant/...)",
|
|
7808
|
-
placeholder: "leave blank to skip the demo page"
|
|
7809
|
-
});
|
|
7810
|
-
if (p22.isCancel(value)) {
|
|
7811
|
-
p22.cancel("Operation cancelled.");
|
|
7812
|
-
process20.exit(0);
|
|
7813
|
-
}
|
|
7814
|
-
return (value ?? "").trim();
|
|
7815
|
-
}
|
|
7816
7879
|
|
|
7817
7880
|
// src/commands/enable/subscriptions.ts
|
|
7818
|
-
import { Command as
|
|
7819
|
-
var subscriptions = new
|
|
7881
|
+
import { Command as Command22 } from "commander";
|
|
7882
|
+
var subscriptions = new Command22("subscriptions").description("enable Stripe subscriptions (requires auth and Stripe payments)").allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
7820
7883
|
(_opts, cmd) => runCommand(
|
|
7821
7884
|
() => runPattern(
|
|
7822
7885
|
"enable-subscriptions",
|
|
@@ -7841,8 +7904,8 @@ var subscriptions = new Command21("subscriptions").description("enable Stripe su
|
|
|
7841
7904
|
);
|
|
7842
7905
|
|
|
7843
7906
|
// src/commands/enable/notifications.ts
|
|
7844
|
-
import { Command as
|
|
7845
|
-
var notifications = new
|
|
7907
|
+
import { Command as Command23 } from "commander";
|
|
7908
|
+
var notifications = new Command23("notifications").description("enable in-app notifications with a bell dropdown (requires auth)").allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
7846
7909
|
(_opts, cmd) => runCommand(
|
|
7847
7910
|
() => runPattern(
|
|
7848
7911
|
"enable-notifications",
|
|
@@ -7867,9 +7930,9 @@ var notifications = new Command22("notifications").description("enable in-app no
|
|
|
7867
7930
|
);
|
|
7868
7931
|
|
|
7869
7932
|
// src/commands/enable/cms.ts
|
|
7870
|
-
import
|
|
7871
|
-
import { Command as
|
|
7872
|
-
import * as
|
|
7933
|
+
import process20 from "node:process";
|
|
7934
|
+
import { Command as Command24 } from "commander";
|
|
7935
|
+
import * as p22 from "@clack/prompts";
|
|
7873
7936
|
import pc8 from "picocolors";
|
|
7874
7937
|
function resolveCmsBackend(facts) {
|
|
7875
7938
|
if (facts.endpoint) return { kind: "hosted", endpoint: facts.endpoint, from: "flag" };
|
|
@@ -7886,12 +7949,12 @@ function adapterOf(root) {
|
|
|
7886
7949
|
return "none";
|
|
7887
7950
|
}
|
|
7888
7951
|
}
|
|
7889
|
-
var cms = new
|
|
7952
|
+
var cms = new Command24("cms").description("enable an inline-editing CMS with an admin bar").option(
|
|
7890
7953
|
"--endpoint <url>",
|
|
7891
7954
|
"read from a hosted CMS at this URL instead of installing the backend in this app"
|
|
7892
7955
|
).allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
7893
7956
|
(opts, cmd) => runCommand(async () => {
|
|
7894
|
-
const root = findWorkspaceRoot() ??
|
|
7957
|
+
const root = findWorkspaceRoot() ?? process20.cwd();
|
|
7895
7958
|
assertKit3(root, "vela enable cms");
|
|
7896
7959
|
const backend3 = resolveCmsBackend({
|
|
7897
7960
|
endpoint: opts.endpoint,
|
|
@@ -7900,7 +7963,7 @@ var cms = new Command23("cms").description("enable an inline-editing CMS with an
|
|
|
7900
7963
|
projectId: readProjectConfig(root)?.projectId
|
|
7901
7964
|
});
|
|
7902
7965
|
if (backend3.kind === "none") {
|
|
7903
|
-
|
|
7966
|
+
p22.log.error(
|
|
7904
7967
|
`${pc8.cyan("vela enable cms")} needs somewhere to run the CMS backend, and this project has no Node server.
|
|
7905
7968
|
|
|
7906
7969
|
Any one of these gives it one:
|
|
@@ -7908,14 +7971,14 @@ Any one of these gives it one:
|
|
|
7908
7971
|
- ${pc8.cyan("vela enable cms --endpoint <url>")} to point at a hosted CMS yourself.
|
|
7909
7972
|
- ${pc8.cyan("vela enable backend")}, or switching to @sveltejs/adapter-node, to host it in this app.`
|
|
7910
7973
|
);
|
|
7911
|
-
|
|
7912
|
-
|
|
7913
|
-
|
|
7974
|
+
p22.log.message();
|
|
7975
|
+
p22.cancel("Operation failed.");
|
|
7976
|
+
process20.exitCode = 1;
|
|
7914
7977
|
return;
|
|
7915
7978
|
}
|
|
7916
7979
|
const hosted = backend3.kind === "hosted";
|
|
7917
7980
|
if (hosted && backend3.from === "link") {
|
|
7918
|
-
|
|
7981
|
+
p22.log.info(`Using the hosted CMS of the linked project (${pc8.cyan(backend3.endpoint)}).`);
|
|
7919
7982
|
}
|
|
7920
7983
|
const input = hosted ? { endpoint: backend3.endpoint } : { server: true };
|
|
7921
7984
|
await runPattern("enable-cms", cmd.args, input, {
|
|
@@ -7935,8 +7998,8 @@ Any one of these gives it one:
|
|
|
7935
7998
|
);
|
|
7936
7999
|
|
|
7937
8000
|
// src/commands/enable/blog.ts
|
|
7938
|
-
import { Command as
|
|
7939
|
-
var blog = new
|
|
8001
|
+
import { Command as Command25 } from "commander";
|
|
8002
|
+
var blog = new Command25("blog").description("enable an mdsvex blog with posts, tags, and RSS").allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
7940
8003
|
(_opts, cmd) => runCommand(
|
|
7941
8004
|
() => runPattern(
|
|
7942
8005
|
"enable-blog",
|
|
@@ -7961,16 +8024,16 @@ var blog = new Command24("blog").description("enable an mdsvex blog with posts,
|
|
|
7961
8024
|
);
|
|
7962
8025
|
|
|
7963
8026
|
// src/commands/enable/content-negotiation.ts
|
|
7964
|
-
import
|
|
7965
|
-
import { Command as
|
|
7966
|
-
var contentNegotiation = new
|
|
8027
|
+
import process21 from "node:process";
|
|
8028
|
+
import { Command as Command26 } from "commander";
|
|
8029
|
+
var contentNegotiation = new Command26("content-negotiation").description("enable content negotiation (sveltekit-negotiate)").allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
7967
8030
|
(_opts, cmd) => runCommand(
|
|
7968
8031
|
() => runPattern(
|
|
7969
8032
|
"enable-content-negotiation",
|
|
7970
8033
|
cmd.args,
|
|
7971
8034
|
// The demo page's loader imports `svelte-meta-tags`, which vela's
|
|
7972
8035
|
// templates carry and a project vela did not create may not.
|
|
7973
|
-
{ metaTags: hasDependency(findWorkspaceRoot() ??
|
|
8036
|
+
{ metaTags: hasDependency(findWorkspaceRoot() ?? process21.cwd(), "svelte-meta-tags") },
|
|
7974
8037
|
{
|
|
7975
8038
|
summary: "Enabled content negotiation.",
|
|
7976
8039
|
nextSteps: [
|
|
@@ -7989,8 +8052,8 @@ var contentNegotiation = new Command25("content-negotiation").description("enabl
|
|
|
7989
8052
|
);
|
|
7990
8053
|
|
|
7991
8054
|
// src/commands/enable/workflows.ts
|
|
7992
|
-
import { Command as
|
|
7993
|
-
var workflows = new
|
|
8055
|
+
import { Command as Command27 } from "commander";
|
|
8056
|
+
var workflows = new Command27("workflows").description("add background workflows to a project created before they were built in").allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
7994
8057
|
(_opts, cmd) => runCommand(
|
|
7995
8058
|
() => runPattern(
|
|
7996
8059
|
"enable-workflows",
|
|
@@ -8015,8 +8078,8 @@ var workflows = new Command26("workflows").description("add background workflows
|
|
|
8015
8078
|
);
|
|
8016
8079
|
|
|
8017
8080
|
// src/commands/enable/whatsapp.ts
|
|
8018
|
-
import { Command as
|
|
8019
|
-
var whatsapp = new
|
|
8081
|
+
import { Command as Command28 } from "commander";
|
|
8082
|
+
var whatsapp = new Command28("whatsapp").description("enable WhatsApp sign-in on the login and signup pages (requires auth)").allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
8020
8083
|
(_opts, cmd) => runCommand(
|
|
8021
8084
|
() => runPattern(
|
|
8022
8085
|
"enable-whatsapp",
|
|
@@ -8041,33 +8104,33 @@ var whatsapp = new Command27("whatsapp").description("enable WhatsApp sign-in on
|
|
|
8041
8104
|
);
|
|
8042
8105
|
|
|
8043
8106
|
// src/commands/enable.ts
|
|
8044
|
-
var enable = new
|
|
8107
|
+
var enable = new Command29("enable").description("enable features").configureHelp(helpConfig).addCommand(ai).addCommand(analytics).addCommand(auth).addCommand(api).addCommand(apiKeys).addCommand(backend).addCommand(contentNegotiation).addCommand(i18n).addCommand(teams).addCommand(payments).addCommand(ecommerce).addCommand(subscriptions).addCommand(notifications).addCommand(cms).addCommand(blog).addCommand(workflows).addCommand(whatsapp);
|
|
8045
8108
|
|
|
8046
8109
|
// src/commands/disable.ts
|
|
8047
|
-
import { Command as
|
|
8110
|
+
import { Command as Command44 } from "commander";
|
|
8048
8111
|
|
|
8049
8112
|
// src/commands/disable/ai.ts
|
|
8050
|
-
import { Command as
|
|
8113
|
+
import { Command as Command30 } from "commander";
|
|
8051
8114
|
|
|
8052
8115
|
// src/commands/disable/_shared.ts
|
|
8053
|
-
import
|
|
8054
|
-
import * as
|
|
8116
|
+
import process22 from "node:process";
|
|
8117
|
+
import * as p23 from "@clack/prompts";
|
|
8055
8118
|
async function runDisable(opts, flags, cmdArgs) {
|
|
8056
8119
|
if (!flags.yes) {
|
|
8057
|
-
const ok = await
|
|
8120
|
+
const ok = await p23.confirm({
|
|
8058
8121
|
message: opts.confirmMessage,
|
|
8059
8122
|
initialValue: false
|
|
8060
8123
|
});
|
|
8061
|
-
if (
|
|
8062
|
-
|
|
8063
|
-
|
|
8124
|
+
if (p23.isCancel(ok) || !ok) {
|
|
8125
|
+
p23.cancel("Operation cancelled.");
|
|
8126
|
+
process22.exit(0);
|
|
8064
8127
|
}
|
|
8065
8128
|
}
|
|
8066
8129
|
await runPattern(opts.slug, cmdArgs, { destructive: true }, opts.report);
|
|
8067
8130
|
}
|
|
8068
8131
|
|
|
8069
8132
|
// src/commands/disable/ai.ts
|
|
8070
|
-
var ai2 = new
|
|
8133
|
+
var ai2 = new Command30("ai").description("disable AI chat").option("-y, --yes", "skip confirmation prompt").allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
8071
8134
|
(opts, cmd) => runCommand(
|
|
8072
8135
|
() => runDisable(
|
|
8073
8136
|
{
|
|
@@ -8093,8 +8156,8 @@ var ai2 = new Command29("ai").description("disable AI chat").option("-y, --yes",
|
|
|
8093
8156
|
);
|
|
8094
8157
|
|
|
8095
8158
|
// src/commands/disable/analytics.ts
|
|
8096
|
-
import { Command as
|
|
8097
|
-
var analytics2 = new
|
|
8159
|
+
import { Command as Command31 } from "commander";
|
|
8160
|
+
var analytics2 = new Command31("analytics").description("disable web analytics").option("-y, --yes", "skip confirmation prompt").allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
8098
8161
|
(opts, cmd) => runCommand(
|
|
8099
8162
|
() => runDisable(
|
|
8100
8163
|
{
|
|
@@ -8120,8 +8183,8 @@ var analytics2 = new Command30("analytics").description("disable web analytics")
|
|
|
8120
8183
|
);
|
|
8121
8184
|
|
|
8122
8185
|
// src/commands/disable/auth.ts
|
|
8123
|
-
import { Command as
|
|
8124
|
-
var auth2 = new
|
|
8186
|
+
import { Command as Command32 } from "commander";
|
|
8187
|
+
var auth2 = new Command32("auth").description("disable authentication").option("-y, --yes", "skip confirmation prompt").allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
8125
8188
|
(opts, cmd) => runCommand(
|
|
8126
8189
|
() => runDisable(
|
|
8127
8190
|
{
|
|
@@ -8147,8 +8210,8 @@ var auth2 = new Command31("auth").description("disable authentication").option("
|
|
|
8147
8210
|
);
|
|
8148
8211
|
|
|
8149
8212
|
// src/commands/disable/api.ts
|
|
8150
|
-
import { Command as
|
|
8151
|
-
var api2 = new
|
|
8213
|
+
import { Command as Command33 } from "commander";
|
|
8214
|
+
var api2 = new Command33("api").description("disable the REST API").option("-y, --yes", "skip confirmation prompt").allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
8152
8215
|
(opts, cmd) => runCommand(
|
|
8153
8216
|
() => runDisable(
|
|
8154
8217
|
{
|
|
@@ -8171,8 +8234,8 @@ var api2 = new Command32("api").description("disable the REST API").option("-y,
|
|
|
8171
8234
|
);
|
|
8172
8235
|
|
|
8173
8236
|
// src/commands/disable/api-keys.ts
|
|
8174
|
-
import { Command as
|
|
8175
|
-
var apiKeys2 = new
|
|
8237
|
+
import { Command as Command34 } from "commander";
|
|
8238
|
+
var apiKeys2 = new Command34("api-keys").description("disable API key management").option("-y, --yes", "skip confirmation prompt").allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
8176
8239
|
(opts, cmd) => runCommand(
|
|
8177
8240
|
() => runDisable(
|
|
8178
8241
|
{
|
|
@@ -8195,8 +8258,8 @@ var apiKeys2 = new Command33("api-keys").description("disable API key management
|
|
|
8195
8258
|
);
|
|
8196
8259
|
|
|
8197
8260
|
// src/commands/disable/backend.ts
|
|
8198
|
-
import { Command as
|
|
8199
|
-
var backend2 = new
|
|
8261
|
+
import { Command as Command35 } from "commander";
|
|
8262
|
+
var backend2 = new Command35("backend").description("disable the PocketBase backend").option("-y, --yes", "skip confirmation prompt").allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
8200
8263
|
(opts, cmd) => runCommand(
|
|
8201
8264
|
() => runDisable(
|
|
8202
8265
|
{
|
|
@@ -8219,8 +8282,8 @@ var backend2 = new Command34("backend").description("disable the PocketBase back
|
|
|
8219
8282
|
);
|
|
8220
8283
|
|
|
8221
8284
|
// src/commands/disable/content-negotiation.ts
|
|
8222
|
-
import { Command as
|
|
8223
|
-
var contentNegotiation2 = new
|
|
8285
|
+
import { Command as Command36 } from "commander";
|
|
8286
|
+
var contentNegotiation2 = new Command36("content-negotiation").description("disable content negotiation").option("-y, --yes", "skip confirmation prompt").allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
8224
8287
|
(opts, cmd) => runCommand(
|
|
8225
8288
|
() => runDisable(
|
|
8226
8289
|
{
|
|
@@ -8243,8 +8306,8 @@ var contentNegotiation2 = new Command35("content-negotiation").description("disa
|
|
|
8243
8306
|
);
|
|
8244
8307
|
|
|
8245
8308
|
// src/commands/disable/i18n.ts
|
|
8246
|
-
import { Command as
|
|
8247
|
-
var i18n2 = new
|
|
8309
|
+
import { Command as Command37 } from "commander";
|
|
8310
|
+
var i18n2 = new Command37("i18n").description("disable internationalization").option("-y, --yes", "skip confirmation prompt").allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
8248
8311
|
(opts, cmd) => runCommand(
|
|
8249
8312
|
() => runDisable(
|
|
8250
8313
|
{
|
|
@@ -8268,8 +8331,8 @@ var i18n2 = new Command36("i18n").description("disable internationalization").op
|
|
|
8268
8331
|
);
|
|
8269
8332
|
|
|
8270
8333
|
// src/commands/disable/notifications.ts
|
|
8271
|
-
import { Command as
|
|
8272
|
-
var notifications2 = new
|
|
8334
|
+
import { Command as Command38 } from "commander";
|
|
8335
|
+
var notifications2 = new Command38("notifications").description("disable in-app notifications").option("-y, --yes", "skip confirmation prompt").allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
8273
8336
|
(opts, cmd) => runCommand(
|
|
8274
8337
|
() => runDisable(
|
|
8275
8338
|
{
|
|
@@ -8295,8 +8358,8 @@ var notifications2 = new Command37("notifications").description("disable in-app
|
|
|
8295
8358
|
);
|
|
8296
8359
|
|
|
8297
8360
|
// src/commands/disable/teams.ts
|
|
8298
|
-
import { Command as
|
|
8299
|
-
var teams2 = new
|
|
8361
|
+
import { Command as Command39 } from "commander";
|
|
8362
|
+
var teams2 = new Command39("teams").description("disable teams").option("-y, --yes", "skip confirmation prompt").allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
8300
8363
|
(opts, cmd) => runCommand(
|
|
8301
8364
|
() => runDisable(
|
|
8302
8365
|
{
|
|
@@ -8319,7 +8382,7 @@ var teams2 = new Command38("teams").description("disable teams").option("-y, --y
|
|
|
8319
8382
|
);
|
|
8320
8383
|
|
|
8321
8384
|
// src/commands/disable/payments.ts
|
|
8322
|
-
import { Command as
|
|
8385
|
+
import { Command as Command40 } from "commander";
|
|
8323
8386
|
var STRIPE = {
|
|
8324
8387
|
confirmMessage: "Disable payments? Drops Stripe collections, strips Stripe env credentials, reverts nav/signup edits, and removes generated payment files. Stripe dashboard products/prices and the stripe packages are untouched.",
|
|
8325
8388
|
nextSteps: [
|
|
@@ -8341,7 +8404,7 @@ var WHATSAPP = {
|
|
|
8341
8404
|
]
|
|
8342
8405
|
};
|
|
8343
8406
|
var COPY = { shopify: SHOPIFY, whatsapp: WHATSAPP };
|
|
8344
|
-
var payments2 = new
|
|
8407
|
+
var payments2 = new Command40("payments").description("disable payments").option("-y, --yes", "skip confirmation prompt").allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
8345
8408
|
(opts, cmd) => runCommand(async () => {
|
|
8346
8409
|
const { detected } = await detectWorkspace();
|
|
8347
8410
|
const provider = detected.providers.payments;
|
|
@@ -8370,8 +8433,8 @@ var payments2 = new Command39("payments").description("disable payments").option
|
|
|
8370
8433
|
);
|
|
8371
8434
|
|
|
8372
8435
|
// src/commands/disable/ecommerce.ts
|
|
8373
|
-
import { Command as
|
|
8374
|
-
var ecommerce2 = new
|
|
8436
|
+
import { Command as Command41 } from "commander";
|
|
8437
|
+
var ecommerce2 = new Command41("ecommerce").description("disable ecommerce").option("-y, --yes", "skip confirmation prompt").allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
8375
8438
|
(opts, cmd) => runCommand(
|
|
8376
8439
|
() => runDisable(
|
|
8377
8440
|
{
|
|
@@ -8398,8 +8461,8 @@ var ecommerce2 = new Command40("ecommerce").description("disable ecommerce").opt
|
|
|
8398
8461
|
);
|
|
8399
8462
|
|
|
8400
8463
|
// src/commands/disable/subscriptions.ts
|
|
8401
|
-
import { Command as
|
|
8402
|
-
var subscriptions2 = new
|
|
8464
|
+
import { Command as Command42 } from "commander";
|
|
8465
|
+
var subscriptions2 = new Command42("subscriptions").description("disable Stripe subscriptions").option("-y, --yes", "skip confirmation prompt").allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
8403
8466
|
(opts, cmd) => runCommand(
|
|
8404
8467
|
() => runDisable(
|
|
8405
8468
|
{
|
|
@@ -8426,8 +8489,8 @@ var subscriptions2 = new Command41("subscriptions").description("disable Stripe
|
|
|
8426
8489
|
);
|
|
8427
8490
|
|
|
8428
8491
|
// src/commands/disable/whatsapp.ts
|
|
8429
|
-
import { Command as
|
|
8430
|
-
var whatsapp2 = new
|
|
8492
|
+
import { Command as Command43 } from "commander";
|
|
8493
|
+
var whatsapp2 = new Command43("whatsapp").description("disable WhatsApp sign-in").option("-y, --yes", "skip confirmation prompt").allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
8431
8494
|
(opts, cmd) => runCommand(
|
|
8432
8495
|
() => runDisable(
|
|
8433
8496
|
{
|
|
@@ -8455,30 +8518,30 @@ var whatsapp2 = new Command42("whatsapp").description("disable WhatsApp sign-in"
|
|
|
8455
8518
|
);
|
|
8456
8519
|
|
|
8457
8520
|
// src/commands/disable.ts
|
|
8458
|
-
var disable = new
|
|
8521
|
+
var disable = new Command44("disable").description("disable features").configureHelp(helpConfig).addCommand(ai2).addCommand(analytics2).addCommand(auth2).addCommand(api2).addCommand(apiKeys2).addCommand(backend2).addCommand(contentNegotiation2).addCommand(i18n2).addCommand(notifications2).addCommand(teams2).addCommand(payments2).addCommand(ecommerce2).addCommand(subscriptions2).addCommand(whatsapp2);
|
|
8459
8522
|
|
|
8460
8523
|
// src/commands/destroy.ts
|
|
8461
|
-
import { Command as
|
|
8524
|
+
import { Command as Command51 } from "commander";
|
|
8462
8525
|
|
|
8463
8526
|
// src/commands/destroy/form.ts
|
|
8464
|
-
import { Command as
|
|
8527
|
+
import { Command as Command45 } from "commander";
|
|
8465
8528
|
|
|
8466
8529
|
// src/commands/destroy/_shared.ts
|
|
8467
|
-
import
|
|
8468
|
-
import * as
|
|
8530
|
+
import process23 from "node:process";
|
|
8531
|
+
import * as p24 from "@clack/prompts";
|
|
8469
8532
|
async function runDestroy(slug2, model, confirmMessage, report5, flags) {
|
|
8470
8533
|
if (!flags.yes) {
|
|
8471
|
-
const ok = await
|
|
8472
|
-
if (
|
|
8473
|
-
|
|
8474
|
-
|
|
8534
|
+
const ok = await p24.confirm({ message: confirmMessage, initialValue: false });
|
|
8535
|
+
if (p24.isCancel(ok) || !ok) {
|
|
8536
|
+
p24.cancel("Operation cancelled.");
|
|
8537
|
+
process23.exit(0);
|
|
8475
8538
|
}
|
|
8476
8539
|
}
|
|
8477
8540
|
await runPattern(slug2, [model], { destructive: true, route: flags.route }, report5);
|
|
8478
8541
|
}
|
|
8479
8542
|
|
|
8480
8543
|
// src/commands/destroy/form.ts
|
|
8481
|
-
var form2 = new
|
|
8544
|
+
var form2 = new Command45("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(
|
|
8482
8545
|
"--route <route>",
|
|
8483
8546
|
"custom route the form was generated at (must match the --route used at generation)"
|
|
8484
8547
|
).allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
@@ -8502,8 +8565,8 @@ var form2 = new Command44("form").description("destroy a form generated by `vela
|
|
|
8502
8565
|
);
|
|
8503
8566
|
|
|
8504
8567
|
// src/commands/destroy/schema.ts
|
|
8505
|
-
import { Command as
|
|
8506
|
-
var schema2 = new
|
|
8568
|
+
import { Command as Command46 } from "commander";
|
|
8569
|
+
var schema2 = new Command46("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").allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
8507
8570
|
(model, opts) => runCommand(
|
|
8508
8571
|
() => runDestroy(
|
|
8509
8572
|
"destroy-schema",
|
|
@@ -8524,8 +8587,8 @@ var schema2 = new Command45("schema").description("destroy a zod schema generate
|
|
|
8524
8587
|
);
|
|
8525
8588
|
|
|
8526
8589
|
// src/commands/destroy/resource.ts
|
|
8527
|
-
import { Command as
|
|
8528
|
-
var resource2 = new
|
|
8590
|
+
import { Command as Command47 } from "commander";
|
|
8591
|
+
var resource2 = new Command47("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").allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
8529
8592
|
(model, opts) => runCommand(
|
|
8530
8593
|
() => runDestroy(
|
|
8531
8594
|
"destroy-resource",
|
|
@@ -8546,8 +8609,8 @@ var resource2 = new Command46("resource").description("destroy a resource genera
|
|
|
8546
8609
|
);
|
|
8547
8610
|
|
|
8548
8611
|
// src/commands/destroy/scaffold.ts
|
|
8549
|
-
import { Command as
|
|
8550
|
-
var scaffold2 = new
|
|
8612
|
+
import { Command as Command48 } from "commander";
|
|
8613
|
+
var scaffold2 = new Command48("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(
|
|
8551
8614
|
"--route <route>",
|
|
8552
8615
|
"custom route the scaffold was generated at (must match the --route used at generation)"
|
|
8553
8616
|
).allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
@@ -8574,15 +8637,15 @@ var scaffold2 = new Command47("scaffold").description("destroy a scaffold genera
|
|
|
8574
8637
|
);
|
|
8575
8638
|
|
|
8576
8639
|
// src/commands/destroy/deployment.ts
|
|
8577
|
-
import
|
|
8578
|
-
import { Command as
|
|
8579
|
-
import * as
|
|
8640
|
+
import process27 from "node:process";
|
|
8641
|
+
import { Command as Command49 } from "commander";
|
|
8642
|
+
import * as p28 from "@clack/prompts";
|
|
8580
8643
|
import pc12 from "picocolors";
|
|
8581
8644
|
|
|
8582
8645
|
// src/lib/server-command.ts
|
|
8583
|
-
import
|
|
8646
|
+
import process26 from "node:process";
|
|
8584
8647
|
import * as v8 from "valibot";
|
|
8585
|
-
import * as
|
|
8648
|
+
import * as p25 from "@clack/prompts";
|
|
8586
8649
|
import pc9 from "picocolors";
|
|
8587
8650
|
|
|
8588
8651
|
// src/lib/deploy-config.ts
|
|
@@ -8714,7 +8777,7 @@ import fs37 from "node:fs";
|
|
|
8714
8777
|
import os5 from "node:os";
|
|
8715
8778
|
import path37 from "node:path";
|
|
8716
8779
|
import crypto4 from "node:crypto";
|
|
8717
|
-
import
|
|
8780
|
+
import process24 from "node:process";
|
|
8718
8781
|
import { spawn as spawn4 } from "node:child_process";
|
|
8719
8782
|
var RemoteCommandError = class extends Error {
|
|
8720
8783
|
exitCode;
|
|
@@ -8992,17 +9055,17 @@ function spawnCapture(command, args, opts = {}) {
|
|
|
8992
9055
|
const child = spawn4(command, args, {
|
|
8993
9056
|
stdio,
|
|
8994
9057
|
cwd: opts.cwd,
|
|
8995
|
-
env: opts.env ? { ...
|
|
9058
|
+
env: opts.env ? { ...process24.env, ...opts.env } : void 0
|
|
8996
9059
|
});
|
|
8997
9060
|
let stdout = "";
|
|
8998
9061
|
let stderr = "";
|
|
8999
9062
|
child.stdout?.on("data", (chunk) => {
|
|
9000
9063
|
stdout += chunk;
|
|
9001
|
-
if (opts.streamStdout)
|
|
9064
|
+
if (opts.streamStdout) process24.stdout.write(chunk);
|
|
9002
9065
|
});
|
|
9003
9066
|
child.stderr?.on("data", (chunk) => {
|
|
9004
9067
|
stderr += chunk;
|
|
9005
|
-
if (opts.stream)
|
|
9068
|
+
if (opts.stream) process24.stderr.write(chunk);
|
|
9006
9069
|
});
|
|
9007
9070
|
child.on("error", reject);
|
|
9008
9071
|
child.on("close", (code2) => resolve2({ stdout, stderr, exitCode: code2 ?? 1 }));
|
|
@@ -9116,7 +9179,7 @@ function sshOptionsFrom(options) {
|
|
|
9116
9179
|
import crypto5 from "node:crypto";
|
|
9117
9180
|
import fs39 from "node:fs";
|
|
9118
9181
|
import path39 from "node:path";
|
|
9119
|
-
import
|
|
9182
|
+
import process25 from "node:process";
|
|
9120
9183
|
var VELA_ROOT = "/var/lib/vela";
|
|
9121
9184
|
var VELA_ETC = "/etc/vela";
|
|
9122
9185
|
var VELA_USER = "vela";
|
|
@@ -9153,7 +9216,7 @@ async function syncServerScripts(session) {
|
|
|
9153
9216
|
const dir = `${SCRIPT_VERSIONS_DIR}/${digest}`;
|
|
9154
9217
|
const present = await session.script(`[ -d "$1" ] && echo yes || echo no`, { args: [dir] });
|
|
9155
9218
|
if (present.stdout.trim() !== "yes") {
|
|
9156
|
-
const incoming = `${SCRIPT_VERSIONS_DIR}/.incoming.${digest}.${
|
|
9219
|
+
const incoming = `${SCRIPT_VERSIONS_DIR}/.incoming.${digest}.${process25.pid}.${Date.now()}`;
|
|
9157
9220
|
await session.script(`mkdir -p "$1" && chmod 0755 "$(dirname "$1")" "$1"`, {
|
|
9158
9221
|
args: [incoming]
|
|
9159
9222
|
});
|
|
@@ -9422,8 +9485,8 @@ function describeTarget(target) {
|
|
|
9422
9485
|
return target.name;
|
|
9423
9486
|
}
|
|
9424
9487
|
}
|
|
9425
|
-
function bold(
|
|
9426
|
-
return `\`${
|
|
9488
|
+
function bold(text18) {
|
|
9489
|
+
return `\`${text18}\``;
|
|
9427
9490
|
}
|
|
9428
9491
|
|
|
9429
9492
|
// src/lib/server-command.ts
|
|
@@ -9520,7 +9583,7 @@ async function ensureBinding(workspaceRootDir, target, request = {}) {
|
|
|
9520
9583
|
writeBinding(workspaceRootDir, key, binding);
|
|
9521
9584
|
}
|
|
9522
9585
|
if (moving) {
|
|
9523
|
-
|
|
9586
|
+
p25.log.warn(
|
|
9524
9587
|
`${pc9.cyan(bindingName(target))} now points at ${pc9.cyan(server)}.
|
|
9525
9588
|
|
|
9526
9589
|
Whatever is running on ${existing.server} is left there, and this project can no
|
|
@@ -9531,7 +9594,7 @@ longer reach it. Remove it there first if that was not intended.`
|
|
|
9531
9594
|
}
|
|
9532
9595
|
async function confirmMove(target, from, to) {
|
|
9533
9596
|
const name = bindingName(target);
|
|
9534
|
-
if (!
|
|
9597
|
+
if (!process26.stdout.isTTY || process26.env.CI) {
|
|
9535
9598
|
throw new Error(
|
|
9536
9599
|
`${pc9.cyan(`--server ${to}`)} does not match the server recorded for ${pc9.cyan(name)}, ${pc9.cyan(from)}.
|
|
9537
9600
|
|
|
@@ -9539,13 +9602,13 @@ Drop ${pc9.cyan("--server")} to use the recorded one, or move the binding on pur
|
|
|
9539
9602
|
this command once from a terminal (or editing .vela/project.json).`
|
|
9540
9603
|
);
|
|
9541
9604
|
}
|
|
9542
|
-
const ok = await
|
|
9605
|
+
const ok = await p25.confirm({
|
|
9543
9606
|
message: `${name} ${target.kind === "preview" ? "run" : "runs"} on ${from}. Point ${name} at ${to} instead?`,
|
|
9544
9607
|
initialValue: false
|
|
9545
9608
|
});
|
|
9546
|
-
if (
|
|
9547
|
-
|
|
9548
|
-
|
|
9609
|
+
if (p25.isCancel(ok) || !ok) {
|
|
9610
|
+
p25.cancel("Operation cancelled.");
|
|
9611
|
+
process26.exit(0);
|
|
9549
9612
|
}
|
|
9550
9613
|
}
|
|
9551
9614
|
function bindingName(target) {
|
|
@@ -9553,7 +9616,7 @@ function bindingName(target) {
|
|
|
9553
9616
|
}
|
|
9554
9617
|
async function promptServer(target) {
|
|
9555
9618
|
const name = bindingName(target);
|
|
9556
|
-
if (!
|
|
9619
|
+
if (!process26.stdout.isTTY || process26.env.CI) {
|
|
9557
9620
|
throw new Error(
|
|
9558
9621
|
`${name} ${target.kind === "preview" ? "are" : "is"} not bound to a server yet, and there is no terminal to ask on.
|
|
9559
9622
|
|
|
@@ -9561,29 +9624,29 @@ Pass ${pc9.cyan("--server user@host")}, or run the command once from your own ma
|
|
|
9561
9624
|
and commit ${pc9.cyan(".vela/project.json")}.`
|
|
9562
9625
|
);
|
|
9563
9626
|
}
|
|
9564
|
-
|
|
9627
|
+
p25.log.info(
|
|
9565
9628
|
`${pc9.cyan(name)} ${target.kind === "preview" ? "are" : "is"} not bound to a server yet.`
|
|
9566
9629
|
);
|
|
9567
|
-
const value = await
|
|
9630
|
+
const value = await p25.text({
|
|
9568
9631
|
message: `Which server should ${name} run on?`,
|
|
9569
9632
|
placeholder: "root@203.0.113.10",
|
|
9570
9633
|
validate: (input) => input?.trim() ? void 0 : "An ssh_config alias, or user@host"
|
|
9571
9634
|
});
|
|
9572
|
-
if (
|
|
9573
|
-
|
|
9574
|
-
|
|
9635
|
+
if (p25.isCancel(value)) {
|
|
9636
|
+
p25.cancel("Operation cancelled.");
|
|
9637
|
+
process26.exit(0);
|
|
9575
9638
|
}
|
|
9576
9639
|
return value.trim();
|
|
9577
9640
|
}
|
|
9578
9641
|
async function promptDomain(target) {
|
|
9579
|
-
if (!
|
|
9580
|
-
const value = await
|
|
9642
|
+
if (!process26.stdout.isTTY || process26.env.CI) return void 0;
|
|
9643
|
+
const value = await p25.text({
|
|
9581
9644
|
message: `Which hostname should ${target.name} be served on?`,
|
|
9582
9645
|
placeholder: "example.com \u2014 leave blank to decide later"
|
|
9583
9646
|
});
|
|
9584
|
-
if (
|
|
9585
|
-
|
|
9586
|
-
|
|
9647
|
+
if (p25.isCancel(value)) {
|
|
9648
|
+
p25.cancel("Operation cancelled.");
|
|
9649
|
+
process26.exit(0);
|
|
9587
9650
|
}
|
|
9588
9651
|
return value.trim() || void 0;
|
|
9589
9652
|
}
|
|
@@ -9591,10 +9654,10 @@ async function applyRestart(ctx) {
|
|
|
9591
9654
|
const outcome = await restartInstance(ctx.session, ctx.instance);
|
|
9592
9655
|
if (!outcome.deployed) return;
|
|
9593
9656
|
if (outcome.restarted) {
|
|
9594
|
-
|
|
9657
|
+
p25.log.success("App restarted");
|
|
9595
9658
|
return;
|
|
9596
9659
|
}
|
|
9597
|
-
|
|
9660
|
+
p25.log.error(
|
|
9598
9661
|
`App restart failed.
|
|
9599
9662
|
|
|
9600
9663
|
The new value is stored and will be used the next time the app starts.
|
|
@@ -9603,7 +9666,7 @@ ${pc9.dim(outcome.error ?? "")}`
|
|
|
9603
9666
|
}
|
|
9604
9667
|
async function applyEnvRestart(ctx, changed) {
|
|
9605
9668
|
if (touchesSuperuser(changed)) {
|
|
9606
|
-
|
|
9669
|
+
p25.log.warn(
|
|
9607
9670
|
`PocketBase superuser credentials changed.
|
|
9608
9671
|
|
|
9609
9672
|
The database still holds the old ones, so the app has not been restarted.
|
|
@@ -9640,14 +9703,14 @@ function isPreview(envTag) {
|
|
|
9640
9703
|
return envTag.startsWith("preview--");
|
|
9641
9704
|
}
|
|
9642
9705
|
function destroyDecision(request) {
|
|
9643
|
-
const { appName, purge, yes, confirm:
|
|
9706
|
+
const { appName, purge, yes, confirm: confirm15, interactive } = request;
|
|
9644
9707
|
const dangerous = isProd(request.envTag) || purge && !isPreview(request.envTag);
|
|
9645
9708
|
const what = describe(request);
|
|
9646
|
-
if (
|
|
9647
|
-
if (
|
|
9709
|
+
if (confirm15 !== void 0) {
|
|
9710
|
+
if (confirm15 === appName) return { kind: "proceed" };
|
|
9648
9711
|
return {
|
|
9649
9712
|
kind: "refuse",
|
|
9650
|
-
message: `\`--confirm ${
|
|
9713
|
+
message: `\`--confirm ${confirm15}\` does not name this app. Removing ${what} takes \`--confirm ${appName}\`.`
|
|
9651
9714
|
};
|
|
9652
9715
|
}
|
|
9653
9716
|
if (dangerous) {
|
|
@@ -9680,11 +9743,11 @@ function describe({ appName, envTag, purge }) {
|
|
|
9680
9743
|
}
|
|
9681
9744
|
|
|
9682
9745
|
// src/lib/deploy-report.ts
|
|
9683
|
-
import * as
|
|
9746
|
+
import * as p27 from "@clack/prompts";
|
|
9684
9747
|
import pc11 from "picocolors";
|
|
9685
9748
|
|
|
9686
9749
|
// src/lib/server-identity.ts
|
|
9687
|
-
import * as
|
|
9750
|
+
import * as p26 from "@clack/prompts";
|
|
9688
9751
|
import pc10 from "picocolors";
|
|
9689
9752
|
var IPV4 = /^\d{1,3}(?:\.\d{1,3}){3}$/;
|
|
9690
9753
|
async function ensureServerIdentity(session, apiKey) {
|
|
@@ -9698,7 +9761,7 @@ async function ensureServerIdentity(session, apiKey) {
|
|
|
9698
9761
|
if (!existing || existing.serverId !== registered.serverId || existing.originHost !== registered.originHost || existing.token !== registered.token) {
|
|
9699
9762
|
await writeServerIdentity(session, registered);
|
|
9700
9763
|
if (existing) {
|
|
9701
|
-
|
|
9764
|
+
p26.log.info(`${pc10.cyan(session.target)} was re-registered with velastack.dev.`);
|
|
9702
9765
|
}
|
|
9703
9766
|
}
|
|
9704
9767
|
await runServerScript(session, "origin.sh");
|
|
@@ -9738,7 +9801,7 @@ function createDeployReporter(workspaceRootDir) {
|
|
|
9738
9801
|
const link2 = readProjectConfig(workspaceRootDir);
|
|
9739
9802
|
const apiKey = link2 ? readApiKey() : null;
|
|
9740
9803
|
if (link2 && !apiKey) {
|
|
9741
|
-
|
|
9804
|
+
p27.log.warn(
|
|
9742
9805
|
`This project is linked to ${pc11.cyan(link2.projectName)} on velastack.dev, but there is no
|
|
9743
9806
|
API key here, so this deploy will not be recorded. Run ${pc11.cyan("vela login")}, or set
|
|
9744
9807
|
${pc11.cyan("VELA_API_KEY")}.`
|
|
@@ -9789,7 +9852,7 @@ async function reportEnvironmentDestroyed(workspaceRootDir, envTag, { missingOk
|
|
|
9789
9852
|
}
|
|
9790
9853
|
}
|
|
9791
9854
|
function warn(what, err) {
|
|
9792
|
-
|
|
9855
|
+
p27.log.warn(
|
|
9793
9856
|
`velastack.dev could not ${what}.
|
|
9794
9857
|
${pc11.dim(err instanceof Error ? err.message : String(err))}`
|
|
9795
9858
|
);
|
|
@@ -9798,7 +9861,7 @@ ${pc11.dim(err instanceof Error ? err.message : String(err))}`
|
|
|
9798
9861
|
// src/commands/destroy/deployment.ts
|
|
9799
9862
|
var deployment = addLockWaitOption(
|
|
9800
9863
|
addTargetOptions(
|
|
9801
|
-
new
|
|
9864
|
+
new Command49("deployment").description("remove a deployed environment from its server").configureHelp(helpConfig),
|
|
9802
9865
|
"production"
|
|
9803
9866
|
)
|
|
9804
9867
|
).option("--purge", "also delete the database and uploaded files").option("-y, --yes", "skip the confirmation prompt").option(
|
|
@@ -9817,7 +9880,7 @@ var deployment = addLockWaitOption(
|
|
|
9817
9880
|
purge: options.purge === true,
|
|
9818
9881
|
yes: options.yes === true,
|
|
9819
9882
|
confirm: options.confirm,
|
|
9820
|
-
interactive: Boolean(
|
|
9883
|
+
interactive: Boolean(process27.stdin.isTTY && process27.stdout.isTTY)
|
|
9821
9884
|
});
|
|
9822
9885
|
if (decision.kind === "refuse") throw new Error(decision.message);
|
|
9823
9886
|
if (decision.kind === "prompt") {
|
|
@@ -9837,13 +9900,13 @@ var deployment = addLockWaitOption(
|
|
|
9837
9900
|
missingOk: true
|
|
9838
9901
|
});
|
|
9839
9902
|
}
|
|
9840
|
-
|
|
9903
|
+
p28.log.info(
|
|
9841
9904
|
`Nothing named ${pc12.cyan(`${ctx.appName} (${ctx.targetName})`)} on ${ctx.server}; nothing to remove.`
|
|
9842
9905
|
);
|
|
9843
9906
|
return;
|
|
9844
9907
|
}
|
|
9845
9908
|
await reportEnvironmentDestroyed(ctx.workspaceRootDir, ctx.envTag);
|
|
9846
|
-
|
|
9909
|
+
p28.log.success(
|
|
9847
9910
|
`Removed ${pc12.cyan(`${ctx.appName} (${ctx.targetName})`)} from ${ctx.server}.` + (result?.purged ? result.trash ? `
|
|
9848
9911
|
|
|
9849
9912
|
A snapshot of its data is at ${pc12.cyan(result.trash)} on the server for two weeks.` : "" : `
|
|
@@ -9861,34 +9924,66 @@ The database and uploads are still in the instance's shared directory. Pass ${pc
|
|
|
9861
9924
|
);
|
|
9862
9925
|
async function confirm6(appName, targetName, byName) {
|
|
9863
9926
|
if (byName) {
|
|
9864
|
-
const answer = await
|
|
9927
|
+
const answer = await p28.text({
|
|
9865
9928
|
message: `This removes ${pc12.cyan(`${appName} (${targetName})`)}. Type the app name to confirm`,
|
|
9866
9929
|
validate: (value) => value === appName ? void 0 : `Type ${appName} to confirm`
|
|
9867
9930
|
});
|
|
9868
|
-
if (
|
|
9869
|
-
|
|
9870
|
-
|
|
9931
|
+
if (p28.isCancel(answer)) {
|
|
9932
|
+
p28.cancel("Operation cancelled.");
|
|
9933
|
+
process27.exit(0);
|
|
9871
9934
|
}
|
|
9872
9935
|
return;
|
|
9873
9936
|
}
|
|
9874
|
-
const ok = await
|
|
9937
|
+
const ok = await p28.confirm({
|
|
9875
9938
|
message: `Remove ${appName} (${targetName})?`,
|
|
9876
9939
|
initialValue: false
|
|
9877
9940
|
});
|
|
9878
|
-
if (
|
|
9879
|
-
|
|
9880
|
-
|
|
9941
|
+
if (p28.isCancel(ok) || !ok) {
|
|
9942
|
+
p28.cancel("Operation cancelled.");
|
|
9943
|
+
process27.exit(0);
|
|
9881
9944
|
}
|
|
9882
9945
|
}
|
|
9883
9946
|
|
|
9947
|
+
// src/commands/destroy/shop.ts
|
|
9948
|
+
import process28 from "node:process";
|
|
9949
|
+
import { Command as Command50 } from "commander";
|
|
9950
|
+
import * as p29 from "@clack/prompts";
|
|
9951
|
+
var shop2 = new Command50("shop").description("destroy the shop pages generated by `vela generate shop`").option("-y, --yes", "skip confirmation prompt").allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
9952
|
+
(opts, cmd) => runCommand(async () => {
|
|
9953
|
+
if (!opts.yes) {
|
|
9954
|
+
const ok = await p29.confirm({
|
|
9955
|
+
message: "Destroy the shop? Removes the listing and product pages (and src/lib/catalog.ts on WhatsApp). The cart and payments stay.",
|
|
9956
|
+
initialValue: false
|
|
9957
|
+
});
|
|
9958
|
+
if (p29.isCancel(ok) || !ok) {
|
|
9959
|
+
p29.cancel("Operation cancelled.");
|
|
9960
|
+
process28.exit(0);
|
|
9961
|
+
}
|
|
9962
|
+
}
|
|
9963
|
+
await runPattern(
|
|
9964
|
+
"destroy-shop",
|
|
9965
|
+
cmd.args,
|
|
9966
|
+
{ destructive: true },
|
|
9967
|
+
{
|
|
9968
|
+
summary: "Destroyed the shop.",
|
|
9969
|
+
task: {
|
|
9970
|
+
title: "Destroying the shop",
|
|
9971
|
+
success: "Destroyed the shop",
|
|
9972
|
+
error: "Failed to destroy the shop"
|
|
9973
|
+
}
|
|
9974
|
+
}
|
|
9975
|
+
);
|
|
9976
|
+
}, "Failed to destroy the shop.")
|
|
9977
|
+
);
|
|
9978
|
+
|
|
9884
9979
|
// src/commands/destroy.ts
|
|
9885
|
-
var destroy = new
|
|
9980
|
+
var destroy = new Command51("destroy").description("destroy scaffolding, or a deployment").configureHelp(helpConfig).addCommand(form2).addCommand(schema2).addCommand(resource2).addCommand(scaffold2).addCommand(shop2).addCommand(deployment);
|
|
9886
9981
|
|
|
9887
9982
|
// src/commands/ui.ts
|
|
9888
|
-
import { Command as
|
|
9983
|
+
import { Command as Command57 } from "commander";
|
|
9889
9984
|
|
|
9890
9985
|
// src/commands/ui/add.ts
|
|
9891
|
-
import { Command as
|
|
9986
|
+
import { Command as Command52 } from "commander";
|
|
9892
9987
|
import * as p30 from "@clack/prompts";
|
|
9893
9988
|
import { installComponents } from "@velastack/patterns";
|
|
9894
9989
|
|
|
@@ -9915,7 +10010,7 @@ var THEMES = [
|
|
|
9915
10010
|
"violet",
|
|
9916
10011
|
"yellow"
|
|
9917
10012
|
];
|
|
9918
|
-
var
|
|
10013
|
+
var NEXT_STEPS4 = [
|
|
9919
10014
|
"Import a component with: import { Button } from '#lib/components/ui/button/index.js';",
|
|
9920
10015
|
"Tweak styling in src/lib/components/ui/<component>/*.svelte.",
|
|
9921
10016
|
`Run \`vela ui base <color>\` to change the palette (${BASE_COLORS.join(", ")}), or \`vela ui list\` to see what else is available.`
|
|
@@ -9926,7 +10021,7 @@ function uiAddReport(requested, outcome) {
|
|
|
9926
10021
|
summary: installed2.length > 0 ? `Added ${installed2.length} UI component(s).` : `All ${new Set(requested).size} requested component(s) are already present.`,
|
|
9927
10022
|
componentsAdded: installed2,
|
|
9928
10023
|
packagesInstalled: packages,
|
|
9929
|
-
nextSteps: [...
|
|
10024
|
+
nextSteps: [...NEXT_STEPS4]
|
|
9930
10025
|
};
|
|
9931
10026
|
if (skipped.length > 0) {
|
|
9932
10027
|
report5.sections = [{ label: "Already present (pass --overwrite to replace)", items: skipped }];
|
|
@@ -9938,7 +10033,7 @@ function uiAddReport(requested, outcome) {
|
|
|
9938
10033
|
}
|
|
9939
10034
|
|
|
9940
10035
|
// src/commands/ui/add.ts
|
|
9941
|
-
var add = new
|
|
10036
|
+
var add = new Command52("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(
|
|
9942
10037
|
(components, options) => runCommand(async () => {
|
|
9943
10038
|
const { workspaceRootDir } = await getWorkspace();
|
|
9944
10039
|
assertShadcn("vela ui add", workspaceRootDir);
|
|
@@ -9961,10 +10056,10 @@ var add = new Command50("add").description("add ui components (shadcn-svelte ite
|
|
|
9961
10056
|
);
|
|
9962
10057
|
|
|
9963
10058
|
// src/commands/ui/base.ts
|
|
9964
|
-
import { Command as
|
|
10059
|
+
import { Command as Command53 } from "commander";
|
|
9965
10060
|
import * as p31 from "@clack/prompts";
|
|
9966
10061
|
import { applyBaseColor } from "@velastack/patterns";
|
|
9967
|
-
var base = new
|
|
10062
|
+
var base = new Command53("base").description("change the base (gray) palette").argument("<color>", `base color to use (${BASE_COLORS.join(", ")})`).configureHelp(helpConfig).action(
|
|
9968
10063
|
(color) => runCommand(async () => {
|
|
9969
10064
|
const { workspaceRootDir } = await getWorkspace();
|
|
9970
10065
|
assertShadcn("vela ui base", workspaceRootDir);
|
|
@@ -9990,7 +10085,7 @@ var base = new Command51("base").description("change the base (gray) palette").a
|
|
|
9990
10085
|
);
|
|
9991
10086
|
|
|
9992
10087
|
// src/commands/ui/list.ts
|
|
9993
|
-
import { Command as
|
|
10088
|
+
import { Command as Command54 } from "commander";
|
|
9994
10089
|
import * as p32 from "@clack/prompts";
|
|
9995
10090
|
import { listComponents } from "@velastack/patterns";
|
|
9996
10091
|
|
|
@@ -10022,7 +10117,7 @@ function uiListReport(result) {
|
|
|
10022
10117
|
}
|
|
10023
10118
|
|
|
10024
10119
|
// src/commands/ui/list.ts
|
|
10025
|
-
var list = new
|
|
10120
|
+
var list = new Command54("list").description("list installed ui components, vela components and the style registry").option("--json", "print the result as JSON", false).configureHelp(helpConfig).action(
|
|
10026
10121
|
(options) => runCommand(async () => {
|
|
10027
10122
|
const { workspaceRootDir } = await getWorkspace();
|
|
10028
10123
|
assertShadcn("vela ui list", workspaceRootDir);
|
|
@@ -10050,7 +10145,7 @@ Registry components are not listed.`);
|
|
|
10050
10145
|
);
|
|
10051
10146
|
|
|
10052
10147
|
// src/commands/ui/style.ts
|
|
10053
|
-
import { Command as
|
|
10148
|
+
import { Command as Command55 } from "commander";
|
|
10054
10149
|
import * as p33 from "@clack/prompts";
|
|
10055
10150
|
import { switchStyle } from "@velastack/patterns";
|
|
10056
10151
|
|
|
@@ -10077,7 +10172,7 @@ function uiStyleReport(result) {
|
|
|
10077
10172
|
}
|
|
10078
10173
|
|
|
10079
10174
|
// src/commands/ui/style.ts
|
|
10080
|
-
var style = new
|
|
10175
|
+
var style = new Command55("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(
|
|
10081
10176
|
(name, options) => runCommand(async () => {
|
|
10082
10177
|
const { workspaceRootDir } = await getWorkspace();
|
|
10083
10178
|
assertShadcn("vela ui style", workspaceRootDir);
|
|
@@ -10131,10 +10226,10 @@ ${components.map((c) => `- ${c}`).join("\n")}`
|
|
|
10131
10226
|
);
|
|
10132
10227
|
|
|
10133
10228
|
// src/commands/ui/theme.ts
|
|
10134
|
-
import { Command as
|
|
10229
|
+
import { Command as Command56 } from "commander";
|
|
10135
10230
|
import * as p34 from "@clack/prompts";
|
|
10136
10231
|
import { applyTheme } from "@velastack/patterns";
|
|
10137
|
-
var theme = new
|
|
10232
|
+
var theme = new Command56("theme").description("change the accent color, keeping the base palette").argument("<accent>", `accent to use (${THEMES.join(", ")})`).configureHelp(helpConfig).action(
|
|
10138
10233
|
(accent) => runCommand(async () => {
|
|
10139
10234
|
const { workspaceRootDir } = await getWorkspace();
|
|
10140
10235
|
assertShadcn("vela ui theme", workspaceRootDir);
|
|
@@ -10160,14 +10255,14 @@ var theme = new Command54("theme").description("change the accent color, keeping
|
|
|
10160
10255
|
);
|
|
10161
10256
|
|
|
10162
10257
|
// src/commands/ui.ts
|
|
10163
|
-
var ui = new
|
|
10258
|
+
var ui = new Command57("ui").description("generate ui components").configureHelp(helpConfig).addCommand(add).addCommand(list).addCommand(style).addCommand(base).addCommand(theme);
|
|
10164
10259
|
|
|
10165
10260
|
// src/commands/legal.ts
|
|
10166
|
-
import { Command as
|
|
10261
|
+
import { Command as Command60 } from "commander";
|
|
10167
10262
|
|
|
10168
10263
|
// src/commands/legal/terms.ts
|
|
10169
10264
|
import path41 from "node:path";
|
|
10170
|
-
import { Command as
|
|
10265
|
+
import { Command as Command58 } from "commander";
|
|
10171
10266
|
import * as p36 from "@clack/prompts";
|
|
10172
10267
|
|
|
10173
10268
|
// src/commands/legal/shared.ts
|
|
@@ -10878,11 +10973,11 @@ async function termsAction() {
|
|
|
10878
10973
|
]
|
|
10879
10974
|
});
|
|
10880
10975
|
}
|
|
10881
|
-
var terms = new
|
|
10976
|
+
var terms = new Command58("terms").description("generate placeholder terms and conditions").configureHelp(helpConfig).action(() => runCommand(termsAction, "Failed to generate terms and conditions."));
|
|
10882
10977
|
|
|
10883
10978
|
// src/commands/legal/privacy.ts
|
|
10884
10979
|
import path42 from "node:path";
|
|
10885
|
-
import { Command as
|
|
10980
|
+
import { Command as Command59 } from "commander";
|
|
10886
10981
|
import * as p37 from "@clack/prompts";
|
|
10887
10982
|
var mapLabels = {
|
|
10888
10983
|
personalInfo: {
|
|
@@ -11614,16 +11709,16 @@ async function privacyAction() {
|
|
|
11614
11709
|
]
|
|
11615
11710
|
});
|
|
11616
11711
|
}
|
|
11617
|
-
var privacy = new
|
|
11712
|
+
var privacy = new Command59("privacy").description("generate placeholder privacy policy").configureHelp(helpConfig).action(() => runCommand(privacyAction, "Failed to generate privacy policy."));
|
|
11618
11713
|
|
|
11619
11714
|
// src/commands/legal.ts
|
|
11620
|
-
var legal = new
|
|
11715
|
+
var legal = new Command60("legal").description("generate placeholder legal documents").configureHelp(helpConfig).addCommand(terms).addCommand(privacy);
|
|
11621
11716
|
|
|
11622
11717
|
// src/commands/fixtures.ts
|
|
11623
|
-
import { Command as
|
|
11718
|
+
import { Command as Command66 } from "commander";
|
|
11624
11719
|
|
|
11625
11720
|
// src/commands/fixtures/load.ts
|
|
11626
|
-
import { Command as
|
|
11721
|
+
import { Command as Command61 } from "commander";
|
|
11627
11722
|
|
|
11628
11723
|
// src/lib/data.ts
|
|
11629
11724
|
import fs42 from "node:fs";
|
|
@@ -11813,7 +11908,7 @@ async function hasLoadedFixtures(pb) {
|
|
|
11813
11908
|
}
|
|
11814
11909
|
|
|
11815
11910
|
// src/commands/fixtures/load.ts
|
|
11816
|
-
var load = new
|
|
11911
|
+
var load = new Command61("load").description("load fixtures into the database").configureHelp(helpConfig).action(
|
|
11817
11912
|
() => runCommand(async () => {
|
|
11818
11913
|
const { workspaceRootDir } = await getWorkspace();
|
|
11819
11914
|
let loaded = [];
|
|
@@ -11839,8 +11934,8 @@ var load = new Command59("load").description("load fixtures into the database").
|
|
|
11839
11934
|
);
|
|
11840
11935
|
|
|
11841
11936
|
// src/commands/fixtures/clear.ts
|
|
11842
|
-
import { Command as
|
|
11843
|
-
var clear = new
|
|
11937
|
+
import { Command as Command62 } from "commander";
|
|
11938
|
+
var clear = new Command62("clear").description("clear loaded fixtures").configureHelp(helpConfig).action(
|
|
11844
11939
|
() => runCommand(async () => {
|
|
11845
11940
|
const { workspaceRootDir } = await getWorkspace();
|
|
11846
11941
|
let cleared = [];
|
|
@@ -11869,8 +11964,8 @@ var clear = new Command60("clear").description("clear loaded fixtures").configur
|
|
|
11869
11964
|
);
|
|
11870
11965
|
|
|
11871
11966
|
// src/commands/fixtures/reset.ts
|
|
11872
|
-
import { Command as
|
|
11873
|
-
var reset = new
|
|
11967
|
+
import { Command as Command63 } from "commander";
|
|
11968
|
+
var reset = new Command63("reset").description("clear and reload fixtures").configureHelp(helpConfig).action(
|
|
11874
11969
|
() => runCommand(async () => {
|
|
11875
11970
|
const { workspaceRootDir } = await getWorkspace();
|
|
11876
11971
|
let cleared = [];
|
|
@@ -11902,7 +11997,7 @@ var reset = new Command61("reset").description("clear and reload fixtures").conf
|
|
|
11902
11997
|
// src/commands/fixtures/generate.ts
|
|
11903
11998
|
import fs43 from "node:fs";
|
|
11904
11999
|
import path44 from "node:path";
|
|
11905
|
-
import { Command as
|
|
12000
|
+
import { Command as Command64, InvalidArgumentError } from "commander";
|
|
11906
12001
|
import * as p38 from "@clack/prompts";
|
|
11907
12002
|
import { annotate } from "annotate-json-schema";
|
|
11908
12003
|
import { createGenerator } from "json-schema-faker";
|
|
@@ -12013,7 +12108,7 @@ async function generateFixtureFiles(pb, workspaceRootDir, opts) {
|
|
|
12013
12108
|
}
|
|
12014
12109
|
return { writtenFiles, warnings };
|
|
12015
12110
|
}
|
|
12016
|
-
var generate2 = new
|
|
12111
|
+
var generate2 = new Command64("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(
|
|
12017
12112
|
(opts) => runCommand(async () => {
|
|
12018
12113
|
const { workspaceRootDir } = await getWorkspace();
|
|
12019
12114
|
const existing = getFixtureFiles(workspaceRootDir);
|
|
@@ -12066,7 +12161,7 @@ var generate2 = new Command62("generate").description("generate fixture data").o
|
|
|
12066
12161
|
);
|
|
12067
12162
|
|
|
12068
12163
|
// src/commands/fixtures/regen.ts
|
|
12069
|
-
import { Command as
|
|
12164
|
+
import { Command as Command65, InvalidArgumentError as InvalidArgumentError2 } from "commander";
|
|
12070
12165
|
import * as p39 from "@clack/prompts";
|
|
12071
12166
|
function parseCount2(value) {
|
|
12072
12167
|
const n = parseInt(value, 10);
|
|
@@ -12082,7 +12177,7 @@ function parseSeed2(value) {
|
|
|
12082
12177
|
}
|
|
12083
12178
|
return n;
|
|
12084
12179
|
}
|
|
12085
|
-
var regen = new
|
|
12180
|
+
var regen = new Command65("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(
|
|
12086
12181
|
(opts) => runCommand(async () => {
|
|
12087
12182
|
const { workspaceRootDir } = await getWorkspace();
|
|
12088
12183
|
let cleared = [];
|
|
@@ -12111,14 +12206,14 @@ var regen = new Command63("regen").description("clear the database, regenerate f
|
|
|
12111
12206
|
);
|
|
12112
12207
|
|
|
12113
12208
|
// src/commands/fixtures.ts
|
|
12114
|
-
var fixtures = new
|
|
12209
|
+
var fixtures = new Command66("fixtures").description("manage fixture data").configureHelp(helpConfig).addCommand(generate2).addCommand(load).addCommand(clear).addCommand(reset).addCommand(regen);
|
|
12115
12210
|
|
|
12116
12211
|
// src/commands/seeds.ts
|
|
12117
|
-
import { Command as
|
|
12212
|
+
import { Command as Command70 } from "commander";
|
|
12118
12213
|
|
|
12119
12214
|
// src/commands/seeds/load.ts
|
|
12120
|
-
import { Command as
|
|
12121
|
-
var load2 = new
|
|
12215
|
+
import { Command as Command67 } from "commander";
|
|
12216
|
+
var load2 = new Command67("load").description("load seeds into the database").option("-f, --force", "load even if target collections already have records").configureHelp(helpConfig).action(
|
|
12122
12217
|
(opts) => runCommand(async () => {
|
|
12123
12218
|
const { workspaceRootDir } = await getWorkspace();
|
|
12124
12219
|
const seedFiles = getSeedFiles(workspaceRootDir);
|
|
@@ -12157,7 +12252,7 @@ var load2 = new Command65("load").description("load seeds into the database").op
|
|
|
12157
12252
|
// src/commands/seeds/save.ts
|
|
12158
12253
|
import fs44 from "node:fs";
|
|
12159
12254
|
import path45 from "node:path";
|
|
12160
|
-
import { Command as
|
|
12255
|
+
import { Command as Command68 } from "commander";
|
|
12161
12256
|
var padZeros2 = (num, length) => num.toString().padStart(length, "0");
|
|
12162
12257
|
function filterSystemFields(record, systemFieldNames) {
|
|
12163
12258
|
const out = {};
|
|
@@ -12168,7 +12263,7 @@ function filterSystemFields(record, systemFieldNames) {
|
|
|
12168
12263
|
}
|
|
12169
12264
|
return out;
|
|
12170
12265
|
}
|
|
12171
|
-
var save = new
|
|
12266
|
+
var save = new Command68("save").description("save the current data as seeds").option("-f, --force", "overwrite existing seed files").configureHelp(helpConfig).action(
|
|
12172
12267
|
(opts) => runCommand(async () => {
|
|
12173
12268
|
const { workspaceRootDir } = await getWorkspace();
|
|
12174
12269
|
const seedsPath = dataDir(workspaceRootDir, "seeds");
|
|
@@ -12240,8 +12335,8 @@ var save = new Command66("save").description("save the current data as seeds").o
|
|
|
12240
12335
|
);
|
|
12241
12336
|
|
|
12242
12337
|
// src/commands/seeds/clear.ts
|
|
12243
|
-
import { Command as
|
|
12244
|
-
var clear2 = new
|
|
12338
|
+
import { Command as Command69 } from "commander";
|
|
12339
|
+
var clear2 = new Command69("clear").description("clear seeded records").configureHelp(helpConfig).action(
|
|
12245
12340
|
() => runCommand(async () => {
|
|
12246
12341
|
const { workspaceRootDir } = await getWorkspace();
|
|
12247
12342
|
const seedFiles = getSeedFiles(workspaceRootDir);
|
|
@@ -12272,13 +12367,13 @@ var clear2 = new Command67("clear").description("clear seeded records").configur
|
|
|
12272
12367
|
);
|
|
12273
12368
|
|
|
12274
12369
|
// src/commands/seeds.ts
|
|
12275
|
-
var seeds = new
|
|
12370
|
+
var seeds = new Command70("seeds").description("manage seed data").configureHelp(helpConfig).addCommand(load2).addCommand(save).addCommand(clear2);
|
|
12276
12371
|
|
|
12277
12372
|
// src/commands/signup.ts
|
|
12278
|
-
import { Command as
|
|
12373
|
+
import { Command as Command71 } from "commander";
|
|
12279
12374
|
import * as p40 from "@clack/prompts";
|
|
12280
12375
|
import makeFetchCookie2 from "fetch-cookie";
|
|
12281
|
-
var signup = new
|
|
12376
|
+
var signup = new Command71("signup").description("signup to velastack.dev").configureHelp(helpConfig).action(
|
|
12282
12377
|
() => runCommand(async () => {
|
|
12283
12378
|
const { email: email2, password: password8, passwordConfirm } = await p40.group({
|
|
12284
12379
|
email: () => p40.text({ message: "Email" }),
|
|
@@ -12313,9 +12408,9 @@ var signup = new Command69("signup").description("signup to velastack.dev").conf
|
|
|
12313
12408
|
);
|
|
12314
12409
|
|
|
12315
12410
|
// src/commands/logout.ts
|
|
12316
|
-
import { Command as
|
|
12411
|
+
import { Command as Command72 } from "commander";
|
|
12317
12412
|
import * as p41 from "@clack/prompts";
|
|
12318
|
-
var logout = new
|
|
12413
|
+
var logout = new Command72("logout").alias("signout").description("logout from velastack.dev").configureHelp(helpConfig).action(
|
|
12319
12414
|
() => runCommand(() => {
|
|
12320
12415
|
if (!readConfig()) {
|
|
12321
12416
|
p41.log.info("Not logged in");
|
|
@@ -12327,9 +12422,9 @@ var logout = new Command70("logout").alias("signout").description("logout from v
|
|
|
12327
12422
|
);
|
|
12328
12423
|
|
|
12329
12424
|
// src/commands/whoami.ts
|
|
12330
|
-
import { Command as
|
|
12425
|
+
import { Command as Command73 } from "commander";
|
|
12331
12426
|
import * as p42 from "@clack/prompts";
|
|
12332
|
-
var whoami = new
|
|
12427
|
+
var whoami = new Command73("whoami").description("show the current user").configureHelp(helpConfig).action(
|
|
12333
12428
|
() => runCommand(async () => {
|
|
12334
12429
|
const apiKey = readConfig()?.apiKey;
|
|
12335
12430
|
if (!apiKey) {
|
|
@@ -12346,10 +12441,10 @@ var whoami = new Command71("whoami").description("show the current user").config
|
|
|
12346
12441
|
);
|
|
12347
12442
|
|
|
12348
12443
|
// src/commands/migrate.ts
|
|
12349
|
-
import { Command as
|
|
12444
|
+
import { Command as Command80 } from "commander";
|
|
12350
12445
|
|
|
12351
12446
|
// src/commands/migrate/up.ts
|
|
12352
|
-
import { Command as
|
|
12447
|
+
import { Command as Command74 } from "commander";
|
|
12353
12448
|
|
|
12354
12449
|
// src/lib/migrate.ts
|
|
12355
12450
|
import path46 from "node:path";
|
|
@@ -12391,10 +12486,10 @@ async function runMigrateUp() {
|
|
|
12391
12486
|
]
|
|
12392
12487
|
});
|
|
12393
12488
|
}
|
|
12394
|
-
var up = new
|
|
12489
|
+
var up = new Command74("up").description("apply all pending migrations").configureHelp(helpConfig).action(() => runCommand(runMigrateUp, "Failed to run migrations."));
|
|
12395
12490
|
|
|
12396
12491
|
// src/commands/migrate/down.ts
|
|
12397
|
-
import { Command as
|
|
12492
|
+
import { Command as Command75, InvalidArgumentError as InvalidArgumentError3 } from "commander";
|
|
12398
12493
|
function parseSteps(value) {
|
|
12399
12494
|
const n = parseInt(value, 10);
|
|
12400
12495
|
if (!Number.isFinite(n) || n <= 0) {
|
|
@@ -12402,7 +12497,7 @@ function parseSteps(value) {
|
|
|
12402
12497
|
}
|
|
12403
12498
|
return n;
|
|
12404
12499
|
}
|
|
12405
|
-
var down = new
|
|
12500
|
+
var down = new Command75("down").alias("rollback").description("revert the last N applied migrations").argument("[number]", "how many migrations to revert", parseSteps, 1).configureHelp(helpConfig).action(
|
|
12406
12501
|
(n) => runCommand(async () => {
|
|
12407
12502
|
await runPocketbaseMigrate(["down", String(n)]);
|
|
12408
12503
|
reportResult({
|
|
@@ -12418,8 +12513,8 @@ var down = new Command73("down").alias("rollback").description("revert the last
|
|
|
12418
12513
|
// src/commands/migrate/create.ts
|
|
12419
12514
|
import fs45 from "node:fs";
|
|
12420
12515
|
import path47 from "node:path";
|
|
12421
|
-
import { Command as
|
|
12422
|
-
var create2 = new
|
|
12516
|
+
import { Command as Command76 } from "commander";
|
|
12517
|
+
var create2 = new Command76("create").alias("new").description("create a new blank migration").argument("<name>", "migration name (snake_case)").configureHelp(helpConfig).action(
|
|
12423
12518
|
(name) => runCommand(async () => {
|
|
12424
12519
|
const cwd = migrateRoot();
|
|
12425
12520
|
const before = listMigrationFiles(cwd);
|
|
@@ -12445,8 +12540,8 @@ function listMigrationFiles(cwd) {
|
|
|
12445
12540
|
// src/commands/migrate/collections.ts
|
|
12446
12541
|
import fs46 from "node:fs";
|
|
12447
12542
|
import path48 from "node:path";
|
|
12448
|
-
import { Command as
|
|
12449
|
-
var collections = new
|
|
12543
|
+
import { Command as Command77 } from "commander";
|
|
12544
|
+
var collections = new Command77("collections").alias("snapshot").description("snapshot local collections into a new migration").configureHelp(helpConfig).action(
|
|
12450
12545
|
() => runCommand(async () => {
|
|
12451
12546
|
const cwd = migrateRoot();
|
|
12452
12547
|
const before = listMigrationFiles2(cwd);
|
|
@@ -12477,8 +12572,8 @@ function listMigrationFiles2(cwd) {
|
|
|
12477
12572
|
}
|
|
12478
12573
|
|
|
12479
12574
|
// src/commands/migrate/history-sync.ts
|
|
12480
|
-
import { Command as
|
|
12481
|
-
var historySync = new
|
|
12575
|
+
import { Command as Command78 } from "commander";
|
|
12576
|
+
var historySync = new Command78("history-sync").description("drop _migrations rows whose files no longer exist").configureHelp(helpConfig).action(
|
|
12482
12577
|
() => runCommand(async () => {
|
|
12483
12578
|
await runPocketbaseMigrate(["history-sync"]);
|
|
12484
12579
|
reportResult({
|
|
@@ -12491,10 +12586,10 @@ var historySync = new Command76("history-sync").description("drop _migrations ro
|
|
|
12491
12586
|
// src/commands/migrate/sveltekit-3.ts
|
|
12492
12587
|
import path49 from "node:path";
|
|
12493
12588
|
import process31 from "node:process";
|
|
12494
|
-
import { Command as
|
|
12589
|
+
import { Command as Command79 } from "commander";
|
|
12495
12590
|
import * as p43 from "@clack/prompts";
|
|
12496
12591
|
import pc13 from "picocolors";
|
|
12497
|
-
var sveltekit3 = new
|
|
12592
|
+
var sveltekit3 = new Command79("sveltekit-3").description("upgrade a SvelteKit 2 project to SvelteKit 3 (sv migrate, then the vela steps)").option("--cwd <path>", "the project to migrate (default: the current project)").option("--no-install", "skip installing dependencies").option("--force", "run even when the git working tree has uncommitted changes").option("--skip-sv", "only run the vela steps (sv has already been run)").configureHelp(helpConfig).action(
|
|
12498
12593
|
(options) => runCommand(async () => {
|
|
12499
12594
|
const root = options.cwd ? path49.resolve(options.cwd) : findWorkspaceRoot() ?? process31.cwd();
|
|
12500
12595
|
p43.intro(pc13.bgCyan(pc13.black(" vela migrate sveltekit-3 ")));
|
|
@@ -12568,14 +12663,14 @@ function nextStepsFor(result) {
|
|
|
12568
12663
|
}
|
|
12569
12664
|
|
|
12570
12665
|
// src/commands/migrate.ts
|
|
12571
|
-
var migrate = new
|
|
12666
|
+
var migrate = new Command80("migrate").description("manage database migrations (and `migrate sveltekit-3` to upgrade SvelteKit)").configureHelp(helpConfig).action(() => runCommand(runMigrateUp, "Failed to run migrations.")).addCommand(up).addCommand(down).addCommand(create2).addCommand(collections).addCommand(historySync).addCommand(sveltekit3);
|
|
12572
12667
|
|
|
12573
12668
|
// src/commands/dev.ts
|
|
12574
12669
|
import fs47 from "node:fs";
|
|
12575
12670
|
import path51 from "node:path";
|
|
12576
12671
|
import process33 from "node:process";
|
|
12577
12672
|
import { performance } from "node:perf_hooks";
|
|
12578
|
-
import { Command as
|
|
12673
|
+
import { Command as Command81, InvalidArgumentError as InvalidArgumentError4 } from "commander";
|
|
12579
12674
|
import pc15 from "picocolors";
|
|
12580
12675
|
import PocketBase5 from "pocketbase";
|
|
12581
12676
|
|
|
@@ -12648,7 +12743,7 @@ function parsePort(value) {
|
|
|
12648
12743
|
}
|
|
12649
12744
|
return port;
|
|
12650
12745
|
}
|
|
12651
|
-
var dev = new
|
|
12746
|
+
var dev = new Command81("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").option("--all-sql", "also print the auth lookup PocketBase runs on every request").configureHelp(helpConfig).action(async (options) => {
|
|
12652
12747
|
const cwd = process33.cwd();
|
|
12653
12748
|
warnIfKit2(findWorkspaceRoot(cwd) ?? cwd, (m) => console.warn(pc15.yellow(`\u25B2 ${m}`)));
|
|
12654
12749
|
process33.env.VELA_DATA_DIR ??= localDataDir(cwd);
|
|
@@ -12773,7 +12868,7 @@ async function startWatchingTypes(cwd, pb) {
|
|
|
12773
12868
|
import fs48 from "node:fs";
|
|
12774
12869
|
import path52 from "node:path";
|
|
12775
12870
|
import process35 from "node:process";
|
|
12776
|
-
import { Command as
|
|
12871
|
+
import { Command as Command82 } from "commander";
|
|
12777
12872
|
import * as p44 from "@clack/prompts";
|
|
12778
12873
|
import pc16 from "picocolors";
|
|
12779
12874
|
import { x as x4 } from "tinyexec";
|
|
@@ -12814,7 +12909,7 @@ function splitHosts(value) {
|
|
|
12814
12909
|
|
|
12815
12910
|
// src/commands/build.ts
|
|
12816
12911
|
var PRERENDERED_DIR = path52.join(".svelte-kit", "output", "prerendered");
|
|
12817
|
-
var build = new
|
|
12912
|
+
var build = new Command82("build").description("build the app").configureHelp(helpConfig).option("-t, --target <target>", "which copy of the app to build for", PRODUCTION_TARGET).action(async (options) => {
|
|
12818
12913
|
const cwd = process35.cwd();
|
|
12819
12914
|
warnIfKit2(findWorkspaceRoot(cwd) ?? cwd, (m) => p44.log.warn(m));
|
|
12820
12915
|
warnIfSsrExternalMissing(findWorkspaceRoot(cwd) ?? cwd);
|
|
@@ -12909,14 +13004,14 @@ Set one with ${pc16.cyan("vela deploy --domain example.com")}, or pass ${pc16.cy
|
|
|
12909
13004
|
import fs49 from "node:fs";
|
|
12910
13005
|
import path53 from "node:path";
|
|
12911
13006
|
import process36 from "node:process";
|
|
12912
|
-
import { Command as
|
|
13007
|
+
import { Command as Command83 } from "commander";
|
|
12913
13008
|
import * as p45 from "@clack/prompts";
|
|
12914
13009
|
import pc17 from "picocolors";
|
|
12915
13010
|
import { x as x5 } from "tinyexec";
|
|
12916
13011
|
import { detect as detect8 } from "package-manager-detector";
|
|
12917
13012
|
import { resolveCommand as resolveCommand6 } from "package-manager-detector/commands";
|
|
12918
13013
|
var ADAPTER_NODE_MODULE = path53.join("build", "adapter-node.js");
|
|
12919
|
-
var preview = new
|
|
13014
|
+
var preview = new Command83("preview").description("preview the built app").configureHelp(helpConfig).action(async () => {
|
|
12920
13015
|
const cwd = process36.cwd();
|
|
12921
13016
|
process36.env.VELA_DATA_DIR ??= localDataDir(cwd);
|
|
12922
13017
|
warnIfKit2(findWorkspaceRoot(cwd) ?? cwd, (m) => p45.log.warn(m));
|
|
@@ -12985,8 +13080,8 @@ set empty so no domain is baked in.`
|
|
|
12985
13080
|
|
|
12986
13081
|
// src/commands/sync.ts
|
|
12987
13082
|
import path54 from "node:path";
|
|
12988
|
-
import { Command as
|
|
12989
|
-
var sync = new
|
|
13083
|
+
import { Command as Command84 } from "commander";
|
|
13084
|
+
var sync = new Command84("sync").description("sync types from the database").configureHelp(helpConfig).action(
|
|
12990
13085
|
() => runCommand(async () => {
|
|
12991
13086
|
const { workspaceRootDir } = await getWorkspace();
|
|
12992
13087
|
const typesDir = path54.join(workspaceRootDir, ".svelte-kit", "types");
|
|
@@ -12999,7 +13094,7 @@ var sync = new Command82("sync").description("sync types from the database").con
|
|
|
12999
13094
|
);
|
|
13000
13095
|
|
|
13001
13096
|
// src/commands/provision.ts
|
|
13002
|
-
import { Command as
|
|
13097
|
+
import { Command as Command85 } from "commander";
|
|
13003
13098
|
import * as p46 from "@clack/prompts";
|
|
13004
13099
|
import pc18 from "picocolors";
|
|
13005
13100
|
import * as v9 from "valibot";
|
|
@@ -13014,7 +13109,7 @@ var OptionsSchema2 = v9.object({
|
|
|
13014
13109
|
)
|
|
13015
13110
|
});
|
|
13016
13111
|
var provision = addSshOptions(
|
|
13017
|
-
new
|
|
13112
|
+
new Command85("provision").description("prepare a server to host vela apps").argument("<target>", "SSH target \u2014 an alias from ~/.ssh/config, or user@host").configureHelp(helpConfig)
|
|
13018
13113
|
).option("--pb-version <version>", "PocketBase version to install").option(
|
|
13019
13114
|
"--node-major <version>",
|
|
13020
13115
|
"Node.js major version to bring the server up to (match the one you build with)",
|
|
@@ -13063,7 +13158,7 @@ var provision = addSshOptions(
|
|
|
13063
13158
|
import path58 from "node:path";
|
|
13064
13159
|
import fs53 from "node:fs";
|
|
13065
13160
|
import process38 from "node:process";
|
|
13066
|
-
import { Command as
|
|
13161
|
+
import { Command as Command86, Option as Option2 } from "commander";
|
|
13067
13162
|
import * as p48 from "@clack/prompts";
|
|
13068
13163
|
import pc20 from "picocolors";
|
|
13069
13164
|
import * as v10 from "valibot";
|
|
@@ -13429,7 +13524,7 @@ var OptionsSchema3 = v10.object({
|
|
|
13429
13524
|
});
|
|
13430
13525
|
var deploy = addLockWaitOption(
|
|
13431
13526
|
addTargetOptions(
|
|
13432
|
-
new
|
|
13527
|
+
new Command86("deploy").description("deploy the app").configureHelp(helpConfig),
|
|
13433
13528
|
"production"
|
|
13434
13529
|
)
|
|
13435
13530
|
).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(
|
|
@@ -13863,10 +13958,10 @@ async function serverTimeOrLocal(session) {
|
|
|
13863
13958
|
// src/commands/link.ts
|
|
13864
13959
|
import path59 from "node:path";
|
|
13865
13960
|
import process39 from "node:process";
|
|
13866
|
-
import { Command as
|
|
13961
|
+
import { Command as Command87 } from "commander";
|
|
13867
13962
|
import * as p49 from "@clack/prompts";
|
|
13868
13963
|
var CREATE_NEW = "__new__";
|
|
13869
|
-
var link = new
|
|
13964
|
+
var link = new Command87("link").description("link this project to a velastack.dev project").configureHelp(helpConfig).action(() => runCommand(linkProject, "Failed to link the project."));
|
|
13870
13965
|
async function linkProject() {
|
|
13871
13966
|
const { workspaceRootDir } = await getWorkspace();
|
|
13872
13967
|
const existing = readProjectConfig(workspaceRootDir);
|
|
@@ -13933,10 +14028,10 @@ function defaultProjectName2(workspaceRootDir) {
|
|
|
13933
14028
|
}
|
|
13934
14029
|
|
|
13935
14030
|
// src/commands/env.ts
|
|
13936
|
-
import { Command as
|
|
14031
|
+
import { Command as Command93 } from "commander";
|
|
13937
14032
|
|
|
13938
14033
|
// src/commands/env/list.ts
|
|
13939
|
-
import { Command as
|
|
14034
|
+
import { Command as Command88 } from "commander";
|
|
13940
14035
|
import * as v12 from "valibot";
|
|
13941
14036
|
import * as p52 from "@clack/prompts";
|
|
13942
14037
|
import pc23 from "picocolors";
|
|
@@ -14208,7 +14303,7 @@ var OptionsSchema5 = v12.object({
|
|
|
14208
14303
|
var HIDDEN = "\u2022\u2022\u2022\u2022";
|
|
14209
14304
|
var MAX_VALUE = 32;
|
|
14210
14305
|
var envList = addEnvTargetOptions(
|
|
14211
|
-
new
|
|
14306
|
+
new Command88("list").description("list environment variables \u2014 every scope at once without -t").configureHelp(helpConfig)
|
|
14212
14307
|
).action(
|
|
14213
14308
|
(raw) => runCommand(async () => {
|
|
14214
14309
|
const options = parseOptions(OptionsSchema5, raw);
|
|
@@ -14368,17 +14463,17 @@ function matrixCell(key, columns, index, states) {
|
|
|
14368
14463
|
return pc23.dim("\u2014");
|
|
14369
14464
|
}
|
|
14370
14465
|
var ANSI3 = /\u001b\[[0-9;]*m/g;
|
|
14371
|
-
function plain(
|
|
14372
|
-
return
|
|
14466
|
+
function plain(text18) {
|
|
14467
|
+
return text18.replace(ANSI3, "");
|
|
14373
14468
|
}
|
|
14374
14469
|
|
|
14375
14470
|
// src/commands/env/set.ts
|
|
14376
14471
|
import process41 from "node:process";
|
|
14377
|
-
import { Command as
|
|
14472
|
+
import { Command as Command89 } from "commander";
|
|
14378
14473
|
import * as p53 from "@clack/prompts";
|
|
14379
14474
|
import pc24 from "picocolors";
|
|
14380
14475
|
var envSet = addEnvTargetOptions(
|
|
14381
|
-
new
|
|
14476
|
+
new Command89("set").description("set an environment variable \u2014 the value is prompted for, never an argument").argument("<key>", "variable name").option(
|
|
14382
14477
|
"--public",
|
|
14383
14478
|
"readable back with `vela env list` and `vela env get`; PUBLIC_* keys are public regardless"
|
|
14384
14479
|
).configureHelp(helpConfig)
|
|
@@ -14436,11 +14531,11 @@ async function promptValue2(key, visibility) {
|
|
|
14436
14531
|
}
|
|
14437
14532
|
|
|
14438
14533
|
// src/commands/env/unset.ts
|
|
14439
|
-
import { Command as
|
|
14534
|
+
import { Command as Command90 } from "commander";
|
|
14440
14535
|
import * as p54 from "@clack/prompts";
|
|
14441
14536
|
import pc25 from "picocolors";
|
|
14442
14537
|
var envUnset = addEnvTargetOptions(
|
|
14443
|
-
new
|
|
14538
|
+
new Command90("unset").description("remove an environment variable").argument("<key>", "variable name").configureHelp(helpConfig)
|
|
14444
14539
|
).action(
|
|
14445
14540
|
(key, raw) => runCommand(
|
|
14446
14541
|
() => withEnvScope(
|
|
@@ -14484,11 +14579,11 @@ var envUnset = addEnvTargetOptions(
|
|
|
14484
14579
|
import fs55 from "node:fs";
|
|
14485
14580
|
import path60 from "node:path";
|
|
14486
14581
|
import process42 from "node:process";
|
|
14487
|
-
import { Command as
|
|
14582
|
+
import { Command as Command91 } from "commander";
|
|
14488
14583
|
import * as p55 from "@clack/prompts";
|
|
14489
14584
|
import pc26 from "picocolors";
|
|
14490
14585
|
var envImport = addEnvTargetOptions(
|
|
14491
|
-
new
|
|
14586
|
+
new Command91("import").description("merge a dotenv file into the environment").argument("<file>", "dotenv file to read").option("--public", "import as readable values; PUBLIC_* keys are public regardless").configureHelp(helpConfig)
|
|
14492
14587
|
).action(
|
|
14493
14588
|
(file, raw) => runCommand(
|
|
14494
14589
|
() => withEnvScope(
|
|
@@ -14564,11 +14659,11 @@ function read(resolved, shown) {
|
|
|
14564
14659
|
|
|
14565
14660
|
// src/commands/env/get.ts
|
|
14566
14661
|
import process43 from "node:process";
|
|
14567
|
-
import { Command as
|
|
14662
|
+
import { Command as Command92 } from "commander";
|
|
14568
14663
|
import * as p56 from "@clack/prompts";
|
|
14569
14664
|
import pc27 from "picocolors";
|
|
14570
14665
|
var envGet = addEnvTargetOptions(
|
|
14571
|
-
new
|
|
14666
|
+
new Command92("get").description("print a public environment variable").argument("<key>", "variable name").configureHelp(helpConfig)
|
|
14572
14667
|
).action(
|
|
14573
14668
|
(key, raw) => runCommand(
|
|
14574
14669
|
() => withEnvScope(
|
|
@@ -14616,14 +14711,14 @@ Set it again to change it: ${pc27.cyan(`vela env set ${key}`)}`
|
|
|
14616
14711
|
}
|
|
14617
14712
|
|
|
14618
14713
|
// src/commands/env.ts
|
|
14619
|
-
var env = new
|
|
14714
|
+
var env = new Command93("env").description("manage environment variables, locally or on a target").configureHelp(helpConfig).addCommand(envList).addCommand(envGet).addCommand(envSet).addCommand(envUnset).addCommand(envImport);
|
|
14620
14715
|
|
|
14621
14716
|
// src/commands/status.ts
|
|
14622
|
-
import { Command as
|
|
14717
|
+
import { Command as Command94 } from "commander";
|
|
14623
14718
|
import * as p57 from "@clack/prompts";
|
|
14624
14719
|
import pc28 from "picocolors";
|
|
14625
14720
|
var status = addTargetOptions(
|
|
14626
|
-
new
|
|
14721
|
+
new Command94("status").description("show what is deployed").configureHelp(helpConfig),
|
|
14627
14722
|
"production"
|
|
14628
14723
|
).option("--all", "show every app on the server, not just this project").option("--json", "print raw JSON").action(
|
|
14629
14724
|
(raw) => runCommand(async () => {
|
|
@@ -14682,12 +14777,12 @@ function describe2(state) {
|
|
|
14682
14777
|
}
|
|
14683
14778
|
|
|
14684
14779
|
// src/commands/rollback.ts
|
|
14685
|
-
import { Command as
|
|
14780
|
+
import { Command as Command95 } from "commander";
|
|
14686
14781
|
import * as p58 from "@clack/prompts";
|
|
14687
14782
|
import pc29 from "picocolors";
|
|
14688
14783
|
var rollback = addLockWaitOption(
|
|
14689
14784
|
addTargetOptions(
|
|
14690
|
-
new
|
|
14785
|
+
new Command95("rollback").description("put the previous release back").configureHelp(helpConfig),
|
|
14691
14786
|
"production"
|
|
14692
14787
|
)
|
|
14693
14788
|
).option("--to <release>", "roll back to a specific release instead of the previous one").action(
|
|
@@ -14726,7 +14821,7 @@ var rollback = addLockWaitOption(
|
|
|
14726
14821
|
);
|
|
14727
14822
|
|
|
14728
14823
|
// src/commands/logs.ts
|
|
14729
|
-
import { Command as
|
|
14824
|
+
import { Command as Command96 } from "commander";
|
|
14730
14825
|
|
|
14731
14826
|
// src/lib/remote-pocketbase.ts
|
|
14732
14827
|
import PocketBase6 from "pocketbase";
|
|
@@ -14777,7 +14872,7 @@ async function withRemotePocketbase(session, instance, fn) {
|
|
|
14777
14872
|
|
|
14778
14873
|
// src/commands/logs.ts
|
|
14779
14874
|
var logs = addTargetOptions(
|
|
14780
|
-
new
|
|
14875
|
+
new Command96("logs").description("tail the logs of a deployed app").configureHelp(helpConfig),
|
|
14781
14876
|
"production"
|
|
14782
14877
|
).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(
|
|
14783
14878
|
(raw) => runCommand(async () => {
|
|
@@ -14812,16 +14907,16 @@ var logs = addTargetOptions(
|
|
|
14812
14907
|
);
|
|
14813
14908
|
|
|
14814
14909
|
// src/commands/admin.ts
|
|
14815
|
-
import { Command as
|
|
14910
|
+
import { Command as Command98 } from "commander";
|
|
14816
14911
|
|
|
14817
14912
|
// src/commands/admin/create.ts
|
|
14818
14913
|
import process44 from "node:process";
|
|
14819
|
-
import { Command as
|
|
14914
|
+
import { Command as Command97 } from "commander";
|
|
14820
14915
|
import * as p59 from "@clack/prompts";
|
|
14821
14916
|
import pc30 from "picocolors";
|
|
14822
14917
|
var MIN_PASSWORD = 10;
|
|
14823
14918
|
var adminCreate = addTargetOptions(
|
|
14824
|
-
new
|
|
14919
|
+
new Command97("create").description("create a login for the admin panel").argument("[email]", "email to sign in with \u2014 prompted for when omitted").configureHelp(helpConfig),
|
|
14825
14920
|
"local"
|
|
14826
14921
|
).action(
|
|
14827
14922
|
(email2, raw) => runCommand(
|
|
@@ -14939,15 +15034,15 @@ async function promptPassword() {
|
|
|
14939
15034
|
}
|
|
14940
15035
|
|
|
14941
15036
|
// src/commands/admin.ts
|
|
14942
|
-
var admin = new
|
|
15037
|
+
var admin = new Command98("admin").description("manage admin panel logins").configureHelp(helpConfig).addCommand(adminCreate);
|
|
14943
15038
|
|
|
14944
15039
|
// src/commands/backup.ts
|
|
14945
|
-
import { Command as
|
|
15040
|
+
import { Command as Command104 } from "commander";
|
|
14946
15041
|
|
|
14947
15042
|
// src/commands/backup/create.ts
|
|
14948
15043
|
import fs56 from "node:fs";
|
|
14949
15044
|
import path61 from "node:path";
|
|
14950
|
-
import { Command as
|
|
15045
|
+
import { Command as Command99 } from "commander";
|
|
14951
15046
|
import * as p60 from "@clack/prompts";
|
|
14952
15047
|
import pc32 from "picocolors";
|
|
14953
15048
|
|
|
@@ -15096,7 +15191,7 @@ async function writeSchedule(pb, cron, maxKeep) {
|
|
|
15096
15191
|
// src/commands/backup/create.ts
|
|
15097
15192
|
var DEFAULT_BACKUP_DIR = "backups";
|
|
15098
15193
|
var backupCreate = addTargetOptions(
|
|
15099
|
-
new
|
|
15194
|
+
new Command99("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),
|
|
15100
15195
|
"production"
|
|
15101
15196
|
).action(
|
|
15102
15197
|
(name, raw) => runCommand(() => {
|
|
@@ -15180,11 +15275,11 @@ async function download(ctx, key, outputDir) {
|
|
|
15180
15275
|
}
|
|
15181
15276
|
|
|
15182
15277
|
// src/commands/backup/list.ts
|
|
15183
|
-
import { Command as
|
|
15278
|
+
import { Command as Command100 } from "commander";
|
|
15184
15279
|
import * as p61 from "@clack/prompts";
|
|
15185
15280
|
import pc33 from "picocolors";
|
|
15186
15281
|
var backupList = addTargetOptions(
|
|
15187
|
-
new
|
|
15282
|
+
new Command100("list").description("list the backups on a target").configureHelp(helpConfig),
|
|
15188
15283
|
"production"
|
|
15189
15284
|
).action(
|
|
15190
15285
|
(raw) => runCommand(
|
|
@@ -15212,11 +15307,11 @@ Take one with ${pc33.cyan("vela backup create")}.`
|
|
|
15212
15307
|
// src/commands/backup/download.ts
|
|
15213
15308
|
import fs57 from "node:fs";
|
|
15214
15309
|
import path62 from "node:path";
|
|
15215
|
-
import { Command as
|
|
15310
|
+
import { Command as Command101 } from "commander";
|
|
15216
15311
|
import * as p62 from "@clack/prompts";
|
|
15217
15312
|
import pc34 from "picocolors";
|
|
15218
15313
|
var backupDownload = addTargetOptions(
|
|
15219
|
-
new
|
|
15314
|
+
new Command101("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),
|
|
15220
15315
|
"production"
|
|
15221
15316
|
).action(
|
|
15222
15317
|
(key, raw) => runCommand(() => {
|
|
@@ -15264,11 +15359,11 @@ Fetch it from the bucket directly \u2014 vela does not hold its credentials.`
|
|
|
15264
15359
|
|
|
15265
15360
|
// src/commands/backup/delete.ts
|
|
15266
15361
|
import process45 from "node:process";
|
|
15267
|
-
import { Command as
|
|
15362
|
+
import { Command as Command102 } from "commander";
|
|
15268
15363
|
import * as p63 from "@clack/prompts";
|
|
15269
15364
|
import pc35 from "picocolors";
|
|
15270
15365
|
var backupDelete = addTargetOptions(
|
|
15271
|
-
new
|
|
15366
|
+
new Command102("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),
|
|
15272
15367
|
"production"
|
|
15273
15368
|
).action(
|
|
15274
15369
|
(key, raw) => runCommand(() => {
|
|
@@ -15299,12 +15394,12 @@ Run ${pc35.cyan("vela backup list")} to see what it does have.`
|
|
|
15299
15394
|
);
|
|
15300
15395
|
|
|
15301
15396
|
// src/commands/backup/schedule.ts
|
|
15302
|
-
import { Command as
|
|
15397
|
+
import { Command as Command103 } from "commander";
|
|
15303
15398
|
import * as p64 from "@clack/prompts";
|
|
15304
15399
|
import pc36 from "picocolors";
|
|
15305
15400
|
var DEFAULT_KEEP = 7;
|
|
15306
15401
|
var backupSchedule = addTargetOptions(
|
|
15307
|
-
new
|
|
15402
|
+
new Command103("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),
|
|
15308
15403
|
"production"
|
|
15309
15404
|
).action(
|
|
15310
15405
|
(cron, raw) => runCommand(() => {
|
|
@@ -15348,18 +15443,18 @@ Set one with ${pc36.cyan('vela backup schedule "0 3 * * *"')}.`
|
|
|
15348
15443
|
);
|
|
15349
15444
|
|
|
15350
15445
|
// src/commands/backup.ts
|
|
15351
|
-
var backup = new
|
|
15446
|
+
var backup = new Command104("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);
|
|
15352
15447
|
|
|
15353
15448
|
// src/commands/restore.ts
|
|
15354
15449
|
import fs58 from "node:fs";
|
|
15355
15450
|
import path63 from "node:path";
|
|
15356
15451
|
import process46 from "node:process";
|
|
15357
|
-
import { Command as
|
|
15452
|
+
import { Command as Command105 } from "commander";
|
|
15358
15453
|
import * as p65 from "@clack/prompts";
|
|
15359
15454
|
import pc37 from "picocolors";
|
|
15360
15455
|
var restore = addLockWaitOption(
|
|
15361
15456
|
addTargetOptions(
|
|
15362
|
-
new
|
|
15457
|
+
new Command105("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),
|
|
15363
15458
|
"production"
|
|
15364
15459
|
)
|
|
15365
15460
|
).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(
|
|
@@ -15385,7 +15480,7 @@ Run \`vela deploy\` first, then restore.`
|
|
|
15385
15480
|
const local = source && fs58.existsSync(source) ? source : void 0;
|
|
15386
15481
|
const key = local ? void 0 : await resolveKey(ctx, source);
|
|
15387
15482
|
if (!options.yes) {
|
|
15388
|
-
await
|
|
15483
|
+
await confirm14(ctx.appName, ctx.targetName, ctx.envTag, local ?? key);
|
|
15389
15484
|
}
|
|
15390
15485
|
const archive = local ? await stage(ctx, local) : remotePaths.backup(ctx.instance, key);
|
|
15391
15486
|
const result = await runServerScript(ctx.session, "restore.sh", {
|
|
@@ -15484,7 +15579,7 @@ async function stage(ctx, file) {
|
|
|
15484
15579
|
spinner9.stop(`Uploaded ${path63.basename(file)}`);
|
|
15485
15580
|
return remote;
|
|
15486
15581
|
}
|
|
15487
|
-
async function
|
|
15582
|
+
async function confirm14(appName, targetName, envTag, from) {
|
|
15488
15583
|
const what = `${pc37.cyan(`${appName} (${targetName})`)} from ${pc37.cyan(path63.basename(from))}`;
|
|
15489
15584
|
if (isProd(envTag)) {
|
|
15490
15585
|
const answer = await p65.text({
|
|
@@ -15508,7 +15603,7 @@ async function confirm13(appName, targetName, envTag, from) {
|
|
|
15508
15603
|
}
|
|
15509
15604
|
|
|
15510
15605
|
// src/commands/targets.ts
|
|
15511
|
-
import { Command as
|
|
15606
|
+
import { Command as Command106 } from "commander";
|
|
15512
15607
|
import * as p66 from "@clack/prompts";
|
|
15513
15608
|
import pc38 from "picocolors";
|
|
15514
15609
|
import * as v13 from "valibot";
|
|
@@ -15518,7 +15613,7 @@ var OptionsSchema6 = v13.object({
|
|
|
15518
15613
|
offline: v13.optional(v13.boolean())
|
|
15519
15614
|
});
|
|
15520
15615
|
var targets = addSshOptions(
|
|
15521
|
-
new
|
|
15616
|
+
new Command106("targets").description("list the targets this project can deploy to").configureHelp(helpConfig)
|
|
15522
15617
|
).option("--json", "print raw JSON").option("--offline", "skip connecting to servers").action(
|
|
15523
15618
|
(raw) => runCommand(async () => {
|
|
15524
15619
|
const options = parseOptions(OptionsSchema6, raw);
|
|
@@ -15597,14 +15692,14 @@ Release and domain are shown from what this project recorded.`
|
|
|
15597
15692
|
// src/commands/test.ts
|
|
15598
15693
|
import path64 from "node:path";
|
|
15599
15694
|
import process47 from "node:process";
|
|
15600
|
-
import { Command as
|
|
15695
|
+
import { Command as Command107 } from "commander";
|
|
15601
15696
|
import PocketBase7 from "pocketbase";
|
|
15602
15697
|
import pc39 from "picocolors";
|
|
15603
15698
|
import { x as x6 } from "tinyexec";
|
|
15604
15699
|
import { detect as detect9 } from "package-manager-detector";
|
|
15605
15700
|
import { resolveCommand as resolveCommand7 } from "package-manager-detector/commands";
|
|
15606
15701
|
import fs59 from "node:fs";
|
|
15607
|
-
var testServer = new
|
|
15702
|
+
var testServer = new Command107("test:server").description("run server tests").allowUnknownOption(true).allowExcessArguments(true).configureHelp(helpConfig).action(async (_opts, cmd) => {
|
|
15608
15703
|
const cwd = process47.cwd();
|
|
15609
15704
|
warnIfKit2(cwd, (m) => console.warn(pc39.yellow(`\u25B2 ${m}`)));
|
|
15610
15705
|
const email2 = `test-${Math.random().toString(36).slice(2)}@example.com`;
|
|
@@ -15748,7 +15843,7 @@ function stubPagesPlugin() {
|
|
|
15748
15843
|
// src/commands/routes.ts
|
|
15749
15844
|
import fs60 from "node:fs";
|
|
15750
15845
|
import path65 from "node:path";
|
|
15751
|
-
import { Command as
|
|
15846
|
+
import { Command as Command108 } from "commander";
|
|
15752
15847
|
var HTTP_METHODS = /* @__PURE__ */ new Set([
|
|
15753
15848
|
"GET",
|
|
15754
15849
|
"POST",
|
|
@@ -15759,7 +15854,7 @@ var HTTP_METHODS = /* @__PURE__ */ new Set([
|
|
|
15759
15854
|
"HEAD",
|
|
15760
15855
|
"fallback"
|
|
15761
15856
|
]);
|
|
15762
|
-
var routes = new
|
|
15857
|
+
var routes = new Command108("routes").description("list routes").configureHelp(helpConfig).action(async () => {
|
|
15763
15858
|
const { workspaceRootDir, routesDir } = await getWorkspace();
|
|
15764
15859
|
const routesRoot = path65.join(workspaceRootDir, routesDir);
|
|
15765
15860
|
const found = walk(routesRoot, routesRoot).filter((r) => r.methods.length > 0);
|
|
@@ -15837,7 +15932,7 @@ function printTable(routes2) {
|
|
|
15837
15932
|
import fs61 from "node:fs";
|
|
15838
15933
|
import path66 from "node:path";
|
|
15839
15934
|
import process48 from "node:process";
|
|
15840
|
-
import { Command as
|
|
15935
|
+
import { Command as Command109 } from "commander";
|
|
15841
15936
|
import { x as x7 } from "tinyexec";
|
|
15842
15937
|
import { detect as detect10 } from "package-manager-detector";
|
|
15843
15938
|
import { resolveCommand as resolveCommand8 } from "package-manager-detector/commands";
|
|
@@ -15856,24 +15951,24 @@ async function runWuchale(extraArgs) {
|
|
|
15856
15951
|
throwOnError: true
|
|
15857
15952
|
});
|
|
15858
15953
|
}
|
|
15859
|
-
var extract2 = new
|
|
15860
|
-
var watch = new
|
|
15861
|
-
var status2 = new
|
|
15862
|
-
var clean = new
|
|
15863
|
-
var i18n3 = new
|
|
15954
|
+
var extract2 = new Command109("extract").description("extract translatable strings").configureHelp(helpConfig).action(() => runCommand(() => runWuchale([])));
|
|
15955
|
+
var watch = new Command109("watch").description("watch and extract translatable strings").configureHelp(helpConfig).action(() => runCommand(() => runWuchale(["--watch"])));
|
|
15956
|
+
var status2 = new Command109("status").description("show i18n status").configureHelp(helpConfig).action(() => runCommand(() => runWuchale(["status"])));
|
|
15957
|
+
var clean = new Command109("clean").description("clean unused translatable strings").configureHelp(helpConfig).action(() => runCommand(() => runWuchale(["--clean"])));
|
|
15958
|
+
var i18n3 = new Command109("i18n").description("i18n utilities").configureHelp(helpConfig).addCommand(extract2, { isDefault: true }).addCommand(watch).addCommand(status2).addCommand(clean);
|
|
15864
15959
|
|
|
15865
15960
|
// src/commands/cms.ts
|
|
15866
|
-
import { Command as
|
|
15961
|
+
import { Command as Command115 } from "commander";
|
|
15867
15962
|
|
|
15868
15963
|
// src/commands/cms/deploy.ts
|
|
15869
15964
|
import process49 from "node:process";
|
|
15870
|
-
import { Command as
|
|
15965
|
+
import { Command as Command110 } from "commander";
|
|
15871
15966
|
import * as p67 from "@clack/prompts";
|
|
15872
15967
|
import pc40 from "picocolors";
|
|
15873
15968
|
var POLL_INTERVAL2 = 5e3;
|
|
15874
15969
|
var POLL_TIMEOUT = 30 * 6e4;
|
|
15875
15970
|
var inFlight = (run) => run?.status === "pending" || run?.status === "building";
|
|
15876
|
-
var deploy2 = new
|
|
15971
|
+
var deploy2 = new Command110("deploy").description("rebuild the hosted site with the latest published content").option(
|
|
15877
15972
|
"--project <id>",
|
|
15878
15973
|
"velastack.dev project whose site to rebuild, instead of the linked one"
|
|
15879
15974
|
).option("--no-wait", "return once the build has started instead of waiting for it").configureHelp(helpConfig).action(
|
|
@@ -15962,11 +16057,11 @@ async function waitForRun(apiKey, projectId, runId) {
|
|
|
15962
16057
|
}
|
|
15963
16058
|
|
|
15964
16059
|
// src/commands/cms/editor.ts
|
|
15965
|
-
import { Command as
|
|
16060
|
+
import { Command as Command114 } from "commander";
|
|
15966
16061
|
|
|
15967
16062
|
// src/commands/cms/editor/add.ts
|
|
15968
16063
|
import { randomBytes } from "node:crypto";
|
|
15969
|
-
import { Command as
|
|
16064
|
+
import { Command as Command111 } from "commander";
|
|
15970
16065
|
import * as p68 from "@clack/prompts";
|
|
15971
16066
|
import pc42 from "picocolors";
|
|
15972
16067
|
|
|
@@ -16009,7 +16104,7 @@ async function withCmsBackend(fn, cwd = process50.cwd()) {
|
|
|
16009
16104
|
}
|
|
16010
16105
|
|
|
16011
16106
|
// src/commands/cms/editor/add.ts
|
|
16012
|
-
var editorAdd = new
|
|
16107
|
+
var editorAdd = new Command111("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(
|
|
16013
16108
|
(email2, options) => runCommand(async () => {
|
|
16014
16109
|
const generated = options.password === void 0;
|
|
16015
16110
|
const password8 = options.password ?? randomBytes(12).toString("base64url");
|
|
@@ -16028,10 +16123,10 @@ var editorAdd = new Command109("add").description("create an editor who can sign
|
|
|
16028
16123
|
);
|
|
16029
16124
|
|
|
16030
16125
|
// src/commands/cms/editor/password.ts
|
|
16031
|
-
import { Command as
|
|
16126
|
+
import { Command as Command112 } from "commander";
|
|
16032
16127
|
import * as p69 from "@clack/prompts";
|
|
16033
16128
|
import pc43 from "picocolors";
|
|
16034
|
-
var editorPassword = new
|
|
16129
|
+
var editorPassword = new Command112("password").description("set an editor's password").argument("<email>", "email of the editor").argument("<password>", "new password").configureHelp(helpConfig).action(
|
|
16035
16130
|
(email2, password8) => runCommand(async () => {
|
|
16036
16131
|
await withCmsBackend((cms3) => cms3.editors.setPassword(email2, password8));
|
|
16037
16132
|
p69.log.success(
|
|
@@ -16041,10 +16136,10 @@ var editorPassword = new Command110("password").description("set an editor's pas
|
|
|
16041
16136
|
);
|
|
16042
16137
|
|
|
16043
16138
|
// src/commands/cms/editor/list.ts
|
|
16044
|
-
import { Command as
|
|
16139
|
+
import { Command as Command113 } from "commander";
|
|
16045
16140
|
import * as p70 from "@clack/prompts";
|
|
16046
16141
|
import pc44 from "picocolors";
|
|
16047
|
-
var editorList = new
|
|
16142
|
+
var editorList = new Command113("list").description("list editors and the projects they may edit").configureHelp(helpConfig).action(
|
|
16048
16143
|
() => runCommand(async () => {
|
|
16049
16144
|
const rows = await withCmsBackend(
|
|
16050
16145
|
async (cms3) => cms3.editors.list().map((editor2) => ({
|
|
@@ -16068,17 +16163,17 @@ var editorList = new Command111("list").description("list editors and the projec
|
|
|
16068
16163
|
);
|
|
16069
16164
|
|
|
16070
16165
|
// src/commands/cms/editor.ts
|
|
16071
|
-
var editor = new
|
|
16166
|
+
var editor = new Command114("editor").description("manage who can sign in to the admin bar").configureHelp(helpConfig).addCommand(editorAdd).addCommand(editorPassword).addCommand(editorList);
|
|
16072
16167
|
|
|
16073
16168
|
// src/commands/cms.ts
|
|
16074
|
-
var cms2 = new
|
|
16169
|
+
var cms2 = new Command115("cms").description("manage the CMS").configureHelp(helpConfig).addCommand(editor).addCommand(deploy2);
|
|
16075
16170
|
|
|
16076
16171
|
// src/commands/workflows.ts
|
|
16077
|
-
import { Command as
|
|
16172
|
+
import { Command as Command119 } from "commander";
|
|
16078
16173
|
|
|
16079
16174
|
// src/commands/workflows/list.ts
|
|
16080
16175
|
import process51 from "node:process";
|
|
16081
|
-
import { Command as
|
|
16176
|
+
import { Command as Command116, InvalidArgumentError as InvalidArgumentError5 } from "commander";
|
|
16082
16177
|
import * as p71 from "@clack/prompts";
|
|
16083
16178
|
import pc45 from "picocolors";
|
|
16084
16179
|
|
|
@@ -16153,7 +16248,7 @@ function formatRun(run, nameWidth) {
|
|
|
16153
16248
|
const error = run.status === "failed" && run.error?.message ? pc45.red(` ${run.error.message}`) : "";
|
|
16154
16249
|
return `${run.id} ${run.workflowName.padEnd(nameWidth)} ${status3}${attempts} ${when}${error}`;
|
|
16155
16250
|
}
|
|
16156
|
-
var workflowsList = new
|
|
16251
|
+
var workflowsList = new Command116("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(
|
|
16157
16252
|
(options) => runCommand(async () => {
|
|
16158
16253
|
await withPocketbase(process51.cwd(), async (pb) => {
|
|
16159
16254
|
const runs = await listRuns(pb, {
|
|
@@ -16177,7 +16272,7 @@ Start one from server code with ${pc45.cyan("<workflow>.run(input)")}, or with $
|
|
|
16177
16272
|
|
|
16178
16273
|
// src/commands/workflows/run.ts
|
|
16179
16274
|
import process52 from "node:process";
|
|
16180
|
-
import { Command as
|
|
16275
|
+
import { Command as Command117, InvalidArgumentError as InvalidArgumentError6 } from "commander";
|
|
16181
16276
|
import * as p72 from "@clack/prompts";
|
|
16182
16277
|
import pc46 from "picocolors";
|
|
16183
16278
|
function parseInput(value) {
|
|
@@ -16187,7 +16282,7 @@ function parseInput(value) {
|
|
|
16187
16282
|
throw new InvalidArgumentError6(`must be JSON, e.g. '{"userId":"abc"}'.`);
|
|
16188
16283
|
}
|
|
16189
16284
|
}
|
|
16190
|
-
var workflowsRun = new
|
|
16285
|
+
var workflowsRun = new Command117("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(
|
|
16191
16286
|
(name, input) => runCommand(async () => {
|
|
16192
16287
|
await withPocketbase(process52.cwd(), async (pb) => {
|
|
16193
16288
|
const run = await createRun(pb, name, input);
|
|
@@ -16202,10 +16297,10 @@ It runs once the app is up (${pc46.cyan("vela dev")}); ${pc46.cyan("vela workflo
|
|
|
16202
16297
|
|
|
16203
16298
|
// src/commands/workflows/cancel.ts
|
|
16204
16299
|
import process53 from "node:process";
|
|
16205
|
-
import { Command as
|
|
16300
|
+
import { Command as Command118 } from "commander";
|
|
16206
16301
|
import * as p73 from "@clack/prompts";
|
|
16207
16302
|
import pc47 from "picocolors";
|
|
16208
|
-
var workflowsCancel = new
|
|
16303
|
+
var workflowsCancel = new Command118("cancel").description("cancel a pending or running workflow run").argument("<run-id>", "the run id from `vela workflows list`").configureHelp(helpConfig).action(
|
|
16209
16304
|
(id) => runCommand(async () => {
|
|
16210
16305
|
await withPocketbase(process53.cwd(), async (pb) => {
|
|
16211
16306
|
const run = await cancelRun(pb, id);
|
|
@@ -16215,7 +16310,7 @@ var workflowsCancel = new Command116("cancel").description("cancel a pending or
|
|
|
16215
16310
|
);
|
|
16216
16311
|
|
|
16217
16312
|
// src/commands/workflows.ts
|
|
16218
|
-
var workflows2 = new
|
|
16313
|
+
var workflows2 = new Command119("workflows").description("list, start and cancel background workflow runs").configureHelp(helpConfig).addCommand(workflowsList).addCommand(workflowsRun).addCommand(workflowsCancel);
|
|
16219
16314
|
|
|
16220
16315
|
// src/program.ts
|
|
16221
16316
|
var NO_BACKEND_COMMMANDS = /* @__PURE__ */ new Set([
|
|
@@ -16279,10 +16374,16 @@ var NO_BACKEND_COMMMANDS = /* @__PURE__ */ new Set([
|
|
|
16279
16374
|
// drop collections and stay gated.
|
|
16280
16375
|
"destroy deployment"
|
|
16281
16376
|
]);
|
|
16282
|
-
var PROVIDER_GATED_COMMANDS = /* @__PURE__ */ new Set([
|
|
16377
|
+
var PROVIDER_GATED_COMMANDS = /* @__PURE__ */ new Set([
|
|
16378
|
+
"enable payments",
|
|
16379
|
+
"disable payments",
|
|
16380
|
+
// Stripe's shop reads PocketBase; Shopify's and WhatsApp's run on a static site.
|
|
16381
|
+
"generate shop",
|
|
16382
|
+
"destroy shop"
|
|
16383
|
+
]);
|
|
16283
16384
|
var BACKEND_OPTIONAL_COMMANDS = /* @__PURE__ */ new Set(["dev", "build", "preview", "deploy"]);
|
|
16284
16385
|
var SELF_CREDENTIALED_COMMANDS = /* @__PURE__ */ new Set(["test:server"]);
|
|
16285
|
-
var program = new
|
|
16386
|
+
var program = new Command120().name(package_default.name).description(package_default.description).version(package_default.version, "-v, --version").configureHelp(helpConfig);
|
|
16286
16387
|
program.hook("preAction", (_thisCommand, actionCommand) => {
|
|
16287
16388
|
const envRoot = findWorkspaceRoot() ?? process54.cwd();
|
|
16288
16389
|
dotenv2.config({ path: nodePath.join(envRoot, ".env"), quiet: true });
|