@geekmidas/cli 1.10.37 → 1.10.38

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/dist/openapi.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env -S npx tsx
2
2
  require('./workspace-CQTT7HJQ.cjs');
3
3
  require('./config-DujV8DbR.cjs');
4
- const require_openapi = require('./openapi-0JUzU5Tv.cjs');
4
+ const require_openapi = require('./openapi-DHp49UJV.cjs');
5
5
 
6
6
  exports.OPENAPI_OUTPUT_PATH = require_openapi.OPENAPI_OUTPUT_PATH;
7
7
  exports.generateOpenApi = require_openapi.generateOpenApi;
package/dist/openapi.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env -S npx tsx
2
2
  import "./workspace-D-37Ylqo.mjs";
3
3
  import "./config-Bbu1JKvf.mjs";
4
- import { OPENAPI_OUTPUT_PATH, generateOpenApi, openapiCommand, resolveOpenApiConfig } from "./openapi-C5AycKTR.mjs";
4
+ import { OPENAPI_OUTPUT_PATH, generateOpenApi, openapiCommand, resolveOpenApiConfig } from "./openapi-DF9GyhyZ.mjs";
5
5
 
6
6
  export { OPENAPI_OUTPUT_PATH, generateOpenApi, openapiCommand, resolveOpenApiConfig };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geekmidas/cli",
3
- "version": "1.10.37",
3
+ "version": "1.10.38",
4
4
  "description": "CLI tools for building Lambda handlers, server applications, and generating OpenAPI specs",
5
5
  "private": false,
6
6
  "type": "module",
@@ -56,11 +56,11 @@
56
56
  "prompts": "~2.4.2",
57
57
  "tsx": "~4.20.3",
58
58
  "yaml": "~2.8.2",
59
- "@geekmidas/constructs": "~3.0.10",
60
- "@geekmidas/envkit": "~1.0.6",
61
59
  "@geekmidas/errors": "~1.0.0",
60
+ "@geekmidas/constructs": "~3.0.10",
62
61
  "@geekmidas/logger": "~1.0.1",
63
- "@geekmidas/schema": "~1.0.1"
62
+ "@geekmidas/schema": "~1.0.1",
63
+ "@geekmidas/envkit": "~1.0.6"
64
64
  },
65
65
  "devDependencies": {
66
66
  "@types/lodash.kebabcase": "^4.1.9",
@@ -74,4 +74,25 @@ describe('OpenApiTsGenerator — zod global registry', () => {
74
74
  expect(content).toMatch(/export interface Foo\b/);
75
75
  expect(content).toMatch(/export interface Bar\b/);
76
76
  });
77
+
78
+ it('references one registered schema from another via the parent type', async () => {
79
+ const UserSchema = z
80
+ .object({ id: z.string(), email: z.string() })
81
+ .meta({ id: 'User' });
82
+
83
+ z.object({ user: UserSchema, role: z.string() }).meta({ id: 'UserRole' });
84
+
85
+ const endpoint = e
86
+ .get('/ping')
87
+ .output(z.object({ ok: z.boolean() }))
88
+ .handle(async () => ({ ok: true }));
89
+
90
+ const generator = new OpenApiTsGenerator();
91
+ const content = await generator.generate([endpoint as any]);
92
+
93
+ expect(content).toMatch(/export interface User\b/);
94
+ expect(content).toMatch(/export interface UserRole\b/);
95
+ // `user` inside UserRole should reference the named User type, not inline.
96
+ expect(content).toMatch(/user:\s*User\b/);
97
+ });
77
98
  });
@@ -32,15 +32,15 @@ export const GEEKMIDAS_VERSIONS = {
32
32
  '@geekmidas/cache': '~1.1.0',
33
33
  '@geekmidas/client': '~4.0.4',
34
34
  '@geekmidas/cloud': '~1.0.0',
35
- '@geekmidas/constructs': '~3.0.9',
35
+ '@geekmidas/constructs': '~3.0.10',
36
36
  '@geekmidas/db': '~1.0.1',
37
37
  '@geekmidas/emailkit': '~1.0.0',
38
38
  '@geekmidas/envkit': '~1.0.6',
39
39
  '@geekmidas/errors': '~1.0.0',
40
- '@geekmidas/events': '~1.1.1',
40
+ '@geekmidas/events': '~1.1.2',
41
41
  '@geekmidas/logger': '~1.0.1',
42
42
  '@geekmidas/rate-limit': '~2.0.0',
43
- '@geekmidas/schema': '~1.0.0',
43
+ '@geekmidas/schema': '~1.0.1',
44
44
  '@geekmidas/services': '~1.0.1',
45
45
  '@geekmidas/storage': '~2.0.2',
46
46
  '@geekmidas/studio': '~1.0.0',
package/src/openapi.ts CHANGED
@@ -127,7 +127,11 @@ export async function openapiCommand(
127
127
  } else {
128
128
  // Workspace config - generate for each backend app
129
129
  const { workspace } = loadedConfig;
130
- const workspaceRoot = options.cwd || process.cwd();
130
+ // Always derive the workspace root from the loaded config rather than
131
+ // CWD. Subprocesses run with CWD set to an app directory, and falling
132
+ // back to CWD there causes `join(workspaceRoot, app.path)` to point at
133
+ // a non-existent nested path (e.g. `apps/api/apps/api`).
134
+ const workspaceRoot = workspace.root;
131
135
 
132
136
  // Find backend apps with openapi enabled
133
137
  const backendApps = Object.entries(workspace.apps).filter(