create-questpie 1.0.0 → 2.0.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.
Files changed (41) hide show
  1. package/README.md +20 -12
  2. package/dist/index.mjs +9 -2
  3. package/package.json +21 -21
  4. package/templates/tanstack-start/AGENTS.md +366 -318
  5. package/templates/tanstack-start/CLAUDE.md +84 -52
  6. package/templates/tanstack-start/README.md +59 -52
  7. package/templates/tanstack-start/components.json +20 -20
  8. package/templates/tanstack-start/package.json +6 -0
  9. package/templates/tanstack-start/questpie.config.ts +7 -7
  10. package/templates/tanstack-start/src/lib/auth-client.ts +3 -3
  11. package/templates/tanstack-start/src/lib/client.ts +13 -0
  12. package/templates/tanstack-start/src/lib/env.ts +19 -22
  13. package/templates/tanstack-start/src/lib/query-client.ts +5 -5
  14. package/templates/tanstack-start/src/questpie/admin/admin.ts +8 -4
  15. package/templates/tanstack-start/src/questpie/server/.generated/factories.ts +318 -0
  16. package/templates/tanstack-start/src/questpie/server/.generated/index.ts +153 -0
  17. package/templates/tanstack-start/src/questpie/server/app.ts +10 -52
  18. package/templates/tanstack-start/src/questpie/server/collections/posts.collection.ts +39 -53
  19. package/templates/tanstack-start/src/questpie/server/config/admin.ts +83 -0
  20. package/templates/tanstack-start/src/questpie/server/config/auth.ts +8 -0
  21. package/templates/tanstack-start/src/questpie/server/config/openapi.ts +10 -0
  22. package/templates/tanstack-start/src/questpie/server/globals/site-settings.global.ts +9 -14
  23. package/templates/tanstack-start/src/questpie/server/modules.ts +10 -0
  24. package/templates/tanstack-start/src/questpie/server/questpie.config.ts +20 -0
  25. package/templates/tanstack-start/src/router.tsx +6 -5
  26. package/templates/tanstack-start/src/routes/__root.tsx +11 -9
  27. package/templates/tanstack-start/src/routes/admin/$.tsx +14 -13
  28. package/templates/tanstack-start/src/routes/admin/index.tsx +11 -10
  29. package/templates/tanstack-start/src/routes/admin/login.tsx +11 -10
  30. package/templates/tanstack-start/src/routes/admin.tsx +53 -52
  31. package/templates/tanstack-start/src/routes/api/{cms/$.ts → $.ts} +6 -20
  32. package/templates/tanstack-start/src/styles.css +109 -109
  33. package/templates/tanstack-start/tsconfig.json +27 -25
  34. package/templates/tanstack-start/vite.config.ts +5 -3
  35. package/templates/tanstack-start/src/lib/cms-client.ts +0 -12
  36. package/templates/tanstack-start/src/migrations/index.ts +0 -8
  37. package/templates/tanstack-start/src/questpie/admin/builder.ts +0 -4
  38. package/templates/tanstack-start/src/questpie/server/builder.ts +0 -4
  39. package/templates/tanstack-start/src/questpie/server/dashboard.ts +0 -68
  40. package/templates/tanstack-start/src/questpie/server/rpc.ts +0 -4
  41. package/templates/tanstack-start/src/questpie/server/sidebar.ts +0 -26
@@ -4,122 +4,122 @@
4
4
  @custom-variant dark (&:is(.dark *));
5
5
 
