socket 1.0.7 → 1.0.8
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 +41 -31
- package/dist/cli.js.map +1 -1
- package/dist/constants.js +8 -3
- package/dist/constants.js.map +1 -1
- package/dist/shadow-npm-bin.js +5 -5
- package/dist/shadow-npm-bin.js.map +1 -1
- package/dist/socket-completion.bash +23 -7
- package/dist/types/commands/fix/cmd-fix.d.mts.map +1 -1
- package/dist/types/commands/fix/handle-fix.d.mts +2 -1
- package/dist/types/commands/fix/handle-fix.d.mts.map +1 -1
- package/dist/types/commands/install/setup-tab-completion.d.mts.map +1 -1
- package/dist/types/commands/manifest/cmd-manifest-cdxgen.d.mts.map +1 -1
- package/dist/types/commands/npm/cmd-npm.d.mts.map +1 -1
- package/dist/types/commands/npx/cmd-npx.d.mts.map +1 -1
- package/dist/types/commands/raw-npm/cmd-raw-npm.d.mts.map +1 -1
- package/dist/types/commands/raw-npx/cmd-raw-npx.d.mts.map +1 -1
- package/dist/types/constants.d.mts.map +1 -1
- package/dist/types/utils/alerts-map.d.mts.map +1 -1
- package/dist/types/utils/api.d.mts.map +1 -1
- package/dist/types/utils/meow-with-subcommands.d.mts +2 -3
- package/dist/types/utils/meow-with-subcommands.d.mts.map +1 -1
- package/dist/utils.js +34 -45
- package/dist/utils.js.map +1 -1
- package/dist/vendor.js +27 -24
- package/external/@coana-tech/cli/cli.mjs +1 -1
- package/external/@socketsecurity/registry/lib/constants/npm-real-exec-path.js +2 -40
- package/external/@socketsecurity/registry/lib/npm.js +102 -71
- package/external/@socketsecurity/registry/lib/spinner.js +6 -0
- package/external/blessed-contrib/lib/widget/charts/bar.js +4 -3
- package/external/blessed-contrib/lib/widget/charts/line.js +4 -3
- package/external/blessed-contrib/lib/widget/table.js +3 -3
- package/package.json +10 -11
- package/external/node-gyp/.release-please-manifest.json +0 -3
- package/external/node-gyp/CHANGELOG.md +0 -1053
- package/external/node-gyp/CODE_OF_CONDUCT.md +0 -4
- package/external/node-gyp/CONTRIBUTING.md +0 -34
- package/external/node-gyp/LICENSE +0 -24
- package/external/node-gyp/README.md +0 -273
- package/external/node-gyp/SECURITY.md +0 -2
- package/external/node-gyp/addon.gypi +0 -204
- package/external/node-gyp/bin/node-gyp.js +0 -137
- package/external/node-gyp/eslint.config.js +0 -3
- package/external/node-gyp/gyp/.release-please-manifest.json +0 -3
- package/external/node-gyp/gyp/LICENSE +0 -28
- package/external/node-gyp/gyp/data/ninja/build.ninja +0 -4
- package/external/node-gyp/gyp/data/win/large-pdb-shim.cc +0 -12
- package/external/node-gyp/gyp/docs/GypVsCMake.md +0 -116
- package/external/node-gyp/gyp/docs/Hacking.md +0 -46
- package/external/node-gyp/gyp/docs/InputFormatReference.md +0 -1083
- package/external/node-gyp/gyp/docs/LanguageSpecification.md +0 -430
- package/external/node-gyp/gyp/docs/README.md +0 -27
- package/external/node-gyp/gyp/docs/Testing.md +0 -450
- package/external/node-gyp/gyp/docs/UserDocumentation.md +0 -965
- package/external/node-gyp/gyp/gyp +0 -8
- package/external/node-gyp/gyp/gyp.bat +0 -5
- package/external/node-gyp/gyp/gyp_main.py +0 -45
- package/external/node-gyp/gyp/pylib/gyp/MSVSNew.py +0 -365
- package/external/node-gyp/gyp/pylib/gyp/MSVSProject.py +0 -206
- package/external/node-gyp/gyp/pylib/gyp/MSVSSettings.py +0 -1272
- package/external/node-gyp/gyp/pylib/gyp/MSVSSettings_test.py +0 -1547
- package/external/node-gyp/gyp/pylib/gyp/MSVSToolFile.py +0 -59
- package/external/node-gyp/gyp/pylib/gyp/MSVSUserFile.py +0 -152
- package/external/node-gyp/gyp/pylib/gyp/MSVSUtil.py +0 -270
- package/external/node-gyp/gyp/pylib/gyp/MSVSVersion.py +0 -574
- package/external/node-gyp/gyp/pylib/gyp/__init__.py +0 -704
- package/external/node-gyp/gyp/pylib/gyp/common.py +0 -709
- package/external/node-gyp/gyp/pylib/gyp/common_test.py +0 -173
- package/external/node-gyp/gyp/pylib/gyp/easy_xml.py +0 -169
- package/external/node-gyp/gyp/pylib/gyp/easy_xml_test.py +0 -113
- package/external/node-gyp/gyp/pylib/gyp/flock_tool.py +0 -55
- package/external/node-gyp/gyp/pylib/gyp/generator/__init__.py +0 -0
- package/external/node-gyp/gyp/pylib/gyp/generator/analyzer.py +0 -805
- package/external/node-gyp/gyp/pylib/gyp/generator/android.py +0 -1172
- package/external/node-gyp/gyp/pylib/gyp/generator/cmake.py +0 -1319
- package/external/node-gyp/gyp/pylib/gyp/generator/compile_commands_json.py +0 -128
- package/external/node-gyp/gyp/pylib/gyp/generator/dump_dependency_json.py +0 -104
- package/external/node-gyp/gyp/pylib/gyp/generator/eclipse.py +0 -462
- package/external/node-gyp/gyp/pylib/gyp/generator/gypd.py +0 -89
- package/external/node-gyp/gyp/pylib/gyp/generator/gypsh.py +0 -56
- package/external/node-gyp/gyp/pylib/gyp/generator/make.py +0 -2745
- package/external/node-gyp/gyp/pylib/gyp/generator/msvs.py +0 -3976
- package/external/node-gyp/gyp/pylib/gyp/generator/msvs_test.py +0 -44
- package/external/node-gyp/gyp/pylib/gyp/generator/ninja.py +0 -2965
- package/external/node-gyp/gyp/pylib/gyp/generator/ninja_test.py +0 -67
- package/external/node-gyp/gyp/pylib/gyp/generator/xcode.py +0 -1391
- package/external/node-gyp/gyp/pylib/gyp/generator/xcode_test.py +0 -26
- package/external/node-gyp/gyp/pylib/gyp/input.py +0 -3112
- package/external/node-gyp/gyp/pylib/gyp/input_test.py +0 -99
- package/external/node-gyp/gyp/pylib/gyp/mac_tool.py +0 -767
- package/external/node-gyp/gyp/pylib/gyp/msvs_emulation.py +0 -1260
- package/external/node-gyp/gyp/pylib/gyp/ninja_syntax.py +0 -174
- package/external/node-gyp/gyp/pylib/gyp/simple_copy.py +0 -61
- package/external/node-gyp/gyp/pylib/gyp/win_tool.py +0 -373
- package/external/node-gyp/gyp/pylib/gyp/xcode_emulation.py +0 -1939
- package/external/node-gyp/gyp/pylib/gyp/xcode_emulation_test.py +0 -54
- package/external/node-gyp/gyp/pylib/gyp/xcode_ninja.py +0 -303
- package/external/node-gyp/gyp/pylib/gyp/xcodeproj_file.py +0 -3196
- package/external/node-gyp/gyp/pylib/gyp/xml_fix.py +0 -65
- package/external/node-gyp/gyp/pylib/packaging/LICENSE +0 -3
- package/external/node-gyp/gyp/pylib/packaging/LICENSE.APACHE +0 -177
- package/external/node-gyp/gyp/pylib/packaging/LICENSE.BSD +0 -23
- package/external/node-gyp/gyp/pylib/packaging/__init__.py +0 -15
- package/external/node-gyp/gyp/pylib/packaging/_elffile.py +0 -108
- package/external/node-gyp/gyp/pylib/packaging/_manylinux.py +0 -252
- package/external/node-gyp/gyp/pylib/packaging/_musllinux.py +0 -83
- package/external/node-gyp/gyp/pylib/packaging/_parser.py +0 -359
- package/external/node-gyp/gyp/pylib/packaging/_structures.py +0 -61
- package/external/node-gyp/gyp/pylib/packaging/_tokenizer.py +0 -192
- package/external/node-gyp/gyp/pylib/packaging/markers.py +0 -252
- package/external/node-gyp/gyp/pylib/packaging/metadata.py +0 -825
- package/external/node-gyp/gyp/pylib/packaging/py.typed +0 -0
- package/external/node-gyp/gyp/pylib/packaging/requirements.py +0 -90
- package/external/node-gyp/gyp/pylib/packaging/specifiers.py +0 -1030
- package/external/node-gyp/gyp/pylib/packaging/tags.py +0 -553
- package/external/node-gyp/gyp/pylib/packaging/utils.py +0 -172
- package/external/node-gyp/gyp/pylib/packaging/version.py +0 -563
- package/external/node-gyp/gyp/pyproject.toml +0 -115
- package/external/node-gyp/gyp/release-please-config.json +0 -11
- package/external/node-gyp/gyp/test_gyp.py +0 -261
- package/external/node-gyp/lib/Find-VisualStudio.cs +0 -250
- package/external/node-gyp/lib/build.js +0 -230
- package/external/node-gyp/lib/clean.js +0 -15
- package/external/node-gyp/lib/configure.js +0 -328
- package/external/node-gyp/lib/create-config-gypi.js +0 -153
- package/external/node-gyp/lib/download.js +0 -41
- package/external/node-gyp/lib/find-node-directory.js +0 -63
- package/external/node-gyp/lib/find-python.js +0 -310
- package/external/node-gyp/lib/find-visualstudio.js +0 -600
- package/external/node-gyp/lib/install.js +0 -415
- package/external/node-gyp/lib/list.js +0 -26
- package/external/node-gyp/lib/log.js +0 -168
- package/external/node-gyp/lib/node-gyp.js +0 -188
- package/external/node-gyp/lib/process-release.js +0 -148
- package/external/node-gyp/lib/rebuild.js +0 -12
- package/external/node-gyp/lib/remove.js +0 -43
- package/external/node-gyp/lib/util.js +0 -81
- package/external/node-gyp/macOS_Catalina_acid_test.sh +0 -21
- package/external/node-gyp/package.json +0 -52
- package/external/node-gyp/release-please-config.json +0 -40
- package/external/node-gyp/src/win_delay_load_hook.cc +0 -41
package/dist/cli.js
CHANGED
|
@@ -1606,7 +1606,7 @@ async function execGradleWithSpinner(bin, commandArgs, cwd) {
|
|
|
1606
1606
|
try {
|
|
1607
1607
|
logger.logger.info('(Running gradle can take a while, it depends on how long gradlew has to run)');
|
|
1608
1608
|
logger.logger.info('(It will show no output, you can use --verbose to see its output)');
|
|
1609
|
-
spinner.start(`Running gradlew
|
|
1609
|
+
spinner.start(`Running gradlew...`);
|
|
1610
1610
|
const output = await spawn.spawn(bin, commandArgs, {
|
|
1611
1611
|
// We can pipe the output through to have the user see the result
|
|
1612
1612
|
// of running gradlew, but then we can't (easily) gather the output
|
|
@@ -3944,7 +3944,7 @@ async function agentFix(pkgEnvDetails, actualTree, alertsMap, installer, {
|
|
|
3944
3944
|
if (test) {
|
|
3945
3945
|
spinner?.info(`Testing ${newId} in ${workspace}.`);
|
|
3946
3946
|
// eslint-disable-next-line no-await-in-loop
|
|
3947
|
-
await npm.
|
|
3947
|
+
await npm.runNpmScript(testScript, [], {
|
|
3948
3948
|
spinner,
|
|
3949
3949
|
stdio: 'ignore'
|
|
3950
3950
|
});
|
|
@@ -4494,7 +4494,7 @@ const {
|
|
|
4494
4494
|
NPM: NPM$7,
|
|
4495
4495
|
PNPM: PNPM$6
|
|
4496
4496
|
} = constants;
|
|
4497
|
-
async function handleFix(
|
|
4497
|
+
async function handleFix({
|
|
4498
4498
|
autoMerge,
|
|
4499
4499
|
cwd,
|
|
4500
4500
|
ghsas,
|
|
@@ -4503,22 +4503,24 @@ async function handleFix(argv, {
|
|
|
4503
4503
|
purls,
|
|
4504
4504
|
rangeStyle,
|
|
4505
4505
|
test,
|
|
4506
|
-
testScript
|
|
4506
|
+
testScript,
|
|
4507
|
+
unknownFlags
|
|
4507
4508
|
}) {
|
|
4509
|
+
// Lazily access constants.spinner.
|
|
4510
|
+
const {
|
|
4511
|
+
spinner
|
|
4512
|
+
} = constants;
|
|
4508
4513
|
let {
|
|
4509
4514
|
length: ghsasCount
|
|
4510
4515
|
} = ghsas;
|
|
4511
4516
|
if (ghsasCount) {
|
|
4512
|
-
// Lazily access constants.spinner.
|
|
4513
|
-
const {
|
|
4514
|
-
spinner
|
|
4515
|
-
} = constants;
|
|
4516
4517
|
spinner.start('Fetching GHSA IDs...');
|
|
4517
4518
|
if (ghsasCount === 1 && ghsas[0] === 'auto') {
|
|
4518
4519
|
const autoCResult = await utils.spawnCoana(['compute-fixes-and-upgrade-purls', cwd], {
|
|
4519
4520
|
cwd,
|
|
4520
4521
|
spinner
|
|
4521
4522
|
});
|
|
4523
|
+
spinner.stop();
|
|
4522
4524
|
if (autoCResult.ok) {
|
|
4523
4525
|
ghsas = utils.cmdFlagValueToArray(/(?<=Vulnerabilities found: )[^\n]+/.exec(autoCResult.data)?.[0]);
|
|
4524
4526
|
ghsasCount = ghsas.length;
|
|
@@ -4530,14 +4532,22 @@ async function handleFix(argv, {
|
|
|
4530
4532
|
ghsas = [];
|
|
4531
4533
|
ghsasCount = 0;
|
|
4532
4534
|
}
|
|
4535
|
+
spinner.start();
|
|
4533
4536
|
}
|
|
4534
4537
|
if (ghsasCount) {
|
|
4535
4538
|
spinner.info(`Found ${ghsasCount} GHSA ${words.pluralize('ID', ghsasCount)}.`);
|
|
4536
|
-
|
|
4539
|
+
const applyFixesCResult = await utils.spawnCoana(['compute-fixes-and-upgrade-purls', cwd, '--apply-fixes-to', ...ghsas, ...unknownFlags], {
|
|
4537
4540
|
cwd,
|
|
4538
4541
|
spinner
|
|
4539
|
-
})
|
|
4542
|
+
});
|
|
4540
4543
|
spinner.stop();
|
|
4544
|
+
if (!applyFixesCResult.ok) {
|
|
4545
|
+
debug.debugFn('coana fail:', {
|
|
4546
|
+
message: applyFixesCResult.message,
|
|
4547
|
+
cause: applyFixesCResult.cause
|
|
4548
|
+
});
|
|
4549
|
+
}
|
|
4550
|
+
await outputFixResult(applyFixesCResult, outputKind);
|
|
4541
4551
|
return;
|
|
4542
4552
|
}
|
|
4543
4553
|
spinner.infoAndStop('No GHSA IDs found.');
|
|
@@ -4578,11 +4588,6 @@ async function handleFix(argv, {
|
|
|
4578
4588
|
}, outputKind);
|
|
4579
4589
|
return;
|
|
4580
4590
|
}
|
|
4581
|
-
|
|
4582
|
-
// Lazily access spinner.
|
|
4583
|
-
const {
|
|
4584
|
-
spinner
|
|
4585
|
-
} = constants;
|
|
4586
4591
|
const fixer = agent === NPM$7 ? npmFix : pnpmFix;
|
|
4587
4592
|
await outputFixResult(await fixer(pkgEnvDetails, {
|
|
4588
4593
|
autoMerge,
|
|
@@ -4723,7 +4728,10 @@ async function run$H(argv, importMeta, {
|
|
|
4723
4728
|
const limit = (cli.flags['limit'] ? parseInt(String(cli.flags['limit'] || ''), 10) : Infinity) || Infinity;
|
|
4724
4729
|
const purls = utils.cmdFlagValueToArray(cli.flags['purl']);
|
|
4725
4730
|
const testScript = String(cli.flags['testScript'] || 'test');
|
|
4726
|
-
|
|
4731
|
+
const {
|
|
4732
|
+
unknownFlags
|
|
4733
|
+
} = cli;
|
|
4734
|
+
await handleFix({
|
|
4727
4735
|
autoMerge,
|
|
4728
4736
|
cwd,
|
|
4729
4737
|
ghsas,
|
|
@@ -4732,7 +4740,8 @@ async function run$H(argv, importMeta, {
|
|
|
4732
4740
|
purls,
|
|
4733
4741
|
rangeStyle,
|
|
4734
4742
|
test,
|
|
4735
|
-
testScript
|
|
4743
|
+
testScript,
|
|
4744
|
+
unknownFlags
|
|
4736
4745
|
});
|
|
4737
4746
|
}
|
|
4738
4747
|
|
|
@@ -4822,7 +4831,7 @@ function getTabCompletionScriptRaw() {
|
|
|
4822
4831
|
if (!fs$1.existsSync(sourcePath)) {
|
|
4823
4832
|
return {
|
|
4824
4833
|
ok: false,
|
|
4825
|
-
message: 'Source not found',
|
|
4834
|
+
message: 'Source not found.',
|
|
4826
4835
|
cause: `Unable to find the source tab completion bash script that Socket should ship. Expected to find it in \`${sourcePath}\` but it was not there.`
|
|
4827
4836
|
};
|
|
4828
4837
|
}
|
|
@@ -4837,12 +4846,11 @@ function updateInstalledTabCompletionScript(targetPath) {
|
|
|
4837
4846
|
return content;
|
|
4838
4847
|
}
|
|
4839
4848
|
|
|
4840
|
-
// Lazily access constants.ENV.INLINED_SOCKET_CLI_VERSION_HASH.
|
|
4841
|
-
const CLI_VERSION = constants.ENV.INLINED_SOCKET_CLI_VERSION_HASH;
|
|
4842
|
-
|
|
4843
4849
|
// When installing set the current package.json version.
|
|
4844
4850
|
// Later, we can call _socket_completion_version to get the installed version.
|
|
4845
|
-
fs$1.writeFileSync(targetPath, content.data.replaceAll('SOCKET_VERSION_TOKEN',
|
|
4851
|
+
fs$1.writeFileSync(targetPath, content.data.replaceAll('%SOCKET_VERSION_TOKEN%',
|
|
4852
|
+
// Lazily access constants.ENV.INLINED_SOCKET_CLI_VERSION_HASH.
|
|
4853
|
+
constants.ENV.INLINED_SOCKET_CLI_VERSION_HASH), 'utf8');
|
|
4846
4854
|
return {
|
|
4847
4855
|
ok: true,
|
|
4848
4856
|
data: undefined
|
|
@@ -9213,7 +9221,9 @@ const config$j = {
|
|
|
9213
9221
|
commandName: 'raw-npm',
|
|
9214
9222
|
description: `Temporarily disable the Socket ${NPM} wrapper`,
|
|
9215
9223
|
hidden: false,
|
|
9216
|
-
flags: {
|
|
9224
|
+
flags: {
|
|
9225
|
+
...utils.commonFlags
|
|
9226
|
+
},
|
|
9217
9227
|
help: command => `
|
|
9218
9228
|
Usage
|
|
9219
9229
|
$ ${command} ...
|
|
@@ -9276,7 +9286,9 @@ const config$i = {
|
|
|
9276
9286
|
commandName: 'raw-npx',
|
|
9277
9287
|
description: `Temporarily disable the Socket ${NPX} wrapper`,
|
|
9278
9288
|
hidden: false,
|
|
9279
|
-
flags: {
|
|
9289
|
+
flags: {
|
|
9290
|
+
...utils.commonFlags
|
|
9291
|
+
},
|
|
9280
9292
|
help: command => `
|
|
9281
9293
|
Usage
|
|
9282
9294
|
$ ${command} ...
|
|
@@ -14103,18 +14115,16 @@ void (async () => {
|
|
|
14103
14115
|
debug.debugFn('Uncaught error (BAD!):');
|
|
14104
14116
|
debug.debugFn(e);
|
|
14105
14117
|
|
|
14106
|
-
// Try to parse the flags, find out if --json or --markdown is set
|
|
14118
|
+
// Try to parse the flags, find out if --json or --markdown is set.
|
|
14107
14119
|
let isJson = false;
|
|
14108
14120
|
try {
|
|
14109
14121
|
const cli = vendor.meow(``, {
|
|
14110
14122
|
argv: process.argv.slice(2),
|
|
14123
|
+
autoHelp: false,
|
|
14124
|
+
flags: {},
|
|
14111
14125
|
importMeta: {
|
|
14112
14126
|
url: `${require$$0.pathToFileURL(__filename$1)}`
|
|
14113
|
-
}
|
|
14114
|
-
flags: {},
|
|
14115
|
-
// Do not strictly check for flags here.
|
|
14116
|
-
allowUnknownFlags: true,
|
|
14117
|
-
autoHelp: false
|
|
14127
|
+
}
|
|
14118
14128
|
});
|
|
14119
14129
|
isJson = !!cli.flags['json'];
|
|
14120
14130
|
} catch {}
|
|
@@ -14152,5 +14162,5 @@ void (async () => {
|
|
|
14152
14162
|
await utils.captureException(e);
|
|
14153
14163
|
}
|
|
14154
14164
|
})();
|
|
14155
|
-
//# debugId=
|
|
14165
|
+
//# debugId=fa52588f-cff8-4914-9a1b-357283f4db17
|
|
14156
14166
|
//# sourceMappingURL=cli.js.map
|