flarecms 0.2.1 → 0.2.3

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.
Files changed (126) hide show
  1. package/dist/api/lib/cache.d.ts +18 -0
  2. package/dist/api/lib/response.d.ts +44 -0
  3. package/dist/api/middlewares/auth.d.ts +10 -0
  4. package/dist/api/middlewares/cors.d.ts +1 -0
  5. package/dist/api/middlewares/rbac.d.ts +21 -0
  6. package/dist/api/routes/auth.d.ts +6 -0
  7. package/dist/api/routes/collections.d.ts +6 -0
  8. package/dist/api/routes/content.d.ts +6 -0
  9. package/dist/api/routes/device.d.ts +6 -0
  10. package/dist/api/routes/magic.d.ts +6 -0
  11. package/dist/api/routes/mcp.d.ts +6 -0
  12. package/dist/api/routes/oauth.d.ts +6 -0
  13. package/dist/api/routes/plugins.d.ts +6 -0
  14. package/dist/api/routes/settings.d.ts +6 -0
  15. package/dist/api/routes/setup.d.ts +6 -0
  16. package/dist/api/routes/tokens.d.ts +6 -0
  17. package/dist/api/schemas/auth.d.ts +12 -0
  18. package/dist/api/schemas/index.d.ts +43 -0
  19. package/dist/api/schemas/tokens.d.ts +20 -0
  20. package/dist/auth/index.d.ts +11 -0
  21. package/dist/cli/commands.d.ts +3 -0
  22. package/dist/cli/commands.js +50 -28
  23. package/dist/cli/index.d.ts +2 -0
  24. package/dist/cli/index.js +50 -28
  25. package/dist/cli/mcp.d.ts +9 -0
  26. package/dist/cli/tests/cli.test.d.ts +1 -0
  27. package/dist/cli/tests/create-plugin-template.test.d.ts +1 -0
  28. package/dist/cli/tests/create.test.d.ts +1 -0
  29. package/dist/cli/tests/plugin.test.d.ts +1 -0
  30. package/dist/cli/tests/publish.test.d.ts +1 -0
  31. package/dist/client/FlareAdminRouter.d.ts +20 -0
  32. package/dist/client/app.d.ts +1 -0
  33. package/dist/client/components/app-sidebar.d.ts +5 -0
  34. package/dist/client/components/blocks/block-card.d.ts +7 -0
  35. package/dist/client/components/blocks/block-form.d.ts +7 -0
  36. package/dist/client/components/blocks/block-renderer.d.ts +10 -0
  37. package/dist/client/components/blocks/block-table.d.ts +7 -0
  38. package/dist/client/components/collection-modal.d.ts +6 -0
  39. package/dist/client/components/content-list.d.ts +3 -0
  40. package/dist/client/components/dynamic-form.d.ts +9 -0
  41. package/dist/client/components/field-modal.d.ts +8 -0
  42. package/dist/client/components/plugin-widget.d.ts +6 -0
  43. package/dist/client/components/settings/api-token-section.d.ts +1 -0
  44. package/dist/client/components/settings/general-section.d.ts +1 -0
  45. package/dist/client/components/settings/security-section.d.ts +1 -0
  46. package/dist/client/components/settings/seo-section.d.ts +1 -0
  47. package/dist/client/components/settings/signup-section.d.ts +1 -0
  48. package/dist/client/components/ui/accordion.d.ts +6 -0
  49. package/dist/client/components/ui/avatar.d.ts +11 -0
  50. package/dist/client/components/ui/badge.d.ts +7 -0
  51. package/dist/client/components/ui/button.d.ts +11 -0
  52. package/dist/client/components/ui/card.d.ts +11 -0
  53. package/dist/client/components/ui/checkbox.d.ts +3 -0
  54. package/dist/client/components/ui/collapsible.d.ts +5 -0
  55. package/dist/client/components/ui/dialog.d.ts +17 -0
  56. package/dist/client/components/ui/icon-picker.d.ts +27 -0
  57. package/dist/client/components/ui/icons-data.d.ts +5 -0
  58. package/dist/client/components/ui/input.d.ts +3 -0
  59. package/dist/client/components/ui/label.d.ts +3 -0
  60. package/dist/client/components/ui/popover.d.ts +10 -0
  61. package/dist/client/components/ui/select.d.ts +15 -0
  62. package/dist/client/components/ui/separator.d.ts +3 -0
  63. package/dist/client/components/ui/sheet.d.ts +14 -0
  64. package/dist/client/components/ui/sidebar.d.ts +63 -0
  65. package/dist/client/components/ui/skeleton.d.ts +2 -0
  66. package/dist/client/components/ui/sonner.d.ts +3 -0
  67. package/dist/client/components/ui/switch.d.ts +5 -0
  68. package/dist/client/components/ui/table.d.ts +10 -0
  69. package/dist/client/components/ui/tabs.d.ts +10 -0
  70. package/dist/client/components/ui/textarea.d.ts +3 -0
  71. package/dist/client/components/ui/tooltip.d.ts +6 -0
  72. package/dist/client/hooks/use-mobile.d.ts +1 -0
  73. package/dist/client/index.d.ts +8 -0
  74. package/dist/client/layouts/admin-layout.d.ts +6 -0
  75. package/dist/client/layouts/settings-layout.d.ts +6 -0
  76. package/dist/client/lib/api.d.ts +18 -0
  77. package/dist/client/lib/block-registry.d.ts +24 -0
  78. package/dist/client/lib/block-types.d.ts +132 -0
  79. package/dist/client/lib/utils.d.ts +2 -0
  80. package/dist/client/main.d.ts +1 -0
  81. package/dist/client/pages/collection-detail.d.ts +7 -0
  82. package/dist/client/pages/collections.d.ts +1 -0
  83. package/dist/client/pages/dashboard.d.ts +1 -0
  84. package/dist/client/pages/device.d.ts +1 -0
  85. package/dist/client/pages/document-detail-page.d.ts +1 -0
  86. package/dist/client/pages/documents-page.d.ts +1 -0
  87. package/dist/client/pages/login.d.ts +1 -0
  88. package/dist/client/pages/plugin-manager.d.ts +1 -0
  89. package/dist/client/pages/plugin-page.d.ts +6 -0
  90. package/dist/client/pages/settings.d.ts +1 -0
  91. package/dist/client/pages/setup.d.ts +1 -0
  92. package/dist/client/pages/signup.d.ts +1 -0
  93. package/dist/client/store/auth.d.ts +10 -0
  94. package/dist/client/store/collections.d.ts +3 -0
  95. package/dist/client/store/config.d.ts +4 -0
  96. package/dist/client/store/fetcher.d.ts +4 -0
  97. package/dist/client/store/plugins.d.ts +21 -0
  98. package/dist/client/store/router.d.ts +84 -0
  99. package/dist/client/store/schema.d.ts +7 -0
  100. package/dist/client/store/settings.d.ts +7 -0
  101. package/dist/client/types.d.ts +31 -0
  102. package/dist/db/dynamic.d.ts +5 -0
  103. package/dist/db/index.d.ts +8 -0
  104. package/dist/db/migrations/001_initial_schema.d.ts +3 -0
  105. package/dist/db/migrations/002_auth_tables.d.ts +3 -0
  106. package/dist/db/migrations/003_plugins.d.ts +3 -0
  107. package/dist/db/migrator.d.ts +10 -0
  108. package/dist/db/schema.d.ts +151 -0
  109. package/dist/index.d.ts +11 -0
  110. package/dist/plugins/adapt-entry.d.ts +5 -0
  111. package/dist/plugins/context.d.ts +21 -0
  112. package/dist/plugins/define-plugin.d.ts +22 -0
  113. package/dist/plugins/hooks.d.ts +37 -0
  114. package/dist/plugins/index.d.ts +7 -0
  115. package/dist/plugins/manager.d.ts +41 -0
  116. package/dist/plugins/middleware.d.ts +8 -0
  117. package/dist/plugins/noop-sandbox.d.ts +18 -0
  118. package/dist/plugins/routes.d.ts +32 -0
  119. package/dist/plugins/sandbox/bridge.d.ts +45 -0
  120. package/dist/plugins/sandbox/runner.d.ts +14 -0
  121. package/dist/plugins/sandbox/types.d.ts +71 -0
  122. package/dist/plugins/sandbox/wrapper.d.ts +6 -0
  123. package/dist/plugins/types.d.ts +725 -0
  124. package/dist/server/index.d.ts +18 -0
  125. package/dist/types.d.ts +19 -0
  126. package/package.json +34 -10
