create-questpie 1.0.0 → 2.0.1

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 (43) hide show
  1. package/README.md +20 -12
  2. package/dist/index.mjs +10 -3
  3. package/package.json +21 -21
  4. package/templates/tanstack-start/AGENTS.md +371 -318
  5. package/templates/tanstack-start/CLAUDE.md +84 -52
  6. package/templates/tanstack-start/README.md +65 -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/.generated/client.ts +13 -0
  15. package/templates/tanstack-start/src/questpie/admin/admin.ts +8 -4
  16. package/templates/tanstack-start/src/questpie/admin/modules.ts +1 -0
  17. package/templates/tanstack-start/src/questpie/server/.generated/factories.ts +194 -0
  18. package/templates/tanstack-start/src/questpie/server/.generated/index.ts +201 -0
  19. package/templates/tanstack-start/src/questpie/server/app.ts +10 -52
  20. package/templates/tanstack-start/src/questpie/server/collections/posts.collection.ts +39 -53
  21. package/templates/tanstack-start/src/questpie/server/config/admin.ts +83 -0
  22. package/templates/tanstack-start/src/questpie/server/config/auth.ts +8 -0
  23. package/templates/tanstack-start/src/questpie/server/config/openapi.ts +10 -0
  24. package/templates/tanstack-start/src/questpie/server/globals/site-settings.global.ts +9 -14
  25. package/templates/tanstack-start/src/questpie/server/modules.ts +10 -0
  26. package/templates/tanstack-start/src/questpie/server/questpie.config.ts +20 -0
  27. package/templates/tanstack-start/src/router.tsx +6 -5
  28. package/templates/tanstack-start/src/routes/__root.tsx +11 -9
  29. package/templates/tanstack-start/src/routes/admin/$.tsx +14 -13
  30. package/templates/tanstack-start/src/routes/admin/index.tsx +11 -10
  31. package/templates/tanstack-start/src/routes/admin/login.tsx +11 -10
  32. package/templates/tanstack-start/src/routes/admin.tsx +53 -52
  33. package/templates/tanstack-start/src/routes/api/{cms/$.ts → $.ts} +6 -20
  34. package/templates/tanstack-start/src/styles.css +109 -109
  35. package/templates/tanstack-start/tsconfig.json +27 -25
  36. package/templates/tanstack-start/vite.config.ts +5 -3
  37. package/templates/tanstack-start/src/lib/cms-client.ts +0 -12
  38. package/templates/tanstack-start/src/migrations/index.ts +0 -8
  39. package/templates/tanstack-start/src/questpie/admin/builder.ts +0 -4
  40. package/templates/tanstack-start/src/questpie/server/builder.ts +0 -4
  41. package/templates/tanstack-start/src/questpie/server/dashboard.ts +0 -68
  42. package/templates/tanstack-start/src/questpie/server/rpc.ts +0 -4
  43. package/templates/tanstack-start/src/questpie/server/sidebar.ts +0 -26
package/README.md CHANGED
@@ -44,21 +44,23 @@ my-app/
44
44
  ├── src/
45
45
  │ ├── questpie/
46
46
  │ │ ├── server/
47
- │ │ │ ├── builder.ts # q.use(adminModule) setup
48
- │ │ │ ├── cms.ts # CMS assembly + build
49
- │ │ │ ├── collections/ # Collection definitions
50
- │ │ │ └── globals/ # Global definitions
47
+ │ │ │ ├── questpie.config.ts # runtimeConfig({ db, app, ... })
48
+ │ │ │ ├── modules.ts # [adminModule, ...] as const
49
+ │ │ │ ├── auth.ts # Auth config (satisfies AuthConfig)
50
+ │ │ │ ├── .generated/ # Codegen output (app + App type)
51
+ │ │ │ ├── collections/ # Collection definitions (auto-discovered)
52
+ │ │ │ └── globals/ # Global definitions (auto-discovered)
51
53
  │ │ └── admin/
52
- │ │ └── admin.ts # Client admin builder
54
+ │ │ └── builder.ts # Client admin builder
53
55
  │ ├── lib/
54
- │ │ ├── cms-client.ts # Typed CMS client
55
- │ │ └── query-client.ts # TanStack Query client
56
+ │ │ ├── client.ts # Typed client
57
+ │ │ └── query-client.ts # TanStack Query client
56
58
  │ ├── routes/
57
- │ │ ├── api/cms.ts # CMS route handler
58
- │ │ └── admin/ # Admin panel routes
59
- │ └── migrations/ # Drizzle migrations
60
- ├── questpie.config.ts # CLI config
61
- ├── AGENTS.md # AI agent guidance
59
+ │ │ ├── api/$.ts # QUESTPIE route handler
60
+ │ │ └── admin/ # Admin panel routes
61
+ │ └── migrations/ # Drizzle migrations
62
+ ├── questpie.config.ts # CLI config
63
+ ├── AGENTS.md # AI agent guidance
62
64
  ├── package.json
