@geekmidas/cli 9.2.0 → 9.2.1

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 (39) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist/{config-Bbu1JKvf.mjs → config-D7AVl-qm.mjs} +2 -2
  3. package/dist/{config-Bbu1JKvf.mjs.map → config-D7AVl-qm.mjs.map} +1 -1
  4. package/dist/{config-DujV8DbR.cjs → config-DcxHEHPB.cjs} +2 -2
  5. package/dist/{config-DujV8DbR.cjs.map → config-DcxHEHPB.cjs.map} +1 -1
  6. package/dist/config.cjs +2 -2
  7. package/dist/config.mjs +2 -2
  8. package/dist/index.cjs +26 -26
  9. package/dist/index.cjs.map +1 -1
  10. package/dist/index.mjs +26 -26
  11. package/dist/index.mjs.map +1 -1
  12. package/dist/{openapi-C5rXJTtj.mjs → openapi-BlIiUahn.mjs} +7 -2
  13. package/dist/{openapi-C5rXJTtj.mjs.map → openapi-BlIiUahn.mjs.map} +1 -1
  14. package/dist/{openapi-B_IGZDVu.cjs → openapi-C-YgZHyd.cjs} +7 -2
  15. package/dist/{openapi-B_IGZDVu.cjs.map → openapi-C-YgZHyd.cjs.map} +1 -1
  16. package/dist/openapi.cjs +3 -3
  17. package/dist/openapi.mjs +3 -3
  18. package/dist/{setup-DDXUXzzl.mjs → setup-A-BX8JUm.mjs} +3 -3
  19. package/dist/{setup-DDXUXzzl.mjs.map → setup-A-BX8JUm.mjs.map} +1 -1
  20. package/dist/setup-BDB9lvEI.cjs +8 -0
  21. package/dist/{setup-Dh-B7YTX.mjs → setup-BzftAUve.mjs} +3 -3
  22. package/dist/{setup-WZ-xqAQO.cjs → setup-C2UhXWhN.cjs} +3 -3
  23. package/dist/{setup-WZ-xqAQO.cjs.map → setup-C2UhXWhN.cjs.map} +1 -1
  24. package/dist/types-BWQDiooe.d.cts.map +1 -1
  25. package/dist/workspace/index.cjs +1 -1
  26. package/dist/workspace/index.mjs +1 -1
  27. package/dist/workspace-CqXfzYyp.cjs +6704 -0
  28. package/dist/workspace-CqXfzYyp.cjs.map +1 -0
  29. package/dist/workspace-DrBWGtI7.mjs +6579 -0
  30. package/dist/workspace-DrBWGtI7.mjs.map +1 -0
  31. package/package.json +10 -10
  32. package/src/generators/OpenApiTsGenerator.ts +21 -0
  33. package/src/generators/__tests__/Generator.bustCache.spec.ts +16 -8
  34. package/src/init/versions.ts +19 -19
  35. package/dist/setup-DLwhfyt-.cjs +0 -8
  36. package/dist/workspace-CQTT7HJQ.cjs +0 -4361
  37. package/dist/workspace-CQTT7HJQ.cjs.map +0 -1
  38. package/dist/workspace-D-37Ylqo.mjs +0 -4236
  39. package/dist/workspace-D-37Ylqo.mjs.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geekmidas/cli",
3
- "version": "9.2.0",
3
+ "version": "9.2.1",
4
4
  "description": "CLI tools for building Lambda handlers, server applications, and generating OpenAPI specs",
5
5
  "private": false,
6
6
  "type": "module",
@@ -81,12 +81,12 @@
81
81
  "prompts": "~2.4.2",
82
82
  "tsx": "~4.20.3",
83
83
  "yaml": "~2.8.2",
