@beignet/cli 0.0.20 → 0.0.22

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.
@@ -110,11 +110,24 @@ export function packageJson(ctx: TemplateContext): string {
110
110
  private: true,
111
111
  type: "module",
112
112
  scripts,
113
+ intent: {
114
+ skills: intentSkillPackages(ctx),
115
+ },
113
116
  dependencies: sortRecord(dependencies),
114
117
  devDependencies: sortRecord(devDependencies),
115
118
  });
116
119
  }
117
120
 
121
+ function intentSkillPackages(ctx: TemplateContext): string[] {
122
+ const packages = ["@beignet/core", "@beignet/next", "@beignet/cli"];
123
+
124
+ if (!ctx.api) {
125
+ packages.push("@beignet/react-query");
126
+ }
127
+
128
+ return packages;
129
+ }
130
+
118
131
  function sortRecord(record: Record<string, string>): Record<string, string> {
119
132
  return Object.fromEntries(
120
133
  Object.entries(record).sort(([left], [right]) => left.localeCompare(right)),
@@ -231,6 +244,14 @@ ${typecheck}
231
244
  \`routes\` shows the contracts Beignet can inspect. \`${cli} lint\` checks dependency direction. \`doctor\` catches route, OpenAPI, and resource drift.
232
245
  \`${lint}\` runs Biome over the starter; use \`${format}\` to apply formatting.
233
246
  ${testingNotes}
247
+ ## Coding agents
248
+
249
+ This app trusts Beignet package skills through \`package.json#intent.skills\`.
250
+ Run \`${intentRunner(ctx)} install\` to add Intent's managed skill-loading block
251
+ to your agent config, then load matching package skills before substantial
252
+ Beignet changes. The generated \`AGENTS.md\` and \`CLAUDE.md\` stay short and
253
+ point agents at app-local conventions, generators, validation, and MCP tools.
254
+
234
255
  ## Build for production
235
256
 
236
257
  \`\`\`bash
@@ -309,6 +330,19 @@ ${shellMap}
309
330
  ${ctx.integrations.length > 0 ? "\nSee `docs/integrations.md` for setup notes.\n" : ""}`;
310
331
  }
311
332
 
333
+ function intentRunner(ctx: TemplateContext): string {
334
+ switch (ctx.packageManager) {
335
+ case "npm":
336
+ return "npx @tanstack/intent@latest";
337
+ case "pnpm":
338
+ return "pnpm dlx @tanstack/intent@latest";
339
+ case "yarn":
340
+ return "yarn dlx @tanstack/intent@latest";
341
+ default:
342
+ return "bunx @tanstack/intent@latest";
343
+ }
344
+ }
345
+
312
346
  export function integrationsDoc(ctx: TemplateContext): string {
313
347
  const lines = [
314
348
  "# Integrations",
@@ -58,6 +58,7 @@ export function getTemplateFiles(ctx: TemplateContext): TemplateFile[] {
58
58
  content: serverFiles.apiCatchAllRoute,
59
59
  },
60
60
  { path: "app/api/health/route.ts", content: serverFiles.healthRoute },
61
+ { path: "app/api/ready/route.ts", content: serverFiles.readyRoute },
61
62
  {
62
63
  path: "app/api/devtools/[[...path]]/route.ts",
63
64
  content: serverFiles.devtoolsRoute,
@@ -515,6 +515,33 @@ export function GET() {
515
515
  },
516
516
  );
517
517
  }
518
+ `,
519
+ readyRoute: `import { createHealthHandler } from "@beignet/core/server";
520
+ import { env } from "@/lib/env";
521
+ import { server } from "@/server";
522
+
523
+ const readiness = createHealthHandler(
524
+ server.ports,
525
+ {
526
+ checks: {
527
+ database: (ports) => ports.db.checkHealth(),
528
+ },
529
+ timeoutMs: 2000,
530
+ },
531
+ env.NODE_ENV,
532
+ );
533
+
534
+ export async function GET(request: Request) {
535
+ const response = await readiness(request);
536
+
537
+ return Response.json(response.body, {
538
+ status: response.status,
539
+ headers: {
540
+ ...response.headers,
541
+ "cache-control": "no-store",
542
+ },
543
+ });
544
+ }
518
545
  `,
519
546
  devtoolsRoute: `import { createDevtoolsRoute } from "@beignet/devtools";
520
547
  import { env } from "@/lib/env";
@@ -578,6 +605,9 @@ export default function RootLayout({ children }: { children: ReactNode }) {
578
605
  <li>
579
606
  <a href="/api/health">/api/health</a> — health check
580
607
  </li>
608
+ <li>
609
+ <a href="/api/ready">/api/ready</a> — readiness check
610
+ </li>
581
611
  <li>
582
612
  <a href="/api/openapi">/api/openapi</a> — OpenAPI document
583
613
  </li>
@@ -110,6 +110,9 @@ export default function HomePage() {
110
110
  <a className="hover:text-foreground" href="/api/health">
111
111
  Health
112
112
  </a>
113
+ <a className="hover:text-foreground" href="/api/ready">
114
+ Ready
115
+ </a>
113
116
  <a className="hover:text-foreground" href="/api/openapi">
114
117
  OpenAPI
115
118
  </a>