@socketsecurity/cli-with-sentry 0.14.117 → 0.14.119
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 +44 -42
- 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 +44 -42
- 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/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.119:4f7b6a8:bcd85d46: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')
|
|
@@ -3817,12 +3817,9 @@ async function gitCreateAndPushBranchIfNeeded(
|
|
|
3817
3817
|
cwd = process.cwd()
|
|
3818
3818
|
) {
|
|
3819
3819
|
if (await gitBranchExists(branch, cwd)) {
|
|
3820
|
-
logger.logger.warn(`Branch "${branch}" already exists
|
|
3821
|
-
return
|
|
3820
|
+
logger.logger.warn(`Branch "${branch}" already exists, skipping creation.`)
|
|
3821
|
+
return true
|
|
3822
3822
|
}
|
|
3823
|
-
await spawn.spawn('git', ['checkout', '-b', branch], {
|
|
3824
|
-
cwd
|
|
3825
|
-
})
|
|
3826
3823
|
const moddedFilepaths = (await gitUnstagedModifiedFiles(cwd)).filter(p => {
|
|
3827
3824
|
const basename = path$1.basename(p)
|
|
3828
3825
|
return (
|
|
@@ -3831,11 +3828,16 @@ async function gitCreateAndPushBranchIfNeeded(
|
|
|
3831
3828
|
basename === 'pnpm-lock.yaml'
|
|
3832
3829
|
)
|
|
3833
3830
|
})
|
|
3834
|
-
if (moddedFilepaths.length) {
|
|
3835
|
-
|
|
3836
|
-
|
|
3837
|
-
})
|
|
3831
|
+
if (!moddedFilepaths.length) {
|
|
3832
|
+
logger.logger.warn('Nothing to commit, skipping push.')
|
|
3833
|
+
return false
|
|
3838
3834
|
}
|
|
3835
|
+
await spawn.spawn('git', ['checkout', '-b', branch], {
|
|
3836
|
+
cwd
|
|
3837
|
+
})
|
|
3838
|
+
await spawn.spawn('git', ['add', ...moddedFilepaths], {
|
|
3839
|
+
cwd
|
|
3840
|
+
})
|
|
3839
3841
|
await spawn.spawn('git', ['commit', '-m', commitMsg], {
|
|
3840
3842
|
cwd
|
|
3841
3843
|
})
|
|
@@ -4216,13 +4218,16 @@ async function npmFix(
|
|
|
4216
4218
|
error = e
|
|
4217
4219
|
errored = true
|
|
4218
4220
|
}
|
|
4219
|
-
if (
|
|
4221
|
+
if (
|
|
4222
|
+
!errored &&
|
|
4223
|
+
shouldOpenPr &&
|
|
4220
4224
|
// eslint-disable-next-line no-await-in-loop
|
|
4221
|
-
await gitCreateAndPushBranchIfNeeded(
|
|
4225
|
+
(await gitCreateAndPushBranchIfNeeded(
|
|
4222
4226
|
branch,
|
|
4223
4227
|
getSocketCommitMessage(oldPurl, newVersion, workspaceName),
|
|
4224
4228
|
cwd
|
|
4225
|
-
)
|
|
4229
|
+
))
|
|
4230
|
+
) {
|
|
4226
4231
|
// eslint-disable-next-line no-await-in-loop
|
|
4227
4232
|
const prResponse = await openGitHubPullRequest(
|
|
4228
4233
|
owner,
|
|
@@ -4248,19 +4253,15 @@ async function npmFix(
|
|
|
4248
4253
|
spinner?.error(`Reverting ${newSpec}${workspaceDetails}`, error)
|
|
4249
4254
|
}
|
|
4250
4255
|
}
|
|
4251
|
-
// eslint-disable-next-line no-await-in-loop
|
|
4252
|
-
await shadowNpmInject.removeNodeModules(cwd)
|
|
4253
|
-
if (isRepo) {
|
|
4254
|
-
// eslint-disable-next-line no-await-in-loop
|
|
4255
|
-
await gitHardReset(cwd)
|
|
4256
|
-
}
|
|
4257
4256
|
if (saved) {
|
|
4258
4257
|
editablePkgJson.update(revertData)
|
|
4259
|
-
if (!isRepo) {
|
|
4260
|
-
// eslint-disable-next-line no-await-in-loop
|
|
4261
|
-
await editablePkgJson.save()
|
|
4262
|
-
}
|
|
4263
4258
|
}
|
|
4259
|
+
// eslint-disable-next-line no-await-in-loop
|
|
4260
|
+
await Promise.all([
|
|
4261
|
+
shadowNpmInject.removeNodeModules(cwd),
|
|
4262
|
+
...(isRepo ? [gitHardReset(cwd)] : []),
|
|
4263
|
+
...(saved && !isRepo ? [editablePkgJson.save()] : [])
|
|
4264
|
+
])
|
|
4264
4265
|
if (!isRepo && installed) {
|
|
4265
4266
|
// eslint-disable-next-line no-await-in-loop
|
|
4266
4267
|
await install$1(revertTree, {
|
|
@@ -4677,13 +4678,16 @@ async function pnpmFix(
|
|
|
4677
4678
|
error = e
|
|
4678
4679
|
errored = true
|
|
4679
4680
|
}
|
|
4680
|
-
if (
|
|
4681
|
+
if (
|
|
4682
|
+
!errored &&
|
|
4683
|
+
shouldOpenPr &&
|
|
4681
4684
|
// eslint-disable-next-line no-await-in-loop
|
|
4682
|
-
await gitCreateAndPushBranchIfNeeded(
|
|
4685
|
+
(await gitCreateAndPushBranchIfNeeded(
|
|
4683
4686
|
branch,
|
|
4684
4687
|
getSocketCommitMessage(oldPurl, newVersion, workspaceName),
|
|
4685
4688
|
cwd
|
|
4686
|
-
)
|
|
4689
|
+
))
|
|
4690
|
+
) {
|
|
4687
4691
|
// eslint-disable-next-line no-await-in-loop
|
|
4688
4692
|
const prResponse = await openGitHubPullRequest(
|
|
4689
4693
|
owner,
|
|
@@ -4711,20 +4715,18 @@ async function pnpmFix(
|
|
|
4711
4715
|
}
|
|
4712
4716
|
editablePkgJson.update(revertData)
|
|
4713
4717
|
// eslint-disable-next-line no-await-in-loop
|
|
4714
|
-
await
|
|
4715
|
-
|
|
4716
|
-
|
|
4717
|
-
|
|
4718
|
-
|
|
4719
|
-
|
|
4720
|
-
|
|
4721
|
-
|
|
4722
|
-
|
|
4723
|
-
|
|
4724
|
-
|
|
4725
|
-
|
|
4726
|
-
})
|
|
4727
|
-
}
|
|
4718
|
+
await Promise.all([
|
|
4719
|
+
shadowNpmInject.removeNodeModules(cwd),
|
|
4720
|
+
...(isRepo
|
|
4721
|
+
? [gitHardReset(cwd)]
|
|
4722
|
+
: installed
|
|
4723
|
+
? [editablePkgJson.save()]
|
|
4724
|
+
: [])
|
|
4725
|
+
])
|
|
4726
|
+
// eslint-disable-next-line no-await-in-loop
|
|
4727
|
+
actualTree = await install(pkgEnvDetails, {
|
|
4728
|
+
spinner
|
|
4729
|
+
})
|
|
4728
4730
|
if (errored) {
|
|
4729
4731
|
if (!failedSpecs.has(newSpecKey)) {
|
|
4730
4732
|
failedSpecs.add(newSpecKey)
|
|
@@ -12306,7 +12308,7 @@ void (async () => {
|
|
|
12306
12308
|
await vendor.updater({
|
|
12307
12309
|
name: SOCKET_CLI_BIN_NAME,
|
|
12308
12310
|
// The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION']".
|
|
12309
|
-
version: '0.14.
|
|
12311
|
+
version: '0.14.119',
|
|
12310
12312
|
ttl: 86_400_000 /* 24 hours in milliseconds */
|
|
12311
12313
|
})
|
|
12312
12314
|
try {
|
|
@@ -12374,5 +12376,5 @@ void (async () => {
|
|
|
12374
12376
|
await shadowNpmInject.captureException(e)
|
|
12375
12377
|
}
|
|
12376
12378
|
})()
|
|
12377
|
-
//# debugId=
|
|
12379
|
+
//# debugId=451e4d23-1f70-43f5-92f6-ed127d74f7d7
|
|
12378
12380
|
//# sourceMappingURL=cli.js.map
|