@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/CHANGELOG.md +24 -0
- package/dist/cli/main.cjs +9 -3
- package/dist/cli/main.cjs.map +1 -1
- package/dist/cli/main.js +9 -3
- package/dist/cli/main.js.map +1 -1
- package/dist/index.cjs +9 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +9 -3
- package/dist/index.js.map +1 -1
- package/dist/nest/index.cjs +8 -2
- package/dist/nest/index.cjs.map +1 -1
- package/dist/nest/index.js +8 -2
- package/dist/nest/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -382,6 +382,6 @@ interface FastDiscoveryOptions {
|
|
|
382
382
|
}
|
|
383
383
|
declare function discoverContractsFast(opts: FastDiscoveryOptions): Promise<RouteDescriptor[]>;
|
|
384
384
|
|
|
385
|
-
declare const VERSION = "0.22.
|
|
385
|
+
declare const VERSION = "0.22.1";
|
|
386
386
|
|
|
387
387
|
export { type ChainModuleRendererOptions, CodegenError, type CodegenManifest, ConfigError, DriftGuardError, type EntryPoint, type FastDiscoveryOptions, type JsonSchema, type MocksEmitOptions, type OpenApiDocument, type OpenApiEmitOptions, type OpenApiInfo, RenderContext, RenderedModule, ResolvedConfig, RouteDescriptor, SchemaModule, SchemaNode, type TsTypeContext, UserConfig, VERSION, ValidationAdapter, type WatchOptions, type Watcher, acquireLock, buildMocksFile, buildOpenApiSpec, createChainModuleRenderer, defineConfig, discoverContractsFast, emitApi, emitForms, emitMocks, emitOpenApi, emitRoutes, extractSchemaFromDto, generate, loadConfig, renderTsType, resolveConfig, schemaModuleToJsonSchema, schemaNodeToJsonSchema, toObjectKey, typeNameFor, watch };
|
package/dist/index.d.ts
CHANGED
|
@@ -382,6 +382,6 @@ interface FastDiscoveryOptions {
|
|
|
382
382
|
}
|
|
383
383
|
declare function discoverContractsFast(opts: FastDiscoveryOptions): Promise<RouteDescriptor[]>;
|
|
384
384
|
|
|
385
|
-
declare const VERSION = "0.22.
|
|
385
|
+
declare const VERSION = "0.22.1";
|
|
386
386
|
|
|
387
387
|
export { type ChainModuleRendererOptions, CodegenError, type CodegenManifest, ConfigError, DriftGuardError, type EntryPoint, type FastDiscoveryOptions, type JsonSchema, type MocksEmitOptions, type OpenApiDocument, type OpenApiEmitOptions, type OpenApiInfo, RenderContext, RenderedModule, ResolvedConfig, RouteDescriptor, SchemaModule, SchemaNode, type TsTypeContext, UserConfig, VERSION, ValidationAdapter, type WatchOptions, type Watcher, acquireLock, buildMocksFile, buildOpenApiSpec, createChainModuleRenderer, defineConfig, discoverContractsFast, emitApi, emitForms, emitMocks, emitOpenApi, emitRoutes, extractSchemaFromDto, generate, loadConfig, renderTsType, resolveConfig, schemaModuleToJsonSchema, schemaNodeToJsonSchema, toObjectKey, typeNameFor, watch };
|
package/dist/index.js
CHANGED
|
@@ -2741,7 +2741,7 @@ function bindDiscoveryContext(project, cwd, tsconfigPath, tsconfig = loadDiscove
|
|
|
2741
2741
|
}
|
|
2742
2742
|
function extractRoutesFrom(project, controllerPaths) {
|
|
2743
2743
|
const routes = [];
|
|
2744
|
-
for (const path of controllerPaths) {
|
|
2744
|
+
for (const path of byPath([...controllerPaths])) {
|
|
2745
2745
|
const sourceFile = project.getSourceFile(path);
|
|
2746
2746
|
if (sourceFile) routes.push(...extractFromSourceFile(sourceFile, project));
|
|
2747
2747
|
}
|
|
@@ -2749,11 +2749,17 @@ function extractRoutesFrom(project, controllerPaths) {
|
|
|
2749
2749
|
}
|
|
2750
2750
|
function extractAllRoutes(project) {
|
|
2751
2751
|
const routes = [];
|
|
2752
|
-
for (const sourceFile of project.getSourceFiles()) {
|
|
2752
|
+
for (const sourceFile of byPath(project.getSourceFiles(), (f) => f.getFilePath())) {
|
|
2753
2753
|
routes.push(...extractFromSourceFile(sourceFile, project));
|
|
2754
2754
|
}
|
|
2755
2755
|
return routes;
|
|
2756
2756
|
}
|
|
2757
|
+
function byPath(items, path = String) {
|
|
2758
|
+
return [...items].sort((a, b) => {
|
|
2759
|
+
const [x, y] = [path(a), path(b)];
|
|
2760
|
+
return x < y ? -1 : x > y ? 1 : 0;
|
|
2761
|
+
});
|
|
2762
|
+
}
|
|
2757
2763
|
var PersistentDiscovery = class _PersistentDiscovery {
|
|
2758
2764
|
project;
|
|
2759
2765
|
cwd;
|
|
@@ -5320,7 +5326,7 @@ function createChainModuleRenderer(opts) {
|
|
|
5320
5326
|
}
|
|
5321
5327
|
|
|
5322
5328
|
// src/index.ts
|
|
5323
|
-
var VERSION = "0.22.
|
|
5329
|
+
var VERSION = "0.22.1";
|
|
5324
5330
|
export {
|
|
5325
5331
|
CodegenError,
|
|
5326
5332
|
ConfigError,
|