socket 1.0.9 → 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 -28
- 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 -3
- 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/utils/coana.d.mts.map +1 -1
- package/dist/types/utils/package-environment.d.mts.map +1 -1
- package/dist/utils.js +7 -5
- package/dist/utils.js.map +1 -1
- package/dist/vendor.js +334 -333
- package/external/@socketsecurity/registry/external/@inquirer/confirm.js +60 -21
- package/external/@socketsecurity/registry/external/@inquirer/input.js +60 -21
- package/external/@socketsecurity/registry/external/@inquirer/password.js +60 -21
- package/external/@socketsecurity/registry/external/@inquirer/search.js +61 -22
- package/external/@socketsecurity/registry/external/@inquirer/select.js +61 -22
- package/external/@socketsecurity/registry/external/ansi-regex.js +13 -0
- package/external/@socketsecurity/registry/external/libnpmpack.js +137 -146
- package/external/@socketsecurity/registry/external/make-fetch-happen.js +85 -94
- package/external/@socketsecurity/registry/external/normalize-package-data.js +17 -404
- package/external/@socketsecurity/registry/external/pacote.js +124 -133
- package/external/@socketsecurity/registry/lib/spawn.js +44 -23
- package/external/@socketsecurity/registry/lib/strings.js +16 -0
- package/external/blessed-contrib/lib/widget/table.js +47 -12
- package/package.json +5 -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
|
}
|
|
@@ -3124,7 +3124,7 @@ async function gitRepoInfo(cwd = process.cwd()) {
|
|
|
3124
3124
|
try {
|
|
3125
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 = (await spawn.spawn('git', ['config', '--get', prop], stdioPipeOptions)).stdout
|
|
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 (await spawn.spawn('git', ['ls-remote', '--heads', 'origin', branch], stdioPipeOptions)).stdout.
|
|
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);
|
|
@@ -4579,7 +4578,7 @@ async function handleFix({
|
|
|
4579
4578
|
await outputFixResult({
|
|
4580
4579
|
ok: false,
|
|
4581
4580
|
message: 'Not supported.',
|
|
4582
|
-
cause: `${agent} is not supported by this command
|
|
4581
|
+
cause: `${agent} is not supported by this command.`
|
|
4583
4582
|
}, outputKind);
|
|
4584
4583
|
return;
|
|
4585
4584
|
}
|
|
@@ -7167,7 +7166,7 @@ async function npmQuery(npmExecPath, cwd) {
|
|
|
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
|
}
|
|
@@ -7179,7 +7178,7 @@ async function lsBun(pkgEnvDetails, cwd) {
|
|
|
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
|
}
|
|
@@ -7203,7 +7202,7 @@ async function lsPnpm(pkgEnvDetails, cwd, options) {
|
|
|
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
|
}
|
|
@@ -7215,21 +7214,19 @@ async function lsVlt(pkgEnvDetails, cwd) {
|
|
|
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
|
-
|
|
7225
|
-
|
|
7226
|
-
|
|
7227
|
-
|
|
7228
|
-
|
|
7229
|
-
|
|
7230
|
-
|
|
7231
|
-
})).stdout.trim()
|
|
7232
|
-
);
|
|
7223
|
+
// Yarn Berry does not support filtering by production packages yet.
|
|
7224
|
+
// https://github.com/yarnpkg/berry/issues/5117
|
|
7225
|
+
return (await spawn.spawn(pkgEnvDetails.agentExecPath, ['info', '--recursive', '--name-only'], {
|
|
7226
|
+
cwd,
|
|
7227
|
+
// Lazily access constants.WIN32.
|
|
7228
|
+
shell: constants.WIN32
|
|
7229
|
+
})).stdout;
|
|
7233
7230
|
} catch {}
|
|
7234
7231
|
return '';
|
|
7235
7232
|
}
|
|
@@ -7243,7 +7240,7 @@ async function lsYarnClassic(pkgEnvDetails, cwd) {
|
|
|
7243
7240
|
cwd,
|
|
7244
7241
|
// Lazily access constants.WIN32.
|
|
7245
7242
|
shell: constants.WIN32
|
|
7246
|
-
})).stdout
|
|
7243
|
+
})).stdout;
|
|
7247
7244
|
} catch {}
|
|
7248
7245
|
return '';
|
|
7249
7246
|
}
|
|
@@ -14178,5 +14175,5 @@ void (async () => {
|
|
|
14178
14175
|
await utils.captureException(e);
|
|
14179
14176
|
}
|
|
14180
14177
|
})();
|
|
14181
|
-
//# debugId=
|
|
14178
|
+
//# debugId=50b201bd-872f-4cc2-a080-a88cc2f0878
|
|
14182
14179
|
//# sourceMappingURL=cli.js.map
|