@dudousxd/nestjs-codegen 0.7.0 → 0.7.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/index.d.cts CHANGED
@@ -296,6 +296,6 @@ interface FastDiscoveryOptions {
296
296
  }
297
297
  declare function discoverContractsFast(opts: FastDiscoveryOptions): Promise<RouteDescriptor[]>;
298
298
 
299
- declare const VERSION = "0.7.0";
299
+ declare const VERSION = "0.7.1";
300
300
 
301
301
  export { type ChainModuleRendererOptions, CodegenError, ConfigError, type FastDiscoveryOptions, type JsonSchema, type MocksEmitOptions, type OpenApiDocument, type OpenApiEmitOptions, type OpenApiInfo, RenderContext, RenderedModule, ResolvedConfig, RouteDescriptor, SchemaModule, SchemaNode, type TsTypeContext, UserConfig, VERSION, ValidationAdapter, 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
@@ -296,6 +296,6 @@ interface FastDiscoveryOptions {
296
296
  }
297
297
  declare function discoverContractsFast(opts: FastDiscoveryOptions): Promise<RouteDescriptor[]>;
298
298
 
299
- declare const VERSION = "0.7.0";
299
+ declare const VERSION = "0.7.1";
300
300
 
301
301
  export { type ChainModuleRendererOptions, CodegenError, ConfigError, type FastDiscoveryOptions, type JsonSchema, type MocksEmitOptions, type OpenApiDocument, type OpenApiEmitOptions, type OpenApiInfo, RenderContext, RenderedModule, ResolvedConfig, RouteDescriptor, SchemaModule, SchemaNode, type TsTypeContext, UserConfig, VERSION, ValidationAdapter, 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
@@ -46,18 +46,23 @@ async function fileExists(filePath) {
46
46
  }
47
47
  }
48
48
  async function importTs(filePath) {
49
- let tsImport;
49
+ const fileUrl = pathToFileURL(filePath).href;
50
50
  try {
51
- const tsxEsm = await import("tsx/esm/api");
52
- tsImport = tsxEsm.tsImport;
53
- } catch {
54
- throw new ConfigError(
55
- "Failed to load config: `tsx` is required for loading TypeScript config files. Install it as a dev dependency: pnpm add -D tsx"
56
- );
51
+ return await import(fileUrl);
52
+ } catch (nativeError) {
53
+ let tsImport;
54
+ try {
55
+ const tsxEsm = await import("tsx/esm/api");
56
+ tsImport = tsxEsm.tsImport;
57
+ } catch {
58
+ throw new ConfigError(
59
+ "Failed to load config: `tsx` is required for loading TypeScript config files. Install it as a dev dependency: pnpm add -D tsx",
60
+ { cause: nativeError }
61
+ );
62
+ }
63
+ const parentURL = pathToFileURL(`${filePath}__parent__`).href;
64
+ return tsImport(fileUrl, { parentURL });
57
65
  }
58
- const parentURL = pathToFileURL(`${filePath}__parent__`).href;
59
- const fileUrl = pathToFileURL(filePath).href;
60
- return tsImport(fileUrl, { parentURL });
61
66
  }
62
67
  function resolveAbsolute(cwd, p) {
63
68
  if (isAbsolute(p)) return p;
@@ -4548,7 +4553,7 @@ function createChainModuleRenderer(opts) {
4548
4553
  }
4549
4554
 
4550
4555
  // src/index.ts
4551
- var VERSION = "0.7.0";
4556
+ var VERSION = "0.7.1";
4552
4557
  export {
4553
4558
  CodegenError,
4554
4559
  ConfigError,