@socketsecurity/cli-with-sentry 0.14.130 → 0.14.132
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 +37 -44
- package/bin/npx-cli.js +1 -3
- package/dist/{module-sync/cli.js → cli.js} +55 -36
- package/dist/cli.js.map +1 -0
- package/dist/constants.js +8 -25
- package/dist/constants.js.map +1 -1
- package/dist/instrument-with-sentry.js +3 -14
- package/dist/instrument-with-sentry.js.map +1 -1
- package/dist/{module-sync/shadow-bin.js → shadow-bin.js} +52 -1
- package/dist/shadow-bin.js.map +1 -0
- package/dist/{module-sync/shadow-npm-inject.js → shadow-npm-inject.js} +60 -16
- package/dist/shadow-npm-inject.js.map +1 -0
- package/dist/shadow-npm-paths.js.map +1 -0
- package/dist/{module-sync/vendor.js → vendor.js} +10320 -4778
- package/dist/vendor.js.map +1 -0
- package/package.json +16 -26
- package/dist/constants.d.ts +0 -285
- package/dist/instrument-with-sentry.d.ts +0 -1
- package/dist/module-sync/arborist-helpers.d.ts +0 -68
- package/dist/module-sync/artifact.d.ts +0 -63
- package/dist/module-sync/cli.d.ts +0 -2
- package/dist/module-sync/cli.js.map +0 -1
- package/dist/module-sync/cmd.d.ts +0 -4
- package/dist/module-sync/config.d.ts +0 -44
- package/dist/module-sync/constants.js +0 -3
- package/dist/module-sync/edge.d.ts +0 -78
- package/dist/module-sync/errors.d.ts +0 -29
- package/dist/module-sync/fs.d.ts +0 -63
- package/dist/module-sync/index.d.ts +0 -34
- package/dist/module-sync/node.d.ts +0 -121
- package/dist/module-sync/override-set.d.ts +0 -43
- package/dist/module-sync/package-environment.d.ts +0 -83
- package/dist/module-sync/path-resolve.d.ts +0 -15
- package/dist/module-sync/sdk.d.ts +0 -9
- package/dist/module-sync/semver.d.ts +0 -17
- package/dist/module-sync/shadow-bin.d.ts +0 -5
- package/dist/module-sync/shadow-bin.js.map +0 -1
- package/dist/module-sync/shadow-npm-inject.d.ts +0 -1
- package/dist/module-sync/shadow-npm-inject.js.map +0 -1
- package/dist/module-sync/shadow-npm-paths.d.ts +0 -27
- package/dist/module-sync/shadow-npm-paths.js.map +0 -1
- package/dist/module-sync/socket-package-alert.d.ts +0 -104
- package/dist/module-sync/vendor.d.ts +0 -0
- package/dist/module-sync/vendor.js.map +0 -1
- package/dist/require/cli.d.ts +0 -2
- package/dist/require/cli.js +0 -12340
- package/dist/require/cli.js.map +0 -1
- package/dist/require/constants.js +0 -3
- package/dist/require/shadow-bin.d.ts +0 -5
- package/dist/require/shadow-bin.js +0 -110
- package/dist/require/shadow-bin.js.map +0 -1
- package/dist/require/shadow-npm-inject.d.ts +0 -1
- package/dist/require/shadow-npm-inject.js +0 -2596
- package/dist/require/shadow-npm-inject.js.map +0 -1
- package/dist/require/shadow-npm-paths.d.ts +0 -27
- package/dist/require/shadow-npm-paths.js +0 -292
- package/dist/require/shadow-npm-paths.js.map +0 -1
- package/dist/require/vendor.js +0 -3
- /package/dist/{module-sync/shadow-npm-paths.js → shadow-npm-paths.js} +0 -0
package/bin/cli.js
CHANGED
|
@@ -3,51 +3,44 @@
|
|
|
3
3
|
|
|
4
4
|
const process = require('node:process')
|
|
5
5
|
|
|
6
|
+
const { spawn } = require('@socketsecurity/registry/lib/spawn')
|
|
7
|
+
|
|
6
8
|
const constants = require('../dist/constants')
|
|
7
9
|
|
|
8
|
-
const {
|
|
10
|
+
const { INLINED_SOCKET_CLI_SENTRY_BUILD } = constants
|
|
11
|
+
|
|
12
|
+
process.exitCode = 1
|
|
9
13
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
stdio: 'inherit'
|
|
14
|
+
spawn(
|
|
15
|
+
// Lazily access constants.execPath.
|
|
16
|
+
constants.execPath,
|
|
17
|
+
[
|
|
18
|
+
// Lazily access constants.nodeHardenFlags.
|
|
19
|
+
...constants.nodeHardenFlags,
|
|
20
|
+
// Lazily access constants.nodeNoWarningsFlags.
|
|
21
|
+
...constants.nodeNoWarningsFlags,
|
|
22
|
+
// Lazily access constants.ENV[INLINED_SOCKET_CLI_SENTRY_BUILD].
|
|
23
|
+
...(constants.ENV[INLINED_SOCKET_CLI_SENTRY_BUILD]
|
|
24
|
+
? [
|
|
25
|
+
'--require',
|
|
26
|
+
// Lazily access constants.distInstrumentWithSentryPath.
|
|
27
|
+
constants.distInstrumentWithSentryPath
|
|
28
|
+
]
|
|
29
|
+
: []),
|
|
30
|
+
// Lazily access constants.distCliPath.
|
|
31
|
+
constants.distCliPath,
|
|
32
|
+
...process.argv.slice(2)
|
|
33
|
+
],
|
|
34
|
+
{
|
|
35
|
+
stdio: 'inherit'
|
|
36
|
+
}
|
|
37
|
+
)
|
|
38
|
+
// See https://nodejs.org/api/all.html#all_child_process_event-exit.
|
|
39
|
+
.process.on('exit', (code, signalName) => {
|
|
40
|
+
if (signalName) {
|
|
41
|
+
process.kill(process.pid, signalName)
|
|
42
|
+
} else if (code !== null) {
|
|
43
|
+
// eslint-disable-next-line n/no-process-exit
|
|
44
|
+
process.exit(code)
|
|
42
45
|
}
|
|
43
|
-
)
|
|
44
|
-
// See https://nodejs.org/api/all.html#all_child_process_event-exit.
|
|
45
|
-
.process.on('exit', (code, signalName) => {
|
|
46
|
-
if (signalName) {
|
|
47
|
-
process.kill(process.pid, signalName)
|
|
48
|
-
} else if (code !== null) {
|
|
49
|
-
// eslint-disable-next-line n/no-process-exit
|
|
50
|
-
process.exit(code)
|
|
51
|
-
}
|
|
52
|
-
})
|
|
53
|
-
}
|
|
46
|
+
})
|
package/bin/npx-cli.js
CHANGED
|
@@ -1,18 +1,7 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
function _socketInterop(e) {
|
|
4
|
-
let c = 0
|
|
5
|
-
for (const k in e ?? {}) {
|
|
6
|
-
c = c === 0 && k === 'default' ? 1 : 0
|
|
7
|
-
if (!c && k !== '__esModule') {
|
|
8
|
-
break
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
return c ? e.default : e
|
|
12
|
-
}
|
|
13
|
-
|
|
14
3
|
const process$1 = require('node:process')
|
|
15
|
-
const require$$0
|
|
4
|
+
const require$$0 = require('node:url')
|
|
16
5
|
const vendor = require('./vendor.js')
|
|
17
6
|
const debug = require('@socketsecurity/registry/lib/debug')
|
|
18
7
|
const logger = require('@socketsecurity/registry/lib/logger')
|
|
@@ -30,18 +19,50 @@ const fs$1 = require('node:fs')
|
|
|
30
19
|
const shadowBin = require('./shadow-bin.js')
|
|
31
20
|
const prompts = require('@socketsecurity/registry/lib/prompts')
|
|
32
21
|
const shadowNpmPaths = require('./shadow-npm-paths.js')
|
|
33
|
-
const
|
|
22
|
+
const util = require('node:util')
|
|
34
23
|
const arrays = require('@socketsecurity/registry/lib/arrays')
|
|
35
24
|
const registry = require('@socketsecurity/registry')
|
|
36
25
|
const npm = require('@socketsecurity/registry/lib/npm')
|
|
37
26
|
const packages = require('@socketsecurity/registry/lib/packages')
|
|
38
|
-
const packageurlJs = require('@socketregistry/packageurl-js')
|
|
39
27
|
const spawn = require('@socketsecurity/registry/lib/spawn')
|
|
40
|
-
const index_cjs = require('@socketregistry/hyrious__bun.lockb/index.cjs')
|
|
41
28
|
const sorts = require('@socketsecurity/registry/lib/sorts')
|
|
42
29
|
const registryConstants = require('@socketsecurity/registry/lib/constants')
|
|
43
|
-
const isInteractive = require('@socketregistry/is-interactive/index.cjs')
|
|
44
30
|
const promises = require('@socketsecurity/registry/lib/promises')
|
|
31
|
+
require('node:os')
|
|
32
|
+
require('node:buffer')
|
|
33
|
+
require('node:util')
|
|
34
|
+
require('node:path')
|
|
35
|
+
require('node:fs')
|
|
36
|
+
require('node:tty')
|
|
37
|
+
require('node:https')
|
|
38
|
+
require('node:http')
|
|
39
|
+
require('node:url')
|
|
40
|
+
require('node:process')
|
|
41
|
+
require('node:events')
|
|
42
|
+
require('node:http')
|
|
43
|
+
require('node:https')
|
|
44
|
+
require('node:readline')
|
|
45
|
+
require('@socketsecurity/registry/lib/constants/abort-signal')
|
|
46
|
+
require('node:fs/promises')
|
|
47
|
+
require('node:child_process')
|
|
48
|
+
require('node:os')
|
|
49
|
+
require('node:tty')
|
|
50
|
+
require('node:crypto')
|
|
51
|
+
require('node:constants')
|
|
52
|
+
require('node:stream')
|
|
53
|
+
require('node:assert')
|
|
54
|
+
require('node:stream')
|
|
55
|
+
require('node:string_decoder')
|
|
56
|
+
require('node:path/win32')
|
|
57
|
+
require('node:module')
|
|
58
|
+
require('node:events')
|
|
59
|
+
require('node:buffer')
|
|
60
|
+
require('node:string_decoder')
|
|
61
|
+
require('node:child_process')
|
|
62
|
+
require('@socketsecurity/registry/lib/fs')
|
|
63
|
+
require('node:timers/promises')
|
|
64
|
+
require('node:module')
|
|
65
|
+
require('@socketsecurity/registry/lib/env')
|
|
45
66
|
|
|
46
67
|
function failMsgWithBadge(badge, msg) {
|
|
47
68
|
return `${vendor.yoctocolorsCjsExports.bgRed(vendor.yoctocolorsCjsExports.bold(vendor.yoctocolorsCjsExports.white(` ${badge}: `)))} ${vendor.yoctocolorsCjsExports.bold(msg)}`
|
|
@@ -401,12 +422,12 @@ ${mdTableStringNumber('Name', 'Counts', data['top_five_alert_types'])}
|
|
|
401
422
|
`
|
|
402
423
|
}
|
|
403
424
|
function displayAnalyticsScreen(data) {
|
|
404
|
-
const ScreenWidget =
|
|
425
|
+
const ScreenWidget = require('blessed/lib/widgets/screen')
|
|
405
426
|
// Lazily access constants.blessedOptions.
|
|
406
427
|
const screen = new ScreenWidget({
|
|
407
428
|
...constants.blessedOptions
|
|
408
429
|
})
|
|
409
|
-
const contrib =
|
|
430
|
+
const contrib = require('blessed-contrib')
|
|
410
431
|
const grid = new contrib.grid({
|
|
411
432
|
rows: 5,
|
|
412
433
|
cols: 4,
|
|
@@ -564,7 +585,7 @@ function formatDate(date) {
|
|
|
564
585
|
return `${Months[new Date(date).getMonth()]} ${new Date(date).getDate()}`
|
|
565
586
|
}
|
|
566
587
|
function renderLineCharts(grid, screen, title, coords, data) {
|
|
567
|
-
const contrib =
|
|
588
|
+
const contrib = require('blessed-contrib')
|
|
568
589
|
const line = grid.set(...coords, contrib.line, {
|
|
569
590
|
style: {
|
|
570
591
|
line: 'cyan',
|
|
@@ -917,7 +938,7 @@ function emitBanner(name) {
|
|
|
917
938
|
logger.logger.error(getAsciiHeader(name))
|
|
918
939
|
}
|
|
919
940
|
function getAsciiHeader(command) {
|
|
920
|
-
const cliVersion = '0.14.
|
|
941
|
+
const cliVersion = '0.14.132:afe2c00:74378e05:pub' // The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION_HASH']".
|
|
921
942
|
const nodeVersion = process$1.version
|
|
922
943
|
const apiToken = shadowNpmInject.getDefaultToken()
|
|
923
944
|
const defaultOrg = shadowNpmInject.getConfigValue('defaultOrg')
|
|
@@ -3535,7 +3556,7 @@ async function outputDiffScan$1(result, { depth, file, outputKind }) {
|
|
|
3535
3556
|
|
|
3536
3557
|
logger.logger.log('Diff scan result:')
|
|
3537
3558
|
logger.logger.log(
|
|
3538
|
-
|
|
3559
|
+
util.inspect(result, {
|
|
3539
3560
|
showHidden: false,
|
|
3540
3561
|
depth: depth > 0 ? depth : null,
|
|
3541
3562
|
colors: true,
|
|
@@ -3746,7 +3767,7 @@ function getBaseGitBranch() {
|
|
|
3746
3767
|
)
|
|
3747
3768
|
}
|
|
3748
3769
|
function getSocketBranchName(purl, newVersion, workspaceName) {
|
|
3749
|
-
const purlObj =
|
|
3770
|
+
const purlObj = vendor.packageurlJsExports.PackageURL.fromString(purl)
|
|
3750
3771
|
const maybeWorkspaceName = workspaceName
|
|
3751
3772
|
? `${formatBranchName(workspaceName)}-`
|
|
3752
3773
|
: ''
|
|
@@ -3757,19 +3778,19 @@ function getSocketBranchName(purl, newVersion, workspaceName) {
|
|
|
3757
3778
|
return `socket-fix-${fullName}-${formatBranchName(newVersion)}`
|
|
3758
3779
|
}
|
|
3759
3780
|
function getSocketPullRequestTitle(purl, newVersion, workspaceName) {
|
|
3760
|
-
const purlObj =
|
|
3781
|
+
const purlObj = vendor.packageurlJsExports.PackageURL.fromString(purl)
|
|
3761
3782
|
const pkgName = getPkgNameFromPurlObj(purlObj)
|
|
3762
3783
|
const workspaceDetails = workspaceName ? ` in ${workspaceName}` : ''
|
|
3763
3784
|
return `Bump ${pkgName} from ${purlObj.version} to ${newVersion}${workspaceDetails}`
|
|
3764
3785
|
}
|
|
3765
3786
|
function getSocketPullRequestBody(purl, newVersion, workspaceName) {
|
|
3766
|
-
const purlObj =
|
|
3787
|
+
const purlObj = vendor.packageurlJsExports.PackageURL.fromString(purl)
|
|
3767
3788
|
const pkgName = getPkgNameFromPurlObj(purlObj)
|
|
3768
3789
|
const workspaceDetails = workspaceName ? ` in ${workspaceName}` : ''
|
|
3769
3790
|
return `Bumps [${pkgName}](https://socket.dev/${purlObj.type}/package/${pkgName}) from ${purlObj.version} to ${newVersion}${workspaceDetails}.`
|
|
3770
3791
|
}
|
|
3771
3792
|
function getSocketCommitMessage(purl, newVersion, workspaceName) {
|
|
3772
|
-
const purlObj =
|
|
3793
|
+
const purlObj = vendor.packageurlJsExports.PackageURL.fromString(purl)
|
|
3773
3794
|
const pkgName = getPkgNameFromPurlObj(purlObj)
|
|
3774
3795
|
const workspaceDetails = workspaceName ? ` in ${workspaceName}` : ''
|
|
3775
3796
|
return `socket: Bump ${pkgName} from ${purlObj.version} to ${newVersion}${workspaceDetails}`
|
|
@@ -4829,7 +4850,7 @@ const readLockFileByAgent = (() => {
|
|
|
4829
4850
|
const lockBuffer = await binaryReader(lockPath)
|
|
4830
4851
|
if (lockBuffer) {
|
|
4831
4852
|
try {
|
|
4832
|
-
return
|
|
4853
|
+
return vendor.hyrious__bun_lockbExports.parse(lockBuffer)
|
|
4833
4854
|
} catch {}
|
|
4834
4855
|
}
|
|
4835
4856
|
// To print a Yarn lockfile to your console without writing it to disk
|
|
@@ -5644,7 +5665,7 @@ async function run$z(argv, importMeta, { parentName }) {
|
|
|
5644
5665
|
logger.logger.log(DRY_RUN_BAIL_TEXT$w)
|
|
5645
5666
|
return
|
|
5646
5667
|
}
|
|
5647
|
-
if (!
|
|
5668
|
+
if (!vendor.isInteractiveExports()) {
|
|
5648
5669
|
throw new shadowNpmInject.InputError(
|
|
5649
5670
|
'Cannot prompt for credentials in a non-interactive shell'
|
|
5650
5671
|
)
|
|
@@ -10801,7 +10822,7 @@ async function outputDiffScan(result, { depth, file, outputKind }) {
|
|
|
10801
10822
|
|
|
10802
10823
|
logger.logger.log('Diff scan result:')
|
|
10803
10824
|
logger.logger.log(
|
|
10804
|
-
|
|
10825
|
+
util.inspect(result, {
|
|
10805
10826
|
showHidden: false,
|
|
10806
10827
|
depth: depth > 0 ? depth : null,
|
|
10807
10828
|
colors: true,
|
|
@@ -11757,7 +11778,7 @@ async function outputThreatFeed(data, { outputKind }) {
|
|
|
11757
11778
|
const descriptions = data.results.map(d => d.description)
|
|
11758
11779
|
|
|
11759
11780
|
// Note: this temporarily takes over the terminal (just like `man` does).
|
|
11760
|
-
const ScreenWidget =
|
|
11781
|
+
const ScreenWidget = require('blessed/lib/widgets/screen')
|
|
11761
11782
|
// Lazily access constants.blessedOptions.
|
|
11762
11783
|
const screen = new ScreenWidget({
|
|
11763
11784
|
...constants.blessedOptions
|
|
@@ -11767,9 +11788,7 @@ async function outputThreatFeed(data, { outputKind }) {
|
|
|
11767
11788
|
// node process just to exit it. That's very bad UX.
|
|
11768
11789
|
// eslint-disable-next-line n/no-process-exit
|
|
11769
11790
|
screen.key(['escape', 'q', 'C-c'], () => process.exit(0))
|
|
11770
|
-
const TableWidget =
|
|
11771
|
-
require('blessed-contrib/lib/widget/table')
|
|
11772
|
-
)
|
|
11791
|
+
const TableWidget = require('blessed-contrib/lib/widget/table')
|
|
11773
11792
|
const table = new TableWidget({
|
|
11774
11793
|
keys: 'true',
|
|
11775
11794
|
fg: 'white',
|
|
@@ -11792,7 +11811,7 @@ async function outputThreatFeed(data, { outputKind }) {
|
|
|
11792
11811
|
})
|
|
11793
11812
|
|
|
11794
11813
|
// Create details box at the bottom
|
|
11795
|
-
const BoxWidget =
|
|
11814
|
+
const BoxWidget = require('blessed/lib/widgets/box')
|
|
11796
11815
|
const detailsBox = new BoxWidget({
|
|
11797
11816
|
bottom: 0,
|
|
11798
11817
|
height: '30%',
|
|
@@ -12268,7 +12287,7 @@ void (async () => {
|
|
|
12268
12287
|
await vendor.updater({
|
|
12269
12288
|
name: SOCKET_CLI_BIN_NAME,
|
|
12270
12289
|
// The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION']".
|
|
12271
|
-
version: '0.14.
|
|
12290
|
+
version: '0.14.132',
|
|
12272
12291
|
ttl: 86_400_000 /* 24 hours in milliseconds */
|
|
12273
12292
|
})
|
|
12274
12293
|
try {
|
|
@@ -12305,7 +12324,7 @@ void (async () => {
|
|
|
12305
12324
|
argv: process$1.argv.slice(2),
|
|
12306
12325
|
name: SOCKET_CLI_BIN_NAME,
|
|
12307
12326
|
importMeta: {
|
|
12308
|
-
url: `${require$$0
|
|
12327
|
+
url: `${require$$0.pathToFileURL(__filename)}`
|
|
12309
12328
|
}
|
|
12310
12329
|
}
|
|
12311
12330
|
)
|
|
@@ -12336,5 +12355,5 @@ void (async () => {
|
|
|
12336
12355
|
await shadowNpmInject.captureException(e)
|
|
12337
12356
|
}
|
|
12338
12357
|
})()
|
|
12339
|
-
//# debugId=
|
|
12358
|
+
//# debugId=2d4ae1ac-fc1e-4b1f-93f6-015518415bf
|
|
12340
12359
|
//# sourceMappingURL=cli.js.map
|