6
6
  :root {
7
- --background: oklch(0.985 0 0);
8
- --foreground: oklch(0.145 0 0);
9
- --card: oklch(1 0 0);
10
- --card-foreground: oklch(0.145 0 0);
11
- --popover: oklch(1 0 0);
12
- --popover-foreground: oklch(0.145 0 0);
13
- --primary: oklch(0.205 0 0);
14
- --primary-foreground: oklch(0.985 0 0);
15
- --secondary: oklch(0.97 0 0);
16
- --secondary-foreground: oklch(0.205 0 0);
17
- --muted: oklch(0.97 0 0);
18
- --muted-foreground: oklch(0.556 0 0);
19
- --accent: oklch(0.97 0 0);
20
- --accent-foreground: oklch(0.205 0 0);
21
- --destructive: oklch(0.58 0.22 27);
22
- --destructive-foreground: oklch(0.985 0 0);
23
- --border: oklch(0.922 0 0);
24
- --input: oklch(0.922 0 0);
25
- --ring: oklch(0.708 0 0);
26
- --chart-1: oklch(0.75 0.18 25);
27
- --chart-2: oklch(0.65 0.15 45);
28
- --chart-3: oklch(0.55 0.12 65);
29
- --chart-4: oklch(0.45 0.09 85);
30
- --chart-5: oklch(0.35 0.06 105);
31
- --radius: 0.5rem;
32
- --sidebar: oklch(0.985 0 0);
33
- --sidebar-foreground: oklch(0.145 0 0);
34
- --sidebar-primary: oklch(0.205 0 0);
35
- --sidebar-primary-foreground: oklch(0.985 0 0);
36
- --sidebar-accent: oklch(0.97 0 0);
37
- --sidebar-accent-foreground: oklch(0.205 0 0);
38
- --sidebar-border: oklch(0.922 0 0);
39
- --sidebar-ring: oklch(0.708 0 0);
7
+ --background: oklch(0.985 0 0);
8
+ --foreground: oklch(0.145 0 0);
9
+ --card: oklch(1 0 0);
10
+ --card-foreground: oklch(0.145 0 0);
11
+ --popover: oklch(1 0 0);
12
+ --popover-foreground: oklch(0.145 0 0);
13
+ --primary: oklch(0.205 0 0);
14
+ --primary-foreground: oklch(0.985 0 0);
15
+ --secondary: oklch(0.97 0 0);
16
+ --secondary-foreground: oklch(0.205 0 0);
17
+ --muted: oklch(0.97 0 0);
18
+ --muted-foreground: oklch(0.556 0 0);
19
+ --accent: oklch(0.97 0 0);
20
+ --accent-foreground: oklch(0.205 0 0);
21
+ --destructive: oklch(0.58 0.22 27);
22
+ --destructive-foreground: oklch(0.985 0 0);
23
+ --border: oklch(0.922 0 0);
24
+ --input: oklch(0.922 0 0);
25
+ --ring: oklch(0.708 0 0);
26
+ --chart-1: oklch(0.75 0.18 25);
27
+ --chart-2: oklch(0.65 0.15 45);
28
+ --chart-3: oklch(0.55 0.12 65);
29
+ --chart-4: oklch(0.45 0.09 85);
30
+ --chart-5: oklch(0.35 0.06 105);
31
+ --radius: 0.5rem;
32
+ --sidebar: oklch(0.985 0 0);
33
+ --sidebar-foreground: oklch(0.145 0 0);
34
+ --sidebar-primary: oklch(0.205 0 0);
35
+ --sidebar-primary-foreground: oklch(0.985 0 0);
36
+ --sidebar-accent: oklch(0.97 0 0);
37
+ --sidebar-accent-foreground: oklch(0.205 0 0);
38
+ --sidebar-border: oklch(0.922 0 0);
39
+ --sidebar-ring: oklch(0.708 0 0);
40
40
  }
41
41
 
