socket 1.1.123 → 1.1.124
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 +8 -0
- package/bin/cli.js +33 -1
- package/dist/cli.js +17 -3
- 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/ci/handle-ci.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/handle-create-new-scan.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.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,14 @@ 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.124](https://github.com/SocketDev/socket-cli/releases/tag/v1.1.124) - 2026-06-19
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
- `socket scan create --reach` accepts a new `--reach-retain-facts-file` flag. By default the CLI deletes the `.socket.facts.json` reachability report from the scan directory after a successful scan; pass this flag to keep it (e.g. for inspection or debugging). **Important:** you must delete the retained `.socket.facts.json` before running a fresh tier 1 reachability scan — a stale file left in place is picked up as a pre-generated input and silently overrides fresh analysis, so the new scan results will not be reliable.
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
- Updated the Coana CLI to v `15.5.4`.
|
|
14
|
+
|
|
7
15
|
## [1.1.123](https://github.com/SocketDev/socket-cli/releases/tag/v1.1.123) - 2026-06-18
|
|
8
16
|
|
|
9
17
|
### Added
|
package/bin/cli.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
void (async () => {
|
|
5
5
|
const Module = require('node:module')
|
|
6
|
+
const os = require('node:os')
|
|
6
7
|
const path = require('node:path')
|
|
7
8
|
const rootPath = path.join(__dirname, '..')
|
|
8
9
|
Module.enableCompileCache?.(path.join(rootPath, '.cache'))
|
|
@@ -38,10 +39,41 @@ void (async () => {
|
|
|
38
39
|
},
|
|
39
40
|
)
|
|
40
41
|
|
|
42
|
+
// The child shares our process group and handles the signal itself; wait briefly for it
|
|
43
|
+
// to exit (so its final output isn't printed after the prompt returns) and mirror its
|
|
44
|
+
// exit below. SIGKILL and leave if it outlasts the grace, or on a second signal.
|
|
45
|
+
const SHUTDOWN_GRACE_MS = 3_000
|
|
46
|
+
const hardAbort = signalName => {
|
|
47
|
+
const child = spawnPromise.process
|
|
48
|
+
if (child.exitCode === null && child.signalCode === null) {
|
|
49
|
+
child.kill('SIGKILL')
|
|
50
|
+
}
|
|
51
|
+
// eslint-disable-next-line n/no-process-exit
|
|
52
|
+
process.exit(signalName === 'SIGTERM' ? 143 : 130)
|
|
53
|
+
}
|
|
54
|
+
let sawSignal = false
|
|
55
|
+
const onSignal = signalName => {
|
|
56
|
+
if (sawSignal) {
|
|
57
|
+
hardAbort(signalName)
|
|
58
|
+
return
|
|
59
|
+
}
|
|
60
|
+
sawSignal = true
|
|
61
|
+
setTimeout(() => hardAbort(signalName), SHUTDOWN_GRACE_MS).unref?.()
|
|
62
|
+
}
|
|
63
|
+
const onSigint = () => onSignal('SIGINT')
|
|
64
|
+
const onSigterm = () => onSignal('SIGTERM')
|
|
65
|
+
process.on('SIGINT', onSigint)
|
|
66
|
+
process.on('SIGTERM', onSigterm)
|
|
67
|
+
|
|
41
68
|
// See https://nodejs.org/api/child_process.html#event-exit.
|
|
42
69
|
spawnPromise.process.on('exit', (code, signalName) => {
|
|
43
70
|
if (signalName) {
|
|
44
|
-
|
|
71
|
+
// Mirror a signal death as the conventional 128 + signum exit code. Exit explicitly
|
|
72
|
+
// rather than re-raising the signal: with our handlers installed the re-raise would
|
|
73
|
+
// race `await spawnPromise` resolving and could leave the default exitCode of 1.
|
|
74
|
+
const signum = os.constants.signals[signalName] ?? 0
|
|
75
|
+
// eslint-disable-next-line n/no-process-exit
|
|
76
|
+
process.exit(128 + signum)
|
|
45
77
|
} else if (typeof code === 'number') {
|
|
46
78
|
// eslint-disable-next-line n/no-process-exit
|
|
47
79
|
process.exit(code)
|
package/dist/cli.js
CHANGED
|
@@ -5205,8 +5205,11 @@ async function handleCreateNewScan({
|
|
|
5205
5205
|
// (e.g. from `socket manifest gradle --facts`) are NOT touched here —
|
|
5206
5206
|
// those are user-owned input that the user can clean up themselves; in
|
|
5207
5207
|
// the --reach path coana overwrites that file with its enriched output
|
|
5208
|
-
// anyway, so it's the same path that gets removed.
|
|
5209
|
-
|
|
5208
|
+
// anyway, so it's the same path that gets removed. `--reach-retain-facts-file`
|
|
5209
|
+
// opts out of this cleanup so the report can be inspected; the user is then
|
|
5210
|
+
// responsible for deleting it before the next tier 1 scan (a stale file is
|
|
5211
|
+
// picked up as pre-generated input and would make those results unreliable).
|
|
5212
|
+
if (fullScanCResult.ok && scanId && reachabilityReport && !reach.reachRetainFactsFile) {
|
|
5210
5213
|
try {
|
|
5211
5214
|
await fs.unlink(path.resolve(cwd, reachabilityReport));
|
|
5212
5215
|
require$$9.debugFn('notice', `[socket-facts] removed coana output after successful scan: ${reachabilityReport}`);
|
|
@@ -5304,6 +5307,7 @@ async function handleCi(autoManifest) {
|
|
|
5304
5307
|
reachEnableAnalysisSplitting: false,
|
|
5305
5308
|
reachExcludePaths: [],
|
|
5306
5309
|
reachLazyMode: false,
|
|
5310
|
+
reachRetainFactsFile: false,
|
|
5307
5311
|
reachSkipCache: false,
|
|
5308
5312
|
reachUseOnlyPregeneratedSboms: false,
|
|
5309
5313
|
reachVersion: undefined,
|
|
@@ -15729,6 +15733,11 @@ const reachabilityFlags = {
|
|
|
15729
15733
|
description: 'Enable lazy mode for reachability analysis.',
|
|
15730
15734
|
hidden: true
|
|
15731
15735
|
},
|
|
15736
|
+
reachRetainFactsFile: {
|
|
15737
|
+
type: 'boolean',
|
|
15738
|
+
default: false,
|
|
15739
|
+
description: 'Keep the `.socket.facts.json` reachability report that the analysis writes to the scan directory instead of deleting it after a successful scan. IMPORTANT: you must delete this file before running a fresh tier 1 reachability scan. A stale `.socket.facts.json` left in place is picked up as a pre-generated input and silently overrides fresh analysis, so the new scan results will not be reliable.'
|
|
15740
|
+
},
|
|
15732
15741
|
reachSkipCache: {
|
|
15733
15742
|
type: 'boolean',
|
|
15734
15743
|
default: false,
|
|
@@ -16004,6 +16013,7 @@ async function run$d(argv, importMeta, {
|
|
|
16004
16013
|
reachDisableExternalToolChecks,
|
|
16005
16014
|
reachEnableAnalysisSplitting,
|
|
16006
16015
|
reachLazyMode,
|
|
16016
|
+
reachRetainFactsFile,
|
|
16007
16017
|
reachSkipCache,
|
|
16008
16018
|
reachUseOnlyPregeneratedSboms,
|
|
16009
16019
|
reachVersion,
|
|
@@ -16271,6 +16281,7 @@ async function run$d(argv, importMeta, {
|
|
|
16271
16281
|
reachEnableAnalysisSplitting: Boolean(reachEnableAnalysisSplitting),
|
|
16272
16282
|
reachExcludePaths,
|
|
16273
16283
|
reachLazyMode: Boolean(reachLazyMode),
|
|
16284
|
+
reachRetainFactsFile: Boolean(reachRetainFactsFile),
|
|
16274
16285
|
reachSkipCache: Boolean(reachSkipCache),
|
|
16275
16286
|
reachUseOnlyPregeneratedSboms: Boolean(reachUseOnlyPregeneratedSboms),
|
|
16276
16287
|
reachVersion,
|
|
@@ -16930,6 +16941,7 @@ async function scanOneRepo(repoSlug, {
|
|
|
16930
16941
|
reachEnableAnalysisSplitting: false,
|
|
16931
16942
|
reachExcludePaths: [],
|
|
16932
16943
|
reachLazyMode: false,
|
|
16944
|
+
reachRetainFactsFile: false,
|
|
16933
16945
|
reachSkipCache: false,
|
|
16934
16946
|
reachUseOnlyPregeneratedSboms: false,
|
|
16935
16947
|
reachVersion: undefined,
|
|
@@ -18277,6 +18289,7 @@ async function run$7(argv, importMeta, {
|
|
|
18277
18289
|
reachDisableExternalToolChecks,
|
|
18278
18290
|
reachEnableAnalysisSplitting,
|
|
18279
18291
|
reachLazyMode,
|
|
18292
|
+
reachRetainFactsFile,
|
|
18280
18293
|
reachSkipCache,
|
|
18281
18294
|
reachUseOnlyPregeneratedSboms,
|
|
18282
18295
|
reachVersion
|
|
@@ -18387,6 +18400,7 @@ async function run$7(argv, importMeta, {
|
|
|
18387
18400
|
reachEnableAnalysisSplitting: Boolean(reachEnableAnalysisSplitting),
|
|
18388
18401
|
reachExcludePaths,
|
|
18389
18402
|
reachLazyMode: Boolean(reachLazyMode),
|
|
18403
|
+
reachRetainFactsFile: Boolean(reachRetainFactsFile),
|
|
18390
18404
|
reachSkipCache: Boolean(reachSkipCache),
|
|
18391
18405
|
reachUseOnlyPregeneratedSboms: Boolean(reachUseOnlyPregeneratedSboms),
|
|
18392
18406
|
reachVersion
|
|
@@ -20315,5 +20329,5 @@ process.on('unhandledRejection', async (reason, promise) => {
|
|
|
20315
20329
|
// eslint-disable-next-line n/no-process-exit
|
|
20316
20330
|
process.exit(1);
|
|
20317
20331
|
});
|
|
20318
|
-
//# debugId=
|
|
20332
|
+
//# debugId=3456501d-db35-49f6-b25b-d2bd0fbae11f
|
|
20319
20333
|
//# sourceMappingURL=cli.js.map
|