@socketsecurity/cli-with-sentry 0.14.126 → 0.14.128
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/instrument-with-sentry.js +2 -2
- package/dist/instrument-with-sentry.js.map +1 -1
- package/dist/module-sync/cli.js +32 -29
- package/dist/module-sync/cli.js.map +1 -1
- package/dist/module-sync/shadow-npm-inject.js +2 -2
- package/dist/module-sync/shadow-npm-inject.js.map +1 -1
- package/dist/require/cli.js +32 -29
- package/dist/require/cli.js.map +1 -1
- package/dist/require/shadow-npm-inject.js +2 -2
- package/dist/require/shadow-npm-inject.js.map +1 -1
- package/package.json +2 -2
package/dist/require/cli.js
CHANGED
|
@@ -917,7 +917,7 @@ function emitBanner(name) {
|
|
|
917
917
|
logger.logger.error(getAsciiHeader(name))
|
|
918
918
|
}
|
|
919
919
|
function getAsciiHeader(command) {
|
|
920
|
-
const cliVersion = '0.14.
|
|
920
|
+
const cliVersion = '0.14.128:ec33790:2e43d170:pub' // The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION_HASH']".
|
|
921
921
|
const nodeVersion = process$1.version
|
|
922
922
|
const apiToken = shadowNpmInject.getDefaultToken()
|
|
923
923
|
const defaultOrg = shadowNpmInject.getConfigValue('defaultOrg')
|
|
@@ -3811,6 +3811,11 @@ async function gitCheckoutBaseBranchIfAvailable(
|
|
|
3811
3811
|
debug.debugLog(e)
|
|
3812
3812
|
}
|
|
3813
3813
|
}
|
|
3814
|
+
async function gitCleanFdx(cwd = process.cwd()) {
|
|
3815
|
+
await spawn.spawn('git', ['clean', '-fdx'], {
|
|
3816
|
+
cwd
|
|
3817
|
+
})
|
|
3818
|
+
}
|
|
3814
3819
|
async function gitCreateAndPushBranchIfNeeded(
|
|
3815
3820
|
branch,
|
|
3816
3821
|
commitMsg,
|
|
@@ -3846,8 +3851,8 @@ async function gitCreateAndPushBranchIfNeeded(
|
|
|
3846
3851
|
})
|
|
3847
3852
|
return true
|
|
3848
3853
|
}
|
|
3849
|
-
async function gitHardReset(cwd = process.cwd()) {
|
|
3850
|
-
await spawn.spawn('git', ['reset', '--hard'], {
|
|
3854
|
+
async function gitHardReset(branch = 'HEAD', cwd = process.cwd()) {
|
|
3855
|
+
await spawn.spawn('git', ['reset', '--hard', branch], {
|
|
3851
3856
|
cwd
|
|
3852
3857
|
})
|
|
3853
3858
|
}
|
|
@@ -4484,37 +4489,23 @@ async function pnpmFix(
|
|
|
4484
4489
|
// Process the workspace root last since it will add an override to package.json.
|
|
4485
4490
|
pkgEnvDetails.editablePkgJson.filename
|
|
4486
4491
|
]
|
|
4487
|
-
let actualTree = await getActualTree(cwd)
|
|
4488
4492
|
for (const { 0: name, 1: infos } of infoByPkg) {
|
|
4493
|
+
debug.debugLog(`Processing vulnerable package: ${name}`)
|
|
4489
4494
|
if (registry.getManifestData(NPM$c, name)) {
|
|
4490
4495
|
spinner?.info(`Skipping ${name}. Socket Optimize package exists.`)
|
|
4491
4496
|
continue
|
|
4492
4497
|
}
|
|
4493
|
-
const oldVersions = arrays.arrayUnique(
|
|
4494
|
-
shadowNpmInject
|
|
4495
|
-
.findPackageNodes(actualTree, name)
|
|
4496
|
-
.map(n => n.target?.version ?? n.version)
|
|
4497
|
-
.filter(Boolean)
|
|
4498
|
-
)
|
|
4499
|
-
const packument =
|
|
4500
|
-
oldVersions.length && infos.length
|
|
4501
|
-
? // eslint-disable-next-line no-await-in-loop
|
|
4502
|
-
await packages.fetchPackagePackument(name)
|
|
4503
|
-
: null
|
|
4504
|
-
if (!packument) {
|
|
4505
|
-
continue
|
|
4506
|
-
}
|
|
4507
4498
|
const fixedSpecs = new Set()
|
|
4508
4499
|
for (const pkgJsonPath of pkgJsonPaths) {
|
|
4509
|
-
|
|
4500
|
+
debug.debugLog(`Checking workspace: ${pkgJsonPath}`)
|
|
4501
|
+
|
|
4510
4502
|
// eslint-disable-next-line no-await-in-loop
|
|
4511
|
-
actualTree = await getActualTree(cwd)
|
|
4512
|
-
const pkgPath = path$1.dirname(pkgJsonPath)
|
|
4503
|
+
let actualTree = await getActualTree(cwd)
|
|
4513
4504
|
const isWorkspaceRoot =
|
|
4514
4505
|
pkgJsonPath === pkgEnvDetails.editablePkgJson.filename
|
|
4515
4506
|
const workspaceName = isWorkspaceRoot
|
|
4516
4507
|
? 'root'
|
|
4517
|
-
: path$1.relative(rootPath,
|
|
4508
|
+
: path$1.relative(rootPath, path$1.dirname(pkgJsonPath))
|
|
4518
4509
|
const editablePkgJson = isWorkspaceRoot
|
|
4519
4510
|
? pkgEnvDetails.editablePkgJson
|
|
4520
4511
|
: // eslint-disable-next-line no-await-in-loop
|
|
@@ -4525,6 +4516,20 @@ async function pnpmFix(
|
|
|
4525
4516
|
// Get current overrides for revert logic
|
|
4526
4517
|
const oldPnpmSection = editablePkgJson.content[PNPM$8]
|
|
4527
4518
|
const oldOverrides = oldPnpmSection?.[OVERRIDES$2]
|
|
4519
|
+
const oldVersions = arrays.arrayUnique(
|
|
4520
|
+
shadowNpmInject
|
|
4521
|
+
.findPackageNodes(actualTree, name)
|
|
4522
|
+
.map(n => n.target?.version ?? n.version)
|
|
4523
|
+
.filter(Boolean)
|
|
4524
|
+
)
|
|
4525
|
+
const packument =
|
|
4526
|
+
oldVersions.length && infos.length
|
|
4527
|
+
? // eslint-disable-next-line no-await-in-loop
|
|
4528
|
+
await packages.fetchPackagePackument(name)
|
|
4529
|
+
: null
|
|
4530
|
+
if (!packument) {
|
|
4531
|
+
continue
|
|
4532
|
+
}
|
|
4528
4533
|
for (const oldVersion of oldVersions) {
|
|
4529
4534
|
const oldSpec = `${name}@${oldVersion}`
|
|
4530
4535
|
const oldPurl = `pkg:npm/${oldSpec}`
|
|
@@ -4704,11 +4709,9 @@ async function pnpmFix(
|
|
|
4704
4709
|
)
|
|
4705
4710
|
} else if (isCi) {
|
|
4706
4711
|
// eslint-disable-next-line no-await-in-loop
|
|
4707
|
-
await
|
|
4708
|
-
|
|
4709
|
-
|
|
4710
|
-
gitCheckoutBaseBranchIfAvailable(baseBranch, cwd)
|
|
4711
|
-
])
|
|
4712
|
+
await gitHardReset(baseBranch, cwd)
|
|
4713
|
+
// eslint-disable-next-line no-await-in-loop
|
|
4714
|
+
await gitCleanFdx(cwd)
|
|
4712
4715
|
// eslint-disable-next-line no-await-in-loop
|
|
4713
4716
|
actualTree = await install(pkgEnvDetails, {
|
|
4714
4717
|
spinner
|
|
@@ -12286,7 +12289,7 @@ void (async () => {
|
|
|
12286
12289
|
await vendor.updater({
|
|
12287
12290
|
name: SOCKET_CLI_BIN_NAME,
|
|
12288
12291
|
// The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION']".
|
|
12289
|
-
version: '0.14.
|
|
12292
|
+
version: '0.14.128',
|
|
12290
12293
|
ttl: 86_400_000 /* 24 hours in milliseconds */
|
|
12291
12294
|
})
|
|
12292
12295
|
try {
|
|
@@ -12354,5 +12357,5 @@ void (async () => {
|
|
|
12354
12357
|
await shadowNpmInject.captureException(e)
|
|
12355
12358
|
}
|
|
12356
12359
|
})()
|
|
12357
|
-
//# debugId=
|
|
12360
|
+
//# debugId=c19d3f6a-66fb-44e0-86a9-334f1e0e0447
|
|
12358
12361
|
//# sourceMappingURL=cli.js.map
|