@socketsecurity/cli-with-sentry 0.15.62 → 0.15.63
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/dist/cli.js +21 -15
- package/dist/cli.js.map +1 -1
- package/dist/constants.js +3 -3
- package/dist/constants.js.map +1 -1
- package/dist/shadow-npm-inject.js +2 -2
- package/dist/shadow-npm-inject.js.map +1 -1
- package/dist/types/commands/fix/fix-branch-helpers.d.mts.map +1 -1
- package/dist/types/commands/fix/npm-fix.d.mts.map +1 -1
- package/dist/types/commands/fix/open-pr.d.mts.map +1 -1
- package/dist/types/commands/fix/pnpm-fix.d.mts.map +1 -1
- package/dist/utils.js +6 -6
- package/dist/utils.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -3918,8 +3918,8 @@ function getActiveBranchesForPackage(ciEnv, partialPurl, openPrs) {
|
|
|
3918
3918
|
if (!ciEnv) {
|
|
3919
3919
|
return [];
|
|
3920
3920
|
}
|
|
3921
|
-
const partialPurlObj = utils.getPurlObject(partialPurl);
|
|
3922
3921
|
const activeBranches = [];
|
|
3922
|
+
const partialPurlObj = utils.getPurlObject(partialPurl);
|
|
3923
3923
|
const branchFullName = getSocketBranchFullNameComponent(partialPurlObj);
|
|
3924
3924
|
const branchPurlType = getSocketBranchPurlTypeComponent(partialPurlObj);
|
|
3925
3925
|
for (const pr of openPrs) {
|
|
@@ -3928,10 +3928,13 @@ function getActiveBranchesForPackage(ciEnv, partialPurl, openPrs) {
|
|
|
3928
3928
|
activeBranches.push(parsedBranch);
|
|
3929
3929
|
}
|
|
3930
3930
|
}
|
|
3931
|
-
if (
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
|
|
3931
|
+
if (debug.isDebug()) {
|
|
3932
|
+
const fullName = packages.resolvePackageName(partialPurlObj);
|
|
3933
|
+
if (activeBranches.length) {
|
|
3934
|
+
debug.debugFn(`found: ${activeBranches.length} active branches for ${fullName}\n`, activeBranches);
|
|
3935
|
+
} else if (openPrs.length) {
|
|
3936
|
+
debug.debugFn(`miss: 0 active branches found for ${fullName}`);
|
|
3937
|
+
}
|
|
3935
3938
|
}
|
|
3936
3939
|
return activeBranches;
|
|
3937
3940
|
}
|
|
@@ -4081,7 +4084,7 @@ async function cleanupOpenPrs(owner, repo, options) {
|
|
|
4081
4084
|
return match;
|
|
4082
4085
|
}));
|
|
4083
4086
|
if (cachesToSave.size) {
|
|
4084
|
-
await Promise.allSettled(
|
|
4087
|
+
await Promise.allSettled(Array.from(cachesToSave).map(({
|
|
4085
4088
|
0: key,
|
|
4086
4089
|
1: data
|
|
4087
4090
|
}) => writeCache(key, data)));
|
|
@@ -4455,7 +4458,7 @@ async function npmFix(pkgEnvDetails, {
|
|
|
4455
4458
|
const pkgJsonPaths = [...workspacePkgJsonPaths,
|
|
4456
4459
|
// Process the workspace root last since it will add an override to package.json.
|
|
4457
4460
|
pkgEnvDetails.editablePkgJson.filename];
|
|
4458
|
-
const sortedInfoEntries =
|
|
4461
|
+
const sortedInfoEntries = Array.from(infoByPartialPurl.entries()).sort((a, b) => sorts.naturalCompare(a[0], b[0]));
|
|
4459
4462
|
const cleanupInfoEntriesLoop = () => {
|
|
4460
4463
|
logger.logger.dedent();
|
|
4461
4464
|
spinner?.dedent();
|
|
@@ -4477,11 +4480,10 @@ async function npmFix(pkgEnvDetails, {
|
|
|
4477
4480
|
const infoEntry = sortedInfoEntries[i];
|
|
4478
4481
|
const partialPurlObj = utils.getPurlObject(infoEntry[0]);
|
|
4479
4482
|
const name = packages.resolvePackageName(partialPurlObj);
|
|
4480
|
-
const infos =
|
|
4483
|
+
const infos = Array.from(infoEntry[1].values());
|
|
4481
4484
|
if (!infos.length) {
|
|
4482
4485
|
continue infoEntriesLoop;
|
|
4483
4486
|
}
|
|
4484
|
-
const activeBranches = getActiveBranchesForPackage(ciEnv, infoEntry[0], openPrs);
|
|
4485
4487
|
logger.logger.log(`Processing vulns for ${name}:`);
|
|
4486
4488
|
logger.logger.indent();
|
|
4487
4489
|
spinner?.indent();
|
|
@@ -4495,6 +4497,7 @@ async function npmFix(pkgEnvDetails, {
|
|
|
4495
4497
|
cleanupInfoEntriesLoop();
|
|
4496
4498
|
continue infoEntriesLoop;
|
|
4497
4499
|
}
|
|
4500
|
+
const activeBranches = getActiveBranchesForPackage(ciEnv, infoEntry[0], openPrs);
|
|
4498
4501
|
const availableVersions = Object.keys(packument.versions);
|
|
4499
4502
|
const warningsForAfter = new Set();
|
|
4500
4503
|
|
|
@@ -4926,6 +4929,9 @@ async function pnpmFix(pkgEnvDetails, {
|
|
|
4926
4929
|
}
|
|
4927
4930
|
};
|
|
4928
4931
|
}
|
|
4932
|
+
if (debug.isDebug()) {
|
|
4933
|
+
debug.debugFn('found: cves for', Array.from(infoByPartialPurl.keys()));
|
|
4934
|
+
}
|
|
4929
4935
|
|
|
4930
4936
|
// Lazily access constants.packumentCache.
|
|
4931
4937
|
const {
|
|
@@ -4935,7 +4941,7 @@ async function pnpmFix(pkgEnvDetails, {
|
|
|
4935
4941
|
const pkgJsonPaths = [...workspacePkgJsonPaths,
|
|
4936
4942
|
// Process the workspace root last since it will add an override to package.json.
|
|
4937
4943
|
pkgEnvDetails.editablePkgJson.filename];
|
|
4938
|
-
const sortedInfoEntries =
|
|
4944
|
+
const sortedInfoEntries = Array.from(infoByPartialPurl.entries()).sort((a, b) => sorts.naturalCompare(a[0], b[0]));
|
|
4939
4945
|
const cleanupInfoEntriesLoop = () => {
|
|
4940
4946
|
logger.logger.dedent();
|
|
4941
4947
|
spinner?.dedent();
|
|
@@ -4957,11 +4963,10 @@ async function pnpmFix(pkgEnvDetails, {
|
|
|
4957
4963
|
const infoEntry = sortedInfoEntries[i];
|
|
4958
4964
|
const partialPurlObj = utils.getPurlObject(infoEntry[0]);
|
|
4959
4965
|
const name = packages.resolvePackageName(partialPurlObj);
|
|
4960
|
-
const infos =
|
|
4966
|
+
const infos = Array.from(infoEntry[1].values());
|
|
4961
4967
|
if (!infos.length) {
|
|
4962
4968
|
continue infoEntriesLoop;
|
|
4963
4969
|
}
|
|
4964
|
-
const activeBranches = getActiveBranchesForPackage(ciEnv, infoEntry[0], openPrs);
|
|
4965
4970
|
logger.logger.log(`Processing vulns for ${name}:`);
|
|
4966
4971
|
logger.logger.indent();
|
|
4967
4972
|
spinner?.indent();
|
|
@@ -4975,6 +4980,7 @@ async function pnpmFix(pkgEnvDetails, {
|
|
|
4975
4980
|
cleanupInfoEntriesLoop();
|
|
4976
4981
|
continue infoEntriesLoop;
|
|
4977
4982
|
}
|
|
4983
|
+
const activeBranches = getActiveBranchesForPackage(ciEnv, infoEntry[0], openPrs);
|
|
4978
4984
|
const availableVersions = Object.keys(packument.versions);
|
|
4979
4985
|
const warningsForAfter = new Set();
|
|
4980
4986
|
|
|
@@ -7878,7 +7884,7 @@ function cleanupQueryStdout(stdout) {
|
|
|
7878
7884
|
names.add(resolvedName);
|
|
7879
7885
|
}
|
|
7880
7886
|
}
|
|
7881
|
-
return JSON.stringify(
|
|
7887
|
+
return JSON.stringify(Array.from(names), null, 2);
|
|
7882
7888
|
}
|
|
7883
7889
|
function parsableToQueryStdout(stdout) {
|
|
7884
7890
|
if (stdout === '') {
|
|
@@ -7888,7 +7894,7 @@ function parsableToQueryStdout(stdout) {
|
|
|
7888
7894
|
// The matchAll regexp looks for a forward (posix) or backward (win32) slash
|
|
7889
7895
|
// and matches one or more non-slashes until the newline.
|
|
7890
7896
|
const names = new Set(stdout.matchAll(/(?<=[/\\])[^/\\]+(?=\n)/g));
|
|
7891
|
-
return JSON.stringify(
|
|
7897
|
+
return JSON.stringify(Array.from(names), null, 2);
|
|
7892
7898
|
}
|
|
7893
7899
|
async function npmQuery(npmExecPath, cwd) {
|
|
7894
7900
|
let stdout = '';
|
|
@@ -14712,5 +14718,5 @@ void (async () => {
|
|
|
14712
14718
|
await utils.captureException(e);
|
|
14713
14719
|
}
|
|
14714
14720
|
})();
|
|
14715
|
-
//# debugId=
|
|
14721
|
+
//# debugId=dab0d87c-3238-422d-976b-390f87d2120a
|
|
14716
14722
|
//# sourceMappingURL=cli.js.map
|