@flaredev/cli 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/flare.js +9 -1
- package/dist/index.js +751 -280
- package/package.json +2 -2
- package/templates/app/app/admin/page.tsx +9 -61
- package/templates/app/app/dashboard/account/page.tsx +6 -4
- package/templates/app/app/{admin → dashboard}/actions.ts +109 -11
- package/templates/app/app/dashboard/import-actions.ts +91 -0
- package/templates/app/app/dashboard/layout.tsx +42 -39
- package/templates/app/app/dashboard/observability/page.tsx +174 -0
- package/templates/app/app/dashboard/page.tsx +106 -25
- package/templates/app/app/verify-email/page.tsx +33 -0
- package/templates/app/components/account/security-settings.tsx +6 -9
- package/templates/app/components/auth/otp-input.tsx +95 -0
- package/templates/app/components/auth/password-field.tsx +116 -0
- package/templates/app/components/auth/password-forms.tsx +76 -79
- package/templates/app/components/auth/sign-in-flow.tsx +306 -315
- package/templates/app/components/auth/sign-up-form.tsx +93 -101
- package/templates/app/components/auth/two-factor-form.tsx +139 -124
- package/templates/app/components/auth/use-resend.ts +44 -0
- package/templates/app/components/auth/verify-email-form.tsx +135 -0
- package/templates/app/components/{admin/admin-header.tsx → dashboard/dashboard-header.tsx} +78 -78
- package/templates/app/components/{admin/resource-nav.tsx → dashboard/dashboard-sidebar.tsx} +166 -120
- package/templates/app/components/dashboard/export-button.tsx +41 -0
- package/templates/app/components/{admin → dashboard}/fields/file-field.tsx +302 -302
- package/templates/app/components/dashboard/import-dialog.tsx +487 -0
- package/templates/app/components/dashboard/page-header.tsx +57 -0
- package/templates/app/components/dashboard/resource-form-dialog.tsx +80 -0
- package/templates/app/components/{admin → dashboard}/resource-form-page.tsx +61 -55
- package/templates/app/components/{admin → dashboard}/resource-form.tsx +165 -139
- package/templates/app/components/dashboard/resource-stats.tsx +53 -0
- package/templates/app/components/{admin → dashboard}/resource-table.tsx +331 -281
- package/templates/app/components/{admin → dashboard}/row-actions.tsx +144 -111
- package/templates/app/components/dashboard/stat-card.tsx +69 -0
- package/templates/app/components/dashboard/table-selection.tsx +185 -0
- package/templates/app/components/dashboard/traffic-chart.tsx +32 -0
- package/templates/app/db/flare-schema.ts +33 -1
- package/templates/app/lib/analytics.ts +121 -0
- package/templates/app/lib/audit.ts +80 -0
- package/templates/app/lib/auth-config.ts +38 -33
- package/templates/app/lib/auth.ts +34 -0
- package/templates/app/lib/cache.ts +83 -83
- package/templates/app/lib/csv.ts +24 -0
- package/templates/app/lib/dashboard-nav.ts +15 -0
- package/templates/app/lib/{admin.ts → dashboard.ts} +138 -103
- package/templates/app/lib/password-rules.ts +159 -0
- package/templates/app/lib/site.ts +56 -47
- package/templates/app/migrations/0000_init.sql +15 -3
- package/templates/app/migrations/meta/0000_snapshot.json +97 -1
- package/templates/app/migrations/meta/_journal.json +1 -1
- package/templates/app/worker-configuration.d.ts +15764 -0
- package/templates/locks/package-lock.json +9189 -0
- package/templates/locks/pnpm-lock.yaml +6347 -0
- package/templates/app/app/admin/layout.tsx +0 -32
- package/templates/app/components/dashboard/dashboard-nav.tsx +0 -35
- package/templates/app/lib/admin-nav.ts +0 -15
- /package/templates/app/components/{admin → dashboard}/fields/country-field.tsx +0 -0
- /package/templates/app/components/{admin → dashboard}/fields/date-field.tsx +0 -0
- /package/templates/app/components/{admin → dashboard}/fields/field-widget.tsx +0 -0
- /package/templates/app/components/{admin → dashboard}/fields/multi-select-field.tsx +0 -0
- /package/templates/app/components/{admin → dashboard}/fields/phone-field.tsx +0 -0
- /package/templates/app/components/{admin → dashboard}/fields/relation-field.tsx +0 -0
- /package/templates/app/components/{admin → dashboard}/query.ts +0 -0
- /package/templates/app/components/{admin → dashboard}/resource-icon.tsx +0 -0
- /package/templates/app/components/{admin → dashboard}/resource-table-toolbar.tsx +0 -0
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { cookies } from "next/headers";
|
|
2
|
-
import { SidebarInset, SidebarProvider } from "@/components/ui/sidebar";
|
|
3
|
-
import { Toaster } from "@/components/ui/sonner";
|
|
4
|
-
import { AdminHeader, type Theme } from "@/components/admin/admin-header";
|
|
5
|
-
import { ResourceNav } from "@/components/admin/resource-nav";
|
|
6
|
-
import { adminLinks } from "@/lib/admin-nav";
|
|
7
|
-
import { requireAdmin, visibleResources } from "@/lib/admin";
|
|
8
|
-
|
|
9
|
-
export default async function AdminLayout({ children }: { children: React.ReactNode }) {
|
|
10
|
-
const { session } = await requireAdmin();
|
|
11
|
-
const jar = await cookies();
|
|
12
|
-
const theme = (jar.get("flare-theme")?.value ?? "system") as Theme;
|
|
13
|
-
const collapsed = jar.get("sidebar_state")?.value === "false";
|
|
14
|
-
|
|
15
|
-
const resources = (await visibleResources()).map((resource) => ({
|
|
16
|
-
name: resource.name,
|
|
17
|
-
pluralLabel: resource.pluralLabel,
|
|
18
|
-
slug: resource.slug,
|
|
19
|
-
icon: resource.icon,
|
|
20
|
-
}));
|
|
21
|
-
|
|
22
|
-
return (
|
|
23
|
-
<SidebarProvider defaultOpen={!collapsed}>
|
|
24
|
-
<ResourceNav appName="__APP_NAME__" resources={resources} links={adminLinks} />
|
|
25
|
-
<SidebarInset>
|
|
26
|
-
<AdminHeader user={{ name: session.user.name, email: session.user.email }} initialTheme={theme} />
|
|
27
|
-
<main className="flex-1 p-6 md:p-8">{children}</main>
|
|
28
|
-
</SidebarInset>
|
|
29
|
-
<Toaster theme={theme} />
|
|
30
|
-
</SidebarProvider>
|
|
31
|
-
);
|
|
32
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import Link from "next/link";
|
|
4
|
-
import { usePathname } from "next/navigation";
|
|
5
|
-
import { cn } from "@/lib/utils";
|
|
6
|
-
|
|
7
|
-
export interface NavLink {
|
|
8
|
-
href: string;
|
|
9
|
-
label: string;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
/** The dashboard's section links, with the current one marked. */
|
|
13
|
-
export function DashboardNav({ links }: { links: NavLink[] }) {
|
|
14
|
-
const pathname = usePathname();
|
|
15
|
-
return (
|
|
16
|
-
<nav aria-label="Dashboard" className="-mb-px flex gap-1 overflow-x-auto">
|
|
17
|
-
{links.map((link) => {
|
|
18
|
-
const current = link.href === "/dashboard" ? pathname === "/dashboard" : pathname.startsWith(link.href);
|
|
19
|
-
return (
|
|
20
|
-
<Link
|
|
21
|
-
key={link.href}
|
|
22
|
-
href={link.href}
|
|
23
|
-
aria-current={current ? "page" : undefined}
|
|
24
|
-
className={cn(
|
|
25
|
-
"border-b-2 px-3 py-3 text-sm font-medium whitespace-nowrap text-foreground-muted transition-colors hover:text-foreground",
|
|
26
|
-
current ? "border-brand text-foreground" : "border-transparent",
|
|
27
|
-
)}
|
|
28
|
-
>
|
|
29
|
-
{link.label}
|
|
30
|
-
</Link>
|
|
31
|
-
);
|
|
32
|
-
})}
|
|
33
|
-
</nav>
|
|
34
|
-
);
|
|
35
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// Extra admin sidebar links (maintained by flare generators such as `flare gen security`).
|
|
2
|
-
// Add your own links outside the generated block.
|
|
3
|
-
// generated:start
|
|
4
|
-
export interface AdminLink {
|
|
5
|
-
label: string;
|
|
6
|
-
href: string;
|
|
7
|
-
/** A resource icon name, e.g. "shield" (see components/admin/resource-icon.tsx). */
|
|
8
|
-
icon: string;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export const generatedAdminLinks: AdminLink[] = [];
|
|
12
|
-
// generated:end
|
|
13
|
-
|
|
14
|
-
/** Links shown under "Platform" in the admin sidebar. */
|
|
15
|
-
export const adminLinks: AdminLink[] = [...generatedAdminLinks, { label: "API reference", href: "/api/reference", icon: "book" }];
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|