@dudousxd/nestjs-codegen 0.22.0 → 0.22.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.
package/dist/cli/main.js CHANGED
@@ -2736,7 +2736,7 @@ function bindDiscoveryContext(project, cwd, tsconfigPath, tsconfig = loadDiscove
2736
2736
  }
2737
2737
  function extractRoutesFrom(project, controllerPaths) {
2738
2738
  const routes = [];
2739
- for (const path of controllerPaths) {
2739
+ for (const path of byPath([...controllerPaths])) {
2740
2740
  const sourceFile = project.getSourceFile(path);
2741
2741
  if (sourceFile) routes.push(...extractFromSourceFile(sourceFile, project));
2742
2742
  }
@@ -2744,11 +2744,17 @@ function extractRoutesFrom(project, controllerPaths) {
2744
2744
  }
2745
2745
  function extractAllRoutes(project) {
2746
2746
  const routes = [];
2747
- for (const sourceFile of project.getSourceFiles()) {
2747
+ for (const sourceFile of byPath(project.getSourceFiles(), (f) => f.getFilePath())) {
2748
2748
  routes.push(...extractFromSourceFile(sourceFile, project));
2749
2749
  }
2750
2750
  return routes;
2751
2751
  }
2752
+ function byPath(items, path = String) {
2753
+ return [...items].sort((a, b) => {
2754
+ const [x, y] = [path(a), path(b)];
2755
+ return x < y ? -1 : x > y ? 1 : 0;
2756
+ });
2757
+ }
2752
2758
  var PersistentDiscovery = class _PersistentDiscovery {
2753
2759
  project;
2754
2760
  cwd;
@@ -5229,7 +5235,7 @@ async function watch(config, onChange, options = {}) {
5229
5235
  }
5230
5236
 
5231
5237
  // src/index.ts
5232
- var VERSION = "0.22.0";
5238
+ var VERSION = "0.22.1";
5233
5239
 
5234
5240
  // src/cli/codegen.ts
5235
5241
  async function runCodegen(opts = {}) {