@betterstart/cli 0.1.20 → 0.1.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +80 -49
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-SAPJG4NO.js";
|
|
5
5
|
|
|
6
6
|
// src/cli.ts
|
|
7
|
-
import { Command as
|
|
7
|
+
import { Command as Command6 } from "commander";
|
|
8
8
|
|
|
9
9
|
// src/commands/generate.ts
|
|
10
10
|
import path22 from "path";
|
|
@@ -2758,11 +2758,11 @@ function generateActions(schema, cwd, actionsDir, options = {}) {
|
|
|
2758
2758
|
const listFieldsWithRels = findListFieldsWithRelationships(dbFields);
|
|
2759
2759
|
const hasListRels = listFieldsWithRels.length > 0;
|
|
2760
2760
|
const allListRelQueries = [];
|
|
2761
|
-
for (const { field: listField, path:
|
|
2761
|
+
for (const { field: listField, path: path40 } of listFieldsWithRels) {
|
|
2762
2762
|
const rels = (listField.fields || []).filter((f) => f.type === "relationship" && f.relationship);
|
|
2763
2763
|
for (const relField of rels) {
|
|
2764
2764
|
allListRelQueries.push({
|
|
2765
|
-
fieldPath:
|
|
2765
|
+
fieldPath: path40.join("_"),
|
|
2766
2766
|
relField,
|
|
2767
2767
|
relTable: toCamelCase3(relField.relationship),
|
|
2768
2768
|
listFieldName: listField.name
|
|
@@ -8704,37 +8704,37 @@ function cmsGlobalsCssTemplate() {
|
|
|
8704
8704
|
@custom-variant dark (&:is(.dark *));
|
|
8705
8705
|
|
|
8706
8706
|
:root {
|
|
8707
|
-
--background: oklch(0.
|
|
8707
|
+
--background: oklch(0.985 0 0);
|
|
8708
8708
|
--foreground: oklch(0 0 0);
|
|
8709
8709
|
--card: oklch(1 0 0);
|
|
8710
8710
|
--card-foreground: oklch(0 0 0);
|
|
8711
|
-
--popover: oklch(0.
|
|
8711
|
+
--popover: oklch(0.99 0 0);
|
|
8712
8712
|
--popover-foreground: oklch(0 0 0);
|
|
8713
8713
|
--primary: oklch(0 0 0);
|
|
8714
8714
|
--primary-foreground: oklch(1 0 0);
|
|
8715
|
-
--secondary: oklch(0.
|
|
8715
|
+
--secondary: oklch(0.97 0 0);
|
|
8716
8716
|
--secondary-foreground: oklch(0 0 0);
|
|
8717
|
-
--muted: oklch(0.
|
|
8718
|
-
--muted-foreground: oklch(0.
|
|
8719
|
-
--accent: oklch(0.
|
|
8717
|
+
--muted: oklch(0.97 0 0);
|
|
8718
|
+
--muted-foreground: oklch(0.44 0 0);
|
|
8719
|
+
--accent: oklch(0.97 0 0);
|
|
8720
8720
|
--accent-foreground: oklch(0 0 0);
|
|
8721
|
-
--destructive: oklch(0.
|
|
8721
|
+
--destructive: oklch(0.63 0.19 23.03);
|
|
8722
8722
|
--destructive-foreground: oklch(1 0 0);
|
|
8723
|
-
--border: oklch(0.
|
|
8724
|
-
--input: oklch(0.
|
|
8723
|
+
--border: oklch(0.92 0 0);
|
|
8724
|
+
--input: oklch(0.99 0 0);
|
|
8725
8725
|
--ring: oklch(0 0 0);
|
|
8726
|
-
--chart-1: oklch(0.
|
|
8727
|
-
--chart-2: oklch(0.
|
|
8728
|
-
--chart-3: oklch(0.
|
|
8729
|
-
--chart-4: oklch(0.
|
|
8730
|
-
--chart-5: oklch(0.
|
|
8726
|
+
--chart-1: oklch(0.81 0.17 75.35);
|
|
8727
|
+
--chart-2: oklch(0.55 0.22 264.53);
|
|
8728
|
+
--chart-3: oklch(0.72 0 0);
|
|
8729
|
+
--chart-4: oklch(0.92 0 0);
|
|
8730
|
+
--chart-5: oklch(0.56 0 0);
|
|
8731
8731
|
--sidebar: oklch(1 0 0);
|
|
8732
8732
|
--sidebar-foreground: oklch(0 0 0);
|
|
8733
8733
|
--sidebar-primary: oklch(0 0 0);
|
|
8734
8734
|
--sidebar-primary-foreground: oklch(1 0 0);
|
|
8735
|
-
--sidebar-accent: oklch(0.
|
|
8735
|
+
--sidebar-accent: oklch(0.94 0 0);
|
|
8736
8736
|
--sidebar-accent-foreground: oklch(0 0 0);
|
|
8737
|
-
--sidebar-border: oklch(0.
|
|
8737
|
+
--sidebar-border: oklch(0.94 0 0);
|
|
8738
8738
|
--sidebar-ring: oklch(0 0 0);
|
|
8739
8739
|
--font-sans: Geist, sans-serif;
|
|
8740
8740
|
--font-serif: Georgia, serif;
|
|
@@ -8748,11 +8748,16 @@ function cmsGlobalsCssTemplate() {
|
|
|
8748
8748
|
--shadow-color: hsl(0 0% 0%);
|
|
8749
8749
|
--shadow-2xs: 0px 1px 3px 0px hsl(0 0% 0% / 0.01);
|
|
8750
8750
|
--shadow-xs: 0px 1px 3px 0px hsl(0 0% 0% / 0.01);
|
|
8751
|
-
--shadow-sm:
|
|
8752
|
-
|
|
8753
|
-
--shadow
|
|
8754
|
-
|
|
8755
|
-
--shadow-
|
|
8751
|
+
--shadow-sm:
|
|
8752
|
+
0px 1px 3px 0px hsl(0 0% 0% / 0.02), 0px 1px 2px -1px hsl(0 0% 0% / 0.02);
|
|
8753
|
+
--shadow:
|
|
8754
|
+
0px 1px 3px 0px hsl(0 0% 0% / 0.02), 0px 1px 2px -1px hsl(0 0% 0% / 0.02);
|
|
8755
|
+
--shadow-md:
|
|
8756
|
+
0px 1px 3px 0px hsl(0 0% 0% / 0.02), 0px 2px 4px -1px hsl(0 0% 0% / 0.02);
|
|
8757
|
+
--shadow-lg:
|
|
8758
|
+
0px 1px 3px 0px hsl(0 0% 0% / 0.02), 0px 4px 6px -1px hsl(0 0% 0% / 0.02);
|
|
8759
|
+
--shadow-xl:
|
|
8760
|
+
0px 1px 3px 0px hsl(0 0% 0% / 0.02), 0px 8px 10px -1px hsl(0 0% 0% / 0.02);
|
|
8756
8761
|
--shadow-2xl: 0px 1px 3px 0px hsl(0 0% 0% / 0.05);
|
|
8757
8762
|
--tracking-normal: 0em;
|
|
8758
8763
|
--spacing: 0.25rem;
|
|
@@ -8761,36 +8766,36 @@ function cmsGlobalsCssTemplate() {
|
|
|
8761
8766
|
.dark {
|
|
8762
8767
|
--background: oklch(0 0 0);
|
|
8763
8768
|
--foreground: oklch(1 0 0);
|
|
8764
|
-
--card: oklch(0.
|
|
8769
|
+
--card: oklch(0.14 0 0);
|
|
8765
8770
|
--card-foreground: oklch(1 0 0);
|
|
8766
|
-
--popover: oklch(0.
|
|
8771
|
+
--popover: oklch(0.18 0 0);
|
|
8767
8772
|
--popover-foreground: oklch(1 0 0);
|
|
8768
8773
|
--primary: oklch(1 0 0);
|
|
8769
8774
|
--primary-foreground: oklch(0 0 0);
|
|
8770
|
-
--secondary: oklch(0.
|
|
8775
|
+
--secondary: oklch(0.25 0 0);
|
|
8771
8776
|
--secondary-foreground: oklch(1 0 0);
|
|
8772
|
-
--muted: oklch(0.
|
|
8773
|
-
--muted-foreground: oklch(0.
|
|
8774
|
-
--accent: oklch(0.
|
|
8777
|
+
--muted: oklch(0.23 0 0);
|
|
8778
|
+
--muted-foreground: oklch(0.72 0 0);
|
|
8779
|
+
--accent: oklch(0.32 0 0);
|
|
8775
8780
|
--accent-foreground: oklch(1 0 0);
|
|
8776
|
-
--destructive: oklch(0.
|
|
8781
|
+
--destructive: oklch(0.69 0.2 23.91);
|
|
8777
8782
|
--destructive-foreground: oklch(0 0 0);
|
|
8778
|
-
--border: oklch(0.
|
|
8779
|
-
--input: oklch(0.
|
|
8780
|
-
--ring: oklch(0.
|
|
8781
|
-
--chart-1: oklch(0.
|
|
8782
|
-
--chart-2: oklch(0.
|
|
8783
|
-
--chart-3: oklch(0.
|
|
8784
|
-
--chart-4: oklch(0.
|
|
8785
|
-
--chart-5: oklch(0.
|
|
8786
|
-
--sidebar: oklch(0.
|
|
8783
|
+
--border: oklch(0.26 0 0);
|
|
8784
|
+
--input: oklch(0.32 0 0);
|
|
8785
|
+
--ring: oklch(0.72 0 0);
|
|
8786
|
+
--chart-1: oklch(0.81 0.17 75.35);
|
|
8787
|
+
--chart-2: oklch(0.58 0.21 260.84);
|
|
8788
|
+
--chart-3: oklch(0.56 0 0);
|
|
8789
|
+
--chart-4: oklch(0.44 0 0);
|
|
8790
|
+
--chart-5: oklch(0.92 0 0);
|
|
8791
|
+
--sidebar: oklch(0.18 0 0);
|
|
8787
8792
|
--sidebar-foreground: oklch(1 0 0);
|
|
8788
8793
|
--sidebar-primary: oklch(1 0 0);
|
|
8789
8794
|
--sidebar-primary-foreground: oklch(0 0 0);
|
|
8790
|
-
--sidebar-accent: oklch(0.
|
|
8795
|
+
--sidebar-accent: oklch(0.32 0 0);
|
|
8791
8796
|
--sidebar-accent-foreground: oklch(1 0 0);
|
|
8792
|
-
--sidebar-border: oklch(0.
|
|
8793
|
-
--sidebar-ring: oklch(0.
|
|
8797
|
+
--sidebar-border: oklch(0.32 0 0);
|
|
8798
|
+
--sidebar-ring: oklch(0.72 0 0);
|
|
8794
8799
|
--font-sans: Geist, sans-serif;
|
|
8795
8800
|
--font-serif: Georgia, serif;
|
|
8796
8801
|
--font-mono: Geist Mono, monospace;
|
|
@@ -8803,11 +8808,16 @@ function cmsGlobalsCssTemplate() {
|
|
|
8803
8808
|
--shadow-color: hsl(0 0% 0%);
|
|
8804
8809
|
--shadow-2xs: 0px 1px 3px 0px hsl(0 0% 0% / 0.01);
|
|
8805
8810
|
--shadow-xs: 0px 1px 3px 0px hsl(0 0% 0% / 0.01);
|
|
8806
|
-
--shadow-sm:
|
|
8807
|
-
|
|
8808
|
-
--shadow
|
|
8809
|
-
|
|
8810
|
-
--shadow-
|
|
8811
|
+
--shadow-sm:
|
|
8812
|
+
0px 1px 3px 0px hsl(0 0% 0% / 0.02), 0px 1px 2px -1px hsl(0 0% 0% / 0.02);
|
|
8813
|
+
--shadow:
|
|
8814
|
+
0px 1px 3px 0px hsl(0 0% 0% / 0.02), 0px 1px 2px -1px hsl(0 0% 0% / 0.02);
|
|
8815
|
+
--shadow-md:
|
|
8816
|
+
0px 1px 3px 0px hsl(0 0% 0% / 0.02), 0px 2px 4px -1px hsl(0 0% 0% / 0.02);
|
|
8817
|
+
--shadow-lg:
|
|
8818
|
+
0px 1px 3px 0px hsl(0 0% 0% / 0.02), 0px 4px 6px -1px hsl(0 0% 0% / 0.02);
|
|
8819
|
+
--shadow-xl:
|
|
8820
|
+
0px 1px 3px 0px hsl(0 0% 0% / 0.02), 0px 8px 10px -1px hsl(0 0% 0% / 0.02);
|
|
8811
8821
|
--shadow-2xl: 0px 1px 3px 0px hsl(0 0% 0% / 0.05);
|
|
8812
8822
|
}
|
|
8813
8823
|
|
|
@@ -14290,12 +14300,33 @@ var removeCommand = new Command4("remove").alias("rm").description("Remove all g
|
|
|
14290
14300
|
console.log("");
|
|
14291
14301
|
});
|
|
14292
14302
|
|
|
14303
|
+
// src/commands/update-styles.ts
|
|
14304
|
+
import fs34 from "fs";
|
|
14305
|
+
import path39 from "path";
|
|
14306
|
+
import * as clack2 from "@clack/prompts";
|
|
14307
|
+
import { Command as Command5 } from "commander";
|
|
14308
|
+
var updateStylesCommand = new Command5("update-styles").description("Replace cms-globals.css with the latest version from the CLI").option("--cwd <path>", "Project root path").action(async (options) => {
|
|
14309
|
+
const cwd = options.cwd ? path39.resolve(options.cwd) : process.cwd();
|
|
14310
|
+
clack2.intro("BetterStart Update Styles");
|
|
14311
|
+
const config = await resolveConfig(cwd);
|
|
14312
|
+
const cmsDir = config.paths?.cms ?? "./cms";
|
|
14313
|
+
const targetPath = path39.join(cwd, cmsDir, "components", "cms-globals.css");
|
|
14314
|
+
if (!fs34.existsSync(targetPath)) {
|
|
14315
|
+
clack2.cancel(`cms-globals.css not found at ${path39.relative(cwd, targetPath)}`);
|
|
14316
|
+
process.exit(1);
|
|
14317
|
+
}
|
|
14318
|
+
fs34.writeFileSync(targetPath, cmsGlobalsCssTemplate(), "utf-8");
|
|
14319
|
+
clack2.log.success(`Updated ${path39.relative(cwd, targetPath)}`);
|
|
14320
|
+
clack2.outro("Styles updated");
|
|
14321
|
+
});
|
|
14322
|
+
|
|
14293
14323
|
// src/cli.ts
|
|
14294
|
-
var program = new
|
|
14324
|
+
var program = new Command6();
|
|
14295
14325
|
program.name("betterstart").description("Scaffold a full-featured CMS into any Next.js 16 application").version("0.1.0");
|
|
14296
14326
|
program.addCommand(initCommand);
|
|
14297
14327
|
program.addCommand(generateCommand);
|
|
14298
14328
|
program.addCommand(removeCommand);
|
|
14299
14329
|
program.addCommand(seedCommand);
|
|
14330
|
+
program.addCommand(updateStylesCommand);
|
|
14300
14331
|
program.parse();
|
|
14301
14332
|
//# sourceMappingURL=cli.js.map
|