@@ -0,0 +1,18 @@
1
+ import type { KVNamespace } from "@cloudflare/workers-types";
2
+ export interface SchemaCache {
3
+ id: string;
4
+ slug: string;
5
+ label: string;
6
+ is_public: number;
7
+ features: string[];
8
+ url_pattern: string | null;
9
+ fields: any[];
10
+ }
11
+ export declare const cache: {
12
+ getSchema(kv: KVNamespace, slug: string): Promise<SchemaCache | null>;
13
+ setSchema(kv: KVNamespace, slug: string, schema: SchemaCache): Promise<void>;
14
+ invalidateSchema(kv: KVNamespace, slug: string): Promise<void>;
15
+ getCollectionList(kv: KVNamespace): Promise<any[] | null>;
16
+ setCollectionList(kv: KVNamespace, collections: any[]): Promise<void>;
17
+ invalidateCollectionList(kv: KVNamespace): Promise<void>;
18
+ };
@@ -0,0 +1,44 @@
1
+ import type { Context } from 'hono';
2
+ export interface PaginationMeta {
3
+ page: number;
4
+ limit: number;
5
+ total: number;
6
+ totalPages: number;
7
+ hasNextPage: boolean;
8
+ hasPrevPage: boolean;
9
+ }
10
+ export declare const apiResponse: {
11
+ /**
12
+ * Send a successful response with data and optional metadata
13
+ */
14
+ ok: (c: Context, data: any, meta?: any, status?: number) => Response & import("hono").TypedResponse<{
15
+ data: any;
16
+ meta: any;
17
+ }, any, "json">;
18
+ /**
19
+ * Send a paginated response
20
+ */
21
+ paginated: (c: Context, data: any[], meta: PaginationMeta, status?: number) => Response & import("hono").TypedResponse<{
22
+ data: any[];
23
+ meta: {
24
+ page: number;
25
+ limit: number;
26
+ total: number;
27
+ totalPages: number;
28
+ hasNextPage: boolean;
29
+ hasPrevPage: boolean;
30
+ };
31
+ }, any, "json">;
32
+ /**
33
+ * Send an error response
34
+ */
35
+ error: (c: Context, message: string | any, status?: number) => Response & import("hono").TypedResponse<{
36
+ error: any;
37
+ }, any, "json">;
38
+ /**
39
+ * Specialized success response for creations
40
+ */
41
+ created: (c: Context, data: any) => Response & import("hono").TypedResponse<{
42
+ data: any;
43
+ }, 201, "json">;
44
+ };
@@ -0,0 +1,10 @@
1
+ import type { Context, Next } from 'hono';
2
+ export declare const authMiddleware: (c: Context, next: Next) => Promise<void | (Response & import("hono").TypedResponse<{
3
+ error: string;
4
+ }, 401, "json">) | (Response & import("hono").TypedResponse<{
5
+ error: string;
6
+ }, 403, "json">)>;
7
+ export declare const setupMiddleware: (c: Context, next: Next) => Promise<void | (Response & import("hono").TypedResponse<{
8
+ error: string;
9
+ code: string;
10
+ }, 403, "json">)>;
@@ -0,0 +1 @@
1
+ export declare const corsMiddleware: import("hono").MiddlewareHandler;
@@ -0,0 +1,21 @@
1
+ import type { Context, Next } from 'hono';
2
+ /**
3
+ * Ensures the authenticated user has one of the allowed roles.
4
+ * Must be used AFTER authMiddleware.
5
+ */
6
+ export declare const requireRole: (allowedRoles: string[]) => (c: Context, next: Next) => Promise<void | (Response & import("hono").TypedResponse<{
7
+ error: string;
8
+ }, 401, "json">) | (Response & import("hono").TypedResponse<{
9
+ error: string;
10
+ requiredRoles: string[];
11
+ }, 403, "json">)>;
12
+ export declare const requireScope: (action: string, resourceOrParamName?: string) => (c: Context, next: Next) => Promise<void | (Response & import("hono").TypedResponse<{
13
+ error: string;
14
+ code: string;
15
+ }, 401, "json">) | (Response & import("hono").TypedResponse<{
16
+ error: string;
17
+ required: {
18
+ action: string;
19
+ resource: string | undefined;
20
+ };
21
+ }, 403, "json">)>;
@@ -0,0 +1,6 @@
1
+ import { Hono } from 'hono';
2
+ import type { Bindings, Variables } from '../../types';
3
+ export declare const authRoutes: Hono<{
4
+ Bindings: Bindings;
5
+ Variables: Variables;
6
+ }, import("hono/types").BlankSchema, "/">;
@@ -0,0 +1,6 @@
1
+ import { Hono } from 'hono';
2
+ import type { Bindings, Variables } from '../../types';
3
+ export declare const collectionsRoutes: Hono<{
4
+ Bindings: Bindings;
5
+ Variables: Variables;
6
+ }, import("hono/types").BlankSchema, "/">;
@@ -0,0 +1,6 @@
1
+ import { Hono } from 'hono';
2
+ import type { Bindings, Variables } from '../../types';
3
+ export declare const contentRoutes: Hono<{
4
+ Bindings: Bindings;
5
+ Variables: Variables;
6
+ }, import("hono/types").BlankSchema, "/">;
@@ -0,0 +1,6 @@
1
+ import { Hono } from 'hono';
2
+ import type { Bindings, Variables } from '../../types';
3
+ export declare const deviceRoutes: Hono<{
4
+ Bindings: Bindings;
5
+ Variables: Variables;
6
+ }, import("hono/types").BlankSchema, "/">;
@@ -0,0 +1,6 @@
1
+ import { Hono } from 'hono';
2
+ import type { Bindings, Variables } from '../../types';
3
+ export declare const magicRoutes: Hono<{
4
+ Bindings: Bindings;
5
+ Variables: Variables;
6
+ }, import("hono/types").BlankSchema, "/">;
@@ -0,0 +1,6 @@
1
+ import { Hono } from 'hono';
2
+ import type { Bindings, Variables } from '../../types';
3
+ export declare const mcpRoutes: Hono<{
4
+ Bindings: Bindings;
5
+ Variables: Variables;
6
+ }, import("hono/types").BlankSchema, "/">;
@@ -0,0 +1,6 @@
1
+ import { Hono } from 'hono';
2
+ import type { Bindings, Variables } from '../../types';
3
+ export declare const oauthRoutes: Hono<{
4
+ Bindings: Bindings;
5
+ Variables: Variables;
6
+ }, import("hono/types").BlankSchema, "/">;
@@ -0,0 +1,6 @@
1
+ import { Hono } from 'hono';
2
+ import type { Bindings, Variables } from '../../types.js';
3
+ export declare const pluginRoutes: Hono<{
4
+ Bindings: Bindings;
5
+ Variables: Variables;
6
+ }, import("hono/types").BlankSchema, "/">;
@@ -0,0 +1,6 @@
1
+ import { Hono } from 'hono';
2
+ import type { Bindings, Variables } from '../../types';
3
+ export declare const settingsRoutes: Hono<{
4
+ Bindings: Bindings;
5
+ Variables: Variables;
6
+ }, import("hono/types").BlankSchema, "/">;
@@ -0,0 +1,6 @@
1
+ import { Hono } from 'hono';
2
+ import type { Bindings, Variables } from '../../types';
3
+ export declare const setupRoutes: Hono<{
4
+ Bindings: Bindings;
5
+ Variables: Variables;
6
+ }, import("hono/types").BlankSchema, "/">;
@@ -0,0 +1,6 @@
1
+ import { Hono } from 'hono';
2
+ import type { Bindings, Variables } from '../../types';
3
+ export declare const tokenRoutes: Hono<{
4
+ Bindings: Bindings;
5
+ Variables: Variables;
6
+ }, import("hono/types").BlankSchema, "/">;
@@ -0,0 +1,12 @@
1
+ import { z } from 'zod';
2
+ export declare const magicLinkRequestSchema: z.ZodObject<{
3
+ email: z.ZodString;
4
+ }, z.core.$strip>;
5
+ export declare const magicLinkVerifySchema: z.ZodObject<{
6
+ email: z.ZodString;
7
+ token: z.ZodString;
8
+ }, z.core.$strip>;
9
+ export declare const oauthCallbackSchema: z.ZodObject<{
10
+ code: z.ZodString;
11
+ state: z.ZodOptional<z.ZodString>;
12
+ }, z.core.$strip>;
@@ -0,0 +1,43 @@
1
+ import { z } from 'zod';
2
+ export declare const loginSchema: z.ZodObject<{
3
+ email: z.ZodEmail;
4
+ password: z.ZodString;
5
+ }, z.core.$strip>;
6
+ export declare const signupSchema: z.ZodObject<{
7
+ email: z.ZodEmail;
8
+ password: z.ZodString;
9
+ }, z.core.$strip>;
10
+ export declare const collectionSchema: z.ZodObject<{
11
+ slug: z.ZodString;
12
+ label: z.ZodString;
13
+ labelSingular: z.ZodOptional<z.ZodString>;
14
+ description: z.ZodOptional<z.ZodString>;
15
+ icon: z.ZodOptional<z.ZodString>;
16
+ isPublic: z.ZodOptional<z.ZodBoolean>;
17
+ features: z.ZodOptional<z.ZodArray<z.ZodString>>;
18
+ urlPattern: z.ZodOptional<z.ZodString>;
19
+ }, z.core.$strip>;
20
+ export declare const fieldSchema: z.ZodObject<{
21
+ slug: z.ZodString;
22
+ label: z.ZodString;
23
+ type: z.ZodString;
24
+ required: z.ZodOptional<z.ZodBoolean>;
25
+ }, z.core.$strip>;
26
+ export declare const setupSchema: z.ZodObject<{
27
+ title: z.ZodString;
28
+ email: z.ZodEmail;
29
+ password: z.ZodString;
30
+ name: z.ZodOptional<z.ZodString>;
31
+ }, z.core.$strip>;
32
+ export declare const dynamicContentSchema: z.ZodObject<{
33
+ slug: z.ZodOptional<z.ZodString>;
34
+ status: z.ZodOptional<z.ZodString>;
35
+ title: z.ZodOptional<z.ZodString>;
36
+ }, z.core.$loose>;
37
+ export declare const webauthnOptionsSchema: z.ZodObject<{
38
+ email: z.ZodString;
39
+ }, z.core.$strip>;
40
+ export declare const webauthnVerifySchema: z.ZodObject<{
41
+ email: z.ZodString;
42
+ response: z.ZodAny;
43
+ }, z.core.$strip>;
@@ -0,0 +1,20 @@
1
+ import { z } from 'zod';
2
+ export declare const tokenCreateSchema: z.ZodObject<{
3
+ name: z.ZodString;
4
+ scopes: z.ZodArray<z.ZodObject<{
5
+ resource: z.ZodString;
6
+ actions: z.ZodArray<z.ZodString>;
7
+ }, z.core.$strip>>;
8
+ }, z.core.$strip>;
9
+ export declare const deviceCodeRequestSchema: z.ZodObject<{
10
+ client_id: z.ZodString;
11
+ scope: z.ZodOptional<z.ZodString>;
12
+ }, z.core.$strip>;
13
+ export declare const deviceTokenRequestSchema: z.ZodObject<{
14
+ client_id: z.ZodString;
15
+ device_code: z.ZodString;
16
+ grant_type: z.ZodLiteral<"urn:ietf:params:oauth:grant-type:device_code">;
17
+ }, z.core.$strip>;
18
+ export declare const deviceApproveSchema: z.ZodObject<{
19
+ user_code: z.ZodString;
20
+ }, z.core.$strip>;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Generate a random token for sessions
3
+ */
4
+ export declare function generateSessionToken(): string;
5
+ /**
6
+ * Hash a password using SHA-256 (for ultra-lightweight worker usage)
7
+ * Note: In a real production app, you might want Scrypt or Argon2id,
8
+ * but those can be slow on the Edge. SHA-256 + Salt is a light starting point.
9
+ */
10
+ export declare function hashPassword(password: string): Promise<string>;
11
+ export declare function verifyPassword(password: string, hash: string): Promise<boolean>;
@@ -0,0 +1,3 @@
1
+ export declare function createProjectCommand(): Promise<void>;
2
+ export declare function createPluginCommand(): Promise<void>;
3
+ export declare function mcpCommand(args: string[]): Promise<void>;
@@ -6490,32 +6490,52 @@ async function createProjectCommand() {
6490
6490
  }
