socket 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/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 +1 -1
package/dist/module-sync/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:9f97cc47: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
|
}
|
|
@@ -4480,37 +4485,23 @@ async function pnpmFix(
|
|
|
4480
4485
|
// Process the workspace root last since it will add an override to package.json.
|
|
4481
4486
|
pkgEnvDetails.editablePkgJson.filename
|
|
4482
4487
|
]
|
|
4483
|
-
let actualTree = await getActualTree(cwd)
|
|
4484
4488
|
for (const { 0: name, 1: infos } of infoByPkg) {
|
|
4489
|
+
debug.debugLog(`Processing vulnerable package: ${name}`)
|
|
4485
4490
|
if (registry.getManifestData(NPM$c, name)) {
|
|
4486
4491
|
spinner?.info(`Skipping ${name}. Socket Optimize package exists.`)
|
|
4487
4492
|
continue
|
|
4488
4493
|
}
|
|
4489
|
-
const oldVersions = arrays.arrayUnique(
|
|
4490
|
-
shadowNpmInject
|
|
4491
|
-
.findPackageNodes(actualTree, name)
|
|
4492
|
-
.map(n => n.target?.version ?? n.version)
|
|
4493
|
-
.filter(Boolean)
|
|
4494
|
-
)
|
|
4495
|
-
const packument =
|
|
4496
|
-
oldVersions.length && infos.length
|
|
4497
|
-
? // eslint-disable-next-line no-await-in-loop
|
|
4498
|
-
await packages.fetchPackagePackument(name)
|
|
4499
|
-
: null
|
|
4500
|
-
if (!packument) {
|
|
4501
|
-
continue
|
|
4502
|
-
}
|
|
4503
4494
|
const fixedSpecs = new Set()
|
|
4504
4495
|
for (const pkgJsonPath of pkgJsonPaths) {
|
|
4505
|
-
|
|
4496
|
+
debug.debugLog(`Checking workspace: ${pkgJsonPath}`)
|
|
4497
|
+
|
|
4506
4498
|
// eslint-disable-next-line no-await-in-loop
|
|
4507
|
-
actualTree = await getActualTree(cwd)
|
|
4508
|
-
const pkgPath = path$1.dirname(pkgJsonPath)
|
|
4499
|
+
let actualTree = await getActualTree(cwd)
|
|
4509
4500
|
const isWorkspaceRoot =
|
|
4510
4501
|
pkgJsonPath === pkgEnvDetails.editablePkgJson.filename
|
|
4511
4502
|
const workspaceName = isWorkspaceRoot
|
|
4512
4503
|
? 'root'
|
|
4513
|
-
: path$1.relative(rootPath,
|
|
4504
|
+
: path$1.relative(rootPath, path$1.dirname(pkgJsonPath))
|
|
4514
4505
|
const editablePkgJson = isWorkspaceRoot
|
|
4515
4506
|
? pkgEnvDetails.editablePkgJson
|
|
4516
4507
|
: // eslint-disable-next-line no-await-in-loop
|
|
@@ -4521,6 +4512,20 @@ async function pnpmFix(
|
|
|
4521
4512
|
// Get current overrides for revert logic
|
|
4522
4513
|
const oldPnpmSection = editablePkgJson.content[PNPM$8]
|
|
4523
4514
|
const oldOverrides = oldPnpmSection?.[OVERRIDES$2]
|
|
4515
|
+
const oldVersions = arrays.arrayUnique(
|
|
4516
|
+
shadowNpmInject
|
|
4517
|
+
.findPackageNodes(actualTree, name)
|
|
4518
|
+
.map(n => n.target?.version ?? n.version)
|
|
4519
|
+
.filter(Boolean)
|
|
4520
|
+
)
|
|
4521
|
+
const packument =
|
|
4522
|
+
oldVersions.length && infos.length
|
|
4523
|
+
? // eslint-disable-next-line no-await-in-loop
|
|
4524
|
+
await packages.fetchPackagePackument(name)
|
|
4525
|
+
: null
|
|
4526
|
+
if (!packument) {
|
|
4527
|
+
continue
|
|
4528
|
+
}
|
|
4524
4529
|
for (const oldVersion of oldVersions) {
|
|
4525
4530
|
const oldSpec = `${name}@${oldVersion}`
|
|
4526
4531
|
const oldPurl = `pkg:npm/${oldSpec}`
|
|
@@ -4700,11 +4705,9 @@ async function pnpmFix(
|
|
|
4700
4705
|
)
|
|
4701
4706
|
} else if (isCi) {
|
|
4702
4707
|
// eslint-disable-next-line no-await-in-loop
|
|
4703
|
-
await
|
|
4704
|
-
|
|
4705
|
-
|
|
4706
|
-
gitCheckoutBaseBranchIfAvailable(baseBranch, cwd)
|
|
4707
|
-
])
|
|
4708
|
+
await gitHardReset(baseBranch, cwd)
|
|
4709
|
+
// eslint-disable-next-line no-await-in-loop
|
|
4710
|
+
await gitCleanFdx(cwd)
|
|
4708
4711
|
// eslint-disable-next-line no-await-in-loop
|
|
4709
4712
|
actualTree = await install(pkgEnvDetails, {
|
|
4710
4713
|
spinner
|
|
@@ -12282,7 +12285,7 @@ void (async () => {
|
|
|
12282
12285
|
await vendor.updater({
|
|
12283
12286
|
name: SOCKET_CLI_BIN_NAME,
|
|
12284
12287
|
// The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION']".
|
|
12285
|
-
version: '0.14.
|
|
12288
|
+
version: '0.14.128',
|
|
12286
12289
|
ttl: 86_400_000 /* 24 hours in milliseconds */
|
|
12287
12290
|
})
|
|
12288
12291
|
try {
|
|
@@ -12350,5 +12353,5 @@ void (async () => {
|
|
|
12350
12353
|
await shadowNpmInject.captureException(e)
|
|
12351
12354
|
}
|
|
12352
12355
|
})()
|
|
12353
|
-
//# debugId=
|
|
12356
|
+
//# debugId=f1c6fcaa-6659-4ef8-b1e9-947a9992b085
|
|
12354
12357
|
//# sourceMappingURL=cli.js.map
|