@rubytech/taskmaster 1.0.79 → 1.0.80
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/build-info.json
CHANGED
|
@@ -4,26 +4,7 @@ import { fileURLToPath } from "node:url";
|
|
|
4
4
|
export function resolveBundledPluginsDir() {
|
|
5
5
|
return resolveBundledPluginsDirDetailed().dir;
|
|
6
6
|
}
|
|
7
|
-
/**
|
|
8
|
-
* Walk up from a starting directory looking for an `extensions/` child.
|
|
9
|
-
* Returns the extensions path if found, otherwise undefined.
|
|
10
|
-
*/
|
|
11
|
-
function walkUpForExtensions(startDir, triedPaths, maxLevels = 6) {
|
|
12
|
-
let cursor = startDir;
|
|
13
|
-
for (let i = 0; i < maxLevels; i += 1) {
|
|
14
|
-
const candidate = path.join(cursor, "extensions");
|
|
15
|
-
triedPaths.push(candidate);
|
|
16
|
-
if (fs.existsSync(candidate))
|
|
17
|
-
return candidate;
|
|
18
|
-
const parent = path.dirname(cursor);
|
|
19
|
-
if (parent === cursor)
|
|
20
|
-
break;
|
|
21
|
-
cursor = parent;
|
|
22
|
-
}
|
|
23
|
-
return undefined;
|
|
24
|
-
}
|
|
25
7
|
export function resolveBundledPluginsDirDetailed() {
|
|
26
|
-
const triedPaths = [];
|
|
27
8
|
const override = process.env.TASKMASTER_BUNDLED_PLUGINS_DIR?.trim();
|
|
28
9
|
if (override)
|
|
29
10
|
return { dir: override, source: "env" };
|
|
@@ -31,59 +12,19 @@ export function resolveBundledPluginsDirDetailed() {
|
|
|
31
12
|
try {
|
|
32
13
|
const execDir = path.dirname(process.execPath);
|
|
33
14
|
const sibling = path.join(execDir, "extensions");
|
|
34
|
-
triedPaths.push(sibling);
|
|
35
15
|
if (fs.existsSync(sibling))
|
|
36
16
|
return { dir: sibling, source: "exec-sibling" };
|
|
37
17
|
}
|
|
38
18
|
catch {
|
|
39
19
|
// ignore
|
|
40
20
|
}
|
|
41
|
-
//
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
catch {
|
|
49
|
-
// ignore
|
|
50
|
-
}
|
|
51
|
-
// Strategy 2: walk up from this module's raw path (without realpath).
|
|
52
|
-
try {
|
|
53
|
-
const rawModulePath = fileURLToPath(import.meta.url);
|
|
54
|
-
const found = walkUpForExtensions(path.dirname(rawModulePath), triedPaths);
|
|
55
|
-
if (found)
|
|
56
|
-
return { dir: found, source: "walk-up-raw" };
|
|
57
|
-
}
|
|
58
|
-
catch {
|
|
59
|
-
// ignore
|
|
60
|
-
}
|
|
61
|
-
// Strategy 3: walk up from the entry script (process.argv[1]).
|
|
62
|
-
// On npm global install, process.argv[1] resolves through bin symlinks
|
|
63
|
-
// to the actual entry.js in the package — a different starting point
|
|
64
|
-
// than import.meta.url which resolves from this specific module file.
|
|
65
|
-
try {
|
|
66
|
-
const entryScript = process.argv[1];
|
|
67
|
-
if (entryScript) {
|
|
68
|
-
const realEntry = fs.realpathSync(entryScript);
|
|
69
|
-
const found = walkUpForExtensions(path.dirname(realEntry), triedPaths);
|
|
70
|
-
if (found)
|
|
71
|
-
return { dir: found, source: "walk-up-argv1" };
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
catch {
|
|
75
|
-
// ignore
|
|
76
|
-
}
|
|
77
|
-
// Strategy 4: walk up from the package's main module.
|
|
78
|
-
// require.resolve finds the package entry regardless of how we were loaded.
|
|
79
|
-
try {
|
|
80
|
-
const pkgEntry = require.resolve("@rubytech/taskmaster");
|
|
81
|
-
const found = walkUpForExtensions(path.dirname(pkgEntry), triedPaths);
|
|
82
|
-
if (found)
|
|
83
|
-
return { dir: found, source: "walk-up-require-resolve" };
|
|
84
|
-
}
|
|
85
|
-
catch {
|
|
86
|
-
// ignore
|
|
21
|
+
// This file compiles to dist/plugins/bundled-dir.js.
|
|
22
|
+
// extensions/ is at the package root — exactly ../../ from here.
|
|
23
|
+
const thisFile = fileURLToPath(import.meta.url);
|
|
24
|
+
const packageRoot = path.resolve(path.dirname(thisFile), "..", "..");
|
|
25
|
+
const extensions = path.join(packageRoot, "extensions");
|
|
26
|
+
if (fs.existsSync(extensions)) {
|
|
27
|
+
return { dir: extensions, source: "package-relative" };
|
|
87
28
|
}
|
|
88
|
-
return { dir: undefined,
|
|
29
|
+
return { dir: undefined, resolvedPath: extensions };
|
|
89
30
|
}
|
|
@@ -275,7 +275,7 @@ export function discoverTaskmasterPlugins(params) {
|
|
|
275
275
|
else {
|
|
276
276
|
diagnostics.push({
|
|
277
277
|
level: "error",
|
|
278
|
-
message: `bundled extensions dir not
|
|
278
|
+
message: `bundled extensions dir not found at ${bundled.resolvedPath ?? "unknown"}`,
|
|
279
279
|
source: "bundled-dir",
|
|
280
280
|
});
|
|
281
281
|
}
|