@modern-js/bff-core 2.7.1-alpha.1 → 2.7.1-alpha.2
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/cjs/router/utils.js +15 -6
- package/dist/esm/router/utils.js +15 -6
- package/dist/types/types.d.ts +1 -1
- package/package.json +1 -1
package/dist/cjs/router/utils.js
CHANGED
|
@@ -76,14 +76,23 @@ const enableRegister = (requireFn) => {
|
|
|
76
76
|
firstCall = false;
|
|
77
77
|
}
|
|
78
78
|
if (!existTsLoader) {
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
79
|
+
const projectSearchDir = import_path.default.dirname(modulePath);
|
|
80
|
+
const tsNode = require("ts-node");
|
|
81
|
+
tsNode.register({
|
|
82
|
+
projectSearchDir,
|
|
83
|
+
scope: true,
|
|
84
|
+
transpileOnly: true,
|
|
85
|
+
ignore: ["(?:^|/)node_modules/"]
|
|
84
86
|
});
|
|
87
|
+
const tsConfigPaths = require("tsconfig-paths");
|
|
88
|
+
const loaderRes = tsConfigPaths.loadConfig(projectSearchDir);
|
|
89
|
+
if (loaderRes.resultType === "success") {
|
|
90
|
+
tsConfigPaths.register({
|
|
91
|
+
baseUrl: loaderRes.absoluteBaseUrl,
|
|
92
|
+
paths: loaderRes.paths
|
|
93
|
+
});
|
|
94
|
+
}
|
|
85
95
|
const requiredModule2 = requireFn(modulePath);
|
|
86
|
-
unregister();
|
|
87
96
|
return requiredModule2;
|
|
88
97
|
}
|
|
89
98
|
const requiredModule = requireFn(modulePath);
|
package/dist/esm/router/utils.js
CHANGED
|
@@ -40,14 +40,23 @@ const enableRegister = (requireFn) => {
|
|
|
40
40
|
firstCall = false;
|
|
41
41
|
}
|
|
42
42
|
if (!existTsLoader) {
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
43
|
+
const projectSearchDir = path.dirname(modulePath);
|
|
44
|
+
const tsNode = require("ts-node");
|
|
45
|
+
tsNode.register({
|
|
46
|
+
projectSearchDir,
|
|
47
|
+
scope: true,
|
|
48
|
+
transpileOnly: true,
|
|
49
|
+
ignore: ["(?:^|/)node_modules/"]
|
|
48
50
|
});
|
|
51
|
+
const tsConfigPaths = require("tsconfig-paths");
|
|
52
|
+
const loaderRes = tsConfigPaths.loadConfig(projectSearchDir);
|
|
53
|
+
if (loaderRes.resultType === "success") {
|
|
54
|
+
tsConfigPaths.register({
|
|
55
|
+
baseUrl: loaderRes.absoluteBaseUrl,
|
|
56
|
+
paths: loaderRes.paths
|
|
57
|
+
});
|
|
58
|
+
}
|
|
49
59
|
const requiredModule2 = requireFn(modulePath);
|
|
50
|
-
unregister();
|
|
51
60
|
return requiredModule2;
|
|
52
61
|
}
|
|
53
62
|
const requiredModule = requireFn(modulePath);
|
package/dist/types/types.d.ts
CHANGED
|
@@ -55,4 +55,4 @@ export type ExtractInputType<T> = { [key in keyof T]: T[key] extends Operator<an
|
|
|
55
55
|
export type ExtractOuputType<T> = { [key in keyof T]: T[key] extends Operator<any, any> ? NonNullable<T[key]['outputType']> : void };
|
|
56
56
|
export type ArrayToObject<T, R = {}> = T extends [infer First, ...infer Rest] ? First extends PromiseLike<infer PromiseValue> ? PromiseValue : First extends object ? Merge<First, ArrayToObject<Rest, R>> : ArrayToObject<Rest, R> : R;
|
|
57
57
|
export type AsyncFunction = (...args: any[]) => Promise<any>;
|
|
58
|
-
export declare const httpMethods: HttpMethod[];
|
|
58
|
+
export declare const httpMethods: HttpMethod[];
|