@supalive/codegen 1.22.1 → 1.22.2

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/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { n as generateToDisk, r as readEntryConfig } from "./src-Ckf5xah9.js";
2
+ import { n as generateToDisk, r as readEntryConfig } from "./src-DCmLjz97.js";
3
3
  import path from "node:path";
4
4
  //#region src/cli.ts
5
5
  function parseArgs(argv) {
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import { a as emit, c as loadSchemaEnums, i as resolveConfig, n as generateToDisk, o as extractClient, r as readEntryConfig, s as SchemaEnumRegistry, t as generate } from "./src-Ckf5xah9.js";
1
+ import { a as emit, c as loadSchemaEnums, i as resolveConfig, n as generateToDisk, o as extractClient, r as readEntryConfig, s as SchemaEnumRegistry, t as generate } from "./src-DCmLjz97.js";
2
2
  export { SchemaEnumRegistry, emit, extractClient, generate, generateToDisk, loadSchemaEnums, readEntryConfig, resolveConfig };
@@ -358,7 +358,7 @@ function scanObjectSchema(schema) {
358
358
  }
359
359
  return map;
360
360
  }
361
- function topLevelZodMethods(node) {
361
+ function topLevelZodMethods(node, depth = 0) {
362
362
  const methods = /* @__PURE__ */ new Set();
363
363
  let cur = node;
364
364
  while (cur && Node.isCallExpression(cur)) {
@@ -368,8 +368,14 @@ function topLevelZodMethods(node) {
368
368
  cur = expr.getExpression();
369
369
  } else break;
370
370
  }
371
+ if (cur && Node.isIdentifier(cur) && depth < MAX_ALIAS_DEPTH) {
372
+ const init = resolveIdentifierInit(cur);
373
+ if (init) for (const m of topLevelZodMethods(init, depth + 1)) methods.add(m);
374
+ }
371
375
  return methods;
372
376
  }
377
+ /** Guards against a cyclic alias (`const A = B; const B = A;`) looping forever. */
378
+ const MAX_ALIAS_DEPTH = 8;
373
379
  function topLevelZodDescription(node) {
374
380
  let cur = node;
375
381
  while (cur && Node.isCallExpression(cur)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supalive/codegen",
3
- "version": "1.22.1",
3
+ "version": "1.22.2",
4
4
  "description": "Generate type-safe client code (Dart, and more) from a Supalive TypeScript router.",
5
5
  "author": "Rebaz Raouf",
6
6
  "license": "MIT",