vela 0.17.0 → 0.18.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/bin.js +508 -403
- package/dist/bin.js.map +4 -4
- package/package.json +3 -3
- package/templates/minimal/package.template.json +3 -8
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.1",
|
|
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.1",
|
|
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",
|
|
@@ -372,6 +372,19 @@ function raiseFloor(pkg, name, range) {
|
|
|
372
372
|
}
|
|
373
373
|
return changed;
|
|
374
374
|
}
|
|
375
|
+
function dropFormsnapOverride(pkg) {
|
|
376
|
+
const overrides = pkg.overrides;
|
|
377
|
+
const entry = overrides?.formsnap;
|
|
378
|
+
if (typeof entry !== "object" || entry === null || !("sveltekit-superforms" in entry)) {
|
|
379
|
+
return false;
|
|
380
|
+
}
|
|
381
|
+
const { "sveltekit-superforms": _, ...rest } = entry;
|
|
382
|
+
const { formsnap: __, ...others } = overrides;
|
|
383
|
+
const next = Object.keys(rest).length > 0 ? { ...others, formsnap: rest } : others;
|
|
384
|
+
if (Object.keys(next).length > 0) pkg.overrides = next;
|
|
385
|
+
else delete pkg.overrides;
|
|
386
|
+
return true;
|
|
387
|
+
}
|
|
375
388
|
var VERSION_PART = /^v?(\d+|[xX*])(?:\.(\d+|[xX*]))?(?:\.(\d+|[xX*]))?(?:-([0-9A-Za-z.-]+))?(?:\+[0-9A-Za-z.-]+)?$/;
|
|
376
389
|
function minVersion(range) {
|
|
377
390
|
const alternatives = range.split("||").map((alt) => alt.trim());
|
|
@@ -406,9 +419,9 @@ function minOfComparatorSet(set) {
|
|
|
406
419
|
if (upperOnly) return { major: 0, minor: 0, patch: 0, prerelease: [] };
|
|
407
420
|
return floor;
|
|
408
421
|
}
|
|
409
|
-
function parseVersionPart(
|
|
410
|
-
if (
|
|
411
|
-
const match =
|
|
422
|
+
function parseVersionPart(text18) {
|
|
423
|
+
if (text18 === "" || text18 === "*" || text18 === "x" || text18 === "X") return null;
|
|
424
|
+
const match = text18.match(VERSION_PART);
|
|
412
425
|
if (!match) return null;
|
|
413
426
|
const nums = [match[1], match[2], match[3]];
|
|
414
427
|
const firstWild = nums.findIndex((n) => n === void 0 || /^[xX*]$/.test(n));
|
|
@@ -594,6 +607,8 @@ function detectFeatures(root, { isAppMode }) {
|
|
|
594
607
|
// The code page, not src/lib/server/whatsapp.ts, which goes once the
|
|
595
608
|
// PocketBase SDK has WhatsApp.
|
|
596
609
|
whatsapp: has("src/routes/(public)/(auth)/whatsapp"),
|
|
610
|
+
// The cart store every provider's ecommerce files share a path for.
|
|
611
|
+
ecommerce: has("src/lib/cart.svelte.ts"),
|
|
597
612
|
ui: detectUi(root)
|
|
598
613
|
};
|
|
599
614
|
}
|
|
@@ -899,10 +914,10 @@ function writeCachedIndex(cached2) {
|
|
|
899
914
|
fs6.mkdirSync(cacheRoot(), { recursive: true });
|
|
900
915
|
fs6.writeFileSync(indexCachePath(), JSON.stringify(cached2, null, 2));
|
|
901
916
|
}
|
|
902
|
-
function parseTemplateIndex(
|
|
917
|
+
function parseTemplateIndex(text18, url) {
|
|
903
918
|
let parsed;
|
|
904
919
|
try {
|
|
905
|
-
parsed = JSON.parse(
|
|
920
|
+
parsed = JSON.parse(text18);
|
|
906
921
|
} catch (e) {
|
|
907
922
|
throw new Error(`Template index at ${url} is not valid JSON: ${e.message}`);
|
|
908
923
|
}
|
|
@@ -1852,8 +1867,8 @@ async function readSite(root) {
|
|
|
1852
1867
|
if (!property || !Node6.isPropertyAssignment(property)) continue;
|
|
1853
1868
|
const value = property.getInitializer();
|
|
1854
1869
|
if (Node6.isStringLiteral(value) || Node6.isNoSubstitutionTemplateLiteral(value)) {
|
|
1855
|
-
const
|
|
1856
|
-
if (
|
|
1870
|
+
const text18 = value.getLiteralValue().trim();
|
|
1871
|
+
if (text18) info[key] = text18;
|
|
1857
1872
|
}
|
|
1858
1873
|
}
|
|
1859
1874
|
return info;
|
|
@@ -2192,11 +2207,11 @@ function mergeOriginConfig(root, options = {}) {
|
|
|
2192
2207
|
if (target) setOriginComment(target);
|
|
2193
2208
|
}
|
|
2194
2209
|
if (orphaned.length > 0) {
|
|
2195
|
-
let
|
|
2210
|
+
let text18 = vite.sourceFile.getFullText();
|
|
2196
2211
|
for (const comment of orphaned) {
|
|
2197
|
-
|
|
2212
|
+
text18 = text18.replace(new RegExp(String.raw`\n[\t ]*${escapeRegExp2(comment)}[\t ]*(?=\n)`), "");
|
|
2198
2213
|
}
|
|
2199
|
-
vite.sourceFile.replaceWithText(
|
|
2214
|
+
vite.sourceFile.replaceWithText(text18);
|
|
2200
2215
|
}
|
|
2201
2216
|
vite.sourceFile.saveSync();
|
|
2202
2217
|
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 +2243,8 @@ var ORIGIN_COMMENT = [
|
|
|
2228
2243
|
"baked in at build time. It is left unset for a deploy that serves more",
|
|
2229
2244
|
"than one host, where each request's own origin is used instead."
|
|
2230
2245
|
];
|
|
2231
|
-
function escapeRegExp2(
|
|
2232
|
-
return
|
|
2246
|
+
function escapeRegExp2(text18) {
|
|
2247
|
+
return text18.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
2233
2248
|
}
|
|
2234
2249
|
function mentionsPrerender(node) {
|
|
2235
2250
|
return node.getLeadingCommentRanges().some((c) => /prerender/i.test(c.getText()));
|
|
@@ -2526,7 +2541,7 @@ function detectJsonIndent(source) {
|
|
|
2526
2541
|
var PRINT_WIDTH = 100;
|
|
2527
2542
|
function stringifyJson(value, indent, level = 0, prefix = 0) {
|
|
2528
2543
|
const pad2 = (n) => indent.repeat(n);
|
|
2529
|
-
const width = (
|
|
2544
|
+
const width = (text18) => text18.replaceAll(" ", " ").length;
|
|
2530
2545
|
if (Array.isArray(value)) {
|
|
2531
2546
|
if (value.length === 0) return "[]";
|
|
2532
2547
|
const scalars = value.every((v14) => v14 === null || typeof v14 !== "object");
|
|
@@ -2886,8 +2901,10 @@ function mergeDependencies(projectPath, templateDir) {
|
|
|
2886
2901
|
if (ensureLibImports(merged)) p6.log.info("package.json: added the #lib imports.");
|
|
2887
2902
|
writePackageJson(userPkgPath, merged);
|
|
2888
2903
|
if (pinned.length > 0) {
|
|
2889
|
-
p6.log.info(
|
|
2890
|
-
|
|
2904
|
+
p6.log.info(
|
|
2905
|
+
`Set what SvelteKit 3's form libraries need:
|
|
2906
|
+
${pinned.map((l) => ` ${l}`).join("\n")}`
|
|
2907
|
+
);
|
|
2891
2908
|
}
|
|
2892
2909
|
if (added.length > 0) {
|
|
2893
2910
|
p6.log.info(
|
|
@@ -2924,16 +2941,15 @@ function applyTemplatePins(merged, template, conflicts) {
|
|
|
2924
2941
|
const index = conflicts.findIndex((c) => c.name === name);
|
|
2925
2942
|
if (index !== -1) conflicts.splice(index, 1);
|
|
2926
2943
|
}
|
|
2927
|
-
const
|
|
2928
|
-
const
|
|
2929
|
-
if (
|
|
2930
|
-
|
|
2931
|
-
const
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
}
|
|
2944
|
+
const formsnapRange = template.devDependencies?.formsnap ?? template.dependencies?.formsnap;
|
|
2945
|
+
const formsnapBefore = merged.devDependencies?.formsnap ?? merged.dependencies?.formsnap;
|
|
2946
|
+
if (formsnapRange && raiseFloor(merged, "formsnap", formsnapRange)) {
|
|
2947
|
+
lines.push(`formsnap: ${formsnapBefore} \u2192 ${formsnapRange}`);
|
|
2948
|
+
const index = conflicts.findIndex((c) => c.name === "formsnap");
|
|
2949
|
+
if (index !== -1) conflicts.splice(index, 1);
|
|
2950
|
+
}
|
|
2951
|
+
if (dropFormsnapOverride(merged)) {
|
|
2952
|
+
lines.push("overrides.formsnap: dropped the sveltekit-superforms entry formsnap 2.0 needed");
|
|
2937
2953
|
}
|
|
2938
2954
|
const engines = template.engines;
|
|
2939
2955
|
const userEngines = merged.engines ?? {};
|
|
@@ -3929,6 +3945,7 @@ import {
|
|
|
3929
3945
|
ADAPTER_STATIC as ADAPTER_STATIC2,
|
|
3930
3946
|
ensurePackageOverrides,
|
|
3931
3947
|
FLASH,
|
|
3948
|
+
FORMSNAP,
|
|
3932
3949
|
SUPERFORMS_VERSION,
|
|
3933
3950
|
VELASTACK_CMS,
|
|
3934
3951
|
VELASTACK_KIT,
|
|
@@ -4380,10 +4397,10 @@ var npmViewLookup = (name, range, cwd) => new Promise((resolve2, reject) => {
|
|
|
4380
4397
|
(error, stdout, stderr) => {
|
|
4381
4398
|
if (error && /\bE404\b/.test(`${stderr}${error.message}`)) return resolve2(null);
|
|
4382
4399
|
if (error) return reject(error);
|
|
4383
|
-
const
|
|
4384
|
-
if (!
|
|
4400
|
+
const text18 = stdout.trim();
|
|
4401
|
+
if (!text18) return resolve2(null);
|
|
4385
4402
|
try {
|
|
4386
|
-
resolve2(newest(JSON.parse(
|
|
4403
|
+
resolve2(newest(JSON.parse(text18)));
|
|
4387
4404
|
} catch (e) {
|
|
4388
4405
|
reject(e);
|
|
4389
4406
|
}
|
|
@@ -4840,14 +4857,14 @@ function skipString(source, start) {
|
|
|
4840
4857
|
}
|
|
4841
4858
|
return -1;
|
|
4842
4859
|
}
|
|
4843
|
-
function splitTopLevel(
|
|
4860
|
+
function splitTopLevel(text18) {
|
|
4844
4861
|
const parts = [];
|
|
4845
4862
|
let depth = 0;
|
|
4846
4863
|
let partStart = 0;
|
|
4847
|
-
for (let i = 0; i <
|
|
4848
|
-
const c =
|
|
4864
|
+
for (let i = 0; i < text18.length; i++) {
|
|
4865
|
+
const c = text18[i];
|
|
4849
4866
|
if (c === '"' || c === "'" || c === "`") {
|
|
4850
|
-
const end = skipString(
|
|
4867
|
+
const end = skipString(text18, i);
|
|
4851
4868
|
if (end === -1) break;
|
|
4852
4869
|
i = end;
|
|
4853
4870
|
continue;
|
|
@@ -4855,12 +4872,12 @@ function splitTopLevel(text19) {
|
|
|
4855
4872
|
if (c === "(" || c === "{" || c === "[") depth++;
|
|
4856
4873
|
else if (c === ")" || c === "}" || c === "]") depth--;
|
|
4857
4874
|
else if (c === "," && depth === 0) {
|
|
4858
|
-
parts.push({ start: partStart, end: i, text:
|
|
4875
|
+
parts.push({ start: partStart, end: i, text: text18.slice(partStart, i) });
|
|
4859
4876
|
partStart = i + 1;
|
|
4860
4877
|
}
|
|
4861
4878
|
}
|
|
4862
|
-
if (
|
|
4863
|
-
parts.push({ start: partStart, end:
|
|
4879
|
+
if (text18.slice(partStart).trim()) {
|
|
4880
|
+
parts.push({ start: partStart, end: text18.length, text: text18.slice(partStart) });
|
|
4864
4881
|
}
|
|
4865
4882
|
return parts;
|
|
4866
4883
|
}
|
|
@@ -4977,8 +4994,8 @@ function rewriteGotoOptions(inner) {
|
|
|
4977
4994
|
if (!joined.startsWith(lead)) joined = lead + joined.trimStart();
|
|
4978
4995
|
return { inner: joined + tail, summary: summary.join("; ") };
|
|
4979
4996
|
}
|
|
4980
|
-
function escapeRegExp3(
|
|
4981
|
-
return
|
|
4997
|
+
function escapeRegExp3(text18) {
|
|
4998
|
+
return text18.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
4982
4999
|
}
|
|
4983
5000
|
function rewriteInvalidateAll(source) {
|
|
4984
5001
|
const outcome = { edits: [], changes: [], tasks: [] };
|
|
@@ -5063,9 +5080,9 @@ function addTaskComments(source, file, tasks) {
|
|
|
5063
5080
|
const lineStart2 = code2.lastIndexOf("\n", index - 1) + 1;
|
|
5064
5081
|
const lineEnd = code2.indexOf("\n", index);
|
|
5065
5082
|
const excerpt = code2.slice(lineStart2, lineEnd === -1 ? void 0 : lineEnd).trim().replace(/--/g, "- -").slice(0, 80);
|
|
5066
|
-
const
|
|
5067
|
-
if (code2.includes(
|
|
5068
|
-
code2 = `<!-- ${
|
|
5083
|
+
const text18 = `${MIGRATION_TASK_MARKER} \`${excerpt}\`: ${message}`;
|
|
5084
|
+
if (code2.includes(text18)) continue;
|
|
5085
|
+
code2 = `<!-- ${text18} -->
|
|
5069
5086
|
${code2}`;
|
|
5070
5087
|
added.push(`line ${line}: ${message}`);
|
|
5071
5088
|
continue;
|
|
@@ -5459,8 +5476,8 @@ function svArgs(root, tasks, exclude) {
|
|
|
5459
5476
|
}
|
|
5460
5477
|
var ANSI = /\u001b\[[0-9;?]*[A-Za-z]/g;
|
|
5461
5478
|
function parseSvFailure(output) {
|
|
5462
|
-
const
|
|
5463
|
-
const match =
|
|
5479
|
+
const text18 = output.replace(ANSI, "");
|
|
5480
|
+
const match = text18.match(/Task '([^']+)' failed: ([^\n]*)/);
|
|
5464
5481
|
if (!match) return null;
|
|
5465
5482
|
const message = match[2].trim();
|
|
5466
5483
|
const file = message.match(/Unable to process '([^']+)'/)?.[1];
|
|
@@ -5550,9 +5567,9 @@ function originFixup(root, capture, sv) {
|
|
|
5550
5567
|
${outcome.snippet}`);
|
|
5551
5568
|
}
|
|
5552
5569
|
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:
|
|
5570
|
+
for (const text18 of capture?.spreads ?? []) {
|
|
5571
|
+
if (carry && !lost && carry.text.endsWith(text18)) continue;
|
|
5572
|
+
sv.dropped.push({ file: capture.file, text: text18 });
|
|
5556
5573
|
}
|
|
5557
5574
|
return f;
|
|
5558
5575
|
}
|
|
@@ -5668,6 +5685,8 @@ var FLOORS = [
|
|
|
5668
5685
|
["svelte-check", "^4.7.6"],
|
|
5669
5686
|
["typescript", "^6.0.0"],
|
|
5670
5687
|
["shadcn-svelte", "^1.7.0"],
|
|
5688
|
+
// 2.1 is the first formsnap whose superforms peer admits 3.x.
|
|
5689
|
+
splitSpec(FORMSNAP),
|
|
5671
5690
|
splitSpec(VELASTACK_KIT),
|
|
5672
5691
|
splitSpec(VELASTACK_POCKETBASE),
|
|
5673
5692
|
splitSpec(VELASTACK_CMS),
|
|
@@ -5704,23 +5723,10 @@ function packageFixup(root, cliVersion) {
|
|
|
5704
5723
|
changed.push(`engines.node ${engines.node ?? "(unset)"} \u2192 ${ENGINES_FLOOR}`);
|
|
5705
5724
|
data.engines = { ...engines, node: ENGINES_FLOOR };
|
|
5706
5725
|
}
|
|
5707
|
-
if (
|
|
5708
|
-
|
|
5709
|
-
|
|
5710
|
-
|
|
5711
|
-
f.warnings.push(
|
|
5712
|
-
`overrides.formsnap is not an object; set "formsnap": { "sveltekit-superforms": "${SUPERFORMS_VERSION}" } by hand`
|
|
5713
|
-
);
|
|
5714
|
-
} else {
|
|
5715
|
-
const formsnap = current ?? {};
|
|
5716
|
-
if (formsnap["sveltekit-superforms"] !== SUPERFORMS_VERSION) {
|
|
5717
|
-
data.overrides = {
|
|
5718
|
-
...overrides,
|
|
5719
|
-
formsnap: { ...formsnap, "sveltekit-superforms": SUPERFORMS_VERSION }
|
|
5720
|
-
};
|
|
5721
|
-
changed.push(`overrides formsnap \u2192 sveltekit-superforms ${SUPERFORMS_VERSION}`);
|
|
5722
|
-
}
|
|
5723
|
-
}
|
|
5726
|
+
if (dropFormsnapOverride(data)) {
|
|
5727
|
+
changed.push(
|
|
5728
|
+
"overrides formsnap \u2192 sveltekit-superforms dropped (formsnap 2.1 peers superforms 3)"
|
|
5729
|
+
);
|
|
5724
5730
|
}
|
|
5725
5731
|
if (changed.length > 0) {
|
|
5726
5732
|
writeJson(pkgPath, data, indent);
|
|
@@ -5863,10 +5869,10 @@ function belowFloor(project, key, entry) {
|
|
|
5863
5869
|
return Boolean(floor && locked && compareVersions(locked, floor) < 0);
|
|
5864
5870
|
}
|
|
5865
5871
|
function readJson(file) {
|
|
5866
|
-
const
|
|
5872
|
+
const text18 = fs29.readFileSync(file, "utf8");
|
|
5867
5873
|
return {
|
|
5868
|
-
data: JSON.parse(
|
|
5869
|
-
indent:
|
|
5874
|
+
data: JSON.parse(text18),
|
|
5875
|
+
indent: text18.match(/^[{[]\s*\n([\t ]+)/)?.[1] ?? " "
|
|
5870
5876
|
};
|
|
5871
5877
|
}
|
|
5872
5878
|
function writeJson(file, data, indent) {
|
|
@@ -5973,13 +5979,13 @@ function previousFollowUps(root, pattern) {
|
|
|
5973
5979
|
const end = content.indexOf("\n## ", start + FOLLOW_UPS_HEADING.length);
|
|
5974
5980
|
return content.slice(start, end === -1 ? void 0 : end).split("\n").filter((line) => line.startsWith("- [") && pattern.test(line)).map((line) => line.replace(/^- \[[ x]\] /, ""));
|
|
5975
5981
|
}
|
|
5976
|
-
function code(
|
|
5977
|
-
const fence =
|
|
5978
|
-
const pad2 =
|
|
5979
|
-
return `${fence}${pad2}${
|
|
5982
|
+
function code(text18) {
|
|
5983
|
+
const fence = text18.includes("`") ? "``" : "`";
|
|
5984
|
+
const pad2 = text18.startsWith("`") || text18.endsWith("`") ? " " : "";
|
|
5985
|
+
return `${fence}${pad2}${text18}${pad2}${fence}`;
|
|
5980
5986
|
}
|
|
5981
|
-
function escape(
|
|
5982
|
-
return
|
|
5987
|
+
function escape(text18) {
|
|
5988
|
+
return text18.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
5983
5989
|
}
|
|
5984
5990
|
function writeFollowUps(root, items, generic) {
|
|
5985
5991
|
const file = path28.join(root, MIGRATION_TASKS_FILE);
|
|
@@ -6121,8 +6127,8 @@ function findRepeaterImport(dir) {
|
|
|
6121
6127
|
for (const entry of entries) {
|
|
6122
6128
|
if (!entry.isFile() || !SOURCE_FILE.test(entry.name)) continue;
|
|
6123
6129
|
const file = path29.join(entry.parentPath, entry.name);
|
|
6124
|
-
const
|
|
6125
|
-
if (
|
|
6130
|
+
const text18 = fs30.readFileSync(file, "utf8");
|
|
6131
|
+
if (text18.includes("CmsRepeater") && REPEATER_IMPORT.test(text18)) {
|
|
6126
6132
|
return path29.relative(dir, file);
|
|
6127
6133
|
}
|
|
6128
6134
|
}
|
|
@@ -6512,7 +6518,7 @@ function hasScript(directory, name) {
|
|
|
6512
6518
|
}
|
|
6513
6519
|
|
|
6514
6520
|
// src/commands/generate.ts
|
|
6515
|
-
import { Command as
|
|
6521
|
+
import { Command as Command11 } from "commander";
|
|
6516
6522
|
|
|
6517
6523
|
// src/commands/generate/form.ts
|
|
6518
6524
|
import { Command as Command4 } from "commander";
|
|
@@ -6539,6 +6545,7 @@ Then run this again.`
|
|
|
6539
6545
|
|
|
6540
6546
|
// src/lib/require-features.ts
|
|
6541
6547
|
import {
|
|
6548
|
+
blockingFeatures,
|
|
6542
6549
|
bySlug as bySlug2,
|
|
6543
6550
|
unmetRequirements
|
|
6544
6551
|
} from "@velastack/patterns";
|
|
@@ -6553,7 +6560,21 @@ var ENABLE_COMMAND = {
|
|
|
6553
6560
|
blog: "vela enable blog",
|
|
6554
6561
|
contentNegotiation: "vela enable content-negotiation",
|
|
6555
6562
|
cms: "vela enable cms",
|
|
6556
|
-
workflows: "vela enable workflows"
|
|
6563
|
+
workflows: "vela enable workflows",
|
|
6564
|
+
ecommerce: "vela enable ecommerce"
|
|
6565
|
+
};
|
|
6566
|
+
var DISABLE_COMMAND = {
|
|
6567
|
+
auth: "vela disable auth",
|
|
6568
|
+
api: "vela disable api",
|
|
6569
|
+
apiKeys: "vela disable api-keys",
|
|
6570
|
+
backend: "vela disable backend",
|
|
6571
|
+
i18n: "vela disable i18n",
|
|
6572
|
+
teams: "vela disable teams",
|
|
6573
|
+
payments: "vela disable payments",
|
|
6574
|
+
blog: "vela disable blog",
|
|
6575
|
+
contentNegotiation: "vela disable content-negotiation",
|
|
6576
|
+
cms: "vela disable cms",
|
|
6577
|
+
ecommerce: "vela disable ecommerce"
|
|
6557
6578
|
};
|
|
6558
6579
|
var FEATURE_NAME = {
|
|
6559
6580
|
apiKeys: "API keys",
|
|
@@ -6608,9 +6629,23 @@ function unmetMessage(command, unmet) {
|
|
|
6608
6629
|
...notes.length > 0 ? ["", ...notes] : []
|
|
6609
6630
|
].join("\n");
|
|
6610
6631
|
}
|
|
6632
|
+
function blockedMessage(command, blocking) {
|
|
6633
|
+
const names = blocking.map((feature) => FEATURE_NAME[feature] ?? feature);
|
|
6634
|
+
const steps = blocking.flatMap((feature) => DISABLE_COMMAND[feature] ?? []);
|
|
6635
|
+
const they = blocking.length > 1 ? "they depend" : "it depends";
|
|
6636
|
+
return [
|
|
6637
|
+
`\`${command}\` can't run while this project has ${names.join(", ")}: ${they} on what it removes.`,
|
|
6638
|
+
"",
|
|
6639
|
+
"Nothing was changed. To take it out first:",
|
|
6640
|
+
...steps.map((step, i) => ` ${i + 1}. ${step}`),
|
|
6641
|
+
"Then run this again."
|
|
6642
|
+
].join("\n");
|
|
6643
|
+
}
|
|
6611
6644
|
function assertRequires(command, pattern, context) {
|
|
6612
6645
|
const unmet = unmetRequirements(pattern, context);
|
|
6613
6646
|
if (unmet.length > 0) throw new Error(unmetMessage(command, unmet));
|
|
6647
|
+
const blocking = blockingFeatures(pattern, context.features);
|
|
6648
|
+
if (blocking.length > 0) throw new Error(blockedMessage(command, blocking));
|
|
6614
6649
|
}
|
|
6615
6650
|
async function assertPatternRequires(slug2, provider) {
|
|
6616
6651
|
const pattern = bySlug2[slug2];
|
|
@@ -7296,15 +7331,55 @@ var workflow = new Command9("workflow").description("generate a background workf
|
|
|
7296
7331
|
)
|
|
7297
7332
|
);
|
|
7298
7333
|
|
|
7334
|
+
// src/commands/generate/shop.ts
|
|
7335
|
+
import { Command as Command10 } from "commander";
|
|
7336
|
+
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(
|
|
7337
|
+
(opts, cmd) => runCommand(async () => {
|
|
7338
|
+
const { detected } = await detectWorkspace();
|
|
7339
|
+
const provider = await resolveProvider("generate-shop", opts.provider, detected.providers);
|
|
7340
|
+
await assertPatternRequires("generate-shop", provider.id);
|
|
7341
|
+
if (provider.id === "stripe") assertBackendReady("vela generate shop");
|
|
7342
|
+
await runPattern(
|
|
7343
|
+
"generate-shop",
|
|
7344
|
+
cmd.args,
|
|
7345
|
+
{ provider: provider.id },
|
|
7346
|
+
{
|
|
7347
|
+
summary: `Generated a ${provider.label} shop.`,
|
|
7348
|
+
nextSteps: [
|
|
7349
|
+
"Run `vela dev` and visit /shop.",
|
|
7350
|
+
...NEXT_STEPS[provider.id],
|
|
7351
|
+
"The pages are yours to edit; `vela destroy shop` removes them."
|
|
7352
|
+
],
|
|
7353
|
+
task: {
|
|
7354
|
+
title: "Generating the shop",
|
|
7355
|
+
success: "Generated the shop",
|
|
7356
|
+
error: "Failed to generate the shop"
|
|
7357
|
+
}
|
|
7358
|
+
}
|
|
7359
|
+
);
|
|
7360
|
+
}, "Failed to generate the shop.")
|
|
7361
|
+
);
|
|
7362
|
+
var NEXT_STEPS = {
|
|
7363
|
+
stripe: [
|
|
7364
|
+
"Products and prices come from your Stripe dashboard; the catalog syncs every ten minutes. Set `metadata.slug` on a product for a readable URL."
|
|
7365
|
+
],
|
|
7366
|
+
shopify: [
|
|
7367
|
+
"Products live in Shopify admin; publish them to the Headless channel the Storefront token belongs to."
|
|
7368
|
+
],
|
|
7369
|
+
whatsapp: [
|
|
7370
|
+
"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."
|
|
7371
|
+
]
|
|
7372
|
+
};
|
|
7373
|
+
|
|
7299
7374
|
// src/commands/generate.ts
|
|
7300
|
-
var generate = new
|
|
7375
|
+
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
7376
|
|
|
7302
7377
|
// src/commands/enable.ts
|
|
7303
|
-
import { Command as
|
|
7378
|
+
import { Command as Command29 } from "commander";
|
|
7304
7379
|
|
|
7305
7380
|
// src/commands/enable/ai.ts
|
|
7306
|
-
import { Command as
|
|
7307
|
-
var ai = new
|
|
7381
|
+
import { Command as Command12 } from "commander";
|
|
7382
|
+
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
7383
|
(opts, cmd) => runCommand(async () => {
|
|
7309
7384
|
const provider = await resolveProvider("enable-ai", opts.provider);
|
|
7310
7385
|
const providerEnv = await collectProviderEnv(provider);
|
|
@@ -7336,8 +7411,8 @@ var ai = new Command11("ai").description("enable AI chat with the Vercel AI SDK
|
|
|
7336
7411
|
);
|
|
7337
7412
|
|
|
7338
7413
|
// src/commands/enable/analytics.ts
|
|
7339
|
-
import { Command as
|
|
7340
|
-
var analytics = new
|
|
7414
|
+
import { Command as Command13 } from "commander";
|
|
7415
|
+
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
7416
|
(opts, cmd) => runCommand(async () => {
|
|
7342
7417
|
const provider = await resolveProvider("enable-analytics", opts.provider);
|
|
7343
7418
|
const providerEnv = await collectProviderEnv(provider);
|
|
@@ -7367,8 +7442,8 @@ var analytics = new Command12("analytics").description("enable web analytics (Pl
|
|
|
7367
7442
|
);
|
|
7368
7443
|
|
|
7369
7444
|
// src/commands/enable/auth.ts
|
|
7370
|
-
import { Command as
|
|
7371
|
-
var auth = new
|
|
7445
|
+
import { Command as Command14 } from "commander";
|
|
7446
|
+
var auth = new Command14("auth").description("enable authentication (email/password + OAuth scaffold)").option(
|
|
7372
7447
|
"--remote",
|
|
7373
7448
|
"generate the auth forms with SvelteKit remote functions instead of form actions and superforms"
|
|
7374
7449
|
).allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
@@ -7400,8 +7475,8 @@ var auth = new Command13("auth").description("enable authentication (email/passw
|
|
|
7400
7475
|
);
|
|
7401
7476
|
|
|
7402
7477
|
// src/commands/enable/api.ts
|
|
7403
|
-
import { Command as
|
|
7404
|
-
var api = new
|
|
7478
|
+
import { Command as Command15 } from "commander";
|
|
7479
|
+
var api = new Command15("api").description("enable the PocketBase REST API").allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
7405
7480
|
(_opts, cmd) => runCommand(
|
|
7406
7481
|
() => runPattern(
|
|
7407
7482
|
"enable-api",
|
|
@@ -7426,8 +7501,8 @@ var api = new Command14("api").description("enable the PocketBase REST API").all
|
|
|
7426
7501
|
);
|
|
7427
7502
|
|
|
7428
7503
|
// src/commands/enable/api-keys.ts
|
|
7429
|
-
import { Command as
|
|
7430
|
-
var apiKeys = new
|
|
7504
|
+
import { Command as Command16 } from "commander";
|
|
7505
|
+
var apiKeys = new Command16("api-keys").description("enable API key management").allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
7431
7506
|
(_opts, cmd) => runCommand(
|
|
7432
7507
|
() => runPattern(
|
|
7433
7508
|
"enable-api-keys",
|
|
@@ -7454,14 +7529,14 @@ var apiKeys = new Command15("api-keys").description("enable API key management")
|
|
|
7454
7529
|
// src/commands/enable/backend.ts
|
|
7455
7530
|
import process18 from "node:process";
|
|
7456
7531
|
import * as v6 from "valibot";
|
|
7457
|
-
import { Command as
|
|
7532
|
+
import { Command as Command17 } from "commander";
|
|
7458
7533
|
import * as p20 from "@clack/prompts";
|
|
7459
7534
|
import pc7 from "picocolors";
|
|
7460
7535
|
var optionsSchema3 = v6.strictObject({
|
|
7461
7536
|
email: emailFlag,
|
|
7462
7537
|
password: passwordFlag
|
|
7463
7538
|
});
|
|
7464
|
-
var backend = new
|
|
7539
|
+
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
7540
|
(rawOpts, cmd) => runCommand(async () => {
|
|
7466
7541
|
const options = parseOptions(optionsSchema3, rawOpts);
|
|
7467
7542
|
const { workspaceRootDir, features } = await getWorkspace();
|
|
@@ -7532,8 +7607,8 @@ async function resolveCredentials(options) {
|
|
|
7532
7607
|
}
|
|
7533
7608
|
|
|
7534
7609
|
// src/commands/enable/i18n.ts
|
|
7535
|
-
import { Command as
|
|
7536
|
-
var i18n = new
|
|
7610
|
+
import { Command as Command18 } from "commander";
|
|
7611
|
+
var i18n = new Command18("i18n").description("enable internationalization").allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
7537
7612
|
(_opts, cmd) => runCommand(
|
|
7538
7613
|
() => runPattern(
|
|
7539
7614
|
"enable-i18n",
|
|
@@ -7558,8 +7633,8 @@ var i18n = new Command17("i18n").description("enable internationalization").allo
|
|
|
7558
7633
|
);
|
|
7559
7634
|
|
|
7560
7635
|
// src/commands/enable/teams.ts
|
|
7561
|
-
import { Command as
|
|
7562
|
-
var teams = new
|
|
7636
|
+
import { Command as Command19 } from "commander";
|
|
7637
|
+
var teams = new Command19("teams").description("enable team / multi-tenant support").allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
7563
7638
|
(_opts, cmd) => runCommand(
|
|
7564
7639
|
() => runPattern(
|
|
7565
7640
|
"enable-teams",
|
|
@@ -7587,7 +7662,7 @@ var teams = new Command18("teams").description("enable team / multi-tenant suppo
|
|
|
7587
7662
|
import fs35 from "node:fs";
|
|
7588
7663
|
import path35 from "node:path";
|
|
7589
7664
|
import process19 from "node:process";
|
|
7590
|
-
import { Command as
|
|
7665
|
+
import { Command as Command20 } from "commander";
|
|
7591
7666
|
import * as p21 from "@clack/prompts";
|
|
7592
7667
|
|
|
7593
7668
|
// src/lib/order-form.ts
|
|
@@ -7647,7 +7722,7 @@ async function ensureOrderForm(root, deps = { readApiKey, createForms: createPro
|
|
|
7647
7722
|
}
|
|
7648
7723
|
|
|
7649
7724
|
// src/commands/enable/payments.ts
|
|
7650
|
-
var payments = new
|
|
7725
|
+
var payments = new Command20("payments").description("enable payments (Stripe, Shopify or WhatsApp)").option("--provider <provider>", "payment provider: stripe, shopify or whatsapp").option(
|
|
7651
7726
|
"--currency <code>",
|
|
7652
7727
|
"WhatsApp: the business's currency, an ISO 4217 code such as MXN (kept in src/lib/site.ts)"
|
|
7653
7728
|
).allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
@@ -7672,7 +7747,7 @@ var payments = new Command19("payments").description("enable payments (Stripe, S
|
|
|
7672
7747
|
nextSteps: [
|
|
7673
7748
|
...blank.map((key) => `Set ${key} in .env.`),
|
|
7674
7749
|
...orderForm,
|
|
7675
|
-
...
|
|
7750
|
+
...NEXT_STEPS2[provider.id],
|
|
7676
7751
|
"Set the same variables on each deploy target with `vela env set`."
|
|
7677
7752
|
],
|
|
7678
7753
|
task: {
|
|
@@ -7684,7 +7759,7 @@ var payments = new Command19("payments").description("enable payments (Stripe, S
|
|
|
7684
7759
|
);
|
|
7685
7760
|
}, "Failed to enable payments.")
|
|
7686
7761
|
);
|
|
7687
|
-
var
|
|
7762
|
+
var NEXT_STEPS2 = {
|
|
7688
7763
|
stripe: [
|
|
7689
7764
|
"Forward Stripe webhooks locally with `stripe listen --forward-to localhost:5173/webhooks/stripe`.",
|
|
7690
7765
|
"Run `vela dev` and visit /payment to run through the checkout flow.",
|
|
@@ -7762,25 +7837,29 @@ async function askDemoId(provider) {
|
|
|
7762
7837
|
}
|
|
7763
7838
|
|
|
7764
7839
|
// 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(
|
|
7840
|
+
import { Command as Command21 } from "commander";
|
|
7841
|
+
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
7842
|
(opts, cmd) => runCommand(async () => {
|
|
7770
|
-
const { detected } = await detectWorkspace();
|
|
7843
|
+
const { detected, features } = await detectWorkspace();
|
|
7844
|
+
if (features.ecommerce) {
|
|
7845
|
+
throw new Error(
|
|
7846
|
+
[
|
|
7847
|
+
"This project already has a cart (src/lib/cart.svelte.ts). Nothing was changed.",
|
|
7848
|
+
"To start over, run `vela disable ecommerce` first, then this again."
|
|
7849
|
+
].join("\n")
|
|
7850
|
+
);
|
|
7851
|
+
}
|
|
7771
7852
|
const provider = await resolveProvider("enable-ecommerce", opts.provider, detected.providers);
|
|
7772
7853
|
await assertPatternRequires("enable-ecommerce", provider.id);
|
|
7773
|
-
const demoId = provider.id === "whatsapp" ? "" : await askDemoId2(provider);
|
|
7774
7854
|
await runPattern(
|
|
7775
7855
|
"enable-ecommerce",
|
|
7776
7856
|
cmd.args,
|
|
7777
|
-
{ provider: provider.id
|
|
7857
|
+
{ provider: provider.id },
|
|
7778
7858
|
{
|
|
7779
7859
|
summary: `Enabled a ${provider.label} cart.`,
|
|
7780
7860
|
nextSteps: [
|
|
7781
|
-
|
|
7782
|
-
|
|
7783
|
-
...NEXT_STEPS2[provider.id]
|
|
7861
|
+
"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.",
|
|
7862
|
+
...NEXT_STEPS3[provider.id]
|
|
7784
7863
|
],
|
|
7785
7864
|
task: {
|
|
7786
7865
|
title: "Enabling ecommerce",
|
|
@@ -7791,7 +7870,7 @@ var ecommerce = new Command20("ecommerce").description("enable a cart and checko
|
|
|
7791
7870
|
);
|
|
7792
7871
|
}, "Failed to enable ecommerce.")
|
|
7793
7872
|
);
|
|
7794
|
-
var
|
|
7873
|
+
var NEXT_STEPS3 = {
|
|
7795
7874
|
stripe: [
|
|
7796
7875
|
"Checkout is Stripe Checkout: payment methods, tax and shipping are set in the Stripe dashboard."
|
|
7797
7876
|
],
|
|
@@ -7801,22 +7880,10 @@ var NEXT_STEPS2 = {
|
|
|
7801
7880
|
"Checkout opens WhatsApp with the order; the business confirms it and takes payment in the chat."
|
|
7802
7881
|
]
|
|
7803
7882
|
};
|
|
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
7883
|
|
|
7817
7884
|
// src/commands/enable/subscriptions.ts
|
|
7818
|
-
import { Command as
|
|
7819
|
-
var subscriptions = new
|
|
7885
|
+
import { Command as Command22 } from "commander";
|
|
7886
|
+
var subscriptions = new Command22("subscriptions").description("enable Stripe subscriptions (requires auth and Stripe payments)").allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
7820
7887
|
(_opts, cmd) => runCommand(
|
|
7821
7888
|
() => runPattern(
|
|
7822
7889
|
"enable-subscriptions",
|
|
@@ -7841,8 +7908,8 @@ var subscriptions = new Command21("subscriptions").description("enable Stripe su
|
|
|
7841
7908
|
);
|
|
7842
7909
|
|
|
7843
7910
|
// src/commands/enable/notifications.ts
|
|
7844
|
-
import { Command as
|
|
7845
|
-
var notifications = new
|
|
7911
|
+
import { Command as Command23 } from "commander";
|
|
7912
|
+
var notifications = new Command23("notifications").description("enable in-app notifications with a bell dropdown (requires auth)").allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
7846
7913
|
(_opts, cmd) => runCommand(
|
|
7847
7914
|
() => runPattern(
|
|
7848
7915
|
"enable-notifications",
|
|
@@ -7867,9 +7934,9 @@ var notifications = new Command22("notifications").description("enable in-app no
|
|
|
7867
7934
|
);
|
|
7868
7935
|
|
|
7869
7936
|
// src/commands/enable/cms.ts
|
|
7870
|
-
import
|
|
7871
|
-
import { Command as
|
|
7872
|
-
import * as
|
|
7937
|
+
import process20 from "node:process";
|
|
7938
|
+
import { Command as Command24 } from "commander";
|
|
7939
|
+
import * as p22 from "@clack/prompts";
|
|
7873
7940
|
import pc8 from "picocolors";
|
|
7874
7941
|
function resolveCmsBackend(facts) {
|
|
7875
7942
|
if (facts.endpoint) return { kind: "hosted", endpoint: facts.endpoint, from: "flag" };
|
|
@@ -7886,12 +7953,12 @@ function adapterOf(root) {
|
|
|
7886
7953
|
return "none";
|
|
7887
7954
|
}
|
|
7888
7955
|
}
|
|
7889
|
-
var cms = new
|
|
7956
|
+
var cms = new Command24("cms").description("enable an inline-editing CMS with an admin bar").option(
|
|
7890
7957
|
"--endpoint <url>",
|
|
7891
7958
|
"read from a hosted CMS at this URL instead of installing the backend in this app"
|
|
7892
7959
|
).allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
7893
7960
|
(opts, cmd) => runCommand(async () => {
|
|
7894
|
-
const root = findWorkspaceRoot() ??
|
|
7961
|
+
const root = findWorkspaceRoot() ?? process20.cwd();
|
|
7895
7962
|
assertKit3(root, "vela enable cms");
|
|
7896
7963
|
const backend3 = resolveCmsBackend({
|
|
7897
7964
|
endpoint: opts.endpoint,
|
|
@@ -7900,7 +7967,7 @@ var cms = new Command23("cms").description("enable an inline-editing CMS with an
|
|
|
7900
7967
|
projectId: readProjectConfig(root)?.projectId
|
|
7901
7968
|
});
|
|
7902
7969
|
if (backend3.kind === "none") {
|
|
7903
|
-
|
|
7970
|
+
p22.log.error(
|
|
7904
7971
|
`${pc8.cyan("vela enable cms")} needs somewhere to run the CMS backend, and this project has no Node server.
|
|
7905
7972
|
|
|
7906
7973
|
Any one of these gives it one:
|
|
@@ -7908,14 +7975,14 @@ Any one of these gives it one:
|
|
|
7908
7975
|
- ${pc8.cyan("vela enable cms --endpoint <url>")} to point at a hosted CMS yourself.
|
|
7909
7976
|
- ${pc8.cyan("vela enable backend")}, or switching to @sveltejs/adapter-node, to host it in this app.`
|
|
7910
7977
|
);
|
|
7911
|
-
|
|
7912
|
-
|
|
7913
|
-
|
|
7978
|
+
p22.log.message();
|
|
7979
|
+
p22.cancel("Operation failed.");
|
|
7980
|
+
process20.exitCode = 1;
|
|
7914
7981
|
return;
|
|
7915
7982
|
}
|
|
7916
7983
|
const hosted = backend3.kind === "hosted";
|
|
7917
7984
|
if (hosted && backend3.from === "link") {
|
|
7918
|
-
|
|
7985
|
+
p22.log.info(`Using the hosted CMS of the linked project (${pc8.cyan(backend3.endpoint)}).`);
|
|
7919
7986
|
}
|
|
7920
7987
|
const input = hosted ? { endpoint: backend3.endpoint } : { server: true };
|
|
7921
7988
|
await runPattern("enable-cms", cmd.args, input, {
|
|
@@ -7935,8 +8002,8 @@ Any one of these gives it one:
|
|
|
7935
8002
|
);
|
|
7936
8003
|
|
|
7937
8004
|
// src/commands/enable/blog.ts
|
|
7938
|
-
import { Command as
|
|
7939
|
-
var blog = new
|
|
8005
|
+
import { Command as Command25 } from "commander";
|
|
8006
|
+
var blog = new Command25("blog").description("enable an mdsvex blog with posts, tags, and RSS").allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
7940
8007
|
(_opts, cmd) => runCommand(
|
|
7941
8008
|
() => runPattern(
|
|
7942
8009
|
"enable-blog",
|
|
@@ -7961,16 +8028,16 @@ var blog = new Command24("blog").description("enable an mdsvex blog with posts,
|
|
|
7961
8028
|
);
|
|
7962
8029
|
|
|
7963
8030
|
// src/commands/enable/content-negotiation.ts
|
|
7964
|
-
import
|
|
7965
|
-
import { Command as
|
|
7966
|
-
var contentNegotiation = new
|
|
8031
|
+
import process21 from "node:process";
|
|
8032
|
+
import { Command as Command26 } from "commander";
|
|
8033
|
+
var contentNegotiation = new Command26("content-negotiation").description("enable content negotiation (sveltekit-negotiate)").allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
7967
8034
|
(_opts, cmd) => runCommand(
|
|
7968
8035
|
() => runPattern(
|
|
7969
8036
|
"enable-content-negotiation",
|
|
7970
8037
|
cmd.args,
|
|
7971
8038
|
// The demo page's loader imports `svelte-meta-tags`, which vela's
|
|
7972
8039
|
// templates carry and a project vela did not create may not.
|
|
7973
|
-
{ metaTags: hasDependency(findWorkspaceRoot() ??
|
|
8040
|
+
{ metaTags: hasDependency(findWorkspaceRoot() ?? process21.cwd(), "svelte-meta-tags") },
|
|
7974
8041
|
{
|
|
7975
8042
|
summary: "Enabled content negotiation.",
|
|
7976
8043
|
nextSteps: [
|
|
@@ -7989,8 +8056,8 @@ var contentNegotiation = new Command25("content-negotiation").description("enabl
|
|
|
7989
8056
|
);
|
|
7990
8057
|
|
|
7991
8058
|
// src/commands/enable/workflows.ts
|
|
7992
|
-
import { Command as
|
|
7993
|
-
var workflows = new
|
|
8059
|
+
import { Command as Command27 } from "commander";
|
|
8060
|
+
var workflows = new Command27("workflows").description("add background workflows to a project created before they were built in").allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
7994
8061
|
(_opts, cmd) => runCommand(
|
|
7995
8062
|
() => runPattern(
|
|
7996
8063
|
"enable-workflows",
|
|
@@ -8015,8 +8082,8 @@ var workflows = new Command26("workflows").description("add background workflows
|
|
|
8015
8082
|
);
|
|
8016
8083
|
|
|
8017
8084
|
// src/commands/enable/whatsapp.ts
|
|
8018
|
-
import { Command as
|
|
8019
|
-
var whatsapp = new
|
|
8085
|
+
import { Command as Command28 } from "commander";
|
|
8086
|
+
var whatsapp = new Command28("whatsapp").description("enable WhatsApp sign-in on the login and signup pages (requires auth)").allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
8020
8087
|
(_opts, cmd) => runCommand(
|
|
8021
8088
|
() => runPattern(
|
|
8022
8089
|
"enable-whatsapp",
|
|
@@ -8041,33 +8108,33 @@ var whatsapp = new Command27("whatsapp").description("enable WhatsApp sign-in on
|
|
|
8041
8108
|
);
|
|
8042
8109
|
|
|
8043
8110
|
// src/commands/enable.ts
|
|
8044
|
-
var enable = new
|
|
8111
|
+
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
8112
|
|
|
8046
8113
|
// src/commands/disable.ts
|
|
8047
|
-
import { Command as
|
|
8114
|
+
import { Command as Command44 } from "commander";
|
|
8048
8115
|
|
|
8049
8116
|
// src/commands/disable/ai.ts
|
|
8050
|
-
import { Command as
|
|
8117
|
+
import { Command as Command30 } from "commander";
|
|
8051
8118
|
|
|
8052
8119
|
// src/commands/disable/_shared.ts
|
|
8053
|
-
import
|
|
8054
|
-
import * as
|
|
8120
|
+
import process22 from "node:process";
|
|
8121
|
+
import * as p23 from "@clack/prompts";
|
|
8055
8122
|
async function runDisable(opts, flags, cmdArgs) {
|
|
8056
8123
|
if (!flags.yes) {
|
|
8057
|
-
const ok = await
|
|
8124
|
+
const ok = await p23.confirm({
|
|
8058
8125
|
message: opts.confirmMessage,
|
|
8059
8126
|
initialValue: false
|
|
8060
8127
|
});
|
|
8061
|
-
if (
|
|
8062
|
-
|
|
8063
|
-
|
|
8128
|
+
if (p23.isCancel(ok) || !ok) {
|
|
8129
|
+
p23.cancel("Operation cancelled.");
|
|
8130
|
+
process22.exit(0);
|
|
8064
8131
|
}
|
|
8065
8132
|
}
|
|
8066
8133
|
await runPattern(opts.slug, cmdArgs, { destructive: true }, opts.report);
|
|
8067
8134
|
}
|
|
8068
8135
|
|
|
8069
8136
|
// src/commands/disable/ai.ts
|
|
8070
|
-
var ai2 = new
|
|
8137
|
+
var ai2 = new Command30("ai").description("disable AI chat").option("-y, --yes", "skip confirmation prompt").allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
8071
8138
|
(opts, cmd) => runCommand(
|
|
8072
8139
|
() => runDisable(
|
|
8073
8140
|
{
|
|
@@ -8093,8 +8160,8 @@ var ai2 = new Command29("ai").description("disable AI chat").option("-y, --yes",
|
|
|
8093
8160
|
);
|
|
8094
8161
|
|
|
8095
8162
|
// src/commands/disable/analytics.ts
|
|
8096
|
-
import { Command as
|
|
8097
|
-
var analytics2 = new
|
|
8163
|
+
import { Command as Command31 } from "commander";
|
|
8164
|
+
var analytics2 = new Command31("analytics").description("disable web analytics").option("-y, --yes", "skip confirmation prompt").allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
8098
8165
|
(opts, cmd) => runCommand(
|
|
8099
8166
|
() => runDisable(
|
|
8100
8167
|
{
|
|
@@ -8120,8 +8187,8 @@ var analytics2 = new Command30("analytics").description("disable web analytics")
|
|
|
8120
8187
|
);
|
|
8121
8188
|
|
|
8122
8189
|
// src/commands/disable/auth.ts
|
|
8123
|
-
import { Command as
|
|
8124
|
-
var auth2 = new
|
|
8190
|
+
import { Command as Command32 } from "commander";
|
|
8191
|
+
var auth2 = new Command32("auth").description("disable authentication").option("-y, --yes", "skip confirmation prompt").allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
8125
8192
|
(opts, cmd) => runCommand(
|
|
8126
8193
|
() => runDisable(
|
|
8127
8194
|
{
|
|
@@ -8147,8 +8214,8 @@ var auth2 = new Command31("auth").description("disable authentication").option("
|
|
|
8147
8214
|
);
|
|
8148
8215
|
|
|
8149
8216
|
// src/commands/disable/api.ts
|
|
8150
|
-
import { Command as
|
|
8151
|
-
var api2 = new
|
|
8217
|
+
import { Command as Command33 } from "commander";
|
|
8218
|
+
var api2 = new Command33("api").description("disable the REST API").option("-y, --yes", "skip confirmation prompt").allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
8152
8219
|
(opts, cmd) => runCommand(
|
|
8153
8220
|
() => runDisable(
|
|
8154
8221
|
{
|
|
@@ -8171,8 +8238,8 @@ var api2 = new Command32("api").description("disable the REST API").option("-y,
|
|
|
8171
8238
|
);
|
|
8172
8239
|
|
|
8173
8240
|
// src/commands/disable/api-keys.ts
|
|
8174
|
-
import { Command as
|
|
8175
|
-
var apiKeys2 = new
|
|
8241
|
+
import { Command as Command34 } from "commander";
|
|
8242
|
+
var apiKeys2 = new Command34("api-keys").description("disable API key management").option("-y, --yes", "skip confirmation prompt").allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
8176
8243
|
(opts, cmd) => runCommand(
|
|
8177
8244
|
() => runDisable(
|
|
8178
8245
|
{
|
|
@@ -8195,8 +8262,8 @@ var apiKeys2 = new Command33("api-keys").description("disable API key management
|
|
|
8195
8262
|
);
|
|
8196
8263
|
|
|
8197
8264
|
// src/commands/disable/backend.ts
|
|
8198
|
-
import { Command as
|
|
8199
|
-
var backend2 = new
|
|
8265
|
+
import { Command as Command35 } from "commander";
|
|
8266
|
+
var backend2 = new Command35("backend").description("disable the PocketBase backend").option("-y, --yes", "skip confirmation prompt").allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
8200
8267
|
(opts, cmd) => runCommand(
|
|
8201
8268
|
() => runDisable(
|
|
8202
8269
|
{
|
|
@@ -8219,8 +8286,8 @@ var backend2 = new Command34("backend").description("disable the PocketBase back
|
|
|
8219
8286
|
);
|
|
8220
8287
|
|
|
8221
8288
|
// src/commands/disable/content-negotiation.ts
|
|
8222
|
-
import { Command as
|
|
8223
|
-
var contentNegotiation2 = new
|
|
8289
|
+
import { Command as Command36 } from "commander";
|
|
8290
|
+
var contentNegotiation2 = new Command36("content-negotiation").description("disable content negotiation").option("-y, --yes", "skip confirmation prompt").allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
8224
8291
|
(opts, cmd) => runCommand(
|
|
8225
8292
|
() => runDisable(
|
|
8226
8293
|
{
|
|
@@ -8243,8 +8310,8 @@ var contentNegotiation2 = new Command35("content-negotiation").description("disa
|
|
|
8243
8310
|
);
|
|
8244
8311
|
|
|
8245
8312
|
// src/commands/disable/i18n.ts
|
|
8246
|
-
import { Command as
|
|
8247
|
-
var i18n2 = new
|
|
8313
|
+
import { Command as Command37 } from "commander";
|
|
8314
|
+
var i18n2 = new Command37("i18n").description("disable internationalization").option("-y, --yes", "skip confirmation prompt").allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
8248
8315
|
(opts, cmd) => runCommand(
|
|
8249
8316
|
() => runDisable(
|
|
8250
8317
|
{
|
|
@@ -8268,8 +8335,8 @@ var i18n2 = new Command36("i18n").description("disable internationalization").op
|
|
|
8268
8335
|
);
|
|
8269
8336
|
|
|
8270
8337
|
// src/commands/disable/notifications.ts
|
|
8271
|
-
import { Command as
|
|
8272
|
-
var notifications2 = new
|
|
8338
|
+
import { Command as Command38 } from "commander";
|
|
8339
|
+
var notifications2 = new Command38("notifications").description("disable in-app notifications").option("-y, --yes", "skip confirmation prompt").allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
8273
8340
|
(opts, cmd) => runCommand(
|
|
8274
8341
|
() => runDisable(
|
|
8275
8342
|
{
|
|
@@ -8295,8 +8362,8 @@ var notifications2 = new Command37("notifications").description("disable in-app
|
|
|
8295
8362
|
);
|
|
8296
8363
|
|
|
8297
8364
|
// src/commands/disable/teams.ts
|
|
8298
|
-
import { Command as
|
|
8299
|
-
var teams2 = new
|
|
8365
|
+
import { Command as Command39 } from "commander";
|
|
8366
|
+
var teams2 = new Command39("teams").description("disable teams").option("-y, --yes", "skip confirmation prompt").allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
8300
8367
|
(opts, cmd) => runCommand(
|
|
8301
8368
|
() => runDisable(
|
|
8302
8369
|
{
|
|
@@ -8319,7 +8386,7 @@ var teams2 = new Command38("teams").description("disable teams").option("-y, --y
|
|
|
8319
8386
|
);
|
|
8320
8387
|
|
|
8321
8388
|
// src/commands/disable/payments.ts
|
|
8322
|
-
import { Command as
|
|
8389
|
+
import { Command as Command40 } from "commander";
|
|
8323
8390
|
var STRIPE = {
|
|
8324
8391
|
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
8392
|
nextSteps: [
|
|
@@ -8341,7 +8408,7 @@ var WHATSAPP = {
|
|
|
8341
8408
|
]
|
|
8342
8409
|
};
|
|
8343
8410
|
var COPY = { shopify: SHOPIFY, whatsapp: WHATSAPP };
|
|
8344
|
-
var payments2 = new
|
|
8411
|
+
var payments2 = new Command40("payments").description("disable payments").option("-y, --yes", "skip confirmation prompt").allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
8345
8412
|
(opts, cmd) => runCommand(async () => {
|
|
8346
8413
|
const { detected } = await detectWorkspace();
|
|
8347
8414
|
const provider = detected.providers.payments;
|
|
@@ -8370,8 +8437,8 @@ var payments2 = new Command39("payments").description("disable payments").option
|
|
|
8370
8437
|
);
|
|
8371
8438
|
|
|
8372
8439
|
// src/commands/disable/ecommerce.ts
|
|
8373
|
-
import { Command as
|
|
8374
|
-
var ecommerce2 = new
|
|
8440
|
+
import { Command as Command41 } from "commander";
|
|
8441
|
+
var ecommerce2 = new Command41("ecommerce").description("disable ecommerce").option("-y, --yes", "skip confirmation prompt").allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
8375
8442
|
(opts, cmd) => runCommand(
|
|
8376
8443
|
() => runDisable(
|
|
8377
8444
|
{
|
|
@@ -8398,8 +8465,8 @@ var ecommerce2 = new Command40("ecommerce").description("disable ecommerce").opt
|
|
|
8398
8465
|
);
|
|
8399
8466
|
|
|
8400
8467
|
// src/commands/disable/subscriptions.ts
|
|
8401
|
-
import { Command as
|
|
8402
|
-
var subscriptions2 = new
|
|
8468
|
+
import { Command as Command42 } from "commander";
|
|
8469
|
+
var subscriptions2 = new Command42("subscriptions").description("disable Stripe subscriptions").option("-y, --yes", "skip confirmation prompt").allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
8403
8470
|
(opts, cmd) => runCommand(
|
|
8404
8471
|
() => runDisable(
|
|
8405
8472
|
{
|
|
@@ -8426,8 +8493,8 @@ var subscriptions2 = new Command41("subscriptions").description("disable Stripe
|
|
|
8426
8493
|
);
|
|
8427
8494
|
|
|
8428
8495
|
// src/commands/disable/whatsapp.ts
|
|
8429
|
-
import { Command as
|
|
8430
|
-
var whatsapp2 = new
|
|
8496
|
+
import { Command as Command43 } from "commander";
|
|
8497
|
+
var whatsapp2 = new Command43("whatsapp").description("disable WhatsApp sign-in").option("-y, --yes", "skip confirmation prompt").allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
8431
8498
|
(opts, cmd) => runCommand(
|
|
8432
8499
|
() => runDisable(
|
|
8433
8500
|
{
|
|
@@ -8455,30 +8522,30 @@ var whatsapp2 = new Command42("whatsapp").description("disable WhatsApp sign-in"
|
|
|
8455
8522
|
);
|
|
8456
8523
|
|
|
8457
8524
|
// src/commands/disable.ts
|
|
8458
|
-
var disable = new
|
|
8525
|
+
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
8526
|
|
|
8460
8527
|
// src/commands/destroy.ts
|
|
8461
|
-
import { Command as
|
|
8528
|
+
import { Command as Command51 } from "commander";
|
|
8462
8529
|
|
|
8463
8530
|
// src/commands/destroy/form.ts
|
|
8464
|
-
import { Command as
|
|
8531
|
+
import { Command as Command45 } from "commander";
|
|
8465
8532
|
|
|
8466
8533
|
// src/commands/destroy/_shared.ts
|
|
8467
|
-
import
|
|
8468
|
-
import * as
|
|
8534
|
+
import process23 from "node:process";
|
|
8535
|
+
import * as p24 from "@clack/prompts";
|
|
8469
8536
|
async function runDestroy(slug2, model, confirmMessage, report5, flags) {
|
|
8470
8537
|
if (!flags.yes) {
|
|
8471
|
-
const ok = await
|
|
8472
|
-
if (
|
|
8473
|
-
|
|
8474
|
-
|
|
8538
|
+
const ok = await p24.confirm({ message: confirmMessage, initialValue: false });
|
|
8539
|
+
if (p24.isCancel(ok) || !ok) {
|
|
8540
|
+
p24.cancel("Operation cancelled.");
|
|
8541
|
+
process23.exit(0);
|
|
8475
8542
|
}
|
|
8476
8543
|
}
|
|
8477
8544
|
await runPattern(slug2, [model], { destructive: true, route: flags.route }, report5);
|
|
8478
8545
|
}
|
|
8479
8546
|
|
|
8480
8547
|
// src/commands/destroy/form.ts
|
|
8481
|
-
var form2 = new
|
|
8548
|
+
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
8549
|
"--route <route>",
|
|
8483
8550
|
"custom route the form was generated at (must match the --route used at generation)"
|
|
8484
8551
|
).allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
@@ -8502,8 +8569,8 @@ var form2 = new Command44("form").description("destroy a form generated by `vela
|
|
|
8502
8569
|
);
|
|
8503
8570
|
|
|
8504
8571
|
// src/commands/destroy/schema.ts
|
|
8505
|
-
import { Command as
|
|
8506
|
-
var schema2 = new
|
|
8572
|
+
import { Command as Command46 } from "commander";
|
|
8573
|
+
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
8574
|
(model, opts) => runCommand(
|
|
8508
8575
|
() => runDestroy(
|
|
8509
8576
|
"destroy-schema",
|
|
@@ -8524,8 +8591,8 @@ var schema2 = new Command45("schema").description("destroy a zod schema generate
|
|
|
8524
8591
|
);
|
|
8525
8592
|
|
|
8526
8593
|
// src/commands/destroy/resource.ts
|
|
8527
|
-
import { Command as
|
|
8528
|
-
var resource2 = new
|
|
8594
|
+
import { Command as Command47 } from "commander";
|
|
8595
|
+
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
8596
|
(model, opts) => runCommand(
|
|
8530
8597
|
() => runDestroy(
|
|
8531
8598
|
"destroy-resource",
|
|
@@ -8546,8 +8613,8 @@ var resource2 = new Command46("resource").description("destroy a resource genera
|
|
|
8546
8613
|
);
|
|
8547
8614
|
|
|
8548
8615
|
// src/commands/destroy/scaffold.ts
|
|
8549
|
-
import { Command as
|
|
8550
|
-
var scaffold2 = new
|
|
8616
|
+
import { Command as Command48 } from "commander";
|
|
8617
|
+
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
8618
|
"--route <route>",
|
|
8552
8619
|
"custom route the scaffold was generated at (must match the --route used at generation)"
|
|
8553
8620
|
).allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
@@ -8574,15 +8641,15 @@ var scaffold2 = new Command47("scaffold").description("destroy a scaffold genera
|
|
|
8574
8641
|
);
|
|
8575
8642
|
|
|
8576
8643
|
// src/commands/destroy/deployment.ts
|
|
8577
|
-
import
|
|
8578
|
-
import { Command as
|
|
8579
|
-
import * as
|
|
8644
|
+
import process27 from "node:process";
|
|
8645
|
+
import { Command as Command49 } from "commander";
|
|
8646
|
+
import * as p28 from "@clack/prompts";
|
|
8580
8647
|
import pc12 from "picocolors";
|
|
8581
8648
|
|
|
8582
8649
|
// src/lib/server-command.ts
|
|
8583
|
-
import
|
|
8650
|
+
import process26 from "node:process";
|
|
8584
8651
|
import * as v8 from "valibot";
|
|
8585
|
-
import * as
|
|
8652
|
+
import * as p25 from "@clack/prompts";
|
|
8586
8653
|
import pc9 from "picocolors";
|
|
8587
8654
|
|
|
8588
8655
|
// src/lib/deploy-config.ts
|
|
@@ -8714,7 +8781,7 @@ import fs37 from "node:fs";
|
|
|
8714
8781
|
import os5 from "node:os";
|
|
8715
8782
|
import path37 from "node:path";
|
|
8716
8783
|
import crypto4 from "node:crypto";
|
|
8717
|
-
import
|
|
8784
|
+
import process24 from "node:process";
|
|
8718
8785
|
import { spawn as spawn4 } from "node:child_process";
|
|
8719
8786
|
var RemoteCommandError = class extends Error {
|
|
8720
8787
|
exitCode;
|
|
@@ -8992,17 +9059,17 @@ function spawnCapture(command, args, opts = {}) {
|
|
|
8992
9059
|
const child = spawn4(command, args, {
|
|
8993
9060
|
stdio,
|
|
8994
9061
|
cwd: opts.cwd,
|
|
8995
|
-
env: opts.env ? { ...
|
|
9062
|
+
env: opts.env ? { ...process24.env, ...opts.env } : void 0
|
|
8996
9063
|
});
|
|
8997
9064
|
let stdout = "";
|
|
8998
9065
|
let stderr = "";
|
|
8999
9066
|
child.stdout?.on("data", (chunk) => {
|
|
9000
9067
|
stdout += chunk;
|
|
9001
|
-
if (opts.streamStdout)
|
|
9068
|
+
if (opts.streamStdout) process24.stdout.write(chunk);
|
|
9002
9069
|
});
|
|
9003
9070
|
child.stderr?.on("data", (chunk) => {
|
|
9004
9071
|
stderr += chunk;
|
|
9005
|
-
if (opts.stream)
|
|
9072
|
+
if (opts.stream) process24.stderr.write(chunk);
|
|
9006
9073
|
});
|
|
9007
9074
|
child.on("error", reject);
|
|
9008
9075
|
child.on("close", (code2) => resolve2({ stdout, stderr, exitCode: code2 ?? 1 }));
|
|
@@ -9116,7 +9183,7 @@ function sshOptionsFrom(options) {
|
|
|
9116
9183
|
import crypto5 from "node:crypto";
|
|
9117
9184
|
import fs39 from "node:fs";
|
|
9118
9185
|
import path39 from "node:path";
|
|
9119
|
-
import
|
|
9186
|
+
import process25 from "node:process";
|
|
9120
9187
|
var VELA_ROOT = "/var/lib/vela";
|
|
9121
9188
|
var VELA_ETC = "/etc/vela";
|
|
9122
9189
|
var VELA_USER = "vela";
|
|
@@ -9153,7 +9220,7 @@ async function syncServerScripts(session) {
|
|
|
9153
9220
|
const dir = `${SCRIPT_VERSIONS_DIR}/${digest}`;
|
|
9154
9221
|
const present = await session.script(`[ -d "$1" ] && echo yes || echo no`, { args: [dir] });
|
|
9155
9222
|
if (present.stdout.trim() !== "yes") {
|
|
9156
|
-
const incoming = `${SCRIPT_VERSIONS_DIR}/.incoming.${digest}.${
|
|
9223
|
+
const incoming = `${SCRIPT_VERSIONS_DIR}/.incoming.${digest}.${process25.pid}.${Date.now()}`;
|
|
9157
9224
|
await session.script(`mkdir -p "$1" && chmod 0755 "$(dirname "$1")" "$1"`, {
|
|
9158
9225
|
args: [incoming]
|
|
9159
9226
|
});
|
|
@@ -9422,8 +9489,8 @@ function describeTarget(target) {
|
|
|
9422
9489
|
return target.name;
|
|
9423
9490
|
}
|
|
9424
9491
|
}
|
|
9425
|
-
function bold(
|
|
9426
|
-
return `\`${
|
|
9492
|
+
function bold(text18) {
|
|
9493
|
+
return `\`${text18}\``;
|
|
9427
9494
|
}
|
|
9428
9495
|
|
|
9429
9496
|
// src/lib/server-command.ts
|
|
@@ -9520,7 +9587,7 @@ async function ensureBinding(workspaceRootDir, target, request = {}) {
|
|
|
9520
9587
|
writeBinding(workspaceRootDir, key, binding);
|
|
9521
9588
|
}
|
|
9522
9589
|
if (moving) {
|
|
9523
|
-
|
|
9590
|
+
p25.log.warn(
|
|
9524
9591
|
`${pc9.cyan(bindingName(target))} now points at ${pc9.cyan(server)}.
|
|
9525
9592
|
|
|
9526
9593
|
Whatever is running on ${existing.server} is left there, and this project can no
|
|
@@ -9531,7 +9598,7 @@ longer reach it. Remove it there first if that was not intended.`
|
|
|
9531
9598
|
}
|
|
9532
9599
|
async function confirmMove(target, from, to) {
|
|
9533
9600
|
const name = bindingName(target);
|
|
9534
|
-
if (!
|
|
9601
|
+
if (!process26.stdout.isTTY || process26.env.CI) {
|
|
9535
9602
|
throw new Error(
|
|
9536
9603
|
`${pc9.cyan(`--server ${to}`)} does not match the server recorded for ${pc9.cyan(name)}, ${pc9.cyan(from)}.
|
|
9537
9604
|
|
|
@@ -9539,13 +9606,13 @@ Drop ${pc9.cyan("--server")} to use the recorded one, or move the binding on pur
|
|
|
9539
9606
|
this command once from a terminal (or editing .vela/project.json).`
|
|
9540
9607
|
);
|
|
9541
9608
|
}
|
|
9542
|
-
const ok = await
|
|
9609
|
+
const ok = await p25.confirm({
|
|
9543
9610
|
message: `${name} ${target.kind === "preview" ? "run" : "runs"} on ${from}. Point ${name} at ${to} instead?`,
|
|
9544
9611
|
initialValue: false
|
|
9545
9612
|
});
|
|
9546
|
-
if (
|
|
9547
|
-
|
|
9548
|
-
|
|
9613
|
+
if (p25.isCancel(ok) || !ok) {
|
|
9614
|
+
p25.cancel("Operation cancelled.");
|
|
9615
|
+
process26.exit(0);
|
|
9549
9616
|
}
|
|
9550
9617
|
}
|
|
9551
9618
|
function bindingName(target) {
|
|
@@ -9553,7 +9620,7 @@ function bindingName(target) {
|
|
|
9553
9620
|
}
|
|
9554
9621
|
async function promptServer(target) {
|
|
9555
9622
|
const name = bindingName(target);
|
|
9556
|
-
if (!
|
|
9623
|
+
if (!process26.stdout.isTTY || process26.env.CI) {
|
|
9557
9624
|
throw new Error(
|
|
9558
9625
|
`${name} ${target.kind === "preview" ? "are" : "is"} not bound to a server yet, and there is no terminal to ask on.
|
|
9559
9626
|
|
|
@@ -9561,29 +9628,29 @@ Pass ${pc9.cyan("--server user@host")}, or run the command once from your own ma
|
|
|
9561
9628
|
and commit ${pc9.cyan(".vela/project.json")}.`
|
|
9562
9629
|
);
|
|
9563
9630
|
}
|
|
9564
|
-
|
|
9631
|
+
p25.log.info(
|
|
9565
9632
|
`${pc9.cyan(name)} ${target.kind === "preview" ? "are" : "is"} not bound to a server yet.`
|
|
9566
9633
|
);
|
|
9567
|
-
const value = await
|
|
9634
|
+
const value = await p25.text({
|
|
9568
9635
|
message: `Which server should ${name} run on?`,
|
|
9569
9636
|
placeholder: "root@203.0.113.10",
|
|
9570
9637
|
validate: (input) => input?.trim() ? void 0 : "An ssh_config alias, or user@host"
|
|
9571
9638
|
});
|
|
9572
|
-
if (
|
|
9573
|
-
|
|
9574
|
-
|
|
9639
|
+
if (p25.isCancel(value)) {
|
|
9640
|
+
p25.cancel("Operation cancelled.");
|
|
9641
|
+
process26.exit(0);
|
|
9575
9642
|
}
|
|
9576
9643
|
return value.trim();
|
|
9577
9644
|
}
|
|
9578
9645
|
async function promptDomain(target) {
|
|
9579
|
-
if (!
|
|
9580
|
-
const value = await
|
|
9646
|
+
if (!process26.stdout.isTTY || process26.env.CI) return void 0;
|
|
9647
|
+
const value = await p25.text({
|
|
9581
9648
|
message: `Which hostname should ${target.name} be served on?`,
|
|
9582
9649
|
placeholder: "example.com \u2014 leave blank to decide later"
|
|
9583
9650
|
});
|
|
9584
|
-
if (
|
|
9585
|
-
|
|
9586
|
-
|
|
9651
|
+
if (p25.isCancel(value)) {
|
|
9652
|
+
p25.cancel("Operation cancelled.");
|
|
9653
|
+
process26.exit(0);
|
|
9587
9654
|
}
|
|
9588
9655
|
return value.trim() || void 0;
|
|
9589
9656
|
}
|
|
@@ -9591,10 +9658,10 @@ async function applyRestart(ctx) {
|
|
|
9591
9658
|
const outcome = await restartInstance(ctx.session, ctx.instance);
|
|
9592
9659
|
if (!outcome.deployed) return;
|
|
9593
9660
|
if (outcome.restarted) {
|
|
9594
|
-
|
|
9661
|
+
p25.log.success("App restarted");
|
|
9595
9662
|
return;
|
|
9596
9663
|
}
|
|
9597
|
-
|
|
9664
|
+
p25.log.error(
|
|
9598
9665
|
`App restart failed.
|
|
9599
9666
|
|
|
9600
9667
|
The new value is stored and will be used the next time the app starts.
|
|
@@ -9603,7 +9670,7 @@ ${pc9.dim(outcome.error ?? "")}`
|
|
|
9603
9670
|
}
|
|
9604
9671
|
async function applyEnvRestart(ctx, changed) {
|
|
9605
9672
|
if (touchesSuperuser(changed)) {
|
|
9606
|
-
|
|
9673
|
+
p25.log.warn(
|
|
9607
9674
|
`PocketBase superuser credentials changed.
|
|
9608
9675
|
|
|
9609
9676
|
The database still holds the old ones, so the app has not been restarted.
|
|
@@ -9640,14 +9707,14 @@ function isPreview(envTag) {
|
|
|
9640
9707
|
return envTag.startsWith("preview--");
|
|
9641
9708
|
}
|
|
9642
9709
|
function destroyDecision(request) {
|
|
9643
|
-
const { appName, purge, yes, confirm:
|
|
9710
|
+
const { appName, purge, yes, confirm: confirm15, interactive } = request;
|
|
9644
9711
|
const dangerous = isProd(request.envTag) || purge && !isPreview(request.envTag);
|
|
9645
9712
|
const what = describe(request);
|
|
9646
|
-
if (
|
|
9647
|
-
if (
|
|
9713
|
+
if (confirm15 !== void 0) {
|
|
9714
|
+
if (confirm15 === appName) return { kind: "proceed" };
|
|
9648
9715
|
return {
|
|
9649
9716
|
kind: "refuse",
|
|
9650
|
-
message: `\`--confirm ${
|
|
9717
|
+
message: `\`--confirm ${confirm15}\` does not name this app. Removing ${what} takes \`--confirm ${appName}\`.`
|
|
9651
9718
|
};
|
|
9652
9719
|
}
|
|
9653
9720
|
if (dangerous) {
|
|
@@ -9680,11 +9747,11 @@ function describe({ appName, envTag, purge }) {
|
|
|
9680
9747
|
}
|
|
9681
9748
|
|
|
9682
9749
|
// src/lib/deploy-report.ts
|
|
9683
|
-
import * as
|
|
9750
|
+
import * as p27 from "@clack/prompts";
|
|
9684
9751
|
import pc11 from "picocolors";
|
|
9685
9752
|
|
|
9686
9753
|
// src/lib/server-identity.ts
|
|
9687
|
-
import * as
|
|
9754
|
+
import * as p26 from "@clack/prompts";
|
|
9688
9755
|
import pc10 from "picocolors";
|
|
9689
9756
|
var IPV4 = /^\d{1,3}(?:\.\d{1,3}){3}$/;
|
|
9690
9757
|
async function ensureServerIdentity(session, apiKey) {
|
|
@@ -9698,7 +9765,7 @@ async function ensureServerIdentity(session, apiKey) {
|
|
|
9698
9765
|
if (!existing || existing.serverId !== registered.serverId || existing.originHost !== registered.originHost || existing.token !== registered.token) {
|
|
9699
9766
|
await writeServerIdentity(session, registered);
|
|
9700
9767
|
if (existing) {
|
|
9701
|
-
|
|
9768
|
+
p26.log.info(`${pc10.cyan(session.target)} was re-registered with velastack.dev.`);
|
|
9702
9769
|
}
|
|
9703
9770
|
}
|
|
9704
9771
|
await runServerScript(session, "origin.sh");
|
|
@@ -9738,7 +9805,7 @@ function createDeployReporter(workspaceRootDir) {
|
|
|
9738
9805
|
const link2 = readProjectConfig(workspaceRootDir);
|
|
9739
9806
|
const apiKey = link2 ? readApiKey() : null;
|
|
9740
9807
|
if (link2 && !apiKey) {
|
|
9741
|
-
|
|
9808
|
+
p27.log.warn(
|
|
9742
9809
|
`This project is linked to ${pc11.cyan(link2.projectName)} on velastack.dev, but there is no
|
|
9743
9810
|
API key here, so this deploy will not be recorded. Run ${pc11.cyan("vela login")}, or set
|
|
9744
9811
|
${pc11.cyan("VELA_API_KEY")}.`
|
|
@@ -9789,7 +9856,7 @@ async function reportEnvironmentDestroyed(workspaceRootDir, envTag, { missingOk
|
|
|
9789
9856
|
}
|
|
9790
9857
|
}
|
|
9791
9858
|
function warn(what, err) {
|
|
9792
|
-
|
|
9859
|
+
p27.log.warn(
|
|
9793
9860
|
`velastack.dev could not ${what}.
|
|
9794
9861
|
${pc11.dim(err instanceof Error ? err.message : String(err))}`
|
|
9795
9862
|
);
|
|
@@ -9798,7 +9865,7 @@ ${pc11.dim(err instanceof Error ? err.message : String(err))}`
|
|
|
9798
9865
|
// src/commands/destroy/deployment.ts
|
|
9799
9866
|
var deployment = addLockWaitOption(
|
|
9800
9867
|
addTargetOptions(
|
|
9801
|
-
new
|
|
9868
|
+
new Command49("deployment").description("remove a deployed environment from its server").configureHelp(helpConfig),
|
|
9802
9869
|
"production"
|
|
9803
9870
|
)
|
|
9804
9871
|
).option("--purge", "also delete the database and uploaded files").option("-y, --yes", "skip the confirmation prompt").option(
|
|
@@ -9817,7 +9884,7 @@ var deployment = addLockWaitOption(
|
|
|
9817
9884
|
purge: options.purge === true,
|
|
9818
9885
|
yes: options.yes === true,
|
|
9819
9886
|
confirm: options.confirm,
|
|
9820
|
-
interactive: Boolean(
|
|
9887
|
+
interactive: Boolean(process27.stdin.isTTY && process27.stdout.isTTY)
|
|
9821
9888
|
});
|
|
9822
9889
|
if (decision.kind === "refuse") throw new Error(decision.message);
|
|
9823
9890
|
if (decision.kind === "prompt") {
|
|
@@ -9837,13 +9904,13 @@ var deployment = addLockWaitOption(
|
|
|
9837
9904
|
missingOk: true
|
|
9838
9905
|
});
|
|
9839
9906
|
}
|
|
9840
|
-
|
|
9907
|
+
p28.log.info(
|
|
9841
9908
|
`Nothing named ${pc12.cyan(`${ctx.appName} (${ctx.targetName})`)} on ${ctx.server}; nothing to remove.`
|
|
9842
9909
|
);
|
|
9843
9910
|
return;
|
|
9844
9911
|
}
|
|
9845
9912
|
await reportEnvironmentDestroyed(ctx.workspaceRootDir, ctx.envTag);
|
|
9846
|
-
|
|
9913
|
+
p28.log.success(
|
|
9847
9914
|
`Removed ${pc12.cyan(`${ctx.appName} (${ctx.targetName})`)} from ${ctx.server}.` + (result?.purged ? result.trash ? `
|
|
9848
9915
|
|
|
9849
9916
|
A snapshot of its data is at ${pc12.cyan(result.trash)} on the server for two weeks.` : "" : `
|
|
@@ -9861,34 +9928,66 @@ The database and uploads are still in the instance's shared directory. Pass ${pc
|
|
|
9861
9928
|
);
|
|
9862
9929
|
async function confirm6(appName, targetName, byName) {
|
|
9863
9930
|
if (byName) {
|
|
9864
|
-
const answer = await
|
|
9931
|
+
const answer = await p28.text({
|
|
9865
9932
|
message: `This removes ${pc12.cyan(`${appName} (${targetName})`)}. Type the app name to confirm`,
|
|
9866
9933
|
validate: (value) => value === appName ? void 0 : `Type ${appName} to confirm`
|
|
9867
9934
|
});
|
|
9868
|
-
if (
|
|
9869
|
-
|
|
9870
|
-
|
|
9935
|
+
if (p28.isCancel(answer)) {
|
|
9936
|
+
p28.cancel("Operation cancelled.");
|
|
9937
|
+
process27.exit(0);
|
|
9871
9938
|
}
|
|
9872
9939
|
return;
|
|
9873
9940
|
}
|
|
9874
|
-
const ok = await
|
|
9941
|
+
const ok = await p28.confirm({
|
|
9875
9942
|
message: `Remove ${appName} (${targetName})?`,
|
|
9876
9943
|
initialValue: false
|
|
9877
9944
|
});
|
|
9878
|
-
if (
|
|
9879
|
-
|
|
9880
|
-
|
|
9945
|
+
if (p28.isCancel(ok) || !ok) {
|
|
9946
|
+
p28.cancel("Operation cancelled.");
|
|
9947
|
+
process27.exit(0);
|
|
9881
9948
|
}
|
|
9882
9949
|
}
|
|
9883
9950
|
|
|
9951
|
+
// src/commands/destroy/shop.ts
|
|
9952
|
+
import process28 from "node:process";
|
|
9953
|
+
import { Command as Command50 } from "commander";
|
|
9954
|
+
import * as p29 from "@clack/prompts";
|
|
9955
|
+
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(
|
|
9956
|
+
(opts, cmd) => runCommand(async () => {
|
|
9957
|
+
if (!opts.yes) {
|
|
9958
|
+
const ok = await p29.confirm({
|
|
9959
|
+
message: "Destroy the shop? Removes the listing and product pages (and src/lib/catalog.ts on WhatsApp). The cart and payments stay.",
|
|
9960
|
+
initialValue: false
|
|
9961
|
+
});
|
|
9962
|
+
if (p29.isCancel(ok) || !ok) {
|
|
9963
|
+
p29.cancel("Operation cancelled.");
|
|
9964
|
+
process28.exit(0);
|
|
9965
|
+
}
|
|
9966
|
+
}
|
|
9967
|
+
await runPattern(
|
|
9968
|
+
"destroy-shop",
|
|
9969
|
+
cmd.args,
|
|
9970
|
+
{ destructive: true },
|
|
9971
|
+
{
|
|
9972
|
+
summary: "Destroyed the shop.",
|
|
9973
|
+
task: {
|
|
9974
|
+
title: "Destroying the shop",
|
|
9975
|
+
success: "Destroyed the shop",
|
|
9976
|
+
error: "Failed to destroy the shop"
|
|
9977
|
+
}
|
|
9978
|
+
}
|
|
9979
|
+
);
|
|
9980
|
+
}, "Failed to destroy the shop.")
|
|
9981
|
+
);
|
|
9982
|
+
|
|
9884
9983
|
// src/commands/destroy.ts
|
|
9885
|
-
var destroy = new
|
|
9984
|
+
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
9985
|
|
|
9887
9986
|
// src/commands/ui.ts
|
|
9888
|
-
import { Command as
|
|
9987
|
+
import { Command as Command57 } from "commander";
|
|
9889
9988
|
|
|
9890
9989
|
// src/commands/ui/add.ts
|
|
9891
|
-
import { Command as
|
|
9990
|
+
import { Command as Command52 } from "commander";
|
|
9892
9991
|
import * as p30 from "@clack/prompts";
|
|
9893
9992
|
import { installComponents } from "@velastack/patterns";
|
|
9894
9993
|
|
|
@@ -9915,7 +10014,7 @@ var THEMES = [
|
|
|
9915
10014
|
"violet",
|
|
9916
10015
|
"yellow"
|
|
9917
10016
|
];
|
|
9918
|
-
var
|
|
10017
|
+
var NEXT_STEPS4 = [
|
|
9919
10018
|
"Import a component with: import { Button } from '#lib/components/ui/button/index.js';",
|
|
9920
10019
|
"Tweak styling in src/lib/components/ui/<component>/*.svelte.",
|
|
9921
10020
|
`Run \`vela ui base <color>\` to change the palette (${BASE_COLORS.join(", ")}), or \`vela ui list\` to see what else is available.`
|
|
@@ -9926,7 +10025,7 @@ function uiAddReport(requested, outcome) {
|
|
|
9926
10025
|
summary: installed2.length > 0 ? `Added ${installed2.length} UI component(s).` : `All ${new Set(requested).size} requested component(s) are already present.`,
|
|
9927
10026
|
componentsAdded: installed2,
|
|
9928
10027
|
packagesInstalled: packages,
|
|
9929
|
-
nextSteps: [...
|
|
10028
|
+
nextSteps: [...NEXT_STEPS4]
|
|
9930
10029
|
};
|
|
9931
10030
|
if (skipped.length > 0) {
|
|
9932
10031
|
report5.sections = [{ label: "Already present (pass --overwrite to replace)", items: skipped }];
|
|
@@ -9938,7 +10037,7 @@ function uiAddReport(requested, outcome) {
|
|
|
9938
10037
|
}
|
|
9939
10038
|
|
|
9940
10039
|
// src/commands/ui/add.ts
|
|
9941
|
-
var add = new
|
|
10040
|
+
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
10041
|
(components, options) => runCommand(async () => {
|
|
9943
10042
|
const { workspaceRootDir } = await getWorkspace();
|
|
9944
10043
|
assertShadcn("vela ui add", workspaceRootDir);
|
|
@@ -9961,10 +10060,10 @@ var add = new Command50("add").description("add ui components (shadcn-svelte ite
|
|
|
9961
10060
|
);
|
|
9962
10061
|
|
|
9963
10062
|
// src/commands/ui/base.ts
|
|
9964
|
-
import { Command as
|
|
10063
|
+
import { Command as Command53 } from "commander";
|
|
9965
10064
|
import * as p31 from "@clack/prompts";
|
|
9966
10065
|
import { applyBaseColor } from "@velastack/patterns";
|
|
9967
|
-
var base = new
|
|
10066
|
+
var base = new Command53("base").description("change the base (gray) palette").argument("<color>", `base color to use (${BASE_COLORS.join(", ")})`).configureHelp(helpConfig).action(
|
|
9968
10067
|
(color) => runCommand(async () => {
|
|
9969
10068
|
const { workspaceRootDir } = await getWorkspace();
|
|
9970
10069
|
assertShadcn("vela ui base", workspaceRootDir);
|
|
@@ -9990,7 +10089,7 @@ var base = new Command51("base").description("change the base (gray) palette").a
|
|
|
9990
10089
|
);
|
|
9991
10090
|
|
|
9992
10091
|
// src/commands/ui/list.ts
|
|
9993
|
-
import { Command as
|
|
10092
|
+
import { Command as Command54 } from "commander";
|
|
9994
10093
|
import * as p32 from "@clack/prompts";
|
|
9995
10094
|
import { listComponents } from "@velastack/patterns";
|
|
9996
10095
|
|
|
@@ -10022,7 +10121,7 @@ function uiListReport(result) {
|
|
|
10022
10121
|
}
|
|
10023
10122
|
|
|
10024
10123
|
// src/commands/ui/list.ts
|
|
10025
|
-
var list = new
|
|
10124
|
+
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
10125
|
(options) => runCommand(async () => {
|
|
10027
10126
|
const { workspaceRootDir } = await getWorkspace();
|
|
10028
10127
|
assertShadcn("vela ui list", workspaceRootDir);
|
|
@@ -10050,7 +10149,7 @@ Registry components are not listed.`);
|
|
|
10050
10149
|
);
|
|
10051
10150
|
|
|
10052
10151
|
// src/commands/ui/style.ts
|
|
10053
|
-
import { Command as
|
|
10152
|
+
import { Command as Command55 } from "commander";
|
|
10054
10153
|
import * as p33 from "@clack/prompts";
|
|
10055
10154
|
import { switchStyle } from "@velastack/patterns";
|
|
10056
10155
|
|
|
@@ -10077,7 +10176,7 @@ function uiStyleReport(result) {
|
|
|
10077
10176
|
}
|
|
10078
10177
|
|
|
10079
10178
|
// src/commands/ui/style.ts
|
|
10080
|
-
var style = new
|
|
10179
|
+
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
10180
|
(name, options) => runCommand(async () => {
|
|
10082
10181
|
const { workspaceRootDir } = await getWorkspace();
|
|
10083
10182
|
assertShadcn("vela ui style", workspaceRootDir);
|
|
@@ -10131,10 +10230,10 @@ ${components.map((c) => `- ${c}`).join("\n")}`
|
|
|
10131
10230
|
);
|
|
10132
10231
|
|
|
10133
10232
|
// src/commands/ui/theme.ts
|
|
10134
|
-
import { Command as
|
|
10233
|
+
import { Command as Command56 } from "commander";
|
|
10135
10234
|
import * as p34 from "@clack/prompts";
|
|
10136
10235
|
import { applyTheme } from "@velastack/patterns";
|
|
10137
|
-
var theme = new
|
|
10236
|
+
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
10237
|
(accent) => runCommand(async () => {
|
|
10139
10238
|
const { workspaceRootDir } = await getWorkspace();
|
|
10140
10239
|
assertShadcn("vela ui theme", workspaceRootDir);
|
|
@@ -10160,14 +10259,14 @@ var theme = new Command54("theme").description("change the accent color, keeping
|
|
|
10160
10259
|
);
|
|
10161
10260
|
|
|
10162
10261
|
// src/commands/ui.ts
|
|
10163
|
-
var ui = new
|
|
10262
|
+
var ui = new Command57("ui").description("generate ui components").configureHelp(helpConfig).addCommand(add).addCommand(list).addCommand(style).addCommand(base).addCommand(theme);
|
|
10164
10263
|
|
|
10165
10264
|
// src/commands/legal.ts
|
|
10166
|
-
import { Command as
|
|
10265
|
+
import { Command as Command60 } from "commander";
|
|
10167
10266
|
|
|
10168
10267
|
// src/commands/legal/terms.ts
|
|
10169
10268
|
import path41 from "node:path";
|
|
10170
|
-
import { Command as
|
|
10269
|
+
import { Command as Command58 } from "commander";
|
|
10171
10270
|
import * as p36 from "@clack/prompts";
|
|
10172
10271
|
|
|
10173
10272
|
// src/commands/legal/shared.ts
|
|
@@ -10878,11 +10977,11 @@ async function termsAction() {
|
|
|
10878
10977
|
]
|
|
10879
10978
|
});
|
|
10880
10979
|
}
|
|
10881
|
-
var terms = new
|
|
10980
|
+
var terms = new Command58("terms").description("generate placeholder terms and conditions").configureHelp(helpConfig).action(() => runCommand(termsAction, "Failed to generate terms and conditions."));
|
|
10882
10981
|
|
|
10883
10982
|
// src/commands/legal/privacy.ts
|
|
10884
10983
|
import path42 from "node:path";
|
|
10885
|
-
import { Command as
|
|
10984
|
+
import { Command as Command59 } from "commander";
|
|
10886
10985
|
import * as p37 from "@clack/prompts";
|
|
10887
10986
|
var mapLabels = {
|
|
10888
10987
|
personalInfo: {
|
|
@@ -11614,16 +11713,16 @@ async function privacyAction() {
|
|
|
11614
11713
|
]
|
|
11615
11714
|
});
|
|
11616
11715
|
}
|
|
11617
|
-
var privacy = new
|
|
11716
|
+
var privacy = new Command59("privacy").description("generate placeholder privacy policy").configureHelp(helpConfig).action(() => runCommand(privacyAction, "Failed to generate privacy policy."));
|
|
11618
11717
|
|
|
11619
11718
|
// src/commands/legal.ts
|
|
11620
|
-
var legal = new
|
|
11719
|
+
var legal = new Command60("legal").description("generate placeholder legal documents").configureHelp(helpConfig).addCommand(terms).addCommand(privacy);
|
|
11621
11720
|
|
|
11622
11721
|
// src/commands/fixtures.ts
|
|
11623
|
-
import { Command as
|
|
11722
|
+
import { Command as Command66 } from "commander";
|
|
11624
11723
|
|
|
11625
11724
|
// src/commands/fixtures/load.ts
|
|
11626
|
-
import { Command as
|
|
11725
|
+
import { Command as Command61 } from "commander";
|
|
11627
11726
|
|
|
11628
11727
|
// src/lib/data.ts
|
|
11629
11728
|
import fs42 from "node:fs";
|
|
@@ -11813,7 +11912,7 @@ async function hasLoadedFixtures(pb) {
|
|
|
11813
11912
|
}
|
|
11814
11913
|
|
|
11815
11914
|
// src/commands/fixtures/load.ts
|
|
11816
|
-
var load = new
|
|
11915
|
+
var load = new Command61("load").description("load fixtures into the database").configureHelp(helpConfig).action(
|
|
11817
11916
|
() => runCommand(async () => {
|
|
11818
11917
|
const { workspaceRootDir } = await getWorkspace();
|
|
11819
11918
|
let loaded = [];
|
|
@@ -11839,8 +11938,8 @@ var load = new Command59("load").description("load fixtures into the database").
|
|
|
11839
11938
|
);
|
|
11840
11939
|
|
|
11841
11940
|
// src/commands/fixtures/clear.ts
|
|
11842
|
-
import { Command as
|
|
11843
|
-
var clear = new
|
|
11941
|
+
import { Command as Command62 } from "commander";
|
|
11942
|
+
var clear = new Command62("clear").description("clear loaded fixtures").configureHelp(helpConfig).action(
|
|
11844
11943
|
() => runCommand(async () => {
|
|
11845
11944
|
const { workspaceRootDir } = await getWorkspace();
|
|
11846
11945
|
let cleared = [];
|
|
@@ -11869,8 +11968,8 @@ var clear = new Command60("clear").description("clear loaded fixtures").configur
|
|
|
11869
11968
|
);
|
|
11870
11969
|
|
|
11871
11970
|
// src/commands/fixtures/reset.ts
|
|
11872
|
-
import { Command as
|
|
11873
|
-
var reset = new
|
|
11971
|
+
import { Command as Command63 } from "commander";
|
|
11972
|
+
var reset = new Command63("reset").description("clear and reload fixtures").configureHelp(helpConfig).action(
|
|
11874
11973
|
() => runCommand(async () => {
|
|
11875
11974
|
const { workspaceRootDir } = await getWorkspace();
|
|
11876
11975
|
let cleared = [];
|
|
@@ -11902,7 +12001,7 @@ var reset = new Command61("reset").description("clear and reload fixtures").conf
|
|
|
11902
12001
|
// src/commands/fixtures/generate.ts
|
|
11903
12002
|
import fs43 from "node:fs";
|
|
11904
12003
|
import path44 from "node:path";
|
|
11905
|
-
import { Command as
|
|
12004
|
+
import { Command as Command64, InvalidArgumentError } from "commander";
|
|
11906
12005
|
import * as p38 from "@clack/prompts";
|
|
11907
12006
|
import { annotate } from "annotate-json-schema";
|
|
11908
12007
|
import { createGenerator } from "json-schema-faker";
|
|
@@ -12013,7 +12112,7 @@ async function generateFixtureFiles(pb, workspaceRootDir, opts) {
|
|
|
12013
12112
|
}
|
|
12014
12113
|
return { writtenFiles, warnings };
|
|
12015
12114
|
}
|
|
12016
|
-
var generate2 = new
|
|
12115
|
+
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
12116
|
(opts) => runCommand(async () => {
|
|
12018
12117
|
const { workspaceRootDir } = await getWorkspace();
|
|
12019
12118
|
const existing = getFixtureFiles(workspaceRootDir);
|
|
@@ -12066,7 +12165,7 @@ var generate2 = new Command62("generate").description("generate fixture data").o
|
|
|
12066
12165
|
);
|
|
12067
12166
|
|
|
12068
12167
|
// src/commands/fixtures/regen.ts
|
|
12069
|
-
import { Command as
|
|
12168
|
+
import { Command as Command65, InvalidArgumentError as InvalidArgumentError2 } from "commander";
|
|
12070
12169
|
import * as p39 from "@clack/prompts";
|
|
12071
12170
|
function parseCount2(value) {
|
|
12072
12171
|
const n = parseInt(value, 10);
|
|
@@ -12082,7 +12181,7 @@ function parseSeed2(value) {
|
|
|
12082
12181
|
}
|
|
12083
12182
|
return n;
|
|
12084
12183
|
}
|
|
12085
|
-
var regen = new
|
|
12184
|
+
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
12185
|
(opts) => runCommand(async () => {
|
|
12087
12186
|
const { workspaceRootDir } = await getWorkspace();
|
|
12088
12187
|
let cleared = [];
|
|
@@ -12111,14 +12210,14 @@ var regen = new Command63("regen").description("clear the database, regenerate f
|
|
|
12111
12210
|
);
|
|
12112
12211
|
|
|
12113
12212
|
// src/commands/fixtures.ts
|
|
12114
|
-
var fixtures = new
|
|
12213
|
+
var fixtures = new Command66("fixtures").description("manage fixture data").configureHelp(helpConfig).addCommand(generate2).addCommand(load).addCommand(clear).addCommand(reset).addCommand(regen);
|
|
12115
12214
|
|
|
12116
12215
|
// src/commands/seeds.ts
|
|
12117
|
-
import { Command as
|
|
12216
|
+
import { Command as Command70 } from "commander";
|
|
12118
12217
|
|
|
12119
12218
|
// src/commands/seeds/load.ts
|
|
12120
|
-
import { Command as
|
|
12121
|
-
var load2 = new
|
|
12219
|
+
import { Command as Command67 } from "commander";
|
|
12220
|
+
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
12221
|
(opts) => runCommand(async () => {
|
|
12123
12222
|
const { workspaceRootDir } = await getWorkspace();
|
|
12124
12223
|
const seedFiles = getSeedFiles(workspaceRootDir);
|
|
@@ -12157,7 +12256,7 @@ var load2 = new Command65("load").description("load seeds into the database").op
|
|
|
12157
12256
|
// src/commands/seeds/save.ts
|
|
12158
12257
|
import fs44 from "node:fs";
|
|
12159
12258
|
import path45 from "node:path";
|
|
12160
|
-
import { Command as
|
|
12259
|
+
import { Command as Command68 } from "commander";
|
|
12161
12260
|
var padZeros2 = (num, length) => num.toString().padStart(length, "0");
|
|
12162
12261
|
function filterSystemFields(record, systemFieldNames) {
|
|
12163
12262
|
const out = {};
|
|
@@ -12168,7 +12267,7 @@ function filterSystemFields(record, systemFieldNames) {
|
|
|
12168
12267
|
}
|
|
12169
12268
|
return out;
|
|
12170
12269
|
}
|
|
12171
|
-
var save = new
|
|
12270
|
+
var save = new Command68("save").description("save the current data as seeds").option("-f, --force", "overwrite existing seed files").configureHelp(helpConfig).action(
|
|
12172
12271
|
(opts) => runCommand(async () => {
|
|
12173
12272
|
const { workspaceRootDir } = await getWorkspace();
|
|
12174
12273
|
const seedsPath = dataDir(workspaceRootDir, "seeds");
|
|
@@ -12240,8 +12339,8 @@ var save = new Command66("save").description("save the current data as seeds").o
|
|
|
12240
12339
|
);
|
|
12241
12340
|
|
|
12242
12341
|
// src/commands/seeds/clear.ts
|
|
12243
|
-
import { Command as
|
|
12244
|
-
var clear2 = new
|
|
12342
|
+
import { Command as Command69 } from "commander";
|
|
12343
|
+
var clear2 = new Command69("clear").description("clear seeded records").configureHelp(helpConfig).action(
|
|
12245
12344
|
() => runCommand(async () => {
|
|
12246
12345
|
const { workspaceRootDir } = await getWorkspace();
|
|
12247
12346
|
const seedFiles = getSeedFiles(workspaceRootDir);
|
|
@@ -12272,13 +12371,13 @@ var clear2 = new Command67("clear").description("clear seeded records").configur
|
|
|
12272
12371
|
);
|
|
12273
12372
|
|
|
12274
12373
|
// src/commands/seeds.ts
|
|
12275
|
-
var seeds = new
|
|
12374
|
+
var seeds = new Command70("seeds").description("manage seed data").configureHelp(helpConfig).addCommand(load2).addCommand(save).addCommand(clear2);
|
|
12276
12375
|
|
|
12277
12376
|
// src/commands/signup.ts
|
|
12278
|
-
import { Command as
|
|
12377
|
+
import { Command as Command71 } from "commander";
|
|
12279
12378
|
import * as p40 from "@clack/prompts";
|
|
12280
12379
|
import makeFetchCookie2 from "fetch-cookie";
|
|
12281
|
-
var signup = new
|
|
12380
|
+
var signup = new Command71("signup").description("signup to velastack.dev").configureHelp(helpConfig).action(
|
|
12282
12381
|
() => runCommand(async () => {
|
|
12283
12382
|
const { email: email2, password: password8, passwordConfirm } = await p40.group({
|
|
12284
12383
|
email: () => p40.text({ message: "Email" }),
|
|
@@ -12313,9 +12412,9 @@ var signup = new Command69("signup").description("signup to velastack.dev").conf
|
|
|
12313
12412
|
);
|
|
12314
12413
|
|
|
12315
12414
|
// src/commands/logout.ts
|
|
12316
|
-
import { Command as
|
|
12415
|
+
import { Command as Command72 } from "commander";
|
|
12317
12416
|
import * as p41 from "@clack/prompts";
|
|
12318
|
-
var logout = new
|
|
12417
|
+
var logout = new Command72("logout").alias("signout").description("logout from velastack.dev").configureHelp(helpConfig).action(
|
|
12319
12418
|
() => runCommand(() => {
|
|
12320
12419
|
if (!readConfig()) {
|
|
12321
12420
|
p41.log.info("Not logged in");
|
|
@@ -12327,9 +12426,9 @@ var logout = new Command70("logout").alias("signout").description("logout from v
|
|
|
12327
12426
|
);
|
|
12328
12427
|
|
|
12329
12428
|
// src/commands/whoami.ts
|
|
12330
|
-
import { Command as
|
|
12429
|
+
import { Command as Command73 } from "commander";
|
|
12331
12430
|
import * as p42 from "@clack/prompts";
|
|
12332
|
-
var whoami = new
|
|
12431
|
+
var whoami = new Command73("whoami").description("show the current user").configureHelp(helpConfig).action(
|
|
12333
12432
|
() => runCommand(async () => {
|
|
12334
12433
|
const apiKey = readConfig()?.apiKey;
|
|
12335
12434
|
if (!apiKey) {
|
|
@@ -12346,10 +12445,10 @@ var whoami = new Command71("whoami").description("show the current user").config
|
|
|
12346
12445
|
);
|
|
12347
12446
|
|
|
12348
12447
|
// src/commands/migrate.ts
|
|
12349
|
-
import { Command as
|
|
12448
|
+
import { Command as Command80 } from "commander";
|
|
12350
12449
|
|
|
12351
12450
|
// src/commands/migrate/up.ts
|
|
12352
|
-
import { Command as
|
|
12451
|
+
import { Command as Command74 } from "commander";
|
|
12353
12452
|
|
|
12354
12453
|
// src/lib/migrate.ts
|
|
12355
12454
|
import path46 from "node:path";
|
|
@@ -12391,10 +12490,10 @@ async function runMigrateUp() {
|
|
|
12391
12490
|
]
|
|
12392
12491
|
});
|
|
12393
12492
|
}
|
|
12394
|
-
var up = new
|
|
12493
|
+
var up = new Command74("up").description("apply all pending migrations").configureHelp(helpConfig).action(() => runCommand(runMigrateUp, "Failed to run migrations."));
|
|
12395
12494
|
|
|
12396
12495
|
// src/commands/migrate/down.ts
|
|
12397
|
-
import { Command as
|
|
12496
|
+
import { Command as Command75, InvalidArgumentError as InvalidArgumentError3 } from "commander";
|
|
12398
12497
|
function parseSteps(value) {
|
|
12399
12498
|
const n = parseInt(value, 10);
|
|
12400
12499
|
if (!Number.isFinite(n) || n <= 0) {
|
|
@@ -12402,7 +12501,7 @@ function parseSteps(value) {
|
|
|
12402
12501
|
}
|
|
12403
12502
|
return n;
|
|
12404
12503
|
}
|
|
12405
|
-
var down = new
|
|
12504
|
+
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
12505
|
(n) => runCommand(async () => {
|
|
12407
12506
|
await runPocketbaseMigrate(["down", String(n)]);
|
|
12408
12507
|
reportResult({
|
|
@@ -12418,8 +12517,8 @@ var down = new Command73("down").alias("rollback").description("revert the last
|
|
|
12418
12517
|
// src/commands/migrate/create.ts
|
|
12419
12518
|
import fs45 from "node:fs";
|
|
12420
12519
|
import path47 from "node:path";
|
|
12421
|
-
import { Command as
|
|
12422
|
-
var create2 = new
|
|
12520
|
+
import { Command as Command76 } from "commander";
|
|
12521
|
+
var create2 = new Command76("create").alias("new").description("create a new blank migration").argument("<name>", "migration name (snake_case)").configureHelp(helpConfig).action(
|
|
12423
12522
|
(name) => runCommand(async () => {
|
|
12424
12523
|
const cwd = migrateRoot();
|
|
12425
12524
|
const before = listMigrationFiles(cwd);
|
|
@@ -12445,8 +12544,8 @@ function listMigrationFiles(cwd) {
|
|
|
12445
12544
|
// src/commands/migrate/collections.ts
|
|
12446
12545
|
import fs46 from "node:fs";
|
|
12447
12546
|
import path48 from "node:path";
|
|
12448
|
-
import { Command as
|
|
12449
|
-
var collections = new
|
|
12547
|
+
import { Command as Command77 } from "commander";
|
|
12548
|
+
var collections = new Command77("collections").alias("snapshot").description("snapshot local collections into a new migration").configureHelp(helpConfig).action(
|
|
12450
12549
|
() => runCommand(async () => {
|
|
12451
12550
|
const cwd = migrateRoot();
|
|
12452
12551
|
const before = listMigrationFiles2(cwd);
|
|
@@ -12477,8 +12576,8 @@ function listMigrationFiles2(cwd) {
|
|
|
12477
12576
|
}
|
|
12478
12577
|
|
|
12479
12578
|
// src/commands/migrate/history-sync.ts
|
|
12480
|
-
import { Command as
|
|
12481
|
-
var historySync = new
|
|
12579
|
+
import { Command as Command78 } from "commander";
|
|
12580
|
+
var historySync = new Command78("history-sync").description("drop _migrations rows whose files no longer exist").configureHelp(helpConfig).action(
|
|
12482
12581
|
() => runCommand(async () => {
|
|
12483
12582
|
await runPocketbaseMigrate(["history-sync"]);
|
|
12484
12583
|
reportResult({
|
|
@@ -12491,10 +12590,10 @@ var historySync = new Command76("history-sync").description("drop _migrations ro
|
|
|
12491
12590
|
// src/commands/migrate/sveltekit-3.ts
|
|
12492
12591
|
import path49 from "node:path";
|
|
12493
12592
|
import process31 from "node:process";
|
|
12494
|
-
import { Command as
|
|
12593
|
+
import { Command as Command79 } from "commander";
|
|
12495
12594
|
import * as p43 from "@clack/prompts";
|
|
12496
12595
|
import pc13 from "picocolors";
|
|
12497
|
-
var sveltekit3 = new
|
|
12596
|
+
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
12597
|
(options) => runCommand(async () => {
|
|
12499
12598
|
const root = options.cwd ? path49.resolve(options.cwd) : findWorkspaceRoot() ?? process31.cwd();
|
|
12500
12599
|
p43.intro(pc13.bgCyan(pc13.black(" vela migrate sveltekit-3 ")));
|
|
@@ -12568,14 +12667,14 @@ function nextStepsFor(result) {
|
|
|
12568
12667
|
}
|
|
12569
12668
|
|
|
12570
12669
|
// src/commands/migrate.ts
|
|
12571
|
-
var migrate = new
|
|
12670
|
+
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
12671
|
|
|
12573
12672
|
// src/commands/dev.ts
|
|
12574
12673
|
import fs47 from "node:fs";
|
|
12575
12674
|
import path51 from "node:path";
|
|
12576
12675
|
import process33 from "node:process";
|
|
12577
12676
|
import { performance } from "node:perf_hooks";
|
|
12578
|
-
import { Command as
|
|
12677
|
+
import { Command as Command81, InvalidArgumentError as InvalidArgumentError4 } from "commander";
|
|
12579
12678
|
import pc15 from "picocolors";
|
|
12580
12679
|
import PocketBase5 from "pocketbase";
|
|
12581
12680
|
|
|
@@ -12648,7 +12747,7 @@ function parsePort(value) {
|
|
|
12648
12747
|
}
|
|
12649
12748
|
return port;
|
|
12650
12749
|
}
|
|
12651
|
-
var dev = new
|
|
12750
|
+
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
12751
|
const cwd = process33.cwd();
|
|
12653
12752
|
warnIfKit2(findWorkspaceRoot(cwd) ?? cwd, (m) => console.warn(pc15.yellow(`\u25B2 ${m}`)));
|
|
12654
12753
|
process33.env.VELA_DATA_DIR ??= localDataDir(cwd);
|
|
@@ -12773,7 +12872,7 @@ async function startWatchingTypes(cwd, pb) {
|
|
|
12773
12872
|
import fs48 from "node:fs";
|
|
12774
12873
|
import path52 from "node:path";
|
|
12775
12874
|
import process35 from "node:process";
|
|
12776
|
-
import { Command as
|
|
12875
|
+
import { Command as Command82 } from "commander";
|
|
12777
12876
|
import * as p44 from "@clack/prompts";
|
|
12778
12877
|
import pc16 from "picocolors";
|
|
12779
12878
|
import { x as x4 } from "tinyexec";
|
|
@@ -12814,7 +12913,7 @@ function splitHosts(value) {
|
|
|
12814
12913
|
|
|
12815
12914
|
// src/commands/build.ts
|
|
12816
12915
|
var PRERENDERED_DIR = path52.join(".svelte-kit", "output", "prerendered");
|
|
12817
|
-
var build = new
|
|
12916
|
+
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
12917
|
const cwd = process35.cwd();
|
|
12819
12918
|
warnIfKit2(findWorkspaceRoot(cwd) ?? cwd, (m) => p44.log.warn(m));
|
|
12820
12919
|
warnIfSsrExternalMissing(findWorkspaceRoot(cwd) ?? cwd);
|
|
@@ -12909,14 +13008,14 @@ Set one with ${pc16.cyan("vela deploy --domain example.com")}, or pass ${pc16.cy
|
|
|
12909
13008
|
import fs49 from "node:fs";
|
|
12910
13009
|
import path53 from "node:path";
|
|
12911
13010
|
import process36 from "node:process";
|
|
12912
|
-
import { Command as
|
|
13011
|
+
import { Command as Command83 } from "commander";
|
|
12913
13012
|
import * as p45 from "@clack/prompts";
|
|
12914
13013
|
import pc17 from "picocolors";
|
|
12915
13014
|
import { x as x5 } from "tinyexec";
|
|
12916
13015
|
import { detect as detect8 } from "package-manager-detector";
|
|
12917
13016
|
import { resolveCommand as resolveCommand6 } from "package-manager-detector/commands";
|
|
12918
13017
|
var ADAPTER_NODE_MODULE = path53.join("build", "adapter-node.js");
|
|
12919
|
-
var preview = new
|
|
13018
|
+
var preview = new Command83("preview").description("preview the built app").configureHelp(helpConfig).action(async () => {
|
|
12920
13019
|
const cwd = process36.cwd();
|
|
12921
13020
|
process36.env.VELA_DATA_DIR ??= localDataDir(cwd);
|
|
12922
13021
|
warnIfKit2(findWorkspaceRoot(cwd) ?? cwd, (m) => p45.log.warn(m));
|
|
@@ -12985,8 +13084,8 @@ set empty so no domain is baked in.`
|
|
|
12985
13084
|
|
|
12986
13085
|
// src/commands/sync.ts
|
|
12987
13086
|
import path54 from "node:path";
|
|
12988
|
-
import { Command as
|
|
12989
|
-
var sync = new
|
|
13087
|
+
import { Command as Command84 } from "commander";
|
|
13088
|
+
var sync = new Command84("sync").description("sync types from the database").configureHelp(helpConfig).action(
|
|
12990
13089
|
() => runCommand(async () => {
|
|
12991
13090
|
const { workspaceRootDir } = await getWorkspace();
|
|
12992
13091
|
const typesDir = path54.join(workspaceRootDir, ".svelte-kit", "types");
|
|
@@ -12999,7 +13098,7 @@ var sync = new Command82("sync").description("sync types from the database").con
|
|
|
12999
13098
|
);
|
|
13000
13099
|
|
|
13001
13100
|
// src/commands/provision.ts
|
|
13002
|
-
import { Command as
|
|
13101
|
+
import { Command as Command85 } from "commander";
|
|
13003
13102
|
import * as p46 from "@clack/prompts";
|
|
13004
13103
|
import pc18 from "picocolors";
|
|
13005
13104
|
import * as v9 from "valibot";
|
|
@@ -13014,7 +13113,7 @@ var OptionsSchema2 = v9.object({
|
|
|
13014
13113
|
)
|
|
13015
13114
|
});
|
|
13016
13115
|
var provision = addSshOptions(
|
|
13017
|
-
new
|
|
13116
|
+
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
13117
|
).option("--pb-version <version>", "PocketBase version to install").option(
|
|
13019
13118
|
"--node-major <version>",
|
|
13020
13119
|
"Node.js major version to bring the server up to (match the one you build with)",
|
|
@@ -13063,7 +13162,7 @@ var provision = addSshOptions(
|
|
|
13063
13162
|
import path58 from "node:path";
|
|
13064
13163
|
import fs53 from "node:fs";
|
|
13065
13164
|
import process38 from "node:process";
|
|
13066
|
-
import { Command as
|
|
13165
|
+
import { Command as Command86, Option as Option2 } from "commander";
|
|
13067
13166
|
import * as p48 from "@clack/prompts";
|
|
13068
13167
|
import pc20 from "picocolors";
|
|
13069
13168
|
import * as v10 from "valibot";
|
|
@@ -13429,7 +13528,7 @@ var OptionsSchema3 = v10.object({
|
|
|
13429
13528
|
});
|
|
13430
13529
|
var deploy = addLockWaitOption(
|
|
13431
13530
|
addTargetOptions(
|
|
13432
|
-
new
|
|
13531
|
+
new Command86("deploy").description("deploy the app").configureHelp(helpConfig),
|
|
13433
13532
|
"production"
|
|
13434
13533
|
)
|
|
13435
13534
|
).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 +13962,10 @@ async function serverTimeOrLocal(session) {
|
|
|
13863
13962
|
// src/commands/link.ts
|
|
13864
13963
|
import path59 from "node:path";
|
|
13865
13964
|
import process39 from "node:process";
|
|
13866
|
-
import { Command as
|
|
13965
|
+
import { Command as Command87 } from "commander";
|
|
13867
13966
|
import * as p49 from "@clack/prompts";
|
|
13868
13967
|
var CREATE_NEW = "__new__";
|
|
13869
|
-
var link = new
|
|
13968
|
+
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
13969
|
async function linkProject() {
|
|
13871
13970
|
const { workspaceRootDir } = await getWorkspace();
|
|
13872
13971
|
const existing = readProjectConfig(workspaceRootDir);
|
|
@@ -13933,10 +14032,10 @@ function defaultProjectName2(workspaceRootDir) {
|
|
|
13933
14032
|
}
|
|
13934
14033
|
|
|
13935
14034
|
// src/commands/env.ts
|
|
13936
|
-
import { Command as
|
|
14035
|
+
import { Command as Command93 } from "commander";
|
|
13937
14036
|
|
|
13938
14037
|
// src/commands/env/list.ts
|
|
13939
|
-
import { Command as
|
|
14038
|
+
import { Command as Command88 } from "commander";
|
|
13940
14039
|
import * as v12 from "valibot";
|
|
13941
14040
|
import * as p52 from "@clack/prompts";
|
|
13942
14041
|
import pc23 from "picocolors";
|
|
@@ -14208,7 +14307,7 @@ var OptionsSchema5 = v12.object({
|
|
|
14208
14307
|
var HIDDEN = "\u2022\u2022\u2022\u2022";
|
|
14209
14308
|
var MAX_VALUE = 32;
|
|
14210
14309
|
var envList = addEnvTargetOptions(
|
|
14211
|
-
new
|
|
14310
|
+
new Command88("list").description("list environment variables \u2014 every scope at once without -t").configureHelp(helpConfig)
|
|
14212
14311
|
).action(
|
|
14213
14312
|
(raw) => runCommand(async () => {
|
|
14214
14313
|
const options = parseOptions(OptionsSchema5, raw);
|
|
@@ -14368,17 +14467,17 @@ function matrixCell(key, columns, index, states) {
|
|
|
14368
14467
|
return pc23.dim("\u2014");
|
|
14369
14468
|
}
|
|
14370
14469
|
var ANSI3 = /\u001b\[[0-9;]*m/g;
|
|
14371
|
-
function plain(
|
|
14372
|
-
return
|
|
14470
|
+
function plain(text18) {
|
|
14471
|
+
return text18.replace(ANSI3, "");
|
|
14373
14472
|
}
|
|
14374
14473
|
|
|
14375
14474
|
// src/commands/env/set.ts
|
|
14376
14475
|
import process41 from "node:process";
|
|
14377
|
-
import { Command as
|
|
14476
|
+
import { Command as Command89 } from "commander";
|
|
14378
14477
|
import * as p53 from "@clack/prompts";
|
|
14379
14478
|
import pc24 from "picocolors";
|
|
14380
14479
|
var envSet = addEnvTargetOptions(
|
|
14381
|
-
new
|
|
14480
|
+
new Command89("set").description("set an environment variable \u2014 the value is prompted for, never an argument").argument("<key>", "variable name").option(
|
|
14382
14481
|
"--public",
|
|
14383
14482
|
"readable back with `vela env list` and `vela env get`; PUBLIC_* keys are public regardless"
|
|
14384
14483
|
).configureHelp(helpConfig)
|
|
@@ -14436,11 +14535,11 @@ async function promptValue2(key, visibility) {
|
|
|
14436
14535
|
}
|
|
14437
14536
|
|
|
14438
14537
|
// src/commands/env/unset.ts
|
|
14439
|
-
import { Command as
|
|
14538
|
+
import { Command as Command90 } from "commander";
|
|
14440
14539
|
import * as p54 from "@clack/prompts";
|
|
14441
14540
|
import pc25 from "picocolors";
|
|
14442
14541
|
var envUnset = addEnvTargetOptions(
|
|
14443
|
-
new
|
|
14542
|
+
new Command90("unset").description("remove an environment variable").argument("<key>", "variable name").configureHelp(helpConfig)
|
|
14444
14543
|
).action(
|
|
14445
14544
|
(key, raw) => runCommand(
|
|
14446
14545
|
() => withEnvScope(
|
|
@@ -14484,11 +14583,11 @@ var envUnset = addEnvTargetOptions(
|
|
|
14484
14583
|
import fs55 from "node:fs";
|
|
14485
14584
|
import path60 from "node:path";
|
|
14486
14585
|
import process42 from "node:process";
|
|
14487
|
-
import { Command as
|
|
14586
|
+
import { Command as Command91 } from "commander";
|
|
14488
14587
|
import * as p55 from "@clack/prompts";
|
|
14489
14588
|
import pc26 from "picocolors";
|
|
14490
14589
|
var envImport = addEnvTargetOptions(
|
|
14491
|
-
new
|
|
14590
|
+
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
14591
|
).action(
|
|
14493
14592
|
(file, raw) => runCommand(
|
|
14494
14593
|
() => withEnvScope(
|
|
@@ -14564,11 +14663,11 @@ function read(resolved, shown) {
|
|
|
14564
14663
|
|
|
14565
14664
|
// src/commands/env/get.ts
|
|
14566
14665
|
import process43 from "node:process";
|
|
14567
|
-
import { Command as
|
|
14666
|
+
import { Command as Command92 } from "commander";
|
|
14568
14667
|
import * as p56 from "@clack/prompts";
|
|
14569
14668
|
import pc27 from "picocolors";
|
|
14570
14669
|
var envGet = addEnvTargetOptions(
|
|
14571
|
-
new
|
|
14670
|
+
new Command92("get").description("print a public environment variable").argument("<key>", "variable name").configureHelp(helpConfig)
|
|
14572
14671
|
).action(
|
|
14573
14672
|
(key, raw) => runCommand(
|
|
14574
14673
|
() => withEnvScope(
|
|
@@ -14616,14 +14715,14 @@ Set it again to change it: ${pc27.cyan(`vela env set ${key}`)}`
|
|
|
14616
14715
|
}
|
|
14617
14716
|
|
|
14618
14717
|
// src/commands/env.ts
|
|
14619
|
-
var env = new
|
|
14718
|
+
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
14719
|
|
|
14621
14720
|
// src/commands/status.ts
|
|
14622
|
-
import { Command as
|
|
14721
|
+
import { Command as Command94 } from "commander";
|
|
14623
14722
|
import * as p57 from "@clack/prompts";
|
|
14624
14723
|
import pc28 from "picocolors";
|
|
14625
14724
|
var status = addTargetOptions(
|
|
14626
|
-
new
|
|
14725
|
+
new Command94("status").description("show what is deployed").configureHelp(helpConfig),
|
|
14627
14726
|
"production"
|
|
14628
14727
|
).option("--all", "show every app on the server, not just this project").option("--json", "print raw JSON").action(
|
|
14629
14728
|
(raw) => runCommand(async () => {
|
|
@@ -14682,12 +14781,12 @@ function describe2(state) {
|
|
|
14682
14781
|
}
|
|
14683
14782
|
|
|
14684
14783
|
// src/commands/rollback.ts
|
|
14685
|
-
import { Command as
|
|
14784
|
+
import { Command as Command95 } from "commander";
|
|
14686
14785
|
import * as p58 from "@clack/prompts";
|
|
14687
14786
|
import pc29 from "picocolors";
|
|
14688
14787
|
var rollback = addLockWaitOption(
|
|
14689
14788
|
addTargetOptions(
|
|
14690
|
-
new
|
|
14789
|
+
new Command95("rollback").description("put the previous release back").configureHelp(helpConfig),
|
|
14691
14790
|
"production"
|
|
14692
14791
|
)
|
|
14693
14792
|
).option("--to <release>", "roll back to a specific release instead of the previous one").action(
|
|
@@ -14726,7 +14825,7 @@ var rollback = addLockWaitOption(
|
|
|
14726
14825
|
);
|
|
14727
14826
|
|
|
14728
14827
|
// src/commands/logs.ts
|
|
14729
|
-
import { Command as
|
|
14828
|
+
import { Command as Command96 } from "commander";
|
|
14730
14829
|
|
|
14731
14830
|
// src/lib/remote-pocketbase.ts
|
|
14732
14831
|
import PocketBase6 from "pocketbase";
|
|
@@ -14777,7 +14876,7 @@ async function withRemotePocketbase(session, instance, fn) {
|
|
|
14777
14876
|
|
|
14778
14877
|
// src/commands/logs.ts
|
|
14779
14878
|
var logs = addTargetOptions(
|
|
14780
|
-
new
|
|
14879
|
+
new Command96("logs").description("tail the logs of a deployed app").configureHelp(helpConfig),
|
|
14781
14880
|
"production"
|
|
14782
14881
|
).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
14882
|
(raw) => runCommand(async () => {
|
|
@@ -14812,16 +14911,16 @@ var logs = addTargetOptions(
|
|
|
14812
14911
|
);
|
|
14813
14912
|
|
|
14814
14913
|
// src/commands/admin.ts
|
|
14815
|
-
import { Command as
|
|
14914
|
+
import { Command as Command98 } from "commander";
|
|
14816
14915
|
|
|
14817
14916
|
// src/commands/admin/create.ts
|
|
14818
14917
|
import process44 from "node:process";
|
|
14819
|
-
import { Command as
|
|
14918
|
+
import { Command as Command97 } from "commander";
|
|
14820
14919
|
import * as p59 from "@clack/prompts";
|
|
14821
14920
|
import pc30 from "picocolors";
|
|
14822
14921
|
var MIN_PASSWORD = 10;
|
|
14823
14922
|
var adminCreate = addTargetOptions(
|
|
14824
|
-
new
|
|
14923
|
+
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
14924
|
"local"
|
|
14826
14925
|
).action(
|
|
14827
14926
|
(email2, raw) => runCommand(
|
|
@@ -14939,15 +15038,15 @@ async function promptPassword() {
|
|
|
14939
15038
|
}
|
|
14940
15039
|
|
|
14941
15040
|
// src/commands/admin.ts
|
|
14942
|
-
var admin = new
|
|
15041
|
+
var admin = new Command98("admin").description("manage admin panel logins").configureHelp(helpConfig).addCommand(adminCreate);
|
|
14943
15042
|
|
|
14944
15043
|
// src/commands/backup.ts
|
|
14945
|
-
import { Command as
|
|
15044
|
+
import { Command as Command104 } from "commander";
|
|
14946
15045
|
|
|
14947
15046
|
// src/commands/backup/create.ts
|
|
14948
15047
|
import fs56 from "node:fs";
|
|
14949
15048
|
import path61 from "node:path";
|
|
14950
|
-
import { Command as
|
|
15049
|
+
import { Command as Command99 } from "commander";
|
|
14951
15050
|
import * as p60 from "@clack/prompts";
|
|
14952
15051
|
import pc32 from "picocolors";
|
|
14953
15052
|
|
|
@@ -15096,7 +15195,7 @@ async function writeSchedule(pb, cron, maxKeep) {
|
|
|
15096
15195
|
// src/commands/backup/create.ts
|
|
15097
15196
|
var DEFAULT_BACKUP_DIR = "backups";
|
|
15098
15197
|
var backupCreate = addTargetOptions(
|
|
15099
|
-
new
|
|
15198
|
+
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
15199
|
"production"
|
|
15101
15200
|
).action(
|
|
15102
15201
|
(name, raw) => runCommand(() => {
|
|
@@ -15180,11 +15279,11 @@ async function download(ctx, key, outputDir) {
|
|
|
15180
15279
|
}
|
|
15181
15280
|
|
|
15182
15281
|
// src/commands/backup/list.ts
|
|
15183
|
-
import { Command as
|
|
15282
|
+
import { Command as Command100 } from "commander";
|
|
15184
15283
|
import * as p61 from "@clack/prompts";
|
|
15185
15284
|
import pc33 from "picocolors";
|
|
15186
15285
|
var backupList = addTargetOptions(
|
|
15187
|
-
new
|
|
15286
|
+
new Command100("list").description("list the backups on a target").configureHelp(helpConfig),
|
|
15188
15287
|
"production"
|
|
15189
15288
|
).action(
|
|
15190
15289
|
(raw) => runCommand(
|
|
@@ -15212,11 +15311,11 @@ Take one with ${pc33.cyan("vela backup create")}.`
|
|
|
15212
15311
|
// src/commands/backup/download.ts
|
|
15213
15312
|
import fs57 from "node:fs";
|
|
15214
15313
|
import path62 from "node:path";
|
|
15215
|
-
import { Command as
|
|
15314
|
+
import { Command as Command101 } from "commander";
|
|
15216
15315
|
import * as p62 from "@clack/prompts";
|
|
15217
15316
|
import pc34 from "picocolors";
|
|
15218
15317
|
var backupDownload = addTargetOptions(
|
|
15219
|
-
new
|
|
15318
|
+
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
15319
|
"production"
|
|
15221
15320
|
).action(
|
|
15222
15321
|
(key, raw) => runCommand(() => {
|
|
@@ -15264,11 +15363,11 @@ Fetch it from the bucket directly \u2014 vela does not hold its credentials.`
|
|
|
15264
15363
|
|
|
15265
15364
|
// src/commands/backup/delete.ts
|
|
15266
15365
|
import process45 from "node:process";
|
|
15267
|
-
import { Command as
|
|
15366
|
+
import { Command as Command102 } from "commander";
|
|
15268
15367
|
import * as p63 from "@clack/prompts";
|
|
15269
15368
|
import pc35 from "picocolors";
|
|
15270
15369
|
var backupDelete = addTargetOptions(
|
|
15271
|
-
new
|
|
15370
|
+
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
15371
|
"production"
|
|
15273
15372
|
).action(
|
|
15274
15373
|
(key, raw) => runCommand(() => {
|
|
@@ -15299,12 +15398,12 @@ Run ${pc35.cyan("vela backup list")} to see what it does have.`
|
|
|
15299
15398
|
);
|
|
15300
15399
|
|
|
15301
15400
|
// src/commands/backup/schedule.ts
|
|
15302
|
-
import { Command as
|
|
15401
|
+
import { Command as Command103 } from "commander";
|
|
15303
15402
|
import * as p64 from "@clack/prompts";
|
|
15304
15403
|
import pc36 from "picocolors";
|
|
15305
15404
|
var DEFAULT_KEEP = 7;
|
|
15306
15405
|
var backupSchedule = addTargetOptions(
|
|
15307
|
-
new
|
|
15406
|
+
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
15407
|
"production"
|
|
15309
15408
|
).action(
|
|
15310
15409
|
(cron, raw) => runCommand(() => {
|
|
@@ -15348,18 +15447,18 @@ Set one with ${pc36.cyan('vela backup schedule "0 3 * * *"')}.`
|
|
|
15348
15447
|
);
|
|
15349
15448
|
|
|
15350
15449
|
// src/commands/backup.ts
|
|
15351
|
-
var backup = new
|
|
15450
|
+
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
15451
|
|
|
15353
15452
|
// src/commands/restore.ts
|
|
15354
15453
|
import fs58 from "node:fs";
|
|
15355
15454
|
import path63 from "node:path";
|
|
15356
15455
|
import process46 from "node:process";
|
|
15357
|
-
import { Command as
|
|
15456
|
+
import { Command as Command105 } from "commander";
|
|
15358
15457
|
import * as p65 from "@clack/prompts";
|
|
15359
15458
|
import pc37 from "picocolors";
|
|
15360
15459
|
var restore = addLockWaitOption(
|
|
15361
15460
|
addTargetOptions(
|
|
15362
|
-
new
|
|
15461
|
+
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
15462
|
"production"
|
|
15364
15463
|
)
|
|
15365
15464
|
).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 +15484,7 @@ Run \`vela deploy\` first, then restore.`
|
|
|
15385
15484
|
const local = source && fs58.existsSync(source) ? source : void 0;
|
|
15386
15485
|
const key = local ? void 0 : await resolveKey(ctx, source);
|
|
15387
15486
|
if (!options.yes) {
|
|
15388
|
-
await
|
|
15487
|
+
await confirm14(ctx.appName, ctx.targetName, ctx.envTag, local ?? key);
|
|
15389
15488
|
}
|
|
15390
15489
|
const archive = local ? await stage(ctx, local) : remotePaths.backup(ctx.instance, key);
|
|
15391
15490
|
const result = await runServerScript(ctx.session, "restore.sh", {
|
|
@@ -15484,7 +15583,7 @@ async function stage(ctx, file) {
|
|
|
15484
15583
|
spinner9.stop(`Uploaded ${path63.basename(file)}`);
|
|
15485
15584
|
return remote;
|
|
15486
15585
|
}
|
|
15487
|
-
async function
|
|
15586
|
+
async function confirm14(appName, targetName, envTag, from) {
|
|
15488
15587
|
const what = `${pc37.cyan(`${appName} (${targetName})`)} from ${pc37.cyan(path63.basename(from))}`;
|
|
15489
15588
|
if (isProd(envTag)) {
|
|
15490
15589
|
const answer = await p65.text({
|
|
@@ -15508,7 +15607,7 @@ async function confirm13(appName, targetName, envTag, from) {
|
|
|
15508
15607
|
}
|
|
15509
15608
|
|
|
15510
15609
|
// src/commands/targets.ts
|
|
15511
|
-
import { Command as
|
|
15610
|
+
import { Command as Command106 } from "commander";
|
|
15512
15611
|
import * as p66 from "@clack/prompts";
|
|
15513
15612
|
import pc38 from "picocolors";
|
|
15514
15613
|
import * as v13 from "valibot";
|
|
@@ -15518,7 +15617,7 @@ var OptionsSchema6 = v13.object({
|
|
|
15518
15617
|
offline: v13.optional(v13.boolean())
|
|
15519
15618
|
});
|
|
15520
15619
|
var targets = addSshOptions(
|
|
15521
|
-
new
|
|
15620
|
+
new Command106("targets").description("list the targets this project can deploy to").configureHelp(helpConfig)
|
|
15522
15621
|
).option("--json", "print raw JSON").option("--offline", "skip connecting to servers").action(
|
|
15523
15622
|
(raw) => runCommand(async () => {
|
|
15524
15623
|
const options = parseOptions(OptionsSchema6, raw);
|
|
@@ -15597,14 +15696,14 @@ Release and domain are shown from what this project recorded.`
|
|
|
15597
15696
|
// src/commands/test.ts
|
|
15598
15697
|
import path64 from "node:path";
|
|
15599
15698
|
import process47 from "node:process";
|
|
15600
|
-
import { Command as
|
|
15699
|
+
import { Command as Command107 } from "commander";
|
|
15601
15700
|
import PocketBase7 from "pocketbase";
|
|
15602
15701
|
import pc39 from "picocolors";
|
|
15603
15702
|
import { x as x6 } from "tinyexec";
|
|
15604
15703
|
import { detect as detect9 } from "package-manager-detector";
|
|
15605
15704
|
import { resolveCommand as resolveCommand7 } from "package-manager-detector/commands";
|
|
15606
15705
|
import fs59 from "node:fs";
|
|
15607
|
-
var testServer = new
|
|
15706
|
+
var testServer = new Command107("test:server").description("run server tests").allowUnknownOption(true).allowExcessArguments(true).configureHelp(helpConfig).action(async (_opts, cmd) => {
|
|
15608
15707
|
const cwd = process47.cwd();
|
|
15609
15708
|
warnIfKit2(cwd, (m) => console.warn(pc39.yellow(`\u25B2 ${m}`)));
|
|
15610
15709
|
const email2 = `test-${Math.random().toString(36).slice(2)}@example.com`;
|
|
@@ -15748,7 +15847,7 @@ function stubPagesPlugin() {
|
|
|
15748
15847
|
// src/commands/routes.ts
|
|
15749
15848
|
import fs60 from "node:fs";
|
|
15750
15849
|
import path65 from "node:path";
|
|
15751
|
-
import { Command as
|
|
15850
|
+
import { Command as Command108 } from "commander";
|
|
15752
15851
|
var HTTP_METHODS = /* @__PURE__ */ new Set([
|
|
15753
15852
|
"GET",
|
|
15754
15853
|
"POST",
|
|
@@ -15759,7 +15858,7 @@ var HTTP_METHODS = /* @__PURE__ */ new Set([
|
|
|
15759
15858
|
"HEAD",
|
|
15760
15859
|
"fallback"
|
|
15761
15860
|
]);
|
|
15762
|
-
var routes = new
|
|
15861
|
+
var routes = new Command108("routes").description("list routes").configureHelp(helpConfig).action(async () => {
|
|
15763
15862
|
const { workspaceRootDir, routesDir } = await getWorkspace();
|
|
15764
15863
|
const routesRoot = path65.join(workspaceRootDir, routesDir);
|
|
15765
15864
|
const found = walk(routesRoot, routesRoot).filter((r) => r.methods.length > 0);
|
|
@@ -15837,7 +15936,7 @@ function printTable(routes2) {
|
|
|
15837
15936
|
import fs61 from "node:fs";
|
|
15838
15937
|
import path66 from "node:path";
|
|
15839
15938
|
import process48 from "node:process";
|
|
15840
|
-
import { Command as
|
|
15939
|
+
import { Command as Command109 } from "commander";
|
|
15841
15940
|
import { x as x7 } from "tinyexec";
|
|
15842
15941
|
import { detect as detect10 } from "package-manager-detector";
|
|
15843
15942
|
import { resolveCommand as resolveCommand8 } from "package-manager-detector/commands";
|
|
@@ -15856,24 +15955,24 @@ async function runWuchale(extraArgs) {
|
|
|
15856
15955
|
throwOnError: true
|
|
15857
15956
|
});
|
|
15858
15957
|
}
|
|
15859
|
-
var extract2 = new
|
|
15860
|
-
var watch = new
|
|
15861
|
-
var status2 = new
|
|
15862
|
-
var clean = new
|
|
15863
|
-
var i18n3 = new
|
|
15958
|
+
var extract2 = new Command109("extract").description("extract translatable strings").configureHelp(helpConfig).action(() => runCommand(() => runWuchale([])));
|
|
15959
|
+
var watch = new Command109("watch").description("watch and extract translatable strings").configureHelp(helpConfig).action(() => runCommand(() => runWuchale(["--watch"])));
|
|
15960
|
+
var status2 = new Command109("status").description("show i18n status").configureHelp(helpConfig).action(() => runCommand(() => runWuchale(["status"])));
|
|
15961
|
+
var clean = new Command109("clean").description("clean unused translatable strings").configureHelp(helpConfig).action(() => runCommand(() => runWuchale(["--clean"])));
|
|
15962
|
+
var i18n3 = new Command109("i18n").description("i18n utilities").configureHelp(helpConfig).addCommand(extract2, { isDefault: true }).addCommand(watch).addCommand(status2).addCommand(clean);
|
|
15864
15963
|
|
|
15865
15964
|
// src/commands/cms.ts
|
|
15866
|
-
import { Command as
|
|
15965
|
+
import { Command as Command115 } from "commander";
|
|
15867
15966
|
|
|
15868
15967
|
// src/commands/cms/deploy.ts
|
|
15869
15968
|
import process49 from "node:process";
|
|
15870
|
-
import { Command as
|
|
15969
|
+
import { Command as Command110 } from "commander";
|
|
15871
15970
|
import * as p67 from "@clack/prompts";
|
|
15872
15971
|
import pc40 from "picocolors";
|
|
15873
15972
|
var POLL_INTERVAL2 = 5e3;
|
|
15874
15973
|
var POLL_TIMEOUT = 30 * 6e4;
|
|
15875
15974
|
var inFlight = (run) => run?.status === "pending" || run?.status === "building";
|
|
15876
|
-
var deploy2 = new
|
|
15975
|
+
var deploy2 = new Command110("deploy").description("rebuild the hosted site with the latest published content").option(
|
|
15877
15976
|
"--project <id>",
|
|
15878
15977
|
"velastack.dev project whose site to rebuild, instead of the linked one"
|
|
15879
15978
|
).option("--no-wait", "return once the build has started instead of waiting for it").configureHelp(helpConfig).action(
|
|
@@ -15962,11 +16061,11 @@ async function waitForRun(apiKey, projectId, runId) {
|
|
|
15962
16061
|
}
|
|
15963
16062
|
|
|
15964
16063
|
// src/commands/cms/editor.ts
|
|
15965
|
-
import { Command as
|
|
16064
|
+
import { Command as Command114 } from "commander";
|
|
15966
16065
|
|
|
15967
16066
|
// src/commands/cms/editor/add.ts
|
|
15968
16067
|
import { randomBytes } from "node:crypto";
|
|
15969
|
-
import { Command as
|
|
16068
|
+
import { Command as Command111 } from "commander";
|
|
15970
16069
|
import * as p68 from "@clack/prompts";
|
|
15971
16070
|
import pc42 from "picocolors";
|
|
15972
16071
|
|
|
@@ -16009,7 +16108,7 @@ async function withCmsBackend(fn, cwd = process50.cwd()) {
|
|
|
16009
16108
|
}
|
|
16010
16109
|
|
|
16011
16110
|
// src/commands/cms/editor/add.ts
|
|
16012
|
-
var editorAdd = new
|
|
16111
|
+
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
16112
|
(email2, options) => runCommand(async () => {
|
|
16014
16113
|
const generated = options.password === void 0;
|
|
16015
16114
|
const password8 = options.password ?? randomBytes(12).toString("base64url");
|
|
@@ -16028,10 +16127,10 @@ var editorAdd = new Command109("add").description("create an editor who can sign
|
|
|
16028
16127
|
);
|
|
16029
16128
|
|
|
16030
16129
|
// src/commands/cms/editor/password.ts
|
|
16031
|
-
import { Command as
|
|
16130
|
+
import { Command as Command112 } from "commander";
|
|
16032
16131
|
import * as p69 from "@clack/prompts";
|
|
16033
16132
|
import pc43 from "picocolors";
|
|
16034
|
-
var editorPassword = new
|
|
16133
|
+
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
16134
|
(email2, password8) => runCommand(async () => {
|
|
16036
16135
|
await withCmsBackend((cms3) => cms3.editors.setPassword(email2, password8));
|
|
16037
16136
|
p69.log.success(
|
|
@@ -16041,10 +16140,10 @@ var editorPassword = new Command110("password").description("set an editor's pas
|
|
|
16041
16140
|
);
|
|
16042
16141
|
|
|
16043
16142
|
// src/commands/cms/editor/list.ts
|
|
16044
|
-
import { Command as
|
|
16143
|
+
import { Command as Command113 } from "commander";
|
|
16045
16144
|
import * as p70 from "@clack/prompts";
|
|
16046
16145
|
import pc44 from "picocolors";
|
|
16047
|
-
var editorList = new
|
|
16146
|
+
var editorList = new Command113("list").description("list editors and the projects they may edit").configureHelp(helpConfig).action(
|
|
16048
16147
|
() => runCommand(async () => {
|
|
16049
16148
|
const rows = await withCmsBackend(
|
|
16050
16149
|
async (cms3) => cms3.editors.list().map((editor2) => ({
|
|
@@ -16068,17 +16167,17 @@ var editorList = new Command111("list").description("list editors and the projec
|
|
|
16068
16167
|
);
|
|
16069
16168
|
|
|
16070
16169
|
// src/commands/cms/editor.ts
|
|
16071
|
-
var editor = new
|
|
16170
|
+
var editor = new Command114("editor").description("manage who can sign in to the admin bar").configureHelp(helpConfig).addCommand(editorAdd).addCommand(editorPassword).addCommand(editorList);
|
|
16072
16171
|
|
|
16073
16172
|
// src/commands/cms.ts
|
|
16074
|
-
var cms2 = new
|
|
16173
|
+
var cms2 = new Command115("cms").description("manage the CMS").configureHelp(helpConfig).addCommand(editor).addCommand(deploy2);
|
|
16075
16174
|
|
|
16076
16175
|
// src/commands/workflows.ts
|
|
16077
|
-
import { Command as
|
|
16176
|
+
import { Command as Command119 } from "commander";
|
|
16078
16177
|
|
|
16079
16178
|
// src/commands/workflows/list.ts
|
|
16080
16179
|
import process51 from "node:process";
|
|
16081
|
-
import { Command as
|
|
16180
|
+
import { Command as Command116, InvalidArgumentError as InvalidArgumentError5 } from "commander";
|
|
16082
16181
|
import * as p71 from "@clack/prompts";
|
|
16083
16182
|
import pc45 from "picocolors";
|
|
16084
16183
|
|
|
@@ -16153,7 +16252,7 @@ function formatRun(run, nameWidth) {
|
|
|
16153
16252
|
const error = run.status === "failed" && run.error?.message ? pc45.red(` ${run.error.message}`) : "";
|
|
16154
16253
|
return `${run.id} ${run.workflowName.padEnd(nameWidth)} ${status3}${attempts} ${when}${error}`;
|
|
16155
16254
|
}
|
|
16156
|
-
var workflowsList = new
|
|
16255
|
+
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
16256
|
(options) => runCommand(async () => {
|
|
16158
16257
|
await withPocketbase(process51.cwd(), async (pb) => {
|
|
16159
16258
|
const runs = await listRuns(pb, {
|
|
@@ -16177,7 +16276,7 @@ Start one from server code with ${pc45.cyan("<workflow>.run(input)")}, or with $
|
|
|
16177
16276
|
|
|
16178
16277
|
// src/commands/workflows/run.ts
|
|
16179
16278
|
import process52 from "node:process";
|
|
16180
|
-
import { Command as
|
|
16279
|
+
import { Command as Command117, InvalidArgumentError as InvalidArgumentError6 } from "commander";
|
|
16181
16280
|
import * as p72 from "@clack/prompts";
|
|
16182
16281
|
import pc46 from "picocolors";
|
|
16183
16282
|
function parseInput(value) {
|
|
@@ -16187,7 +16286,7 @@ function parseInput(value) {
|
|
|
16187
16286
|
throw new InvalidArgumentError6(`must be JSON, e.g. '{"userId":"abc"}'.`);
|
|
16188
16287
|
}
|
|
16189
16288
|
}
|
|
16190
|
-
var workflowsRun = new
|
|
16289
|
+
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
16290
|
(name, input) => runCommand(async () => {
|
|
16192
16291
|
await withPocketbase(process52.cwd(), async (pb) => {
|
|
16193
16292
|
const run = await createRun(pb, name, input);
|
|
@@ -16202,10 +16301,10 @@ It runs once the app is up (${pc46.cyan("vela dev")}); ${pc46.cyan("vela workflo
|
|
|
16202
16301
|
|
|
16203
16302
|
// src/commands/workflows/cancel.ts
|
|
16204
16303
|
import process53 from "node:process";
|
|
16205
|
-
import { Command as
|
|
16304
|
+
import { Command as Command118 } from "commander";
|
|
16206
16305
|
import * as p73 from "@clack/prompts";
|
|
16207
16306
|
import pc47 from "picocolors";
|
|
16208
|
-
var workflowsCancel = new
|
|
16307
|
+
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
16308
|
(id) => runCommand(async () => {
|
|
16210
16309
|
await withPocketbase(process53.cwd(), async (pb) => {
|
|
16211
16310
|
const run = await cancelRun(pb, id);
|
|
@@ -16215,7 +16314,7 @@ var workflowsCancel = new Command116("cancel").description("cancel a pending or
|
|
|
16215
16314
|
);
|
|
16216
16315
|
|
|
16217
16316
|
// src/commands/workflows.ts
|
|
16218
|
-
var workflows2 = new
|
|
16317
|
+
var workflows2 = new Command119("workflows").description("list, start and cancel background workflow runs").configureHelp(helpConfig).addCommand(workflowsList).addCommand(workflowsRun).addCommand(workflowsCancel);
|
|
16219
16318
|
|
|
16220
16319
|
// src/program.ts
|
|
16221
16320
|
var NO_BACKEND_COMMMANDS = /* @__PURE__ */ new Set([
|
|
@@ -16279,10 +16378,16 @@ var NO_BACKEND_COMMMANDS = /* @__PURE__ */ new Set([
|
|
|
16279
16378
|
// drop collections and stay gated.
|
|
16280
16379
|
"destroy deployment"
|
|
16281
16380
|
]);
|
|
16282
|
-
var PROVIDER_GATED_COMMANDS = /* @__PURE__ */ new Set([
|
|
16381
|
+
var PROVIDER_GATED_COMMANDS = /* @__PURE__ */ new Set([
|
|
16382
|
+
"enable payments",
|
|
16383
|
+
"disable payments",
|
|
16384
|
+
// Stripe's shop reads PocketBase; Shopify's and WhatsApp's run on a static site.
|
|
16385
|
+
"generate shop",
|
|
16386
|
+
"destroy shop"
|
|
16387
|
+
]);
|
|
16283
16388
|
var BACKEND_OPTIONAL_COMMANDS = /* @__PURE__ */ new Set(["dev", "build", "preview", "deploy"]);
|
|
16284
16389
|
var SELF_CREDENTIALED_COMMANDS = /* @__PURE__ */ new Set(["test:server"]);
|
|
16285
|
-
var program = new
|
|
16390
|
+
var program = new Command120().name(package_default.name).description(package_default.description).version(package_default.version, "-v, --version").configureHelp(helpConfig);
|
|
16286
16391
|
program.hook("preAction", (_thisCommand, actionCommand) => {
|
|
16287
16392
|
const envRoot = findWorkspaceRoot() ?? process54.cwd();
|
|
16288
16393
|
dotenv2.config({ path: nodePath.join(envRoot, ".env"), quiet: true });
|