@beignet/cli 0.0.38 → 0.0.40

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 (92) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +154 -102
  3. package/dist/choices.d.ts +17 -21
  4. package/dist/choices.d.ts.map +1 -1
  5. package/dist/choices.js +21 -67
  6. package/dist/choices.js.map +1 -1
  7. package/dist/config.d.ts +1 -1
  8. package/dist/config.d.ts.map +1 -1
  9. package/dist/config.js +4 -2
  10. package/dist/config.js.map +1 -1
  11. package/dist/create-prompts.d.ts +5 -6
  12. package/dist/create-prompts.d.ts.map +1 -1
  13. package/dist/create-prompts.js +15 -15
  14. package/dist/create-prompts.js.map +1 -1
  15. package/dist/create.d.ts +11 -2
  16. package/dist/create.d.ts.map +1 -1
  17. package/dist/create.js +38 -28
  18. package/dist/create.js.map +1 -1
  19. package/dist/framework.d.ts +3 -0
  20. package/dist/framework.d.ts.map +1 -0
  21. package/dist/framework.js +6 -0
  22. package/dist/framework.js.map +1 -0
  23. package/dist/index.d.ts.map +1 -1
  24. package/dist/index.js +149 -47
  25. package/dist/index.js.map +1 -1
  26. package/dist/inspect.d.ts +4 -2
  27. package/dist/inspect.d.ts.map +1 -1
  28. package/dist/inspect.js +174 -34
  29. package/dist/inspect.js.map +1 -1
  30. package/dist/lib.d.ts +1 -1
  31. package/dist/lib.d.ts.map +1 -1
  32. package/dist/make/inbox.js +3 -3
  33. package/dist/make/inbox.js.map +1 -1
  34. package/dist/make/payments.d.ts.map +1 -1
  35. package/dist/make/payments.js +5 -3
  36. package/dist/make/payments.js.map +1 -1
  37. package/dist/make/shared.d.ts +10 -3
  38. package/dist/make/shared.d.ts.map +1 -1
  39. package/dist/make/shared.js +7 -8
  40. package/dist/make/shared.js.map +1 -1
  41. package/dist/make.d.ts +3 -2
  42. package/dist/make.d.ts.map +1 -1
  43. package/dist/make.js +549 -186
  44. package/dist/make.js.map +1 -1
  45. package/dist/mcp.d.ts.map +1 -1
  46. package/dist/mcp.js +15 -11
  47. package/dist/mcp.js.map +1 -1
  48. package/dist/provider-add.d.ts +21 -3
  49. package/dist/provider-add.d.ts.map +1 -1
  50. package/dist/provider-add.js +101 -65
  51. package/dist/provider-add.js.map +1 -1
  52. package/dist/task.js +1 -1
  53. package/dist/task.js.map +1 -1
  54. package/dist/templates/base.d.ts +1 -1
  55. package/dist/templates/base.d.ts.map +1 -1
  56. package/dist/templates/base.js +15 -15
  57. package/dist/templates/base.js.map +1 -1
  58. package/dist/templates/index.d.ts +2 -2
  59. package/dist/templates/index.d.ts.map +1 -1
  60. package/dist/templates/index.js +5 -5
  61. package/dist/templates/index.js.map +1 -1
  62. package/dist/templates/server.d.ts.map +1 -1
  63. package/dist/templates/server.js +17 -13
  64. package/dist/templates/server.js.map +1 -1
  65. package/dist/templates/shadcn.js +1 -1
  66. package/dist/templates/shared.d.ts +4 -4
  67. package/dist/templates/shared.d.ts.map +1 -1
  68. package/dist/templates/shared.js +6 -6
  69. package/dist/templates/shared.js.map +1 -1
  70. package/package.json +2 -2
  71. package/skills/app-structure/SKILL.md +29 -9
  72. package/src/choices.ts +38 -88
  73. package/src/config.ts +7 -3
  74. package/src/create-prompts.ts +20 -21
  75. package/src/create.ts +54 -36
  76. package/src/framework.ts +13 -0
  77. package/src/index.ts +193 -65
  78. package/src/inspect.ts +290 -39
  79. package/src/lib.ts +1 -1
  80. package/src/make/inbox.ts +3 -3
  81. package/src/make/payments.ts +10 -3
  82. package/src/make/shared.ts +16 -10
  83. package/src/make.ts +720 -176
  84. package/src/mcp.ts +20 -13
  85. package/src/provider-add.ts +159 -79
  86. package/src/task.ts +1 -1
  87. package/src/templates/base.ts +16 -16
  88. package/src/templates/index.ts +6 -6
  89. package/src/templates/server.ts +17 -13
  90. package/src/templates/shadcn.ts +1 -1
  91. package/src/templates/shared.ts +10 -10
  92. package/src/test-helpers/generated-app.ts +2 -1
