@socketsecurity/cli-with-sentry 0.14.93 → 0.14.95
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/dist/constants.js +3 -3
- package/dist/constants.js.map +1 -1
- package/dist/instrument-with-sentry.js +2 -2
- package/dist/instrument-with-sentry.js.map +1 -1
- package/dist/module-sync/cli.js +177 -157
- package/dist/module-sync/cli.js.map +1 -1
- package/dist/module-sync/shadow-bin.js +3 -14
- package/dist/module-sync/shadow-bin.js.map +1 -1
- package/dist/module-sync/shadow-npm-inject.js +68 -59
- package/dist/module-sync/shadow-npm-inject.js.map +1 -1
- package/dist/module-sync/shadow-npm-paths.js +16 -29
- package/dist/module-sync/shadow-npm-paths.js.map +1 -1
- package/dist/module-sync/vendor.d.ts +0 -0
- package/dist/module-sync/vendor.js +85829 -12598
- package/dist/module-sync/vendor.js.map +1 -1
- package/dist/require/cli.js +159 -138
- package/dist/require/cli.js.map +1 -1
- package/dist/require/shadow-bin.d.ts +5 -0
- package/dist/require/shadow-bin.js +108 -1
- package/dist/require/shadow-bin.js.map +1 -0
- package/dist/require/shadow-npm-inject.d.ts +1 -0
- package/dist/require/shadow-npm-inject.js +2335 -1
- package/dist/require/shadow-npm-inject.js.map +1 -0
- package/dist/require/shadow-npm-paths.d.ts +29 -0
- package/dist/require/shadow-npm-paths.js +454 -1
- package/dist/require/shadow-npm-paths.js.map +1 -0
- package/package.json +29 -29
- package/dist/blessed/lib/alias.js +0 -521
- package/dist/blessed/lib/blessed.js +0 -34
- package/dist/blessed/lib/colors.js +0 -492
- package/dist/blessed/lib/events.js +0 -197
- package/dist/blessed/lib/gpmclient.js +0 -247
- package/dist/blessed/lib/helpers.js +0 -172
- package/dist/blessed/lib/keys.js +0 -514
- package/dist/blessed/lib/program.js +0 -4532
- package/dist/blessed/lib/tput.js +0 -3113
- package/dist/blessed/lib/unicode.js +0 -914
- package/dist/blessed/lib/widget.js +0 -62
- package/dist/blessed/lib/widgets/ansiimage.js +0 -175
- package/dist/blessed/lib/widgets/bigtext.js +0 -172
- package/dist/blessed/lib/widgets/box.js +0 -36
- package/dist/blessed/lib/widgets/button.js +0 -64
- package/dist/blessed/lib/widgets/checkbox.js +0 -97
- package/dist/blessed/lib/widgets/element.js +0 -2873
- package/dist/blessed/lib/widgets/filemanager.js +0 -225
- package/dist/blessed/lib/widgets/form.js +0 -303
- package/dist/blessed/lib/widgets/image.js +0 -73
- package/dist/blessed/lib/widgets/input.js +0 -36
- package/dist/blessed/lib/widgets/layout.js +0 -251
- package/dist/blessed/lib/widgets/line.js +0 -61
- package/dist/blessed/lib/widgets/list.js +0 -654
- package/dist/blessed/lib/widgets/listbar.js +0 -454
- package/dist/blessed/lib/widgets/listtable.js +0 -267
- package/dist/blessed/lib/widgets/loading.js +0 -90
- package/dist/blessed/lib/widgets/log.js +0 -84
- package/dist/blessed/lib/widgets/message.js +0 -147
- package/dist/blessed/lib/widgets/node.js +0 -315
- package/dist/blessed/lib/widgets/overlayimage.js +0 -796
- package/dist/blessed/lib/widgets/progressbar.js +0 -168
- package/dist/blessed/lib/widgets/prompt.js +0 -129
- package/dist/blessed/lib/widgets/question.js +0 -131
- package/dist/blessed/lib/widgets/radiobutton.js +0 -64
- package/dist/blessed/lib/widgets/radioset.js +0 -38
- package/dist/blessed/lib/widgets/screen.js +0 -2487
- package/dist/blessed/lib/widgets/scrollablebox.js +0 -417
- package/dist/blessed/lib/widgets/scrollabletext.js +0 -37
- package/dist/blessed/lib/widgets/table.js +0 -385
- package/dist/blessed/lib/widgets/terminal.js +0 -454
- package/dist/blessed/lib/widgets/text.js +0 -37
- package/dist/blessed/lib/widgets/textarea.js +0 -378
- package/dist/blessed/lib/widgets/textbox.js +0 -81
- package/dist/blessed/lib/widgets/video.js +0 -132
- package/dist/blessed/usr/fonts/AUTHORS +0 -1
- package/dist/blessed/usr/fonts/LICENSE +0 -94
- package/dist/blessed/usr/fonts/README +0 -340
- package/dist/blessed/usr/fonts/ter-u14b.json +0 -17826
- package/dist/blessed/usr/fonts/ter-u14n.json +0 -17826
- package/dist/blessed/usr/linux +0 -0
- package/dist/blessed/usr/windows-ansi +0 -0
- package/dist/blessed/usr/xterm +0 -0
- package/dist/blessed/usr/xterm-256color +0 -0
- package/dist/blessed/usr/xterm.termcap +0 -243
- package/dist/blessed/usr/xterm.terminfo +0 -1977
- package/dist/blessed/vendor/tng.js +0 -1878
package/dist/require/cli.js
CHANGED
|
@@ -12,54 +12,38 @@ function _socketInterop(e) {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
const process$1 = require('node:process')
|
|
15
|
-
const require$$0 = require('node:url')
|
|
16
|
-
const ponyCause = _socketInterop(require('pony-cause'))
|
|
15
|
+
const require$$0$2 = require('node:url')
|
|
17
16
|
const vendor = require('./vendor.js')
|
|
18
17
|
const debug = require('@socketsecurity/registry/lib/debug')
|
|
19
18
|
const logger = require('@socketsecurity/registry/lib/logger')
|
|
20
19
|
const assert = require('node:assert')
|
|
21
20
|
const fs = require('node:fs/promises')
|
|
22
|
-
const commonTags = _socketInterop(require('common-tags'))
|
|
23
21
|
const strings = require('@socketsecurity/registry/lib/strings')
|
|
24
22
|
const shadowNpmInject = require('./shadow-npm-inject.js')
|
|
25
23
|
const constants = require('./constants.js')
|
|
26
|
-
const colors = _socketInterop(require('yoctocolors-cjs'))
|
|
27
24
|
const path$1 = require('node:path')
|
|
28
25
|
const objects = require('@socketsecurity/registry/lib/objects')
|
|
29
26
|
const path = require('@socketsecurity/registry/lib/path')
|
|
30
27
|
const regexps = require('@socketsecurity/registry/lib/regexps')
|
|
31
|
-
const yargsParse = _socketInterop(require('yargs-parser'))
|
|
32
28
|
const words = require('@socketsecurity/registry/lib/words')
|
|
33
|
-
const
|
|
29
|
+
const require$$0 = require('node:fs')
|
|
34
30
|
const shadowBin = require('./shadow-bin.js')
|
|
35
31
|
const prompts = require('@socketsecurity/registry/lib/prompts')
|
|
36
32
|
const shadowNpmPaths = require('./shadow-npm-paths.js')
|
|
37
|
-
const chalkTable = _socketInterop(require('chalk-table'))
|
|
38
33
|
const require$$0$1 = require('node:util')
|
|
39
|
-
const terminalLink = _socketInterop(require('terminal-link'))
|
|
40
34
|
const arrays = require('@socketsecurity/registry/lib/arrays')
|
|
41
35
|
const registry = require('@socketsecurity/registry')
|
|
42
36
|
const npm = require('@socketsecurity/registry/lib/npm')
|
|
43
37
|
const packages = require('@socketsecurity/registry/lib/packages')
|
|
44
38
|
const spawn = require('@socketsecurity/registry/lib/spawn')
|
|
45
|
-
const lockfile_fs = _socketInterop(require('@pnpm/lockfile.fs'))
|
|
46
|
-
const lockfile_detectDepTypes = _socketInterop(
|
|
47
|
-
require('@pnpm/lockfile.detect-dep-types')
|
|
48
|
-
)
|
|
49
|
-
const browserslist = _socketInterop(require('browserslist'))
|
|
50
|
-
const semver = _socketInterop(require('semver'))
|
|
51
|
-
const which = _socketInterop(require('which'))
|
|
52
39
|
const index_cjs = require('@socketregistry/hyrious__bun.lockb/index.cjs')
|
|
53
40
|
const sorts = require('@socketsecurity/registry/lib/sorts')
|
|
54
41
|
const registryConstants = require('@socketsecurity/registry/lib/constants')
|
|
55
42
|
const isInteractive = require('@socketregistry/is-interactive/index.cjs')
|
|
56
|
-
const npa = _socketInterop(require('npm-package-arg'))
|
|
57
|
-
const tinyglobby = _socketInterop(require('tinyglobby'))
|
|
58
43
|
const promises = require('@socketsecurity/registry/lib/promises')
|
|
59
|
-
const yaml = _socketInterop(require('yaml'))
|
|
60
44
|
|
|
61
45
|
function failMsgWithBadge(badge, msg) {
|
|
62
|
-
return `${
|
|
46
|
+
return `${vendor.yoctocolorsCjsExports.bgRed(vendor.yoctocolorsCjsExports.bold(vendor.yoctocolorsCjsExports.white(` ${badge}: `)))} ${vendor.yoctocolorsCjsExports.bold(msg)}`
|
|
63
47
|
}
|
|
64
48
|
|
|
65
49
|
function handleUnsuccessfulApiResponse(_name, sockSdkError) {
|
|
@@ -362,7 +346,7 @@ function renderJson(data) {
|
|
|
362
346
|
}
|
|
363
347
|
}
|
|
364
348
|
function renderMarkdown(data, days, repoSlug) {
|
|
365
|
-
return
|
|
349
|
+
return vendor.stripIndents`
|
|
366
350
|
# Socket Alert Analytics
|
|
367
351
|
|
|
368
352
|
These are the Socket.dev stats are analytics for the ${repoSlug ? `${repoSlug} repo` : 'org'} of the past ${days} days
|
|
@@ -402,7 +386,7 @@ ${[
|
|
|
402
386
|
]
|
|
403
387
|
]
|
|
404
388
|
.map(
|
|
405
|
-
([title, table]) =>
|
|
389
|
+
([title, table]) => vendor.stripIndents`
|
|
406
390
|
## ${title}
|
|
407
391
|
|
|
408
392
|
${table}
|
|
@@ -681,7 +665,7 @@ function handleBadInput(...checks) {
|
|
|
681
665
|
// If the message has newlines then format the first line with the input
|
|
682
666
|
// expectation and teh rest indented below it
|
|
683
667
|
msg.push(
|
|
684
|
-
` - ${lines[0]} (${d.test ?
|
|
668
|
+
` - ${lines[0]} (${d.test ? vendor.yoctocolorsCjsExports.green(d.pass) : vendor.yoctocolorsCjsExports.red(d.fail)})`
|
|
685
669
|
)
|
|
686
670
|
if (lines.length > 1) {
|
|
687
671
|
msg.push(...lines.slice(1).map(str => ` ${str}`))
|
|
@@ -915,7 +899,7 @@ function emitBanner(name) {
|
|
|
915
899
|
logger.logger.error(getAsciiHeader(name))
|
|
916
900
|
}
|
|
917
901
|
function getAsciiHeader(command) {
|
|
918
|
-
const cliVersion = '0.14.
|
|
902
|
+
const cliVersion = '0.14.95:3360fca:82287460:pub' // The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION_HASH']".
|
|
919
903
|
const nodeVersion = process$1.version
|
|
920
904
|
const apiToken = shadowNpmInject.getDefaultToken()
|
|
921
905
|
const shownToken = apiToken ? getLastFiveOfApiToken(apiToken) : 'no'
|
|
@@ -1361,9 +1345,9 @@ async function runCycloneDX(yargvWithYes) {
|
|
|
1361
1345
|
if (
|
|
1362
1346
|
yargv.type !== YARN$1 &&
|
|
1363
1347
|
nodejsPlatformTypes.has(yargv.type) &&
|
|
1364
|
-
|
|
1348
|
+
require$$0.existsSync(`./${YARN_LOCK}`)
|
|
1365
1349
|
) {
|
|
1366
|
-
if (
|
|
1350
|
+
if (require$$0.existsSync(`./${PACKAGE_LOCK_JSON}`)) {
|
|
1367
1351
|
yargv.type = NPM$g
|
|
1368
1352
|
} else {
|
|
1369
1353
|
// Use synp to create a package-lock.json from the yarn.lock,
|
|
@@ -1389,12 +1373,14 @@ async function runCycloneDX(yargvWithYes) {
|
|
|
1389
1373
|
])
|
|
1390
1374
|
if (cleanupPackageLock) {
|
|
1391
1375
|
try {
|
|
1392
|
-
await
|
|
1376
|
+
await require$$0.promises.rm(`./${PACKAGE_LOCK_JSON}`)
|
|
1393
1377
|
} catch {}
|
|
1394
1378
|
}
|
|
1395
1379
|
const fullOutputPath = path$1.join(process$1.cwd(), yargv.output)
|
|
1396
|
-
if (
|
|
1397
|
-
logger.logger.log(
|
|
1380
|
+
if (require$$0.existsSync(fullOutputPath)) {
|
|
1381
|
+
logger.logger.log(
|
|
1382
|
+
vendor.yoctocolorsCjsExports.cyanBright(`${yargv.output} created!`)
|
|
1383
|
+
)
|
|
1398
1384
|
}
|
|
1399
1385
|
}
|
|
1400
1386
|
function argvToArray(argv) {
|
|
@@ -1597,7 +1583,7 @@ async function run$I(argv, importMeta, { parentName }) {
|
|
|
1597
1583
|
|
|
1598
1584
|
// TODO: Convert to meow.
|
|
1599
1585
|
const yargv = {
|
|
1600
|
-
...
|
|
1586
|
+
...vendor.yargsParser(argv, yargsConfig)
|
|
1601
1587
|
}
|
|
1602
1588
|
const unknown = yargv._
|
|
1603
1589
|
const { length: unknownLength } = unknown
|
|
@@ -2332,7 +2318,9 @@ async function outputCreateNewScan(data, outputKind) {
|
|
|
2332
2318
|
logger.logger.log('')
|
|
2333
2319
|
return
|
|
2334
2320
|
}
|
|
2335
|
-
const link =
|
|
2321
|
+
const link = vendor.yoctocolorsCjsExports.underline(
|
|
2322
|
+
vendor.yoctocolorsCjsExports.cyan(`${data.html_report_url}`)
|
|
2323
|
+
)
|
|
2336
2324
|
logger.logger.log(`Available at: ${link}`)
|
|
2337
2325
|
if (
|
|
2338
2326
|
await prompts.confirm({
|
|
@@ -3327,35 +3315,35 @@ async function outputDependencies(data, { limit, offset, outputKind }) {
|
|
|
3327
3315
|
columns: [
|
|
3328
3316
|
{
|
|
3329
3317
|
field: 'namespace',
|
|
3330
|
-
name:
|
|
3318
|
+
name: vendor.yoctocolorsCjsExports.cyan('Namespace')
|
|
3331
3319
|
},
|
|
3332
3320
|
{
|
|
3333
3321
|
field: 'name',
|
|
3334
|
-
name:
|
|
3322
|
+
name: vendor.yoctocolorsCjsExports.cyan('Name')
|
|
3335
3323
|
},
|
|
3336
3324
|
{
|
|
3337
3325
|
field: 'version',
|
|
3338
|
-
name:
|
|
3326
|
+
name: vendor.yoctocolorsCjsExports.cyan('Version')
|
|
3339
3327
|
},
|
|
3340
3328
|
{
|
|
3341
3329
|
field: 'repository',
|
|
3342
|
-
name:
|
|
3330
|
+
name: vendor.yoctocolorsCjsExports.cyan('Repository')
|
|
3343
3331
|
},
|
|
3344
3332
|
{
|
|
3345
3333
|
field: 'branch',
|
|
3346
|
-
name:
|
|
3334
|
+
name: vendor.yoctocolorsCjsExports.cyan('Branch')
|
|
3347
3335
|
},
|
|
3348
3336
|
{
|
|
3349
3337
|
field: 'type',
|
|
3350
|
-
name:
|
|
3338
|
+
name: vendor.yoctocolorsCjsExports.cyan('Type')
|
|
3351
3339
|
},
|
|
3352
3340
|
{
|
|
3353
3341
|
field: 'direct',
|
|
3354
|
-
name:
|
|
3342
|
+
name: vendor.yoctocolorsCjsExports.cyan('Direct')
|
|
3355
3343
|
}
|
|
3356
3344
|
]
|
|
3357
3345
|
}
|
|
3358
|
-
logger.logger.log(
|
|
3346
|
+
logger.logger.log(vendor.srcExports(options, data.rows))
|
|
3359
3347
|
}
|
|
3360
3348
|
|
|
3361
3349
|
async function handleDependencies({ limit, offset, outputKind }) {
|
|
@@ -3482,7 +3470,7 @@ async function fetchDiffScan({ after, before, orgSlug }) {
|
|
|
3482
3470
|
async function outputDiffScan(result, { depth, file, outputKind }) {
|
|
3483
3471
|
const dashboardUrl = result.diff_report_url
|
|
3484
3472
|
const dashboardMessage = dashboardUrl
|
|
3485
|
-
? `\n View this diff scan in the Socket dashboard: ${
|
|
3473
|
+
? `\n View this diff scan in the Socket dashboard: ${vendor.yoctocolorsCjsExports.cyan(dashboardUrl)}`
|
|
3486
3474
|
: ''
|
|
3487
3475
|
|
|
3488
3476
|
// When forcing json, or dumping to file, serialize to string such that it
|
|
@@ -3501,7 +3489,7 @@ async function outputDiffScan(result, { depth, file, outputKind }) {
|
|
|
3501
3489
|
}
|
|
3502
3490
|
if (file && file !== '-') {
|
|
3503
3491
|
logger.logger.log(`Writing json to \`${file}\``)
|
|
3504
|
-
|
|
3492
|
+
require$$0.writeFile(file, JSON.stringify(result, null, 2), err => {
|
|
3505
3493
|
if (err) {
|
|
3506
3494
|
logger.logger.fail(`Writing to \`${file}\` failed...`)
|
|
3507
3495
|
logger.logger.error(err)
|
|
@@ -3830,7 +3818,7 @@ async function openGitHubPullRequest(
|
|
|
3830
3818
|
owner,
|
|
3831
3819
|
repo,
|
|
3832
3820
|
title: commitMsg,
|
|
3833
|
-
head: branch
|
|
3821
|
+
head: `${owner}:${branch}`,
|
|
3834
3822
|
base: baseBranch,
|
|
3835
3823
|
body: `[socket] Upgrade \`${name}\` to ${version}`
|
|
3836
3824
|
})
|
|
@@ -4058,7 +4046,7 @@ async function getAlertsMapFromPnpmLockfile(lockfile, options_) {
|
|
|
4058
4046
|
...options.include
|
|
4059
4047
|
}
|
|
4060
4048
|
const { spinner } = options
|
|
4061
|
-
const depTypes =
|
|
4049
|
+
const depTypes = vendor.libExports$2.detectDepTypes(lockfile)
|
|
4062
4050
|
const pkgIds = Object.keys(depTypes)
|
|
4063
4051
|
let { length: remaining } = pkgIds
|
|
4064
4052
|
const alertsByPkgId = new Map()
|
|
@@ -4264,7 +4252,7 @@ async function pnpmFix(
|
|
|
4264
4252
|
pkgEnvDetails,
|
|
4265
4253
|
{ autoMerge, cwd, rangeStyle, spinner, test, testScript }
|
|
4266
4254
|
) {
|
|
4267
|
-
const lockfile = await
|
|
4255
|
+
const lockfile = await vendor.libExports$3.readWantedLockfile(cwd, {
|
|
4268
4256
|
ignoreIncompatible: false
|
|
4269
4257
|
})
|
|
4270
4258
|
if (!lockfile) {
|
|
@@ -4513,7 +4501,7 @@ const binByAgent = new Map([
|
|
|
4513
4501
|
async function getAgentExecPath(agent) {
|
|
4514
4502
|
const binName = binByAgent.get(agent)
|
|
4515
4503
|
return (
|
|
4516
|
-
(await
|
|
4504
|
+
(await vendor.libExports$1(binName, {
|
|
4517
4505
|
nothrow: true
|
|
4518
4506
|
})) ?? binName
|
|
4519
4507
|
)
|
|
@@ -4525,7 +4513,7 @@ async function getAgentVersion(agentExecPath, cwd) {
|
|
|
4525
4513
|
// Coerce version output into a valid semver version by passing it through
|
|
4526
4514
|
// semver.coerce which strips leading v's, carets (^), comparators (<,<=,>,>=,=),
|
|
4527
4515
|
// and tildes (~).
|
|
4528
|
-
|
|
4516
|
+
vendor.semverExports.coerce(
|
|
4529
4517
|
// All package managers support the "--version" flag.
|
|
4530
4518
|
(
|
|
4531
4519
|
await spawn.spawn(agentExecPath, ['--version'], {
|
|
@@ -4619,7 +4607,7 @@ async function detectPackageEnvironment({
|
|
|
4619
4607
|
cwd
|
|
4620
4608
|
})
|
|
4621
4609
|
const pkgPath =
|
|
4622
|
-
pkgJsonPath &&
|
|
4610
|
+
pkgJsonPath && require$$0.existsSync(pkgJsonPath)
|
|
4623
4611
|
? path$1.dirname(pkgJsonPath)
|
|
4624
4612
|
: undefined
|
|
4625
4613
|
const editablePkgJson = pkgPath
|
|
@@ -4673,7 +4661,7 @@ async function detectPackageEnvironment({
|
|
|
4673
4661
|
// Lazily access constants.minimumVersionByAgent.
|
|
4674
4662
|
const minSupportedAgentVersion = constants.minimumVersionByAgent.get(agent)
|
|
4675
4663
|
const minSupportedNodeVersion = maintainedNodeVersions.last
|
|
4676
|
-
const nodeVersion =
|
|
4664
|
+
const nodeVersion = vendor.semverExports.coerce(process$1.version)
|
|
4677
4665
|
let lockSrc
|
|
4678
4666
|
let pkgAgentRange
|
|
4679
4667
|
let pkgNodeRange
|
|
@@ -4687,8 +4675,8 @@ async function detectPackageEnvironment({
|
|
|
4687
4675
|
pkgAgentRange = engineAgentRange
|
|
4688
4676
|
// Roughly check agent range as semver.coerce will strip leading
|
|
4689
4677
|
// v's, carets (^), comparators (<,<=,>,>=,=), and tildes (~).
|
|
4690
|
-
const coerced =
|
|
4691
|
-
if (coerced &&
|
|
4678
|
+
const coerced = vendor.semverExports.coerce(pkgAgentRange)
|
|
4679
|
+
if (coerced && vendor.semverExports.lt(coerced, pkgMinAgentVersion)) {
|
|
4692
4680
|
pkgMinAgentVersion = coerced.version
|
|
4693
4681
|
}
|
|
4694
4682
|
}
|
|
@@ -4696,22 +4684,23 @@ async function detectPackageEnvironment({
|
|
|
4696
4684
|
pkgNodeRange = engineNodeRange
|
|
4697
4685
|
// Roughly check Node range as semver.coerce will strip leading
|
|
4698
4686
|
// v's, carets (^), comparators (<,<=,>,>=,=), and tildes (~).
|
|
4699
|
-
const coerced =
|
|
4700
|
-
if (coerced &&
|
|
4687
|
+
const coerced = vendor.semverExports.coerce(pkgNodeRange)
|
|
4688
|
+
if (coerced && vendor.semverExports.lt(coerced, pkgMinNodeVersion)) {
|
|
4701
4689
|
pkgMinNodeVersion = coerced.version
|
|
4702
4690
|
}
|
|
4703
4691
|
}
|
|
4704
4692
|
const browserslistQuery = pkgJson['browserslist']
|
|
4705
4693
|
if (Array.isArray(browserslistQuery)) {
|
|
4706
4694
|
// List Node targets in ascending version order.
|
|
4707
|
-
const browserslistNodeTargets =
|
|
4695
|
+
const browserslistNodeTargets = vendor
|
|
4696
|
+
.browserslistExports(browserslistQuery)
|
|
4708
4697
|
.filter(v => /^node /i.test(v))
|
|
4709
4698
|
.map(v => v.slice(5 /*'node '.length*/))
|
|
4710
4699
|
.sort(sorts.naturalCompare)
|
|
4711
4700
|
if (browserslistNodeTargets.length) {
|
|
4712
4701
|
// browserslistNodeTargets[0] is the lowest Node target version.
|
|
4713
|
-
const coerced =
|
|
4714
|
-
if (coerced &&
|
|
4702
|
+
const coerced = vendor.semverExports.coerce(browserslistNodeTargets[0])
|
|
4703
|
+
if (coerced && vendor.semverExports.lt(coerced, pkgMinNodeVersion)) {
|
|
4715
4704
|
pkgMinNodeVersion = coerced.version
|
|
4716
4705
|
}
|
|
4717
4706
|
}
|
|
@@ -4727,17 +4716,20 @@ async function detectPackageEnvironment({
|
|
|
4727
4716
|
// Does the system agent version meet our minimum supported agent version?
|
|
4728
4717
|
const agentSupported =
|
|
4729
4718
|
!!agentVersion &&
|
|
4730
|
-
|
|
4719
|
+
vendor.semverExports.satisfies(
|
|
4720
|
+
agentVersion,
|
|
4721
|
+
`>=${minSupportedAgentVersion}`
|
|
4722
|
+
)
|
|
4731
4723
|
|
|
4732
4724
|
// Does the system Node version meet our minimum supported Node version?
|
|
4733
|
-
const nodeSupported =
|
|
4725
|
+
const nodeSupported = vendor.semverExports.satisfies(
|
|
4734
4726
|
nodeVersion,
|
|
4735
4727
|
`>=${minSupportedNodeVersion}`
|
|
4736
4728
|
)
|
|
4737
4729
|
const npmBuggyOverrides =
|
|
4738
4730
|
agent === NPM$b &&
|
|
4739
4731
|
!!agentVersion &&
|
|
4740
|
-
|
|
4732
|
+
vendor.semverExports.lt(agentVersion, NPM_BUGGY_OVERRIDES_PATCHED_VERSION$1)
|
|
4741
4733
|
return {
|
|
4742
4734
|
agent,
|
|
4743
4735
|
agentExecPath,
|
|
@@ -4760,13 +4752,13 @@ async function detectPackageEnvironment({
|
|
|
4760
4752
|
},
|
|
4761
4753
|
pkgSupports: {
|
|
4762
4754
|
// Does our minimum supported agent version meet the package's requirements?
|
|
4763
|
-
agent:
|
|
4755
|
+
agent: vendor.semverExports.satisfies(
|
|
4764
4756
|
minSupportedAgentVersion,
|
|
4765
4757
|
`>=${pkgMinAgentVersion}`
|
|
4766
4758
|
),
|
|
4767
4759
|
// Does our supported Node versions meet the package's requirements?
|
|
4768
4760
|
node: maintainedNodeVersions.some(v =>
|
|
4769
|
-
|
|
4761
|
+
vendor.semverExports.satisfies(v, `>=${pkgMinNodeVersion}`)
|
|
4770
4762
|
)
|
|
4771
4763
|
}
|
|
4772
4764
|
}
|
|
@@ -4914,12 +4906,12 @@ const config$z = {
|
|
|
4914
4906
|
autoMerge: {
|
|
4915
4907
|
type: 'boolean',
|
|
4916
4908
|
default: false,
|
|
4917
|
-
description: `Enable auto-merge for pull requests that Socket opens.\n See ${
|
|
4909
|
+
description: `Enable auto-merge for pull requests that Socket opens.\n See ${vendor.terminalLinkExports('GitHub documentation', 'https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-auto-merge-for-pull-requests-in-your-repository')} for managing auto-merge for pull requests in your repository.`
|
|
4918
4910
|
},
|
|
4919
4911
|
rangeStyle: {
|
|
4920
4912
|
type: 'string',
|
|
4921
4913
|
default: 'preserve',
|
|
4922
|
-
description:
|
|
4914
|
+
description: vendor.stripIndent`
|
|
4923
4915
|
Define how updated dependency versions should be written in package.json.
|
|
4924
4916
|
Available styles:
|
|
4925
4917
|
* caret - Use ^ range for compatible updates (e.g. ^1.2.3)
|
|
@@ -5028,11 +5020,11 @@ async function fetchPackageInfo(pkgName, pkgVersion, includeAllIssues) {
|
|
|
5028
5020
|
const { NPM: NPM$9 } = registryConstants
|
|
5029
5021
|
function formatScore$1(score) {
|
|
5030
5022
|
if (score > 80) {
|
|
5031
|
-
return
|
|
5023
|
+
return vendor.yoctocolorsCjsExports.green(`${score}`)
|
|
5032
5024
|
} else if (score < 80 && score > 60) {
|
|
5033
|
-
return
|
|
5025
|
+
return vendor.yoctocolorsCjsExports.yellow(`${score}`)
|
|
5034
5026
|
}
|
|
5035
|
-
return
|
|
5027
|
+
return vendor.yoctocolorsCjsExports.red(`${score}`)
|
|
5036
5028
|
}
|
|
5037
5029
|
function outputPackageIssuesDetails(packageData, outputMarkdown) {
|
|
5038
5030
|
const issueDetails = packageData.filter(
|
|
@@ -5080,7 +5072,7 @@ function outputPackageInfo(
|
|
|
5080
5072
|
return
|
|
5081
5073
|
}
|
|
5082
5074
|
if (outputKind === 'markdown') {
|
|
5083
|
-
logger.logger.log(
|
|
5075
|
+
logger.logger.log(vendor.stripIndents`
|
|
5084
5076
|
# Package report for ${pkgName}
|
|
5085
5077
|
|
|
5086
5078
|
Package report card:
|
|
@@ -5137,8 +5129,8 @@ function outputPackageInfo(
|
|
|
5137
5129
|
}
|
|
5138
5130
|
if (outputKind !== 'markdown') {
|
|
5139
5131
|
logger.logger.log(
|
|
5140
|
-
|
|
5141
|
-
`\nOr rerun ${
|
|
5132
|
+
vendor.yoctocolorsCjsExports.dim(
|
|
5133
|
+
`\nOr rerun ${vendor.yoctocolorsCjsExports.italic(commandName)} using the ${vendor.yoctocolorsCjsExports.italic('--json')} flag to get full JSON output`
|
|
5142
5134
|
)
|
|
5143
5135
|
)
|
|
5144
5136
|
} else {
|
|
@@ -5269,7 +5261,7 @@ async function attemptLogin(apiBaseUrl, apiProxy) {
|
|
|
5269
5261
|
apiProxy ??= shadowNpmInject.getConfigValue('apiProxy') ?? undefined
|
|
5270
5262
|
const apiToken =
|
|
5271
5263
|
(await prompts.password({
|
|
5272
|
-
message: `Enter your ${
|
|
5264
|
+
message: `Enter your ${vendor.terminalLinkExports('Socket.dev API key', 'https://docs.socket.dev/docs/api-keys')} (leave blank for a public key)`
|
|
5273
5265
|
})) || SOCKET_PUBLIC_API_TOKEN
|
|
5274
5266
|
// Lazily access constants.spinner.
|
|
5275
5267
|
const { spinner } = constants
|
|
@@ -6015,7 +6007,7 @@ async function run$t(argv, importMeta, { parentName }) {
|
|
|
6015
6007
|
subArgs.push('--verbose')
|
|
6016
6008
|
}
|
|
6017
6009
|
const dir = cwd
|
|
6018
|
-
if (
|
|
6010
|
+
if (require$$0.existsSync(path$1.join(dir, 'build.sbt'))) {
|
|
6019
6011
|
logger.logger.log(
|
|
6020
6012
|
'Detected a Scala sbt build, running default Scala generator...'
|
|
6021
6013
|
)
|
|
@@ -6032,7 +6024,7 @@ async function run$t(argv, importMeta, { parentName }) {
|
|
|
6032
6024
|
})
|
|
6033
6025
|
return
|
|
6034
6026
|
}
|
|
6035
|
-
if (
|
|
6027
|
+
if (require$$0.existsSync(path$1.join(dir, 'gradlew'))) {
|
|
6036
6028
|
logger.logger.log(
|
|
6037
6029
|
'Detected a gradle build, running default gradle generator...'
|
|
6038
6030
|
)
|
|
@@ -6546,7 +6538,7 @@ async function getWorkspaceGlobs(agent, pkgPath, editablePkgJson) {
|
|
|
6546
6538
|
const yml = await shadowNpmInject.safeReadFile(workspacePath)
|
|
6547
6539
|
if (yml) {
|
|
6548
6540
|
try {
|
|
6549
|
-
workspacePatterns =
|
|
6541
|
+
workspacePatterns = vendor.distExports$1.parse(yml)?.packages
|
|
6550
6542
|
} catch {}
|
|
6551
6543
|
if (workspacePatterns) {
|
|
6552
6544
|
break
|
|
@@ -7016,10 +7008,10 @@ async function addOverrides(pkgPath, pkgEnvDetails, options) {
|
|
|
7016
7008
|
const depAliasMap = new Map()
|
|
7017
7009
|
const depEntries = getDependencyEntries(editablePkgJson)
|
|
7018
7010
|
const manifestEntries = manifestNpmOverrides.filter(({ 1: data }) =>
|
|
7019
|
-
|
|
7011
|
+
vendor.semverExports.satisfies(
|
|
7020
7012
|
// Roughly check Node range as semver.coerce will strip leading
|
|
7021
7013
|
// v's, carets (^), comparators (<,<=,>,>=,=), and tildes (~).
|
|
7022
|
-
|
|
7014
|
+
vendor.semverExports.coerce(data.engines.node),
|
|
7023
7015
|
pkgEnvDetails.pkgRequirements.node
|
|
7024
7016
|
)
|
|
7025
7017
|
)
|
|
@@ -7027,7 +7019,7 @@ async function addOverrides(pkgPath, pkgEnvDetails, options) {
|
|
|
7027
7019
|
// Chunk package names to process them in parallel 3 at a time.
|
|
7028
7020
|
await promises.pEach(manifestEntries, 3, async ({ 1: data }) => {
|
|
7029
7021
|
const { name: sockRegPkgName, package: origPkgName, version } = data
|
|
7030
|
-
const major =
|
|
7022
|
+
const major = vendor.semverExports.major(version)
|
|
7031
7023
|
const sockOverridePrefix = `${NPM$1}:${sockRegPkgName}@`
|
|
7032
7024
|
const sockOverrideSpec = `${sockOverridePrefix}${pin ? version : `^${major}`}`
|
|
7033
7025
|
for (const { 1: depObj } of depEntries) {
|
|
@@ -7051,7 +7043,8 @@ async function addOverrides(pkgPath, pkgEnvDetails, options) {
|
|
|
7051
7043
|
thisSpec.startsWith(sockOverridePrefix) &&
|
|
7052
7044
|
// Check the validity of the spec by passing it through npa and
|
|
7053
7045
|
// seeing if it will coerce to a version.
|
|
7054
|
-
|
|
7046
|
+
vendor.semverExports.coerce(vendor.npaExports(thisSpec).rawSpec)
|
|
7047
|
+
?.version
|
|
7055
7048
|
)
|
|
7056
7049
|
) {
|
|
7057
7050
|
thisSpec = sockOverrideSpec
|
|
@@ -7108,20 +7101,22 @@ async function addOverrides(pkgPath, pkgEnvDetails, options) {
|
|
|
7108
7101
|
if (thisSpec.startsWith(sockOverridePrefix)) {
|
|
7109
7102
|
if (
|
|
7110
7103
|
pin &&
|
|
7111
|
-
|
|
7104
|
+
vendor.semverExports.major(
|
|
7112
7105
|
// Check the validity of the spec by passing it through npa
|
|
7113
7106
|
// and seeing if it will coerce to a version. semver.coerce
|
|
7114
7107
|
// will strip leading v's, carets (^), comparators (<,<=,>,>=,=),
|
|
7115
7108
|
// and tildes (~). If not coerced to a valid version then
|
|
7116
7109
|
// default to the manifest entry version.
|
|
7117
|
-
|
|
7110
|
+
vendor.semverExports.coerce(
|
|
7111
|
+
vendor.npaExports(thisSpec).rawSpec
|
|
7112
|
+
)?.version ?? version
|
|
7118
7113
|
) !== major
|
|
7119
7114
|
) {
|
|
7120
7115
|
const otherVersion = (
|
|
7121
7116
|
await packages.fetchPackageManifest(thisSpec)
|
|
7122
7117
|
)?.version
|
|
7123
7118
|
if (otherVersion && otherVersion !== version) {
|
|
7124
|
-
newSpec = `${sockOverridePrefix}${pin ? otherVersion : `^${
|
|
7119
|
+
newSpec = `${sockOverridePrefix}${pin ? otherVersion : `^${vendor.semverExports.major(otherVersion)}`}`
|
|
7125
7120
|
}
|
|
7126
7121
|
}
|
|
7127
7122
|
} else {
|
|
@@ -7139,11 +7134,14 @@ async function addOverrides(pkgPath, pkgEnvDetails, options) {
|
|
|
7139
7134
|
}
|
|
7140
7135
|
})
|
|
7141
7136
|
if (workspaceGlobs) {
|
|
7142
|
-
const workspacePkgJsonPaths = await
|
|
7143
|
-
|
|
7144
|
-
|
|
7145
|
-
|
|
7146
|
-
|
|
7137
|
+
const workspacePkgJsonPaths = await vendor.distExports.glob(
|
|
7138
|
+
workspaceGlobs,
|
|
7139
|
+
{
|
|
7140
|
+
absolute: true,
|
|
7141
|
+
cwd: pkgPath,
|
|
7142
|
+
ignore: ['**/node_modules/**', '**/bower_components/**']
|
|
7143
|
+
}
|
|
7144
|
+
)
|
|
7147
7145
|
// Chunk package names to process them in parallel 3 at a time.
|
|
7148
7146
|
await promises.pEach(
|
|
7149
7147
|
workspacePkgJsonPaths,
|
|
@@ -7380,7 +7378,7 @@ async function outputOrganizationList(data, outputKind = 'text') {
|
|
|
7380
7378
|
}
|
|
7381
7379
|
logger.logger.log('# Organizations\n')
|
|
7382
7380
|
logger.logger.log(
|
|
7383
|
-
`List of organizations associated with your API key, ending with: ${
|
|
7381
|
+
`List of organizations associated with your API key, ending with: ${vendor.yoctocolorsCjsExports.italic(lastFiveOfApiToken)}\n`
|
|
7384
7382
|
)
|
|
7385
7383
|
logger.logger.log(
|
|
7386
7384
|
`| Name${' '.repeat(mw1 - 4)} | ID${' '.repeat(mw2 - 2)} | Plan${' '.repeat(mw3 - 4)} |`
|
|
@@ -7400,12 +7398,12 @@ async function outputOrganizationList(data, outputKind = 'text') {
|
|
|
7400
7398
|
}
|
|
7401
7399
|
default: {
|
|
7402
7400
|
logger.logger.log(
|
|
7403
|
-
`List of organizations associated with your API key, ending with: ${
|
|
7401
|
+
`List of organizations associated with your API key, ending with: ${vendor.yoctocolorsCjsExports.italic(lastFiveOfApiToken)}\n`
|
|
7404
7402
|
)
|
|
7405
7403
|
// Just dump
|
|
7406
7404
|
for (const o of organizations) {
|
|
7407
7405
|
logger.logger.log(
|
|
7408
|
-
`- Name: ${
|
|
7406
|
+
`- Name: ${vendor.yoctocolorsCjsExports.bold(o.name ?? 'undefined')}, ID: ${vendor.yoctocolorsCjsExports.bold(o.id)}, Plan: ${vendor.yoctocolorsCjsExports.bold(o.plan)}`
|
|
7409
7407
|
)
|
|
7410
7408
|
}
|
|
7411
7409
|
}
|
|
@@ -8394,7 +8392,7 @@ function outputPurlsShallowScore(purls, packageData, outputKind) {
|
|
|
8394
8392
|
return true // not found
|
|
8395
8393
|
})
|
|
8396
8394
|
if (outputKind === 'markdown') {
|
|
8397
|
-
logger.logger.log(
|
|
8395
|
+
logger.logger.log(vendor.stripIndents`
|
|
8398
8396
|
# Shallow Package Report
|
|
8399
8397
|
|
|
8400
8398
|
This report contains the response for requesting data on some package url(s).
|
|
@@ -8408,14 +8406,16 @@ function outputPurlsShallowScore(purls, packageData, outputKind) {
|
|
|
8408
8406
|
`)
|
|
8409
8407
|
return
|
|
8410
8408
|
}
|
|
8411
|
-
logger.logger.log(
|
|
8409
|
+
logger.logger.log(
|
|
8410
|
+
'\n' + vendor.yoctocolorsCjsExports.bold('Shallow Package Score') + '\n'
|
|
8411
|
+
)
|
|
8412
8412
|
logger.logger.log(
|
|
8413
8413
|
'Please note: The listed scores are ONLY for the package itself. It does NOT\n' +
|
|
8414
8414
|
' reflect the scores of any dependencies, transitive or otherwise.'
|
|
8415
8415
|
)
|
|
8416
8416
|
if (missing.length) {
|
|
8417
8417
|
logger.logger.log(
|
|
8418
|
-
`\nAt least one package had no response or the purl was not canonical:\n${missing.map(purl => '\n- ' +
|
|
8418
|
+
`\nAt least one package had no response or the purl was not canonical:\n${missing.map(purl => '\n- ' + vendor.yoctocolorsCjsExports.bold(purl)).join('')}`
|
|
8419
8419
|
)
|
|
8420
8420
|
}
|
|
8421
8421
|
packageData.forEach(data => {
|
|
@@ -8435,7 +8435,7 @@ function formatReportCard(data, color) {
|
|
|
8435
8435
|
const alertString = getAlertString(data.alerts, !color)
|
|
8436
8436
|
const purl = 'pkg:' + data.type + '/' + data.name + '@' + data.version
|
|
8437
8437
|
return [
|
|
8438
|
-
'Package: ' + (color ?
|
|
8438
|
+
'Package: ' + (color ? vendor.yoctocolorsCjsExports.bold(purl) : purl),
|
|
8439
8439
|
'',
|
|
8440
8440
|
...Object.entries(scoreResult).map(
|
|
8441
8441
|
score =>
|
|
@@ -8451,16 +8451,18 @@ function formatScore(score, noColor = false, pad = false) {
|
|
|
8451
8451
|
return padded
|
|
8452
8452
|
}
|
|
8453
8453
|
if (score >= 80) {
|
|
8454
|
-
return
|
|
8454
|
+
return vendor.yoctocolorsCjsExports.green(padded)
|
|
8455
8455
|
}
|
|
8456
8456
|
if (score >= 60) {
|
|
8457
|
-
return
|
|
8457
|
+
return vendor.yoctocolorsCjsExports.yellow(padded)
|
|
8458
8458
|
}
|
|
8459
|
-
return
|
|
8459
|
+
return vendor.yoctocolorsCjsExports.red(padded)
|
|
8460
8460
|
}
|
|
8461
8461
|
function getAlertString(alerts, noColor = false) {
|
|
8462
8462
|
if (!alerts?.length) {
|
|
8463
|
-
return noColor
|
|
8463
|
+
return noColor
|
|
8464
|
+
? `- Alerts: none!`
|
|
8465
|
+
: `- Alerts: ${vendor.yoctocolorsCjsExports.green('none')}!`
|
|
8464
8466
|
}
|
|
8465
8467
|
const bad = alerts
|
|
8466
8468
|
.filter(alert => alert.severity !== 'low' && alert.severity !== 'middle')
|
|
@@ -8490,22 +8492,32 @@ function getAlertString(alerts, noColor = false) {
|
|
|
8490
8492
|
)
|
|
8491
8493
|
}
|
|
8492
8494
|
return (
|
|
8493
|
-
`- Alerts (${
|
|
8495
|
+
`- Alerts (${vendor.yoctocolorsCjsExports.red(bad.length.toString())}/${vendor.yoctocolorsCjsExports.yellow(mid.length.toString())}/${low.length}):` +
|
|
8494
8496
|
' '.repeat(Math.max(0, 20 - colorless.length)) +
|
|
8495
8497
|
' ' +
|
|
8496
8498
|
[
|
|
8497
8499
|
bad
|
|
8498
8500
|
.map(alert =>
|
|
8499
|
-
|
|
8501
|
+
vendor.yoctocolorsCjsExports.red(
|
|
8502
|
+
vendor.yoctocolorsCjsExports.dim(`[${alert.severity}] `) +
|
|
8503
|
+
alert.type
|
|
8504
|
+
)
|
|
8500
8505
|
)
|
|
8501
8506
|
.join(', '),
|
|
8502
8507
|
mid
|
|
8503
8508
|
.map(alert =>
|
|
8504
|
-
|
|
8509
|
+
vendor.yoctocolorsCjsExports.yellow(
|
|
8510
|
+
vendor.yoctocolorsCjsExports.dim(`[${alert.severity}] `) +
|
|
8511
|
+
alert.type
|
|
8512
|
+
)
|
|
8505
8513
|
)
|
|
8506
8514
|
.join(', '),
|
|
8507
8515
|
low
|
|
8508
|
-
.map(
|
|
8516
|
+
.map(
|
|
8517
|
+
alert =>
|
|
8518
|
+
vendor.yoctocolorsCjsExports.dim(`[${alert.severity}] `) +
|
|
8519
|
+
alert.type
|
|
8520
|
+
)
|
|
8509
8521
|
.join(', ')
|
|
8510
8522
|
]
|
|
8511
8523
|
.filter(Boolean)
|
|
@@ -9123,27 +9135,27 @@ async function outputListRepos(data, outputKind) {
|
|
|
9123
9135
|
columns: [
|
|
9124
9136
|
{
|
|
9125
9137
|
field: 'id',
|
|
9126
|
-
name:
|
|
9138
|
+
name: vendor.yoctocolorsCjsExports.magenta('ID')
|
|
9127
9139
|
},
|
|
9128
9140
|
{
|
|
9129
9141
|
field: 'name',
|
|
9130
|
-
name:
|
|
9142
|
+
name: vendor.yoctocolorsCjsExports.magenta('Name')
|
|
9131
9143
|
},
|
|
9132
9144
|
{
|
|
9133
9145
|
field: 'visibility',
|
|
9134
|
-
name:
|
|
9146
|
+
name: vendor.yoctocolorsCjsExports.magenta('Visibility')
|
|
9135
9147
|
},
|
|
9136
9148
|
{
|
|
9137
9149
|
field: 'default_branch',
|
|
9138
|
-
name:
|
|
9150
|
+
name: vendor.yoctocolorsCjsExports.magenta('Default branch')
|
|
9139
9151
|
},
|
|
9140
9152
|
{
|
|
9141
9153
|
field: 'archived',
|
|
9142
|
-
name:
|
|
9154
|
+
name: vendor.yoctocolorsCjsExports.magenta('Archived')
|
|
9143
9155
|
}
|
|
9144
9156
|
]
|
|
9145
9157
|
}
|
|
9146
|
-
logger.logger.log(
|
|
9158
|
+
logger.logger.log(vendor.srcExports(options, data.results))
|
|
9147
9159
|
}
|
|
9148
9160
|
|
|
9149
9161
|
async function handleListRepos({
|
|
@@ -9488,35 +9500,35 @@ async function outputViewRepo(data, outputKind) {
|
|
|
9488
9500
|
columns: [
|
|
9489
9501
|
{
|
|
9490
9502
|
field: 'id',
|
|
9491
|
-
name:
|
|
9503
|
+
name: vendor.yoctocolorsCjsExports.magenta('ID')
|
|
9492
9504
|
},
|
|
9493
9505
|
{
|
|
9494
9506
|
field: 'name',
|
|
9495
|
-
name:
|
|
9507
|
+
name: vendor.yoctocolorsCjsExports.magenta('Name')
|
|
9496
9508
|
},
|
|
9497
9509
|
{
|
|
9498
9510
|
field: 'visibility',
|
|
9499
|
-
name:
|
|
9511
|
+
name: vendor.yoctocolorsCjsExports.magenta('Visibility')
|
|
9500
9512
|
},
|
|
9501
9513
|
{
|
|
9502
9514
|
field: 'default_branch',
|
|
9503
|
-
name:
|
|
9515
|
+
name: vendor.yoctocolorsCjsExports.magenta('Default branch')
|
|
9504
9516
|
},
|
|
9505
9517
|
{
|
|
9506
9518
|
field: 'homepage',
|
|
9507
|
-
name:
|
|
9519
|
+
name: vendor.yoctocolorsCjsExports.magenta('Homepage')
|
|
9508
9520
|
},
|
|
9509
9521
|
{
|
|
9510
9522
|
field: 'archived',
|
|
9511
|
-
name:
|
|
9523
|
+
name: vendor.yoctocolorsCjsExports.magenta('Archived')
|
|
9512
9524
|
},
|
|
9513
9525
|
{
|
|
9514
9526
|
field: 'created_at',
|
|
9515
|
-
name:
|
|
9527
|
+
name: vendor.yoctocolorsCjsExports.magenta('Created at')
|
|
9516
9528
|
}
|
|
9517
9529
|
]
|
|
9518
9530
|
}
|
|
9519
|
-
logger.logger.log(
|
|
9531
|
+
logger.logger.log(vendor.srcExports(options, [data]))
|
|
9520
9532
|
}
|
|
9521
9533
|
|
|
9522
9534
|
async function handleViewRepo(orgSlug, repoName, outputKind) {
|
|
@@ -10121,26 +10133,28 @@ async function outputListScans(data, outputKind) {
|
|
|
10121
10133
|
columns: [
|
|
10122
10134
|
{
|
|
10123
10135
|
field: 'id',
|
|
10124
|
-
name:
|
|
10136
|
+
name: vendor.yoctocolorsCjsExports.magenta('ID')
|
|
10125
10137
|
},
|
|
10126
10138
|
{
|
|
10127
10139
|
field: 'report_url',
|
|
10128
|
-
name:
|
|
10140
|
+
name: vendor.yoctocolorsCjsExports.magenta('Scan URL')
|
|
10129
10141
|
},
|
|
10130
10142
|
{
|
|
10131
10143
|
field: 'branch',
|
|
10132
|
-
name:
|
|
10144
|
+
name: vendor.yoctocolorsCjsExports.magenta('Branch')
|
|
10133
10145
|
},
|
|
10134
10146
|
{
|
|
10135
10147
|
field: 'created_at',
|
|
10136
|
-
name:
|
|
10148
|
+
name: vendor.yoctocolorsCjsExports.magenta('Created at')
|
|
10137
10149
|
}
|
|
10138
10150
|
]
|
|
10139
10151
|
}
|
|
10140
10152
|
const formattedResults = data.results.map(d => {
|
|
10141
10153
|
return {
|
|
10142
10154
|
id: d.id,
|
|
10143
|
-
report_url:
|
|
10155
|
+
report_url: vendor.yoctocolorsCjsExports.underline(
|
|
10156
|
+
`${d.html_report_url}`
|
|
10157
|
+
),
|
|
10144
10158
|
created_at: d.created_at
|
|
10145
10159
|
? new Date(d.created_at).toLocaleDateString('en-us', {
|
|
10146
10160
|
year: 'numeric',
|
|
@@ -10151,7 +10165,7 @@ async function outputListScans(data, outputKind) {
|
|
|
10151
10165
|
branch: d.branch
|
|
10152
10166
|
}
|
|
10153
10167
|
})
|
|
10154
|
-
logger.logger.log(
|
|
10168
|
+
logger.logger.log(vendor.srcExports(options, formattedResults))
|
|
10155
10169
|
}
|
|
10156
10170
|
|
|
10157
10171
|
async function handleListScans({
|
|
@@ -11152,7 +11166,7 @@ async function run$1(argv, importMeta, { parentName }) {
|
|
|
11152
11166
|
}
|
|
11153
11167
|
|
|
11154
11168
|
function addSocketWrapper(file) {
|
|
11155
|
-
return
|
|
11169
|
+
return require$$0.appendFile(
|
|
11156
11170
|
file,
|
|
11157
11171
|
'alias npm="socket npm"\nalias npx="socket npx"\n',
|
|
11158
11172
|
err => {
|
|
@@ -11161,7 +11175,7 @@ function addSocketWrapper(file) {
|
|
|
11161
11175
|
}
|
|
11162
11176
|
// TODO: pretty sure you need to source the file or restart
|
|
11163
11177
|
// any terminal session before changes are reflected.
|
|
11164
|
-
logger.logger.log(
|
|
11178
|
+
logger.logger.log(vendor.stripIndents`
|
|
11165
11179
|
The alias was added to ${file}. Running 'npm install' will now be wrapped in Socket's "safe npm" 🎉
|
|
11166
11180
|
If you want to disable it at any time, run \`socket wrapper --disable\`
|
|
11167
11181
|
`)
|
|
@@ -11170,7 +11184,7 @@ If you want to disable it at any time, run \`socket wrapper --disable\`
|
|
|
11170
11184
|
}
|
|
11171
11185
|
|
|
11172
11186
|
function checkSocketWrapperSetup(file) {
|
|
11173
|
-
const fileContent =
|
|
11187
|
+
const fileContent = require$$0.readFileSync(file, 'utf8')
|
|
11174
11188
|
const linesWithSocketAlias = fileContent
|
|
11175
11189
|
.split('\n')
|
|
11176
11190
|
.filter(
|
|
@@ -11189,10 +11203,11 @@ async function postinstallWrapper() {
|
|
|
11189
11203
|
// Lazily access constants.bashRcPath and constants.zshRcPath.
|
|
11190
11204
|
const { bashRcPath, zshRcPath } = constants
|
|
11191
11205
|
const socketWrapperEnabled =
|
|
11192
|
-
(
|
|
11193
|
-
|
|
11206
|
+
(require$$0.existsSync(bashRcPath) &&
|
|
11207
|
+
checkSocketWrapperSetup(bashRcPath)) ||
|
|
11208
|
+
(require$$0.existsSync(zshRcPath) && checkSocketWrapperSetup(zshRcPath))
|
|
11194
11209
|
if (!socketWrapperEnabled) {
|
|
11195
|
-
await installSafeNpm(
|
|
11210
|
+
await installSafeNpm(vendor.stripIndents`
|
|
11196
11211
|
The Socket CLI is now successfully installed! 🎉
|
|
11197
11212
|
|
|
11198
11213
|
To better protect yourself against supply-chain attacks, our "safe npm" wrapper can warn you about malicious packages whenever you run 'npm install'.
|
|
@@ -11217,10 +11232,10 @@ async function installSafeNpm(query) {
|
|
|
11217
11232
|
// Lazily access constants.bashRcPath and constants.zshRcPath.
|
|
11218
11233
|
const { bashRcPath, zshRcPath } = constants
|
|
11219
11234
|
try {
|
|
11220
|
-
if (
|
|
11235
|
+
if (require$$0.existsSync(bashRcPath)) {
|
|
11221
11236
|
addSocketWrapper(bashRcPath)
|
|
11222
11237
|
}
|
|
11223
|
-
if (
|
|
11238
|
+
if (require$$0.existsSync(zshRcPath)) {
|
|
11224
11239
|
addSocketWrapper(zshRcPath)
|
|
11225
11240
|
}
|
|
11226
11241
|
} catch (e) {
|
|
@@ -11232,7 +11247,7 @@ async function installSafeNpm(query) {
|
|
|
11232
11247
|
}
|
|
11233
11248
|
|
|
11234
11249
|
function removeSocketWrapper(file) {
|
|
11235
|
-
return
|
|
11250
|
+
return require$$0.readFile(file, 'utf8', function (err, data) {
|
|
11236
11251
|
if (err) {
|
|
11237
11252
|
logger.logger.fail('There was an error removing the alias:')
|
|
11238
11253
|
logger.logger.error(err)
|
|
@@ -11244,7 +11259,7 @@ function removeSocketWrapper(file) {
|
|
|
11244
11259
|
l => l !== 'alias npm="socket npm"' && l !== 'alias npx="socket npx"'
|
|
11245
11260
|
)
|
|
11246
11261
|
const updatedFileContent = linesWithoutSocketAlias.join('\n')
|
|
11247
|
-
|
|
11262
|
+
require$$0.writeFile(file, updatedFileContent, function (err) {
|
|
11248
11263
|
if (err) {
|
|
11249
11264
|
logger.logger.error(err)
|
|
11250
11265
|
return
|
|
@@ -11332,21 +11347,27 @@ async function run(argv, importMeta, { parentName }) {
|
|
|
11332
11347
|
// Lazily access constants.bashRcPath and constants.zshRcPath.
|
|
11333
11348
|
const { bashRcPath, zshRcPath } = constants
|
|
11334
11349
|
if (enable) {
|
|
11335
|
-
if (
|
|
11350
|
+
if (
|
|
11351
|
+
require$$0.existsSync(bashRcPath) &&
|
|
11352
|
+
!checkSocketWrapperSetup(bashRcPath)
|
|
11353
|
+
) {
|
|
11336
11354
|
addSocketWrapper(bashRcPath)
|
|
11337
11355
|
}
|
|
11338
|
-
if (
|
|
11356
|
+
if (
|
|
11357
|
+
require$$0.existsSync(zshRcPath) &&
|
|
11358
|
+
!checkSocketWrapperSetup(zshRcPath)
|
|
11359
|
+
) {
|
|
11339
11360
|
addSocketWrapper(zshRcPath)
|
|
11340
11361
|
}
|
|
11341
11362
|
} else {
|
|
11342
|
-
if (
|
|
11363
|
+
if (require$$0.existsSync(bashRcPath)) {
|
|
11343
11364
|
removeSocketWrapper(bashRcPath)
|
|
11344
11365
|
}
|
|
11345
|
-
if (
|
|
11366
|
+
if (require$$0.existsSync(zshRcPath)) {
|
|
11346
11367
|
removeSocketWrapper(zshRcPath)
|
|
11347
11368
|
}
|
|
11348
11369
|
}
|
|
11349
|
-
if (!
|
|
11370
|
+
if (!require$$0.existsSync(bashRcPath) && !require$$0.existsSync(zshRcPath)) {
|
|
11350
11371
|
logger.logger.fail(
|
|
11351
11372
|
'There was an issue setting up the alias in your bash profile'
|
|
11352
11373
|
)
|
|
@@ -11360,7 +11381,7 @@ void (async () => {
|
|
|
11360
11381
|
await vendor.updater({
|
|
11361
11382
|
name: SOCKET_CLI_BIN_NAME,
|
|
11362
11383
|
// The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION']".
|
|
11363
|
-
version: '0.14.
|
|
11384
|
+
version: '0.14.95',
|
|
11364
11385
|
ttl: 86_400_000 /* 24 hours in milliseconds */
|
|
11365
11386
|
})
|
|
11366
11387
|
try {
|
|
@@ -11397,7 +11418,7 @@ void (async () => {
|
|
|
11397
11418
|
argv: process$1.argv.slice(2),
|
|
11398
11419
|
name: SOCKET_CLI_BIN_NAME,
|
|
11399
11420
|
importMeta: {
|
|
11400
|
-
url: `${require$$0.pathToFileURL(__filename)}`
|
|
11421
|
+
url: `${require$$0$2.pathToFileURL(__filename)}`
|
|
11401
11422
|
}
|
|
11402
11423
|
}
|
|
11403
11424
|
)
|
|
@@ -11415,8 +11436,8 @@ void (async () => {
|
|
|
11415
11436
|
errorBody = e.body
|
|
11416
11437
|
} else if (e instanceof Error) {
|
|
11417
11438
|
errorTitle = 'Unexpected error'
|
|
11418
|
-
errorMessage =
|
|
11419
|
-
errorBody =
|
|
11439
|
+
errorMessage = vendor.messageWithCauses(e)
|
|
11440
|
+
errorBody = vendor.stackWithCauses(e)
|
|
11420
11441
|
} else {
|
|
11421
11442
|
errorTitle = 'Unexpected error with no details'
|
|
11422
11443
|
}
|
|
@@ -11428,5 +11449,5 @@ void (async () => {
|
|
|
11428
11449
|
await shadowNpmInject.captureException(e)
|
|
11429
11450
|
}
|
|
11430
11451
|
})()
|
|
11431
|
-
//# debugId=
|
|
11452
|
+
//# debugId=c34fd255-4999-4681-9636-3dc45d80a01d
|
|
11432
11453
|
//# sourceMappingURL=cli.js.map
|