socket 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/{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/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 -12336
- 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 -106
- 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:3dd0d78f: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}`
|
|
@@ -4825,7 +4846,7 @@ const readLockFileByAgent = (() => {
|
|
|
4825
4846
|
const lockBuffer = await binaryReader(lockPath)
|
|
4826
4847
|
if (lockBuffer) {
|
|
4827
4848
|
try {
|
|
4828
|
-
return
|
|
4849
|
+
return vendor.hyrious__bun_lockbExports.parse(lockBuffer)
|
|
4829
4850
|
} catch {}
|
|
4830
4851
|
}
|
|
4831
4852
|
// To print a Yarn lockfile to your console without writing it to disk
|
|
@@ -5640,7 +5661,7 @@ async function run$z(argv, importMeta, { parentName }) {
|
|
|
5640
5661
|
logger.logger.log(DRY_RUN_BAIL_TEXT$w)
|
|
5641
5662
|
return
|
|
5642
5663
|
}
|
|
5643
|
-
if (!
|
|
5664
|
+
if (!vendor.isInteractiveExports()) {
|
|
5644
5665
|
throw new shadowNpmInject.InputError(
|
|
5645
5666
|
'Cannot prompt for credentials in a non-interactive shell'
|
|
5646
5667
|
)
|
|
@@ -10797,7 +10818,7 @@ async function outputDiffScan(result, { depth, file, outputKind }) {
|
|
|
10797
10818
|
|
|
10798
10819
|
logger.logger.log('Diff scan result:')
|
|
10799
10820
|
logger.logger.log(
|
|
10800
|
-
|
|
10821
|
+
util.inspect(result, {
|
|
10801
10822
|
showHidden: false,
|
|
10802
10823
|
depth: depth > 0 ? depth : null,
|
|
10803
10824
|
colors: true,
|
|
@@ -11753,7 +11774,7 @@ async function outputThreatFeed(data, { outputKind }) {
|
|
|
11753
11774
|
const descriptions = data.results.map(d => d.description)
|
|
11754
11775
|
|
|
11755
11776
|
// Note: this temporarily takes over the terminal (just like `man` does).
|
|
11756
|
-
const ScreenWidget =
|
|
11777
|
+
const ScreenWidget = require('blessed/lib/widgets/screen')
|
|
11757
11778
|
// Lazily access constants.blessedOptions.
|
|
11758
11779
|
const screen = new ScreenWidget({
|
|
11759
11780
|
...constants.blessedOptions
|
|
@@ -11763,9 +11784,7 @@ async function outputThreatFeed(data, { outputKind }) {
|
|
|
11763
11784
|
// node process just to exit it. That's very bad UX.
|
|
11764
11785
|
// eslint-disable-next-line n/no-process-exit
|
|
11765
11786
|
screen.key(['escape', 'q', 'C-c'], () => process.exit(0))
|
|
11766
|
-
const TableWidget =
|
|
11767
|
-
require('blessed-contrib/lib/widget/table')
|
|
11768
|
-
)
|
|
11787
|
+
const TableWidget = require('blessed-contrib/lib/widget/table')
|
|
11769
11788
|
const table = new TableWidget({
|
|
11770
11789
|
keys: 'true',
|
|
11771
11790
|
fg: 'white',
|
|
@@ -11788,7 +11807,7 @@ async function outputThreatFeed(data, { outputKind }) {
|
|
|
11788
11807
|
})
|
|
11789
11808
|
|
|
11790
11809
|
// Create details box at the bottom
|
|
11791
|
-
const BoxWidget =
|
|
11810
|
+
const BoxWidget = require('blessed/lib/widgets/box')
|
|
11792
11811
|
const detailsBox = new BoxWidget({
|
|
11793
11812
|
bottom: 0,
|
|
11794
11813
|
height: '30%',
|
|
@@ -12264,7 +12283,7 @@ void (async () => {
|
|
|
12264
12283
|
await vendor.updater({
|
|
12265
12284
|
name: SOCKET_CLI_BIN_NAME,
|
|
12266
12285
|
// The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION']".
|
|
12267
|
-
version: '0.14.
|
|
12286
|
+
version: '0.14.132',
|
|
12268
12287
|
ttl: 86_400_000 /* 24 hours in milliseconds */
|
|
12269
12288
|
})
|
|
12270
12289
|
try {
|
|
@@ -12301,7 +12320,7 @@ void (async () => {
|
|
|
12301
12320
|
argv: process$1.argv.slice(2),
|
|
12302
12321
|
name: SOCKET_CLI_BIN_NAME,
|
|
12303
12322
|
importMeta: {
|
|
12304
|
-
url: `${require$$0
|
|
12323
|
+
url: `${require$$0.pathToFileURL(__filename)}`
|
|
12305
12324
|
}
|
|
12306
12325
|
}
|
|
12307
12326
|
)
|
|
@@ -12332,5 +12351,5 @@ void (async () => {
|
|
|
12332
12351
|
await shadowNpmInject.captureException(e)
|
|
12333
12352
|
}
|
|
12334
12353
|
})()
|
|
12335
|
-
//# debugId=
|
|
12354
|
+
//# debugId=e85b0d39-f663-4f70-9a00-8166147e6a01
|
|
12336
12355
|
//# sourceMappingURL=cli.js.map
|