42
42
  .dark {
43
- --background: oklch(0.12 0 0);
44
- --foreground: oklch(0.985 0 0);
45
- --card: oklch(0.17 0 0);
46
- --card-foreground: oklch(0.985 0 0);
47
- --popover: oklch(0.17 0 0);
48
- --popover-foreground: oklch(0.985 0 0);
49
- --primary: oklch(0.985 0 0);
50
- --primary-foreground: oklch(0.12 0 0);
51
- --secondary: oklch(0.22 0 0);
52
- --secondary-foreground: oklch(0.985 0 0);
53
- --muted: oklch(0.22 0 0);
54
- --muted-foreground: oklch(0.65 0 0);
55
- --accent: oklch(0.27 0 0);
56
- --accent-foreground: oklch(0.985 0 0);
57
- --destructive: oklch(0.704 0.191 22.216);
58
- --destructive-foreground: oklch(0.985 0 0);
59
- --border: oklch(0.27 0 0);
60
- --input: oklch(0.27 0 0);
61
- --ring: oklch(0.45 0 0);
62
- --chart-1: oklch(0.75 0.18 25);
63
- --chart-2: oklch(0.65 0.15 45);
64
- --chart-3: oklch(0.55 0.12 65);
65
- --chart-4: oklch(0.45 0.09 85);
66
- --chart-5: oklch(0.35 0.06 105);
67
- --sidebar: oklch(0.17 0 0);
68
- --sidebar-foreground: oklch(0.985 0 0);
69
- --sidebar-primary: oklch(0.985 0 0);
70
- --sidebar-primary-foreground: oklch(0.12 0 0);
71
- --sidebar-accent: oklch(0.22 0 0);
72
- --sidebar-accent-foreground: oklch(0.985 0 0);
73
- --sidebar-border: oklch(0.27 0 0);
74
- --sidebar-ring: oklch(0.45 0 0);
43
+ --background: oklch(0.12 0 0);
44
+ --foreground: oklch(0.985 0 0);
45
+ --card: oklch(0.17 0 0);
46
+ --card-foreground: oklch(0.985 0 0);
47
+ --popover: oklch(0.17 0 0);
48
+ --popover-foreground: oklch(0.985 0 0);
49
+ --primary: oklch(0.985 0 0);
50
+ --primary-foreground: oklch(0.12 0 0);
51
+ --secondary: oklch(0.22 0 0);
52
+ --secondary-foreground: oklch(0.985 0 0);
53
+ --muted: oklch(0.22 0 0);
54
+ --muted-foreground: oklch(0.65 0 0);
55
+ --accent: oklch(0.27 0 0);
56
+ --accent-foreground: oklch(0.985 0 0);
57
+ --destructive: oklch(0.704 0.191 22.216);
58
+ --destructive-foreground: oklch(0.985 0 0);
59
+ --border: oklch(0.27 0 0);
60
+ --input: oklch(0.27 0 0);
61
+ --ring: oklch(0.45 0 0);
62
+ --chart-1: oklch(0.75 0.18 25);
63
+ --chart-2: oklch(0.65 0.15 45);
64
+ --chart-3: oklch(0.55 0.12 65);
65
+ --chart-4: oklch(0.45 0.09 85);
66
+ --chart-5: oklch(0.35 0.06 105);
67
+ --sidebar: oklch(0.17 0 0);
68
+ --sidebar-foreground: oklch(0.985 0 0);
69
+ --sidebar-primary: oklch(0.985 0 0);
70
+ --sidebar-primary-foreground: oklch(0.12 0 0);
71
+ --sidebar-accent: oklch(0.22 0 0);
72
+ --sidebar-accent-foreground: oklch(0.985 0 0);
73
+ --sidebar-border: oklch(0.27 0 0);
74
+ --sidebar-ring: oklch(0.45 0 0);
75
75
  }
76
76
 
77
77
  @theme inline {
78
- --font-sans: ui-sans-serif, system-ui, sans-serif;
79
- --color-background: var(--background);
80
- --color-foreground: var(--foreground);
81
- --color-card: var(--card);
82
- --color-card-foreground: var(--card-foreground);
83
- --color-popover: var(--popover);
84
- --color-popover-foreground: var(--popover-foreground);
85
- --color-primary: var(--primary);
86
- --color-primary-foreground: var(--primary-foreground);
87
- --color-secondary: var(--secondary);
88
- --color-secondary-foreground: var(--secondary-foreground);
89
- --color-muted: var(--muted);
90
- --color-muted-foreground: var(--muted-foreground);
91
- --color-accent: var(--accent);
92
- --color-accent-foreground: var(--accent-foreground);
93
- --color-destructive: var(--destructive);
94
- --color-destructive-foreground: var(--destructive-foreground);
95
- --color-border: var(--border);
96
- --color-input: var(--input);
97
- --color-ring: var(--ring);
98
- --color-chart-1: var(--chart-1);
99
- --color-chart-2: var(--chart-2);
100
- --color-chart-3: var(--chart-3);
101
- --color-chart-4: var(--chart-4);
102
- --color-chart-5: var(--chart-5);
103
- --color-sidebar: var(--sidebar);
104
- --color-sidebar-foreground: var(--sidebar-foreground);
105
- --color-sidebar-primary: var(--sidebar-primary);
106
- --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
107
- --color-sidebar-accent: var(--sidebar-accent);
108
- --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
109
- --color-sidebar-border: var(--sidebar-border);
110
- --color-sidebar-ring: var(--sidebar-ring);
111
- --radius-sm: calc(var(--radius) - 4px);
112
- --radius-md: calc(var(--radius) - 2px);
113
- --radius-lg: var(--radius);
114
- --radius-xl: calc(var(--radius) + 4px);
115
- --radius-2xl: calc(var(--radius) + 8px);
78
+ --font-sans: ui-sans-serif, system-ui, sans-serif;
79
+ --color-background: var(--background);
80
+ --color-foreground: var(--foreground);
81
+ --color-card: var(--card);
82
+ --color-card-foreground: var(--card-foreground);
83
+ --color-popover: var(--popover);
84
+ --color-popover-foreground: var(--popover-foreground);
85
+ --color-primary: var(--primary);
86
+ --color-primary-foreground: var(--primary-foreground);
87
+ --color-secondary: var(--secondary);
88
+ --color-secondary-foreground: var(--secondary-foreground);
89
+ --color-muted: var(--muted);
90
+ --color-muted-foreground: var(--muted-foreground);
91
+ --color-accent: var(--accent);
92
+ --color-accent-foreground: var(--accent-foreground);
93
+ --color-destructive: var(--destructive);
94
+ --color-destructive-foreground: var(--destructive-foreground);
95
+ --color-border: var(--border);
96
+ --color-input: var(--input);
97
+ --color-ring: var(--ring);
98
+ --color-chart-1: var(--chart-1);
99
+ --color-chart-2: var(--chart-2);
100
+ --color-chart-3: var(--chart-3);
101
+ --color-chart-4: var(--chart-4);
102
+ --color-chart-5: var(--chart-5);
103
+ --color-sidebar: var(--sidebar);
104
+ --color-sidebar-foreground: var(--sidebar-foreground);
105
+ --color-sidebar-primary: var(--sidebar-primary);
106
+ --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
107
+ --color-sidebar-accent: var(--sidebar-accent);
108
+ --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
109
+ --color-sidebar-border: var(--sidebar-border);
110
+ --color-sidebar-ring: var(--sidebar-ring);
111
+ --radius-sm: calc(var(--radius) - 4px);
112
+ --radius-md: calc(var(--radius) - 2px);
113
+ --radius-lg: var(--radius);
114
+ --radius-xl: calc(var(--radius) + 4px);
115
+ --radius-2xl: calc(var(--radius) + 8px);
116
116
  }
