@beignet/cli 0.0.4 → 0.0.6

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 (73) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dist/choices.d.ts +5 -28
  3. package/dist/choices.d.ts.map +1 -1
  4. package/dist/choices.js +0 -35
  5. package/dist/choices.js.map +1 -1
  6. package/dist/create-prompts.d.ts +5 -6
  7. package/dist/create-prompts.d.ts.map +1 -1
  8. package/dist/create-prompts.js +19 -77
  9. package/dist/create-prompts.js.map +1 -1
  10. package/dist/create.d.ts +6 -4
  11. package/dist/create.d.ts.map +1 -1
  12. package/dist/create.js +15 -24
  13. package/dist/create.js.map +1 -1
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +32 -39
  16. package/dist/index.js.map +1 -1
  17. package/dist/lib.d.ts +1 -1
  18. package/dist/lib.d.ts.map +1 -1
  19. package/dist/make.d.ts.map +1 -1
  20. package/dist/make.js +153 -1
  21. package/dist/make.js.map +1 -1
  22. package/dist/templates/base.d.ts +13 -0
  23. package/dist/templates/base.d.ts.map +1 -0
  24. package/dist/templates/base.js +300 -0
  25. package/dist/templates/base.js.map +1 -0
  26. package/dist/templates/db.d.ts +15 -0
  27. package/dist/templates/db.d.ts.map +1 -0
  28. package/dist/templates/db.js +1001 -0
  29. package/dist/templates/db.js.map +1 -0
  30. package/dist/templates/index.d.ts +14 -0
  31. package/dist/templates/index.d.ts.map +1 -0
  32. package/dist/templates/index.js +124 -0
  33. package/dist/templates/index.js.map +1 -0
  34. package/dist/templates/server.d.ts +26 -0
  35. package/dist/templates/server.d.ts.map +1 -0
  36. package/dist/templates/server.js +525 -0
  37. package/dist/templates/server.js.map +1 -0
  38. package/dist/templates/shadcn.d.ts +5 -0
  39. package/dist/templates/shadcn.d.ts.map +1 -0
  40. package/dist/templates/shadcn.js +555 -0
  41. package/dist/templates/shadcn.js.map +1 -0
  42. package/dist/templates/shared.d.ts +49 -0
  43. package/dist/templates/shared.d.ts.map +1 -0
  44. package/dist/templates/shared.js +57 -0
  45. package/dist/templates/shared.js.map +1 -0
  46. package/dist/templates/shell.d.ts +5 -0
  47. package/dist/templates/shell.d.ts.map +1 -0
  48. package/dist/templates/shell.js +1198 -0
  49. package/dist/templates/shell.js.map +1 -0
  50. package/dist/templates/todos.d.ts +17 -0
  51. package/dist/templates/todos.d.ts.map +1 -0
  52. package/dist/templates/todos.js +607 -0
  53. package/dist/templates/todos.js.map +1 -0
  54. package/package.json +2 -2
  55. package/src/choices.ts +4 -58
  56. package/src/create-prompts.ts +20 -88
  57. package/src/create.ts +21 -38
  58. package/src/index.ts +39 -45
  59. package/src/lib.ts +1 -1
  60. package/src/make.ts +208 -1
  61. package/src/templates/base.ts +377 -0
  62. package/src/templates/db.ts +1002 -0
  63. package/src/templates/index.ts +149 -0
  64. package/src/templates/server.ts +533 -0
  65. package/src/templates/shadcn.ts +570 -0
  66. package/src/templates/shared.ts +90 -0
  67. package/src/templates/shell.ts +1227 -0
  68. package/src/templates/todos.ts +607 -0
  69. package/dist/templates.d.ts +0 -26
  70. package/dist/templates.d.ts.map +0 -1
  71. package/dist/templates.js +0 -3995
  72. package/dist/templates.js.map +0 -1
  73. package/src/templates.ts +0 -4280
package/CHANGELOG.md CHANGED
@@ -1,9 +1,38 @@
1
1
  # @beignet/cli
2
2
 