6491
6491
  s3.start("Injecting FlareCMS configuration...");
6492
6492
  }
6493
- const template = TEMPLATES[templateKey];
6494
6493
  const currentFilePath = fileURLToPath(import.meta.url);
6495
6494
  const cliDir = resolve(currentFilePath, "..");
6496
6495
  const localTemplatesRoot = resolve(cliDir, "..", "..", "..", "..", "templates");
6497
- const localTemplatePath = resolve(localTemplatesRoot, template.dir.split("/").pop() || "");
6498
- if (existsSync2(localTemplatePath)) {
6499
- if (!existsSync2(projectDir)) {
6500
- mkdirSync(projectDir, { recursive: true });
6496
+ if (templateKey === "plugin-development") {
6497
+ const pkgPath = resolve(projectDir, "package.json");
6498
+ const rootPkg = {
6499
+ name: projectName,
6500
+ version: "0.1.0",
6501
+ private: true,
6502
+ workspaces: ["plugins/*", "apps/*"],
6503
+ scripts: {
6504
+ dev: "bun --cwd apps/playground dev"
6505
+ }
6506
+ };
6507
+ mkdirSync(resolve(projectDir, "plugins"), { recursive: true });
6508
+ mkdirSync(resolve(projectDir, "apps"), { recursive: true });
6509
+ cpSync(resolve(localTemplatesRoot, "plugin-development", "starter-plugin"), resolve(projectDir, "plugins", "starter-plugin"), { recursive: true });
6510
+ cpSync(resolve(localTemplatesRoot, "plugin-development", "starter-playground"), resolve(projectDir, "apps", "playground"), { recursive: true });
6511
+ writeFileSync(pkgPath, JSON.stringify(rootPkg, null, 2));
6512
+ } else {
6513
+ const template = TEMPLATES[templateKey];
6514
+ const localTemplatePath = resolve(localTemplatesRoot, template.dir.split("/").pop() || "");
6515
+ if (existsSync2(localTemplatePath)) {
6516
+ if (!existsSync2(projectDir)) {
6517
+ mkdirSync(projectDir, { recursive: true });
6518
+ }
6519
+ cpSync(localTemplatePath, projectDir, { recursive: true });
6520
+ } else if (templateKey !== "nextjs") {
6521
+ const remoteSource = `github:fhorray/flarecms/${template.dir}`;
6522
+ await downloadTemplate(remoteSource, {
6523
+ dir: projectDir,
6524
+ force: true
6525
+ });
6501
6526
  }
6502
- cpSync(localTemplatePath, projectDir, { recursive: true });
6503
- } else if (templateKey !== "nextjs") {
6504
- const remoteSource = `github:fhorray/flarecms/${template.dir}`;
6505
- await downloadTemplate(remoteSource, {
6506
- dir: projectDir,
6507
- force: true
6508
- });
6509
6527
  }
6510
- const pkgPath = resolve(projectDir, "package.json");
6511
- if (existsSync2(pkgPath)) {
6512
- const pkg = JSON.parse(readFileSync(pkgPath, "utf-8"));
6513
- pkg.name = projectName;
6514
- pkg.version = "0.1.0";
6515
- pkg.dependencies = pkg.dependencies || {};
6516
- pkg.dependencies["flarecms"] = "latest";
6517
- pkg.dependencies["hono"] = "latest";
6518
- writeFileSync(pkgPath, JSON.stringify(pkg, null, 2));
6528
+ if (templateKey !== "plugin-development") {
6529
+ const pkgPath = resolve(projectDir, "package.json");
6530
+ if (existsSync2(pkgPath)) {
6531
+ const pkg = JSON.parse(readFileSync(pkgPath, "utf-8"));
6532
+ pkg.name = projectName;
6533
+ pkg.version = "0.1.0";
6534
+ pkg.dependencies = pkg.dependencies || {};
6535
+ pkg.dependencies["flarecms"] = "latest";
6536
+ pkg.dependencies["hono"] = "latest";
6537
+ writeFileSync(pkgPath, JSON.stringify(pkg, null, 2));
6538
+ }
6519
6539
  }
6520
6540
  const wranglerPath = resolve(projectDir, "wrangler.jsonc");
6521
6541
  if (existsSync2(wranglerPath)) {
@@ -6530,16 +6550,18 @@ async function createProjectCommand() {
6530
6550
  try {
6531
6551
  await execAsync("bun install", { cwd: projectDir });
6532
6552
  s3.stop("Dependencies installed!");
6533
- s3.start("Generating TypeScript bindings...");
6534
- try {
6535
- await execAsync("bun wrangler types", { cwd: projectDir });
6536
- s3.stop("TypeScript bindings generated!");
6537
- } catch (err) {
6538
- s3.stop("Failed to generate bindings (this is normal if wrangler.jsonc is incomplete)");
6553
+ if (templateKey !== "plugin-development") {
6554
+ s3.start("Generating TypeScript bindings...");
6555
+ try {
6556
+ await execAsync("bun wrangler types", { cwd: projectDir });
6557
+ s3.stop("TypeScript bindings generated!");
6558
+ } catch (err) {
6559
+ s3.stop("Failed to generate bindings (this is normal if wrangler.jsonc is incomplete)");
6560
+ }
6539
6561
  }
6540
6562
  } catch (err) {
6541
6563
  s3.stop("Failed to install dependencies");
6542
- O2.warn(`Run ${import_picocolors.default.cyan(`cd ${projectName} && bun install && bun cf-typegen`)} manually`);
6564
+ O2.warn(`Run ${import_picocolors.default.cyan(`cd ${projectName} && bun install`)} manually`);
6543
6565
  }
6544
6566
  }
6545
6567
  const steps = [`cd ${projectName}`, "bun run dev"];
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env bun
2
+ export {};
package/dist/cli/index.js CHANGED
@@ -6491,32 +6491,52 @@ async function createProjectCommand() {
6491
6491
  }
6492
6492
  s3.start("Injecting FlareCMS configuration...");
6493
6493
  }
6494
- const template = TEMPLATES[templateKey];
6495
6494
  const currentFilePath = fileURLToPath(import.meta.url);
6496
6495
  const cliDir = resolve(currentFilePath, "..");
6497
6496
  const localTemplatesRoot = resolve(cliDir, "..", "..", "..", "..", "templates");
6498
- const localTemplatePath = resolve(localTemplatesRoot, template.dir.split("/").pop() || "");
6499
- if (existsSync2(localTemplatePath)) {
6500
- if (!existsSync2(projectDir)) {
6501
- mkdirSync(projectDir, { recursive: true });
6497
+ if (templateKey === "plugin-development") {
6498
+ const pkgPath = resolve(projectDir, "package.json");
6499
+ const rootPkg = {
6500
+ name: projectName,
6501
+ version: "0.1.0",
6502
+ private: true,
6503
+ workspaces: ["plugins/*", "apps/*"],
6504
+ scripts: {
6505
+ dev: "bun --cwd apps/playground dev"
6506
+ }
6507
+ };
6508
+ mkdirSync(resolve(projectDir, "plugins"), { recursive: true });
6509
+ mkdirSync(resolve(projectDir, "apps"), { recursive: true });
6510
+ cpSync(resolve(localTemplatesRoot, "plugin-development", "starter-plugin"), resolve(projectDir, "plugins", "starter-plugin"), { recursive: true });
6511
+ cpSync(resolve(localTemplatesRoot, "plugin-development", "starter-playground"), resolve(projectDir, "apps", "playground"), { recursive: true });
6512
+ writeFileSync(pkgPath, JSON.stringify(rootPkg, null, 2));
6513
+ } else {
6514
+ const template = TEMPLATES[templateKey];
6515
+ const localTemplatePath = resolve(localTemplatesRoot, template.dir.split("/").pop() || "");
6516
+ if (existsSync2(localTemplatePath)) {
6517
+ if (!existsSync2(projectDir)) {
6518
+ mkdirSync(projectDir, { recursive: true });
6519
+ }
6520
+ cpSync(localTemplatePath, projectDir, { recursive: true });
6521
+ } else if (templateKey !== "nextjs") {
6522
+ const remoteSource = `github:fhorray/flarecms/${template.dir}`;
6523
+ await downloadTemplate(remoteSource, {
6524
+ dir: projectDir,
6525
+ force: true
6526
+ });
6502
6527
  }
6503
- cpSync(localTemplatePath, projectDir, { recursive: true });
6504
- } else if (templateKey !== "nextjs") {
6505
- const remoteSource = `github:fhorray/flarecms/${template.dir}`;
6506
- await downloadTemplate(remoteSource, {
6507
- dir: projectDir,
6508
- force: true
6509
- });
6510
6528
  }
6511
- const pkgPath = resolve(projectDir, "package.json");
6512
- if (existsSync2(pkgPath)) {
6513
- const pkg = JSON.parse(readFileSync(pkgPath, "utf-8"));
6514
- pkg.name = projectName;
6515
- pkg.version = "0.1.0";
6516
- pkg.dependencies = pkg.dependencies || {};
6517
- pkg.dependencies["flarecms"] = "latest";
6518
- pkg.dependencies["hono"] = "latest";
6519
- writeFileSync(pkgPath, JSON.stringify(pkg, null, 2));
6529
+ if (templateKey !== "plugin-development") {
6530
+ const pkgPath = resolve(projectDir, "package.json");
6531
+ if (existsSync2(pkgPath)) {
6532
+ const pkg = JSON.parse(readFileSync(pkgPath, "utf-8"));
6533
+ pkg.name = projectName;
6534
+ pkg.version = "0.1.0";
6535
+ pkg.dependencies = pkg.dependencies || {};
6536
+ pkg.dependencies["flarecms"] = "latest";
6537
+ pkg.dependencies["hono"] = "latest";
6538
+ writeFileSync(pkgPath, JSON.stringify(pkg, null, 2));
6539
+ }
6520
6540
  }
6521
6541
  const wranglerPath = resolve(projectDir, "wrangler.jsonc");
6522
6542
  if (existsSync2(wranglerPath)) {
@@ -6531,16 +6551,18 @@ async function createProjectCommand() {
6531
6551
  try {
6532
6552
  await execAsync("bun install", { cwd: projectDir });
6533
6553
  s3.stop("Dependencies installed!");
6534
- s3.start("Generating TypeScript bindings...");
6535
- try {
6536
- await execAsync("bun wrangler types", { cwd: projectDir });
6537
- s3.stop("TypeScript bindings generated!");
6538
- } catch (err) {
6539
- s3.stop("Failed to generate bindings (this is normal if wrangler.jsonc is incomplete)");
6554
+ if (templateKey !== "plugin-development") {
6555
+ s3.start("Generating TypeScript bindings...");
6556
+ try {
6557
+ await execAsync("bun wrangler types", { cwd: projectDir });
6558
+ s3.stop("TypeScript bindings generated!");
6559
+ } catch (err) {
6560
+ s3.stop("Failed to generate bindings (this is normal if wrangler.jsonc is incomplete)");
6561
+ }
6540
6562
  }
6541
6563
  } catch (err) {
6542
6564
  s3.stop("Failed to install dependencies");
6543
- O2.warn(`Run ${import_picocolors.default.cyan(`cd ${projectName} && bun install && bun cf-typegen`)} manually`);
6565
+ O2.warn(`Run ${import_picocolors.default.cyan(`cd ${projectName} && bun install`)} manually`);
6544
6566
  }
6545
6567
  }
6546
6568
  const steps = [`cd ${projectName}`, "bun run dev"];
@@ -0,0 +1,9 @@
1
+ /**
2
+ * FlareCMS MCP Bridge Server (CLI Implementation)
3
+ * Implements MCP (Model Context Protocol) over stdio
4
+ */
5
+ export interface McpOptions {
6
+ url: string;
7
+ token?: string;
8
+ }
9
+ export declare function runMcpBridge(options: McpOptions): Promise<void>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,20 @@
1
+ export interface FlareAdminProps {
2
+ /**
3
+ * The base path where the admin UI is mounted.
4
+ * @default "/admin"
5
+ */
6
+ basePath?: string;
7
+ /**
8
+ * The base URL for FlareCMS API calls.
9
+ * @default "/api"
10
+ */
11
+ apiBaseUrl?: string;
12
+ }
13
+ /**
14
+ * FlareAdminRouter is the main entry point for the FlareCMS Admin UI.
15
+ * It manages the routing and state for the entire administrative dashboard.
16
+ *
17
+ * @example
18
+ * <FlareAdminRouter basePath="/admin" apiBaseUrl="/api/flarecms" />
19
+ */
20
+ export declare function FlareAdminRouter({ basePath, apiBaseUrl }: FlareAdminProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export default function App(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ interface AppSidebarProps {
2
+ variant?: 'sidebar' | 'floating' | 'inset';
3
+ }
4
+ export declare function AppSidebar({ variant }: AppSidebarProps): import("react/jsx-runtime").JSX.Element;
5
+ export {};
@@ -0,0 +1,7 @@
1
+ import type { CardBlock } from '../../lib/block-types';
2
+ interface BlockCardProps {
3
+ block: CardBlock;
4
+ onAction: (interaction: any) => void;
5
+ }
6
+ export declare function BlockCard({ block, onAction }: BlockCardProps): import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,7 @@
1
+ import type { FormBlock, BlockInteraction } from '../../lib/block-types';
2
+ interface BlockFormProps {
3
+ block: FormBlock;
4
+ onAction: (interaction: BlockInteraction) => void;
5
+ }
6
+ export declare function BlockForm({ block, onAction }: BlockFormProps): import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,10 @@
1
+ import type { Block, BlockInteraction } from '../../lib/block-types';
2
+ interface BlockRendererProps {
3
+ blocks: Block[];
4
+ onAction: (interaction: BlockInteraction) => void;
5
+ }
6
+ /**
7
+ * Renders a list of blocks.
8
+ */
9
+ export declare function BlockRenderer({ blocks, onAction }: BlockRendererProps): import("react/jsx-runtime").JSX.Element;
10
+ export {};
@@ -0,0 +1,7 @@
1
+ import type { BlockInteraction, TableBlock } from '../../lib/block-types';
2
+ interface BlockTableProps {
3
+ block: TableBlock;
4
+ onAction: (interaction: BlockInteraction) => void;
5
+ }
6
+ export declare function BlockTable({ block, onAction }: BlockTableProps): import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ interface CollectionModalProps {
3
+ children: React.ReactElement;
4
+ }
5
+ export declare function CollectionModal({ children }: CollectionModalProps): import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -0,0 +1,3 @@
1
+ export declare function ContentList({ slug }: {
2
+ slug: string;
3
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ interface DynamicFormProps {
2
+ slug: string;
3
+ onSubmit: (data: Record<string, any>) => void;
4
+ onCancel: () => void;
5
+ initialData?: Record<string, any> | null;
6
+ isSubmitting?: boolean;
7
+ }
8
+ export declare function DynamicForm({ slug, onSubmit, onCancel, initialData, isSubmitting, }: DynamicFormProps): import("react/jsx-runtime").JSX.Element;
9
+ export {};
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ interface FieldModalProps {
3
+ children: React.ReactElement;
4
+ collectionId: string;
5
+ collectionSlug: string;
6
+ }
7
+ export declare function FieldModal({ children, collectionId, collectionSlug, }: FieldModalProps): import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -0,0 +1,6 @@
1
+ interface PluginWidgetProps {
2
+ pluginId: string;
3
+ widgetId: string;
4
+ }
5
+ export declare function PluginWidget({ pluginId, widgetId }: PluginWidgetProps): import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -0,0 +1 @@
1
+ export declare function APITokenSection(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function GeneralSection(): import("react/jsx-runtime").JSX.Element;