layermap 0.1.13 → 0.1.14
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/README.md +6 -3
- package/analyzers/go/win32-arm64/go-map.exe +0 -0
- package/analyzers/go/win32-x64/go-map.exe +0 -0
- package/analyzers/project-map-go-worker.mjs +64 -26
- package/analyzers/project-map-java/java-map.jar +0 -0
- package/analyzers/project-map-java-worker.mjs +62 -28
- package/analyzers/project-map-python-worker.mjs +42 -41
- package/analyzers/project-map-worker.mjs +218 -200
- package/dist/cli.mjs +476 -388
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -99,7 +99,6 @@ in one local map:
|
|
|
99
99
|
Another tool fits better if you need:
|
|
100
100
|
|
|
101
101
|
- more languages, since tree-sitter graphs cover 30 or more;
|
|
102
|
-
- Windows;
|
|
103
102
|
- renaming and refactoring, from language servers;
|
|
104
103
|
- search by meaning, from embedding search;
|
|
105
104
|
- search across many repositories, with Sourcegraph.
|
|
@@ -159,7 +158,7 @@ other MCP client, run `npx -y layermap mcp` as a stdio server in the repository.
|
|
|
159
158
|
**Requirements:**
|
|
160
159
|
|
|
161
160
|
- Node.js 22.22 or later.
|
|
162
|
-
- macOS or Linux (x64 or arm64).
|
|
161
|
+
- macOS or Linux (x64 or arm64); Windows (x64 or arm64) is experimental.
|
|
163
162
|
- A Git repository.
|
|
164
163
|
- For Java projects, a JDK 21 or later.
|
|
165
164
|
|
|
@@ -201,7 +200,11 @@ npx layermap check --base main
|
|
|
201
200
|
framework routing, reflection and computed names. The tools say where a trace stops, and a missing
|
|
202
201
|
relationship does not prove absence.
|
|
203
202
|
|
|
204
|
-
**Windows?**
|
|
203
|
+
**Windows?** Experimental. LayerMap's tests pass on Windows, but it has not yet been tried with
|
|
204
|
+
Claude Code or Codex on a real Windows machine, so please test it on your own projects first and
|
|
205
|
+
[report what breaks](https://github.com/coffeecoproject/layermap/issues). The Claude Code plugin's
|
|
206
|
+
hooks need Git for Windows (they run in Git Bash); without it the map tools still work, and the
|
|
207
|
+
session-start note and end-of-task check do not run.
|
|
205
208
|
|
|
206
209
|
**Claude Code in print mode (`claude -p`)?** Print mode, as of Claude Code 2.1, does not start the
|
|
207
210
|
servers that installed plugins bring, so the map tools are missing there while the plugin's hooks
|
|
Binary file
|
|
Binary file
|
|
@@ -7,6 +7,40 @@ var __export = (target, all) => {
|
|
|
7
7
|
// src/project-map-go-worker.ts
|
|
8
8
|
import { spawn } from "node:child_process";
|
|
9
9
|
|
|
10
|
+
// src/platform.ts
|
|
11
|
+
import { spawnSync } from "node:child_process";
|
|
12
|
+
import path from "node:path";
|
|
13
|
+
var WINDOWS_SYSTEM = [
|
|
14
|
+
"SystemRoot",
|
|
15
|
+
"windir",
|
|
16
|
+
"SystemDrive",
|
|
17
|
+
"TEMP",
|
|
18
|
+
"TMP",
|
|
19
|
+
"USERPROFILE",
|
|
20
|
+
"LOCALAPPDATA",
|
|
21
|
+
"APPDATA",
|
|
22
|
+
"PATHEXT",
|
|
23
|
+
"ComSpec"
|
|
24
|
+
];
|
|
25
|
+
function childEnvironment(variables, platform = process.platform, env = process.env) {
|
|
26
|
+
if (platform !== "win32") return variables;
|
|
27
|
+
const system = {};
|
|
28
|
+
for (const name of WINDOWS_SYSTEM) if (env[name] !== void 0) system[name] = env[name];
|
|
29
|
+
return { ...system, ...variables };
|
|
30
|
+
}
|
|
31
|
+
function stopProcessTree(pid, signal, platform = process.platform) {
|
|
32
|
+
if (platform !== "win32") {
|
|
33
|
+
process.kill(-pid, signal);
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
const taskkill = path.win32.join(
|
|
37
|
+
process.env.SystemRoot ?? "C:\\Windows",
|
|
38
|
+
"System32",
|
|
39
|
+
"taskkill.exe"
|
|
40
|
+
);
|
|
41
|
+
spawnSync(taskkill, ["/PID", String(pid), "/T", "/F"], { stdio: "ignore", windowsHide: true });
|
|
42
|
+
}
|
|
43
|
+
|
|
10
44
|
// node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/external.js
|
|
11
45
|
var external_exports = {};
|
|
12
46
|
__export(external_exports, {
|
|
@@ -773,10 +807,10 @@ function mergeDefs(...defs) {
|
|
|
773
807
|
function cloneDef(schema) {
|
|
774
808
|
return mergeDefs(schema._zod.def);
|
|
775
809
|
}
|
|
776
|
-
function getElementAtPath(obj,
|
|
777
|
-
if (!
|
|
810
|
+
function getElementAtPath(obj, path3) {
|
|
811
|
+
if (!path3)
|
|
778
812
|
return obj;
|
|
779
|
-
return
|
|
813
|
+
return path3.reduce((acc, key) => acc?.[key], obj);
|
|
780
814
|
}
|
|
781
815
|
function promiseAllObject(promisesObj) {
|
|
782
816
|
const keys = Object.keys(promisesObj);
|
|
@@ -1185,11 +1219,11 @@ function explicitlyAborted(x, startIndex = 0) {
|
|
|
1185
1219
|
}
|
|
1186
1220
|
return false;
|
|
1187
1221
|
}
|
|
1188
|
-
function prefixIssues(
|
|
1222
|
+
function prefixIssues(path3, issues) {
|
|
1189
1223
|
return issues.map((iss) => {
|
|
1190
1224
|
var _a3;
|
|
1191
1225
|
(_a3 = iss).path ?? (_a3.path = []);
|
|
1192
|
-
iss.path.unshift(
|
|
1226
|
+
iss.path.unshift(path3);
|
|
1193
1227
|
return iss;
|
|
1194
1228
|
});
|
|
1195
1229
|
}
|
|
@@ -1336,16 +1370,16 @@ function flattenError(error51, mapper = (issue2) => issue2.message) {
|
|
|
1336
1370
|
}
|
|
1337
1371
|
function formatError(error51, mapper = (issue2) => issue2.message) {
|
|
1338
1372
|
const fieldErrors = { _errors: [] };
|
|
1339
|
-
const processError = (error52,
|
|
1373
|
+
const processError = (error52, path3 = []) => {
|
|
1340
1374
|
for (const issue2 of error52.issues) {
|
|
1341
1375
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
1342
|
-
issue2.errors.map((issues) => processError({ issues }, [...
|
|
1376
|
+
issue2.errors.map((issues) => processError({ issues }, [...path3, ...issue2.path]));
|
|
1343
1377
|
} else if (issue2.code === "invalid_key") {
|
|
1344
|
-
processError({ issues: issue2.issues }, [...
|
|
1378
|
+
processError({ issues: issue2.issues }, [...path3, ...issue2.path]);
|
|
1345
1379
|
} else if (issue2.code === "invalid_element") {
|
|
1346
|
-
processError({ issues: issue2.issues }, [...
|
|
1380
|
+
processError({ issues: issue2.issues }, [...path3, ...issue2.path]);
|
|
1347
1381
|
} else {
|
|
1348
|
-
const fullpath = [...
|
|
1382
|
+
const fullpath = [...path3, ...issue2.path];
|
|
1349
1383
|
if (fullpath.length === 0) {
|
|
1350
1384
|
fieldErrors._errors.push(mapper(issue2));
|
|
1351
1385
|
} else {
|
|
@@ -1372,17 +1406,17 @@ function formatError(error51, mapper = (issue2) => issue2.message) {
|
|
|
1372
1406
|
}
|
|
1373
1407
|
function treeifyError(error51, mapper = (issue2) => issue2.message) {
|
|
1374
1408
|
const result = { errors: [] };
|
|
1375
|
-
const processError = (error52,
|
|
1409
|
+
const processError = (error52, path3 = []) => {
|
|
1376
1410
|
var _a3, _b;
|
|
1377
1411
|
for (const issue2 of error52.issues) {
|
|
1378
1412
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
1379
|
-
issue2.errors.map((issues) => processError({ issues }, [...
|
|
1413
|
+
issue2.errors.map((issues) => processError({ issues }, [...path3, ...issue2.path]));
|
|
1380
1414
|
} else if (issue2.code === "invalid_key") {
|
|
1381
|
-
processError({ issues: issue2.issues }, [...
|
|
1415
|
+
processError({ issues: issue2.issues }, [...path3, ...issue2.path]);
|
|
1382
1416
|
} else if (issue2.code === "invalid_element") {
|
|
1383
|
-
processError({ issues: issue2.issues }, [...
|
|
1417
|
+
processError({ issues: issue2.issues }, [...path3, ...issue2.path]);
|
|
1384
1418
|
} else {
|
|
1385
|
-
const fullpath = [...
|
|
1419
|
+
const fullpath = [...path3, ...issue2.path];
|
|
1386
1420
|
if (fullpath.length === 0) {
|
|
1387
1421
|
result.errors.push(mapper(issue2));
|
|
1388
1422
|
continue;
|
|
@@ -1414,8 +1448,8 @@ function treeifyError(error51, mapper = (issue2) => issue2.message) {
|
|
|
1414
1448
|
}
|
|
1415
1449
|
function toDotPath(_path) {
|
|
1416
1450
|
const segs = [];
|
|
1417
|
-
const
|
|
1418
|
-
for (const seg of
|
|
1451
|
+
const path3 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
|
|
1452
|
+
for (const seg of path3) {
|
|
1419
1453
|
if (typeof seg === "number")
|
|
1420
1454
|
segs.push(`[${seg}]`);
|
|
1421
1455
|
else if (typeof seg === "symbol")
|
|
@@ -14107,13 +14141,13 @@ function resolveRef(ref, ctx) {
|
|
|
14107
14141
|
if (!ref.startsWith("#")) {
|
|
14108
14142
|
throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
|
|
14109
14143
|
}
|
|
14110
|
-
const
|
|
14111
|
-
if (
|
|
14144
|
+
const path3 = ref.slice(1).split("/").filter(Boolean);
|
|
14145
|
+
if (path3.length === 0) {
|
|
14112
14146
|
return ctx.rootSchema;
|
|
14113
14147
|
}
|
|
14114
14148
|
const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
|
|
14115
|
-
if (
|
|
14116
|
-
const key =
|
|
14149
|
+
if (path3[0] === defsKey) {
|
|
14150
|
+
const key = path3[1];
|
|
14117
14151
|
if (!key || !ctx.defs[key]) {
|
|
14118
14152
|
throw new Error(`Reference not found: ${ref}`);
|
|
14119
14153
|
}
|
|
@@ -14522,7 +14556,7 @@ function date4(params) {
|
|
|
14522
14556
|
config(en_default());
|
|
14523
14557
|
|
|
14524
14558
|
// src/core.ts
|
|
14525
|
-
import
|
|
14559
|
+
import path2 from "node:path";
|
|
14526
14560
|
var ProjectEvidencePathError = class extends Error {
|
|
14527
14561
|
constructor(code) {
|
|
14528
14562
|
super(code);
|
|
@@ -14532,14 +14566,14 @@ var ProjectEvidencePathError = class extends Error {
|
|
|
14532
14566
|
code;
|
|
14533
14567
|
};
|
|
14534
14568
|
var normalizeProjectEvidencePath = (value, allowRoot = false) => {
|
|
14535
|
-
if (value.includes("\0") ||
|
|
14569
|
+
if (value.includes("\0") || path2.isAbsolute(value) || value.includes("\\")) {
|
|
14536
14570
|
throw new ProjectEvidencePathError("PROJECT_PATH_INVALID");
|
|
14537
14571
|
}
|
|
14538
14572
|
if (value === ".") {
|
|
14539
14573
|
if (allowRoot) return "";
|
|
14540
14574
|
throw new ProjectEvidencePathError("PROJECT_PATH_INVALID");
|
|
14541
14575
|
}
|
|
14542
|
-
const normalized =
|
|
14576
|
+
const normalized = path2.posix.normalize(value);
|
|
14543
14577
|
if (normalized.length === 0 || normalized !== value || normalized === ".." || normalized.startsWith("../") || value.split("/").some((segment) => segment.length === 0 || segment === "." || segment === "..")) {
|
|
14544
14578
|
throw new ProjectEvidencePathError("PROJECT_PATH_INVALID");
|
|
14545
14579
|
}
|
|
@@ -14662,7 +14696,7 @@ function mapWorkerFailure(error51, trace, workerUrl) {
|
|
|
14662
14696
|
}
|
|
14663
14697
|
|
|
14664
14698
|
// src/project-map-go-worker.ts
|
|
14665
|
-
var stopOwnedGroup = () =>
|
|
14699
|
+
var stopOwnedGroup = () => stopProcessTree(process.pid, "SIGKILL");
|
|
14666
14700
|
process.once("disconnect", stopOwnedGroup);
|
|
14667
14701
|
process.once("SIGTERM", stopOwnedGroup);
|
|
14668
14702
|
process.once("beforeExit", () => process.off("disconnect", stopOwnedGroup));
|
|
@@ -14675,7 +14709,11 @@ process.once(
|
|
|
14675
14709
|
process.exitCode = 1;
|
|
14676
14710
|
process.channel?.unref();
|
|
14677
14711
|
};
|
|
14678
|
-
const helper = spawn(message.compilerPath, [], {
|
|
14712
|
+
const helper = spawn(message.compilerPath, [], {
|
|
14713
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
14714
|
+
env: childEnvironment({}),
|
|
14715
|
+
windowsHide: true
|
|
14716
|
+
});
|
|
14679
14717
|
const output = [];
|
|
14680
14718
|
let errors = "";
|
|
14681
14719
|
helper.stdout.on("data", (chunk) => output.push(chunk));
|
|
Binary file
|
|
@@ -6,7 +6,41 @@ var __export = (target, all) => {
|
|
|
6
6
|
|
|
7
7
|
// src/project-map-java-worker.ts
|
|
8
8
|
import { spawn } from "node:child_process";
|
|
9
|
-
import
|
|
9
|
+
import path3 from "node:path";
|
|
10
|
+
|
|
11
|
+
// src/platform.ts
|
|
12
|
+
import { spawnSync } from "node:child_process";
|
|
13
|
+
import path from "node:path";
|
|
14
|
+
var WINDOWS_SYSTEM = [
|
|
15
|
+
"SystemRoot",
|
|
16
|
+
"windir",
|
|
17
|
+
"SystemDrive",
|
|
18
|
+
"TEMP",
|
|
19
|
+
"TMP",
|
|
20
|
+
"USERPROFILE",
|
|
21
|
+
"LOCALAPPDATA",
|
|
22
|
+
"APPDATA",
|
|
23
|
+
"PATHEXT",
|
|
24
|
+
"ComSpec"
|
|
25
|
+
];
|
|
26
|
+
function childEnvironment(variables, platform = process.platform, env = process.env) {
|
|
27
|
+
if (platform !== "win32") return variables;
|
|
28
|
+
const system = {};
|
|
29
|
+
for (const name of WINDOWS_SYSTEM) if (env[name] !== void 0) system[name] = env[name];
|
|
30
|
+
return { ...system, ...variables };
|
|
31
|
+
}
|
|
32
|
+
function stopProcessTree(pid, signal, platform = process.platform) {
|
|
33
|
+
if (platform !== "win32") {
|
|
34
|
+
process.kill(-pid, signal);
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
const taskkill = path.win32.join(
|
|
38
|
+
process.env.SystemRoot ?? "C:\\Windows",
|
|
39
|
+
"System32",
|
|
40
|
+
"taskkill.exe"
|
|
41
|
+
);
|
|
42
|
+
spawnSync(taskkill, ["/PID", String(pid), "/T", "/F"], { stdio: "ignore", windowsHide: true });
|
|
43
|
+
}
|
|
10
44
|
|
|
11
45
|
// node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/external.js
|
|
12
46
|
var external_exports = {};
|
|
@@ -774,10 +808,10 @@ function mergeDefs(...defs) {
|
|
|
774
808
|
function cloneDef(schema) {
|
|
775
809
|
return mergeDefs(schema._zod.def);
|
|
776
810
|
}
|
|
777
|
-
function getElementAtPath(obj,
|
|
778
|
-
if (!
|
|
811
|
+
function getElementAtPath(obj, path4) {
|
|
812
|
+
if (!path4)
|
|
779
813
|
return obj;
|
|
780
|
-
return
|
|
814
|
+
return path4.reduce((acc, key) => acc?.[key], obj);
|
|
781
815
|
}
|
|
782
816
|
function promiseAllObject(promisesObj) {
|
|
783
817
|
const keys = Object.keys(promisesObj);
|
|
@@ -1186,11 +1220,11 @@ function explicitlyAborted(x, startIndex = 0) {
|
|
|
1186
1220
|
}
|
|
1187
1221
|
return false;
|
|
1188
1222
|
}
|
|
1189
|
-
function prefixIssues(
|
|
1223
|
+
function prefixIssues(path4, issues) {
|
|
1190
1224
|
return issues.map((iss) => {
|
|
1191
1225
|
var _a3;
|
|
1192
1226
|
(_a3 = iss).path ?? (_a3.path = []);
|
|
1193
|
-
iss.path.unshift(
|
|
1227
|
+
iss.path.unshift(path4);
|
|
1194
1228
|
return iss;
|
|
1195
1229
|
});
|
|
1196
1230
|
}
|
|
@@ -1337,16 +1371,16 @@ function flattenError(error51, mapper = (issue2) => issue2.message) {
|
|
|
1337
1371
|
}
|
|
1338
1372
|
function formatError(error51, mapper = (issue2) => issue2.message) {
|
|
1339
1373
|
const fieldErrors = { _errors: [] };
|
|
1340
|
-
const processError = (error52,
|
|
1374
|
+
const processError = (error52, path4 = []) => {
|
|
1341
1375
|
for (const issue2 of error52.issues) {
|
|
1342
1376
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
1343
|
-
issue2.errors.map((issues) => processError({ issues }, [...
|
|
1377
|
+
issue2.errors.map((issues) => processError({ issues }, [...path4, ...issue2.path]));
|
|
1344
1378
|
} else if (issue2.code === "invalid_key") {
|
|
1345
|
-
processError({ issues: issue2.issues }, [...
|
|
1379
|
+
processError({ issues: issue2.issues }, [...path4, ...issue2.path]);
|
|
1346
1380
|
} else if (issue2.code === "invalid_element") {
|
|
1347
|
-
processError({ issues: issue2.issues }, [...
|
|
1381
|
+
processError({ issues: issue2.issues }, [...path4, ...issue2.path]);
|
|
1348
1382
|
} else {
|
|
1349
|
-
const fullpath = [...
|
|
1383
|
+
const fullpath = [...path4, ...issue2.path];
|
|
1350
1384
|
if (fullpath.length === 0) {
|
|
1351
1385
|
fieldErrors._errors.push(mapper(issue2));
|
|
1352
1386
|
} else {
|
|
@@ -1373,17 +1407,17 @@ function formatError(error51, mapper = (issue2) => issue2.message) {
|
|
|
1373
1407
|
}
|
|
1374
1408
|
function treeifyError(error51, mapper = (issue2) => issue2.message) {
|
|
1375
1409
|
const result = { errors: [] };
|
|
1376
|
-
const processError = (error52,
|
|
1410
|
+
const processError = (error52, path4 = []) => {
|
|
1377
1411
|
var _a3, _b;
|
|
1378
1412
|
for (const issue2 of error52.issues) {
|
|
1379
1413
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
1380
|
-
issue2.errors.map((issues) => processError({ issues }, [...
|
|
1414
|
+
issue2.errors.map((issues) => processError({ issues }, [...path4, ...issue2.path]));
|
|
1381
1415
|
} else if (issue2.code === "invalid_key") {
|
|
1382
|
-
processError({ issues: issue2.issues }, [...
|
|
1416
|
+
processError({ issues: issue2.issues }, [...path4, ...issue2.path]);
|
|
1383
1417
|
} else if (issue2.code === "invalid_element") {
|
|
1384
|
-
processError({ issues: issue2.issues }, [...
|
|
1418
|
+
processError({ issues: issue2.issues }, [...path4, ...issue2.path]);
|
|
1385
1419
|
} else {
|
|
1386
|
-
const fullpath = [...
|
|
1420
|
+
const fullpath = [...path4, ...issue2.path];
|
|
1387
1421
|
if (fullpath.length === 0) {
|
|
1388
1422
|
result.errors.push(mapper(issue2));
|
|
1389
1423
|
continue;
|
|
@@ -1415,8 +1449,8 @@ function treeifyError(error51, mapper = (issue2) => issue2.message) {
|
|
|
1415
1449
|
}
|
|
1416
1450
|
function toDotPath(_path) {
|
|
1417
1451
|
const segs = [];
|
|
1418
|
-
const
|
|
1419
|
-
for (const seg of
|
|
1452
|
+
const path4 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
|
|
1453
|
+
for (const seg of path4) {
|
|
1420
1454
|
if (typeof seg === "number")
|
|
1421
1455
|
segs.push(`[${seg}]`);
|
|
1422
1456
|
else if (typeof seg === "symbol")
|
|
@@ -14108,13 +14142,13 @@ function resolveRef(ref, ctx) {
|
|
|
14108
14142
|
if (!ref.startsWith("#")) {
|
|
14109
14143
|
throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
|
|
14110
14144
|
}
|
|
14111
|
-
const
|
|
14112
|
-
if (
|
|
14145
|
+
const path4 = ref.slice(1).split("/").filter(Boolean);
|
|
14146
|
+
if (path4.length === 0) {
|
|
14113
14147
|
return ctx.rootSchema;
|
|
14114
14148
|
}
|
|
14115
14149
|
const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
|
|
14116
|
-
if (
|
|
14117
|
-
const key =
|
|
14150
|
+
if (path4[0] === defsKey) {
|
|
14151
|
+
const key = path4[1];
|
|
14118
14152
|
if (!key || !ctx.defs[key]) {
|
|
14119
14153
|
throw new Error(`Reference not found: ${ref}`);
|
|
14120
14154
|
}
|
|
@@ -14523,7 +14557,7 @@ function date4(params) {
|
|
|
14523
14557
|
config(en_default());
|
|
14524
14558
|
|
|
14525
14559
|
// src/core.ts
|
|
14526
|
-
import
|
|
14560
|
+
import path2 from "node:path";
|
|
14527
14561
|
var ProjectEvidencePathError = class extends Error {
|
|
14528
14562
|
constructor(code) {
|
|
14529
14563
|
super(code);
|
|
@@ -14533,14 +14567,14 @@ var ProjectEvidencePathError = class extends Error {
|
|
|
14533
14567
|
code;
|
|
14534
14568
|
};
|
|
14535
14569
|
var normalizeProjectEvidencePath = (value, allowRoot = false) => {
|
|
14536
|
-
if (value.includes("\0") ||
|
|
14570
|
+
if (value.includes("\0") || path2.isAbsolute(value) || value.includes("\\")) {
|
|
14537
14571
|
throw new ProjectEvidencePathError("PROJECT_PATH_INVALID");
|
|
14538
14572
|
}
|
|
14539
14573
|
if (value === ".") {
|
|
14540
14574
|
if (allowRoot) return "";
|
|
14541
14575
|
throw new ProjectEvidencePathError("PROJECT_PATH_INVALID");
|
|
14542
14576
|
}
|
|
14543
|
-
const normalized =
|
|
14577
|
+
const normalized = path2.posix.normalize(value);
|
|
14544
14578
|
if (normalized.length === 0 || normalized !== value || normalized === ".." || normalized.startsWith("../") || value.split("/").some((segment) => segment.length === 0 || segment === "." || segment === "..")) {
|
|
14545
14579
|
throw new ProjectEvidencePathError("PROJECT_PATH_INVALID");
|
|
14546
14580
|
}
|
|
@@ -14663,7 +14697,7 @@ function mapWorkerFailure(error51, trace, workerUrl) {
|
|
|
14663
14697
|
}
|
|
14664
14698
|
|
|
14665
14699
|
// src/project-map-java-worker.ts
|
|
14666
|
-
var stopOwnedGroup = () =>
|
|
14700
|
+
var stopOwnedGroup = () => stopProcessTree(process.pid, "SIGKILL");
|
|
14667
14701
|
process.once("disconnect", stopOwnedGroup);
|
|
14668
14702
|
process.once("SIGTERM", stopOwnedGroup);
|
|
14669
14703
|
process.once("beforeExit", () => process.off("disconnect", stopOwnedGroup));
|
|
@@ -14689,7 +14723,7 @@ process.once(
|
|
|
14689
14723
|
message.compilerPath,
|
|
14690
14724
|
"javamap.Main"
|
|
14691
14725
|
],
|
|
14692
|
-
{ stdio: ["pipe", "pipe", "pipe"], env: {} }
|
|
14726
|
+
{ stdio: ["pipe", "pipe", "pipe"], env: childEnvironment({}), windowsHide: true }
|
|
14693
14727
|
);
|
|
14694
14728
|
const output = [];
|
|
14695
14729
|
let errors = "";
|
|
@@ -14720,7 +14754,7 @@ process.once(
|
|
|
14720
14754
|
files: message.files,
|
|
14721
14755
|
release: message.release,
|
|
14722
14756
|
tests: message.tests,
|
|
14723
|
-
lombok:
|
|
14757
|
+
lombok: path3.join(path3.dirname(message.compilerPath), "lombok.jar"),
|
|
14724
14758
|
...message.target ? { target: message.target } : {},
|
|
14725
14759
|
...message.incremental ? { incremental: message.incremental } : {}
|
|
14726
14760
|
})
|
|
@@ -41295,13 +41295,13 @@ var FileSpec;
|
|
|
41295
41295
|
return !!paths.find((p2) => p2.regExp.test(path3));
|
|
41296
41296
|
}
|
|
41297
41297
|
FileSpec3.isInPath = isInPath;
|
|
41298
|
-
function matchesIncludeFileRegex(
|
|
41299
|
-
return isFile2 ? _includeFileRegex.test(
|
|
41298
|
+
function matchesIncludeFileRegex(filePath2, isFile2 = true) {
|
|
41299
|
+
return isFile2 ? _includeFileRegex.test(filePath2) : true;
|
|
41300
41300
|
}
|
|
41301
41301
|
FileSpec3.matchesIncludeFileRegex = matchesIncludeFileRegex;
|
|
41302
|
-
function matchIncludeFileSpec(includeRegExp, exclude,
|
|
41303
|
-
if (includeRegExp.test(
|
|
41304
|
-
if (!FileSpec3.isInPath(
|
|
41302
|
+
function matchIncludeFileSpec(includeRegExp, exclude, filePath2, isFile2 = true) {
|
|
41303
|
+
if (includeRegExp.test(filePath2)) {
|
|
41304
|
+
if (!FileSpec3.isInPath(filePath2, exclude) && FileSpec3.matchesIncludeFileRegex(filePath2, isFile2)) {
|
|
41305
41305
|
return true;
|
|
41306
41306
|
}
|
|
41307
41307
|
}
|
|
@@ -42004,10 +42004,10 @@ var _FileUri = class _FileUri extends BaseUri {
|
|
|
42004
42004
|
get isCaseSensitive() {
|
|
42005
42005
|
return this._isCaseSensitive;
|
|
42006
42006
|
}
|
|
42007
|
-
static createFileUri(
|
|
42008
|
-
|
|
42009
|
-
const key = _FileUri._createKey(
|
|
42010
|
-
return new _FileUri(key,
|
|
42007
|
+
static createFileUri(filePath2, query, fragment, originalString, isCaseSensitive) {
|
|
42008
|
+
filePath2 = isDiskPathRoot(filePath2) ? ensureTrailingDirectorySeparator(filePath2) : filePath2;
|
|
42009
|
+
const key = _FileUri._createKey(filePath2, query, fragment);
|
|
42010
|
+
return new _FileUri(key, filePath2, query, fragment, originalString, isCaseSensitive);
|
|
42011
42011
|
}
|
|
42012
42012
|
static isFileUri(uri) {
|
|
42013
42013
|
return uri?._filePath !== void 0 && uri?._key !== void 0;
|
|
@@ -42122,12 +42122,12 @@ var _FileUri = class _FileUri extends BaseUri {
|
|
|
42122
42122
|
return this;
|
|
42123
42123
|
}
|
|
42124
42124
|
getDirectory() {
|
|
42125
|
-
const
|
|
42126
|
-
let dir = getDirectoryPath(
|
|
42125
|
+
const filePath2 = this._filePath;
|
|
42126
|
+
let dir = getDirectoryPath(filePath2);
|
|
42127
42127
|
if (hasTrailingDirectorySeparator(dir) && dir.length > 1) {
|
|
42128
42128
|
dir = dir.slice(0, -1);
|
|
42129
42129
|
}
|
|
42130
|
-
if (dir !==
|
|
42130
|
+
if (dir !== filePath2) {
|
|
42131
42131
|
return _FileUri.createFileUri(dir, "", "", void 0, this._isCaseSensitive);
|
|
42132
42132
|
} else {
|
|
42133
42133
|
return this;
|
|
@@ -42170,8 +42170,8 @@ var _FileUri = class _FileUri extends BaseUri {
|
|
|
42170
42170
|
getComparablePath() {
|
|
42171
42171
|
return this._getNormalizedPath();
|
|
42172
42172
|
}
|
|
42173
|
-
static _createKey(
|
|
42174
|
-
return `${
|
|
42173
|
+
static _createKey(filePath2, query, fragment) {
|
|
42174
|
+
return `${filePath2}${query ? "?" + query : ""}${fragment ? "#" + fragment : ""}`;
|
|
42175
42175
|
}
|
|
42176
42176
|
_getNormalizedPath() {
|
|
42177
42177
|
if (this._normalizedPath === void 0) {
|
|
@@ -42429,19 +42429,19 @@ var WebUri = _WebUri;
|
|
|
42429
42429
|
var _dosPathRegex = /^\/[a-zA-Z]:\//;
|
|
42430
42430
|
var _win32NormalizationRegex = /\//g;
|
|
42431
42431
|
function getFilePath(uri) {
|
|
42432
|
-
let
|
|
42432
|
+
let filePath2;
|
|
42433
42433
|
if (uri.authority && uri.path[0] === "/" && uri.path.length === 1) {
|
|
42434
|
-
|
|
42434
|
+
filePath2 = `//${uri.authority}${uri.path}`;
|
|
42435
42435
|
} else {
|
|
42436
|
-
|
|
42436
|
+
filePath2 = uri.fsPath;
|
|
42437
42437
|
}
|
|
42438
|
-
if (
|
|
42439
|
-
|
|
42438
|
+
if (filePath2.match(_dosPathRegex)) {
|
|
42439
|
+
filePath2 = filePath2.slice(1);
|
|
42440
42440
|
}
|
|
42441
42441
|
if (process?.platform === "win32") {
|
|
42442
|
-
|
|
42442
|
+
filePath2 = filePath2.replace(_win32NormalizationRegex, "\\");
|
|
42443
42443
|
}
|
|
42444
|
-
return
|
|
42444
|
+
return filePath2;
|
|
42445
42445
|
}
|
|
42446
42446
|
function normalizeUri(uri) {
|
|
42447
42447
|
const parsed = u.isUri(uri) ? uri : u.parse(uri);
|
|
@@ -57619,10 +57619,10 @@ function getPathsFromPthFiles(fs, parentDir) {
|
|
|
57619
57619
|
const searchPaths = [];
|
|
57620
57620
|
const pthFiles = fs.readdirEntriesSync(parentDir).filter((entry) => (entry.isFile() || entry.isSymbolicLink()) && entry.name.endsWith(".pth")).sort((a2, b2) => compareComparableValues(a2.name, b2.name));
|
|
57621
57621
|
pthFiles.forEach((pthFile) => {
|
|
57622
|
-
const
|
|
57623
|
-
const fileStats = tryStat(fs,
|
|
57622
|
+
const filePath2 = fs.realCasePath(parentDir.combinePaths(pthFile.name));
|
|
57623
|
+
const fileStats = tryStat(fs, filePath2);
|
|
57624
57624
|
if (fileStats?.isFile() && fileStats.size > 0 && fileStats.size < 64 * 1024) {
|
|
57625
|
-
searchPaths.push(...readPthSearchPaths(
|
|
57625
|
+
searchPaths.push(...readPthSearchPaths(filePath2, fs));
|
|
57626
57626
|
}
|
|
57627
57627
|
});
|
|
57628
57628
|
return searchPaths;
|
|
@@ -60211,29 +60211,29 @@ var ImportResolver = class _ImportResolver {
|
|
|
60211
60211
|
this.fileSystem,
|
|
60212
60212
|
dirPath
|
|
60213
60213
|
);
|
|
60214
|
-
for (const
|
|
60215
|
-
const fileExt =
|
|
60214
|
+
for (const filePath2 of entries.files) {
|
|
60215
|
+
const fileExt = filePath2.lastExtension;
|
|
60216
60216
|
let strippedFileName;
|
|
60217
60217
|
let isNativeLib = false;
|
|
60218
60218
|
if (fileExt === ".py" || fileExt === ".pyi") {
|
|
60219
|
-
strippedFileName = stripFileExtension(
|
|
60220
|
-
} else if (_isNativeModuleFileExtension(fileExt) && !this.fileExistsCached(
|
|
60221
|
-
strippedFileName =
|
|
60219
|
+
strippedFileName = stripFileExtension(filePath2.fileName);
|
|
60220
|
+
} else if (_isNativeModuleFileExtension(fileExt) && !this.fileExistsCached(filePath2.packageUri) && !this.fileExistsCached(filePath2.packageStubUri)) {
|
|
60221
|
+
strippedFileName = filePath2.stripAllExtensions().fileName;
|
|
60222
60222
|
isNativeLib = true;
|
|
60223
60223
|
} else {
|
|
60224
60224
|
continue;
|
|
60225
60225
|
}
|
|
60226
|
-
if (!exclusions.find((exclusion) => exclusion.equals(
|
|
60226
|
+
if (!exclusions.find((exclusion) => exclusion.equals(filePath2))) {
|
|
60227
60227
|
const implicitImport = {
|
|
60228
|
-
isStubFile:
|
|
60228
|
+
isStubFile: filePath2.hasExtension(".pyi"),
|
|
60229
60229
|
isNativeLib,
|
|
60230
60230
|
name: strippedFileName,
|
|
60231
|
-
uri:
|
|
60231
|
+
uri: filePath2
|
|
60232
60232
|
};
|
|
60233
60233
|
const entry = implicitImportMap.get(implicitImport.name);
|
|
60234
60234
|
if (!entry || !entry.isStubFile) {
|
|
60235
60235
|
if (isNativeLib) {
|
|
60236
|
-
const nativeLibPath =
|
|
60236
|
+
const nativeLibPath = filePath2;
|
|
60237
60237
|
const nativeStubPath = this.resolveNativeImportEx(
|
|
60238
60238
|
nativeLibPath,
|
|
60239
60239
|
`${importingModuleName}.${strippedFileName}`
|
|
@@ -61417,11 +61417,11 @@ var ImportResolver = class _ImportResolver {
|
|
|
61417
61417
|
}
|
|
61418
61418
|
// Retrieves the pytyped info for a directory if it exists. This is a small perf optimization
|
|
61419
61419
|
// that allows skipping the search when the pytyped file doesn't exist.
|
|
61420
|
-
_getPyTypedInfo(
|
|
61421
|
-
if (!this.fileExistsCached(
|
|
61420
|
+
_getPyTypedInfo(filePath2) {
|
|
61421
|
+
if (!this.fileExistsCached(filePath2.pytypedUri)) {
|
|
61422
61422
|
return void 0;
|
|
61423
61423
|
}
|
|
61424
|
-
return getPyTypedInfoForPyTypedFile(this.fileSystem,
|
|
61424
|
+
return getPyTypedInfoForPyTypedFile(this.fileSystem, filePath2.pytypedUri);
|
|
61425
61425
|
}
|
|
61426
61426
|
_findAndResolveNativeModule(fileDirectory, dirPath, execEnv, importName, moduleDescriptor, importLogger, resolvedPaths) {
|
|
61427
61427
|
let isNativeLib = false;
|
|
@@ -120692,6 +120692,7 @@ var NoAccessHost = class {
|
|
|
120692
120692
|
var PROJECT = "/project";
|
|
120693
120693
|
var TYPESHED = "/typeshed";
|
|
120694
120694
|
var detector = { isCaseSensitive: () => true };
|
|
120695
|
+
var filePath = (uri) => uri.getFilePath().replaceAll("\\", "/");
|
|
120695
120696
|
var missing = (path3) => {
|
|
120696
120697
|
throw Object.assign(new Error(`ENOENT: ${path3}`), { code: "ENOENT" });
|
|
120697
120698
|
};
|
|
@@ -120737,14 +120738,14 @@ var SourceFileSystem = class {
|
|
|
120737
120738
|
return path3 === TYPESHED || path3.startsWith(`${TYPESHED}/`) ? this.typeshed + path3.slice(TYPESHED.length) : void 0;
|
|
120738
120739
|
}
|
|
120739
120740
|
existsSync(uri) {
|
|
120740
|
-
const path3 = uri
|
|
120741
|
+
const path3 = filePath(uri);
|
|
120741
120742
|
const disk = this.disk(path3);
|
|
120742
120743
|
return disk ? nodeFs.existsSync(disk) : this.files.has(path3) || this.directories.has(path3);
|
|
120743
120744
|
}
|
|
120744
120745
|
chdir() {
|
|
120745
120746
|
}
|
|
120746
120747
|
readdirEntriesSync(uri) {
|
|
120747
|
-
const path3 = uri
|
|
120748
|
+
const path3 = filePath(uri);
|
|
120748
120749
|
const disk = this.disk(path3);
|
|
120749
120750
|
if (disk) return nodeFs.readdirSync(disk, { withFileTypes: true });
|
|
120750
120751
|
return [...this.directories.get(path3) ?? missing(path3)].map(([name, file2]) => ({
|
|
@@ -120758,13 +120759,13 @@ var SourceFileSystem = class {
|
|
|
120758
120759
|
return this.readdirEntriesSync(uri).map((entry) => entry.name);
|
|
120759
120760
|
}
|
|
120760
120761
|
readFileSync(uri, encoding) {
|
|
120761
|
-
const path3 = uri
|
|
120762
|
+
const path3 = filePath(uri);
|
|
120762
120763
|
const disk = this.disk(path3);
|
|
120763
120764
|
const text = disk ? nodeFs.readFileSync(disk, "utf8") : this.files.get(path3) ?? missing(path3);
|
|
120764
120765
|
return encoding ? text : Buffer.from(text);
|
|
120765
120766
|
}
|
|
120766
120767
|
statSync(uri) {
|
|
120767
|
-
const path3 = uri
|
|
120768
|
+
const path3 = filePath(uri);
|
|
120768
120769
|
const disk = this.disk(path3);
|
|
120769
120770
|
if (disk) return nodeFs.statSync(disk);
|
|
120770
120771
|
const text = this.files.get(path3);
|
|
@@ -120922,7 +120923,7 @@ function openPythonProgram(input) {
|
|
|
120922
120923
|
}
|
|
120923
120924
|
};
|
|
120924
120925
|
}
|
|
120925
|
-
var pythonStandardLibrary = (uri) => uri
|
|
120926
|
+
var pythonStandardLibrary = (uri) => filePath(uri).startsWith(`${TYPESHED}/`);
|
|
120926
120927
|
|
|
120927
120928
|
// src/project-map-python-extract.ts
|
|
120928
120929
|
var isPublic = (name) => !name.startsWith("_");
|