ts-arc 1.1.15 → 1.1.16
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/bin.js +8 -5
- package/dist/cli.js +6 -4
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -83,12 +83,10 @@ function findTsConfig(dir) {
|
|
|
83
83
|
}
|
|
84
84
|
var tsArcConfig = { baseUrl: null, paths: {}, tsconfigDir: null };
|
|
85
85
|
async function registerLoader() {
|
|
86
|
-
console.log("Registering ts-arc module loader..");
|
|
87
86
|
register("./loader.js", import.meta.url, { data: tsArcConfig });
|
|
88
87
|
}
|
|
89
|
-
async function
|
|
90
|
-
const
|
|
91
|
-
const tsconfigPath = findTsConfig(path.dirname(scriptPath));
|
|
88
|
+
async function setArcTsConfig(directory) {
|
|
89
|
+
const tsconfigPath = findTsConfig(directory);
|
|
92
90
|
if (tsconfigPath) {
|
|
93
91
|
const mergedConfig = loadConfig(tsconfigPath);
|
|
94
92
|
const compilerOptions = mergedConfig.compilerOptions || {};
|
|
@@ -98,6 +96,10 @@ async function loadModule(scriptUrl) {
|
|
|
98
96
|
tsArcConfig.paths = compilerOptions.paths || {};
|
|
99
97
|
tsArcConfig.tsconfigDir = tsconfigDir;
|
|
100
98
|
}
|
|
99
|
+
}
|
|
100
|
+
async function loadModule(scriptUrl) {
|
|
101
|
+
const scriptPath = url.fileURLToPath(scriptUrl);
|
|
102
|
+
setArcTsConfig(path.dirname(scriptPath));
|
|
101
103
|
await registerLoader();
|
|
102
104
|
import(scriptUrl).catch((err) => {
|
|
103
105
|
console.error(err);
|
|
@@ -106,5 +108,6 @@ async function loadModule(scriptUrl) {
|
|
|
106
108
|
}
|
|
107
109
|
export {
|
|
108
110
|
loadModule,
|
|
109
|
-
registerLoader
|
|
111
|
+
registerLoader,
|
|
112
|
+
setArcTsConfig
|
|
110
113
|
};
|
package/dist/cli.js
CHANGED
|
@@ -89,12 +89,10 @@ function findTsConfig(dir) {
|
|
|
89
89
|
}
|
|
90
90
|
var tsArcConfig = { baseUrl: null, paths: {}, tsconfigDir: null };
|
|
91
91
|
async function registerLoader() {
|
|
92
|
-
console.log("Registering ts-arc module loader..");
|
|
93
92
|
register("./loader.js", import.meta.url, { data: tsArcConfig });
|
|
94
93
|
}
|
|
95
|
-
async function
|
|
96
|
-
const
|
|
97
|
-
const tsconfigPath = findTsConfig(path.dirname(scriptPath2));
|
|
94
|
+
async function setArcTsConfig(directory) {
|
|
95
|
+
const tsconfigPath = findTsConfig(directory);
|
|
98
96
|
if (tsconfigPath) {
|
|
99
97
|
const mergedConfig = loadConfig(tsconfigPath);
|
|
100
98
|
const compilerOptions = mergedConfig.compilerOptions || {};
|
|
@@ -104,6 +102,10 @@ async function loadModule(scriptUrl2) {
|
|
|
104
102
|
tsArcConfig.paths = compilerOptions.paths || {};
|
|
105
103
|
tsArcConfig.tsconfigDir = tsconfigDir;
|
|
106
104
|
}
|
|
105
|
+
}
|
|
106
|
+
async function loadModule(scriptUrl2) {
|
|
107
|
+
const scriptPath2 = url.fileURLToPath(scriptUrl2);
|
|
108
|
+
setArcTsConfig(path.dirname(scriptPath2));
|
|
107
109
|
await registerLoader();
|
|
108
110
|
import(scriptUrl2).catch((err) => {
|
|
109
111
|
console.error(err);
|