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