socket 1.1.89 → 1.1.91
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 +13 -0
- package/dist/cli.js +33 -8
- package/dist/cli.js.map +1 -1
- package/dist/constants.js +4 -4
- package/dist/constants.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/handle-fix.d.mts +1 -1
- package/dist/types/commands/fix/handle-fix.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/scan/reachability-flags.d.mts.map +1 -1
- package/dist/types/utils/glob.d.mts.map +1 -1
- package/dist/types/utils/package-manager.d.mts +12 -0
- package/dist/types/utils/package-manager.d.mts.map +1 -0
- package/dist/utils.js +32 -2
- package/dist/utils.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,19 @@ 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.91](https://github.com/SocketDev/socket-cli/releases/tag/v1.1.91) - 2026-05-01
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
- New `socket scan create` and `socket scan reach` flags let you keep reachability analysis going when it would otherwise halt: `--reach-continue-on-analysis-errors`, `--reach-continue-on-install-errors`, `--reach-continue-on-missing-lock-files`, and `--reach-continue-on-no-source-files`. Each falls back to precomputed (Tier 2) results so you still get a scan when individual workspaces hit timeouts, install failures, missing lock files, or empty source trees.
|
|
11
|
+
|
|
12
|
+
## [1.1.90](https://github.com/SocketDev/socket-cli/releases/tag/v1.1.90) - 2026-04-30
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
- `socket fix` now accepts a `--package-managers` flag to narrow fix computation to specific package managers within an ecosystem (e.g. only PNPM in a monorepo that mixes pnpm/yarn/npm). Accepts space- or comma-separated values and is case-insensitive. When combined with `--ecosystems`, both filters must match.
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
- Updated the Coana CLI to v `15.2.0`.
|
|
19
|
+
|
|
7
20
|
## [1.1.89](https://github.com/SocketDev/socket-cli/releases/tag/v1.1.89) - 2026-04-30
|
|
8
21
|
|
|
9
22
|
### Fixed
|
package/dist/cli.js
CHANGED
|
@@ -3772,13 +3772,14 @@ async function discoverGhsaIds(orgSlug, tarHash, options) {
|
|
|
3772
3772
|
const {
|
|
3773
3773
|
cwd = process.cwd(),
|
|
3774
3774
|
ecosystems,
|
|
3775
|
+
packageManagers,
|
|
3775
3776
|
silence = false,
|
|
3776
3777
|
spinner
|
|
3777
3778
|
} = {
|
|
3778
3779
|
__proto__: null,
|
|
3779
3780
|
...options
|
|
3780
3781
|
};
|
|
3781
|
-
const foundCResult = await utils.spawnCoanaDlx(['find-vulnerabilities', cwd, '--manifests-tar-hash', tarHash, ...(ecosystems?.length ? ['--purl-types', ...ecosystems] : [])], orgSlug, {
|
|
3782
|
+
const foundCResult = await utils.spawnCoanaDlx(['find-vulnerabilities', cwd, '--manifests-tar-hash', tarHash, ...(ecosystems?.length ? ['--purl-types', ...ecosystems] : []), ...(packageManagers?.length ? ['--package-managers', ...packageManagers] : [])], orgSlug, {
|
|
3782
3783
|
cwd,
|
|
3783
3784
|
spinner: silence ? undefined : spinner,
|
|
3784
3785
|
coanaVersion: options?.coanaVersion
|
|
@@ -3813,6 +3814,7 @@ async function coanaFix(fixConfig) {
|
|
|
3813
3814
|
minimumReleaseAge,
|
|
3814
3815
|
orgSlug,
|
|
3815
3816
|
outputFile,
|
|
3817
|
+
packageManagers,
|
|
3816
3818
|
prLimit,
|
|
3817
3819
|
showAffectedDirectDependencies,
|
|
3818
3820
|
silence,
|
|
@@ -3905,6 +3907,7 @@ async function coanaFix(fixConfig) {
|
|
|
3905
3907
|
coanaVersion,
|
|
3906
3908
|
cwd,
|
|
3907
3909
|
ecosystems,
|
|
3910
|
+
packageManagers,
|
|
3908
3911
|
silence,
|
|
3909
3912
|
spinner
|
|
3910
3913
|
}) : ghsas;
|
|
@@ -3925,7 +3928,7 @@ async function coanaFix(fixConfig) {
|
|
|
3925
3928
|
const tmpDir = os.tmpdir();
|
|
3926
3929
|
const tmpFile = path.join(tmpDir, `socket-fix-${Date.now()}.json`);
|
|
3927
3930
|
try {
|
|
3928
|
-
const fixCResult = await utils.spawnCoanaDlx(['compute-fixes-and-upgrade-purls', cwd, '--manifests-tar-hash', tarHash, '--apply-fixes-to', ...ids, ...(fixConfig.rangeStyle ? ['--range-style', fixConfig.rangeStyle] : []), ...(minimumReleaseAge ? ['--minimum-release-age', minimumReleaseAge] : []), ...(include.length ? ['--include', ...include] : []), ...(exclude.length ? ['--exclude', ...exclude] : []), ...(ecosystems.length ? ['--purl-types', ...ecosystems] : []), ...(!applyFixes ? [constants.FLAG_DRY_RUN] : []), '--output-file', tmpFile, ...(debug ? ['--debug'] : []), ...(disableExternalToolChecks ? ['--disable-external-tool-checks'] : []), ...(disableMajorUpdates ? ['--disable-major-updates'] : []), ...(showAffectedDirectDependencies ? ['--show-affected-direct-dependencies'] : []), ...fixConfig.unknownFlags], fixConfig.orgSlug, {
|
|
3931
|
+
const fixCResult = await utils.spawnCoanaDlx(['compute-fixes-and-upgrade-purls', cwd, '--manifests-tar-hash', tarHash, '--apply-fixes-to', ...ids, ...(fixConfig.rangeStyle ? ['--range-style', fixConfig.rangeStyle] : []), ...(minimumReleaseAge ? ['--minimum-release-age', minimumReleaseAge] : []), ...(include.length ? ['--include', ...include] : []), ...(exclude.length ? ['--exclude', ...exclude] : []), ...(ecosystems.length ? ['--purl-types', ...ecosystems] : []), ...(packageManagers.length ? ['--package-managers', ...packageManagers] : []), ...(!applyFixes ? [constants.FLAG_DRY_RUN] : []), '--output-file', tmpFile, ...(debug ? ['--debug'] : []), ...(disableExternalToolChecks ? ['--disable-external-tool-checks'] : []), ...(disableMajorUpdates ? ['--disable-major-updates'] : []), ...(showAffectedDirectDependencies ? ['--show-affected-direct-dependencies'] : []), ...fixConfig.unknownFlags], fixConfig.orgSlug, {
|
|
3929
3932
|
coanaVersion,
|
|
3930
3933
|
cwd,
|
|
3931
3934
|
spinner: silence ? undefined : spinner,
|
|
@@ -3993,6 +3996,7 @@ async function coanaFix(fixConfig) {
|
|
|
3993
3996
|
coanaVersion,
|
|
3994
3997
|
cwd,
|
|
3995
3998
|
ecosystems,
|
|
3999
|
+
packageManagers,
|
|
3996
4000
|
silence,
|
|
3997
4001
|
spinner
|
|
3998
4002
|
}) : ghsas).slice(0, adjustedPrLimit);
|
|
@@ -4036,7 +4040,7 @@ async function coanaFix(fixConfig) {
|
|
|
4036
4040
|
|
|
4037
4041
|
// Apply fix for single GHSA ID.
|
|
4038
4042
|
// eslint-disable-next-line no-await-in-loop
|
|
4039
|
-
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] : []), ...(minimumReleaseAge ? ['--minimum-release-age', minimumReleaseAge] : []), ...(include.length ? ['--include', ...include] : []), ...(exclude.length ? ['--exclude', ...exclude] : []), ...(ecosystems.length ? ['--purl-types', ...ecosystems] : []), ...(debug ? ['--debug'] : []), ...(disableExternalToolChecks ? ['--disable-external-tool-checks'] : []), ...(disableMajorUpdates ? ['--disable-major-updates'] : []), ...(showAffectedDirectDependencies ? ['--show-affected-direct-dependencies'] : []), '--output-file', tmpFile, ...fixConfig.unknownFlags], fixConfig.orgSlug, {
|
|
4043
|
+
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] : []), ...(minimumReleaseAge ? ['--minimum-release-age', minimumReleaseAge] : []), ...(include.length ? ['--include', ...include] : []), ...(exclude.length ? ['--exclude', ...exclude] : []), ...(ecosystems.length ? ['--purl-types', ...ecosystems] : []), ...(packageManagers.length ? ['--package-managers', ...packageManagers] : []), ...(debug ? ['--debug'] : []), ...(disableExternalToolChecks ? ['--disable-external-tool-checks'] : []), ...(disableMajorUpdates ? ['--disable-major-updates'] : []), ...(showAffectedDirectDependencies ? ['--show-affected-direct-dependencies'] : []), '--output-file', tmpFile, ...fixConfig.unknownFlags], fixConfig.orgSlug, {
|
|
4040
4044
|
coanaVersion,
|
|
4041
4045
|
cwd,
|
|
4042
4046
|
spinner: silence ? undefined : spinner,
|
|
@@ -4384,6 +4388,7 @@ async function handleFix({
|
|
|
4384
4388
|
orgSlug,
|
|
4385
4389
|
outputFile,
|
|
4386
4390
|
outputKind,
|
|
4391
|
+
packageManagers,
|
|
4387
4392
|
prCheck,
|
|
4388
4393
|
prLimit,
|
|
4389
4394
|
rangeStyle,
|
|
@@ -4410,6 +4415,7 @@ async function handleFix({
|
|
|
4410
4415
|
minimumReleaseAge,
|
|
4411
4416
|
outputFile,
|
|
4412
4417
|
outputKind,
|
|
4418
|
+
packageManagers,
|
|
4413
4419
|
prCheck,
|
|
4414
4420
|
prLimit,
|
|
4415
4421
|
rangeStyle,
|
|
@@ -4437,6 +4443,7 @@ async function handleFix({
|
|
|
4437
4443
|
minSatisfying,
|
|
4438
4444
|
orgSlug,
|
|
4439
4445
|
outputFile,
|
|
4446
|
+
packageManagers,
|
|
4440
4447
|
prCheck,
|
|
4441
4448
|
prLimit,
|
|
4442
4449
|
rangeStyle,
|
|
@@ -4553,6 +4560,12 @@ Available styles:
|
|
|
4553
4560
|
description: 'Limit fix analysis to specific ecosystems. Can be provided as comma separated values or as multiple flags. Defaults to all ecosystems.',
|
|
4554
4561
|
isMultiple: true
|
|
4555
4562
|
},
|
|
4563
|
+
packageManagers: {
|
|
4564
|
+
type: 'string',
|
|
4565
|
+
default: [],
|
|
4566
|
+
description: 'Limit fix analysis to specific package managers within an ecosystem (e.g. NPM, PNPM, YARN, MAVEN, POETRY). Accepts space- or comma-separated values and is case-insensitive. When combined with --ecosystems, an artifact must satisfy both filters.',
|
|
4567
|
+
isMultiple: true
|
|
4568
|
+
},
|
|
4556
4569
|
showAffectedDirectDependencies: {
|
|
4557
4570
|
type: 'boolean',
|
|
4558
4571
|
default: false,
|
|
@@ -4684,6 +4697,7 @@ async function run$K(argv, importMeta, {
|
|
|
4684
4697
|
maxSatisfying,
|
|
4685
4698
|
minimumReleaseAge,
|
|
4686
4699
|
outputFile,
|
|
4700
|
+
packageManagers,
|
|
4687
4701
|
prCheck,
|
|
4688
4702
|
prLimit,
|
|
4689
4703
|
rangeStyle,
|
|
@@ -4713,6 +4727,20 @@ async function run$K(argv, importMeta, {
|
|
|
4713
4727
|
validatedEcosystems.push(ecosystem);
|
|
4714
4728
|
}
|
|
4715
4729
|
|
|
4730
|
+
// Process and validate package manager values early, before dry-run check.
|
|
4731
|
+
// Coana normalizes input to uppercase and rejects unknown values, so do the
|
|
4732
|
+
// same here for a consistent UX and an early failure when invalid.
|
|
4733
|
+
const packageManagersRaw = utils.cmdFlagValueToArray(packageManagers).map(s => s.toUpperCase());
|
|
4734
|
+
const validatedPackageManagers = [];
|
|
4735
|
+
for (const pm of packageManagersRaw) {
|
|
4736
|
+
if (!utils.isValidPackageManager(pm)) {
|
|
4737
|
+
logger.logger.fail(`Invalid package manager: "${pm}". Valid values are: ${arrays.joinAnd([...utils.ALL_PACKAGE_MANAGERS])}`);
|
|
4738
|
+
process.exitCode = 1;
|
|
4739
|
+
return;
|
|
4740
|
+
}
|
|
4741
|
+
validatedPackageManagers.push(pm);
|
|
4742
|
+
}
|
|
4743
|
+
|
|
4716
4744
|
// Collect ghsas early to validate --all and --id mutual exclusivity.
|
|
4717
4745
|
const ghsas = arrays.arrayUnique([...utils.cmdFlagValueToArray(cli.flags['id']), ...utils.cmdFlagValueToArray(cli.flags['ghsa']), ...utils.cmdFlagValueToArray(cli.flags['purl'])]);
|
|
4718
4746
|
const wasValidInput = utils.checkCommandInput(outputKind, {
|
|
@@ -4787,6 +4815,7 @@ async function run$K(argv, importMeta, {
|
|
|
4787
4815
|
orgSlug,
|
|
4788
4816
|
outputFile,
|
|
4789
4817
|
outputKind,
|
|
4818
|
+
packageManagers: validatedPackageManagers,
|
|
4790
4819
|
prCheck,
|
|
4791
4820
|
prLimit,
|
|
4792
4821
|
rangeStyle,
|
|
@@ -11033,25 +11062,21 @@ const reachabilityFlags = {
|
|
|
11033
11062
|
reachContinueOnAnalysisErrors: {
|
|
11034
11063
|
type: 'boolean',
|
|
11035
11064
|
default: false,
|
|
11036
|
-
hidden: true,
|
|
11037
11065
|
description: 'Continue reachability analysis when errors occur (timeouts, OOM, parse errors, etc.), falling back to precomputed (Tier 2) results. By default, the CLI halts on analysis errors.'
|
|
11038
11066
|
},
|
|
11039
11067
|
reachContinueOnInstallErrors: {
|
|
11040
11068
|
type: 'boolean',
|
|
11041
11069
|
default: false,
|
|
11042
|
-
hidden: true,
|
|
11043
11070
|
description: 'Continue reachability analysis when package installation fails, falling back to precomputed (Tier 2) results. By default, the CLI halts on installation errors.'
|
|
11044
11071
|
},
|
|
11045
11072
|
reachContinueOnMissingLockFiles: {
|
|
11046
11073
|
type: 'boolean',
|
|
11047
11074
|
default: false,
|
|
11048
|
-
hidden: true,
|
|
11049
11075
|
description: 'Continue reachability analysis when a Gradle or SBT project is missing its lock file (or version catalog / pre-generated SBOM). By default, the CLI halts.'
|
|
11050
11076
|
},
|
|
11051
11077
|
reachContinueOnNoSourceFiles: {
|
|
11052
11078
|
type: 'boolean',
|
|
11053
11079
|
default: false,
|
|
11054
|
-
hidden: true,
|
|
11055
11080
|
description: 'Continue reachability analysis when a workspace contains no source files for its ecosystem. By default, the CLI halts.'
|
|
11056
11081
|
},
|
|
11057
11082
|
reachDisableExternalToolChecks: {
|
|
@@ -15615,5 +15640,5 @@ process.on('unhandledRejection', async (reason, promise) => {
|
|
|
15615
15640
|
// eslint-disable-next-line n/no-process-exit
|
|
15616
15641
|
process.exit(1);
|
|
15617
15642
|
});
|
|
15618
|
-
//# debugId=
|
|
15643
|
+
//# debugId=b896b0a3-35bb-4e49-a314-5769e9e8152f
|
|
15619
15644
|
//# sourceMappingURL=cli.js.map
|