vela 0.14.2 → 0.14.4
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 +2 -1
- package/dist/bin.js +39 -26
- package/dist/bin.js.map +2 -2
- package/package.json +3 -3
- package/templates/server/apply.sh +6 -6
- package/templates/server/lib.sh +45 -2
- package/templates/server/restore.sh +1 -1
- package/templates/server/rollback.sh +1 -1
package/README.md
CHANGED
|
@@ -110,12 +110,13 @@ keeps deploying to the same instance, now with a database.
|
|
|
110
110
|
Much of `vela` needs neither. In a plain `npx sv create` project, with no setup:
|
|
111
111
|
|
|
112
112
|
- `vela generate schema` and `vela generate form`, the form in plain HTML
|
|
113
|
+
- `vela generate scaffold` once there is a backend: a plain HTML table, detail page and forms
|
|
113
114
|
- `vela enable i18n`, `ai`, `analytics`, `content-negotiation` and `cms`
|
|
114
115
|
- `vela legal` and `vela routes`
|
|
115
116
|
- `vela deploy`, `env`, `status`, `logs` and `rollback`
|
|
116
117
|
|
|
117
118
|
`vela ui`, `vela enable blog`, `vela enable auth` and what builds on it, and
|
|
118
|
-
`vela generate scaffold` write shadcn-svelte markup. Without it they refuse before
|
|
119
|
+
`vela generate scaffold --remote` write shadcn-svelte markup. Without it they refuse before
|
|
119
120
|
changing anything and name the setup: `npx sv add tailwindcss`, then
|
|
120
121
|
`npx shadcn-svelte@latest init`.
|
|
121
122
|
|
package/dist/bin.js
CHANGED
|
@@ -21,7 +21,7 @@ import pc43 from "picocolors";
|
|
|
21
21
|
// package.json
|
|
22
22
|
var package_default = {
|
|
23
23
|
name: "vela",
|
|
24
|
-
version: "0.14.
|
|
24
|
+
version: "0.14.4",
|
|
25
25
|
type: "module",
|
|
26
26
|
description: "A CLI for creating and updating SvelteKit projects",
|
|
27
27
|
license: "MIT",
|
|
@@ -57,9 +57,9 @@ 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.3.
|
|
60
|
+
"@velastack/patterns": "^0.3.3",
|
|
61
61
|
"@velastack/pocketbase-codegen": "^0.1.0",
|
|
62
|
-
"annotate-json-schema": "^0.1.
|
|
62
|
+
"annotate-json-schema": "^0.1.1",
|
|
63
63
|
commander: "^13.1.0",
|
|
64
64
|
"cross-spawn": "^7.0.6",
|
|
65
65
|
dedent: "^1.7.2",
|
|
@@ -2839,7 +2839,7 @@ async function runPattern(slug2, argv, input, report4, after) {
|
|
|
2839
2839
|
if (pattern.requires.ui === "shadcn" && features.ui !== "shadcn") {
|
|
2840
2840
|
assertShadcn(`vela ${pattern.command.base.replace(/^vela /, "")}`, workspaceRootDir);
|
|
2841
2841
|
}
|
|
2842
|
-
const
|
|
2842
|
+
const log52 = p10.taskLog({ title: report4.task.title });
|
|
2843
2843
|
let result;
|
|
2844
2844
|
try {
|
|
2845
2845
|
result = await pattern.generate({
|
|
@@ -2860,11 +2860,11 @@ async function runPattern(slug2, argv, input, report4, after) {
|
|
|
2860
2860
|
});
|
|
2861
2861
|
return collections2;
|
|
2862
2862
|
},
|
|
2863
|
-
logger: { info: (message) =>
|
|
2863
|
+
logger: { info: (message) => log52.message(message) }
|
|
2864
2864
|
});
|
|
2865
|
-
|
|
2865
|
+
log52.success(report4.task.success);
|
|
2866
2866
|
} catch (e) {
|
|
2867
|
-
|
|
2867
|
+
log52.error(report4.task.error);
|
|
2868
2868
|
throw e;
|
|
2869
2869
|
}
|
|
2870
2870
|
let afterError;
|
|
@@ -3367,12 +3367,20 @@ import * as p17 from "@clack/prompts";
|
|
|
3367
3367
|
var scaffold = new Command7("scaffold").description("generate a full CRUD scaffold (model, forms, list, detail)").argument("[model]", "model name").argument("[fields...]", "field definitions").option("--remote", "generate create/update forms with SvelteKit remote functions").option(
|
|
3368
3368
|
"--route <route>",
|
|
3369
3369
|
'place the scaffold at a custom route (e.g. "(app)/[team_id]/projects"). Defaults to the pluralized model name under the (app) or (public) group, or src/routes when it has neither.'
|
|
3370
|
+
).option(
|
|
3371
|
+
"--ui <ui>",
|
|
3372
|
+
'markup to generate: "shadcn" components or "plain" HTML. Defaults to shadcn when the project has shadcn-svelte, plain otherwise. --remote needs shadcn.'
|
|
3370
3373
|
).option(
|
|
3371
3374
|
"--ai <description>",
|
|
3372
3375
|
"design the scaffold with AI from a natural-language description (two stages: schema \u2192 layout)"
|
|
3373
3376
|
).allowUnknownOption(true).allowExcessArguments(true).configureHelp(helpConfig).action(
|
|
3374
3377
|
(model, fields, options) => runCommand(async () => {
|
|
3375
|
-
|
|
3378
|
+
if (options.remote) {
|
|
3379
|
+
if (options.ui === "plain") {
|
|
3380
|
+
throw new Error("--remote has no plain variant; drop --ui plain or --remote.");
|
|
3381
|
+
}
|
|
3382
|
+
assertShadcn("vela generate scaffold --remote");
|
|
3383
|
+
}
|
|
3376
3384
|
let argv;
|
|
3377
3385
|
let modelName;
|
|
3378
3386
|
let sidecarPath = null;
|
|
@@ -3400,6 +3408,11 @@ var scaffold = new Command7("scaffold").description("generate a full CRUD scaffo
|
|
|
3400
3408
|
argv = [model, ...fields];
|
|
3401
3409
|
modelName = model;
|
|
3402
3410
|
}
|
|
3411
|
+
const { workspaceRootDir, features } = await getWorkspace();
|
|
3412
|
+
const formInput = resolveFormInput(workspaceRootDir, features.ui, options.ui);
|
|
3413
|
+
if (features.ui === "plain" && !options.ui) {
|
|
3414
|
+
p17.log.info("shadcn-svelte not detected: generating plain HTML pages.");
|
|
3415
|
+
}
|
|
3403
3416
|
const slug2 = options.remote ? "generate-scaffold-remote" : "generate-scaffold";
|
|
3404
3417
|
const nextSteps = [
|
|
3405
3418
|
`Run \`vela fixtures generate\` to create 10 ${modelName} records for development.`,
|
|
@@ -3414,7 +3427,7 @@ var scaffold = new Command7("scaffold").description("generate a full CRUD scaffo
|
|
|
3414
3427
|
await runPattern(
|
|
3415
3428
|
slug2,
|
|
3416
3429
|
argv,
|
|
3417
|
-
{ route: options.route },
|
|
3430
|
+
{ route: options.route, ...formInput },
|
|
3418
3431
|
{
|
|
3419
3432
|
summary: `Created ${modelName} scaffold.`,
|
|
3420
3433
|
nextSteps,
|
|
@@ -3672,9 +3685,9 @@ function backendNextSteps(ui2) {
|
|
|
3672
3685
|
}
|
|
3673
3686
|
return [
|
|
3674
3687
|
dev2,
|
|
3675
|
-
"Run `vela generate
|
|
3688
|
+
"Run `vela generate scaffold <model> <fields...>` to add a collection with CRUD pages in plain HTML.",
|
|
3676
3689
|
"Run `vela test:server` to run the server tests that come with it.",
|
|
3677
|
-
"`vela enable auth`
|
|
3690
|
+
"`vela enable auth` needs shadcn-svelte: `npx sv add tailwindcss`, then `npx shadcn-svelte@latest init`."
|
|
3678
3691
|
];
|
|
3679
3692
|
}
|
|
3680
3693
|
async function initPocketbase(root, { email: email2, password: password11 }) {
|
|
@@ -6613,18 +6626,18 @@ var add = new Command50("add").description("add ui components (shadcn-svelte ite
|
|
|
6613
6626
|
(components, options) => runCommand(async () => {
|
|
6614
6627
|
const { workspaceRootDir } = await getWorkspace();
|
|
6615
6628
|
assertShadcn("vela ui add", workspaceRootDir);
|
|
6616
|
-
const
|
|
6629
|
+
const log52 = p31.taskLog({ title: "Adding UI components..." });
|
|
6617
6630
|
let outcome;
|
|
6618
6631
|
try {
|
|
6619
6632
|
outcome = await installComponents({
|
|
6620
6633
|
root: workspaceRootDir,
|
|
6621
6634
|
components,
|
|
6622
6635
|
overwrite: options.overwrite,
|
|
6623
|
-
logger: { info: (message) =>
|
|
6636
|
+
logger: { info: (message) => log52.message(message) }
|
|
6624
6637
|
});
|
|
6625
|
-
|
|
6638
|
+
log52.success("UI components ready");
|
|
6626
6639
|
} catch (e) {
|
|
6627
|
-
|
|
6640
|
+
log52.error("Could not add UI components");
|
|
6628
6641
|
throw e;
|
|
6629
6642
|
}
|
|
6630
6643
|
reportResult(uiAddReport(components, outcome));
|
|
@@ -6639,13 +6652,13 @@ var base = new Command51("base").description("change the base (gray) palette").a
|
|
|
6639
6652
|
(color) => runCommand(async () => {
|
|
6640
6653
|
const { workspaceRootDir } = await getWorkspace();
|
|
6641
6654
|
assertShadcn("vela ui base", workspaceRootDir);
|
|
6642
|
-
const
|
|
6655
|
+
const log52 = p32.taskLog({ title: `Applying the ${color} palette...` });
|
|
6643
6656
|
let outcome;
|
|
6644
6657
|
try {
|
|
6645
6658
|
outcome = await applyBaseColor({ root: workspaceRootDir, color });
|
|
6646
|
-
|
|
6659
|
+
log52.success("Palette applied");
|
|
6647
6660
|
} catch (e) {
|
|
6648
|
-
|
|
6661
|
+
log52.error("Could not change the base color");
|
|
6649
6662
|
throw e;
|
|
6650
6663
|
}
|
|
6651
6664
|
reportResult({
|
|
@@ -6754,14 +6767,14 @@ var style = new Command53("style").description("switch the shadcn-svelte style,
|
|
|
6754
6767
|
assertShadcn("vela ui style", workspaceRootDir);
|
|
6755
6768
|
const spinner8 = p34.spinner();
|
|
6756
6769
|
spinner8.start(`Reading the ${name} registry...`);
|
|
6757
|
-
let
|
|
6770
|
+
let log52;
|
|
6758
6771
|
let outcome;
|
|
6759
6772
|
try {
|
|
6760
6773
|
outcome = await switchStyle({
|
|
6761
6774
|
root: workspaceRootDir,
|
|
6762
6775
|
style: name,
|
|
6763
6776
|
font: options.font,
|
|
6764
|
-
logger: { info: (message) =>
|
|
6777
|
+
logger: { info: (message) => log52?.message(message) },
|
|
6765
6778
|
confirm: async (components) => {
|
|
6766
6779
|
spinner8.stop(`Read the ${name} registry`);
|
|
6767
6780
|
if (components.length > 0) {
|
|
@@ -6778,13 +6791,13 @@ ${components.map((c) => `- ${c}`).join("\n")}`
|
|
|
6778
6791
|
const ok = await p34.confirm({ message: `Switch to ${name}?`, initialValue: false });
|
|
6779
6792
|
if (p34.isCancel(ok) || !ok) return false;
|
|
6780
6793
|
}
|
|
6781
|
-
|
|
6794
|
+
log52 = p34.taskLog({ title: `Switching to the ${name} style...` });
|
|
6782
6795
|
return true;
|
|
6783
6796
|
}
|
|
6784
6797
|
});
|
|
6785
6798
|
} catch (e) {
|
|
6786
6799
|
spinner8.stop(`Could not switch to ${name}`);
|
|
6787
|
-
|
|
6800
|
+
log52?.error("Could not switch style");
|
|
6788
6801
|
throw e;
|
|
6789
6802
|
}
|
|
6790
6803
|
spinner8.stop(`Read the ${name} registry`);
|
|
@@ -6796,7 +6809,7 @@ ${components.map((c) => `- ${c}`).join("\n")}`
|
|
|
6796
6809
|
p34.cancel("Operation cancelled.");
|
|
6797
6810
|
return;
|
|
6798
6811
|
}
|
|
6799
|
-
|
|
6812
|
+
log52?.success("Style switched");
|
|
6800
6813
|
reportResult(uiStyleReport(outcome));
|
|
6801
6814
|
}, "Failed to switch style.")
|
|
6802
6815
|
);
|
|
@@ -6809,13 +6822,13 @@ var theme = new Command54("theme").description("change the accent color, keeping
|
|
|
6809
6822
|
(accent) => runCommand(async () => {
|
|
6810
6823
|
const { workspaceRootDir } = await getWorkspace();
|
|
6811
6824
|
assertShadcn("vela ui theme", workspaceRootDir);
|
|
6812
|
-
const
|
|
6825
|
+
const log52 = p35.taskLog({ title: `Applying the ${accent} accent...` });
|
|
6813
6826
|
let outcome;
|
|
6814
6827
|
try {
|
|
6815
6828
|
outcome = await applyTheme({ root: workspaceRootDir, theme: accent });
|
|
6816
|
-
|
|
6829
|
+
log52.success("Accent applied");
|
|
6817
6830
|
} catch (e) {
|
|
6818
|
-
|
|
6831
|
+
log52.error("Could not change the accent");
|
|
6819
6832
|
throw e;
|
|
6820
6833
|
}
|
|
6821
6834
|
reportResult({
|