@socketsecurity/cli-with-sentry 1.0.10 → 1.0.11
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 +25 -27
- package/dist/cli.js.map +1 -1
- package/dist/constants.js +3 -3
- package/dist/constants.js.map +1 -1
- package/dist/shadow-npm-bin.js +3 -4
- package/dist/shadow-npm-bin.js.map +1 -1
- package/dist/types/commands/fix/git.d.mts.map +1 -1
- package/dist/types/commands/optimize/ls-by-agent.d.mts.map +1 -1
- package/dist/types/commands/scan/suggest_branch_slug.d.mts.map +1 -1
- package/dist/types/shadow/npm/bin.d.mts.map +1 -1
- package/dist/types/utils/coana.d.mts.map +1 -1
- package/dist/types/utils/package-environment.d.mts.map +1 -1
- package/dist/utils.js +8 -7
- package/dist/utils.js.map +1 -1
- package/dist/vendor.js +9 -9
- package/external/@socketsecurity/registry/lib/spawn.js +44 -23
- package/package.json +4 -4
package/dist/cli.js
CHANGED
|
@@ -3010,10 +3010,10 @@ async function getBaseGitBranch(cwd = process.cwd()) {
|
|
|
3010
3010
|
// 3. Try to resolve the default remote branch using 'git remote show origin'.
|
|
3011
3011
|
// This handles detached HEADs or workflows triggered by tags/releases.
|
|
3012
3012
|
try {
|
|
3013
|
-
const
|
|
3013
|
+
const originDetails = (await spawn.spawn('git', ['remote', 'show', 'origin'], {
|
|
3014
3014
|
cwd
|
|
3015
|
-
})).stdout
|
|
3016
|
-
const match = /(?<=HEAD branch: ).+/.exec(
|
|
3015
|
+
})).stdout;
|
|
3016
|
+
const match = /(?<=HEAD branch: ).+/.exec(originDetails);
|
|
3017
3017
|
if (match?.[0]) {
|
|
3018
3018
|
return match[0].trim();
|
|
3019
3019
|
}
|
|
@@ -3122,9 +3122,9 @@ async function gitCreateAndPushBranch(branch, commitMsg, filepaths, options) {
|
|
|
3122
3122
|
}
|
|
3123
3123
|
async function gitRepoInfo(cwd = process.cwd()) {
|
|
3124
3124
|
try {
|
|
3125
|
-
const remoteUrl =
|
|
3125
|
+
const remoteUrl = (await spawn.spawn('git', ['remote', 'get-url', 'origin'], {
|
|
3126
3126
|
cwd
|
|
3127
|
-
})).stdout
|
|
3127
|
+
})).stdout;
|
|
3128
3128
|
// 1. Handle SSH-style, e.g. git@github.com:owner/repo.git
|
|
3129
3129
|
const sshMatch = /^git@[^:]+:([^/]+)\/(.+?)(?:\.git)?$/.exec(remoteUrl);
|
|
3130
3130
|
if (sshMatch) {
|
|
@@ -3168,7 +3168,7 @@ async function gitEnsureIdentity(name, email, cwd = process.cwd()) {
|
|
|
3168
3168
|
let configValue;
|
|
3169
3169
|
try {
|
|
3170
3170
|
// Will throw with exit code 1 if the config property is not set.
|
|
3171
|
-
configValue =
|
|
3171
|
+
configValue = (await spawn.spawn('git', ['config', '--get', prop], stdioPipeOptions)).stdout;
|
|
3172
3172
|
} catch {}
|
|
3173
3173
|
if (configValue !== value) {
|
|
3174
3174
|
try {
|
|
@@ -3184,10 +3184,9 @@ async function gitRemoteBranchExists(branch, cwd = process.cwd()) {
|
|
|
3184
3184
|
cwd
|
|
3185
3185
|
};
|
|
3186
3186
|
try {
|
|
3187
|
-
return
|
|
3188
|
-
} catch {
|
|
3189
|
-
|
|
3190
|
-
}
|
|
3187
|
+
return (await spawn.spawn('git', ['ls-remote', '--heads', 'origin', branch], stdioPipeOptions)).stdout.length > 0;
|
|
3188
|
+
} catch {}
|
|
3189
|
+
return false;
|
|
3191
3190
|
}
|
|
3192
3191
|
async function gitResetAndClean(branch = 'HEAD', cwd = process.cwd()) {
|
|
3193
3192
|
// Discards tracked changes.
|
|
@@ -3207,11 +3206,11 @@ async function gitUnstagedModifiedFiles(cwd = process.cwd()) {
|
|
|
3207
3206
|
const stdioPipeOptions = {
|
|
3208
3207
|
cwd
|
|
3209
3208
|
};
|
|
3210
|
-
const
|
|
3211
|
-
const
|
|
3209
|
+
const changedFilesDetails = (await spawn.spawn('git', ['diff', '--name-only'], stdioPipeOptions)).stdout;
|
|
3210
|
+
const rawRelPaths = changedFilesDetails.split('\n') ?? [];
|
|
3212
3211
|
return {
|
|
3213
3212
|
ok: true,
|
|
3214
|
-
data:
|
|
3213
|
+
data: rawRelPaths.map(relPath => path$1.normalizePath(relPath))
|
|
3215
3214
|
};
|
|
3216
3215
|
} catch (e) {
|
|
3217
3216
|
debug.debugFn('catch: git diff --name-only failed\n', e);
|
|
@@ -7163,11 +7162,11 @@ function parsableToQueryStdout(stdout) {
|
|
|
7163
7162
|
async function npmQuery(npmExecPath, cwd) {
|
|
7164
7163
|
let stdout = '';
|
|
7165
7164
|
try {
|
|
7166
|
-
stdout =
|
|
7165
|
+
stdout = (await spawn.spawn(npmExecPath, ['query', ':not(.dev)'], {
|
|
7167
7166
|
cwd,
|
|
7168
7167
|
// Lazily access constants.WIN32.
|
|
7169
7168
|
shell: constants.WIN32
|
|
7170
|
-
})).stdout
|
|
7169
|
+
})).stdout;
|
|
7171
7170
|
} catch {}
|
|
7172
7171
|
return cleanupQueryStdout(stdout);
|
|
7173
7172
|
}
|
|
@@ -7175,11 +7174,11 @@ async function lsBun(pkgEnvDetails, cwd) {
|
|
|
7175
7174
|
try {
|
|
7176
7175
|
// Bun does not support filtering by production packages yet.
|
|
7177
7176
|
// https://github.com/oven-sh/bun/issues/8283
|
|
7178
|
-
return
|
|
7177
|
+
return (await spawn.spawn(pkgEnvDetails.agentExecPath, ['pm', 'ls', '--all'], {
|
|
7179
7178
|
cwd,
|
|
7180
7179
|
// Lazily access constants.WIN32.
|
|
7181
7180
|
shell: constants.WIN32
|
|
7182
|
-
})).stdout
|
|
7181
|
+
})).stdout;
|
|
7183
7182
|
} catch {}
|
|
7184
7183
|
return '';
|
|
7185
7184
|
}
|
|
@@ -7196,14 +7195,14 @@ async function lsPnpm(pkgEnvDetails, cwd, options) {
|
|
|
7196
7195
|
}
|
|
7197
7196
|
let stdout = '';
|
|
7198
7197
|
try {
|
|
7199
|
-
stdout =
|
|
7198
|
+
stdout = (await spawn.spawn(pkgEnvDetails.agentExecPath,
|
|
7200
7199
|
// Pnpm uses the alternative spelling of parsable.
|
|
7201
7200
|
// https://en.wiktionary.org/wiki/parsable
|
|
7202
7201
|
['ls', '--parseable', '--prod', '--depth', 'Infinity'], {
|
|
7203
7202
|
cwd,
|
|
7204
7203
|
// Lazily access constants.WIN32.
|
|
7205
7204
|
shell: constants.WIN32
|
|
7206
|
-
})).stdout
|
|
7205
|
+
})).stdout;
|
|
7207
7206
|
} catch {}
|
|
7208
7207
|
return parsableToQueryStdout(stdout);
|
|
7209
7208
|
}
|
|
@@ -7211,24 +7210,23 @@ async function lsVlt(pkgEnvDetails, cwd) {
|
|
|
7211
7210
|
let stdout = '';
|
|
7212
7211
|
try {
|
|
7213
7212
|
// See https://docs.vlt.sh/cli/commands/list#options.
|
|
7214
|
-
stdout =
|
|
7213
|
+
stdout = (await spawn.spawn(pkgEnvDetails.agentExecPath, ['ls', '--view', 'human', ':not(.dev)'], {
|
|
7215
7214
|
cwd,
|
|
7216
7215
|
// Lazily access constants.WIN32.
|
|
7217
7216
|
shell: constants.WIN32
|
|
7218
|
-
})).stdout
|
|
7217
|
+
})).stdout;
|
|
7219
7218
|
} catch {}
|
|
7220
7219
|
return cleanupQueryStdout(stdout);
|
|
7221
7220
|
}
|
|
7222
7221
|
async function lsYarnBerry(pkgEnvDetails, cwd) {
|
|
7223
7222
|
try {
|
|
7224
|
-
return strings.stripAnsi(
|
|
7225
7223
|
// Yarn Berry does not support filtering by production packages yet.
|
|
7226
7224
|
// https://github.com/yarnpkg/berry/issues/5117
|
|
7227
|
-
(await spawn.spawn(pkgEnvDetails.agentExecPath, ['info', '--recursive', '--name-only'], {
|
|
7225
|
+
return (await spawn.spawn(pkgEnvDetails.agentExecPath, ['info', '--recursive', '--name-only'], {
|
|
7228
7226
|
cwd,
|
|
7229
7227
|
// Lazily access constants.WIN32.
|
|
7230
7228
|
shell: constants.WIN32
|
|
7231
|
-
})).stdout
|
|
7229
|
+
})).stdout;
|
|
7232
7230
|
} catch {}
|
|
7233
7231
|
return '';
|
|
7234
7232
|
}
|
|
@@ -7238,11 +7236,11 @@ async function lsYarnClassic(pkgEnvDetails, cwd) {
|
|
|
7238
7236
|
// https://github.com/yarnpkg/yarn/releases/tag/v1.0.0
|
|
7239
7237
|
// > Fix: Excludes dev dependencies from the yarn list output when the
|
|
7240
7238
|
// environment is production
|
|
7241
|
-
return
|
|
7239
|
+
return (await spawn.spawn(pkgEnvDetails.agentExecPath, ['list', '--prod'], {
|
|
7242
7240
|
cwd,
|
|
7243
7241
|
// Lazily access constants.WIN32.
|
|
7244
7242
|
shell: constants.WIN32
|
|
7245
|
-
})).stdout
|
|
7243
|
+
})).stdout;
|
|
7246
7244
|
} catch {}
|
|
7247
7245
|
return '';
|
|
7248
7246
|
}
|
|
@@ -14177,5 +14175,5 @@ void (async () => {
|
|
|
14177
14175
|
await utils.captureException(e);
|
|
14178
14176
|
}
|
|
14179
14177
|
})();
|
|
14180
|
-
//# debugId=
|
|
14178
|
+
//# debugId=50b201bd-872f-4cc2-a080-a88cc2f0878
|
|
14181
14179
|
//# sourceMappingURL=cli.js.map
|