socket 1.0.6 → 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 +55 -34
- 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/shadow-npm-inject.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/fix/npm-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/shadow/npm/arborist/types.d.mts +5 -1
- package/dist/types/shadow/npm/arborist/types.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
|
});
|
|
@@ -4250,11 +4250,18 @@ async function npmFix(pkgEnvDetails, options) {
|
|
|
4250
4250
|
shorthands: vendor.definitionsExports.shorthands
|
|
4251
4251
|
});
|
|
4252
4252
|
await config.load();
|
|
4253
|
-
|
|
4253
|
+
const flatConfig = {
|
|
4254
|
+
__proto__: null,
|
|
4255
|
+
...config.flat
|
|
4256
|
+
};
|
|
4257
|
+
flatConfig.nodeVersion = constants.NODE_VERSION;
|
|
4258
|
+
flatConfig.npmVersion = pkgEnvDetails.agentVersion.toString();
|
|
4259
|
+
flatConfig.npmCommand = 'install';
|
|
4260
|
+
debug.debugFn('npm config:', flatConfig);
|
|
4254
4261
|
const arb = new shadowNpmInject.Arborist({
|
|
4255
4262
|
path: pkgEnvDetails.pkgPath,
|
|
4256
|
-
...
|
|
4257
|
-
|
|
4263
|
+
...flatConfig,
|
|
4264
|
+
...shadowNpmInject.SAFE_ARBORIST_REIFY_OPTIONS_OVERRIDES
|
|
4258
4265
|
});
|
|
4259
4266
|
actualTree = await arb.reify();
|
|
4260
4267
|
// Calling arb.reify() creates the arb.diff object, nulls-out arb.idealTree,
|
|
@@ -4487,7 +4494,7 @@ const {
|
|
|
4487
4494
|
NPM: NPM$7,
|
|
4488
4495
|
PNPM: PNPM$6
|
|
4489
4496
|
} = constants;
|
|
4490
|
-
async function handleFix(
|
|
4497
|
+
async function handleFix({
|
|
4491
4498
|
autoMerge,
|
|
4492
4499
|
cwd,
|
|
4493
4500
|
ghsas,
|
|
@@ -4496,37 +4503,51 @@ async function handleFix(argv, {
|
|
|
4496
4503
|
purls,
|
|
4497
4504
|
rangeStyle,
|
|
4498
4505
|
test,
|
|
4499
|
-
testScript
|
|
4506
|
+
testScript,
|
|
4507
|
+
unknownFlags
|
|
4500
4508
|
}) {
|
|
4509
|
+
// Lazily access constants.spinner.
|
|
4510
|
+
const {
|
|
4511
|
+
spinner
|
|
4512
|
+
} = constants;
|
|
4501
4513
|
let {
|
|
4502
4514
|
length: ghsasCount
|
|
4503
4515
|
} = ghsas;
|
|
4504
4516
|
if (ghsasCount) {
|
|
4505
|
-
// Lazily access constants.spinner.
|
|
4506
|
-
const {
|
|
4507
|
-
spinner
|
|
4508
|
-
} = constants;
|
|
4509
4517
|
spinner.start('Fetching GHSA IDs...');
|
|
4510
4518
|
if (ghsasCount === 1 && ghsas[0] === 'auto') {
|
|
4511
4519
|
const autoCResult = await utils.spawnCoana(['compute-fixes-and-upgrade-purls', cwd], {
|
|
4512
4520
|
cwd,
|
|
4513
4521
|
spinner
|
|
4514
4522
|
});
|
|
4523
|
+
spinner.stop();
|
|
4515
4524
|
if (autoCResult.ok) {
|
|
4516
4525
|
ghsas = utils.cmdFlagValueToArray(/(?<=Vulnerabilities found: )[^\n]+/.exec(autoCResult.data)?.[0]);
|
|
4517
4526
|
ghsasCount = ghsas.length;
|
|
4518
4527
|
} else {
|
|
4528
|
+
debug.debugFn('coana fail:', {
|
|
4529
|
+
message: autoCResult.message,
|
|
4530
|
+
cause: autoCResult.cause
|
|
4531
|
+
});
|
|
4519
4532
|
ghsas = [];
|
|
4520
4533
|
ghsasCount = 0;
|
|
4521
4534
|
}
|
|
4535
|
+
spinner.start();
|
|
4522
4536
|
}
|
|
4523
4537
|
if (ghsasCount) {
|
|
4524
4538
|
spinner.info(`Found ${ghsasCount} GHSA ${words.pluralize('ID', ghsasCount)}.`);
|
|
4525
|
-
|
|
4539
|
+
const applyFixesCResult = await utils.spawnCoana(['compute-fixes-and-upgrade-purls', cwd, '--apply-fixes-to', ...ghsas, ...unknownFlags], {
|
|
4526
4540
|
cwd,
|
|
4527
4541
|
spinner
|
|
4528
|
-
})
|
|
4542
|
+
});
|
|
4529
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);
|
|
4530
4551
|
return;
|
|
4531
4552
|
}
|
|
4532
4553
|
spinner.infoAndStop('No GHSA IDs found.');
|
|
@@ -4567,11 +4588,6 @@ async function handleFix(argv, {
|
|
|
4567
4588
|
}, outputKind);
|
|
4568
4589
|
return;
|
|
4569
4590
|
}
|
|
4570
|
-
|
|
4571
|
-
// Lazily access spinner.
|
|
4572
|
-
const {
|
|
4573
|
-
spinner
|
|
4574
|
-
} = constants;
|
|
4575
4591
|
const fixer = agent === NPM$7 ? npmFix : pnpmFix;
|
|
4576
4592
|
await outputFixResult(await fixer(pkgEnvDetails, {
|
|
4577
4593
|
autoMerge,
|
|
@@ -4712,7 +4728,10 @@ async function run$H(argv, importMeta, {
|
|
|
4712
4728
|
const limit = (cli.flags['limit'] ? parseInt(String(cli.flags['limit'] || ''), 10) : Infinity) || Infinity;
|
|
4713
4729
|
const purls = utils.cmdFlagValueToArray(cli.flags['purl']);
|
|
4714
4730
|
const testScript = String(cli.flags['testScript'] || 'test');
|
|
4715
|
-
|
|
4731
|
+
const {
|
|
4732
|
+
unknownFlags
|
|
4733
|
+
} = cli;
|
|
4734
|
+
await handleFix({
|
|
4716
4735
|
autoMerge,
|
|
4717
4736
|
cwd,
|
|
4718
4737
|
ghsas,
|
|
@@ -4721,7 +4740,8 @@ async function run$H(argv, importMeta, {
|
|
|
4721
4740
|
purls,
|
|
4722
4741
|
rangeStyle,
|
|
4723
4742
|
test,
|
|
4724
|
-
testScript
|
|
4743
|
+
testScript,
|
|
4744
|
+
unknownFlags
|
|
4725
4745
|
});
|
|
4726
4746
|
}
|
|
4727
4747
|
|
|
@@ -4811,7 +4831,7 @@ function getTabCompletionScriptRaw() {
|
|
|
4811
4831
|
if (!fs$1.existsSync(sourcePath)) {
|
|
4812
4832
|
return {
|
|
4813
4833
|
ok: false,
|
|
4814
|
-
message: 'Source not found',
|
|
4834
|
+
message: 'Source not found.',
|
|
4815
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.`
|
|
4816
4836
|
};
|
|
4817
4837
|
}
|
|
@@ -4826,12 +4846,11 @@ function updateInstalledTabCompletionScript(targetPath) {
|
|
|
4826
4846
|
return content;
|
|
4827
4847
|
}
|
|
4828
4848
|
|
|
4829
|
-
// Lazily access constants.ENV.INLINED_SOCKET_CLI_VERSION_HASH.
|
|
4830
|
-
const CLI_VERSION = constants.ENV.INLINED_SOCKET_CLI_VERSION_HASH;
|
|
4831
|
-
|
|
4832
4849
|
// When installing set the current package.json version.
|
|
4833
4850
|
// Later, we can call _socket_completion_version to get the installed version.
|
|
4834
|
-
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');
|
|
4835
4854
|
return {
|
|
4836
4855
|
ok: true,
|
|
4837
4856
|
data: undefined
|
|
@@ -9202,7 +9221,9 @@ const config$j = {
|
|
|
9202
9221
|
commandName: 'raw-npm',
|
|
9203
9222
|
description: `Temporarily disable the Socket ${NPM} wrapper`,
|
|
9204
9223
|
hidden: false,
|
|
9205
|
-
flags: {
|
|
9224
|
+
flags: {
|
|
9225
|
+
...utils.commonFlags
|
|
9226
|
+
},
|
|
9206
9227
|
help: command => `
|
|
9207
9228
|
Usage
|
|
9208
9229
|
$ ${command} ...
|
|
@@ -9265,7 +9286,9 @@ const config$i = {
|
|
|
9265
9286
|
commandName: 'raw-npx',
|
|
9266
9287
|
description: `Temporarily disable the Socket ${NPX} wrapper`,
|
|
9267
9288
|
hidden: false,
|
|
9268
|
-
flags: {
|
|
9289
|
+
flags: {
|
|
9290
|
+
...utils.commonFlags
|
|
9291
|
+
},
|
|
9269
9292
|
help: command => `
|
|
9270
9293
|
Usage
|
|
9271
9294
|
$ ${command} ...
|
|
@@ -14092,18 +14115,16 @@ void (async () => {
|
|
|
14092
14115
|
debug.debugFn('Uncaught error (BAD!):');
|
|
14093
14116
|
debug.debugFn(e);
|
|
14094
14117
|
|
|
14095
|
-
// 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.
|
|
14096
14119
|
let isJson = false;
|
|
14097
14120
|
try {
|
|
14098
14121
|
const cli = vendor.meow(``, {
|
|
14099
14122
|
argv: process.argv.slice(2),
|
|
14123
|
+
autoHelp: false,
|
|
14124
|
+
flags: {},
|
|
14100
14125
|
importMeta: {
|
|
14101
14126
|
url: `${require$$0.pathToFileURL(__filename$1)}`
|
|
14102
|
-
}
|
|
14103
|
-
flags: {},
|
|
14104
|
-
// Do not strictly check for flags here.
|
|
14105
|
-
allowUnknownFlags: true,
|
|
14106
|
-
autoHelp: false
|
|
14127
|
+
}
|
|
14107
14128
|
});
|
|
14108
14129
|
isJson = !!cli.flags['json'];
|
|
14109
14130
|
} catch {}
|
|
@@ -14141,5 +14162,5 @@ void (async () => {
|
|
|
14141
14162
|
await utils.captureException(e);
|
|
14142
14163
|
}
|
|
14143
14164
|
})();
|
|
14144
|
-
//# debugId=
|
|
14165
|
+
//# debugId=fa52588f-cff8-4914-9a1b-357283f4db17
|
|
14145
14166
|
//# sourceMappingURL=cli.js.map
|