@0x-jerry/x 2.12.7 → 2.12.8
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/{chunk-LBTVWMZC.js → chunk-P2FBA3GW.js} +1 -1
- package/dist/x.js +1 -1
- package/dist/xn.js +1 -1
- package/dist/xr.js +15 -5
- package/package.json +1 -1
package/dist/x.js
CHANGED
package/dist/xn.js
CHANGED
package/dist/xr.js
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
} from "./chunk-RDZVDWJQ.js";
|
|
6
6
|
import {
|
|
7
7
|
version
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-P2FBA3GW.js";
|
|
9
9
|
|
|
10
10
|
// src/xr.ts
|
|
11
11
|
import { sliver } from "@0x-jerry/silver";
|
|
@@ -60,18 +60,28 @@ var NodeTaskDetecter = class {
|
|
|
60
60
|
return envPaths;
|
|
61
61
|
}
|
|
62
62
|
async check(cwd) {
|
|
63
|
-
const
|
|
64
|
-
return
|
|
63
|
+
const rootPkgInfo = await detectPackageRoot(cwd);
|
|
64
|
+
return getClosestProjectInfo(rootPkgInfo)?.pkgDir;
|
|
65
65
|
}
|
|
66
66
|
async task(cwd, taskName) {
|
|
67
67
|
return (await this.tasks(cwd))[taskName];
|
|
68
68
|
}
|
|
69
69
|
async tasks(cwd) {
|
|
70
|
-
const
|
|
71
|
-
const tasks =
|
|
70
|
+
const rootPkgInfo = await detectPackageRoot(cwd);
|
|
71
|
+
const tasks = getClosestProjectInfo(rootPkgInfo)?.package.scripts || {};
|
|
72
72
|
return tasks;
|
|
73
73
|
}
|
|
74
74
|
};
|
|
75
|
+
function getClosestProjectInfo(rootPkgInfo) {
|
|
76
|
+
if (!rootPkgInfo) {
|
|
77
|
+
return void 0;
|
|
78
|
+
}
|
|
79
|
+
let pkgInfo = rootPkgInfo;
|
|
80
|
+
while (pkgInfo.subProject) {
|
|
81
|
+
pkgInfo = pkgInfo.subProject;
|
|
82
|
+
}
|
|
83
|
+
return pkgInfo;
|
|
84
|
+
}
|
|
75
85
|
async function getBinariesPairs() {
|
|
76
86
|
let dir = process.cwd();
|
|
77
87
|
const binaries = {};
|