@socketsecurity/cli-with-sentry 1.1.92 → 1.1.94
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 +11 -0
- package/dist/cli.js +251 -26
- package/dist/cli.js.map +1 -1
- package/dist/constants.js +4 -4
- package/dist/constants.js.map +1 -1
- package/dist/socket-completion.bash +2 -2
- package/dist/tsconfig.dts.tsbuildinfo +1 -1
- package/dist/types/commands/ci/handle-ci.d.mts.map +1 -1
- package/dist/types/commands/fix/cmd-fix.d.mts.map +1 -1
- package/dist/types/commands/manifest/cmd-manifest-scala.d.mts.map +1 -1
- package/dist/types/commands/manifest/convert_sbt_to_maven.d.mts.map +1 -1
- package/dist/types/commands/scan/cmd-scan-create.d.mts.map +1 -1
- package/dist/types/commands/scan/cmd-scan-reach.d.mts.map +1 -1
- package/dist/types/commands/scan/exclude-paths.d.mts +47 -0
- package/dist/types/commands/scan/exclude-paths.d.mts.map +1 -0
- package/dist/types/commands/scan/handle-create-new-scan.d.mts.map +1 -1
- package/dist/types/commands/scan/handle-scan-reach.d.mts.map +1 -1
- package/dist/types/commands/scan/output-scan-reach.d.mts.map +1 -1
- package/dist/types/commands/scan/perform-reachability-analysis.d.mts +1 -0
- package/dist/types/commands/scan/perform-reachability-analysis.d.mts.map +1 -1
- package/dist/types/commands/scan/reachability-flags.d.mts +1 -0
- package/dist/types/commands/scan/reachability-flags.d.mts.map +1 -1
- package/dist/types/utils/glob.d.mts +14 -0
- package/dist/types/utils/glob.d.mts.map +1 -1
- package/dist/types/utils/path-resolve.d.mts +5 -0
- package/dist/types/utils/path-resolve.d.mts.map +1 -1
- package/dist/utils.js +273 -244
- package/dist/utils.js.map +1 -1
- package/dist/vendor.js +8181 -8181
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,17 @@ 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.94](https://github.com/SocketDev/socket-cli/releases/tag/v1.1.94) - 2026-05-12
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
- `socket manifest scala` now copies sbt-generated `.pom` files out of each subproject's `target/` directory to the project root as `pom.xml`, so Socket scan (which discovers `**/pom.xml` and respects `.gitignore`) picks them up automatically. Use `--out` to override the destination filename.
|
|
11
|
+
|
|
12
|
+
## [1.1.93](https://github.com/SocketDev/socket-cli/releases/tag/v1.1.93) - 2026-05-08
|
|
13
|
+
|
|
14
|
+
### Changed
|
|
15
|
+
- `socket fix --ecosystems` now accepts values case-insensitively (e.g. `NPM`, `npm`, and `Npm` are all valid), matching the existing behavior of `--package-managers`.
|
|
16
|
+
- Updated the Coana CLI to v `15.2.4`.
|
|
17
|
+
|
|
7
18
|
## [1.1.92](https://github.com/SocketDev/socket-cli/releases/tag/v1.1.92) - 2026-05-05
|
|
8
19
|
|
|
9
20
|
### Changed
|
package/dist/cli.js
CHANGED
|
@@ -880,6 +880,143 @@ async function run$R(argv, importMeta, {
|
|
|
880
880
|
});
|
|
881
881
|
}
|
|
882
882
|
|
|
883
|
+
function normalizeProjectIgnorePath(path) {
|
|
884
|
+
return utils.stripTrailingSlash(toPosixPath(path.startsWith('/') ? path.slice(1) : path));
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
/**
|
|
888
|
+
* Converts a Socket-scan-root anchored --exclude-paths pattern into the shape
|
|
889
|
+
* Coana expects for the current analysis target. Coana resolves --exclude-dirs
|
|
890
|
+
* relative to the path passed to `coana run`, not relative to this command's
|
|
891
|
+
* cwd. For a root target the pattern can pass through unchanged; for a nested
|
|
892
|
+
* target we strip the target prefix; documented match-anywhere globstar
|
|
893
|
+
* patterns remain meaningful relative to the nested target; and paths outside
|
|
894
|
+
* the target return undefined because Coana cannot exclude directories it is
|
|
895
|
+
* not analyzing.
|
|
896
|
+
*/
|
|
897
|
+
function pathRelativeToTarget(path, target) {
|
|
898
|
+
const normalized = normalizeProjectIgnorePath(path);
|
|
899
|
+
if (target === '.' || target === '') {
|
|
900
|
+
// Root target: the project root and Coana analysis root are the same directory.
|
|
901
|
+
return normalized;
|
|
902
|
+
}
|
|
903
|
+
if (normalized === target) {
|
|
904
|
+
// Whole target excluded: manifest discovery should stop before Coana runs.
|
|
905
|
+
return undefined;
|
|
906
|
+
}
|
|
907
|
+
if (normalized.startsWith('**/')) {
|
|
908
|
+
// Match-anywhere glob: keep matching at any depth under the Coana target.
|
|
909
|
+
return normalized;
|
|
910
|
+
}
|
|
911
|
+
const targetPrefix = `${target}/`;
|
|
912
|
+
if (normalized.startsWith(targetPrefix)) {
|
|
913
|
+
// Nested target: strip the target prefix to make the pattern target-relative.
|
|
914
|
+
return normalized.slice(targetPrefix.length);
|
|
915
|
+
}
|
|
916
|
+
// Outside the target: there is nothing for this Coana run to exclude.
|
|
917
|
+
return undefined;
|
|
918
|
+
}
|
|
919
|
+
function toPosixPath(path) {
|
|
920
|
+
return path.replaceAll('\\', '/');
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
/**
|
|
924
|
+
* Derives the two scan-time forms of --exclude-paths: anchored minimatch
|
|
925
|
+
* patterns for SCA manifest discovery, and target-relative paths for Coana's
|
|
926
|
+
* reachability analysis.
|
|
927
|
+
*/
|
|
928
|
+
function applyFullExcludePaths({
|
|
929
|
+
cwd,
|
|
930
|
+
reachabilityOptions,
|
|
931
|
+
target
|
|
932
|
+
}) {
|
|
933
|
+
const {
|
|
934
|
+
excludePaths
|
|
935
|
+
} = reachabilityOptions;
|
|
936
|
+
const additionalScaIgnores = excludePaths.flatMap(excludePathToScanIgnores);
|
|
937
|
+
const coanaExcludeGlobs = projectIgnorePathsToReachExcludePaths(excludePaths, {
|
|
938
|
+
cwd,
|
|
939
|
+
target
|
|
940
|
+
});
|
|
941
|
+
const mergedReachabilityOptions = excludePaths.length ? {
|
|
942
|
+
...reachabilityOptions,
|
|
943
|
+
reachExcludePaths: [...reachabilityOptions.reachExcludePaths, ...coanaExcludeGlobs]
|
|
944
|
+
} : reachabilityOptions;
|
|
945
|
+
return {
|
|
946
|
+
additionalScaIgnores,
|
|
947
|
+
mergedReachabilityOptions
|
|
948
|
+
};
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
// Patterns that resolve to "exclude the entire scan" or "exclude nothing
|
|
952
|
+
// useful" are almost certainly typos. Rejecting them up front beats
|
|
953
|
+
// silently producing an empty scan or a no-op exclusion.
|
|
954
|
+
const DEGENERATE_EXCLUDE_PATHS = new Set(['', '.', './', './**', '/', '**', '/**']);
|
|
955
|
+
|
|
956
|
+
/**
|
|
957
|
+
* Validates --exclude-paths entries before they reach either exclusion sink.
|
|
958
|
+
* Rejects gitignore-style negations (coana's --exclude-dirs has no negation
|
|
959
|
+
* form), absolute paths (the flag is scan-root relative), patterns escaping
|
|
960
|
+
* the scan root via `..`, and degenerate match-everything sentinels like `.`,
|
|
961
|
+
* `**`, `/`.
|
|
962
|
+
*/
|
|
963
|
+
function assertValidExcludePaths(paths) {
|
|
964
|
+
for (const p of paths) {
|
|
965
|
+
if (p.startsWith('!')) {
|
|
966
|
+
throw new utils.InputError(`--exclude-paths does not support negation patterns. Got: '${p}'.`);
|
|
967
|
+
}
|
|
968
|
+
const posix = toPosixPath(p).trim();
|
|
969
|
+
if (DEGENERATE_EXCLUDE_PATHS.has(utils.stripTrailingSlash(posix))) {
|
|
970
|
+
throw new utils.InputError(`--exclude-paths does not accept match-everything patterns. Got: '${p}'.`);
|
|
971
|
+
}
|
|
972
|
+
if (posix.startsWith('/')) {
|
|
973
|
+
throw new utils.InputError(`--exclude-paths must be relative to the scan root. Got absolute path: '${p}'.`);
|
|
974
|
+
}
|
|
975
|
+
if (posix === '..' || posix.startsWith('../') || posix.includes('/../')) {
|
|
976
|
+
throw new utils.InputError(`--exclude-paths cannot escape the scan root with '..'. Got: '${p}'.`);
|
|
977
|
+
}
|
|
978
|
+
}
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
/**
|
|
982
|
+
* Expands an anchored-micromatch --exclude-paths entry into the minimatch
|
|
983
|
+
* patterns fast-glob needs to skip both the matched entry itself (file-shaped
|
|
984
|
+
* matches like `packages/stray.json` against `packages/*`) and any subtree
|
|
985
|
+
* underneath it (`packages/a/foo.json`). Returned patterns are ready for
|
|
986
|
+
* fast-glob's `ignore` list — no gitignore translation involved.
|
|
987
|
+
*/
|
|
988
|
+
function excludePathToScanIgnores(input) {
|
|
989
|
+
const stripped = utils.stripTrailingSlash(toPosixPath(input));
|
|
990
|
+
// User already opted into "match everything under this dir" — one pattern
|
|
991
|
+
// is enough.
|
|
992
|
+
if (stripped.endsWith('/**')) {
|
|
993
|
+
return [stripped];
|
|
994
|
+
}
|
|
995
|
+
// Emit the entry itself (catches file-shaped hits) plus its subtree
|
|
996
|
+
// (catches descendants when the entry resolves to a directory).
|
|
997
|
+
return [stripped, `${stripped}/**`];
|
|
998
|
+
}
|
|
999
|
+
|
|
1000
|
+
/**
|
|
1001
|
+
* Re-anchors --exclude-paths patterns onto the reachability analysis target.
|
|
1002
|
+
* Coana matches --exclude-dirs relative to whichever directory it was invoked
|
|
1003
|
+
* on, so when the analysis target is a nested subdirectory, scan-root
|
|
1004
|
+
* patterns need their target prefix stripped. Patterns that fall outside the
|
|
1005
|
+
* target are dropped — coana cannot exclude what it isn't analyzing. Bails
|
|
1006
|
+
* out entirely when any input contains a negation, since coana's --exclude-dirs
|
|
1007
|
+
* has no negation form.
|
|
1008
|
+
*/
|
|
1009
|
+
function projectIgnorePathsToReachExcludePaths(paths, options) {
|
|
1010
|
+
if (!Array.isArray(paths) || paths.some(p => p.startsWith('!'))) {
|
|
1011
|
+
return [];
|
|
1012
|
+
}
|
|
1013
|
+
const targetPattern = normalizeProjectIgnorePath(path.relative(options.cwd, path.resolve(options.cwd, options.target)));
|
|
1014
|
+
return paths.flatMap(p => {
|
|
1015
|
+
const reachPath = pathRelativeToTarget(p, targetPattern);
|
|
1016
|
+
return reachPath === undefined ? [] : [reachPath];
|
|
1017
|
+
});
|
|
1018
|
+
}
|
|
1019
|
+
|
|
883
1020
|
async function fetchCreateOrgFullScan(packagePaths, orgSlug, config, options) {
|
|
884
1021
|
const {
|
|
885
1022
|
branchName,
|
|
@@ -1857,6 +1994,23 @@ async function execGradleWithSpinner(bin, commandArgs, cwd) {
|
|
|
1857
1994
|
}
|
|
1858
1995
|
}
|
|
1859
1996
|
|
|
1997
|
+
// Walk up from a pom path to find a `target` directory ancestor and return
|
|
1998
|
+
// its parent (the project root). Returns undefined if no `target` ancestor
|
|
1999
|
+
// is found, which means we cannot safely lift the file out of the ignored
|
|
2000
|
+
// build dir.
|
|
2001
|
+
function findProjectRootAboveTarget(pomPath) {
|
|
2002
|
+
let dir = path.dirname(pomPath);
|
|
2003
|
+
const {
|
|
2004
|
+
root
|
|
2005
|
+
} = path.parse(dir);
|
|
2006
|
+
while (dir !== root) {
|
|
2007
|
+
if (path.basename(dir) === 'target') {
|
|
2008
|
+
return path.dirname(dir);
|
|
2009
|
+
}
|
|
2010
|
+
dir = path.dirname(dir);
|
|
2011
|
+
}
|
|
2012
|
+
return undefined;
|
|
2013
|
+
}
|
|
1860
2014
|
async function convertSbtToMaven({
|
|
1861
2015
|
bin,
|
|
1862
2016
|
cwd,
|
|
@@ -1933,18 +2087,43 @@ async function convertSbtToMaven({
|
|
|
1933
2087
|
logger.logger.info('Exiting now...');
|
|
1934
2088
|
return;
|
|
1935
2089
|
} else {
|
|
1936
|
-
//
|
|
1937
|
-
//
|
|
1938
|
-
//
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
2090
|
+
// sbt writes poms inside each project's `target/` directory, which is
|
|
2091
|
+
// typically gitignored. Copy them out to a sibling of `target/` so
|
|
2092
|
+
// downstream SBOM/scan steps see them.
|
|
2093
|
+
const copied = [];
|
|
2094
|
+
const outBasename = path.basename(out) || 'pom.xml';
|
|
2095
|
+
for (const pomPath of poms) {
|
|
2096
|
+
let destPath;
|
|
2097
|
+
if (poms.length === 1 && out !== outBasename) {
|
|
2098
|
+
// Honor the full `--out` path verbatim when exactly one pom was
|
|
2099
|
+
// produced and the user (or default) supplied a path, not just a
|
|
2100
|
+
// bare filename.
|
|
2101
|
+
destPath = path.resolve(cwd, out);
|
|
2102
|
+
} else {
|
|
2103
|
+
const projectRoot = findProjectRootAboveTarget(pomPath);
|
|
2104
|
+
if (!projectRoot) {
|
|
2105
|
+
logger.logger.warn(`Could not locate \`target/\` ancestor for \`${pomPath}\`, leaving in place`);
|
|
2106
|
+
continue;
|
|
2107
|
+
}
|
|
2108
|
+
destPath = path.join(projectRoot, outBasename);
|
|
2109
|
+
}
|
|
2110
|
+
try {
|
|
2111
|
+
// eslint-disable-next-line no-await-in-loop
|
|
2112
|
+
await fs$1.promises.mkdir(path.dirname(destPath), {
|
|
2113
|
+
recursive: true
|
|
2114
|
+
});
|
|
2115
|
+
// eslint-disable-next-line no-await-in-loop
|
|
2116
|
+
await fs$1.promises.copyFile(pomPath, destPath);
|
|
2117
|
+
copied.push(destPath);
|
|
2118
|
+
} catch (e) {
|
|
2119
|
+
logger.logger.warn(`Failed to copy \`${pomPath}\` to \`${destPath}\`: ${utils.getErrorCause(e)}`);
|
|
2120
|
+
}
|
|
2121
|
+
}
|
|
2122
|
+
logger.logger.success(`Generated ${copied.length} pom file${copied.length === 1 ? '' : 's'}`);
|
|
2123
|
+
logger.logger.log('Reported exports:');
|
|
2124
|
+
for (const fn of copied) {
|
|
2125
|
+
logger.logger.log('-', fn);
|
|
2126
|
+
}
|
|
1948
2127
|
}
|
|
1949
2128
|
} catch (e) {
|
|
1950
2129
|
process.exitCode = 1;
|
|
@@ -2156,7 +2335,7 @@ async function generateAutoManifest({
|
|
|
2156
2335
|
// Note: `sbt` is more likely to be resolved against PATH env
|
|
2157
2336
|
bin: sockJson.defaults?.manifest?.sbt?.bin ?? 'sbt',
|
|
2158
2337
|
cwd,
|
|
2159
|
-
out: sockJson.defaults?.manifest?.sbt?.outfile ?? './
|
|
2338
|
+
out: sockJson.defaults?.manifest?.sbt?.outfile ?? './pom.xml',
|
|
2160
2339
|
sbtOpts: sockJson.defaults?.manifest?.sbt?.sbtOpts?.split(' ').map(s => s.trim()).filter(Boolean) ?? [],
|
|
2161
2340
|
verbose: Boolean(sockJson.defaults?.manifest?.sbt?.verbose)
|
|
2162
2341
|
});
|
|
@@ -2291,7 +2470,16 @@ async function handleCreateNewScan({
|
|
|
2291
2470
|
// Load socket.yml to respect projectIgnorePaths when collecting files.
|
|
2292
2471
|
const socketYmlResult = utils.findSocketYmlSync(cwd);
|
|
2293
2472
|
const socketConfig = socketYmlResult.ok ? socketYmlResult.data?.parsed : undefined;
|
|
2473
|
+
const {
|
|
2474
|
+
additionalScaIgnores,
|
|
2475
|
+
mergedReachabilityOptions
|
|
2476
|
+
} = applyFullExcludePaths({
|
|
2477
|
+
cwd,
|
|
2478
|
+
reachabilityOptions: reach,
|
|
2479
|
+
target: targets[0]
|
|
2480
|
+
});
|
|
2294
2481
|
const packagePaths = await utils.getPackageFilesForScan(targets, supportedFiles, {
|
|
2482
|
+
additionalIgnores: additionalScaIgnores,
|
|
2295
2483
|
config: socketConfig,
|
|
2296
2484
|
cwd
|
|
2297
2485
|
});
|
|
@@ -2324,7 +2512,7 @@ async function handleCreateNewScan({
|
|
|
2324
2512
|
logger.logger.info('Starting reachability analysis...');
|
|
2325
2513
|
require$$9.debugFn('notice', 'Reachability analysis enabled');
|
|
2326
2514
|
require$$9.debugDir('inspect', {
|
|
2327
|
-
reachabilityOptions:
|
|
2515
|
+
reachabilityOptions: mergedReachabilityOptions
|
|
2328
2516
|
});
|
|
2329
2517
|
spinner.start();
|
|
2330
2518
|
const reachResult = await performReachabilityAnalysis({
|
|
@@ -2332,7 +2520,7 @@ async function handleCreateNewScan({
|
|
|
2332
2520
|
cwd,
|
|
2333
2521
|
orgSlug,
|
|
2334
2522
|
packagePaths,
|
|
2335
|
-
reachabilityOptions:
|
|
2523
|
+
reachabilityOptions: mergedReachabilityOptions,
|
|
2336
2524
|
repoName,
|
|
2337
2525
|
spinner,
|
|
2338
2526
|
target: targets[0]
|
|
@@ -2450,6 +2638,7 @@ async function handleCi(autoManifest) {
|
|
|
2450
2638
|
pendingHead: true,
|
|
2451
2639
|
pullRequest: 0,
|
|
2452
2640
|
reach: {
|
|
2641
|
+
excludePaths: [],
|
|
2453
2642
|
reachAnalysisMemoryLimit: 0,
|
|
2454
2643
|
reachAnalysisTimeout: 0,
|
|
2455
2644
|
reachConcurrency: 1,
|
|
@@ -4557,7 +4746,7 @@ Available styles:
|
|
|
4557
4746
|
ecosystems: {
|
|
4558
4747
|
type: 'string',
|
|
4559
4748
|
default: [],
|
|
4560
|
-
description: 'Limit fix analysis to specific ecosystems.
|
|
4749
|
+
description: 'Limit fix analysis to specific ecosystems. Accepts space- or comma-separated values and is case-insensitive. Defaults to all ecosystems.',
|
|
4561
4750
|
isMultiple: true
|
|
4562
4751
|
},
|
|
4563
4752
|
packageManagers: {
|
|
@@ -4713,7 +4902,9 @@ async function run$K(argv, importMeta, {
|
|
|
4713
4902
|
const outputKind = utils.getOutputKind(json, markdown);
|
|
4714
4903
|
|
|
4715
4904
|
// Process comma-separated values for ecosystems flag.
|
|
4716
|
-
|
|
4905
|
+
// ALL_ECOSYSTEMS is lowercase, so normalize input for a case-insensitive
|
|
4906
|
+
// match (mirrors --package-managers behavior).
|
|
4907
|
+
const ecosystemsRaw = utils.cmdFlagValueToArray(ecosystems).map(s => s.toLowerCase());
|
|
4717
4908
|
|
|
4718
4909
|
// Validate ecosystem values early, before dry-run check.
|
|
4719
4910
|
const validatedEcosystems = [];
|
|
@@ -6338,8 +6529,10 @@ const config$9 = {
|
|
|
6338
6529
|
|
|
6339
6530
|
There are some caveats with \`build.sbt\` to \`pom.xml\` conversion:
|
|
6340
6531
|
|
|
6341
|
-
- the xml is exported as
|
|
6342
|
-
|
|
6532
|
+
- the xml is exported as pom.xml at the project root so Socket scan picks
|
|
6533
|
+
it up; sbt itself first writes it inside your /target/sbt<version> folder
|
|
6534
|
+
(as a different name). Use --out to override if you already have a
|
|
6535
|
+
hand-authored pom.xml at the project root.
|
|
6343
6536
|
|
|
6344
6537
|
- the pom.xml format (standard by Scala) does not support certain sbt features
|
|
6345
6538
|
- \`excludeAll()\`, \`dependencyOverrides\`, \`force()\`, \`relativePath\`
|
|
@@ -6419,7 +6612,7 @@ async function run$A(argv, importMeta, {
|
|
|
6419
6612
|
out = sockJson.defaults?.manifest?.sbt?.outfile;
|
|
6420
6613
|
logger.logger.info(`Using default --out from ${constants.SOCKET_JSON}:`, out);
|
|
6421
6614
|
} else {
|
|
6422
|
-
out = './
|
|
6615
|
+
out = './pom.xml';
|
|
6423
6616
|
}
|
|
6424
6617
|
}
|
|
6425
6618
|
if (!sbtOpts) {
|
|
@@ -11118,7 +11311,8 @@ const reachabilityFlags = {
|
|
|
11118
11311
|
reachExcludePaths: {
|
|
11119
11312
|
type: 'string',
|
|
11120
11313
|
isMultiple: true,
|
|
11121
|
-
|
|
11314
|
+
hidden: true,
|
|
11315
|
+
description: 'Deprecated: use --exclude-paths instead. List of paths to exclude from reachability analysis, as either a comma separated value or as multiple flags.'
|
|
11122
11316
|
},
|
|
11123
11317
|
reachLazyMode: {
|
|
11124
11318
|
type: 'boolean',
|
|
@@ -11137,6 +11331,13 @@ const reachabilityFlags = {
|
|
|
11137
11331
|
description: 'When using this option, the scan is created based only on pre-generated CDX and SPDX files in your project.'
|
|
11138
11332
|
}
|
|
11139
11333
|
};
|
|
11334
|
+
const excludePathsFlag = {
|
|
11335
|
+
excludePaths: {
|
|
11336
|
+
type: 'string',
|
|
11337
|
+
isMultiple: true,
|
|
11338
|
+
description: 'List of glob patterns to exclude from the scan, including SCA/SBOM manifest discovery and (when --reach is enabled) Tier 1 reachability analysis. Patterns are anchored micromatch globs matched relative to the Socket scan root, which is the command working directory (`--cwd` if set), not the reachability target: `tests` matches only `<cwd>/tests`; use `**/tests` to match at any depth. Negation patterns (`!path`) are not supported. Accepts a comma-separated value or multiple flags.'
|
|
11339
|
+
}
|
|
11340
|
+
};
|
|
11140
11341
|
|
|
11141
11342
|
async function suggestTarget() {
|
|
11142
11343
|
// We could prefill this with sub-dirs of the current
|
|
@@ -11307,6 +11508,7 @@ async function run$d(argv, importMeta, {
|
|
|
11307
11508
|
hidden: hidden$a,
|
|
11308
11509
|
flags: {
|
|
11309
11510
|
...generalFlags$1,
|
|
11511
|
+
...excludePathsFlag,
|
|
11310
11512
|
...reachabilityFlags
|
|
11311
11513
|
},
|
|
11312
11514
|
help: command => `
|
|
@@ -11317,7 +11519,10 @@ async function run$d(argv, importMeta, {
|
|
|
11317
11519
|
${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$a}`)}
|
|
11318
11520
|
|
|
11319
11521
|
Options
|
|
11320
|
-
${utils.getFlagListOutput(
|
|
11522
|
+
${utils.getFlagListOutput({
|
|
11523
|
+
...generalFlags$1,
|
|
11524
|
+
...excludePathsFlag
|
|
11525
|
+
})}
|
|
11321
11526
|
|
|
11322
11527
|
Reachability Options (when --reach is used)
|
|
11323
11528
|
${utils.getFlagListOutput(reachabilityFlags)}
|
|
@@ -11525,6 +11730,8 @@ async function run$d(argv, importMeta, {
|
|
|
11525
11730
|
logger.logger.info(`You can also run \`socket scan setup\` to persist these flag defaults to a ${constants.SOCKET_JSON} file.`);
|
|
11526
11731
|
logger.logger.error('');
|
|
11527
11732
|
}
|
|
11733
|
+
const excludePaths = utils.cmdFlagValueToArray(cli.flags['excludePaths']);
|
|
11734
|
+
assertValidExcludePaths(excludePaths);
|
|
11528
11735
|
const reachExcludePaths = utils.cmdFlagValueToArray(cli.flags['reachExcludePaths']);
|
|
11529
11736
|
|
|
11530
11737
|
// Validation helpers for better readability.
|
|
@@ -11620,6 +11827,7 @@ async function run$d(argv, importMeta, {
|
|
|
11620
11827
|
pendingHead: Boolean(pendingHead),
|
|
11621
11828
|
pullRequest: Number(pullRequest),
|
|
11622
11829
|
reach: {
|
|
11830
|
+
excludePaths,
|
|
11623
11831
|
reachAnalysisMemoryLimit: Number(reachAnalysisMemoryLimit),
|
|
11624
11832
|
reachAnalysisTimeout: Number(reachAnalysisTimeout),
|
|
11625
11833
|
reachConcurrency: Number(reachConcurrency),
|
|
@@ -12278,6 +12486,7 @@ async function scanOneRepo(repoSlug, {
|
|
|
12278
12486
|
pendingHead: true,
|
|
12279
12487
|
pullRequest: 0,
|
|
12280
12488
|
reach: {
|
|
12489
|
+
excludePaths: [],
|
|
12281
12490
|
reachAnalysisMemoryLimit: 0,
|
|
12282
12491
|
reachAnalysisTimeout: 0,
|
|
12283
12492
|
reachConcurrency: 1,
|
|
@@ -13460,7 +13669,7 @@ async function handleScanReach({
|
|
|
13460
13669
|
spinner
|
|
13461
13670
|
} = constants.default;
|
|
13462
13671
|
|
|
13463
|
-
// Get supported file names
|
|
13672
|
+
// Get supported file names.
|
|
13464
13673
|
const supportedFilesCResult = await fetchSupportedScanFileNames({
|
|
13465
13674
|
spinner
|
|
13466
13675
|
});
|
|
@@ -13477,7 +13686,16 @@ async function handleScanReach({
|
|
|
13477
13686
|
// Load socket.yml to respect projectIgnorePaths when collecting files.
|
|
13478
13687
|
const socketYmlResult = utils.findSocketYmlSync(cwd);
|
|
13479
13688
|
const socketConfig = socketYmlResult.ok ? socketYmlResult.data?.parsed : undefined;
|
|
13689
|
+
const {
|
|
13690
|
+
additionalScaIgnores,
|
|
13691
|
+
mergedReachabilityOptions
|
|
13692
|
+
} = applyFullExcludePaths({
|
|
13693
|
+
cwd,
|
|
13694
|
+
reachabilityOptions,
|
|
13695
|
+
target: targets[0]
|
|
13696
|
+
});
|
|
13480
13697
|
const packagePaths = await utils.getPackageFilesForScan(targets, supportedFiles, {
|
|
13698
|
+
additionalIgnores: additionalScaIgnores,
|
|
13481
13699
|
config: socketConfig,
|
|
13482
13700
|
cwd
|
|
13483
13701
|
});
|
|
@@ -13498,7 +13716,7 @@ async function handleScanReach({
|
|
|
13498
13716
|
orgSlug,
|
|
13499
13717
|
outputPath,
|
|
13500
13718
|
packagePaths,
|
|
13501
|
-
reachabilityOptions,
|
|
13719
|
+
reachabilityOptions: mergedReachabilityOptions,
|
|
13502
13720
|
spinner,
|
|
13503
13721
|
target: targets[0],
|
|
13504
13722
|
uploadManifests: true
|
|
@@ -13547,6 +13765,7 @@ async function run$7(argv, importMeta, {
|
|
|
13547
13765
|
hidden: hidden$4,
|
|
13548
13766
|
flags: {
|
|
13549
13767
|
...generalFlags,
|
|
13768
|
+
...excludePathsFlag,
|
|
13550
13769
|
...reachabilityFlags
|
|
13551
13770
|
},
|
|
13552
13771
|
help: command => `
|
|
@@ -13560,7 +13779,10 @@ async function run$7(argv, importMeta, {
|
|
|
13560
13779
|
${utils.getFlagListOutput(generalFlags)}
|
|
13561
13780
|
|
|
13562
13781
|
Reachability Options
|
|
13563
|
-
${utils.getFlagListOutput(
|
|
13782
|
+
${utils.getFlagListOutput({
|
|
13783
|
+
...excludePathsFlag,
|
|
13784
|
+
...reachabilityFlags
|
|
13785
|
+
})}
|
|
13564
13786
|
|
|
13565
13787
|
Runs the Socket reachability analysis without creating a scan in Socket.
|
|
13566
13788
|
The output is written to .socket.facts.json in the current working directory
|
|
@@ -13612,8 +13834,10 @@ async function run$7(argv, importMeta, {
|
|
|
13612
13834
|
const dryRun = !!cli.flags['dryRun'];
|
|
13613
13835
|
|
|
13614
13836
|
// Process comma-separated values for isMultiple flags.
|
|
13837
|
+
const excludePaths = utils.cmdFlagValueToArray(cli.flags['excludePaths']);
|
|
13615
13838
|
const reachEcosystemsRaw = utils.cmdFlagValueToArray(cli.flags['reachEcosystems']);
|
|
13616
13839
|
const reachExcludePaths = utils.cmdFlagValueToArray(cli.flags['reachExcludePaths']);
|
|
13840
|
+
assertValidExcludePaths(excludePaths);
|
|
13617
13841
|
|
|
13618
13842
|
// Validate ecosystem values.
|
|
13619
13843
|
const reachEcosystems = [];
|
|
@@ -13697,6 +13921,7 @@ async function run$7(argv, importMeta, {
|
|
|
13697
13921
|
outputKind,
|
|
13698
13922
|
outputPath: outputPath || '',
|
|
13699
13923
|
reachabilityOptions: {
|
|
13924
|
+
excludePaths,
|
|
13700
13925
|
reachAnalysisMemoryLimit: Number(reachAnalysisMemoryLimit),
|
|
13701
13926
|
reachAnalysisTimeout: Number(reachAnalysisTimeout),
|
|
13702
13927
|
reachConcurrency: Number(reachConcurrency),
|
|
@@ -15640,5 +15865,5 @@ process.on('unhandledRejection', async (reason, promise) => {
|
|
|
15640
15865
|
// eslint-disable-next-line n/no-process-exit
|
|
15641
15866
|
process.exit(1);
|
|
15642
15867
|
});
|
|
15643
|
-
//# debugId=
|
|
15868
|
+
//# debugId=1acf2006-28da-49e4-9572-412f961998c4
|
|
15644
15869
|
//# sourceMappingURL=cli.js.map
|