3
+ ## 0.0.6
4
+
5
+ ### Patch Changes
6
+
7
+ - 5850e38: Generated apps apply pending Drizzle migrations automatically in development
8
+ on the first database access — including through the Better Auth routes,
9
+ which can run before any Beignet provider boots — so `bun run dev` works on a
10
+ fresh clone without remembering `beignet db migrate`. Production never
11
+ mutates the schema: an unmigrated database fails loudly with the migrate
12
+ command to run.
13
+ - ee283df: The generated app shell loads Inter through `next/font` and wires it into the
14
+ `--font-sans` token, so the starter renders with a real typeface instead of
15
+ the browser's serif fallback.
16
+ - @beignet/core@0.0.6
17
+
18
+ ## 0.0.5
19
+
20
+ ### Patch Changes
21
+
22
+ - 29653f5: beignet make schedule now maintains the app schedule registry: it creates server/schedules.ts on demand, appends new feature schedules idempotently, and with --route wires CRON_SECRET into lib/env.ts, .env.example, and an existing .env.local with a generated secret.
23
+ - 29653f5: beignet create scaffolds a single full-stack starter with a shadcn/Tailwind UI shell, Better Auth sign-in, and vendored Drizzle migrations; --preset and --features are replaced by --api, and base providers (Better Auth, Drizzle/libSQL, pino) are no longer --integrations choices.
24
+ - @beignet/core@0.0.5
25
+
3
26
  ## 0.0.4
4
27
 
5
28
  ### Patch Changes
6
29
 
30
+ - Fix the generated standard app failing `next build`: the outbox and schedule
31
+ registries imported `./index.js` (which Turbopack cannot resolve to a
32
+ TypeScript file), and the database bootstrap hit `SQLITE_BUSY` when Next's
33
+ parallel page-data workers booted the server concurrently (it now sets a
34
+ busy timeout). The generated-app conformance check now runs the README's
35
+ database setup and `next build` for every scenario.
7
36
  - 8bcb31f: Mark package READMEs with Beignet's experimental alpha status and 0.0.x stability expectations.
8
37
  - c1a834d: Generate an app-owned client error helper and align form error handling docs with
9
38
  the canonical React Query and React Hook Form mutation path.
package/dist/choices.d.ts CHANGED
@@ -7,22 +7,17 @@
7
7
  * Package managers supported by the app template generator.
8
8
  */
9
9
  export type PackageManager = "bun" | "npm" | "pnpm" | "yarn";
10
- /**
11
- * Starter presets supported by the app template generator.
12
- */
13
- export type PresetName = "minimal" | "standard";
14
10
  /**
15
11
  * Application templates supported by the app template generator.
16
12
  */
17
13
  export type TemplateName = "next";
18
- /**
19
- * Optional first-party features that can be scaffolded into a new app.
20
- */
21
- export type FeatureName = "client" | "react-query" | "forms" | "openapi";
22
14
  /**
23
15
  * Optional provider integrations that can be scaffolded into a new app.
16
+ *
17
+ * Better Auth, Drizzle/libSQL, and pino ship in every starter, so only
18
+ * integrations that add an external service remain selectable.
24
19
  */
25
- export type IntegrationName = "better-auth" | "drizzle-turso" | "inngest" | "pino" | "resend" | "upstash-rate-limit";
20
+ export type IntegrationName = "inngest" | "resend" | "upstash-rate-limit";
26
21
  /**
27
22
  * Supported scaffold template choices.
28
23
  */
@@ -31,28 +26,10 @@ export declare const templateChoices: readonly ["next"];
31
26
  * Supported scaffold package manager choices.
32
27
  */
33
28
  export declare const packageManagerChoices: readonly ["bun", "npm", "pnpm", "yarn"];
34
- /**
35
- * Supported scaffold feature choices.
36
- */
37
- export declare const featureChoices: readonly ["client", "react-query", "forms", "openapi"];
38
- /**
39
- * Supported scaffold preset choices.
40
- */
41
- export declare const presetChoices: readonly ["minimal", "standard"];
42
29
  /**
43
30
  * Supported scaffold integration choices.
44
31
  */
45
- export declare const integrationChoices: readonly ["better-auth", "drizzle-turso", "inngest", "pino", "resend", "upstash-rate-limit"];
46
- /**
47
- * Features included by each starter preset before explicit `--features`
48
- * selections are added.
49
- */
50
- export declare const presetFeatureDefaults: Record<PresetName, readonly FeatureName[]>;
51
- /**
52
- * Integrations included by each starter preset before explicit
53
- * `--integrations` selections are added.
54
- */
55
- export declare const presetIntegrationDefaults: Record<PresetName, readonly IntegrationName[]>;
32
+ export declare const integrationChoices: readonly ["inngest", "resend", "upstash-rate-limit"];
56
33
  /**
57
34
  * Shells supported by `beignet completion install` and `uninstall`.
58
35
  */
