@socketsecurity/cli-with-sentry 0.15.55 → 0.15.56
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/bin/cli.js +2 -2
- package/dist/cli.js +24 -24
- package/dist/cli.js.map +1 -1
- package/dist/constants.js +49 -29
- package/dist/constants.js.map +1 -1
- package/dist/{shadow-bin.js → shadow-npm-bin.js} +6 -6
- package/dist/shadow-npm-bin.js.map +1 -0
- package/dist/{shadow-inject.js → shadow-npm-inject.js} +1 -1
- package/dist/shadow-npm-inject.js.map +1 -0
- package/dist/types/constants.d.mts +9 -5
- package/dist/types/constants.d.mts.map +1 -1
- package/dist/utils.js +5 -5
- package/dist/utils.js.map +1 -1
- package/external/@coana-tech/cli/cli.mjs +122 -7
- package/external/blessed-contrib/lib/layout/grid.js +400 -32
- package/external/blessed-contrib/lib/widget/charts/bar.js +8338 -67
- package/external/blessed-contrib/lib/widget/charts/line.js +17861 -196
- package/external/blessed-contrib/lib/widget/table.js +140 -121
- package/package.json +12 -11
- package/dist/shadow-bin.js.map +0 -1
- package/dist/shadow-inject.js.map +0 -1
- package/external/blessed-contrib/index.js +0 -28
- package/external/blessed-contrib/lib/layout/carousel.js +0 -74
- package/external/blessed-contrib/lib/server-utils.js +0 -73
- package/external/blessed-contrib/lib/utils.js +0 -73
- package/external/blessed-contrib/lib/widget/canvas.js +0 -51
- package/external/blessed-contrib/lib/widget/charts/stacked-bar.js +0 -218
- package/external/blessed-contrib/lib/widget/donut.js +0 -149
- package/external/blessed-contrib/lib/widget/gauge-list.js +0 -106
- package/external/blessed-contrib/lib/widget/gauge.js +0 -125
- package/external/blessed-contrib/lib/widget/lcd.js +0 -451
- package/external/blessed-contrib/lib/widget/log.js +0 -33
- package/external/blessed-contrib/lib/widget/map.js +0 -86
- package/external/blessed-contrib/lib/widget/markdown.js +0 -64
- package/external/blessed-contrib/lib/widget/picture.js +0 -66
- package/external/blessed-contrib/lib/widget/sparkline.js +0 -58
- package/external/blessed-contrib/lib/widget/tree.js +0 -167
package/bin/cli.js
CHANGED
|
@@ -28,8 +28,8 @@ spawn(
|
|
|
28
28
|
...(constants.ENV.INLINED_SOCKET_CLI_SENTRY_BUILD
|
|
29
29
|
? [
|
|
30
30
|
'--require',
|
|
31
|
-
// Lazily access constants.
|
|
32
|
-
constants.
|
|
31
|
+
// Lazily access constants.instrumentWithSentryPath.
|
|
32
|
+
constants.instrumentWithSentryPath,
|
|
33
33
|
]
|
|
34
34
|
: []),
|
|
35
35
|
// Lazily access constants.distCliPath.
|
package/dist/cli.js
CHANGED
|
@@ -12,7 +12,7 @@ var constants = require('./constants.js');
|
|
|
12
12
|
var words = require('../external/@socketsecurity/registry/lib/words');
|
|
13
13
|
var fs$1 = require('node:fs');
|
|
14
14
|
var path = require('node:path');
|
|
15
|
-
var
|
|
15
|
+
var shadowNpmBin = require('./shadow-npm-bin.js');
|
|
16
16
|
var prompts = require('../external/@socketsecurity/registry/lib/prompts');
|
|
17
17
|
var spawn = require('../external/@socketsecurity/registry/lib/spawn');
|
|
18
18
|
var util = require('node:util');
|
|
@@ -25,7 +25,7 @@ var path$1 = require('../external/@socketsecurity/registry/lib/path');
|
|
|
25
25
|
var regexps = require('../external/@socketsecurity/registry/lib/regexps');
|
|
26
26
|
var fs$2 = require('../external/@socketsecurity/registry/lib/fs');
|
|
27
27
|
var strings = require('../external/@socketsecurity/registry/lib/strings');
|
|
28
|
-
var
|
|
28
|
+
var shadowNpmInject = require('./shadow-npm-inject.js');
|
|
29
29
|
var objects = require('../external/@socketsecurity/registry/lib/objects');
|
|
30
30
|
var registryConstants = require('../external/@socketsecurity/registry/lib/constants');
|
|
31
31
|
var require$$7 = require('../external/@socketsecurity/registry/lib/promises');
|
|
@@ -834,7 +834,7 @@ async function runCdxgen(yargvWithYes) {
|
|
|
834
834
|
// Use synp to create a package-lock.json from the yarn.lock,
|
|
835
835
|
// based on the node_modules folder, for a more accurate SBOM.
|
|
836
836
|
try {
|
|
837
|
-
await
|
|
837
|
+
await shadowNpmBin(NPX$1, [...yesArgs,
|
|
838
838
|
// Lazily access constants.ENV.INLINED_SYNP_VERSION.
|
|
839
839
|
`synp@${constants.ENV.INLINED_SYNP_VERSION}`, '--source-file', `./${YARN_LOCK}`]);
|
|
840
840
|
yargv.type = NPM$9;
|
|
@@ -842,7 +842,7 @@ async function runCdxgen(yargvWithYes) {
|
|
|
842
842
|
} catch {}
|
|
843
843
|
}
|
|
844
844
|
}
|
|
845
|
-
await
|
|
845
|
+
await shadowNpmBin(NPX$1, [...yesArgs,
|
|
846
846
|
// Lazily access constants.ENV.INLINED_CYCLONEDX_CDXGEN_VERSION.
|
|
847
847
|
`@cyclonedx/cdxgen@${constants.ENV.INLINED_CYCLONEDX_CDXGEN_VERSION}`, ...argvToArray(yargv)]);
|
|
848
848
|
if (cleanupPackageLock) {
|
|
@@ -4277,7 +4277,7 @@ async function install$1(arb, options) {
|
|
|
4277
4277
|
...options
|
|
4278
4278
|
};
|
|
4279
4279
|
try {
|
|
4280
|
-
const newArb = new
|
|
4280
|
+
const newArb = new shadowNpmInject.Arborist({
|
|
4281
4281
|
path: cwd
|
|
4282
4282
|
});
|
|
4283
4283
|
newArb.idealTree = await arb.buildIdealTree();
|
|
@@ -4317,9 +4317,9 @@ async function npmFix(pkgEnvDetails, {
|
|
|
4317
4317
|
author: gitUser
|
|
4318
4318
|
}) : [];
|
|
4319
4319
|
let count = 0;
|
|
4320
|
-
const arb = new
|
|
4320
|
+
const arb = new shadowNpmInject.Arborist({
|
|
4321
4321
|
path: rootPath,
|
|
4322
|
-
...
|
|
4322
|
+
...shadowNpmInject.SAFE_ARBORIST_REIFY_OPTIONS_OVERRIDES
|
|
4323
4323
|
});
|
|
4324
4324
|
// Calling arb.reify() creates the arb.diff object, nulls-out arb.idealTree,
|
|
4325
4325
|
// and populates arb.actualTree.
|
|
@@ -4328,7 +4328,7 @@ async function npmFix(pkgEnvDetails, {
|
|
|
4328
4328
|
try {
|
|
4329
4329
|
alertsMap = purls.length ? await utils.getAlertsMapFromPurls(purls, getAlertsMapOptions({
|
|
4330
4330
|
limit: Math.max(limit, openPrs.length)
|
|
4331
|
-
})) : await
|
|
4331
|
+
})) : await shadowNpmInject.getAlertsMapFromArborist(arb, getAlertsMapOptions({
|
|
4332
4332
|
limit: Math.max(limit, openPrs.length)
|
|
4333
4333
|
}));
|
|
4334
4334
|
} catch (e) {
|
|
@@ -4425,7 +4425,7 @@ async function npmFix(pkgEnvDetails, {
|
|
|
4425
4425
|
const isWorkspaceRoot = pkgJsonPath === pkgEnvDetails.editablePkgJson.filename;
|
|
4426
4426
|
const workspace = isWorkspaceRoot ? 'root' : path.relative(rootPath, pkgPath);
|
|
4427
4427
|
const branchWorkspace = isCi ? getSocketBranchWorkspaceComponent(workspace) : '';
|
|
4428
|
-
const oldVersions = arrays.arrayUnique(
|
|
4428
|
+
const oldVersions = arrays.arrayUnique(shadowNpmInject.findPackageNodes(actualTree, name).map(n => n.target?.version ?? n.version).filter(Boolean));
|
|
4429
4429
|
if (!oldVersions.length) {
|
|
4430
4430
|
debug.debugFn(`skip: ${name} not found\n`);
|
|
4431
4431
|
// Skip to next package.
|
|
@@ -4450,7 +4450,7 @@ async function npmFix(pkgEnvDetails, {
|
|
|
4450
4450
|
oldVersionsLoop: for (const oldVersion of oldVersions) {
|
|
4451
4451
|
const oldId = `${name}@${oldVersion}`;
|
|
4452
4452
|
const oldPurl = utils.idToPurl(oldId, partialPurlObj.type);
|
|
4453
|
-
const node =
|
|
4453
|
+
const node = shadowNpmInject.findPackageNode(actualTree, name, oldVersion);
|
|
4454
4454
|
if (!node) {
|
|
4455
4455
|
debug.debugFn(`skip: ${oldId} not found`);
|
|
4456
4456
|
continue oldVersionsLoop;
|
|
@@ -4463,7 +4463,7 @@ async function npmFix(pkgEnvDetails, {
|
|
|
4463
4463
|
debug.debugFn(`skip: ${oldId} is >= ${firstPatchedVersionIdentifier}`);
|
|
4464
4464
|
continue infosLoop;
|
|
4465
4465
|
}
|
|
4466
|
-
const newVersion =
|
|
4466
|
+
const newVersion = shadowNpmInject.findBestPatchVersion(node, availableVersions, vulnerableVersionRange);
|
|
4467
4467
|
if (activeBranches.find(b => b.workspace === branchWorkspace && b.newVersion === newVersion)) {
|
|
4468
4468
|
debug.debugFn(`skip: open PR found for ${name}@${newVersion}`);
|
|
4469
4469
|
if (++count >= limit) {
|
|
@@ -4497,8 +4497,8 @@ async function npmFix(pkgEnvDetails, {
|
|
|
4497
4497
|
}
|
|
4498
4498
|
})
|
|
4499
4499
|
};
|
|
4500
|
-
|
|
4501
|
-
|
|
4500
|
+
shadowNpmInject.updateNode(node, newVersion, newVersionPackument);
|
|
4501
|
+
shadowNpmInject.updatePackageJsonFromNode(editablePkgJson,
|
|
4502
4502
|
// eslint-disable-next-line no-await-in-loop
|
|
4503
4503
|
await arb.buildIdealTree(), node, newVersion, rangeStyle);
|
|
4504
4504
|
// eslint-disable-next-line no-await-in-loop
|
|
@@ -4717,9 +4717,9 @@ async function getActualTree(cwd = process.cwd()) {
|
|
|
4717
4717
|
// folders. However, support is iffy resulting in unhappy path errors and hangs.
|
|
4718
4718
|
// So, to avoid the unhappy path, we restrict our usage to --dry-run loading
|
|
4719
4719
|
// of the node_modules folder.
|
|
4720
|
-
const arb = new
|
|
4720
|
+
const arb = new shadowNpmInject.Arborist({
|
|
4721
4721
|
path: cwd,
|
|
4722
|
-
...
|
|
4722
|
+
...shadowNpmInject.SAFE_ARBORIST_REIFY_OPTIONS_OVERRIDES
|
|
4723
4723
|
});
|
|
4724
4724
|
return await arb.loadActual();
|
|
4725
4725
|
}
|
|
@@ -4950,7 +4950,7 @@ async function pnpmFix(pkgEnvDetails, {
|
|
|
4950
4950
|
// Exit early if install fails.
|
|
4951
4951
|
return handleInstallFail();
|
|
4952
4952
|
}
|
|
4953
|
-
const oldVersions = arrays.arrayUnique(
|
|
4953
|
+
const oldVersions = arrays.arrayUnique(shadowNpmInject.findPackageNodes(actualTree, name).map(n => n.version).filter(Boolean));
|
|
4954
4954
|
if (!oldVersions.length) {
|
|
4955
4955
|
debug.debugFn(`skip: ${name} not found\n`);
|
|
4956
4956
|
// Skip to next package.
|
|
@@ -4978,7 +4978,7 @@ async function pnpmFix(pkgEnvDetails, {
|
|
|
4978
4978
|
oldVersionsLoop: for (const oldVersion of oldVersions) {
|
|
4979
4979
|
const oldId = `${name}@${oldVersion}`;
|
|
4980
4980
|
const oldPurl = utils.idToPurl(oldId, partialPurlObj.type);
|
|
4981
|
-
const node =
|
|
4981
|
+
const node = shadowNpmInject.findPackageNode(actualTree, name, oldVersion);
|
|
4982
4982
|
if (!node) {
|
|
4983
4983
|
debug.debugFn(`skip: ${oldId} not found`);
|
|
4984
4984
|
continue oldVersionsLoop;
|
|
@@ -4991,7 +4991,7 @@ async function pnpmFix(pkgEnvDetails, {
|
|
|
4991
4991
|
debug.debugFn(`skip: ${oldId} is >= ${firstPatchedVersionIdentifier}`);
|
|
4992
4992
|
continue infosLoop;
|
|
4993
4993
|
}
|
|
4994
|
-
const newVersion =
|
|
4994
|
+
const newVersion = shadowNpmInject.findBestPatchVersion(node, availableVersions, vulnerableVersionRange);
|
|
4995
4995
|
if (activeBranches.find(b => b.workspace === branchWorkspace && b.newVersion === newVersion)) {
|
|
4996
4996
|
debug.debugFn(`skip: open PR found for ${name}@${newVersion}`);
|
|
4997
4997
|
if (++count >= limit) {
|
|
@@ -5050,7 +5050,7 @@ async function pnpmFix(pkgEnvDetails, {
|
|
|
5050
5050
|
// generates pnpm-lock.yaml it updates transitive dependencies too.
|
|
5051
5051
|
editablePkgJson.update(updateOverrides);
|
|
5052
5052
|
}
|
|
5053
|
-
|
|
5053
|
+
shadowNpmInject.updatePackageJsonFromNode(editablePkgJson, actualTree, node, newVersion, rangeStyle);
|
|
5054
5054
|
// eslint-disable-next-line no-await-in-loop
|
|
5055
5055
|
if (!(await editablePkgJson.save({
|
|
5056
5056
|
ignoreWhitespace: true
|
|
@@ -7511,8 +7511,8 @@ async function run$v(argv, importMeta, {
|
|
|
7511
7511
|
return;
|
|
7512
7512
|
}
|
|
7513
7513
|
|
|
7514
|
-
// Lazily access constants.
|
|
7515
|
-
const shadowBin = require$3(constants.
|
|
7514
|
+
// Lazily access constants.shadowNpmBinPath.
|
|
7515
|
+
const shadowBin = require$3(constants.shadowNpmBinPath);
|
|
7516
7516
|
await shadowBin('npm', argv);
|
|
7517
7517
|
}
|
|
7518
7518
|
|
|
@@ -7551,8 +7551,8 @@ async function run$u(argv, importMeta, {
|
|
|
7551
7551
|
return;
|
|
7552
7552
|
}
|
|
7553
7553
|
|
|
7554
|
-
// Lazily access constants.
|
|
7555
|
-
const shadowBin = require$2(constants.
|
|
7554
|
+
// Lazily access constants.shadowNpmBinPath.
|
|
7555
|
+
const shadowBin = require$2(constants.shadowNpmBinPath);
|
|
7556
7556
|
await shadowBin('npx', argv);
|
|
7557
7557
|
}
|
|
7558
7558
|
|
|
@@ -14619,5 +14619,5 @@ void (async () => {
|
|
|
14619
14619
|
await utils.captureException(e);
|
|
14620
14620
|
}
|
|
14621
14621
|
})();
|
|
14622
|
-
//# debugId=
|
|
14622
|
+
//# debugId=f53da652-ed7e-41d2-baff-cba59a65e6b2
|
|
14623
14623
|
//# sourceMappingURL=cli.js.map
|