117
117
 
118
118
  @layer base {
119
- * {
120
- @apply border-border outline-ring/50;
121
- }
122
- body {
123
- @apply font-sans bg-background text-foreground;
124
- }
119
+ * {
120
+ @apply border-border outline-ring/50;
121
+ }
122
+ body {
123
+ @apply bg-background text-foreground font-sans;
124
+ }
125
125
  }
@@ -1,27 +1,29 @@
1
1
  {
2
- "include": ["src/**/*.ts", "src/**/*.tsx", "*.config.ts"],
3
- "exclude": ["node_modules", "dist", "**/*.test.ts"],
4
- "compilerOptions": {
5
- "target": "ES2022",
6
- "jsx": "react-jsx",
7
- "module": "ESNext",
8
- "lib": ["ES2022", "DOM", "DOM.Iterable"],
9
- "types": ["vite/client"],
10
- "moduleResolution": "bundler",
11
- "resolveJsonModule": true,
12
- "allowImportingTsExtensions": true,
13
- "verbatimModuleSyntax": false,
14
- "noEmit": true,
15
- "skipLibCheck": true,
16
- "strict": true,
17
- "noUnusedLocals": false,
18
- "noUnusedParameters": false,
19
- "noFallthroughCasesInSwitch": true,
20
- "noUncheckedSideEffectImports": true,
21
- "baseUrl": ".",
22
- "paths": {
23
- "@/*": ["./src/*"],
24
- "~/*": ["./src/*"]
25
- }
26
- }
2
+ "include": ["src/**/*.ts", "src/**/*.tsx", "*.config.ts"],
3
+ "exclude": ["node_modules", "dist", "**/*.test.ts"],
4
+ "compilerOptions": {
5
+ "target": "ES2022",
6
+ "jsx": "react-jsx",
7
+ "module": "ESNext",
8
+ "lib": ["ES2022", "DOM", "DOM.Iterable"],
9
+ "types": ["vite/client"],
10
+ "moduleResolution": "bundler",
11
+ "resolveJsonModule": true,
12
+ "allowImportingTsExtensions": true,
13
+ "verbatimModuleSyntax": false,
14
+ "noEmit": true,
15
+ "skipLibCheck": true,
16
+ "strict": true,
17
+ "noUnusedLocals": false,
18
+ "noUnusedParameters": false,
19
+ "noFallthroughCasesInSwitch": true,
20
+ "noUncheckedSideEffectImports": true,
21
+ "baseUrl": ".",
22
+ "paths": {
23
+ "@/*": ["./src/*"],
24
+ "~/*": ["./src/*"],
25
+ "#questpie": ["./src/questpie/server/.generated/index.ts"],
26
+ "#questpie/*": ["./src/questpie/server/.generated/*"]
27
+ }
28
+ }
27
29
  }
@@ -1,13 +1,15 @@
1
- import { defineConfig } from "vite";
1
+ import { iconifyPreload } from "@questpie/vite-plugin-iconify";
2
+ import tailwindcss from "@tailwindcss/vite";
2
3
  import { devtools } from "@tanstack/devtools-vite";