@@ -1 +1 @@
1
- {"version":3,"file":"choices.d.ts","sourceRoot":"","sources":["../src/choices.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;AAC7D;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,UAAU,CAAC;AAChD;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC;AAClC;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,aAAa,GAAG,OAAO,GAAG,SAAS,CAAC;AACzE;;GAEG;AACH,MAAM,MAAM,eAAe,GACvB,aAAa,GACb,eAAe,GACf,SAAS,GACT,MAAM,GACN,QAAQ,GACR,oBAAo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;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,KAAK,CAAC;AAE7C;;GAEG;AACH,eAAO,MAAM,sBAAsB,0BAGY,CAAC;AAEhD;;GAEG;AACH,eAAO,MAAM,uBAAuB,oIAa1B,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC"}
package/dist/choices.js CHANGED
@@ -18,49 +18,14 @@ export const packageManagerChoices = [
18
18
  "pnpm",
19
19
  "yarn",
20
20
  ];
21
- /**
22
- * Supported scaffold feature choices.
23
- */
24
- export const featureChoices = [
25
- "client",
26
- "react-query",
27
- "forms",
28
- "openapi",
29
- ];
30
- /**
31
- * Supported scaffold preset choices.
32
- */
33
- export const presetChoices = [
34
- "minimal",
35
- "standard",
36
- ];
37
21
  /**
38
22
  * Supported scaffold integration choices.
39
23
  */
40
24
  export const integrationChoices = [
41
- "better-auth",
42
- "drizzle-turso",
43
25
  "inngest",
44
- "pino",
45
26
  "resend",
46
27
  "upstash-rate-limit",
47
28
  ];
48
- /**
49
- * Features included by each starter preset before explicit `--features`
50
- * selections are added.
51
- */
52
- export const presetFeatureDefaults = {
53
- minimal: [],
54
- standard: featureChoices,
55
- };
56
- /**
57
- * Integrations included by each starter preset before explicit
58
- * `--integrations` selections are added.
59
- */
60
- export const presetIntegrationDefaults = {
61
- minimal: [],
62
- standard: ["better-auth", "drizzle-turso", "pino"],
63
- };
64
29
  /**
65
30
  * Supported completion shell choices.
66
31
  */
@@ -1 +1 @@
1
- {"version":3,"file":"choices.js","sourceRoot":"","sources":["../src/choices.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AA6BH;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,MAAM;CACoC,CAAC;AAE7C;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,KAAK;IACL,KAAK;IACL,MAAM;IACN,MAAM;CACsC,CAAC;AAE/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C;AAOhD;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,MAAM;IACN,KAAK;CACwC,CAAC;AAEhD;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,KAAK;IACL,MAAM;IACN,cAAc;IACd,eAAe;IACf,MAAM;IACN,OAAO;IACP,IAAI;IACJ,QAAQ;IACR,SAAS;CACD,CAAC"}
@@ -5,14 +5,13 @@
5
5
  * `@clack/prompts` is loaded lazily inside the prompt flow so non-interactive
6
6
  * runs and CLI startup never pay for it.
7
7
  */
8
- import { type FeatureName, type IntegrationName, type PackageManager, type PresetName } from "./choices.js";
8
+ import { type IntegrationName, type PackageManager } from "./choices.js";
9
9
  /**
10
10
  * Selections shared by create flags and interactive prompt answers.
11
11
  */
12
12
  export type CreateSelections = {
13
13
  directory?: string;
14
- preset?: PresetName;
15
- features?: readonly FeatureName[];
14
+ api?: boolean;
16
15
  integrations?: readonly IntegrationName[];
17
16
  packageManager?: PackageManager;
18
17
  };
@@ -27,9 +26,9 @@ type CreatePromptTty = {
27
26
  * Decide whether `beignet create` should run the interactive prompt flow.
28
27
  *
29
28
  * Prompts run only on a full TTY, only when `--yes` is absent, and only when
30
- * no selection flag was passed. Any explicit preset, feature, integration, or
31
- * package manager selection means the invocation is scripted, so the
32
- * non-interactive path stays byte-identical for agents and CI.
29
+ * no selection flag was passed. Any explicit api, integration, or package
30
+ * manager selection means the invocation is scripted, so the non-interactive
31
+ * path stays byte-identical for agents and CI.
33
32
  */
34
33
  export declare function shouldPromptInteractively(flags: CreatePromptFlags, tty: CreatePromptTty): boolean;
35
34
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"create-prompts.d.ts","sourceRoot":"","sources":["../src/create-prompts.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,KAAK,WAAW,EAEhB,KAAK,eAAe,EAEpB,KAAK,cAAc,EACnB,KAAK,UAA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IACf,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,iBAAiB,EACxB,GAAG,EAAE,eAAe,GACnB,OAAO,CAUT;AAQD;;;;GAIG;AACH,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC,CA4CvC"}
@@ -5,37 +5,27 @@
5
5
  * `@clack/prompts` is loaded lazily inside the prompt flow so non-interactive
6
6
  * runs and CLI startup never pay for it.
7
7
  */
8
- import { featureChoices, integrationChoices, packageManagerChoices, presetIntegrationDefaults, } from "./choices.js";
8
+ import { integrationChoices, } from "./choices.js";
9
9
  /**
10
10
  * Decide whether `beignet create` should run the interactive prompt flow.
11
11
  *
12
12
  * Prompts run only on a full TTY, only when `--yes` is absent, and only when
13
- * no selection flag was passed. Any explicit preset, feature, integration, or
14
- * package manager selection means the invocation is scripted, so the
15
- * non-interactive path stays byte-identical for agents and CI.
13
+ * no selection flag was passed. Any explicit api, integration, or package
14
+ * manager selection means the invocation is scripted, so the non-interactive
15
+ * path stays byte-identical for agents and CI.
16
16
  */
17
17
  export function shouldPromptInteractively(flags, tty) {
18
18
  if (!tty.stdin || !tty.stdout)
19
19
  return false;
20
20
  if (flags.yes)
21
21
  return false;
22
- const selectionFlagPassed = flags.preset !== undefined ||
23
- (flags.features?.length ?? 0) > 0 ||
22
+ const selectionFlagPassed = flags.api !== undefined ||
24
23
  (flags.integrations?.length ?? 0) > 0 ||
25
24
  flags.packageManager !== undefined;
26
25
  return !selectionFlagPassed;
27
26
  }
28
- const featureHints = {
29
- client: "Typed Beignet HTTP client",
30
- "react-query": "TanStack Query helpers for contracts",
31
- forms: "React Hook Form wired to contract bodies",
32
- openapi: "OpenAPI document route generated from contracts",
33
- };
34
27
  const integrationHints = {
35
- "better-auth": "Better Auth routes and auth provider wiring",
36
- "drizzle-turso": "Drizzle/libSQL persistence with Turso-ready config",
37
28
  inngest: "Inngest-backed background jobs",
38
- pino: "Pino logger provider",
39
29
  resend: "Resend-backed mail provider",
40
30
  "upstash-rate-limit": "Upstash-backed rate limiting",
41
31
  };
@@ -60,77 +50,29 @@ export async function promptCreateSelections(initial) {
60
50
  return undefined;
61
51
  directory = answer;
62
52
  }
63
- const preset = await prompts.select({
64
- message: "Which starter preset?",
65
- options: [
66
- {
67
- value: "standard",
68
- label: "standard",
69
- hint: "Full app layout with auth, database, jobs, and devtools",
70
- },
71
- {
72
- value: "minimal",
73
- label: "minimal",
74
- hint: "Smallest contract/server/use-case loop",
75
- },
76
- ],
77
- initialValue: "standard",
53
+ const api = await prompts.confirm({
54
+ message: "API-only app (no UI shell)?",
55
+ initialValue: false,
78
56
  });
79
- if (prompts.isCancel(preset))
57
+ if (prompts.isCancel(api))
80
58
  return undefined;
81
- // The standard preset already includes every starter feature, so the
82
- // feature multiselect only appears when the preset leaves features open.
83
- let features;
84
- if (preset === "minimal") {
85
- const answer = await prompts.multiselect({
86
- message: "Add starter features? (press enter to skip)",
87
- options: featureChoices.map((feature) => ({
88
- value: feature,
89
- label: feature,
90
- hint: featureHints[feature],
91
- })),
92
- required: false,
93
- });
94
- if (prompts.isCancel(answer))
95
- return undefined;
96
- features = answer;
97
- }
98
- const presetIntegrations = new Set(presetIntegrationDefaults[preset]);
99
- const integrationOptions = integrationChoices.filter((integration) => !presetIntegrations.has(integration));
100
- let integrations;
101
- if (integrationOptions.length > 0) {
102
- const answer = await prompts.multiselect({
103
- message: presetIntegrations.size > 0
104
- ? "Add provider integrations beyond the preset defaults? (press enter to skip)"
105
- : "Add provider integrations? (press enter to skip)",
106
- options: integrationOptions.map((integration) => ({
107
- value: integration,
108
- label: integration,
109
- hint: integrationHints[integration],
110
- })),
111
- required: false,
112
- });
113
- if (prompts.isCancel(answer))
114
- return undefined;
115
- integrations = answer;
116
- }
117
- const packageManager = await prompts.select({
118
- message: "Which package manager?",
119
- options: packageManagerChoices.map((manager) => ({
120
- value: manager,
121
- label: manager,
59
+ const integrations = await prompts.multiselect({
60
+ message: "Add provider integrations? (press enter to skip)",
61
+ options: integrationChoices.map((integration) => ({
62
+ value: integration,
63
+ label: integration,
64
+ hint: integrationHints[integration],
122
65
  })),
123
- initialValue: "bun",
66
+ required: false,
124
67
  });
125
- if (prompts.isCancel(packageManager))
68
+ if (prompts.isCancel(integrations))
126
69
  return undefined;
127
70
  prompts.outro(`Creating ${directory}`);
128
71
  return {
129
72
  directory,
130
- preset,
131
- features,
73
+ api,
132
74
  integrations,
133
- packageManager,
75
+ packageManager: initial.packageManager,
134
76
  };
135
77
  }
136
78
  //# sourceMappingURL=create-prompts.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-prompts.js","sourceRoot":"","sources":["../src/create-prompts.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAEL,cAAc,EAEd,kBAAkB,EAGlB,qBAAqB,EACrB,yBAAyB,GAC1B,MAAM,cAAc,CAAC;AAsBtB;;;;;;;GAOG;AACH,MAAM,UAAU,yBAAyB,CACvC,KAAwB,EACxB,GAAoB;IAEpB,IAAI,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC,GAAG,CAAC,MAAM;QAAE,OAAO,KAAK,CAAC;IAC5C,IAAI,KAAK,CAAC,GAAG;QAAE,OAAO,KAAK,CAAC;IAE5B,MAAM,mBAAmB,GACvB,KAAK,CAAC,MAAM,KAAK,SAAS;QAC1B,CAAC,KAAK,CAAC,QAAQ,EAAE,MAAM,IAAI,CAAC,CAAC,GAAG,CAAC;QACjC,CAAC,KAAK,CAAC,YAAY,EAAE,MAAM,IAAI,CAAC,CAAC,GAAG,CAAC;QACrC,KAAK,CAAC,cAAc,KAAK,SAAS,CAAC;IAErC,OAAO,CAAC,mBAAmB,CAAC;AAC9B,CAAC;AAED,MAAM,YAAY,GAAgC;IAChD,MAAM,EAAE,2BAA2B;IACnC,aAAa,EAAE,sCAAsC;IACrD,KAAK,EAAE,0CAA0C;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,EAAE,WAAW;YAClB,IAAI,EAAE,gBAAgB,CAAC,WAAW,CAAC;SACpC,CAAC,CAAC;QACH,QAAQ,EAAE,KAAK;KAChB,CAAC,CAAC;IACH,IAAI,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC;QAAE,OAAO,SAAS,CAAC;IAErD,OAAO,CAAC,KAAK,CAAC,YAAY,SAAS,EAAE,CAAC,CAAC;IAEvC,OAAO;QACL,SAAS;QACT,GAAG;QACH,YAAY;QACZ,cAAc,EAAE,OAAO,CAAC,cAAc;KACvC,CAAC;AACJ,CAAC"}
package/dist/create.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { type FeatureName, type IntegrationName, type PackageManager, type PresetName, type TemplateName } from "./templates.js";
1
+ import { type IntegrationName, type PackageManager, type TemplateName } from "./templates/index.js";
2
2
  /**
3
3
  * Options for creating a new Beignet app.
4
4
  */
@@ -6,8 +6,10 @@ export type CreateOptions = {
6
6
  name: string;
7
7
  cwd?: string;
8
8
  template?: TemplateName;
9
- preset?: PresetName;
10
- features?: FeatureName[];
9
+ /**
10
+ * Scaffold an API-only app without the UI shell.
11
+ */
12
+ api?: boolean;
11
13
  packageManager?: PackageManager;
12
14
  integrations?: IntegrationName[];
13
15
  force?: boolean;
@@ -26,7 +28,7 @@ export type CreateResult = {
26
28
  packageManager: PackageManager;
27
29
  };
28
30
  /**
29
- * Create a Beignet app from a starter template.
31
+ * Create a Beignet app from the starter template.
30
32
  */
31
33
  export declare function createProject(options: CreateOptions): Promise<CreateResult>;
32
34
  //# sourceMappingURL=create.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../src/create.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,WAAW,EAGhB,KAAK,eAAe,EAEpB,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,YAAY,EAClB,MAAM,gBAAgB,CAAC;AAGxB;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,IAA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MAAM,CAAC;CACzB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,aAAa,EAAE,CAAC,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,cAAc,EAAE,cAAc,CAAC;CAChC,CAAC;AAEF;;GAEG;AACH,wBAAsB,aAAa,CACjC,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,YAAY,CAAC,CA6CvB"}
package/dist/create.js CHANGED
@@ -1,10 +1,9 @@
1
1
  import { mkdir, readdir, writeFile } from "node:fs/promises";
2
2
  import path from "node:path";
3
- import { presetFeatureDefaults, presetIntegrationDefaults } from "./choices.js";
4
- import { featureChoices, getTemplateFiles, integrationChoices, } from "./templates.js";
3
+ import { getTemplateFiles, integrationChoices, } from "./templates/index.js";
5
4
  import { getCliVersion } from "./version.js";
6
5
  /**
7
- * Create a Beignet app from a starter template.
6
+ * Create a Beignet app from the starter template.
8
7
  */
9
8
  export async function createProject(options) {
10
9
  const cwd = options.cwd ?? process.cwd();
@@ -12,9 +11,8 @@ export async function createProject(options) {
12
11
  const targetDir = path.resolve(cwd, options.name);
13
12
  const packageManager = options.packageManager ?? "bun";
14
13
  const template = options.template ?? "next";
15
- const preset = options.preset ?? "standard";
16
- const features = resolveFeatures(preset, options.features ?? []);
17
- const integrations = resolveIntegrations(preset, options.integrations ?? []);
14
+ const api = Boolean(options.api);
15
+ const integrations = resolveIntegrations(options.integrations ?? []);
18
16
  if (template !== "next") {
19
17
  throw new Error(`Unknown template "${template}". Available templates: next`);
20
18
  }
@@ -24,8 +22,7 @@ export async function createProject(options) {
24
22
  name,
25
23
  packageManager,
26
24
  beignetVersion: options.beignetVersion ?? getDefaultBeignetVersion(),
27
- preset,
28
- features,
25
+ api,
29
26
  integrations,
30
27
  });
31
28
  if (!dryRun) {
@@ -45,24 +42,18 @@ export async function createProject(options) {
45
42
  packageManager,
46
43
  };
47
44
  }
48
- function resolveFeatures(preset, explicitFeatures) {
49
- const features = new Set(presetFeatureDefaults[preset]);
50
- for (const feature of explicitFeatures) {
51
- features.add(feature);
52
- }
53
- if (features.has("forms")) {
54
- features.add("react-query");
55
- }
56
- if (features.has("react-query")) {
57
- features.add("client");
58
- }
59
- return featureChoices.filter((feature) => features.has(feature));
60
- }
61
- function resolveIntegrations(preset, explicitIntegrations) {
62
- const integrations = new Set(presetIntegrationDefaults[preset]);
45
+ /**
46
+ * Providers that ship in every starter. They used to be `--integrations`
47
+ * choices, so passing them gets a pointed error instead of a generic one.
48
+ */
49
+ const baseProviderNames = new Set(["better-auth", "drizzle-turso", "pino"]);
50
+ function resolveIntegrations(explicitIntegrations) {
63
51
  for (const integration of explicitIntegrations) {
64
- integrations.add(integration);
52
+ if (baseProviderNames.has(integration)) {
53
+ throw new Error(`${integration} is part of every Beignet starter and no longer an --integrations choice.`);
54
+ }
65
55
  }
56
+ const integrations = new Set(explicitIntegrations);
66
57
  return integrationChoices.filter((integration) => integrations.has(integration));
67
58
  }
68
59
  function getDefaultBeignetVersion() {
@@ -1 +1 @@
1
- {"version":3,"file":"create.js","sourceRoot":"","sources":["../src/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AAChF,OAAO,EAEL,cAAc,EACd,gBAAgB,EAEhB,kBAAkB,GAInB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AA8B7C;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,OAAsB;IAEtB,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE,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OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;IAC5B,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;IAC/C,CAAC;IAED,OAAO,IAAI;SACR,QAAQ,CAAC,OAAO,CAAC;SACjB,WAAW,EAAE;SACb,UAAU,CAAC,eAAe,EAAE,GAAG,CAAC,CAAC;AACtC,CAAC;AAED,KAAK,UAAU,cAAc,CAC3B,SAAiB,EACjB,KAAc;IAEd,IAAI,OAAiB,CAAC;IACtB,IAAI,CAAC;QACH,OAAO,GAAG,MAAM,OAAO,CAAC,SAAS,CAAC,CAAC;IACrC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO;IACT,CAAC;IAED,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;QACjC,MAAM,IAAI,KAAK,CACb,aAAa,SAAS,8CAA8C,CACrE,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAGA,OAAO,EAIL,KAAK,cAAc,EAInB,KAAK,4BAA4B,EACjC,KAAK,cAAc,EAEpB,MAAM,eAAe,CAAC;AAqBvB,KAAK,UAAU,GAAG,cAAc,GAAG;IACjC,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;CAClC,CAAC;AAg7CF,wBAAsB,IAAI,CACxB,MAAM,WAAwB,EAC9B,OAAO,GAAE,4BAA4B,CAAC,UAAU,CAAe,GAC9D,OAAO,CAAC,IAAI,CAAC,CAiBf"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAGA,OAAO,EAIL,KAAK,cAAc,EAInB,KAAK,4BAA4B,EACjC,KAAK,cAAc,EAEpB,MAAM,eAAe,CAAC;AAiBvB,KAAK,UAAU,GAAG,cAAc,GAAG;IACjC,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;CAClC,CAAC;AA86CF,wBAAsB,IAAI,CACxB,MAAM,WAAwB,EAC9B,OAAO,GAAE,4BAA4B,CAAC,UAAU,CAAe,GAC9D,OAAO,CAAC,IAAI,CAAC,CAiBf"}
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import { realpathSync } from "node:fs";
3
3
  import { fileURLToPath } from "node:url";
4
4
  import { buildApplication, buildCommand, buildRouteMap, proposeCompletions, run, text_en, } from "@stricli/core";
5
- import { completionShellChoices, featureChoices, integrationChoices, makeFeatureAddonChoices, packageManagerChoices, presetChoices, templateChoices, } from "./choices.js";
5
+ import { completionShellChoices, integrationChoices, makeFeatureAddonChoices, packageManagerChoices, templateChoices, } from "./choices.js";
6
6
  import { getCliVersion } from "./version.js";
7
7
  const outputFormatChoices = [
8
8
  "human",
@@ -123,7 +123,10 @@ function useColor() {
123
123
  const createCommand = buildCommand({
124
124
  docs: {
125
125
  brief: "Create a new Beignet app.",
126
- fullDescription: `Available features: ${featureChoices.join(", ")}
126
+ fullDescription: `Scaffolds a full-stack Beignet starter: typed contracts, Better Auth,
127
+ Drizzle/libSQL persistence with checked-in migrations, pino logging,
128
+ devtools, and a shadcn UI shell. Pass --api for an API-only scaffold
129
+ without the UI shell.
127
130
 
128
131
  Available integrations: ${integrationChoices.join(", ")}
129
132
 
@@ -138,11 +141,11 @@ prompt-based setup. Pass --yes or any selection flag to skip the prompts.`,
138
141
  default: "next",
139
142
  brief: "Template to use.",
140
143
  },
141
- preset: {
142
- kind: "enum",
143
- values: presetChoices,
144
+ api: {
145
+ kind: "boolean",
144
146
  optional: true,
145
- brief: "Starter preset to generate. Defaults to standard.",
147
+ withNegated: false,
148
+ brief: "Scaffold an API-only app without the UI shell.",
146
149
  },
147
150
  packageManager: {
148
151
  kind: "enum",
@@ -150,13 +153,6 @@ prompt-based setup. Pass --yes or any selection flag to skip the prompts.`,
150
153
  optional: true,
151
154
  brief: "Package manager to use in next-step commands.",
152
155
  },
153
- features: {
154
- kind: "enum",
155
- values: featureChoices,
156
- optional: true,
157
- variadic: ",",
158
- brief: "Add starter features as a comma-separated list.",
159
- },
160
156
  integrations: {
161
157
  kind: "enum",
162
158
  values: integrationChoices,
@@ -192,8 +188,7 @@ prompt-based setup. Pass --yes or any selection flag to skip the prompts.`,
192
188
  return async function runCreate(flags, directory) {
193
189
  let selections = {
194
190
  directory,
195
- preset: flags.preset,
196
- features: flags.features,
191
+ api: flags.api,
197
192
  integrations: flags.integrations,
198
193
  packageManager: flags.packageManager,
199
194
  };
@@ -213,12 +208,12 @@ prompt-based setup. Pass --yes or any selection flag to skip the prompts.`,
213
208
  if (selections.directory === undefined) {
214
209
  throw new Error("Project directory is required. Pass beignet create <directory>, or run beignet create in an interactive terminal.");
215
210
  }
211
+ const api = selections.api ?? false;
216
212
  const integrations = uniqueValues([...(selections.integrations ?? [])]);
217
213
  const result = await createProject({
218
214
  name: selections.directory,
219
215
  template: flags.template,
220
- preset: selections.preset ?? "standard",
221
- features: uniqueValues([...(selections.features ?? [])]),
216
+ api,
222
217
  packageManager: selections.packageManager,
223
218
  integrations,
224
219
  force: Boolean(flags.force),
@@ -226,7 +221,7 @@ prompt-based setup. Pass --yes or any selection flag to skip the prompts.`,
226
221
  });
227
222
  writeOutput(this, flags.json
228
223
  ? JSON.stringify(result, null, 2)
229
- : nextSteps(result, { integrations }));
224
+ : nextSteps(result, { api, integrations }));
230
225
  };
231
226
  },
232
227
  });
@@ -672,7 +667,7 @@ const makeScheduleCommand = buildCommand({
672
667
  });
673
668
  writeOutput(this, flags.json
674
669
  ? JSON.stringify(result, null, 2)
675
- : makeScheduleNextSteps(result));
670
+ : makeScheduleNextSteps(result, { route: Boolean(flags.route) }));
676
671
  };
677
672
  },
678
673
  });
@@ -788,34 +783,26 @@ ${plannedFiles}`;
788
783
  const pm = result.packageManager;
789
784
  const run = pm === "npm" ? "npm run" : `${pm} run`;
790
785
  const cli = packageRunnerFromPackageManager(pm);
791
- const envFileStep = result.files.includes(".env.example")
792
- ? " cp .env.example .env.local\n"
793
- : "";
794
786
  const envRequiredIntegrations = options.integrations?.filter(isEnvRequiredProviderIntegration) ?? [];
795
787
  const envStep = envRequiredIntegrations.length > 0
796
788
  ? " Fill .env.local for selected provider integrations before starting the app.\n"
797
789
  : "";
798
- const hasDatabase = result.files.some((file) => file.startsWith("infra/db/"));
799
- const databaseStep = hasDatabase
800
- ? `
801
- Prepare the database:
802
- ${cli} db generate
803
- ${cli} db migrate
804
- `
805
- : "";
806
- const featureDatabaseSteps = hasDatabase
807
- ? `
808
- ${cli} db generate
809
- ${cli} db migrate`
810
- : "";
790
+ const openStep = options.api
791
+ ? " open http://localhost:3000 for the API landing page"
792
+ : " open http://localhost:3000/sign-up";
811
793
  return `Created ${result.name} at ${result.targetDir}
812
794
 
813
795
  Next steps:
814
796
  cd ${result.targetDir}
815
797
  ${pm} install
816
- ${envFileStep}${envStep}${databaseStep}
798
+ cp .env.example .env.local
799
+ ${envStep}
800
+ Prepare the database:
801
+ ${cli} db migrate
802
+
817
803
  Start the app:
818
804
  ${run} dev
805
+ ${openStep}
819
806
 
820
807
  Inspect the app:
821
808
  ${cli} routes
@@ -823,7 +810,9 @@ Inspect the app:
823
810
  ${cli} doctor
824
811
 
825
812
  Generate a feature:
826
- ${cli} make feature projects${featureDatabaseSteps}
813
+ ${cli} make feature projects
814
+ ${cli} db generate
815
+ ${cli} db migrate
827
816
  ${run} test
828
817
  ${run} typecheck
829
818
  ${cli} lint
@@ -967,10 +956,14 @@ function makeListenerNextSteps(result) {
967
956
  "Register the listener collection from infrastructure startup.",
968
957
  ]);
969
958
  }
970
- function makeScheduleNextSteps(result) {
959
+ function makeScheduleNextSteps(result, options = {}) {
971
960
  return makeNextSteps(result, "schedule", [
972
961
  "Replace the starter payload and handler with the scheduled workflow.",
973
- "Trigger it from a cron route, worker, or provider adapter.",
962
+ ...(options.route
963
+ ? [
964
+ "Set CRON_SECRET in your deployment and configure a scheduled request with Authorization: Bearer $CRON_SECRET.",
965
+ ]
966
+ : ["Trigger it from a cron route, worker, or provider adapter."]),
974
967
  ]);
975
968
  }
976
969
  function makeUploadNextSteps(result) {