84
- "@geekmidas/constructs": "~9.2.0",
85
- "@geekmidas/envkit": "~9.2.0",
86
- "@geekmidas/errors": "~9.2.0",
87
- "@geekmidas/logger": "~9.2.0",
88
- "@geekmidas/manifest": "9.2.0",
89
- "@geekmidas/schema": "~9.2.0"
84
+ "@geekmidas/constructs": "~9.2.1",
85
+ "@geekmidas/errors": "~9.2.1",
86
+ "@geekmidas/logger": "~9.2.1",
87
+ "@geekmidas/manifest": "9.2.1",
88
+ "@geekmidas/envkit": "~9.2.1",
89
+ "@geekmidas/schema": "~9.2.1"
90
90
  },
91
91
  "devDependencies": {
92
92
  "@types/lodash.kebabcase": "^4.1.9",
@@ -95,11 +95,11 @@
95
95
  "@types/prompts": "~2.4.9",
96
96
  "typescript": "^5.8.2",
97
97
  "vitest": "^3.2.4",
98
- "zod": "~4.1.13",
99
- "@geekmidas/testkit": "9.2.0"
98
+ "zod": "~4.6.6",
99
+ "@geekmidas/testkit": "9.2.1"
100
100
  },
101
101
  "peerDependencies": {
102
- "@geekmidas/telescope": "^9.2.0"
102
+ "@geekmidas/telescope": "^9.2.1"
103
103
  },
