@socketsecurity/cli-with-sentry 1.0.33 → 1.0.35
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/cli.js +22 -48
- package/dist/cli.js.map +1 -1
- package/dist/constants.js +3 -3
- package/dist/constants.js.map +1 -1
- package/dist/types/commands/fix/agent-fix.d.mts.map +1 -1
- package/dist/types/commands/fix/git.d.mts.map +1 -1
- package/dist/types/commands/fix/pull-request.d.mts.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -3091,7 +3091,7 @@ function getSocketPullRequestTitle(purl, newVersion, workspace) {
|
|
|
3091
3091
|
async function gitCleanFdx(cwd = process.cwd()) {
|
|
3092
3092
|
const stdioIgnoreOptions = {
|
|
3093
3093
|
cwd,
|
|
3094
|
-
stdio: 'ignore'
|
|
3094
|
+
stdio: debug.isDebug('stdio') ? 'inherit' : 'ignore'
|
|
3095
3095
|
};
|
|
3096
3096
|
// TODO: propagate CResult?
|
|
3097
3097
|
await spawn.spawn('git', ['clean', '-fdx'], stdioIgnoreOptions);
|
|
@@ -3109,16 +3109,8 @@ async function gitCreateAndPushBranch(branch, commitMsg, filepaths, options) {
|
|
|
3109
3109
|
};
|
|
3110
3110
|
const stdioIgnoreOptions = {
|
|
3111
3111
|
cwd,
|
|
3112
|
-
stdio: 'inherit'
|
|
3112
|
+
stdio: debug.isDebug('stdio') ? 'inherit' : 'ignore'
|
|
3113
3113
|
};
|
|
3114
|
-
logger.logger.dir({
|
|
3115
|
-
branch,
|
|
3116
|
-
user,
|
|
3117
|
-
email,
|
|
3118
|
-
cwd,
|
|
3119
|
-
filepaths,
|
|
3120
|
-
commitMsg
|
|
3121
|
-
});
|
|
3122
3114
|
try {
|
|
3123
3115
|
await gitEnsureIdentity(user, email, cwd);
|
|
3124
3116
|
await spawn.spawn('git', ['checkout', '-b', branch], stdioIgnoreOptions);
|
|
@@ -3127,14 +3119,10 @@ async function gitCreateAndPushBranch(branch, commitMsg, filepaths, options) {
|
|
|
3127
3119
|
await spawn.spawn('git', ['push', '--force', '--set-upstream', 'origin', branch], stdioIgnoreOptions);
|
|
3128
3120
|
return true;
|
|
3129
3121
|
} catch (e) {
|
|
3130
|
-
|
|
3122
|
+
debug.debugFn('error', `caught: git push --force --set-upstream origin ${branch} failed`);
|
|
3123
|
+
debug.debugDir('inspect', {
|
|
3131
3124
|
error: e
|
|
3132
3125
|
});
|
|
3133
|
-
// debugFn(
|
|
3134
|
-
// 'error',
|
|
3135
|
-
// `caught: git push --force --set-upstream origin ${branch} failed`,
|
|
3136
|
-
// )
|
|
3137
|
-
// debugDir('inspect', { error: e })
|
|
3138
3126
|
}
|
|
3139
3127
|
try {
|
|
3140
3128
|
// Will throw with exit code 1 if branch does not exist.
|
|
@@ -3183,7 +3171,7 @@ async function gitRepoInfo(cwd = process.cwd()) {
|
|
|
3183
3171
|
async function gitEnsureIdentity(name, email, cwd = process.cwd()) {
|
|
3184
3172
|
const stdioIgnoreOptions = {
|
|
3185
3173
|
cwd,
|
|
3186
|
-
stdio: 'ignore'
|
|
3174
|
+
stdio: debug.isDebug('stdio') ? 'inherit' : 'ignore'
|
|
3187
3175
|
};
|
|
3188
3176
|
const stdioPipeOptions = {
|
|
3189
3177
|
cwd
|
|
@@ -3228,7 +3216,7 @@ async function gitResetAndClean(branch = 'HEAD', cwd = process.cwd()) {
|
|
|
3228
3216
|
async function gitResetHard(branch = 'HEAD', cwd = process.cwd()) {
|
|
3229
3217
|
const stdioIgnoreOptions = {
|
|
3230
3218
|
cwd,
|
|
3231
|
-
stdio: 'ignore'
|
|
3219
|
+
stdio: debug.isDebug('stdio') ? 'inherit' : 'ignore'
|
|
3232
3220
|
};
|
|
3233
3221
|
await spawn.spawn('git', ['reset', '--hard', branch], stdioIgnoreOptions);
|
|
3234
3222
|
}
|
|
@@ -3238,13 +3226,10 @@ async function gitUnstagedModifiedFiles(cwd = process.cwd()) {
|
|
|
3238
3226
|
cwd
|
|
3239
3227
|
};
|
|
3240
3228
|
const changedFilesDetails = (await spawn.spawn('git', ['diff', '--name-only'], stdioPipeOptions)).stdout;
|
|
3241
|
-
const
|
|
3242
|
-
console.log({
|
|
3243
|
-
rawRelPaths
|
|
3244
|
-
});
|
|
3229
|
+
const relPaths = changedFilesDetails.split('\n') ?? [];
|
|
3245
3230
|
return {
|
|
3246
3231
|
ok: true,
|
|
3247
|
-
data:
|
|
3232
|
+
data: relPaths.map(p => path$1.normalizePath(p))
|
|
3248
3233
|
};
|
|
3249
3234
|
} catch (e) {
|
|
3250
3235
|
debug.debugFn('error', 'caught: git diff --name-only failed');
|
|
@@ -3644,7 +3629,7 @@ async function openPr(owner, repo, branch, purl, newVersion, options) {
|
|
|
3644
3629
|
async function setGitRemoteGithubRepoUrl(owner, repo, token, cwd = process.cwd()) {
|
|
3645
3630
|
const stdioIgnoreOptions = {
|
|
3646
3631
|
cwd,
|
|
3647
|
-
stdio: 'ignore'
|
|
3632
|
+
stdio: debug.isDebug('stdio') ? 'inherit' : 'ignore'
|
|
3648
3633
|
};
|
|
3649
3634
|
const {
|
|
3650
3635
|
host
|
|
@@ -3936,10 +3921,7 @@ async function agentFix(pkgEnvDetails, actualTree, alertsMap, installer, {
|
|
|
3936
3921
|
cwd,
|
|
3937
3922
|
spinner
|
|
3938
3923
|
});
|
|
3939
|
-
|
|
3940
|
-
// eslint-disable-next-line no-await-in-loop
|
|
3941
|
-
await utils.readLockfile(pkgEnvDetails.lockPath) : null;
|
|
3942
|
-
if (maybeActualTree && maybeLockSrc) {
|
|
3924
|
+
if (maybeActualTree && fs$1.existsSync(pkgEnvDetails.lockPath)) {
|
|
3943
3925
|
actualTree = maybeActualTree;
|
|
3944
3926
|
}
|
|
3945
3927
|
}
|
|
@@ -4054,6 +4036,9 @@ async function agentFix(pkgEnvDetails, actualTree, alertsMap, installer, {
|
|
|
4054
4036
|
}
|
|
4055
4037
|
continue infosLoop;
|
|
4056
4038
|
}
|
|
4039
|
+
|
|
4040
|
+
// eslint-disable-next-line no-await-in-loop
|
|
4041
|
+
const lockSrc = await utils.readLockfile(pkgEnvDetails.lockPath);
|
|
4057
4042
|
if (!hasAnnouncedWorkspace) {
|
|
4058
4043
|
hasAnnouncedWorkspace = true;
|
|
4059
4044
|
workspaceLogCallCount = logger.logger.logCallCount;
|
|
@@ -4069,19 +4054,10 @@ async function agentFix(pkgEnvDetails, actualTree, alertsMap, installer, {
|
|
|
4069
4054
|
cwd,
|
|
4070
4055
|
spinner
|
|
4071
4056
|
});
|
|
4072
|
-
|
|
4073
|
-
const unstagedCResult = await gitUnstagedModifiedFiles(cwd);
|
|
4074
|
-
console.log('after installer', unstagedCResult);
|
|
4075
|
-
const maybeLockSrc = maybeActualTree ?
|
|
4076
|
-
// eslint-disable-next-line no-await-in-loop
|
|
4077
|
-
await utils.readLockfile(pkgEnvDetails.lockPath) : null;
|
|
4078
|
-
if (maybeActualTree && maybeLockSrc) {
|
|
4057
|
+
if (maybeActualTree && fs$1.existsSync(pkgEnvDetails.lockPath)) {
|
|
4079
4058
|
actualTree = maybeActualTree;
|
|
4080
4059
|
// eslint-disable-next-line no-await-in-loop
|
|
4081
4060
|
await afterInstall(editablePkgJson, packument, oldVersion, newVersion, vulnerableVersionRange, fixConfig);
|
|
4082
|
-
// eslint-disable-next-line no-await-in-loop
|
|
4083
|
-
const unstagedCResult = await gitUnstagedModifiedFiles(cwd);
|
|
4084
|
-
console.log('after afterInstall', unstagedCResult);
|
|
4085
4061
|
if (test) {
|
|
4086
4062
|
spinner?.info(`Testing ${newId} in ${workspace}.`);
|
|
4087
4063
|
// eslint-disable-next-line no-await-in-loop
|
|
@@ -4103,12 +4079,13 @@ async function agentFix(pkgEnvDetails, actualTree, alertsMap, installer, {
|
|
|
4103
4079
|
|
|
4104
4080
|
// Check repoInfo to make TypeScript happy.
|
|
4105
4081
|
if (!errored && fixEnv.isCi && fixEnv.repoInfo) {
|
|
4082
|
+
// Rewrite files in case the install reverted them.
|
|
4106
4083
|
// eslint-disable-next-line no-await-in-loop
|
|
4107
|
-
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
4084
|
+
await editablePkgJson.save({
|
|
4085
|
+
ignoreWhitespace: true
|
|
4086
|
+
});
|
|
4087
|
+
// eslint-disable-next-line no-await-in-loop
|
|
4088
|
+
await fs$1.promises.writeFile(pkgEnvDetails.lockPath, lockSrc, 'utf8');
|
|
4112
4089
|
try {
|
|
4113
4090
|
if (
|
|
4114
4091
|
// eslint-disable-next-line no-await-in-loop
|
|
@@ -4125,10 +4102,7 @@ async function agentFix(pkgEnvDetails, actualTree, alertsMap, installer, {
|
|
|
4125
4102
|
cwd,
|
|
4126
4103
|
spinner
|
|
4127
4104
|
});
|
|
4128
|
-
|
|
4129
|
-
// eslint-disable-next-line no-await-in-loop
|
|
4130
|
-
await utils.readLockfile(pkgEnvDetails.lockPath) : null;
|
|
4131
|
-
if (maybeActualTree && maybeLockSrc) {
|
|
4105
|
+
if (maybeActualTree && fs$1.existsSync(pkgEnvDetails.lockPath)) {
|
|
4132
4106
|
actualTree = maybeActualTree;
|
|
4133
4107
|
continue infosLoop;
|
|
4134
4108
|
}
|
|
@@ -14289,5 +14263,5 @@ void (async () => {
|
|
|
14289
14263
|
await utils.captureException(e);
|
|
14290
14264
|
}
|
|
14291
14265
|
})();
|
|
14292
|
-
//# debugId=
|
|
14266
|
+
//# debugId=4d4efe6d-3f8e-4bd8-b5f9-0987e88a59d4
|
|
14293
14267
|
//# sourceMappingURL=cli.js.map
|