@dudousxd/nestjs-codegen 0.22.0 → 0.23.0

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.
@@ -975,6 +975,7 @@ function classifyTypeKeyword(raw) {
975
975
  function markNullable(r, nullable) {
976
976
  return nullable ? { ...r, nullable: true } : r;
977
977
  }
978
+ var TRANSPARENT_TYPE_BRANDS = /* @__PURE__ */ new Set(["Opt", "Hidden"]);
978
979
  function classifyTypeNode(typeNode, sourceFile, project, opts) {
979
980
  if (Node3.isUnionTypeNode(typeNode)) {
980
981
  let nullable = false;
@@ -1033,6 +1034,11 @@ function classifyTypeNode(typeNode, sourceFile, project, opts) {
1033
1034
  const refName = typeNode.getTypeName().getText();
1034
1035
  if (refName === "Date") return { kind: "date" };
1035
1036
  if (refName === "Record" || refName === "Object") return { kind: "json" };
1037
+ const unwrapped = TRANSPARENT_TYPE_BRANDS.has(refName) ? typeNode.getTypeArguments()[0] : void 0;
1038
+ if (unwrapped) {
1039
+ const inner = classifyTypeNode(unwrapped, sourceFile, project, opts);
1040
+ return inner;
1041
+ }
1036
1042
  const typeRef = opts?.resolveRef?.(refName) ?? null;
1037
1043
  const en = resolveEnumValues(refName, sourceFile, project);
1038
1044
  if (en) {
@@ -2347,12 +2353,18 @@ function bindDiscoveryContext(project, cwd, tsconfigPath, tsconfig = loadDiscove
2347
2353
  }
2348
2354
  function extractRoutesFrom(project, controllerPaths) {
2349
2355
  const routes = [];
2350
- for (const path of controllerPaths) {
2356
+ for (const path of byPath([...controllerPaths])) {
2351
2357
  const sourceFile = project.getSourceFile(path);
2352
2358
  if (sourceFile) routes.push(...extractFromSourceFile(sourceFile, project));
2353
2359
  }
2354
2360
  return routes;
2355
2361
  }
2362
+ function byPath(items, path = String) {
2363
+ return [...items].sort((a, b) => {
2364
+ const [x, y] = [path(a), path(b)];
2365
+ return x < y ? -1 : x > y ? 1 : 0;
2366
+ });
2367
+ }
2356
2368
  var PersistentDiscovery = class _PersistentDiscovery {
2357
2369
  project;
2358
2370
  cwd;
@@ -5010,7 +5022,7 @@ async function watch(config, onChange, options = {}) {
5010
5022
  }
5011
5023
 
5012
5024
  // src/index.ts
5013
- var VERSION = "0.22.0";
5025
+ var VERSION = "0.23.0";
5014
5026
 
5015
5027
  // src/generate-manifest.ts
5016
5028
  var MANIFEST_FILE = ".codegen-manifest.json";