104
104
  "peerDependenciesMeta": {
105
105
  "@geekmidas/telescope": {
@@ -426,6 +426,27 @@ export class OpenApiTsGenerator {
426
426
 
427
427
  // Remove $defs from the schema before converting to interface
428
428
  const { $defs, ...schemaWithoutDefs } = jsonSchema;
429
+
430
+ // A schema that *is* a registered schema converts to nothing but a
431
+ // `$ref` at it, and the def it points at has already been collected
432
+ // above — so emitting a declaration here as well produces
433
+ // `export type User = User`, a circular alias that is not a type.
434
+ //
435
+ // Zod used to inline this case and only started emitting the `$ref` in
436
+ // 4.6, which is how the bug arrived without the generator changing.
437
+ const ref = (schemaWithoutDefs as { $ref?: string }).$ref;
438
+ if (
439
+ ref &&
440
+ Object.keys(schemaWithoutDefs).every(
441
+ (k) => k === '$ref' || k === '$schema',
442
+ )
443
+ ) {
444
+ const target = ref.split('/').pop();
445
+ // The def's own interface is the declaration. Only alias it when the
446
+ // names actually differ, which is when the alias says something.
447
+ return target === name ? null : `export type ${name} = ${target};`;
448
+ }
449
+
429
450
  return this.jsonSchemaToInterface(schemaWithoutDefs, name);
430
451
  } catch {
431
452
  return null;
@@ -7,17 +7,25 @@ import { EndpointGenerator } from '../EndpointGenerator';
7
7
  import { clearZodGlobalRegistry } from '../Generator';
8
8
 
9
9
  describe('clearZodGlobalRegistry', () => {
10
- it('removes an id from the global registry so the same id can be re-registered', () => {
11
- // Register once — succeeds
12
- z.object({ x: z.string() }).meta({ id: 'BustCacheSchema_A' });
10
+ it('removes a registered id from the global registry', () => {
11
+ const registry = (
12
+ globalThis as {
13
+ __zod_globalRegistry?: { _idmap?: Map<string, unknown> };
14
+ }
15
+ ).__zod_globalRegistry;
13
16
 
14
- // Re-registering without clearing throws
15
- expect(() =>
16
- z.object({ y: z.string() }).meta({ id: 'BustCacheSchema_A' }),
17
- ).toThrow(/already exists in the registry/);
17
+ z.object({ x: z.string() }).meta({ id: 'BustCacheSchema_A' });
18
+ expect(registry?._idmap?.has('BustCacheSchema_A')).toBe(true);
18
19
 
19
- // After clearing, the id can be registered again
20
+ // The contract is that the id is gone, asserted on the registry itself.
21
+ // This used to be asserted by re-registering and expecting a throw, which
22
+ // stopped meaning anything in Zod 4.6: a duplicate id is accepted now
23
+ // rather than rejected. That made the test pass for the wrong reason
24
+ // first, and then fail for the wrong reason — neither of which was ever
25
+ // about `clearZodGlobalRegistry`.
20
26
  clearZodGlobalRegistry();
27
+ expect(registry?._idmap?.has('BustCacheSchema_A')).toBe(false);
28
+
21
29
  expect(() =>
22
30
  z.object({ z: z.string() }).meta({ id: 'BustCacheSchema_A' }),
23
31
  ).not.toThrow();
@@ -27,25 +27,25 @@ export const CLI_VERSION = `~${pkg.version}`;
27
27
  * Run: pnpm --filter @geekmidas/cli sync-versions
28
28
  */
29
29
  export const GEEKMIDAS_VERSIONS = {
30
- '@geekmidas/audit': '~9.1.0',
31
- '@geekmidas/auth': '~9.1.0',
32
- '@geekmidas/cache': '~9.1.0',
33
- '@geekmidas/client': '~9.1.0',
34
- '@geekmidas/cloud': '~9.1.0',
35
- '@geekmidas/constructs': '~9.1.0',
36
- '@geekmidas/db': '~9.1.0',
37
- '@geekmidas/emailkit': '~9.1.0',
38
- '@geekmidas/envkit': '~9.1.0',
39
- '@geekmidas/errors': '~9.1.0',
40
- '@geekmidas/events': '~9.1.0',
41
- '@geekmidas/logger': '~9.1.0',
42
- '@geekmidas/rate-limit': '~9.1.0',
43
- '@geekmidas/schema': '~9.1.0',
44
- '@geekmidas/services': '~9.1.0',
45
- '@geekmidas/storage': '~9.1.0',
46
- '@geekmidas/studio': '~9.1.0',
47
- '@geekmidas/telescope': '~9.1.0',
48
- '@geekmidas/testkit': '~9.1.0',
30
+ '@geekmidas/audit': '~9.2.0',
31
+ '@geekmidas/auth': '~9.2.0',
32
+ '@geekmidas/cache': '~9.2.0',
33
+ '@geekmidas/client': '~9.2.0',
34
+ '@geekmidas/cloud': '~9.2.0',
35
+ '@geekmidas/constructs': '~9.2.0',
36
+ '@geekmidas/db': '~9.2.0',
37
+ '@geekmidas/emailkit': '~9.2.0',
38
+ '@geekmidas/envkit': '~9.2.0',
39
+ '@geekmidas/errors': '~9.2.0',
40
+ '@geekmidas/events': '~9.2.0',
41
+ '@geekmidas/logger': '~9.2.0',
42
+ '@geekmidas/rate-limit': '~9.2.0',
43
+ '@geekmidas/schema': '~9.2.0',
44
+ '@geekmidas/services': '~9.2.0',
45
+ '@geekmidas/storage': '~9.2.0',
46
+ '@geekmidas/studio': '~9.2.0',
47
+ '@geekmidas/telescope': '~9.2.0',
48
+ '@geekmidas/testkit': '~9.2.0',
49
49
  '@geekmidas/cli': CLI_VERSION,
50
50
  } as const;
51
51
 
@@ -1,8 +0,0 @@
1
- require('./workspace-CQTT7HJQ.cjs');
2
- require('./config-DujV8DbR.cjs');
3
- require('./fullstack-secrets-BYzi6Hwl.cjs');
4
- require('./storage-B1wvztiJ.cjs');
5
- const require_setup = require('./setup-WZ-xqAQO.cjs');
6
- require('./sync-o_CtEbvR.cjs');
7
-
8
- exports.ensureStageSecrets = require_setup.ensureStageSecrets;