63
65
  └── vite.config.ts
64
66
  ```
@@ -70,8 +72,14 @@ cd my-app
70
72
  cp .env.example .env # Set DATABASE_URL
71
73
  bun questpie migrate # Run migrations
72
74
  bun dev # Start dev server
75
+
76
+ # Add entities (auto-runs codegen)
77
+ bun questpie add collection products
78
+ bun questpie add global marketing
73
79
  ```
74
80
 
81
+ `questpie add` runs codegen automatically. Use `bunx questpie generate` only when you create files manually.
82
+
75
83
  ## Documentation
76
84
 
77
85
  Full documentation: [https://questpie.com/docs/getting-started/quickstart](https://questpie.com/docs/getting-started/quickstart)
package/dist/index.mjs CHANGED
@@ -179,7 +179,7 @@ function isTextFile(filename) {
179
179
  return TEXT_EXTENSIONS.has(ext);
180
180
  }
181
181
  async function replaceInFile(filePath, vars) {
182
- const content = await readFile(filePath, "utf-8");
182
+ const content = (await readFile(filePath)).toString("utf-8");
183
183
  const replaced = content.replace(TEMPLATE_VAR_REGEX, (match, key) => {
184
184
  return key in vars ? vars[key] : match;
185
185
  });
@@ -260,14 +260,21 @@ async function scaffold(options) {
260
260
  `${runCmd} questpie migrate`,
261
261
  "",
262
262
  "# Start dev server",
263
- `${runCmd} dev`
263
+ `${runCmd} dev`,
264
+ "",
265
+ "# Add entities (auto-runs codegen)",
266
+ `${runCmd} questpie add collection products`,
267
+ `${runCmd} questpie add global marketing`,
268
+ "",
269
+ "# If you create files manually",
270
+ "bunx questpie generate"
264
271
  ].join("\n"), "Next steps");
265
272
  p.outro(`${label.success("Done!")} Happy building with QUESTPIE!`);
266
273
  }
267
274
 
268
275
  //#endregion
269
276
  //#region src/index.ts
270
- new Command().name("create-questpie").description("Create a new QUESTPIE CMS project").version("0.1.0").argument("[project-name]", "Name of the project").option("-t, --template <name>", "Template to use (default: tanstack-start)").option("--no-install", "Skip dependency installation").option("--no-git", "Skip git initialization").action(async (projectName, opts) => {
277
+ new Command().name("create-questpie").description("Create a new QUESTPIE project").version("0.1.0").argument("[project-name]", "Name of the project").option("-t, --template <name>", "Template to use (default: tanstack-start)").option("--no-install", "Skip dependency installation").option("--no-git", "Skip git initialization").action(async (projectName, opts) => {
271
278
  if (opts.template && !getTemplate(opts.template)) {
272
279
  console.error(`Unknown template: ${opts.template}`);
273
280
  process.exit(1);
package/package.json CHANGED
@@ -1,8 +1,20 @@
1
1
  {
2
2
  "name": "create-questpie",
3
- "version": "1.0.0",
4
- "type": "module",
5
- "description": "Create a new QUESTPIE CMS project",
3
+ "version": "2.0.1",
4
+ "description": "Create a new QUESTPIE project",
5
+ "keywords": [
6
+ "create",
7
+ "framework",
8
+ "questpie",
9
+ "scaffold",
10
+ "template"
11
+ ],
12
+ "license": "MIT",
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "https://github.com/questpie/questpie.git",
16
+ "directory": "packages/create-questpie"
17
+ },
6
18
  "bin": {
7
19
  "create-questpie": "./dist/index.mjs"
8
20
  },
@@ -10,6 +22,10 @@
10
22
  "dist",
11
23
  "templates"
12
24
  ],
25
+ "type": "module",
26
+ "publishConfig": {
27
+ "access": "public"
28
+ },
13
29
  "scripts": {
14
30
  "build": "tsdown",
15
31
  "dev": "tsdown --watch",
@@ -17,28 +33,12 @@
17
33
  },
18
34
  "dependencies": {
19
35
  "@clack/prompts": "^0.10.0",
20
- "commander": "^13.0.0",
36
+ "commander": "^14.0.2",
21
37
  "picocolors": "^1.1.1"
22
38
  },
23
39
  "devDependencies": {
24
40
  "bun-types": "latest",
25
41
  "tsdown": "^0.18.3",
26
42
  "typescript": "^5.9.2"
27
- },
28
- "repository": {
29
- "type": "git",
30
- "url": "https://github.com/questpie/questpie-cms.git",
31
- "directory": "packages/create-questpie"
32
- },
33
- "publishConfig": {
34
- "access": "public"
35
- },
36
- "keywords": [
37
- "questpie",
38
- "cms",
39
- "create",
40
- "scaffold",
41
- "template"
42
- ],
43
- "license": "MIT"
43
+ }
44
44
  }