@coana-tech/cli 15.2.5 → 15.2.6
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 +15 -4
- package/package.json +1 -1
- package/reachability-analyzers-cli.mjs +69 -19
- 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
|
@@ -250958,11 +250958,16 @@ var MAVEN_PUBLIC_REPOSITORIES = [
|
|
|
250958
250958
|
"https://nexus.bedatadriven.com/content/groups/public/"
|
|
250959
250959
|
];
|
|
250960
250960
|
async function findRepositoriesForMavenPackageAndVersion(groupId, artifactId, version4) {
|
|
250961
|
+
const coords = `${groupId}:${artifactId}:${version4}`;
|
|
250961
250962
|
try {
|
|
250962
250963
|
const url2 = `https://api.deps.dev/v3/systems/maven/packages/${groupId}:${artifactId}/versions/${version4}`;
|
|
250963
250964
|
const registries = (await axios_default.get(url2)).data?.registries;
|
|
250964
|
-
if (registries
|
|
250965
|
-
|
|
250965
|
+
if (registries?.length) return registries;
|
|
250966
|
+
logger.debug(`findRepositoriesForMavenPackageAndVersion: deps.dev returned no registries for ${coords}`);
|
|
250967
|
+
} catch (e) {
|
|
250968
|
+
logger.debug(
|
|
250969
|
+
`findRepositoriesForMavenPackageAndVersion: deps.dev lookup failed for ${coords}: ${e?.message ?? e}`
|
|
250970
|
+
);
|
|
250966
250971
|
}
|
|
250967
250972
|
const availableRepos = [];
|
|
250968
250973
|
await asyncForEach(
|
|
@@ -250979,7 +250984,13 @@ async function findRepositoriesForMavenPackageAndVersion(groupId, artifactId, ve
|
|
|
250979
250984
|
},
|
|
250980
250985
|
4
|
|
250981
250986
|
);
|
|
250982
|
-
|
|
250987
|
+
if (!availableRepos.length) {
|
|
250988
|
+
logger.debug(
|
|
250989
|
+
`findRepositoriesForMavenPackageAndVersion: no public repository (of ${MAVEN_PUBLIC_REPOSITORIES.length} tried) serves ${coords}`
|
|
250990
|
+
);
|
|
250991
|
+
return void 0;
|
|
250992
|
+
}
|
|
250993
|
+
return availableRepos;
|
|
250983
250994
|
}
|
|
250984
250995
|
function getUrlForProject(repository, groupId, artifactId) {
|
|
250985
250996
|
return new URL(`${groupId.replaceAll(".", "/")}/${artifactId}/`, repository).href;
|
|
@@ -252310,7 +252321,7 @@ async function onlineScan(dependencyTree, apiKey, timeout) {
|
|
|
252310
252321
|
}
|
|
252311
252322
|
|
|
252312
252323
|
// dist/version.js
|
|
252313
|
-
var version3 = "15.2.
|
|
252324
|
+
var version3 = "15.2.6";
|
|
252314
252325
|
|
|
252315
252326
|
// dist/cli-core.js
|
|
252316
252327
|
var { mapValues, omit, partition, pickBy: pickBy2 } = import_lodash15.default;
|
package/package.json
CHANGED
|
@@ -88464,10 +88464,16 @@ async function downloadFile(fileUrl, outputFile) {
|
|
|
88464
88464
|
Accept: "*/*"
|
|
88465
88465
|
}
|
|
88466
88466
|
});
|
|
88467
|
-
if (response.status < 200 || response.status >= 300)
|
|
88467
|
+
if (response.status < 200 || response.status >= 300) {
|
|
88468
|
+
logger.debug(`downloadFile: HTTP ${response.status} for ${fileUrl}`);
|
|
88469
|
+
return false;
|
|
88470
|
+
}
|
|
88468
88471
|
await writeFile3(outputFile, Buffer.from(response.data));
|
|
88469
88472
|
return existsSync4(outputFile);
|
|
88470
|
-
} catch {
|
|
88473
|
+
} catch (e) {
|
|
88474
|
+
const err = e;
|
|
88475
|
+
const reason = err?.response?.status ? `HTTP ${err.response.status}` : err?.code ?? err?.message ?? "unknown";
|
|
88476
|
+
logger.debug(`downloadFile: failed for ${fileUrl}: ${reason}`);
|
|
88471
88477
|
return false;
|
|
88472
88478
|
}
|
|
88473
88479
|
}
|
|
@@ -110138,6 +110144,9 @@ async function findLocalRepository() {
|
|
|
110138
110144
|
cmdt`mvn ${getMavenCLIOpts()} help:evaluate -Dexpression=settings.localRepository -q -DforceStdout`
|
|
110139
110145
|
);
|
|
110140
110146
|
} catch (e) {
|
|
110147
|
+
logger.debug(
|
|
110148
|
+
`findLocalRepository: mvn help:evaluate -Dexpression=settings.localRepository failed: ${e?.message ?? e}`
|
|
110149
|
+
);
|
|
110141
110150
|
return void 0;
|
|
110142
110151
|
}
|
|
110143
110152
|
}
|
|
@@ -110151,11 +110160,16 @@ var MAVEN_PUBLIC_REPOSITORIES = [
|
|
|
110151
110160
|
"https://nexus.bedatadriven.com/content/groups/public/"
|
|
110152
110161
|
];
|
|
110153
110162
|
async function findRepositoriesForMavenPackageAndVersion(groupId, artifactId, version3) {
|
|
110163
|
+
const coords = `${groupId}:${artifactId}:${version3}`;
|
|
110154
110164
|
try {
|
|
110155
110165
|
const url2 = `https://api.deps.dev/v3/systems/maven/packages/${groupId}:${artifactId}/versions/${version3}`;
|
|
110156
110166
|
const registries = (await axios_default.get(url2)).data?.registries;
|
|
110157
|
-
if (registries
|
|
110158
|
-
|
|
110167
|
+
if (registries?.length) return registries;
|
|
110168
|
+
logger.debug(`findRepositoriesForMavenPackageAndVersion: deps.dev returned no registries for ${coords}`);
|
|
110169
|
+
} catch (e) {
|
|
110170
|
+
logger.debug(
|
|
110171
|
+
`findRepositoriesForMavenPackageAndVersion: deps.dev lookup failed for ${coords}: ${e?.message ?? e}`
|
|
110172
|
+
);
|
|
110159
110173
|
}
|
|
110160
110174
|
const availableRepos = [];
|
|
110161
110175
|
await asyncForEach(
|
|
@@ -110172,7 +110186,13 @@ async function findRepositoriesForMavenPackageAndVersion(groupId, artifactId, ve
|
|
|
110172
110186
|
},
|
|
110173
110187
|
4
|
|
110174
110188
|
);
|
|
110175
|
-
|
|
110189
|
+
if (!availableRepos.length) {
|
|
110190
|
+
logger.debug(
|
|
110191
|
+
`findRepositoriesForMavenPackageAndVersion: no public repository (of ${MAVEN_PUBLIC_REPOSITORIES.length} tried) serves ${coords}`
|
|
110192
|
+
);
|
|
110193
|
+
return void 0;
|
|
110194
|
+
}
|
|
110195
|
+
return availableRepos;
|
|
110176
110196
|
}
|
|
110177
110197
|
function getUrlForProject(repository, groupId, artifactId) {
|
|
110178
110198
|
return new URL(`${groupId.replaceAll(".", "/")}/${artifactId}/`, repository).href;
|
|
@@ -110217,15 +110237,22 @@ async function findArtifactsForPackageInRemoteRepository(repository, groupId, ar
|
|
|
110217
110237
|
}
|
|
110218
110238
|
}
|
|
110219
110239
|
async function resolveMavenArtifactFromStandardRepositories(groupId, artifactId, type, classifier, version3, dest) {
|
|
110240
|
+
const coords = `${groupId}:${artifactId}:${version3}${classifier ? `:${classifier}` : ""}${type ? `@${type}` : ""}`;
|
|
110220
110241
|
const repositories = await findRepositoriesForMavenPackageAndVersion(groupId, artifactId, version3);
|
|
110221
110242
|
if (!repositories?.length) {
|
|
110243
|
+
logger.debug(`resolveMavenArtifactFromStandardRepositories: no repositories returned for ${coords}`);
|
|
110222
110244
|
return false;
|
|
110223
110245
|
}
|
|
110224
110246
|
for (const repository of repositories) {
|
|
110225
110247
|
const artifactUrl = getUrlForArtifact(repository, groupId, artifactId, type, classifier, version3);
|
|
110226
110248
|
if (!artifactUrl) continue;
|
|
110227
|
-
|
|
110249
|
+
const success = await downloadFile(artifactUrl, dest);
|
|
110250
|
+
if (!success) {
|
|
110251
|
+
logger.debug(`resolveMavenArtifactFromStandardRepositories: download failed for ${coords} from ${artifactUrl}`);
|
|
110252
|
+
}
|
|
110253
|
+
return success;
|
|
110228
110254
|
}
|
|
110255
|
+
logger.debug(`resolveMavenArtifactFromStandardRepositories: no usable artifact URL among repositories for ${coords}`);
|
|
110229
110256
|
return false;
|
|
110230
110257
|
}
|
|
110231
110258
|
|
|
@@ -110531,45 +110558,58 @@ async function convertSocketArtifacts2(rootDir, artifacts, tmpDir) {
|
|
|
110531
110558
|
const mavenInstalled = await isMavenInstalled();
|
|
110532
110559
|
const localRepositories = getLocalRepositoryPaths().filter((repo) => existsSync9(repo.path));
|
|
110533
110560
|
const mavenLocalRepo = await findLocalRepository() ?? resolve10(process.env.HOME ?? "~", ".m2", "repository");
|
|
110534
|
-
async function resolveArtifact(groupId, artifactId, type, classifier, version3, pomFile) {
|
|
110561
|
+
async function resolveArtifact(groupId, artifactId, type, classifier, version3, pomFile, coords) {
|
|
110535
110562
|
for (const repo of localRepositories) {
|
|
110536
110563
|
switch (repo.type) {
|
|
110537
110564
|
case "maven": {
|
|
110538
110565
|
const artifactPath = getPathToArtifact(repo.path, groupId, artifactId, type, classifier, version3);
|
|
110539
110566
|
if (existsSync9(artifactPath))
|
|
110540
|
-
return artifactPath;
|
|
110567
|
+
return { path: artifactPath, source: `local-${repo.type}` };
|
|
110541
110568
|
break;
|
|
110542
110569
|
}
|
|
110543
110570
|
case "gradle": {
|
|
110544
110571
|
const artifactPath = (await getFiles(resolve10(repo.path, groupId, artifactId, version3))).find((file) => basename8(file) === `${artifactId}-${version3}${classifier ? `-${classifier}` : ""}.${type}`);
|
|
110545
110572
|
if (artifactPath)
|
|
110546
|
-
return artifactPath;
|
|
110573
|
+
return { path: artifactPath, source: `local-${repo.type}` };
|
|
110547
110574
|
break;
|
|
110548
110575
|
}
|
|
110549
110576
|
case "sbt": {
|
|
110550
110577
|
const artifactPath = (await getFiles(resolve10(repo.path, groupId, artifactId))).find((file) => basename8(file) === `${artifactId}-${version3}${classifier ? `-${classifier}` : ""}.${type}`);
|
|
110551
110578
|
if (artifactPath)
|
|
110552
|
-
return artifactPath;
|
|
110579
|
+
return { path: artifactPath, source: `local-${repo.type}` };
|
|
110553
110580
|
break;
|
|
110554
110581
|
}
|
|
110555
110582
|
}
|
|
110556
110583
|
}
|
|
110557
110584
|
const artifactFile = getPathToArtifact(tmpDir, groupId, artifactId, type, classifier, version3);
|
|
110558
110585
|
if (existsSync9(artifactFile))
|
|
110559
|
-
return artifactFile;
|
|
110586
|
+
return { path: artifactFile, source: "tmp-preinstall" };
|
|
110560
110587
|
if (mavenInstalled && pomFile) {
|
|
110561
110588
|
try {
|
|
110562
110589
|
const dependencyGetCmd = cmdt`mvn -f=${basename8(resolve10(rootDir, pomFile))} dependency:get -DgroupId=${groupId} -DartifactId=${artifactId} -Dpackaging=${type} -Dclassifier=${classifier} -Dversion=${version3} -Dtransitive=false`;
|
|
110563
|
-
await execNeverFail2(dependencyGetCmd, dirname11(resolve10(rootDir, pomFile)));
|
|
110564
|
-
|
|
110565
|
-
|
|
110566
|
-
|
|
110567
|
-
|
|
110590
|
+
const result = await execNeverFail2(dependencyGetCmd, dirname11(resolve10(rootDir, pomFile)));
|
|
110591
|
+
if (result.error) {
|
|
110592
|
+
const stderrTail = (result.stderr ?? "").trim().split("\n").slice(-3).join(" | ");
|
|
110593
|
+
const reason = stderrTail || result.error.message || "unknown error";
|
|
110594
|
+
logger.debug(`resolveArtifact: mvn dependency:get failed for ${coords}: ${reason}`);
|
|
110595
|
+
} else {
|
|
110596
|
+
const mavenArtifact = getPathToArtifact(mavenLocalRepo, groupId, artifactId, type, classifier, version3);
|
|
110597
|
+
if (existsSync9(mavenArtifact))
|
|
110598
|
+
return { path: mavenArtifact, source: "mvn-dependency-get" };
|
|
110599
|
+
logger.debug(`resolveArtifact: mvn dependency:get succeeded for ${coords} but artifact not found at ${mavenArtifact}`);
|
|
110600
|
+
}
|
|
110601
|
+
} catch (e) {
|
|
110602
|
+
const reason = e?.message ?? String(e);
|
|
110603
|
+
logger.debug(`resolveArtifact: mvn dependency:get threw for ${coords}: ${reason}`);
|
|
110568
110604
|
}
|
|
110605
|
+
} else if (!mavenInstalled) {
|
|
110606
|
+
logger.debug(`resolveArtifact: skipping mvn dependency:get for ${coords} (maven not installed)`);
|
|
110607
|
+
} else if (!pomFile) {
|
|
110608
|
+
logger.debug(`resolveArtifact: skipping mvn dependency:get for ${coords} (no POM file available)`);
|
|
110569
110609
|
}
|
|
110570
110610
|
await mkdir6(dirname11(artifactFile), { recursive: true });
|
|
110571
110611
|
const success = await resolveMavenArtifactFromStandardRepositories(groupId, artifactId, type, classifier, version3, artifactFile);
|
|
110572
|
-
return success ? artifactFile : void 0;
|
|
110612
|
+
return success ? { path: artifactFile, source: "http-fallback" } : void 0;
|
|
110573
110613
|
}
|
|
110574
110614
|
const deps = {};
|
|
110575
110615
|
const depIdToPurl = /* @__PURE__ */ new Map();
|
|
@@ -110579,10 +110619,20 @@ async function convertSocketArtifacts2(rootDir, artifacts, tmpDir) {
|
|
|
110579
110619
|
...artifact.toplevelAncestors?.flatMap((ancestorId) => artifacts.find((a2) => a2.id === ancestorId)?.manifestFiles?.map((m) => m.file) ?? []) ?? []
|
|
110580
110620
|
]);
|
|
110581
110621
|
const pomFile = manifestFilesForArtifact.find((manifestFile) => pomMatcher(basename8(manifestFile)));
|
|
110582
|
-
const
|
|
110622
|
+
const classifier = artifact.qualifiers?.classifier;
|
|
110623
|
+
const type = artifact.qualifiers?.ext;
|
|
110624
|
+
const coords = artifact.namespace && artifact.name && artifact.version ? `${artifact.namespace}:${artifact.name}:${artifact.version}${classifier ? `:${classifier}` : ""}${type ? `@${type}` : ""}` : `<unresolvable>(id=${artifact.id})`;
|
|
110625
|
+
const resolved = artifact.namespace && artifact.name && artifact.version ? await resolveArtifact(artifact.namespace, artifact.name, type, classifier, artifact.version, pomFile, coords) : void 0;
|
|
110626
|
+
if (resolved) {
|
|
110627
|
+
logger.debug(`convertSocketArtifacts: resolved ${coords} via ${resolved.source} -> ${resolved.path}`);
|
|
110628
|
+
} else if (!artifact.namespace || !artifact.name || !artifact.version) {
|
|
110629
|
+
logger.debug(`convertSocketArtifacts: cannot resolve ${coords} (missing namespace/name/version on artifact)`);
|
|
110630
|
+
} else {
|
|
110631
|
+
logger.debug(`convertSocketArtifacts: failed to resolve ${coords} (tried local caches, mvn dependency:get, http)`);
|
|
110632
|
+
}
|
|
110583
110633
|
depIdToPurl.set(artifact.id, getPurlFromSocketFactArtifact(artifact));
|
|
110584
110634
|
deps[artifact.id] = {
|
|
110585
|
-
bin:
|
|
110635
|
+
bin: resolved ? [resolved.path] : void 0
|
|
110586
110636
|
};
|
|
110587
110637
|
}, 4);
|
|
110588
110638
|
return { deps, depIdToPurl };
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|