@getstrata/cli 1.1.3 → 1.1.5

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,18 @@
1
1
  # @getstrata/cli changelog
2
2
 
3
+ ## 1.1.5
4
+
5
+ - Close dogfood gaps: webhook docs, starter extras, signing helper
6
+
7
+ ## Unreleased
8
+
9
+ - `make:module` appends a `registerModelClass` hint to `src/models/register.ts` when that file exists.
10
+ - `openapi:check` drift output reminds you to run `openapi:generate` in CI.
11
+
12
+ ## 1.1.4
13
+
14
+ - Publish http/uploads, validateUploadFile, migration-adoption docs
15
+
3
16
  ## 1.1.3
4
17
 
5
18
  - Eager with() arrays, OpenAPI mkdir, public-read/auth docs
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getstrata/cli",
3
- "version": "1.1.3",
3
+ "version": "1.1.5",
4
4
  "description": "Strata CLI: framework commands for Bun apps (dev, start, migrate, run)",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/openapi.ts CHANGED
@@ -73,6 +73,9 @@ function createOpenApiCheckCommand(bootstrap: AppBootstrap) {
73
73
  if (committed !== generated) {
74
74
  console.error("OpenAPI spec drift detected.");
75
75
  console.error("Run `strata openapi:generate` and commit docs/openapi.json.");
76
+ console.error(
77
+ "Add that generate step next to `strata openapi:check` in CI so new routes cannot ship undocumented.",
78
+ );
76
79
  process.exit(1);
77
80
  }
78
81
 
@@ -587,6 +587,23 @@ export { create${moduleName}WebRoutes };
587
587
  }
588
588
  console.log(`Module will be auto-discovered from the app modules directory (${moduleSlug}/)`);
589
589
  console.log(`Next: strata make:migration create_${moduleSlug} && strata migrate`);
590
+
591
+ const registerPath = join(process.cwd(), "src", "models", "register.ts");
592
+ try {
593
+ await access(registerPath);
594
+ const existing = await Bun.file(registerPath).text();
595
+ if (!existing.includes(`registerModelClass("${moduleName}"`)) {
596
+ const snippet = `
597
+ // ${moduleName}: after you add a Model class, register string aliases here:
598
+ // import { ${moduleName} } from "../modules/${moduleSlug}/model.ts";
599
+ // registerModelClass("${moduleName}", ${moduleName});
600
+ `;
601
+ await Bun.write(registerPath, `${existing.trimEnd()}\n${snippet}`);
602
+ console.log(`Appended a registerModelClass hint to src/models/register.ts`);
603
+ }
604
+ } catch {
605
+ // Generated apps ship register.ts. Older apps can add it from DATABASE.md.
606
+ }
590
607
  }
591
608
 
592
609
  export { makeModuleCommand };