@coana-tech/cli 15.2.3 → 15.2.4
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/cli.mjs +98 -71
- package/package.json +1 -1
- package/repos/coana-tech/goana/bin/goana-darwin-amd64.gz +0 -0
- package/repos/coana-tech/goana/bin/goana-darwin-arm64.gz +0 -0
- package/repos/coana-tech/goana/bin/goana-linux-amd64.gz +0 -0
- package/repos/coana-tech/goana/bin/goana-linux-arm64.gz +0 -0
- package/repos/coana-tech/javap-service/javap-service.jar +0 -0
package/cli.mjs
CHANGED
|
@@ -218666,16 +218666,20 @@ var MavenSocketUpgradeManager = class {
|
|
|
218666
218666
|
const targetOutput = (0, import_picomatch3.default)("**/target/**");
|
|
218667
218667
|
const gradleLockfileMatcher = (0, import_picomatch3.default)("gradle.lockfile", { basename: true });
|
|
218668
218668
|
const sbtMatcher = (0, import_picomatch3.default)(["*.sbt", "*.scala"], { basename: true });
|
|
218669
|
+
const allowed = ctxt.allowedPackageManagers;
|
|
218669
218670
|
for (const manifestFile of ctxt.manifestFiles) {
|
|
218670
218671
|
if (pomMatcher(manifestFile) && !buildOutput(manifestFile) && !targetOutput(manifestFile)) {
|
|
218672
|
+
if (allowed && !allowed.includes("MAVEN")) continue;
|
|
218671
218673
|
pomFiles.add(resolve16(this.rootDir, manifestFile));
|
|
218672
218674
|
continue;
|
|
218673
218675
|
}
|
|
218674
218676
|
if (gradleLockfileMatcher(manifestFile)) {
|
|
218677
|
+
if (allowed && !allowed.includes("GRADLE")) continue;
|
|
218675
218678
|
gradleLockfiles.add(resolve16(this.rootDir, manifestFile));
|
|
218676
218679
|
continue;
|
|
218677
218680
|
}
|
|
218678
218681
|
if (pomMatcher(manifestFile) && targetOutput(manifestFile) || sbtMatcher(manifestFile)) {
|
|
218682
|
+
if (allowed && !allowed.includes("SBT")) continue;
|
|
218679
218683
|
sbtManifestFiles.add(resolve16(this.rootDir, manifestFile));
|
|
218680
218684
|
continue;
|
|
218681
218685
|
}
|
|
@@ -219014,7 +219018,6 @@ ${indent(1, indentationSize)}`)}
|
|
|
219014
219018
|
};
|
|
219015
219019
|
|
|
219016
219020
|
// ../fixing-management/src/fixing-management/npm/npm-socket-upgrade-manager.ts
|
|
219017
|
-
import { existsSync as existsSync17 } from "fs";
|
|
219018
219021
|
import { readFile as readFile20 } from "fs/promises";
|
|
219019
219022
|
import assert10 from "node:assert";
|
|
219020
219023
|
import { dirname as dirname14, join as join14, relative as relative10, resolve as resolve24 } from "path";
|
|
@@ -226092,27 +226095,54 @@ async function checkForYarnResolutions(packageJsonPath, fixes) {
|
|
|
226092
226095
|
|
|
226093
226096
|
// ../fixing-management/src/fixing-management/npm/npm-socket-upgrade-manager.ts
|
|
226094
226097
|
import { basename as basename7 } from "node:path";
|
|
226098
|
+
function npmPackageManagerForLockfile(file) {
|
|
226099
|
+
switch (basename7(file)) {
|
|
226100
|
+
case "package-lock.json":
|
|
226101
|
+
return "NPM";
|
|
226102
|
+
case "pnpm-lock.yaml":
|
|
226103
|
+
case "pnpm-lock.yml":
|
|
226104
|
+
return "PNPM";
|
|
226105
|
+
case "yarn.lock":
|
|
226106
|
+
return "YARN";
|
|
226107
|
+
default:
|
|
226108
|
+
return void 0;
|
|
226109
|
+
}
|
|
226110
|
+
}
|
|
226095
226111
|
var NpmSocketUpgradeManager = class {
|
|
226096
226112
|
constructor(rootDir) {
|
|
226097
226113
|
this.rootDir = rootDir;
|
|
226098
226114
|
}
|
|
226099
226115
|
async applySocketArtifactUpgrades(ctxt) {
|
|
226100
|
-
const subprojectToUpgrade = await this.groupUpgradesBySubprojectAndWorkspace(
|
|
226116
|
+
const { subprojectToUpgrade, subprojectToPackageManager, subprojectToLockfileName } = await this.groupUpgradesBySubprojectAndWorkspace(
|
|
226101
226117
|
ctxt.manifestFiles,
|
|
226102
226118
|
Array.from(ctxt.upgrades).map(([idx, upgradeVersion]) => ({
|
|
226103
226119
|
idx,
|
|
226104
226120
|
upgradeVersion
|
|
226105
226121
|
})),
|
|
226106
226122
|
ctxt.artifacts,
|
|
226107
|
-
ctxt.wsFilter
|
|
226123
|
+
ctxt.wsFilter,
|
|
226124
|
+
ctxt.allowedPackageManagers
|
|
226108
226125
|
);
|
|
226109
226126
|
for (const [subprojectDir, workspaceToUpgrade] of subprojectToUpgrade) {
|
|
226110
|
-
const
|
|
226111
|
-
|
|
226112
|
-
|
|
226113
|
-
|
|
226127
|
+
const pm = subprojectToPackageManager.get(subprojectDir);
|
|
226128
|
+
const lockfileName = subprojectToLockfileName.get(subprojectDir);
|
|
226129
|
+
if (!pm || !lockfileName) {
|
|
226130
|
+
ctxt.statusUpdater?.({
|
|
226131
|
+
status: "warn",
|
|
226132
|
+
file: subprojectDir,
|
|
226133
|
+
message: "Skipping upgrade for this directory: no supported lockfile found" + (ctxt.allowedPackageManagers ? ` (after applying --package-managers filter [${ctxt.allowedPackageManagers.join(", ")}])` : ""),
|
|
226134
|
+
artifacts: Array.from(
|
|
226135
|
+
new Set(
|
|
226136
|
+
Array.from(workspaceToUpgrade.values()).flat().map((u8) => u8.idx)
|
|
226137
|
+
)
|
|
226138
|
+
)
|
|
226139
|
+
});
|
|
226140
|
+
continue;
|
|
226141
|
+
}
|
|
226142
|
+
const fixingManager = this.getFixingManagerFromPackageManager(pm, subprojectDir);
|
|
226114
226143
|
await this.applySecurityFixesForSocketArtifacts(
|
|
226115
226144
|
subprojectDir,
|
|
226145
|
+
lockfileName,
|
|
226116
226146
|
fixingManager,
|
|
226117
226147
|
ctxt.artifacts,
|
|
226118
226148
|
workspaceToUpgrade,
|
|
@@ -226120,19 +226150,19 @@ var NpmSocketUpgradeManager = class {
|
|
|
226120
226150
|
);
|
|
226121
226151
|
}
|
|
226122
226152
|
}
|
|
226123
|
-
async groupUpgradesBySubprojectAndWorkspace(manifestFiles, upgrades, artifacts, wsFilter) {
|
|
226153
|
+
async groupUpgradesBySubprojectAndWorkspace(manifestFiles, upgrades, artifacts, wsFilter, allowedPackageManagers) {
|
|
226124
226154
|
const subprojectToUpgrade = /* @__PURE__ */ new Map();
|
|
226155
|
+
const subprojectToPackageManager = /* @__PURE__ */ new Map();
|
|
226156
|
+
const subprojectToLockfileName = /* @__PURE__ */ new Map();
|
|
226125
226157
|
const workspaceToSubproject = /* @__PURE__ */ new Map();
|
|
226126
|
-
const
|
|
226127
|
-
(f5) => ["package-lock.json", "pnpm-lock.yml", "pnpm-lock.yaml", "yarn.lock"].some(
|
|
226128
|
-
(lockFile) => basename7(f5) === lockFile
|
|
226129
|
-
)
|
|
226130
|
-
) ?? [];
|
|
226131
|
-
for (const lockFile of lockFiles) {
|
|
226132
|
-
const subprojectDir = dirname14(lockFile);
|
|
226158
|
+
for (const lockFile of manifestFiles) {
|
|
226133
226159
|
const fileName3 = basename7(lockFile);
|
|
226134
|
-
const
|
|
226135
|
-
|
|
226160
|
+
const pm = npmPackageManagerForLockfile(lockFile);
|
|
226161
|
+
if (!pm) continue;
|
|
226162
|
+
if (allowedPackageManagers && !allowedPackageManagers.includes(pm)) continue;
|
|
226163
|
+
const subprojectDir = dirname14(lockFile);
|
|
226164
|
+
const isPnpmLockFile = pm === "PNPM";
|
|
226165
|
+
const isYarnBerry = pm === "YARN" && await getYarnType(resolve24(this.rootDir, subprojectDir)) === "berry";
|
|
226136
226166
|
let workspaces;
|
|
226137
226167
|
if (isPnpmLockFile) {
|
|
226138
226168
|
workspaces = await getWorkspacePathsFromPnpmLockFile(resolve24(this.rootDir, subprojectDir), true);
|
|
@@ -226146,6 +226176,10 @@ var NpmSocketUpgradeManager = class {
|
|
|
226146
226176
|
}
|
|
226147
226177
|
workspaces = result.workspacePaths;
|
|
226148
226178
|
}
|
|
226179
|
+
if (!subprojectToPackageManager.has(subprojectDir)) {
|
|
226180
|
+
subprojectToPackageManager.set(subprojectDir, pm);
|
|
226181
|
+
subprojectToLockfileName.set(subprojectDir, fileName3);
|
|
226182
|
+
}
|
|
226149
226183
|
for (const workspace of workspaces) {
|
|
226150
226184
|
workspaceToSubproject.set(join14(subprojectDir, workspace), subprojectDir);
|
|
226151
226185
|
}
|
|
@@ -226178,9 +226212,9 @@ var NpmSocketUpgradeManager = class {
|
|
|
226178
226212
|
subprojectToUpgrade.get(subprojectDir)?.get(workspacePath)?.push(upgrade);
|
|
226179
226213
|
}
|
|
226180
226214
|
}
|
|
226181
|
-
return subprojectToUpgrade;
|
|
226215
|
+
return { subprojectToUpgrade, subprojectToPackageManager, subprojectToLockfileName };
|
|
226182
226216
|
}
|
|
226183
|
-
async applySecurityFixesForSocketArtifacts(subprojectDir, fixingManager, artifacts, workspaceToFixes, ctxt) {
|
|
226217
|
+
async applySecurityFixesForSocketArtifacts(subprojectDir, lockfileName, fixingManager, artifacts, workspaceToFixes, ctxt) {
|
|
226184
226218
|
for (const [workspacePath, upgrades] of workspaceToFixes.entries()) {
|
|
226185
226219
|
const upgradesToDirectDependencies = upgrades.filter((upgrade) => artifacts[upgrade.idx].direct);
|
|
226186
226220
|
if (upgradesToDirectDependencies.length === 0) continue;
|
|
@@ -226203,7 +226237,6 @@ var NpmSocketUpgradeManager = class {
|
|
|
226203
226237
|
await applyPatches("NPM", this.rootDir, directPatches, ctxt);
|
|
226204
226238
|
}
|
|
226205
226239
|
}
|
|
226206
|
-
const lockfileName = this.getLockfileName(subprojectDir);
|
|
226207
226240
|
const lockfilePath = join14(subprojectDir, lockfileName);
|
|
226208
226241
|
const allUpgrades = Array.from(workspaceToFixes.values()).flat();
|
|
226209
226242
|
const upgradesTransformed = allUpgrades.map((upgrade) => ({
|
|
@@ -226259,27 +226292,6 @@ var NpmSocketUpgradeManager = class {
|
|
|
226259
226292
|
return new YarnFixingManager(this.rootDir, subprojectPath);
|
|
226260
226293
|
}
|
|
226261
226294
|
}
|
|
226262
|
-
getPackageManagerForDirectory(directory) {
|
|
226263
|
-
const fullPath = resolve24(this.rootDir, directory);
|
|
226264
|
-
if (existsSync17(join14(fullPath, "pnpm-lock.yaml")) || existsSync17(join14(fullPath, "pnpm-lock.yml"))) {
|
|
226265
|
-
return "PNPM";
|
|
226266
|
-
} else if (existsSync17(join14(fullPath, "yarn.lock"))) {
|
|
226267
|
-
return "YARN";
|
|
226268
|
-
} else if (existsSync17(join14(fullPath, "package-lock.json"))) {
|
|
226269
|
-
return "NPM";
|
|
226270
|
-
}
|
|
226271
|
-
throw new Error(
|
|
226272
|
-
`Upgrading packages is currently only supported for NPM projects using a lock file. Failed to find a lock file in ${fullPath}`
|
|
226273
|
-
);
|
|
226274
|
-
}
|
|
226275
|
-
getLockfileName(directory) {
|
|
226276
|
-
const fullPath = resolve24(this.rootDir, directory);
|
|
226277
|
-
if (existsSync17(join14(fullPath, "pnpm-lock.yaml"))) return "pnpm-lock.yaml";
|
|
226278
|
-
if (existsSync17(join14(fullPath, "pnpm-lock.yml"))) return "pnpm-lock.yml";
|
|
226279
|
-
if (existsSync17(join14(fullPath, "yarn.lock"))) return "yarn.lock";
|
|
226280
|
-
if (existsSync17(join14(fullPath, "package-lock.json"))) return "package-lock.json";
|
|
226281
|
-
throw new Error(`No lockfile found in ${fullPath}`);
|
|
226282
|
-
}
|
|
226283
226295
|
async createDirectDependencyPatches(mf, idx, upgradeVersion, ctxt) {
|
|
226284
226296
|
const artifact = ctxt.artifacts[idx];
|
|
226285
226297
|
assert10(artifact.name);
|
|
@@ -226662,7 +226674,7 @@ import { dirname as dirname16, relative as relative12, resolve as resolve26 } fr
|
|
|
226662
226674
|
var import_parse_xml3 = __toESM(require_dist(), 1);
|
|
226663
226675
|
import { readFile as readFile22 } from "node:fs/promises";
|
|
226664
226676
|
import { dirname as dirname15, join as join17, relative as relative11, resolve as resolve25, basename as basename8, extname } from "node:path";
|
|
226665
|
-
import { existsSync as
|
|
226677
|
+
import { existsSync as existsSync17 } from "node:fs";
|
|
226666
226678
|
|
|
226667
226679
|
// ../utils/dist/version-comparison/version-satisfies.js
|
|
226668
226680
|
var import_semver4 = __toESM(require_semver2(), 1);
|
|
@@ -228215,7 +228227,7 @@ async function loadNuGetProject(rootDir, projectFile, validateFile) {
|
|
|
228215
228227
|
}
|
|
228216
228228
|
async function loadNuGetProjectOrTarget(rootDir, projectFile, mainProject, visited, validateFile) {
|
|
228217
228229
|
const validatedProjectPath = validateFile ? validateFile(resolve25(rootDir, projectFile)) : resolve25(rootDir, projectFile);
|
|
228218
|
-
if (!validatedProjectPath || !
|
|
228230
|
+
if (!validatedProjectPath || !existsSync17(validatedProjectPath)) return void 0;
|
|
228219
228231
|
if (visited.has(validatedProjectPath)) return void 0;
|
|
228220
228232
|
visited.set(validatedProjectPath);
|
|
228221
228233
|
const sourceText = await readFile22(validatedProjectPath, "utf-8");
|
|
@@ -228290,7 +228302,7 @@ async function loadNuGetProjectOrTarget(rootDir, projectFile, mainProject, visit
|
|
|
228290
228302
|
}
|
|
228291
228303
|
async function loadPackagesConfig(rootDir, file, validateFile) {
|
|
228292
228304
|
const validatedConfigPath = validateFile(resolve25(rootDir, file));
|
|
228293
|
-
if (!validatedConfigPath || !
|
|
228305
|
+
if (!validatedConfigPath || !existsSync17(validatedConfigPath)) return void 0;
|
|
228294
228306
|
const sourceText = await readFile22(validatedConfigPath, "utf-8");
|
|
228295
228307
|
const configXml = (0, import_parse_xml3.parseXml)(sourceText, { includeOffsets: true });
|
|
228296
228308
|
const packages = extractPackagesFromXml(configXml, sourceText);
|
|
@@ -228420,7 +228432,7 @@ async function handleImportElement(currentProject, importElement, mainProject, v
|
|
|
228420
228432
|
if (!importPath) return;
|
|
228421
228433
|
const resolvedPath = resolve25(dirname15(currentProject.validatedProjectPath), normalizeMSBuildPath(importPath));
|
|
228422
228434
|
const validatedPath = validateFile ? validateFile(resolvedPath) : resolvedPath;
|
|
228423
|
-
if (!validatedPath || !
|
|
228435
|
+
if (!validatedPath || !existsSync17(validatedPath)) return;
|
|
228424
228436
|
const importedProject = await loadNuGetProjectOrTarget(
|
|
228425
228437
|
currentProject.rootDir,
|
|
228426
228438
|
resolvedPath,
|
|
@@ -229827,7 +229839,7 @@ function createPep508VersionPatches(file, idx, requirement, oldVersion, upgradeV
|
|
|
229827
229839
|
}
|
|
229828
229840
|
|
|
229829
229841
|
// ../utils/src/pip-utils.ts
|
|
229830
|
-
import { existsSync as
|
|
229842
|
+
import { existsSync as existsSync18 } from "node:fs";
|
|
229831
229843
|
import { readFile as readFile26 } from "node:fs/promises";
|
|
229832
229844
|
import { dirname as dirname19, resolve as resolve30, relative as relative15 } from "node:path";
|
|
229833
229845
|
import util4 from "node:util";
|
|
@@ -229911,6 +229923,17 @@ var PipSocketUpgradeManager = class {
|
|
|
229911
229923
|
pyprojectTomlMatcher = (0, import_picomatch8.default)("pyproject.toml", { basename: true });
|
|
229912
229924
|
uvLockMatcher = (0, import_picomatch8.default)("uv.lock", { basename: true });
|
|
229913
229925
|
poetryLockMatcher = (0, import_picomatch8.default)("poetry.lock", { basename: true });
|
|
229926
|
+
/**
|
|
229927
|
+
* Drop manifests whose PM is excluded by `--package-managers`. Files with
|
|
229928
|
+
* no clear PM signal (pyproject.toml, uv.lock) are PM-agnostic and always
|
|
229929
|
+
* pass through.
|
|
229930
|
+
*/
|
|
229931
|
+
isManifestAllowed(file, ctxt) {
|
|
229932
|
+
if (!ctxt.allowedPackageManagers) return true;
|
|
229933
|
+
const pms = getPackageManagersForManifestFile(file);
|
|
229934
|
+
if (pms.length === 0) return true;
|
|
229935
|
+
return pms.some((pm) => ctxt.allowedPackageManagers.includes(pm));
|
|
229936
|
+
}
|
|
229914
229937
|
async applySocketArtifactUpgrades(ctxt) {
|
|
229915
229938
|
const patches = [];
|
|
229916
229939
|
const uvLockFilesToValidate = /* @__PURE__ */ new Set();
|
|
@@ -229930,6 +229953,7 @@ var PipSocketUpgradeManager = class {
|
|
|
229930
229953
|
assert13(artifact.version);
|
|
229931
229954
|
const directRequirementsTxts = /* @__PURE__ */ new Set();
|
|
229932
229955
|
for (const mf of artifact.manifestFiles ?? []) {
|
|
229956
|
+
if (!this.isManifestAllowed(mf.file, ctxt)) continue;
|
|
229933
229957
|
if (this.requirementsTxtMatcher(mf.file)) {
|
|
229934
229958
|
if (ctxt.wsFilter && !ctxt.wsFilter(dirname20(mf.file) || ".")) continue;
|
|
229935
229959
|
directRequirementsTxts.add(mf.file);
|
|
@@ -229966,6 +229990,7 @@ var PipSocketUpgradeManager = class {
|
|
|
229966
229990
|
const ancestor = ctxt.artifacts.find((a4) => a4.id === ancestorId);
|
|
229967
229991
|
for (const mf of ancestor?.manifestFiles ?? []) {
|
|
229968
229992
|
if (ctxt.wsFilter && !ctxt.wsFilter(dirname20(mf.file) || ".")) continue;
|
|
229993
|
+
if (!this.isManifestAllowed(mf.file, ctxt)) continue;
|
|
229969
229994
|
if (this.requirementsTxtMatcher(mf.file) && !directRequirementsTxts.has(mf.file)) {
|
|
229970
229995
|
patches.push(...await this.createRequirementsTxtTransitivePatches(mf.file, idx, upgradeVersion, ctxt));
|
|
229971
229996
|
}
|
|
@@ -230556,7 +230581,7 @@ import assert14 from "node:assert";
|
|
|
230556
230581
|
var import_good_enough_parser4 = __toESM(require_cjs(), 1);
|
|
230557
230582
|
init_ruby_lang();
|
|
230558
230583
|
import { resolve as resolve32, dirname as dirname21, relative as relative16 } from "node:path";
|
|
230559
|
-
import { existsSync as
|
|
230584
|
+
import { existsSync as existsSync19, readFileSync as readFileSync5, readdirSync as readdirSync4 } from "node:fs";
|
|
230560
230585
|
init_gemspec_utils();
|
|
230561
230586
|
var booleanQuery2 = import_good_enough_parser4.query.alt(
|
|
230562
230587
|
import_good_enough_parser4.query.sym(/^true|false$/, (ctx, { value: value2, offset }) => {
|
|
@@ -230671,7 +230696,7 @@ var evalGemfileQuery = import_good_enough_parser4.query.sym("eval_gemfile").join
|
|
|
230671
230696
|
if (pathEvaluated === void 0) return ctx;
|
|
230672
230697
|
const rootDir = ctx.gemfile.rootDir;
|
|
230673
230698
|
const file = relative16(rootDir, resolve32(rootDir, dirname21(ctx.gemfile.file), pathEvaluated));
|
|
230674
|
-
if (!
|
|
230699
|
+
if (!existsSync19(resolve32(rootDir, file))) return ctx;
|
|
230675
230700
|
const sourceText = readFileSync5(resolve32(rootDir, file), "utf-8");
|
|
230676
230701
|
const parser2 = import_good_enough_parser4.lang.createLang(lang3);
|
|
230677
230702
|
const cursor = parser2.parse(sourceText);
|
|
@@ -230746,7 +230771,7 @@ var gemspecQuery = import_good_enough_parser4.query.sym("gemspec").opt(
|
|
|
230746
230771
|
ctx.currentGem = void 0;
|
|
230747
230772
|
}
|
|
230748
230773
|
const searchDir = gemspecPath ? resolve32(rootDir, gemfileDir, gemspecPath) : resolve32(rootDir, gemfileDir);
|
|
230749
|
-
if (!
|
|
230774
|
+
if (!existsSync19(searchDir)) return ctx;
|
|
230750
230775
|
let gemspecFiles = [];
|
|
230751
230776
|
try {
|
|
230752
230777
|
const entries = readdirSync4(searchDir);
|
|
@@ -231470,7 +231495,7 @@ async function applySocketUpgrades(ecosystem, rootDir, ctxt) {
|
|
|
231470
231495
|
|
|
231471
231496
|
// dist/cli-apply-fix.js
|
|
231472
231497
|
var import_lodash13 = __toESM(require_lodash(), 1);
|
|
231473
|
-
import { existsSync as
|
|
231498
|
+
import { existsSync as existsSync23 } from "fs";
|
|
231474
231499
|
|
|
231475
231500
|
// ../other-modules-communicator/src/other-modules-communicator.ts
|
|
231476
231501
|
import { execFileSync as execFileSync2 } from "child_process";
|
|
@@ -231487,7 +231512,7 @@ import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
|
231487
231512
|
// ../utils/dist/file-utils.js
|
|
231488
231513
|
var import_lodash7 = __toESM(require_lodash(), 1);
|
|
231489
231514
|
var import_micromatch2 = __toESM(require_micromatch(), 1);
|
|
231490
|
-
import { existsSync as
|
|
231515
|
+
import { existsSync as existsSync20 } from "fs";
|
|
231491
231516
|
import { access as access4, cp as cp3, readdir as readdir4, stat as stat4 } from "fs/promises";
|
|
231492
231517
|
import { basename as basename9, join as join19, relative as relative18, resolve as resolve34 } from "path";
|
|
231493
231518
|
var { uniq: uniq2 } = import_lodash7.default;
|
|
@@ -231927,7 +231952,7 @@ async function detectVariantMaven(projectDir) {
|
|
|
231927
231952
|
}
|
|
231928
231953
|
|
|
231929
231954
|
// ../docker-management/src/maven/gradle-version-detector.ts
|
|
231930
|
-
import { existsSync as
|
|
231955
|
+
import { existsSync as existsSync21 } from "fs";
|
|
231931
231956
|
import { join as join22 } from "path";
|
|
231932
231957
|
import { readFile as readFile30 } from "fs/promises";
|
|
231933
231958
|
async function detectVariantGradle(projectDir) {
|
|
@@ -231935,7 +231960,7 @@ async function detectVariantGradle(projectDir) {
|
|
|
231935
231960
|
}
|
|
231936
231961
|
async function detect(projectDir) {
|
|
231937
231962
|
const gradleWrapperPropertiesPath = join22(projectDir, "gradle", "wrapper", "gradle-wrapper.properties");
|
|
231938
|
-
const gradleWrapperProperties =
|
|
231963
|
+
const gradleWrapperProperties = existsSync21(gradleWrapperPropertiesPath) ? (await readFile30(gradleWrapperPropertiesPath, "utf-8")).split("\n").map((line) => line.trim()).filter((line) => !line.startsWith("#")).filter((line) => line) : void 0;
|
|
231939
231964
|
if (!gradleWrapperProperties) return void 0;
|
|
231940
231965
|
const distributionUrlRegex = /.*gradle-(\d+(\.\d+(\.\d+)?)?)/;
|
|
231941
231966
|
for (const prop2 of gradleWrapperProperties) {
|
|
@@ -231949,7 +231974,7 @@ async function detect(projectDir) {
|
|
|
231949
231974
|
}
|
|
231950
231975
|
|
|
231951
231976
|
// ../docker-management/src/maven/sbt-version-detector.ts
|
|
231952
|
-
import { existsSync as
|
|
231977
|
+
import { existsSync as existsSync22 } from "fs";
|
|
231953
231978
|
import { join as join23 } from "path";
|
|
231954
231979
|
import { readFile as readFile31 } from "fs/promises";
|
|
231955
231980
|
async function detectVariantSbt(projectDir) {
|
|
@@ -231957,7 +231982,7 @@ async function detectVariantSbt(projectDir) {
|
|
|
231957
231982
|
}
|
|
231958
231983
|
async function detect2(projectDir) {
|
|
231959
231984
|
const sbtBuildPropertiesPath = join23(projectDir, "project", "build.properties");
|
|
231960
|
-
const sbtBuildProperties =
|
|
231985
|
+
const sbtBuildProperties = existsSync22(sbtBuildPropertiesPath) ? (await readFile31(sbtBuildPropertiesPath, "utf-8")).split("\n").map((line) => line.trim()).filter((line) => !line.startsWith("#")).filter((line) => line) : void 0;
|
|
231961
231986
|
if (!sbtBuildProperties) return void 0;
|
|
231962
231987
|
for (const prop2 of sbtBuildProperties) {
|
|
231963
231988
|
const [key, value2] = prop2.split("=");
|
|
@@ -233263,7 +233288,7 @@ async function verifyFixes(fixes, otherModulesCommunicator, rootPath) {
|
|
|
233263
233288
|
if (pathsForEachFixIdData.length !== new Set(pathsForEachFixIdData).size) {
|
|
233264
233289
|
throw new Error("Multiple fix IDs found for the same subproject, workspace and ecosystem");
|
|
233265
233290
|
}
|
|
233266
|
-
const subprojectsNotFound = uniq3(fixes.filter(({ vulnerabilityInstance: v }) => !
|
|
233291
|
+
const subprojectsNotFound = uniq3(fixes.filter(({ vulnerabilityInstance: v }) => !existsSync23(resolve37(rootPath, v.subprojectPath))).map(({ vulnerabilityInstance: v }) => `${v.subprojectPath}:${v.ecosystem}`));
|
|
233267
233292
|
if (subprojectsNotFound.length > 0) {
|
|
233268
233293
|
throw new Error(`Cannot find the following subprojects: ${subprojectsNotFound.join(", ")}`);
|
|
233269
233294
|
}
|
|
@@ -234089,7 +234114,7 @@ import { readdir as readdir6 } from "fs/promises";
|
|
|
234089
234114
|
import { join as join28, relative as relative21, resolve as resolve38 } from "path";
|
|
234090
234115
|
|
|
234091
234116
|
// ../project-management/src/project-management/ecosystem-management/ecosystem-specs.ts
|
|
234092
|
-
import { existsSync as
|
|
234117
|
+
import { existsSync as existsSync24 } from "fs";
|
|
234093
234118
|
import { readdir as readdir5, readFile as readFile33 } from "fs/promises";
|
|
234094
234119
|
import { join as join27, sep as sep4 } from "path";
|
|
234095
234120
|
var specs = {
|
|
@@ -234166,7 +234191,7 @@ function getEcosystemSpecs(ecosystems) {
|
|
|
234166
234191
|
}
|
|
234167
234192
|
function packageManagerIfPackageJSONExistsAndValid(packageManager) {
|
|
234168
234193
|
return async (projectDir) => {
|
|
234169
|
-
if (!
|
|
234194
|
+
if (!existsSync24(join27(projectDir, "package.json"))) return void 0;
|
|
234170
234195
|
const packageJSONPath = join27(projectDir, "package.json");
|
|
234171
234196
|
try {
|
|
234172
234197
|
JSON.parse(await readFile33(packageJSONPath, "utf-8"));
|
|
@@ -234764,7 +234789,8 @@ ${Array.from(upgrades).map(([idx, upgradeVersion]) => ` ${prettyPrintPurlUpgrade
|
|
|
234764
234789
|
wsFilter: (0, import_picomatch10.default)(options.include?.map((s6) => (s6 || ".").replace(/\/+$/, "") || ".") ?? [".", "**"], {
|
|
234765
234790
|
ignore: options.exclude?.map((s6) => (s6 || ".").replace(/\/+$/, "") || ".")
|
|
234766
234791
|
}),
|
|
234767
|
-
statusUpdater
|
|
234792
|
+
statusUpdater,
|
|
234793
|
+
allowedPackageManagers: options.packageManagers
|
|
234768
234794
|
};
|
|
234769
234795
|
try {
|
|
234770
234796
|
await applySocketUpgrades(ecosystem, rootDir, ctxt);
|
|
@@ -234973,7 +234999,8 @@ async function computeFixesAndUpgradePurls(path9, options, logFile) {
|
|
|
234973
234999
|
include: options.include,
|
|
234974
235000
|
exclude: options.exclude,
|
|
234975
235001
|
rangeStyle: options.rangeStyle,
|
|
234976
|
-
disableExternalToolChecks: options.disableExternalToolChecks
|
|
235002
|
+
disableExternalToolChecks: options.disableExternalToolChecks,
|
|
235003
|
+
packageManagers: options.packageManagers
|
|
234977
235004
|
}, autofixRunId) ?? "fixed-all";
|
|
234978
235005
|
if (autofixRunId) {
|
|
234979
235006
|
const allGhsasFailed = ghsasWithFixes.length === 0;
|
|
@@ -235258,7 +235285,7 @@ function prettyApplyFixesTo(applyFixesToOption) {
|
|
|
235258
235285
|
|
|
235259
235286
|
// dist/cli-core.js
|
|
235260
235287
|
import assert16 from "node:assert";
|
|
235261
|
-
import { existsSync as
|
|
235288
|
+
import { existsSync as existsSync29, writeFileSync as writeFileSync3 } from "fs";
|
|
235262
235289
|
import { mkdir as mkdir6, rm as rm3, writeFile as writeFile15 } from "fs/promises";
|
|
235263
235290
|
var import_lodash15 = __toESM(require_lodash(), 1);
|
|
235264
235291
|
import os2 from "os";
|
|
@@ -235516,7 +235543,7 @@ var BatchedHttpLogStreamer = class {
|
|
|
235516
235543
|
// ../utils/src/logging/socket-log-server.ts
|
|
235517
235544
|
import { createServer } from "net";
|
|
235518
235545
|
import { once as once8 } from "events";
|
|
235519
|
-
import { createWriteStream as createWriteStream6, existsSync as
|
|
235546
|
+
import { createWriteStream as createWriteStream6, existsSync as existsSync25 } from "fs";
|
|
235520
235547
|
import { unlink as unlink3 } from "fs/promises";
|
|
235521
235548
|
var SocketLogServer = class {
|
|
235522
235549
|
server;
|
|
@@ -235537,7 +235564,7 @@ var SocketLogServer = class {
|
|
|
235537
235564
|
this.server = createServer((socket) => this.handleConnection(socket));
|
|
235538
235565
|
}
|
|
235539
235566
|
async start() {
|
|
235540
|
-
if (
|
|
235567
|
+
if (existsSync25(this.socketPath)) {
|
|
235541
235568
|
await unlink3(this.socketPath);
|
|
235542
235569
|
}
|
|
235543
235570
|
this.server.listen(this.socketPath);
|
|
@@ -235659,7 +235686,7 @@ var SocketLogServer = class {
|
|
|
235659
235686
|
return new Promise((resolve45, reject) => {
|
|
235660
235687
|
this.server.close((serverError) => {
|
|
235661
235688
|
this.writeStream.end(() => {
|
|
235662
|
-
if (
|
|
235689
|
+
if (existsSync25(this.socketPath)) {
|
|
235663
235690
|
unlink3(this.socketPath).then(() => {
|
|
235664
235691
|
if (serverError) reject(serverError);
|
|
235665
235692
|
else resolve45();
|
|
@@ -236121,16 +236148,16 @@ function nextParent(dir) {
|
|
|
236121
236148
|
var DEFAULT_REPORT_FILENAME_BASE = "coana-report";
|
|
236122
236149
|
|
|
236123
236150
|
// dist/internal/exclude-dirs-from-configuration-files.js
|
|
236124
|
-
import { existsSync as
|
|
236151
|
+
import { existsSync as existsSync26 } from "fs";
|
|
236125
236152
|
import { readFile as readFile35 } from "fs/promises";
|
|
236126
236153
|
import { basename as basename12, resolve as resolve41 } from "path";
|
|
236127
236154
|
var import_yaml2 = __toESM(require_dist11(), 1);
|
|
236128
236155
|
async function inferExcludeDirsFromConfigurationFiles(rootWorkingDir) {
|
|
236129
236156
|
const socketYmlConfigFile = resolve41(rootWorkingDir, "socket.yml");
|
|
236130
|
-
if (
|
|
236157
|
+
if (existsSync26(socketYmlConfigFile))
|
|
236131
236158
|
return inferExcludeDirsFromSocketConfig(socketYmlConfigFile);
|
|
236132
236159
|
const socketYamlConfigFile = resolve41(rootWorkingDir, "socket.yaml");
|
|
236133
|
-
if (
|
|
236160
|
+
if (existsSync26(socketYamlConfigFile))
|
|
236134
236161
|
return inferExcludeDirsFromSocketConfig(socketYamlConfigFile);
|
|
236135
236162
|
return void 0;
|
|
236136
236163
|
}
|
|
@@ -250910,11 +250937,11 @@ var { root: root2 } = static_exports;
|
|
|
250910
250937
|
|
|
250911
250938
|
// ../utils/src/maven-utils.ts
|
|
250912
250939
|
var import_lodash14 = __toESM(require_lodash(), 1);
|
|
250913
|
-
import { existsSync as
|
|
250940
|
+
import { existsSync as existsSync28, readdirSync as readdirSync5, statSync as statSync5 } from "fs";
|
|
250914
250941
|
import { join as join32 } from "path";
|
|
250915
250942
|
|
|
250916
250943
|
// ../utils/src/download-utils.ts
|
|
250917
|
-
import { existsSync as
|
|
250944
|
+
import { existsSync as existsSync27 } from "fs";
|
|
250918
250945
|
import { writeFile as writeFile14 } from "fs/promises";
|
|
250919
250946
|
|
|
250920
250947
|
// ../utils/src/maven-utils.ts
|
|
@@ -252282,7 +252309,7 @@ async function onlineScan(dependencyTree, apiKey, timeout) {
|
|
|
252282
252309
|
}
|
|
252283
252310
|
|
|
252284
252311
|
// dist/version.js
|
|
252285
|
-
var version3 = "15.2.
|
|
252312
|
+
var version3 = "15.2.4";
|
|
252286
252313
|
|
|
252287
252314
|
// dist/cli-core.js
|
|
252288
252315
|
var { mapValues, omit, partition, pickBy: pickBy2 } = import_lodash15.default;
|
|
@@ -252985,7 +253012,7 @@ Subproject: ${subproject}`);
|
|
|
252985
253012
|
const concurrency = Number(this.options.concurrency);
|
|
252986
253013
|
const shouldIncludeWorkspaceInLogs = concurrency > 1;
|
|
252987
253014
|
let npmProjectDirPool;
|
|
252988
|
-
const nodeModulesExists =
|
|
253015
|
+
const nodeModulesExists = existsSync29(resolve42(subprojectPath, "node_modules"));
|
|
252989
253016
|
if (ecosystem === "NPM" && concurrency > 1 && !nodeModulesExists) {
|
|
252990
253017
|
const numCopies = Math.min(concurrency, workspaces.length) - 1;
|
|
252991
253018
|
if (numCopies > 0) {
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|