@betterstart/cli 0.1.4 → 0.1.5
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 +279 -178
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
- package/templates/ui/sidebar.tsx +5 -2
package/dist/cli.js
CHANGED
|
@@ -8395,91 +8395,178 @@ import fs25 from "fs-extra";
|
|
|
8395
8395
|
|
|
8396
8396
|
// src/init/templates/components/cms-globals.ts
|
|
8397
8397
|
function cmsGlobalsCssTemplate() {
|
|
8398
|
-
return
|
|
8399
|
-
|
|
8400
|
-
@
|
|
8401
|
-
|
|
8402
|
-
|
|
8403
|
-
|
|
8404
|
-
|
|
8405
|
-
|
|
8406
|
-
|
|
8407
|
-
|
|
8408
|
-
|
|
8409
|
-
|
|
8410
|
-
|
|
8411
|
-
|
|
8412
|
-
|
|
8413
|
-
|
|
8414
|
-
|
|
8415
|
-
|
|
8416
|
-
|
|
8417
|
-
|
|
8418
|
-
|
|
8419
|
-
|
|
8420
|
-
|
|
8421
|
-
|
|
8422
|
-
|
|
8423
|
-
|
|
8424
|
-
|
|
8425
|
-
|
|
8426
|
-
|
|
8427
|
-
|
|
8428
|
-
|
|
8429
|
-
|
|
8430
|
-
|
|
8431
|
-
|
|
8432
|
-
|
|
8433
|
-
|
|
8434
|
-
|
|
8435
|
-
|
|
8436
|
-
|
|
8437
|
-
|
|
8438
|
-
.
|
|
8439
|
-
|
|
8440
|
-
|
|
8441
|
-
|
|
8442
|
-
|
|
8443
|
-
|
|
8444
|
-
|
|
8445
|
-
|
|
8446
|
-
|
|
8447
|
-
|
|
8448
|
-
|
|
8449
|
-
|
|
8450
|
-
|
|
8451
|
-
|
|
8452
|
-
|
|
8453
|
-
|
|
8454
|
-
|
|
8455
|
-
|
|
8456
|
-
|
|
8457
|
-
|
|
8458
|
-
|
|
8459
|
-
|
|
8460
|
-
|
|
8461
|
-
|
|
8462
|
-
|
|
8463
|
-
|
|
8464
|
-
|
|
8465
|
-
|
|
8466
|
-
|
|
8467
|
-
|
|
8468
|
-
|
|
8469
|
-
|
|
8470
|
-
|
|
8471
|
-
|
|
8472
|
-
|
|
8473
|
-
|
|
8474
|
-
|
|
8475
|
-
|
|
8476
|
-
.
|
|
8477
|
-
|
|
8478
|
-
|
|
8479
|
-
|
|
8480
|
-
|
|
8481
|
-
|
|
8482
|
-
|
|
8398
|
+
return `@import "tailwindcss";
|
|
8399
|
+
|
|
8400
|
+
@custom-variant dark (&:is(.dark *));
|
|
8401
|
+
|
|
8402
|
+
:root {
|
|
8403
|
+
--background: oklch(0.9850 0 0);
|
|
8404
|
+
--foreground: oklch(0 0 0);
|
|
8405
|
+
--card: oklch(1 0 0);
|
|
8406
|
+
--card-foreground: oklch(0 0 0);
|
|
8407
|
+
--popover: oklch(0.9900 0 0);
|
|
8408
|
+
--popover-foreground: oklch(0 0 0);
|
|
8409
|
+
--primary: oklch(0 0 0);
|
|
8410
|
+
--primary-foreground: oklch(1 0 0);
|
|
8411
|
+
--secondary: oklch(0.9700 0 0);
|
|
8412
|
+
--secondary-foreground: oklch(0 0 0);
|
|
8413
|
+
--muted: oklch(0.9700 0 0);
|
|
8414
|
+
--muted-foreground: oklch(0.4400 0 0);
|
|
8415
|
+
--accent: oklch(0.9700 0 0);
|
|
8416
|
+
--accent-foreground: oklch(0 0 0);
|
|
8417
|
+
--destructive: oklch(0.6300 0.1900 23.0300);
|
|
8418
|
+
--destructive-foreground: oklch(1 0 0);
|
|
8419
|
+
--border: oklch(0.9200 0 0);
|
|
8420
|
+
--input: oklch(0.9400 0 0);
|
|
8421
|
+
--ring: oklch(0 0 0);
|
|
8422
|
+
--chart-1: oklch(0.8100 0.1700 75.3500);
|
|
8423
|
+
--chart-2: oklch(0.5500 0.2200 264.5300);
|
|
8424
|
+
--chart-3: oklch(0.7200 0 0);
|
|
8425
|
+
--chart-4: oklch(0.9200 0 0);
|
|
8426
|
+
--chart-5: oklch(0.5600 0 0);
|
|
8427
|
+
--sidebar: oklch(1 0 0);
|
|
8428
|
+
--sidebar-foreground: oklch(0 0 0);
|
|
8429
|
+
--sidebar-primary: oklch(0 0 0);
|
|
8430
|
+
--sidebar-primary-foreground: oklch(1 0 0);
|
|
8431
|
+
--sidebar-accent: oklch(0.9400 0 0);
|
|
8432
|
+
--sidebar-accent-foreground: oklch(0 0 0);
|
|
8433
|
+
--sidebar-border: oklch(0.9400 0 0);
|
|
8434
|
+
--sidebar-ring: oklch(0 0 0);
|
|
8435
|
+
--font-sans: Geist, sans-serif;
|
|
8436
|
+
--font-serif: Georgia, serif;
|
|
8437
|
+
--font-mono: Geist Mono, monospace;
|
|
8438
|
+
--radius: 0.4rem;
|
|
8439
|
+
--shadow-x: 0px;
|
|
8440
|
+
--shadow-y: 1px;
|
|
8441
|
+
--shadow-blur: 3px;
|
|
8442
|
+
--shadow-spread: 0px;
|
|
8443
|
+
--shadow-opacity: 0.02;
|
|
8444
|
+
--shadow-color: hsl(0 0% 0%);
|
|
8445
|
+
--shadow-2xs: 0px 1px 3px 0px hsl(0 0% 0% / 0.01);
|
|
8446
|
+
--shadow-xs: 0px 1px 3px 0px hsl(0 0% 0% / 0.01);
|
|
8447
|
+
--shadow-sm: 0px 1px 3px 0px hsl(0 0% 0% / 0.02), 0px 1px 2px -1px hsl(0 0% 0% / 0.02);
|
|
8448
|
+
--shadow: 0px 1px 3px 0px hsl(0 0% 0% / 0.02), 0px 1px 2px -1px hsl(0 0% 0% / 0.02);
|
|
8449
|
+
--shadow-md: 0px 1px 3px 0px hsl(0 0% 0% / 0.02), 0px 2px 4px -1px hsl(0 0% 0% / 0.02);
|
|
8450
|
+
--shadow-lg: 0px 1px 3px 0px hsl(0 0% 0% / 0.02), 0px 4px 6px -1px hsl(0 0% 0% / 0.02);
|
|
8451
|
+
--shadow-xl: 0px 1px 3px 0px hsl(0 0% 0% / 0.02), 0px 8px 10px -1px hsl(0 0% 0% / 0.02);
|
|
8452
|
+
--shadow-2xl: 0px 1px 3px 0px hsl(0 0% 0% / 0.05);
|
|
8453
|
+
--tracking-normal: 0em;
|
|
8454
|
+
--spacing: 0.25rem;
|
|
8455
|
+
}
|
|
8456
|
+
|
|
8457
|
+
.dark {
|
|
8458
|
+
--background: oklch(0 0 0);
|
|
8459
|
+
--foreground: oklch(1 0 0);
|
|
8460
|
+
--card: oklch(0.1400 0 0);
|
|
8461
|
+
--card-foreground: oklch(1 0 0);
|
|
8462
|
+
--popover: oklch(0.1800 0 0);
|
|
8463
|
+
--popover-foreground: oklch(1 0 0);
|
|
8464
|
+
--primary: oklch(1 0 0);
|
|
8465
|
+
--primary-foreground: oklch(0 0 0);
|
|
8466
|
+
--secondary: oklch(0.2500 0 0);
|
|
8467
|
+
--secondary-foreground: oklch(1 0 0);
|
|
8468
|
+
--muted: oklch(0.2300 0 0);
|
|
8469
|
+
--muted-foreground: oklch(0.7200 0 0);
|
|
8470
|
+
--accent: oklch(0.3200 0 0);
|
|
8471
|
+
--accent-foreground: oklch(1 0 0);
|
|
8472
|
+
--destructive: oklch(0.6900 0.2000 23.9100);
|
|
8473
|
+
--destructive-foreground: oklch(0 0 0);
|
|
8474
|
+
--border: oklch(0.2600 0 0);
|
|
8475
|
+
--input: oklch(0.3200 0 0);
|
|
8476
|
+
--ring: oklch(0.7200 0 0);
|
|
8477
|
+
--chart-1: oklch(0.8100 0.1700 75.3500);
|
|
8478
|
+
--chart-2: oklch(0.5800 0.2100 260.8400);
|
|
8479
|
+
--chart-3: oklch(0.5600 0 0);
|
|
8480
|
+
--chart-4: oklch(0.4400 0 0);
|
|
8481
|
+
--chart-5: oklch(0.9200 0 0);
|
|
8482
|
+
--sidebar: oklch(0.1800 0 0);
|
|
8483
|
+
--sidebar-foreground: oklch(1 0 0);
|
|
8484
|
+
--sidebar-primary: oklch(1 0 0);
|
|
8485
|
+
--sidebar-primary-foreground: oklch(0 0 0);
|
|
8486
|
+
--sidebar-accent: oklch(0.3200 0 0);
|
|
8487
|
+
--sidebar-accent-foreground: oklch(1 0 0);
|
|
8488
|
+
--sidebar-border: oklch(0.3200 0 0);
|
|
8489
|
+
--sidebar-ring: oklch(0.7200 0 0);
|
|
8490
|
+
--font-sans: Geist, sans-serif;
|
|
8491
|
+
--font-serif: Georgia, serif;
|
|
8492
|
+
--font-mono: Geist Mono, monospace;
|
|
8493
|
+
--radius: 0.4rem;
|
|
8494
|
+
--shadow-x: 0px;
|
|
8495
|
+
--shadow-y: 1px;
|
|
8496
|
+
--shadow-blur: 3px;
|
|
8497
|
+
--shadow-spread: 0px;
|
|
8498
|
+
--shadow-opacity: 0.02;
|
|
8499
|
+
--shadow-color: hsl(0 0% 0%);
|
|
8500
|
+
--shadow-2xs: 0px 1px 3px 0px hsl(0 0% 0% / 0.01);
|
|
8501
|
+
--shadow-xs: 0px 1px 3px 0px hsl(0 0% 0% / 0.01);
|
|
8502
|
+
--shadow-sm: 0px 1px 3px 0px hsl(0 0% 0% / 0.02), 0px 1px 2px -1px hsl(0 0% 0% / 0.02);
|
|
8503
|
+
--shadow: 0px 1px 3px 0px hsl(0 0% 0% / 0.02), 0px 1px 2px -1px hsl(0 0% 0% / 0.02);
|
|
8504
|
+
--shadow-md: 0px 1px 3px 0px hsl(0 0% 0% / 0.02), 0px 2px 4px -1px hsl(0 0% 0% / 0.02);
|
|
8505
|
+
--shadow-lg: 0px 1px 3px 0px hsl(0 0% 0% / 0.02), 0px 4px 6px -1px hsl(0 0% 0% / 0.02);
|
|
8506
|
+
--shadow-xl: 0px 1px 3px 0px hsl(0 0% 0% / 0.02), 0px 8px 10px -1px hsl(0 0% 0% / 0.02);
|
|
8507
|
+
--shadow-2xl: 0px 1px 3px 0px hsl(0 0% 0% / 0.05);
|
|
8508
|
+
}
|
|
8509
|
+
|
|
8510
|
+
@theme inline {
|
|
8511
|
+
--color-background: var(--background);
|
|
8512
|
+
--color-foreground: var(--foreground);
|
|
8513
|
+
--color-card: var(--card);
|
|
8514
|
+
--color-card-foreground: var(--card-foreground);
|
|
8515
|
+
--color-popover: var(--popover);
|
|
8516
|
+
--color-popover-foreground: var(--popover-foreground);
|
|
8517
|
+
--color-primary: var(--primary);
|
|
8518
|
+
--color-primary-foreground: var(--primary-foreground);
|
|
8519
|
+
--color-secondary: var(--secondary);
|
|
8520
|
+
--color-secondary-foreground: var(--secondary-foreground);
|
|
8521
|
+
--color-muted: var(--muted);
|
|
8522
|
+
--color-muted-foreground: var(--muted-foreground);
|
|
8523
|
+
--color-accent: var(--accent);
|
|
8524
|
+
--color-accent-foreground: var(--accent-foreground);
|
|
8525
|
+
--color-destructive: var(--destructive);
|
|
8526
|
+
--color-destructive-foreground: var(--destructive-foreground);
|
|
8527
|
+
--color-border: var(--border);
|
|
8528
|
+
--color-input: var(--input);
|
|
8529
|
+
--color-ring: var(--ring);
|
|
8530
|
+
--color-chart-1: var(--chart-1);
|
|
8531
|
+
--color-chart-2: var(--chart-2);
|
|
8532
|
+
--color-chart-3: var(--chart-3);
|
|
8533
|
+
--color-chart-4: var(--chart-4);
|
|
8534
|
+
--color-chart-5: var(--chart-5);
|
|
8535
|
+
--color-sidebar: var(--sidebar);
|
|
8536
|
+
--color-sidebar-foreground: var(--sidebar-foreground);
|
|
8537
|
+
--color-sidebar-primary: var(--sidebar-primary);
|
|
8538
|
+
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
|
|
8539
|
+
--color-sidebar-accent: var(--sidebar-accent);
|
|
8540
|
+
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
|
|
8541
|
+
--color-sidebar-border: var(--sidebar-border);
|
|
8542
|
+
--color-sidebar-ring: var(--sidebar-ring);
|
|
8543
|
+
|
|
8544
|
+
--font-sans: var(--font-sans);
|
|
8545
|
+
--font-mono: var(--font-mono);
|
|
8546
|
+
--font-serif: var(--font-serif);
|
|
8547
|
+
|
|
8548
|
+
--radius-sm: calc(var(--radius) - 4px);
|
|
8549
|
+
--radius-md: calc(var(--radius) - 2px);
|
|
8550
|
+
--radius-lg: var(--radius);
|
|
8551
|
+
--radius-xl: calc(var(--radius) + 4px);
|
|
8552
|
+
|
|
8553
|
+
--shadow-2xs: var(--shadow-2xs);
|
|
8554
|
+
--shadow-xs: var(--shadow-xs);
|
|
8555
|
+
--shadow-sm: var(--shadow-sm);
|
|
8556
|
+
--shadow: var(--shadow);
|
|
8557
|
+
--shadow-md: var(--shadow-md);
|
|
8558
|
+
--shadow-lg: var(--shadow-lg);
|
|
8559
|
+
--shadow-xl: var(--shadow-xl);
|
|
8560
|
+
--shadow-2xl: var(--shadow-2xl);
|
|
8561
|
+
}
|
|
8562
|
+
|
|
8563
|
+
@layer base {
|
|
8564
|
+
* {
|
|
8565
|
+
@apply border-border outline-ring/50;
|
|
8566
|
+
}
|
|
8567
|
+
body {
|
|
8568
|
+
@apply bg-background text-foreground;
|
|
8569
|
+
}
|
|
8483
8570
|
}
|
|
8484
8571
|
|
|
8485
8572
|
/* Editor styles */
|
|
@@ -8970,7 +9057,14 @@ export function CmsProviders({ children }: { children: React.ReactNode }) {
|
|
|
8970
9057
|
|
|
8971
9058
|
// src/init/templates/components/layout/cms-sidebar.ts
|
|
8972
9059
|
function cmsSidebarTemplate() {
|
|
8973
|
-
return `import {
|
|
9060
|
+
return `import { getSession } from '@cms/auth/middleware'
|
|
9061
|
+
import { Avatar, AvatarFallback, AvatarImage } from '@cms/components/ui/avatar'
|
|
9062
|
+
import {
|
|
9063
|
+
Collapsible,
|
|
9064
|
+
CollapsibleContent,
|
|
9065
|
+
CollapsibleTrigger,
|
|
9066
|
+
} from '@cms/components/ui/collapsible'
|
|
9067
|
+
import {
|
|
8974
9068
|
Sidebar,
|
|
8975
9069
|
SidebarContent,
|
|
8976
9070
|
SidebarFooter,
|
|
@@ -8984,15 +9078,9 @@ function cmsSidebarTemplate() {
|
|
|
8984
9078
|
SidebarRail,
|
|
8985
9079
|
SidebarTrigger,
|
|
8986
9080
|
} from '@cms/components/ui/sidebar'
|
|
8987
|
-
import {
|
|
8988
|
-
Collapsible,
|
|
8989
|
-
CollapsibleContent,
|
|
8990
|
-
CollapsibleTrigger,
|
|
8991
|
-
} from '@cms/components/ui/collapsible'
|
|
8992
|
-
import { cmsNavigation, type CmsNavigationItem } from '@cms/data/navigation'
|
|
8993
|
-
import { getSession } from '@cms/auth/middleware'
|
|
8994
|
-
import Link from 'next/link'
|
|
9081
|
+
import { type CmsNavigationItem, cmsNavigation } from '@cms/data/navigation'
|
|
8995
9082
|
import { ChevronRight } from 'lucide-react'
|
|
9083
|
+
import Link from 'next/link'
|
|
8996
9084
|
|
|
8997
9085
|
function NavItem({ item }: { item: CmsNavigationItem }) {
|
|
8998
9086
|
if (item.children && item.children.length > 0) {
|
|
@@ -9043,10 +9131,18 @@ export async function CmsSidebar(props: React.ComponentProps<typeof Sidebar>) {
|
|
|
9043
9131
|
|
|
9044
9132
|
return (
|
|
9045
9133
|
<Sidebar collapsible="icon" {...props}>
|
|
9046
|
-
<SidebarHeader className="border-b border-border h-
|
|
9134
|
+
<SidebarHeader className="border-b border-border h-14 items-center flex w-full">
|
|
9047
9135
|
<div className="flex items-center gap-2 w-full relative h-full">
|
|
9048
|
-
<div className="flex items-center
|
|
9049
|
-
<
|
|
9136
|
+
<div className="flex items-center gap-2 w-full">
|
|
9137
|
+
<Avatar className="size-8">
|
|
9138
|
+
<AvatarImage src={user?.image ?? ''} />
|
|
9139
|
+
<AvatarFallback className="text-sm font-semibold">
|
|
9140
|
+
{user?.name?.charAt(0)}
|
|
9141
|
+
</AvatarFallback>
|
|
9142
|
+
</Avatar>
|
|
9143
|
+
<div className="flex items-center gap-1 w-full group-data-[collapsible=icon]:hidden">
|
|
9144
|
+
<span className="text-base font-bold">CMS</span>
|
|
9145
|
+
</div>
|
|
9050
9146
|
</div>
|
|
9051
9147
|
<SidebarTrigger className="hidden md:flex" />
|
|
9052
9148
|
</div>
|
|
@@ -11389,6 +11485,7 @@ export default function CmsLayout({ children }: { children: React.ReactNode }) {
|
|
|
11389
11485
|
function dashboardPageTemplate() {
|
|
11390
11486
|
return `import { PageHeader } from '@cms/components/shared/page-header'
|
|
11391
11487
|
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@cms/components/ui/card'
|
|
11488
|
+
import { Badge } from '@cms/components/ui/badge'
|
|
11392
11489
|
import { FileText, Settings, Users } from 'lucide-react'
|
|
11393
11490
|
import Link from 'next/link'
|
|
11394
11491
|
|
|
@@ -11446,6 +11543,38 @@ export default function DashboardPage() {
|
|
|
11446
11543
|
</Link>
|
|
11447
11544
|
))}
|
|
11448
11545
|
</div>
|
|
11546
|
+
<Card>
|
|
11547
|
+
<CardHeader>
|
|
11548
|
+
<CardTitle className="text-sm font-medium">Environment</CardTitle>
|
|
11549
|
+
<CardDescription>Current configuration status</CardDescription>
|
|
11550
|
+
</CardHeader>
|
|
11551
|
+
<CardContent className="space-y-3">
|
|
11552
|
+
<div className="flex items-center justify-between">
|
|
11553
|
+
<span className="text-sm text-muted-foreground">Environment</span>
|
|
11554
|
+
<Badge variant="outline">
|
|
11555
|
+
{process.env.NODE_ENV === 'production' ? 'Production' : 'Development'}
|
|
11556
|
+
</Badge>
|
|
11557
|
+
</div>
|
|
11558
|
+
<div className="flex items-center justify-between">
|
|
11559
|
+
<span className="text-sm text-muted-foreground">Database</span>
|
|
11560
|
+
<Badge variant="outline">
|
|
11561
|
+
{process.env.BETTERSTART_DATABASE_URL ? 'Connected' : 'Not configured'}
|
|
11562
|
+
</Badge>
|
|
11563
|
+
</div>
|
|
11564
|
+
<div className="flex items-center justify-between">
|
|
11565
|
+
<span className="text-sm text-muted-foreground">Storage (R2)</span>
|
|
11566
|
+
<Badge variant="outline">
|
|
11567
|
+
{process.env.BETTERSTART_R2_BUCKET_NAME ? 'Configured' : 'Not configured'}
|
|
11568
|
+
</Badge>
|
|
11569
|
+
</div>
|
|
11570
|
+
<div className="flex items-center justify-between">
|
|
11571
|
+
<span className="text-sm text-muted-foreground">Email (Resend)</span>
|
|
11572
|
+
<Badge variant="outline">
|
|
11573
|
+
{process.env.BETTERSTART_RESEND_API_KEY ? 'Configured' : 'Not configured'}
|
|
11574
|
+
</Badge>
|
|
11575
|
+
</div>
|
|
11576
|
+
</CardContent>
|
|
11577
|
+
</Card>
|
|
11449
11578
|
</div>
|
|
11450
11579
|
</div>
|
|
11451
11580
|
)
|
|
@@ -11567,67 +11696,6 @@ export function LoginForm() {
|
|
|
11567
11696
|
`;
|
|
11568
11697
|
}
|
|
11569
11698
|
|
|
11570
|
-
// src/init/templates/pages/settings-page.ts
|
|
11571
|
-
function settingsPageTemplate() {
|
|
11572
|
-
return `import { PageHeader } from '@cms/components/shared/page-header'
|
|
11573
|
-
import {
|
|
11574
|
-
Card,
|
|
11575
|
-
CardContent,
|
|
11576
|
-
CardDescription,
|
|
11577
|
-
CardHeader,
|
|
11578
|
-
CardTitle
|
|
11579
|
-
} from '@cms/components/ui/card'
|
|
11580
|
-
import { Badge } from '@cms/components/ui/badge'
|
|
11581
|
-
|
|
11582
|
-
export default function SettingsPage() {
|
|
11583
|
-
return (
|
|
11584
|
-
<div className="flex flex-col">
|
|
11585
|
-
<div className="flex items-center justify-between bg-card px-6 py-4 border-b">
|
|
11586
|
-
<PageHeader
|
|
11587
|
-
title="Settings"
|
|
11588
|
-
description="Manage your CMS configuration"
|
|
11589
|
-
/>
|
|
11590
|
-
</div>
|
|
11591
|
-
<div className="p-6 space-y-6 max-w-2xl">
|
|
11592
|
-
<Card>
|
|
11593
|
-
<CardHeader>
|
|
11594
|
-
<CardTitle className="text-sm font-medium">General</CardTitle>
|
|
11595
|
-
<CardDescription>CMS environment information</CardDescription>
|
|
11596
|
-
</CardHeader>
|
|
11597
|
-
<CardContent className="space-y-3">
|
|
11598
|
-
<div className="flex items-center justify-between">
|
|
11599
|
-
<span className="text-sm text-muted-foreground">Environment</span>
|
|
11600
|
-
<Badge variant="outline">
|
|
11601
|
-
{process.env.NODE_ENV === 'production' ? 'Production' : 'Development'}
|
|
11602
|
-
</Badge>
|
|
11603
|
-
</div>
|
|
11604
|
-
<div className="flex items-center justify-between">
|
|
11605
|
-
<span className="text-sm text-muted-foreground">Database</span>
|
|
11606
|
-
<Badge variant="outline">
|
|
11607
|
-
{process.env.BETTERSTART_DATABASE_URL ? 'Connected' : 'Not configured'}
|
|
11608
|
-
</Badge>
|
|
11609
|
-
</div>
|
|
11610
|
-
<div className="flex items-center justify-between">
|
|
11611
|
-
<span className="text-sm text-muted-foreground">Storage (R2)</span>
|
|
11612
|
-
<Badge variant="outline">
|
|
11613
|
-
{process.env.BETTERSTART_R2_BUCKET_NAME ? 'Configured' : 'Not configured'}
|
|
11614
|
-
</Badge>
|
|
11615
|
-
</div>
|
|
11616
|
-
<div className="flex items-center justify-between">
|
|
11617
|
-
<span className="text-sm text-muted-foreground">Email (Resend)</span>
|
|
11618
|
-
<Badge variant="outline">
|
|
11619
|
-
{process.env.BETTERSTART_RESEND_API_KEY ? 'Configured' : 'Not configured'}
|
|
11620
|
-
</Badge>
|
|
11621
|
-
</div>
|
|
11622
|
-
</CardContent>
|
|
11623
|
-
</Card>
|
|
11624
|
-
</div>
|
|
11625
|
-
</div>
|
|
11626
|
-
)
|
|
11627
|
-
}
|
|
11628
|
-
`;
|
|
11629
|
-
}
|
|
11630
|
-
|
|
11631
11699
|
// src/init/templates/pages/users/create-user-dialog.ts
|
|
11632
11700
|
function createUserDialogTemplate() {
|
|
11633
11701
|
return `'use client'
|
|
@@ -12212,7 +12280,6 @@ function scaffoldLayout({ cwd, config }) {
|
|
|
12212
12280
|
write(path31.join(usersDir, "columns.tsx"), usersColumnsTemplate());
|
|
12213
12281
|
write(path31.join(usersDir, "create-user-dialog.tsx"), createUserDialogTemplate());
|
|
12214
12282
|
write(path31.join(usersDir, "edit-role-dialog.tsx"), editRoleDialogTemplate());
|
|
12215
|
-
write(path31.join(config.paths.pages, "settings", "page.tsx"), settingsPageTemplate());
|
|
12216
12283
|
return created;
|
|
12217
12284
|
}
|
|
12218
12285
|
|
|
@@ -12394,6 +12461,34 @@ function blogPostsSchema() {
|
|
|
12394
12461
|
);
|
|
12395
12462
|
}
|
|
12396
12463
|
|
|
12464
|
+
// src/init/templates/presets/default-settings.ts
|
|
12465
|
+
function defaultSettingsSchema() {
|
|
12466
|
+
return JSON.stringify(
|
|
12467
|
+
{
|
|
12468
|
+
name: "settings",
|
|
12469
|
+
type: "single",
|
|
12470
|
+
label: "Settings",
|
|
12471
|
+
description: "General site settings",
|
|
12472
|
+
icon: "Settings",
|
|
12473
|
+
fields: [
|
|
12474
|
+
{ name: "siteName", type: "string", label: "Site Name", required: true },
|
|
12475
|
+
{ name: "tagline", type: "string", label: "Tagline" },
|
|
12476
|
+
{ name: "separator1", type: "separator" },
|
|
12477
|
+
{ name: "logo", type: "image", label: "Logo" },
|
|
12478
|
+
{ name: "favicon", type: "image", label: "Favicon" },
|
|
12479
|
+
{ name: "separator2", type: "separator" },
|
|
12480
|
+
{ name: "contactEmail", type: "string", label: "Contact Email" },
|
|
12481
|
+
{ name: "socialTwitter", type: "string", label: "Twitter / X URL" },
|
|
12482
|
+
{ name: "socialInstagram", type: "string", label: "Instagram URL" },
|
|
12483
|
+
{ name: "socialLinkedin", type: "string", label: "LinkedIn URL" },
|
|
12484
|
+
{ name: "socialGithub", type: "string", label: "GitHub URL" }
|
|
12485
|
+
]
|
|
12486
|
+
},
|
|
12487
|
+
null,
|
|
12488
|
+
2
|
|
12489
|
+
);
|
|
12490
|
+
}
|
|
12491
|
+
|
|
12397
12492
|
// src/init/templates/presets/full-contact.ts
|
|
12398
12493
|
function fullContactSchema() {
|
|
12399
12494
|
return JSON.stringify(
|
|
@@ -12551,16 +12646,25 @@ function fullNavigationSchema() {
|
|
|
12551
12646
|
|
|
12552
12647
|
// src/init/scaffolders/preset.ts
|
|
12553
12648
|
function getPresetSchemas(preset) {
|
|
12554
|
-
if (preset === "blank") return [];
|
|
12555
12649
|
const schemas = [
|
|
12556
12650
|
{
|
|
12557
|
-
filename: "
|
|
12558
|
-
content:
|
|
12651
|
+
filename: "settings.json",
|
|
12652
|
+
content: defaultSettingsSchema(),
|
|
12559
12653
|
isForm: false,
|
|
12560
|
-
isSingle:
|
|
12561
|
-
}
|
|
12562
|
-
{ filename: "posts.json", content: blogPostsSchema(), isForm: false, isSingle: false }
|
|
12654
|
+
isSingle: true
|
|
12655
|
+
}
|
|
12563
12656
|
];
|
|
12657
|
+
if (preset !== "blank") {
|
|
12658
|
+
schemas.push(
|
|
12659
|
+
{
|
|
12660
|
+
filename: "categories.json",
|
|
12661
|
+
content: blogCategoriesSchema(),
|
|
12662
|
+
isForm: false,
|
|
12663
|
+
isSingle: false
|
|
12664
|
+
},
|
|
12665
|
+
{ filename: "posts.json", content: blogPostsSchema(), isForm: false, isSingle: false }
|
|
12666
|
+
);
|
|
12667
|
+
}
|
|
12564
12668
|
if (preset === "full") {
|
|
12565
12669
|
schemas.push(
|
|
12566
12670
|
{
|
|
@@ -12589,7 +12693,6 @@ function scaffoldPreset({
|
|
|
12589
12693
|
generatedFiles: [],
|
|
12590
12694
|
errors: []
|
|
12591
12695
|
};
|
|
12592
|
-
if (preset === "blank") return result;
|
|
12593
12696
|
const schemasDir = path32.join(cwd, config.paths?.schemas ?? "./cms/schemas");
|
|
12594
12697
|
const presetSchemas = getPresetSchemas(preset);
|
|
12595
12698
|
for (const ps of presetSchemas) {
|
|
@@ -13097,19 +13200,17 @@ var initCommand = new Command2("init").description("Scaffold CMS into a new or e
|
|
|
13097
13200
|
${pc.cyan(`${pm} add -D ${depsResult.devDeps.join(" ")}`)}`
|
|
13098
13201
|
);
|
|
13099
13202
|
}
|
|
13100
|
-
|
|
13101
|
-
|
|
13102
|
-
|
|
13103
|
-
|
|
13104
|
-
|
|
13105
|
-
|
|
13106
|
-
p3.log.warning(` ${err}`);
|
|
13107
|
-
}
|
|
13108
|
-
} else {
|
|
13109
|
-
s.stop(
|
|
13110
|
-
`Created ${presetResult.schemas.length} schemas, generated ${presetResult.generatedFiles.length} files`
|
|
13111
|
-
);
|
|
13203
|
+
s.start(`Applying ${features.preset} preset...`);
|
|
13204
|
+
const presetResult = scaffoldPreset({ cwd, config, preset: features.preset });
|
|
13205
|
+
if (presetResult.errors.length > 0) {
|
|
13206
|
+
s.stop(`Preset applied with ${presetResult.errors.length} warning(s)`);
|
|
13207
|
+
for (const err of presetResult.errors) {
|
|
13208
|
+
p3.log.warning(` ${err}`);
|
|
13112
13209
|
}
|
|
13210
|
+
} else {
|
|
13211
|
+
s.stop(
|
|
13212
|
+
`Created ${presetResult.schemas.length} schemas, generated ${presetResult.generatedFiles.length} files`
|
|
13213
|
+
);
|
|
13113
13214
|
}
|
|
13114
13215
|
if (depsResult.success && hasDbUrl(cwd)) {
|
|
13115
13216
|
s.start("Pushing database schema (drizzle-kit push)...");
|