@@ -2,10 +2,10 @@ import { databaseLocalUrl, databaseStartCommand } from "../choices.js";
2
2
  import { shadcnDependencies, shadcnDevDependencies } from "./shadcn.js";
3
3
  import {
4
4
  externalVersions,
5
- hasIntegration,
6
- integrationDeps,
5
+ hasStarterProvider,
7
6
  json,
8
7
  packageRunner,
8
+ starterProviderDeps,
9
9
  type TemplateContext,
10
10
  } from "./shared.js";
11
11
  import { shellDependencies, shellDevDependencies } from "./shell.js";
@@ -55,9 +55,9 @@ export function packageJson(ctx: TemplateContext): string {
55
55
  }
56
56
  }
57
57
 
58
- for (const integration of ctx.integrations) {
58
+ for (const provider of ctx.providers) {
59
59
  for (const [name, version] of Object.entries(
60
- integrationDeps[integration],
60
+ starterProviderDeps[provider],
61
61
  )) {
62
62
  dependencies[name] = version || ctx.beignetVersion;
63
63
  }
@@ -356,10 +356,10 @@ ${optionalAuthRedirects}
356
356
  : "; it refuses non-local hosts unless `BEIGNET_ALLOW_DATABASE_RESET=true`"
357
357
  }.
358
358
  - Remove \`DEVTOOLS_ENABLED=true\` in production unless you add authentication and stricter redaction.
359
- - Set \`APP_URL\`, \`BETTER_AUTH_SECRET\`, \`LOG_LEVEL\`, and service-specific integration variables in your hosting environment.
359
+ - Set \`APP_URL\`, \`BETTER_AUTH_SECRET\`, \`LOG_LEVEL\`, and provider-specific variables in your hosting environment.
360
360
  - Set \`BETTER_AUTH_TRUSTED_ORIGINS\` before serving auth across multiple origins.
361
361
  - Review the starter authorization policy before exposing user-owned data.
362
- ${ctx.integrations.length > 0 ? "\nSee `docs/integrations.md` for setup notes.\n" : ""}`;
362
+ ${ctx.providers.length > 0 ? "\nSee `docs/providers.md` for setup notes.\n" : ""}`;
363
363
  }
364
364
 
365
365
  function intentRunner(ctx: TemplateContext): string {
@@ -375,16 +375,16 @@ function intentRunner(ctx: TemplateContext): string {
375
375
  }
376
376
  }
377
377
 
378
- export function integrationsDoc(ctx: TemplateContext): string {
378
+ export function providersDoc(ctx: TemplateContext): string {
379
379
  const lines = [
380
- "# Integrations",
380
+ "# Providers",
381
381
  "",
382
- "The starter app added dependencies for the integrations you selected. Runtime providers are wired in `server/providers.ts` when Beignet can do so safely; integrations that need app-owned setup list their follow-up steps below.",
382
+ "The starter app added dependencies for the providers you selected. Runtime providers are wired in `server/providers.ts` when Beignet can do so safely; providers that need app-owned setup list their follow-up steps below.",
383
383
  "",
384
384
  ];
385
385
 
386
- for (const integration of ctx.integrations) {
387
- if (integration === "inngest") {
386
+ for (const provider of ctx.providers) {
387
+ if (provider === "jobs-inngest") {
388
388
  lines.push(
389
389
  "## Inngest jobs",
390
390
  "",
@@ -398,7 +398,7 @@ export function integrationsDoc(ctx: TemplateContext): string {
398
398
  );
399
399
  }
400
400
 
401
- if (integration === "resend") {
401
+ if (provider === "mail-resend") {
402
402
  lines.push(
403
403
  "## Resend mail",
404
404
  "",
@@ -410,7 +410,7 @@ export function integrationsDoc(ctx: TemplateContext): string {
410
410
  );
411
411
  }
412
412
 
413
- if (integration === "upstash-rate-limit") {
413
+ if (provider === "rate-limit-upstash") {
414
414
  lines.push(
415
415
  "## Upstash rate limit",
416
416
  "",
@@ -470,11 +470,11 @@ export function envExample(ctx: TemplateContext): string {
470
470
  "",
471
471
  ];
472
472
 
473
- if (hasIntegration(ctx, "inngest")) {
473
+ if (hasStarterProvider(ctx, "jobs-inngest")) {
474
474
  lines.push("INNGEST_APP_NAME=beignet-app", "# INNGEST_EVENT_KEY=", "");
475
475
  }
476
476
 
477
- if (hasIntegration(ctx, "resend")) {
477
+ if (hasStarterProvider(ctx, "mail-resend")) {
478
478
  lines.push(
479
479
  "# Dev placeholders keep the app bootable; set real Resend values before sending mail.",
480
480
  "RESEND_API_KEY=dev-placeholder-change-me",
@@ -483,7 +483,7 @@ export function envExample(ctx: TemplateContext): string {
483
483
  );
484
484
  }
485
485
 
486
- if (hasIntegration(ctx, "upstash-rate-limit")) {
486
+ if (hasStarterProvider(ctx, "rate-limit-upstash")) {
487
487
  lines.push(
488
488
  "# Dev placeholders keep the app bootable; set real Upstash values before rate limiting.",
489
489
  "UPSTASH_REDIS_REST_URL=https://dev-placeholder.upstash.io",
@@ -1,18 +1,18 @@
1
1
  export type {
2
2
  DatabaseName,
3
- IntegrationName,
4
3
  PackageManager,
4
+ StarterProviderName,
5
5
  TemplateName,
6
6
  } from "../choices.js";
7
- export { databaseChoices, integrationChoices } from "../choices.js";
7
+ export { databaseChoices, starterProviderChoices } from "../choices.js";
8
8
  export type { TemplateContext, TemplateFile } from "./shared.js";
9
9
 
10
10
  import { agentsMd, mcpJson } from "./agents.js";
11
11
  import {
12
12
  baseFiles,
13
13
  envExample,
14
- integrationsDoc,
15
14
  packageJson,
15
+ providersDoc,
16
16
  readme,
17
17
  } from "./base.js";
18
18
  import { dbFiles } from "./db/index.js";
@@ -154,10 +154,10 @@ export function getTemplateFiles(ctx: TemplateContext): TemplateFile[] {
154
154
  templateFiles.push(...shadcnTemplateFiles(), ...shellTemplateFiles(ctx));
155
155
  }
156
156
 
157
- if (ctx.integrations.length > 0) {
157
+ if (ctx.providers.length > 0) {
158
158
  templateFiles.push({
159
- path: "docs/integrations.md",
160
- content: integrationsDoc(ctx),
159
+ path: "docs/providers.md",
160
+ content: providersDoc(ctx),
161
161
  });
162
162
  }
163
163
 
@@ -1,7 +1,7 @@
1
1
  import { databaseLocalUrl } from "../choices.js";
2
2
  import {
3
3
  databaseDescriptor,
4
- hasIntegration,
4
+ hasStarterProvider,
5
5
  type TemplateContext,
6
6
  } from "./shared.js";
7
7
 
@@ -12,14 +12,14 @@ export function serverProviders(ctx: TemplateContext): string {
12
12
  'import { createDevtoolsProvider } from "@beignet/devtools";',
13
13
  'import { createBetterAuthProvider } from "@beignet/provider-auth-better-auth";',
14
14
  `import { ${db.providerFactory} } from "@beignet/provider-db-drizzle/${db.subpath}";`,
15
- hasIntegration(ctx, "inngest")
15
+ hasStarterProvider(ctx, "jobs-inngest")
16
16
  ? 'import { createInngestJobsProvider } from "@beignet/provider-jobs-inngest";'
17
17
  : undefined,
18
18
  'import { createPinoLoggerProvider } from "@beignet/provider-logger-pino";',
19
- hasIntegration(ctx, "resend")
19
+ hasStarterProvider(ctx, "mail-resend")
20
20
  ? 'import { createResendMailProvider } from "@beignet/provider-mail-resend";'
21
21
  : undefined,
22
- hasIntegration(ctx, "upstash-rate-limit")
22
+ hasStarterProvider(ctx, "rate-limit-upstash")
23
23
  ? 'import { createUpstashRateLimitProvider } from "@beignet/provider-rate-limit-upstash";'
24
24
  : undefined,
25
25
  'import * as schema from "@/infra/db/schema";',
@@ -35,11 +35,13 @@ export function serverProviders(ctx: TemplateContext): string {
35
35
  "\tcreatePinoLoggerProvider(),",
36
36
  `\t${db.providerInstance},`,
37
37
  "\tstarterDatabaseProvider,",
38
- hasIntegration(ctx, "inngest")
38
+ hasStarterProvider(ctx, "jobs-inngest")
39
39
  ? "\tcreateInngestJobsProvider(),"
40
40
  : undefined,
41
- hasIntegration(ctx, "resend") ? "\tcreateResendMailProvider()," : undefined,
42
- hasIntegration(ctx, "upstash-rate-limit")
41
+ hasStarterProvider(ctx, "mail-resend")
42
+ ? "\tcreateResendMailProvider(),"
43
+ : undefined,
44
+ hasStarterProvider(ctx, "rate-limit-upstash")
43
45
  ? "\tcreateUpstashRateLimitProvider(),"
44
46
  : undefined,
45
47
  ].filter((entry): entry is string => Boolean(entry));
@@ -58,9 +60,9 @@ ${entries.join("\n")}
58
60
  }
59
61
 
60
62
  export function ports(ctx: TemplateContext): string {
61
- const usesInngest = hasIntegration(ctx, "inngest");
62
- const usesResend = hasIntegration(ctx, "resend");
63
- const usesUpstash = hasIntegration(ctx, "upstash-rate-limit");
63
+ const usesInngest = hasStarterProvider(ctx, "jobs-inngest");
64
+ const usesResend = hasStarterProvider(ctx, "mail-resend");
65
+ const usesUpstash = hasStarterProvider(ctx, "rate-limit-upstash");
64
66
  const coreImports = [
65
67
  "\tBoundGate,",
66
68
  "\tGatePort,",
@@ -105,10 +107,12 @@ export function portWiring(ctx: TemplateContext): string {
105
107
  const deferred = [
106
108
  '\t\t"auth",',
107
109
  '\t\t"idempotency",',
108
- hasIntegration(ctx, "inngest") ? '\t\t"jobs",' : undefined,
110
+ hasStarterProvider(ctx, "jobs-inngest") ? '\t\t"jobs",' : undefined,
109
111
  '\t\t"logger",',
110
- hasIntegration(ctx, "resend") ? '\t\t"mailer",' : undefined,
111
- hasIntegration(ctx, "upstash-rate-limit") ? '\t\t"rateLimit",' : undefined,
112
+ hasStarterProvider(ctx, "mail-resend") ? '\t\t"mailer",' : undefined,
113
+ hasStarterProvider(ctx, "rate-limit-upstash")
114
+ ? '\t\t"rateLimit",'
115
+ : undefined,
112
116
  '\t\t"todos",',
113
117
  '\t\t"uow",',
114
118
  ].filter((entry): entry is string => Boolean(entry));
@@ -6,7 +6,7 @@ import type { TemplateFile } from "./shared.js";
6
6
  * uses.
7
7
  *
8
8
  * The config, tokens, and most primitives are vendored byte-identically from
9
- * `apps/example-twitter-clone` (shadcn style "radix-nova"), which is the
9
+ * `apps/example-next-twitter-clone` (shadcn style "radix-nova"), which is the
10
10
  * repo's source of truth for this stack. `checkbox` and `label` are ported
11
11
  * from the radix-nova registry following the same conventions.
12
12
  */
@@ -1,7 +1,7 @@
1
1
  import type {
2
2
  DatabaseName,
3
- IntegrationName,
4
3
  PackageManager,
4
+ StarterProviderName,
5
5
  } from "../choices.js";
6
6
 
7
7
  /**
@@ -23,7 +23,7 @@ export type TemplateContext = {
23
23
  * When true, scaffold an API-only app without the UI shell.
24
24
  */
25
25
  api: boolean;
26
- integrations: IntegrationName[];
26
+ providers: StarterProviderName[];
27
27
  /**
28
28
  * Database backing the starter's Drizzle persistence layer.
29
29
  */
@@ -169,30 +169,30 @@ export function packageRunner(ctx: TemplateContext): string {
169
169
  }
170
170
  }
171
171
 
172
- export const integrationDeps: Record<
173
- IntegrationName,
172
+ export const starterProviderDeps: Record<
173
+ StarterProviderName,
174
174
  Record<string, string>
175
175
  > = {
176
- inngest: {
176
+ "jobs-inngest": {
177
177
  "@beignet/provider-jobs-inngest": "",
178
178
  inngest: externalVersions.inngest,
179
179
  },
180
- resend: {
180
+ "mail-resend": {
181
181
  "@beignet/provider-mail-resend": "",
182
182
  resend: externalVersions.resend,
183
183
  },
184
- "upstash-rate-limit": {
184
+ "rate-limit-upstash": {
185
185
  "@beignet/provider-rate-limit-upstash": "",
186
186
  "@upstash/ratelimit": externalVersions.upstashRateLimit,
187
187
  "@upstash/redis": externalVersions.upstashRedis,
188
188
  },
189
189
  };
190
190
 
191
- export function hasIntegration(
191
+ export function hasStarterProvider(
192
192
  ctx: TemplateContext,
193
- integration: IntegrationName,
193
+ provider: StarterProviderName,
194
194
  ): boolean {
195
- return ctx.integrations.includes(integration);
195
+ return ctx.providers.includes(provider);
196
196
  }
197
197
 
198
198
  export function json(value: unknown): string {
@@ -37,6 +37,7 @@ export async function linkSmokeDependencies(
37
37
  "provider-storage-local",
38
38
  "react-hook-form",
39
39
  "react-query",
40
+ "react-uploads",
40
41
  "web",
41
42
  ];
42
43
 
@@ -49,7 +50,7 @@ export async function linkSmokeDependencies(
49
50
 
50
51
  const externalSource = path.join(
51
52
  repoRoot,
52
- "apps/example-linear-clone/node_modules",
53
+ "apps/example-next-linear-clone/node_modules",
53
54
  );
54
55
  const externalPackages = [
55
56
  "@electric-sql/pglite",