@igniter-js/cli 0.2.70 → 0.2.72
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 +22 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +21 -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,19 @@ 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
|
+
"chalk",
|
|
17163
|
+
"supports-color"
|
|
17164
|
+
]
|
|
17153
17165
|
});
|
|
17154
17166
|
const [outputFile] = result.outputFiles;
|
|
17155
17167
|
if (!outputFile) {
|
|
@@ -17157,7 +17169,14 @@ async function loadRouter(routerPath) {
|
|
|
17157
17169
|
}
|
|
17158
17170
|
const compiledCode = outputFile.text;
|
|
17159
17171
|
const routerModule = { exports: {} };
|
|
17160
|
-
const
|
|
17172
|
+
const projectRequire = createRequire(fullPath);
|
|
17173
|
+
const requireFunc = (moduleName) => {
|
|
17174
|
+
try {
|
|
17175
|
+
return projectRequire(moduleName);
|
|
17176
|
+
} catch (error) {
|
|
17177
|
+
return __require(moduleName);
|
|
17178
|
+
}
|
|
17179
|
+
};
|
|
17161
17180
|
const factory = new Function("exports", "require", "module", "__filename", "__dirname", compiledCode);
|
|
17162
17181
|
factory(routerModule.exports, requireFunc, routerModule, fullPath, path7.dirname(fullPath));
|
|
17163
17182
|
const moduleExports = routerModule.exports;
|