@maverickcer/env-cap 0.7.0 → 0.7.1
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/CHANGELOG.md +11 -0
- package/dist/.dts/_ipc/display-path.d.ts.map +1 -1
- package/dist/.dts/_ipc/no-node-fs.d.ts +3 -2
- package/dist/.dts/_ipc/no-node-fs.d.ts.map +1 -1
- package/dist/.dts/_ipc/resolve-tsconfig-paths.d.ts.map +1 -1
- package/dist/.dts/build/index.d.ts +3 -3
- package/dist/{build-WKDIAWF7.js → build-F3RQS7VE.js} +27 -10
- package/dist/build-F3RQS7VE.js.map +1 -0
- package/dist/build.cjs +71 -54
- package/dist/build.cjs.map +1 -1
- package/dist/build.js +70 -53
- package/dist/build.js.map +1 -1
- package/dist/{chunk-KEGYUHBU.js → chunk-QKIQ3LZP.js} +2 -2
- package/dist/cli/index.js +3 -3
- package/dist/eslint-plugin/index.cjs +16 -5
- package/dist/eslint-plugin/index.cjs.map +1 -1
- package/dist/eslint-plugin/index.js +16 -5
- package/dist/eslint-plugin/index.js.map +1 -1
- package/package.json +7 -7
- package/skills/env-cap/SKILL.md +1 -1
- package/skills/env-cap/references/api.md +1 -1
- package/dist/build-WKDIAWF7.js.map +0 -1
- /package/dist/{chunk-KEGYUHBU.js.map → chunk-QKIQ3LZP.js.map} +0 -0
package/dist/build.cjs
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var path = require('path');
|
|
4
4
|
var crypto = require('crypto');
|
|
5
5
|
var module$1 = require('module');
|
|
6
6
|
|
|
7
7
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var path__default = /*#__PURE__*/_interopDefault(path);
|
|
10
10
|
var crypto__default = /*#__PURE__*/_interopDefault(crypto);
|
|
11
11
|
|
|
12
12
|
// node_modules/tsup/assets/cjs_shims.js
|
|
13
13
|
var getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.tagName.toUpperCase() === "SCRIPT" ? document.currentScript.src : new URL("main.js", document.baseURI).href;
|
|
14
14
|
var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
|
|
15
15
|
function displayPath(root, filePath) {
|
|
16
|
-
if (!
|
|
17
|
-
const relative =
|
|
18
|
-
if (relative.startsWith(
|
|
19
|
-
|
|
16
|
+
if (!path__default.default.isAbsolute(filePath)) return filePath.split(path__default.default.sep).join("/");
|
|
17
|
+
const relative = path__default.default.relative(root, filePath);
|
|
18
|
+
if (relative === ".." || relative.startsWith(`..${path__default.default.sep}`) || path__default.default.isAbsolute(relative))
|
|
19
|
+
return filePath;
|
|
20
|
+
return relative.split(path__default.default.sep).join("/");
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
// src/build/source-position.ts
|
|
@@ -76,7 +77,7 @@ async function buildCitationSnapshots(activeContracts, previous, root, readFile)
|
|
|
76
77
|
let acknowledgment;
|
|
77
78
|
let contentHash;
|
|
78
79
|
try {
|
|
79
|
-
const content = await readFile(
|
|
80
|
+
const content = await readFile(path__default.default.resolve(root, position.file));
|
|
80
81
|
contentHash = hashContent(content);
|
|
81
82
|
const baseline = previousBaselines.get(
|
|
82
83
|
`${identity}#${position.file}:${position.line}:${position.column}`
|
|
@@ -270,7 +271,7 @@ async function readEvidenceSnapshot(snapshotPath, fs) {
|
|
|
270
271
|
return { status: "ok", snapshot: parsed };
|
|
271
272
|
}
|
|
272
273
|
async function writeEvidenceSnapshot(snapshotPath, snapshot, fs) {
|
|
273
|
-
await fs.mkdir(
|
|
274
|
+
await fs.mkdir(path__default.default.dirname(snapshotPath), { recursive: true });
|
|
274
275
|
await fs.writeFile(snapshotPath, `${JSON.stringify(snapshot, null, 2)}
|
|
275
276
|
`, "utf8");
|
|
276
277
|
}
|
|
@@ -386,13 +387,13 @@ async function discoverSchemaFiles(options) {
|
|
|
386
387
|
`discoverSchemaFiles: found ${String(included.length)} files matching "include" under ${options.root} -- more than the ${String(MAX_DISCOVERED_SCHEMA_FILES)}-file sanity limit. This almost always means "root" (or "include"/"exclude") resolved more broadly than intended -- e.g. an omitted "root" falling back to an unexpectedly large process.cwd() -- rather than a real project genuinely declaring this many contracts. Narrow "root"/"include"/"exclude" to the intended project boundary.`
|
|
387
388
|
);
|
|
388
389
|
}
|
|
389
|
-
return included.map((file) =>
|
|
390
|
+
return included.map((file) => path__default.default.normalize(file)).sort();
|
|
390
391
|
}
|
|
391
392
|
async function walkDirectory(directory, root, exclude, fs) {
|
|
392
393
|
const entries = await fs.readdir(directory, { withFileTypes: true });
|
|
393
394
|
const results = [];
|
|
394
395
|
for (const entry of entries) {
|
|
395
|
-
const fullPath =
|
|
396
|
+
const fullPath = path__default.default.join(directory, entry.name);
|
|
396
397
|
if (entry.isDirectory()) {
|
|
397
398
|
if (isAlwaysSkippedDirName(entry.name)) continue;
|
|
398
399
|
const relativeDir = `${toPosixRelative(root, fullPath)}/`;
|
|
@@ -407,7 +408,7 @@ async function walkDirectory(directory, root, exclude, fs) {
|
|
|
407
408
|
return results;
|
|
408
409
|
}
|
|
409
410
|
function toPosixRelative(root, target) {
|
|
410
|
-
return
|
|
411
|
+
return path__default.default.relative(root, target).split(path__default.default.sep).join("/");
|
|
411
412
|
}
|
|
412
413
|
function matchesAnyPattern(filePath, patterns) {
|
|
413
414
|
return patterns.some((pattern) => globToRegExp(pattern).test(filePath));
|
|
@@ -1108,11 +1109,11 @@ function donatedTo(variable) {
|
|
|
1108
1109
|
return DONATED.get(variable) ?? /* @__PURE__ */ new Set();
|
|
1109
1110
|
}
|
|
1110
1111
|
function isWithinDirectory(baseDir, targetPath) {
|
|
1111
|
-
const relative =
|
|
1112
|
-
return relative !== ".." && !relative.startsWith(`..${
|
|
1112
|
+
const relative = path__default.default.relative(baseDir, targetPath);
|
|
1113
|
+
return relative !== ".." && !relative.startsWith(`..${path__default.default.sep}`) && !path__default.default.isAbsolute(relative);
|
|
1113
1114
|
}
|
|
1114
1115
|
function resolveWithinRoot(root, location, optionName, functionName) {
|
|
1115
|
-
const resolved =
|
|
1116
|
+
const resolved = path__default.default.resolve(root, location);
|
|
1116
1117
|
if (!isWithinDirectory(root, resolved)) {
|
|
1117
1118
|
return {
|
|
1118
1119
|
ok: false,
|
|
@@ -1135,10 +1136,10 @@ function isRecord2(value) {
|
|
|
1135
1136
|
return typeof value === "object" && value !== null;
|
|
1136
1137
|
}
|
|
1137
1138
|
async function locatePackageManifest(packageName, root, fs) {
|
|
1138
|
-
const req = module$1.createRequire(
|
|
1139
|
+
const req = module$1.createRequire(path__default.default.join(root, "package.json"));
|
|
1139
1140
|
try {
|
|
1140
1141
|
const packageJsonPath = req.resolve(`${packageName}/package.json`);
|
|
1141
|
-
return { packageJsonPath, packageDir:
|
|
1142
|
+
return { packageJsonPath, packageDir: path__default.default.dirname(packageJsonPath) };
|
|
1142
1143
|
} catch {
|
|
1143
1144
|
}
|
|
1144
1145
|
let mainFile;
|
|
@@ -1147,9 +1148,9 @@ async function locatePackageManifest(packageName, root, fs) {
|
|
|
1147
1148
|
} catch {
|
|
1148
1149
|
return void 0;
|
|
1149
1150
|
}
|
|
1150
|
-
let dir =
|
|
1151
|
+
let dir = path__default.default.dirname(mainFile);
|
|
1151
1152
|
for (let i = 0; i < PACKAGE_JSON_ANCESTOR_SEARCH_LIMIT; i++) {
|
|
1152
|
-
const candidate =
|
|
1153
|
+
const candidate = path__default.default.join(dir, "package.json");
|
|
1153
1154
|
try {
|
|
1154
1155
|
const parsed = JSON.parse(await fs.readFile(candidate, "utf8"));
|
|
1155
1156
|
if (isRecord2(parsed) && parsed["name"] === packageName) {
|
|
@@ -1157,7 +1158,7 @@ async function locatePackageManifest(packageName, root, fs) {
|
|
|
1157
1158
|
}
|
|
1158
1159
|
} catch {
|
|
1159
1160
|
}
|
|
1160
|
-
const parent =
|
|
1161
|
+
const parent = path__default.default.dirname(dir);
|
|
1161
1162
|
if (parent === dir) break;
|
|
1162
1163
|
dir = parent;
|
|
1163
1164
|
}
|
|
@@ -1199,7 +1200,7 @@ async function resolveUncached(packageName, root, fs) {
|
|
|
1199
1200
|
reason: `"${packageName}"'s package.json has no "envCap.schema" field (or it is not a string).`
|
|
1200
1201
|
};
|
|
1201
1202
|
}
|
|
1202
|
-
const lexicallyResolved =
|
|
1203
|
+
const lexicallyResolved = path__default.default.resolve(packageDir, declaredField);
|
|
1203
1204
|
if (!isWithinDirectory(packageDir, lexicallyResolved)) {
|
|
1204
1205
|
return {
|
|
1205
1206
|
ok: false,
|
|
@@ -1342,7 +1343,7 @@ function typescriptPath(file, separator) {
|
|
|
1342
1343
|
async function loadTsconfigPaths(product, root, tsconfigOption, fs) {
|
|
1343
1344
|
if (tsconfigOption === false) return { resolution: void 0, warning: void 0 };
|
|
1344
1345
|
const isExplicit = tsconfigOption !== void 0;
|
|
1345
|
-
const configFile =
|
|
1346
|
+
const configFile = path__default.default.resolve(root, tsconfigOption ?? "tsconfig.json");
|
|
1346
1347
|
if (!await fileExists(configFile, fs)) {
|
|
1347
1348
|
if (!isExplicit) return { resolution: void 0, warning: void 0 };
|
|
1348
1349
|
return {
|
|
@@ -1354,10 +1355,19 @@ async function loadTsconfigPaths(product, root, tsconfigOption, fs) {
|
|
|
1354
1355
|
};
|
|
1355
1356
|
}
|
|
1356
1357
|
assertCompilerApi(product, ts);
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
)
|
|
1358
|
+
let text;
|
|
1359
|
+
try {
|
|
1360
|
+
text = await fs.readFile(configFile, "utf8");
|
|
1361
|
+
} catch (error) {
|
|
1362
|
+
return {
|
|
1363
|
+
resolution: void 0,
|
|
1364
|
+
warning: {
|
|
1365
|
+
file: configFile,
|
|
1366
|
+
message: `Could not read "${configFile}": ${error.message}`
|
|
1367
|
+
}
|
|
1368
|
+
};
|
|
1369
|
+
}
|
|
1370
|
+
const readResult = ts.parseConfigFileTextToJson(typescriptPath(configFile, path__default.default.sep), text);
|
|
1361
1371
|
if (readResult.error) {
|
|
1362
1372
|
const detail = ts.flattenDiagnosticMessageText(readResult.error.messageText, ts.sys.newLine);
|
|
1363
1373
|
return {
|
|
@@ -1368,13 +1378,20 @@ async function loadTsconfigPaths(product, root, tsconfigOption, fs) {
|
|
|
1368
1378
|
}
|
|
1369
1379
|
};
|
|
1370
1380
|
}
|
|
1371
|
-
const parsed = ts.parseJsonConfigFileContent(readResult.config, ts.sys,
|
|
1381
|
+
const parsed = ts.parseJsonConfigFileContent(readResult.config, ts.sys, path__default.default.dirname(configFile));
|
|
1382
|
+
const problems = parsed.errors.filter((diagnostic) => diagnostic.code !== 18003);
|
|
1383
|
+
const warning = problems.length === 0 ? void 0 : {
|
|
1384
|
+
file: configFile,
|
|
1385
|
+
message: `"${configFile}" has problems the compiler reported: ${problems.map(
|
|
1386
|
+
(diagnostic) => ts.flattenDiagnosticMessageText(diagnostic.messageText, ts.sys.newLine)
|
|
1387
|
+
).join("; ")}`
|
|
1388
|
+
};
|
|
1372
1389
|
const { paths, baseUrl } = pathMappingOptions(parsed.options);
|
|
1373
1390
|
const hasPaths = paths !== void 0 && Object.keys(paths).length > 0;
|
|
1374
1391
|
if (!hasPaths && baseUrl === void 0) {
|
|
1375
|
-
return { resolution: void 0, warning
|
|
1392
|
+
return { resolution: void 0, warning };
|
|
1376
1393
|
}
|
|
1377
|
-
return { resolution: { compilerOptions: parsed.options, configFile }, warning
|
|
1394
|
+
return { resolution: { compilerOptions: parsed.options, configFile }, warning };
|
|
1378
1395
|
}
|
|
1379
1396
|
function resolveAliasImport(specifier, importingFile, resolution, cache) {
|
|
1380
1397
|
const cacheKey = `${importingFile}\0${specifier}`;
|
|
@@ -1383,8 +1400,8 @@ function resolveAliasImport(specifier, importingFile, resolution, cache) {
|
|
|
1383
1400
|
const resolvedFileName = result.resolvedModule?.resolvedFileName;
|
|
1384
1401
|
let resolved;
|
|
1385
1402
|
if (resolvedFileName) {
|
|
1386
|
-
const normalized =
|
|
1387
|
-
const isInNodeModules = normalized.split(
|
|
1403
|
+
const normalized = path__default.default.normalize(resolvedFileName);
|
|
1404
|
+
const isInNodeModules = normalized.split(path__default.default.sep).includes("node_modules");
|
|
1388
1405
|
const isTsSource = /\.tsx?$/.test(normalized);
|
|
1389
1406
|
if (!isInNodeModules && isTsSource) resolved = normalized;
|
|
1390
1407
|
}
|
|
@@ -1401,12 +1418,12 @@ function loadTsconfigPaths2(root, tsconfigOption, fs) {
|
|
|
1401
1418
|
async function resolveRelativeImport(importingFile, specifier, fs) {
|
|
1402
1419
|
if (!specifier.startsWith("./") && !specifier.startsWith("../")) return void 0;
|
|
1403
1420
|
const withoutExt = specifier.replace(/\.(js|jsx|ts|tsx)$/, "");
|
|
1404
|
-
const base =
|
|
1421
|
+
const base = path__default.default.resolve(path__default.default.dirname(importingFile), withoutExt);
|
|
1405
1422
|
for (const candidate of [
|
|
1406
1423
|
`${base}.ts`,
|
|
1407
1424
|
`${base}.tsx`,
|
|
1408
|
-
|
|
1409
|
-
|
|
1425
|
+
path__default.default.join(base, "index.ts"),
|
|
1426
|
+
path__default.default.join(base, "index.tsx")
|
|
1410
1427
|
]) {
|
|
1411
1428
|
if (await fileExists2(candidate, fs)) return candidate;
|
|
1412
1429
|
}
|
|
@@ -1641,7 +1658,7 @@ async function linkFiles(discoveredFiles, readFile, context, packageOrigins = /*
|
|
|
1641
1658
|
}
|
|
1642
1659
|
function summarizeContract(contract, root) {
|
|
1643
1660
|
return {
|
|
1644
|
-
file:
|
|
1661
|
+
file: path__default.default.relative(root, contract.file),
|
|
1645
1662
|
exportName: contract.exportName,
|
|
1646
1663
|
contractName: contract.contractName,
|
|
1647
1664
|
variableCount: contract.variables.length,
|
|
@@ -2639,7 +2656,7 @@ function discoverValidationContexts(contracts) {
|
|
|
2639
2656
|
}
|
|
2640
2657
|
function renderManifest(contracts, outputFile) {
|
|
2641
2658
|
const sorted = [...contracts].sort((a, b) => a.file.localeCompare(b.file));
|
|
2642
|
-
const outputDir =
|
|
2659
|
+
const outputDir = path__default.default.dirname(outputFile);
|
|
2643
2660
|
const usedNames = /* @__PURE__ */ new Set();
|
|
2644
2661
|
const importLines = [];
|
|
2645
2662
|
const referenceNames = [];
|
|
@@ -2659,7 +2676,7 @@ function renderManifest(contracts, outputFile) {
|
|
|
2659
2676
|
specifier = contract.packageOrigin.packageName;
|
|
2660
2677
|
} else {
|
|
2661
2678
|
const withoutExt = contract.file.replace(/\.tsx?$/, "");
|
|
2662
|
-
specifier =
|
|
2679
|
+
specifier = path__default.default.relative(outputDir, withoutExt).split(path__default.default.sep).join("/");
|
|
2663
2680
|
if (!specifier.startsWith(".")) specifier = `./${specifier}`;
|
|
2664
2681
|
}
|
|
2665
2682
|
const binding = localName === contract.exportName ? contract.exportName : `${contract.exportName} as ${localName}`;
|
|
@@ -2723,11 +2740,11 @@ function computeManifest(root, linkResult, onIncompatibility) {
|
|
|
2723
2740
|
}
|
|
2724
2741
|
async function writeManifest(outputPath, activeContracts, fs) {
|
|
2725
2742
|
const manifestSource = renderManifest(activeContracts, outputPath);
|
|
2726
|
-
await fs.mkdir(
|
|
2743
|
+
await fs.mkdir(path__default.default.dirname(outputPath), { recursive: true });
|
|
2727
2744
|
await fs.writeFile(outputPath, manifestSource, "utf8");
|
|
2728
2745
|
}
|
|
2729
2746
|
async function generateEnvManifest(options) {
|
|
2730
|
-
const root =
|
|
2747
|
+
const root = path__default.default.resolve(options.root ?? process.cwd());
|
|
2731
2748
|
const include = options.include ?? defaultInclude();
|
|
2732
2749
|
const exclude = options.exclude ?? defaultExclude();
|
|
2733
2750
|
const locationResult = resolveWithinRoot(
|
|
@@ -2958,20 +2975,20 @@ async function computeUsage(root, contracts, scanFiles, readFile, context, scann
|
|
|
2958
2975
|
};
|
|
2959
2976
|
const dependencyOwnership = graph.contracts.map((c) => ({
|
|
2960
2977
|
contractName: c.contractName,
|
|
2961
|
-
file:
|
|
2978
|
+
file: path__default.default.relative(root, c.file),
|
|
2962
2979
|
owner: ownerFor(c.file, c.exportName),
|
|
2963
2980
|
variableCount: c.variables.size,
|
|
2964
|
-
consumers: c.consumingFiles.map((f) =>
|
|
2981
|
+
consumers: c.consumingFiles.map((f) => path__default.default.relative(root, f))
|
|
2965
2982
|
}));
|
|
2966
2983
|
const abandonedContracts = findings.abandoned.map((f) => ({
|
|
2967
2984
|
contractName: f.contractName,
|
|
2968
|
-
file:
|
|
2985
|
+
file: path__default.default.relative(root, f.file),
|
|
2969
2986
|
owner: ownerFor(f.file, f.exportName)
|
|
2970
2987
|
}));
|
|
2971
2988
|
const unresolvedConsumers = findings.unresolvedConsumers.map(
|
|
2972
2989
|
(f) => ({
|
|
2973
2990
|
contractName: f.contractName,
|
|
2974
|
-
file:
|
|
2991
|
+
file: path__default.default.relative(root, f.file),
|
|
2975
2992
|
reason: f.reason
|
|
2976
2993
|
})
|
|
2977
2994
|
);
|
|
@@ -3038,11 +3055,11 @@ async function computeUsage(root, contracts, scanFiles, readFile, context, scann
|
|
|
3038
3055
|
}
|
|
3039
3056
|
async function writeUsageReport(reportPath, computed, fs) {
|
|
3040
3057
|
const source = renderUsageReport(computed);
|
|
3041
|
-
await fs.mkdir(
|
|
3058
|
+
await fs.mkdir(path__default.default.dirname(reportPath), { recursive: true });
|
|
3042
3059
|
await fs.writeFile(reportPath, source, "utf8");
|
|
3043
3060
|
}
|
|
3044
3061
|
async function generateUsageReport(options) {
|
|
3045
|
-
const root =
|
|
3062
|
+
const root = path__default.default.resolve(options.root ?? process.cwd());
|
|
3046
3063
|
const include = options.include ?? defaultInclude();
|
|
3047
3064
|
const exclude = options.exclude ?? defaultExclude();
|
|
3048
3065
|
let reportPath;
|
|
@@ -4143,7 +4160,7 @@ async function writeEnvExample(contracts, location, fs, options = {}) {
|
|
|
4143
4160
|
}
|
|
4144
4161
|
if (existingContent === void 0) {
|
|
4145
4162
|
const content2 = renderEnvExample(contracts, []);
|
|
4146
|
-
await fs.mkdir(
|
|
4163
|
+
await fs.mkdir(path__default.default.dirname(location), { recursive: true });
|
|
4147
4164
|
await fs.writeFile(location, content2, "utf8");
|
|
4148
4165
|
return {
|
|
4149
4166
|
writtenPath: location,
|
|
@@ -4168,7 +4185,7 @@ async function writeEnvExample(contracts, location, fs, options = {}) {
|
|
|
4168
4185
|
const content = renderEnvExample(contracts, headerLines);
|
|
4169
4186
|
const writtenPath = onExisting === "overwrite" ? location : `${location}.${Date.now()}`;
|
|
4170
4187
|
const skippedExistingPath = onExisting === "overwrite" ? void 0 : location;
|
|
4171
|
-
await fs.mkdir(
|
|
4188
|
+
await fs.mkdir(path__default.default.dirname(writtenPath), { recursive: true });
|
|
4172
4189
|
await fs.writeFile(writtenPath, content, "utf8");
|
|
4173
4190
|
return { writtenPath, skippedExistingPath, staleVariables, variablesToComment, variablesToAdd };
|
|
4174
4191
|
}
|
|
@@ -4266,7 +4283,7 @@ async function writeDocumentation(docsPath, envExamplePath, root, contracts, con
|
|
|
4266
4283
|
generatedAt,
|
|
4267
4284
|
previousContent
|
|
4268
4285
|
});
|
|
4269
|
-
await fs.mkdir(
|
|
4286
|
+
await fs.mkdir(path__default.default.dirname(docsPath), { recursive: true });
|
|
4270
4287
|
await fs.writeFile(docsPath, docsSource, "utf8");
|
|
4271
4288
|
const envExample = envExamplePath ? (
|
|
4272
4289
|
// `exactOptionalPropertyTypes` rejects an explicit `undefined`, so the key is omitted when unset.
|
|
@@ -4280,7 +4297,7 @@ async function writeDocumentation(docsPath, envExamplePath, root, contracts, con
|
|
|
4280
4297
|
return { envExample };
|
|
4281
4298
|
}
|
|
4282
4299
|
async function generateDocumentation(options) {
|
|
4283
|
-
const root =
|
|
4300
|
+
const root = path__default.default.resolve(options.root ?? process.cwd());
|
|
4284
4301
|
const include = options.include ?? defaultInclude();
|
|
4285
4302
|
const exclude = options.exclude ?? defaultExclude();
|
|
4286
4303
|
const expiringWithinDays = options.expiringWithinDays ?? DEFAULT_EXPIRING_WITHIN_DAYS;
|
|
@@ -4484,12 +4501,12 @@ function buildOwnershipModel(contracts, root) {
|
|
|
4484
4501
|
|
|
4485
4502
|
// src/build/tool-version.ts
|
|
4486
4503
|
function readToolVersion() {
|
|
4487
|
-
return "0.7.
|
|
4504
|
+
return "0.7.1";
|
|
4488
4505
|
}
|
|
4489
4506
|
|
|
4490
4507
|
// src/build/generate-evidence.ts
|
|
4491
4508
|
async function generateEvidenceModel(options) {
|
|
4492
|
-
const root =
|
|
4509
|
+
const root = path__default.default.resolve(options.root ?? process.cwd());
|
|
4493
4510
|
const include = options.include ?? defaultInclude();
|
|
4494
4511
|
const exclude = options.exclude ?? defaultExclude();
|
|
4495
4512
|
const expiringWithinDays = options.expiringWithinDays ?? DEFAULT_EXPIRING_WITHIN_DAYS;
|
|
@@ -4631,10 +4648,10 @@ async function writeEvidenceFingerprint(evidencePath, fingerprint, fs) {
|
|
|
4631
4648
|
`, "utf8");
|
|
4632
4649
|
}
|
|
4633
4650
|
async function getEvidenceModel(options) {
|
|
4634
|
-
const root =
|
|
4651
|
+
const root = path__default.default.resolve(options.root ?? process.cwd());
|
|
4635
4652
|
const include = options.include ?? defaultInclude();
|
|
4636
4653
|
const exclude = options.exclude ?? defaultExclude();
|
|
4637
|
-
const evidencePath =
|
|
4654
|
+
const evidencePath = path__default.default.resolve(root, options.location);
|
|
4638
4655
|
const fingerprintPath = fingerprintPathFor(evidencePath);
|
|
4639
4656
|
const recompute = async (missReason) => ({
|
|
4640
4657
|
evidence: await generateEvidenceModel(options),
|
|
@@ -4700,7 +4717,7 @@ function requestedPass(option) {
|
|
|
4700
4717
|
return option === false ? void 0 : option;
|
|
4701
4718
|
}
|
|
4702
4719
|
async function computeArtifacts(options) {
|
|
4703
|
-
const root =
|
|
4720
|
+
const root = path__default.default.resolve(options.root ?? process.cwd());
|
|
4704
4721
|
const include = options.include ?? defaultInclude();
|
|
4705
4722
|
const exclude = options.exclude ?? defaultExclude();
|
|
4706
4723
|
const manifestOptions = requestedPass(options.manifest);
|
|
@@ -5053,7 +5070,7 @@ function sarifLocations(finding) {
|
|
|
5053
5070
|
function buildSarifLog(findingModel) {
|
|
5054
5071
|
const ruleIds = [...new Set(findingModel.findings.map((f) => f.code))].sort();
|
|
5055
5072
|
return {
|
|
5056
|
-
$schema: "https://
|
|
5073
|
+
$schema: "https://docs.oasis-open.org/sarif/sarif/v2.1.0/errata01/os/schemas/sarif-schema-2.1.0.json",
|
|
5057
5074
|
version: "2.1.0",
|
|
5058
5075
|
runs: [
|
|
5059
5076
|
{
|