@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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @beignet/cli
2
2
 
3
+ ## 0.0.22
4
+
5
+ ### Patch Changes
6
+
7
+ - Add app-owned readiness helpers, first-party provider health checks, generated `/api/ready` routes, and doctor readiness hints.
8
+ - Updated dependencies
9
+ - @beignet/core@0.0.22
10
+
11
+ ## 0.0.21
12
+
13
+ ### Patch Changes
14
+
15
+ - Ship TanStack Intent agent skills with Beignet packages and scaffold generated apps with Intent skill-loading guidance.
16
+ - Updated dependencies
17
+ - @beignet/core@0.0.21
18
+
3
19
  ## 0.0.20
4
20
 
5
21
  ### Patch Changes
package/README.md CHANGED
@@ -141,6 +141,13 @@ Open `http://localhost:3000` for the starter UI. The generated homepage links
141
141
  to the todo feature, health check, OpenAPI document, devtools, and Beignet
142
142
  docs.
143
143
 
144
+ Generated apps also trust Beignet's package-shipped TanStack Intent skills via
145
+ `package.json#intent.skills`. Run `bunx @tanstack/intent@latest install` (or
146
+ the matching runner for your package manager) to add Intent's managed guidance
147
+ block, then load matching skills such as `@beignet/core#app-architecture`,
148
+ `@beignet/next#routes-server`, `@beignet/react-query#client`, and
149
+ `@beignet/cli#app-structure` before substantial Beignet changes.
150
+
144
151
  Inspect the app, then generate the next feature:
145
152
 
146
153
  ```bash
package/dist/inspect.js CHANGED
@@ -1162,6 +1162,22 @@ async function inspectRouteErrorCatalogDrift(targetDir, files, config, conventio
1162
1162
  }
1163
1163
  return diagnostics;
1164
1164
  }
1165
+ const readinessRelevantProviderPackages = new Set([
1166
+ "@beignet/provider-auth-better-auth",
1167
+ "@beignet/provider-db-drizzle",
1168
+ "@beignet/provider-error-reporting-sentry",
1169
+ "@beignet/provider-flags-openfeature",
1170
+ "@beignet/provider-jobs-bullmq",
1171
+ "@beignet/provider-jobs-inngest",
1172
+ "@beignet/provider-locks-redis",
1173
+ "@beignet/provider-mail-resend",
1174
+ "@beignet/provider-mail-smtp",
1175
+ "@beignet/provider-payments-stripe",
1176
+ "@beignet/provider-rate-limit-upstash",
1177
+ "@beignet/provider-redis",
1178
+ "@beignet/provider-search-meilisearch",
1179
+ "@beignet/provider-storage-s3",
1180
+ ]);
1165
1181
  async function inspectProductionReadiness(targetDir, files, config, convention) {
1166
1182
  if (!convention.resourceGenerator)
1167
1183
  return [];
@@ -1272,8 +1288,41 @@ async function inspectProductionReadiness(targetDir, files, config, convention)
1272
1288
  });
1273
1289
  }
1274
1290
  }
1291
+ const installedReadinessProviders = [...installedPackages].filter((packageName) => readinessRelevantProviderPackages.has(packageName));
1292
+ if (installedReadinessProviders.length > 0 &&
1293
+ !(await hasReadinessCheck(targetDir, files, config, sourceCache))) {
1294
+ diagnostics.push({
1295
+ severity: "hint",
1296
+ code: "BEIGNET_READINESS_ROUTE_MISSING",
1297
+ file: directoryPath(config.paths.routes),
1298
+ message: `${installedReadinessProviders.join(", ")} ${installedReadinessProviders.length === 1 ? "is" : "are"} installed, but no app-owned readiness route or dependency health checks were found. Consider exposing /api/ready with bounded dependency checks before deploying provider-backed infrastructure.`,
1299
+ });
1300
+ }
1275
1301
  return diagnostics;
1276
1302
  }
1303
+ async function hasReadinessCheck(targetDir, files, config, sourceCache) {
1304
+ const routesDir = directoryPath(config.paths.routes);
1305
+ if (files.includes(`${routesDir}/ready/route.ts`))
1306
+ return true;
1307
+ for (const file of files) {
1308
+ if (!file.endsWith(".ts") || file.endsWith(".test.ts"))
1309
+ continue;
1310
+ if (!isRouteServerOrInfraFile(file, config))
1311
+ continue;
1312
+ const source = await readCachedSource(targetDir, file, sourceCache);
1313
+ if (containsReadinessCheck(source)) {
1314
+ return true;
1315
+ }
1316
+ }
1317
+ return false;
1318
+ }
1319
+ function containsReadinessCheck(source) {
1320
+ if (containsCallExpression(source, "runHealthChecks"))
1321
+ return true;
1322
+ if (!containsCallExpression(source, "createHealthHandler"))
1323
+ return false;
1324
+ return /\bchecks\s*:/.test(source) || /\.checkHealth\s*\(/.test(source);
1325
+ }
1277
1326
  async function inspectEntitlementsProductionReadiness(targetDir, files, config, sourceCache) {
1278
1327
  if (!(await usesEntitlementChecks(targetDir, files, sourceCache)) ||
1279
1328
  (await appPortsIncludesPort(targetDir, files, config, sourceCache, "entitlements"))) {