3
4
  import { tanstackStart } from "@tanstack/react-start/plugin/vite";
4
5
  import viteReact from "@vitejs/plugin-react";
5
- import viteTsConfigPaths from "vite-tsconfig-paths";
6
- import tailwindcss from "@tailwindcss/vite";
7
6
  import { nitro } from "nitro/vite";
7
+ import { defineConfig } from "vite";
8
+ import viteTsConfigPaths from "vite-tsconfig-paths";
8
9
 
9
10
  export default defineConfig({
10
11
  plugins: [
12
+ iconifyPreload(),
11
13
  devtools(),
12
14
  nitro({ preset: "bun" }) as any,
13
15
  viteTsConfigPaths({ projects: ["./tsconfig.json"] }),
@@ -1,12 +0,0 @@
1
- import { createClient } from "questpie/client";
2
- import type { AppCMS, AppRpc } from "@/questpie/server/app.js";
3
-
4
- export const client = createClient<AppCMS, AppRpc>({
5
- baseURL:
6
- typeof window !== "undefined"
7
- ? window.location.origin
8
- : process.env.APP_URL || "http://localhost:3000",
9
- basePath: "/api/cms",
10
- });
11
-
12
- export type CMSClient = typeof client;
@@ -1,8 +0,0 @@
1
- // Migrations will be generated by the QUESTPIE CLI.
2
- // Run: bun questpie migrate
3
- //
4
- // This file exports all migrations for the CMS to apply.
5
-
6
- import type { Migration } from "questpie";
7
-
8
- export const migrations: Migration[] = [];
@@ -1,4 +0,0 @@
1
- import { adminModule, qa } from "@questpie/admin/client";
2
- import type { AppCMS } from "@/questpie/server/app.js";
3
-
4
- export const builder = qa<AppCMS>().use(adminModule);
@@ -1,4 +0,0 @@
1
- import { adminModule } from "@questpie/admin/server";
2
- import { q } from "questpie";
3
-
4
- export const qb = q.use(adminModule);
@@ -1,68 +0,0 @@
1
- export function configureDashboard({ d }: any) {
2
- return d.dashboard({
3
- title: "Dashboard",
4
- description: "Overview of your content",
5
- columns: 4,
6
- items: [
7
- {
8
- type: "section",
9
- label: "Content",
10
- layout: "grid",
11
- columns: 2,
12
- items: [
13
- {
14
- id: "total-posts",
15
- type: "stats",
16
- collection: "posts",
17
- label: "Total Posts",
18
- span: 1,
19
- },
20
- {
21
- id: "published-posts",
22
- type: "stats",
23
- collection: "posts",
24
- label: "Published",
25
- filter: { published: true },
26
- variant: "primary",
27
- span: 1,
28
- },
29
- ],
30
- },
31
- {
32
- type: "section",
33
- label: "Recent",
34
- layout: "grid",
35
- columns: 4,
36
- items: [
37
- {
38
- id: "recent-posts",
39
- type: "recentItems",
40
- collection: "posts",
41
- label: "Recent Posts",
42
- limit: 5,
43
- span: 2,
44
- },
45
- {
46
- id: "quick-actions",
47
- type: "quickActions",
48
- label: "Quick Actions",
49
- actions: [
50
- {
51
- label: "New Post",
52
- action: { type: "create", collection: "posts" },
53
- },
54
- {
55
- label: "Site Settings",
56
- action: {
57
- type: "link",
58
- href: "/admin/globals/siteSettings",
59
- },
60
- },
61
- ],
62
- span: 2,
63
- },
64
- ],
65
- },
66
- ],
67
- });
68
- }
@@ -1,4 +0,0 @@
1
- import { rpc } from "questpie";
2
- import type { AppCMS } from "./app.js";
3
-
4
- export const r = rpc<AppCMS>();
@@ -1,26 +0,0 @@
1
- import type { qb } from "./builder.js";
2
-
3
- type SidebarBuilder = Parameters<
4
- Parameters<ReturnType<typeof qb.collection>["sidebar"]>[0]
5
- >[0];
6
-
7
- export function configureSidebar({ s, c }: any) {
8
- return s.sidebar({
9
- sections: [
10
- s.section({
11
- id: "main",
12
- title: "Content",
13
- items: [
14
- {
15
- type: "link",
16
- label: "Dashboard",
17
- href: "/admin",
18
- icon: c.icon("ph:house"),
19
- },
20
- { type: "collection", collection: "posts" },
21
- { type: "global", global: "siteSettings" },
22
- ],
23
- }),
24
- ],
25
- });
26
- }