socket 1.1.13 → 1.1.14
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/CHANGELOG.md +5 -0
- package/dist/cli.js +50 -58
- package/dist/cli.js.map +1 -1
- package/dist/constants.js +107 -5
- package/dist/constants.js.map +1 -1
- package/dist/flags.js.map +1 -1
- package/dist/npm-cli.js +3 -2
- package/dist/npm-cli.js.map +1 -1
- package/dist/shadow-npm-inject.js.map +1 -1
- package/dist/tsconfig.dts.tsbuildinfo +1 -1
- package/dist/types/commands/fix/cmd-fix.d.mts.map +1 -1
- package/dist/types/commands/fix/coana-fix.d.mts.map +1 -1
- package/dist/types/commands/fix/git.d.mts +1 -1
- package/dist/types/commands/fix/git.d.mts.map +1 -1
- package/dist/types/commands/fix/handle-fix.d.mts +2 -1
- package/dist/types/commands/fix/handle-fix.d.mts.map +1 -1
- package/dist/types/commands/fix/pull-request.d.mts +1 -1
- package/dist/types/commands/fix/pull-request.d.mts.map +1 -1
- package/dist/types/commands/fix/types.d.mts +1 -0
- package/dist/types/commands/fix/types.d.mts.map +1 -1
- package/dist/types/commands/login/apply-login.d.mts.map +1 -1
- package/dist/types/commands/login/attempt-login.d.mts.map +1 -1
- package/dist/types/commands/logout/apply-logout.d.mts.map +1 -1
- package/dist/types/commands/manifest/run-cdxgen.d.mts.map +1 -1
- package/dist/types/commands/scan/perform-reachability-analysis.d.mts.map +1 -1
- package/dist/types/constants.d.mts +74 -6
- package/dist/types/constants.d.mts.map +1 -1
- package/dist/types/flags.d.mts +1 -1
- package/dist/types/flags.d.mts.map +1 -1
- package/dist/types/shadow/npm/arborist/types.d.mts +10 -10
- package/dist/types/shadow/npm/arborist/types.d.mts.map +1 -1
- package/dist/types/types.d.mts +4 -4
- package/dist/types/types.d.mts.map +1 -1
- package/dist/types/utils/alert/artifact.d.mts +1 -1
- package/dist/types/utils/alert/artifact.d.mts.map +1 -1
- package/dist/types/utils/api.d.mts +2 -2
- package/dist/types/utils/api.d.mts.map +1 -1
- package/dist/types/utils/coana.d.mts +0 -4
- package/dist/types/utils/coana.d.mts.map +1 -1
- package/dist/types/utils/config.d.mts +4 -3
- package/dist/types/utils/config.d.mts.map +1 -1
- package/dist/types/utils/determine-org-slug.d.mts.map +1 -1
- package/dist/types/utils/dlx.d.mts +33 -0
- package/dist/types/utils/dlx.d.mts.map +1 -0
- package/dist/types/utils/errors.d.mts +1 -1
- package/dist/types/utils/errors.d.mts.map +1 -1
- package/dist/types/utils/github.d.mts +3 -3
- package/dist/types/utils/github.d.mts.map +1 -1
- package/dist/types/utils/glob.d.mts.map +1 -1
- package/dist/types/utils/meow-with-subcommands.d.mts +1 -1
- package/dist/types/utils/meow-with-subcommands.d.mts.map +1 -1
- package/dist/types/utils/package-environment.d.mts.map +1 -1
- package/dist/types/utils/sdk.d.mts.map +1 -1
- package/dist/types/utils/socket-json.d.mts +27 -27
- package/dist/types/utils/socket-json.d.mts.map +1 -1
- package/dist/utils.js +283 -140
- package/dist/utils.js.map +1 -1
- package/dist/vendor.js +235 -235
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
|
|
|
4
4
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
6
6
|
|
|
7
|
+
## [1.1.14](https://github.com/SocketDev/socket-cli/releases/tag/v1.1.14) - 2025-09-17
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
- Enhanced 3rd-party on-demand download and execution
|
|
11
|
+
|
|
7
12
|
## [1.1.13](https://github.com/SocketDev/socket-cli/releases/tag/v1.1.13) - 2025-09-16
|
|
8
13
|
|
|
9
14
|
### Added
|
package/dist/cli.js
CHANGED
|
@@ -19,7 +19,6 @@ var spawn = require('../external/@socketsecurity/registry/lib/spawn');
|
|
|
19
19
|
var fs$2 = require('../external/@socketsecurity/registry/lib/fs');
|
|
20
20
|
var strings = require('../external/@socketsecurity/registry/lib/strings');
|
|
21
21
|
var path$1 = require('../external/@socketsecurity/registry/lib/path');
|
|
22
|
-
var shadowNpmBin = require('./shadow-npm-bin.js');
|
|
23
22
|
var require$$11 = require('../external/@socketsecurity/registry/lib/objects');
|
|
24
23
|
var registry = require('../external/@socketsecurity/registry');
|
|
25
24
|
var packages = require('../external/@socketsecurity/registry/lib/packages');
|
|
@@ -68,7 +67,7 @@ async function fetchRepoAnalyticsData(repo, time, options) {
|
|
|
68
67
|
|
|
69
68
|
// Note: Widgets does not seem to actually work as code :'(
|
|
70
69
|
|
|
71
|
-
const require$
|
|
70
|
+
const require$7 = require$$5.createRequire((typeof document === 'undefined' ? require$$0.pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli.js', document.baseURI).href)));
|
|
72
71
|
const METRICS = ['total_critical_alerts', 'total_high_alerts', 'total_medium_alerts', 'total_low_alerts', 'total_critical_added', 'total_medium_added', 'total_low_added', 'total_high_added', 'total_critical_prevented', 'total_high_prevented', 'total_medium_prevented', 'total_low_prevented'];
|
|
73
72
|
|
|
74
73
|
// Note: This maps `new Date(date).getMonth()` to English three letters
|
|
@@ -147,11 +146,11 @@ ${utils.mdTableStringNumber('Name', 'Counts', data['top_five_alert_types'])}
|
|
|
147
146
|
`.trim() + '\n';
|
|
148
147
|
}
|
|
149
148
|
function displayAnalyticsScreen(data) {
|
|
150
|
-
const ScreenWidget = /*@__PURE__*/require$
|
|
149
|
+
const ScreenWidget = /*@__PURE__*/require$7('../external/blessed/lib/widgets/screen.js');
|
|
151
150
|
const screen = new ScreenWidget({
|
|
152
151
|
...constants.default.blessedOptions
|
|
153
152
|
});
|
|
154
|
-
const GridLayout = /*@__PURE__*/require$
|
|
153
|
+
const GridLayout = /*@__PURE__*/require$7('../external/blessed-contrib/lib/layout/grid.js');
|
|
155
154
|
const grid = new GridLayout({
|
|
156
155
|
rows: 5,
|
|
157
156
|
cols: 4,
|
|
@@ -165,7 +164,7 @@ function displayAnalyticsScreen(data) {
|
|
|
165
164
|
renderLineCharts(grid, screen, 'Total high alerts prevented from the main branch', [2, 2, 1, 2], data['total_high_prevented']);
|
|
166
165
|
renderLineCharts(grid, screen, 'Total medium alerts prevented from the main branch', [3, 0, 1, 2], data['total_medium_prevented']);
|
|
167
166
|
renderLineCharts(grid, screen, 'Total low alerts prevented from the main branch', [3, 2, 1, 2], data['total_low_prevented']);
|
|
168
|
-
const BarChart = /*@__PURE__*/require$
|
|
167
|
+
const BarChart = /*@__PURE__*/require$7('../external/blessed-contrib/lib/widget/charts/bar.js');
|
|
169
168
|
const bar = grid.set(4, 0, 1, 2, BarChart, {
|
|
170
169
|
label: 'Top 5 alert types',
|
|
171
170
|
barWidth: 10,
|
|
@@ -265,7 +264,7 @@ function formatDate(date) {
|
|
|
265
264
|
return `${Months[new Date(date).getMonth()]} ${new Date(date).getDate()}`;
|
|
266
265
|
}
|
|
267
266
|
function renderLineCharts(grid, screen, title, coords, data) {
|
|
268
|
-
const LineChart = /*@__PURE__*/require$
|
|
267
|
+
const LineChart = /*@__PURE__*/require$7('../external/blessed-contrib/lib/widget/charts/line.js');
|
|
269
268
|
const line = grid.set(...coords, LineChart, {
|
|
270
269
|
style: {
|
|
271
270
|
line: 'cyan',
|
|
@@ -500,7 +499,7 @@ async function fetchAuditLog(config, options) {
|
|
|
500
499
|
});
|
|
501
500
|
}
|
|
502
501
|
|
|
503
|
-
const require$
|
|
502
|
+
const require$6 = require$$5.createRequire((typeof document === 'undefined' ? require$$0.pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli.js', document.baseURI).href)));
|
|
504
503
|
async function outputAuditLog(result, {
|
|
505
504
|
logType,
|
|
506
505
|
orgSlug,
|
|
@@ -628,7 +627,7 @@ async function outputWithBlessed(data, orgSlug) {
|
|
|
628
627
|
const headers = [' Event id', ' Created at', ' Event type', ' User email', ' IP address', ' User agent'];
|
|
629
628
|
|
|
630
629
|
// Note: this temporarily takes over the terminal (just like `man` does).
|
|
631
|
-
const ScreenWidget = /*@__PURE__*/require$
|
|
630
|
+
const ScreenWidget = /*@__PURE__*/require$6('../external/blessed/lib/widgets/screen.js');
|
|
632
631
|
const screen = new ScreenWidget({
|
|
633
632
|
...constants.default.blessedOptions
|
|
634
633
|
});
|
|
@@ -637,7 +636,7 @@ async function outputWithBlessed(data, orgSlug) {
|
|
|
637
636
|
// node process just to exit it. That's very bad UX.
|
|
638
637
|
// eslint-disable-next-line n/no-process-exit
|
|
639
638
|
screen.key(['escape', 'q', 'C-c'], () => process.exit(0));
|
|
640
|
-
const TableWidget = /*@__PURE__*/require$
|
|
639
|
+
const TableWidget = /*@__PURE__*/require$6('../external/blessed-contrib/lib/widget/table.js');
|
|
641
640
|
const tipsBoxHeight = 1; // 1 row for tips box
|
|
642
641
|
const detailsBoxHeight = 20; // bottom N rows for details box. 20 gives 4 lines for condensed payload before it scrolls out of view
|
|
643
642
|
|
|
@@ -667,7 +666,7 @@ async function outputWithBlessed(data, orgSlug) {
|
|
|
667
666
|
columnSpacing: 4,
|
|
668
667
|
truncate: '_'
|
|
669
668
|
});
|
|
670
|
-
const BoxWidget = /*@__PURE__*/require$
|
|
669
|
+
const BoxWidget = /*@__PURE__*/require$6('../external/blessed/lib/widgets/box.js');
|
|
671
670
|
const tipsBox = new BoxWidget({
|
|
672
671
|
bottom: detailsBoxHeight,
|
|
673
672
|
// sits just above the details box
|
|
@@ -1636,7 +1635,7 @@ async function performReachabilityAnalysis(options) {
|
|
|
1636
1635
|
}
|
|
1637
1636
|
|
|
1638
1637
|
// Run Coana with the manifests tar hash.
|
|
1639
|
-
const coanaResult = await utils.
|
|
1638
|
+
const coanaResult = await utils.spawnCoanaDlx(coanaArgs, orgSlug, {
|
|
1640
1639
|
cwd,
|
|
1641
1640
|
env: coanaEnv,
|
|
1642
1641
|
spinner,
|
|
@@ -3441,6 +3440,7 @@ async function coanaFix(fixConfig) {
|
|
|
3441
3440
|
autopilot,
|
|
3442
3441
|
cwd,
|
|
3443
3442
|
ghsas,
|
|
3443
|
+
glob,
|
|
3444
3444
|
limit,
|
|
3445
3445
|
onlyCompute,
|
|
3446
3446
|
orgSlug,
|
|
@@ -3496,7 +3496,7 @@ async function coanaFix(fixConfig) {
|
|
|
3496
3496
|
}
|
|
3497
3497
|
};
|
|
3498
3498
|
}
|
|
3499
|
-
const fixCResult = await utils.
|
|
3499
|
+
const fixCResult = await utils.spawnCoanaDlx(['compute-fixes-and-upgrade-purls', cwd, '--manifests-tar-hash', tarHash, '--apply-fixes-to', ...(isAll ? ['all'] : ghsas), ...(fixConfig.rangeStyle ? ['--range-style', fixConfig.rangeStyle] : []), ...(glob ? ['--glob', glob] : []), ...(onlyCompute ? ['--dry-run'] : []), ...(outputFile ? ['--output-file', outputFile] : []), ...fixConfig.unknownFlags], fixConfig.orgSlug, {
|
|
3500
3500
|
cwd,
|
|
3501
3501
|
spinner,
|
|
3502
3502
|
stdio: 'inherit'
|
|
@@ -3533,7 +3533,7 @@ async function coanaFix(fixConfig) {
|
|
|
3533
3533
|
const shouldSpawnCoana = adjustedLimit > 0;
|
|
3534
3534
|
let ids;
|
|
3535
3535
|
if (shouldSpawnCoana && isAll) {
|
|
3536
|
-
const foundCResult = await utils.
|
|
3536
|
+
const foundCResult = await utils.spawnCoanaDlx(['compute-fixes-and-upgrade-purls', cwd, '--manifests-tar-hash', tarHash, ...(fixConfig.rangeStyle ? ['--range-style', fixConfig.rangeStyle] : []), ...(glob ? ['--glob', glob] : []), ...fixConfig.unknownFlags], fixConfig.orgSlug, {
|
|
3537
3537
|
cwd,
|
|
3538
3538
|
spinner
|
|
3539
3539
|
});
|
|
@@ -3575,7 +3575,7 @@ async function coanaFix(fixConfig) {
|
|
|
3575
3575
|
|
|
3576
3576
|
// Apply fix for single GHSA ID.
|
|
3577
3577
|
// eslint-disable-next-line no-await-in-loop
|
|
3578
|
-
const fixCResult = await utils.
|
|
3578
|
+
const fixCResult = await utils.spawnCoanaDlx(['compute-fixes-and-upgrade-purls', cwd, '--manifests-tar-hash', tarHash, '--apply-fixes-to', ghsaId, ...(fixConfig.rangeStyle ? ['--range-style', fixConfig.rangeStyle] : []), ...(glob ? ['--glob', glob] : []), ...fixConfig.unknownFlags], fixConfig.orgSlug, {
|
|
3579
3579
|
cwd,
|
|
3580
3580
|
spinner,
|
|
3581
3581
|
stdio: 'inherit'
|
|
@@ -3769,6 +3769,7 @@ async function handleFix({
|
|
|
3769
3769
|
autopilot,
|
|
3770
3770
|
cwd,
|
|
3771
3771
|
ghsas,
|
|
3772
|
+
glob,
|
|
3772
3773
|
limit,
|
|
3773
3774
|
minSatisfying,
|
|
3774
3775
|
onlyCompute,
|
|
@@ -3785,6 +3786,7 @@ async function handleFix({
|
|
|
3785
3786
|
cwd,
|
|
3786
3787
|
// Convert mixed CVE/GHSA/PURL inputs to GHSA IDs only
|
|
3787
3788
|
ghsas: await convertIdsToGhsas(ghsas),
|
|
3789
|
+
glob,
|
|
3788
3790
|
limit,
|
|
3789
3791
|
orgSlug,
|
|
3790
3792
|
rangeStyle,
|
|
@@ -3855,6 +3857,12 @@ const hiddenFlags = {
|
|
|
3855
3857
|
...generalFlags$2['id'],
|
|
3856
3858
|
hidden: true
|
|
3857
3859
|
},
|
|
3860
|
+
glob: {
|
|
3861
|
+
type: 'string',
|
|
3862
|
+
default: '',
|
|
3863
|
+
description: 'Glob pattern to pass to coana for filtering files',
|
|
3864
|
+
hidden: true
|
|
3865
|
+
},
|
|
3858
3866
|
maxSatisfying: {
|
|
3859
3867
|
type: 'boolean',
|
|
3860
3868
|
default: true,
|
|
@@ -3931,6 +3939,7 @@ async function run$K(argv, importMeta, {
|
|
|
3931
3939
|
});
|
|
3932
3940
|
const {
|
|
3933
3941
|
autopilot,
|
|
3942
|
+
glob,
|
|
3934
3943
|
json,
|
|
3935
3944
|
limit,
|
|
3936
3945
|
markdown,
|
|
@@ -3966,7 +3975,7 @@ async function run$K(argv, importMeta, {
|
|
|
3966
3975
|
const orgSlugCResult = await utils.getDefaultOrgSlug();
|
|
3967
3976
|
if (!orgSlugCResult.ok) {
|
|
3968
3977
|
process.exitCode = orgSlugCResult.code ?? 1;
|
|
3969
|
-
logger.logger.fail(
|
|
3978
|
+
logger.logger.fail(`${constants.ERROR_UNABLE_RESOLVE_ORG}.\nEnsure a Socket API token is specified for the organization using the SOCKET_CLI_API_TOKEN environment variable.`);
|
|
3970
3979
|
return;
|
|
3971
3980
|
}
|
|
3972
3981
|
const orgSlug = orgSlugCResult.data;
|
|
@@ -3982,6 +3991,7 @@ async function run$K(argv, importMeta, {
|
|
|
3982
3991
|
autopilot,
|
|
3983
3992
|
cwd,
|
|
3984
3993
|
ghsas,
|
|
3994
|
+
glob,
|
|
3985
3995
|
limit,
|
|
3986
3996
|
minSatisfying,
|
|
3987
3997
|
prCheck,
|
|
@@ -4250,15 +4260,15 @@ async function run$I(argv, importMeta, {
|
|
|
4250
4260
|
}
|
|
4251
4261
|
|
|
4252
4262
|
function applyLogin(apiToken, enforcedOrgs, apiBaseUrl, apiProxy) {
|
|
4253
|
-
utils.updateConfigValue(
|
|
4254
|
-
utils.updateConfigValue(
|
|
4255
|
-
utils.updateConfigValue(
|
|
4256
|
-
utils.updateConfigValue(
|
|
4263
|
+
utils.updateConfigValue(constants.CONFIG_KEY_ENFORCED_ORGS, enforcedOrgs);
|
|
4264
|
+
utils.updateConfigValue(constants.CONFIG_KEY_API_TOKEN, apiToken);
|
|
4265
|
+
utils.updateConfigValue(constants.CONFIG_KEY_API_BASE_URL, apiBaseUrl);
|
|
4266
|
+
utils.updateConfigValue(constants.CONFIG_KEY_API_PROXY, apiProxy);
|
|
4257
4267
|
}
|
|
4258
4268
|
|
|
4259
4269
|
async function attemptLogin(apiBaseUrl, apiProxy) {
|
|
4260
|
-
apiBaseUrl ??= utils.getConfigValueOrUndef(
|
|
4261
|
-
apiProxy ??= utils.getConfigValueOrUndef(
|
|
4270
|
+
apiBaseUrl ??= utils.getConfigValueOrUndef(constants.CONFIG_KEY_API_BASE_URL) ?? undefined;
|
|
4271
|
+
apiProxy ??= utils.getConfigValueOrUndef(constants.CONFIG_KEY_API_PROXY) ?? undefined;
|
|
4262
4272
|
const apiTokenInput = await prompts.password({
|
|
4263
4273
|
message: `Enter your ${vendor.terminalLinkExports('Socket.dev API token', 'https://docs.socket.dev/docs/api-keys')} (leave blank to use a limited public token)`
|
|
4264
4274
|
});
|
|
@@ -4372,8 +4382,8 @@ async function attemptLogin(apiBaseUrl, apiProxy) {
|
|
|
4372
4382
|
logger.logger.fail('Failed to install tab completion script. Try `socket install completion` later.');
|
|
4373
4383
|
}
|
|
4374
4384
|
}
|
|
4375
|
-
utils.updateConfigValue(
|
|
4376
|
-
const previousPersistedToken = utils.getConfigValueOrUndef(
|
|
4385
|
+
utils.updateConfigValue(constants.CONFIG_KEY_DEFAULT_ORG, orgSlugs[0]);
|
|
4386
|
+
const previousPersistedToken = utils.getConfigValueOrUndef(constants.CONFIG_KEY_API_TOKEN);
|
|
4377
4387
|
try {
|
|
4378
4388
|
applyLogin(apiToken, enforcedOrgs, apiBaseUrl, apiProxy);
|
|
4379
4389
|
logger.logger.success(`API credentials ${previousPersistedToken === apiToken ? 'refreshed' : previousPersistedToken ? 'updated' : 'set'}`);
|
|
@@ -4454,10 +4464,10 @@ async function run$H(argv, importMeta, {
|
|
|
4454
4464
|
}
|
|
4455
4465
|
|
|
4456
4466
|
function applyLogout() {
|
|
4457
|
-
utils.updateConfigValue(
|
|
4458
|
-
utils.updateConfigValue(
|
|
4459
|
-
utils.updateConfigValue(
|
|
4460
|
-
utils.updateConfigValue(
|
|
4467
|
+
utils.updateConfigValue(constants.CONFIG_KEY_API_TOKEN, null);
|
|
4468
|
+
utils.updateConfigValue(constants.CONFIG_KEY_API_BASE_URL, null);
|
|
4469
|
+
utils.updateConfigValue(constants.CONFIG_KEY_API_PROXY, null);
|
|
4470
|
+
utils.updateConfigValue(constants.CONFIG_KEY_ENFORCED_ORGS, null);
|
|
4461
4471
|
}
|
|
4462
4472
|
|
|
4463
4473
|
function attemptLogout() {
|
|
@@ -4512,11 +4522,9 @@ async function run$G(argv, importMeta, {
|
|
|
4512
4522
|
attemptLogout();
|
|
4513
4523
|
}
|
|
4514
4524
|
|
|
4515
|
-
const require$6 = require$$5.createRequire((typeof document === 'undefined' ? require$$0.pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli.js', document.baseURI).href)));
|
|
4516
4525
|
const {
|
|
4517
4526
|
PACKAGE_LOCK_JSON,
|
|
4518
4527
|
PNPM_LOCK_YAML,
|
|
4519
|
-
YARN,
|
|
4520
4528
|
YARN_LOCK
|
|
4521
4529
|
} = constants.default;
|
|
4522
4530
|
const nodejsPlatformTypes = new Set(['javascript', 'js', 'nodejs', constants.NPM, constants.PNPM, 'ts', 'tsx', 'typescript']);
|
|
@@ -4578,30 +4586,20 @@ async function runCdxgen(argvObj) {
|
|
|
4578
4586
|
const yarnLockPath = pnpmLockPath || npmLockPath ? undefined : await utils.findUp(YARN_LOCK, {
|
|
4579
4587
|
onlyFiles: true
|
|
4580
4588
|
});
|
|
4589
|
+
const agent = pnpmLockPath ? constants.PNPM : yarnLockPath && utils.isYarnBerry() ? constants.YARN : constants.NPM;
|
|
4581
4590
|
let cleanupPackageLock = false;
|
|
4582
|
-
if (argvMutable['type'] !== YARN && nodejsPlatformTypes.has(argvMutable['type']) && yarnLockPath) {
|
|
4591
|
+
if (argvMutable['type'] !== constants.YARN && nodejsPlatformTypes.has(argvMutable['type']) && yarnLockPath) {
|
|
4583
4592
|
if (npmLockPath) {
|
|
4584
4593
|
argvMutable['type'] = constants.NPM;
|
|
4585
4594
|
} else {
|
|
4586
4595
|
// Use synp to create a package-lock.json from the yarn.lock,
|
|
4587
4596
|
// based on the node_modules folder, for a more accurate SBOM.
|
|
4588
4597
|
try {
|
|
4589
|
-
const
|
|
4590
|
-
|
|
4591
|
-
|
|
4592
|
-
|
|
4593
|
-
|
|
4594
|
-
const shadowPnpmBin = /*@__PURE__*/require$6(constants.default.shadowPnpmBinPath);
|
|
4595
|
-
synpPromise = (await shadowPnpmBin(args, shadowOpts)).spawnPromise;
|
|
4596
|
-
} else if (useYarnBerry) {
|
|
4597
|
-
args = ['dlx', `synp@${constants.default.ENV.INLINED_SOCKET_CLI_SYNP_VERSION}`, '--source-file', `./${YARN_LOCK}`];
|
|
4598
|
-
const shadowYarnBin = /*@__PURE__*/require$6(constants.default.shadowYarnBinPath);
|
|
4599
|
-
synpPromise = (await shadowYarnBin(args, shadowOpts)).spawnPromise;
|
|
4600
|
-
} else {
|
|
4601
|
-
args = ['exec', '--yes', `synp@${constants.default.ENV.INLINED_SOCKET_CLI_SYNP_VERSION}`, '--source-file', `./${YARN_LOCK}`];
|
|
4602
|
-
synpPromise = (await shadowNpmBin('npm', args, shadowOpts)).spawnPromise;
|
|
4603
|
-
}
|
|
4604
|
-
await synpPromise;
|
|
4598
|
+
const synpResult = await utils.spawnSynpDlx(['--source-file', `./${YARN_LOCK}`], {
|
|
4599
|
+
...shadowOpts,
|
|
4600
|
+
agent
|
|
4601
|
+
});
|
|
4602
|
+
await synpResult.spawnPromise;
|
|
4605
4603
|
argvMutable['type'] = constants.NPM;
|
|
4606
4604
|
cleanupPackageLock = true;
|
|
4607
4605
|
} catch {}
|
|
@@ -4609,16 +4607,10 @@ async function runCdxgen(argvObj) {
|
|
|
4609
4607
|
}
|
|
4610
4608
|
|
|
4611
4609
|
// Use appropriate package manager for cdxgen
|
|
4612
|
-
|
|
4613
|
-
|
|
4614
|
-
|
|
4615
|
-
|
|
4616
|
-
} else if (yarnLockPath && utils.isYarnBerry()) {
|
|
4617
|
-
const shadowYarnBin = /*@__PURE__*/require$6(constants.default.shadowYarnBinPath);
|
|
4618
|
-
shadowResult = await shadowYarnBin(['dlx', '--quiet', `@cyclonedx/cdxgen@${constants.default.ENV.INLINED_SOCKET_CLI_CYCLONEDX_CDXGEN_VERSION}`, ...argvToArray(argvMutable)], shadowOpts);
|
|
4619
|
-
} else {
|
|
4620
|
-
shadowResult = await shadowNpmBin('npm', ['exec', '--silent', '--yes', `@cyclonedx/cdxgen@${constants.default.ENV.INLINED_SOCKET_CLI_CYCLONEDX_CDXGEN_VERSION}`, '--', ...argvToArray(argvMutable)], shadowOpts);
|
|
4621
|
-
}
|
|
4610
|
+
const shadowResult = await utils.spawnCdxgenDlx(argvToArray(argvMutable), {
|
|
4611
|
+
...shadowOpts,
|
|
4612
|
+
agent
|
|
4613
|
+
});
|
|
4622
4614
|
shadowResult.spawnPromise.process.on('exit', () => {
|
|
4623
4615
|
if (cleanupPackageLock) {
|
|
4624
4616
|
try {
|
|
@@ -6234,7 +6226,7 @@ async function run$x(argv, importMeta, context) {
|
|
|
6234
6226
|
const argsToForward = utils.filterFlags(argv, {
|
|
6235
6227
|
...flags.commonFlags,
|
|
6236
6228
|
...flags.outputFlags
|
|
6237
|
-
}, [
|
|
6229
|
+
}, [constants.FLAG_JSON]);
|
|
6238
6230
|
const {
|
|
6239
6231
|
spawnPromise
|
|
6240
6232
|
} = await shadowBin(constants.NPM, argsToForward, {
|
|
@@ -14660,5 +14652,5 @@ void (async () => {
|
|
|
14660
14652
|
await utils.captureException(e);
|
|
14661
14653
|
}
|
|
14662
14654
|
})();
|
|
14663
|
-
//# debugId=
|
|
14655
|
+
//# debugId=934b325d-4c21-4b37-9c71-c80f38f54d52
|
|
14664
14656
|
//# sourceMappingURL=cli.js.map
|