@igniter-js/cli 0.2.70 → 0.2.71
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.js +20 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +19 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -17095,6 +17095,7 @@ __export(introspector_exports, {
|
|
|
17095
17095
|
});
|
|
17096
17096
|
import * as path7 from "path";
|
|
17097
17097
|
import { build } from "esbuild";
|
|
17098
|
+
import { createRequire } from "module";
|
|
17098
17099
|
function introspectRouter(router) {
|
|
17099
17100
|
const logger6 = createChildLogger({ component: "router-introspector" });
|
|
17100
17101
|
logger6.debug("Starting router introspection");
|
|
@@ -17148,8 +17149,17 @@ async function loadRouter(routerPath) {
|
|
|
17148
17149
|
format: "cjs",
|
|
17149
17150
|
write: false,
|
|
17150
17151
|
// Keep the result in memory
|
|
17151
|
-
logLevel: "silent"
|
|
17152
|
+
logLevel: "silent",
|
|
17152
17153
|
// We will handle our own logging
|
|
17154
|
+
external: [
|
|
17155
|
+
"@igniter-js/*",
|
|
17156
|
+
"@prisma/*",
|
|
17157
|
+
"prisma",
|
|
17158
|
+
"redis",
|
|
17159
|
+
"ioredis",
|
|
17160
|
+
"bullmq",
|
|
17161
|
+
"@opentelemetry/*"
|
|
17162
|
+
]
|
|
17153
17163
|
});
|
|
17154
17164
|
const [outputFile] = result.outputFiles;
|
|
17155
17165
|
if (!outputFile) {
|
|
@@ -17157,7 +17167,14 @@ async function loadRouter(routerPath) {
|
|
|
17157
17167
|
}
|
|
17158
17168
|
const compiledCode = outputFile.text;
|
|
17159
17169
|
const routerModule = { exports: {} };
|
|
17160
|
-
const
|
|
17170
|
+
const projectRequire = createRequire(fullPath);
|
|
17171
|
+
const requireFunc = (moduleName) => {
|
|
17172
|
+
try {
|
|
17173
|
+
return projectRequire(moduleName);
|
|
17174
|
+
} catch (error) {
|
|
17175
|
+
return __require(moduleName);
|
|
17176
|
+
}
|
|
17177
|
+
};
|
|
17161
17178
|
const factory = new Function("exports", "require", "module", "__filename", "__dirname", compiledCode);
|
|
17162
17179
|
factory(routerModule.exports, requireFunc, routerModule, fullPath, path7.dirname(fullPath));
|
|
17163
17180
|
const moduleExports = routerModule.exports;
|