@socketsecurity/cli-with-sentry 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 +11 -12
- 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/utils.js
CHANGED
|
@@ -736,30 +736,23 @@ async function queryApiSafeText(path, fetchSpinnerDesc) {
|
|
|
736
736
|
cause: 'User must be authenticated to run this command. To log in, run the command `socket login` and enter your API key.'
|
|
737
737
|
};
|
|
738
738
|
}
|
|
739
|
+
|
|
740
|
+
// Lazily access constants.spinner.
|
|
741
|
+
const {
|
|
742
|
+
spinner
|
|
743
|
+
} = constants;
|
|
739
744
|
if (fetchSpinnerDesc) {
|
|
740
|
-
// Lazily access constants.spinner.
|
|
741
|
-
const {
|
|
742
|
-
spinner
|
|
743
|
-
} = constants;
|
|
744
745
|
spinner.start(`Requesting ${fetchSpinnerDesc} from API...`);
|
|
745
746
|
}
|
|
746
747
|
let result;
|
|
747
748
|
try {
|
|
748
749
|
result = await queryApi(path, apiToken);
|
|
749
750
|
if (fetchSpinnerDesc) {
|
|
750
|
-
// Lazily access constants.spinner.
|
|
751
|
-
const {
|
|
752
|
-
spinner
|
|
753
|
-
} = constants;
|
|
754
751
|
spinner.successAndStop(`Received API response (after requesting ${fetchSpinnerDesc}).`);
|
|
755
752
|
}
|
|
756
753
|
} catch (e) {
|
|
757
754
|
if (fetchSpinnerDesc) {
|
|
758
|
-
|
|
759
|
-
const {
|
|
760
|
-
spinner
|
|
761
|
-
} = constants;
|
|
762
|
-
spinner.failAndStop(`An error was thrown while requesting ${fetchSpinnerDesc}`);
|
|
755
|
+
spinner.failAndStop(`An error was thrown while requesting ${fetchSpinnerDesc}.`);
|
|
763
756
|
}
|
|
764
757
|
const cause = e?.message;
|
|
765
758
|
debug.debugFn('catch: queryApi() error\n', e);
|
|
@@ -1250,8 +1243,8 @@ async function meowWithSubcommands(subcommands, options) {
|
|
|
1250
1243
|
});
|
|
1251
1244
|
if (commands.size) {
|
|
1252
1245
|
logger.logger.fail('Found commands in the list that were not marked as public or not defined at all:',
|
|
1253
|
-
// Node < 22 will print 'Object (n)' before the array. So to have
|
|
1254
|
-
//
|
|
1246
|
+
// Node < 22 will print 'Object (n)' before the array. So to have consistent
|
|
1247
|
+
// test snapshots we use joinAnd.
|
|
1255
1248
|
arrays.joinAnd(Array.from(commands).sort(sorts.naturalCompare).map(c => `'${c}'`)));
|
|
1256
1249
|
}
|
|
1257
1250
|
const out = [];
|
|
@@ -1318,11 +1311,11 @@ ${isRootCommand ? ` $ ${name} scan create --json` : ''}${isRootCommand ? `\
|
|
|
1318
1311
|
flags,
|
|
1319
1312
|
// Do not strictly check for flags here.
|
|
1320
1313
|
allowUnknownFlags: true,
|
|
1321
|
-
|
|
1322
|
-
// We want to detect whether a bool flag is given at all.
|
|
1323
|
-
// We will emit help when we're ready
|
|
1314
|
+
// We will emit help when we're ready.
|
|
1324
1315
|
// Plus, if we allow this then meow() can just exit here.
|
|
1325
|
-
autoHelp: false
|
|
1316
|
+
autoHelp: false,
|
|
1317
|
+
// We want to detect whether a bool flag is given at all.
|
|
1318
|
+
booleanDefault: undefined
|
|
1326
1319
|
});
|
|
1327
1320
|
|
|
1328
1321
|
// ...else we provide basic instructions and help.
|
|
@@ -1345,8 +1338,8 @@ ${isRootCommand ? ` $ ${name} scan create --json` : ''}${isRootCommand ? `\
|
|
|
1345
1338
|
* Note: meow will exit immediately if it calls its .showHelp()
|
|
1346
1339
|
*/
|
|
1347
1340
|
function meowOrExit({
|
|
1348
|
-
// allowUnknownFlags, // commands that pass-through args need to allow this
|
|
1349
1341
|
argv,
|
|
1342
|
+
collectUnknownFlags = true,
|
|
1350
1343
|
config,
|
|
1351
1344
|
importMeta,
|
|
1352
1345
|
parentName
|
|
@@ -1356,15 +1349,15 @@ function meowOrExit({
|
|
|
1356
1349
|
// This exits if .printHelp() is called either by meow itself or by us.
|
|
1357
1350
|
const cli = vendor.meow({
|
|
1358
1351
|
argv,
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
importMeta,
|
|
1362
|
-
flags: config.flags,
|
|
1363
|
-
allowUnknownFlags: true,
|
|
1364
|
-
// meow will exit(1) before printing the banner
|
|
1352
|
+
autoHelp: false,
|
|
1353
|
+
// meow will exit(0) before printing the banner.
|
|
1365
1354
|
booleanDefault: undefined,
|
|
1366
1355
|
// We want to detect whether a bool flag is given at all.
|
|
1367
|
-
|
|
1356
|
+
collectUnknownFlags,
|
|
1357
|
+
description: config.description,
|
|
1358
|
+
flags: config.flags,
|
|
1359
|
+
help: config.help(command, config),
|
|
1360
|
+
importMeta
|
|
1368
1361
|
});
|
|
1369
1362
|
if (!cli.flags['nobanner']) {
|
|
1370
1363
|
emitBanner(command, String(cli.flags['org'] || '') || undefined);
|
|
@@ -1373,18 +1366,18 @@ function meowOrExit({
|
|
|
1373
1366
|
}
|
|
1374
1367
|
|
|
1375
1368
|
// As per https://github.com/sindresorhus/meow/issues/178
|
|
1376
|
-
// Setting allowUnknownFlags:
|
|
1369
|
+
// Setting `allowUnknownFlags: false` makes it reject camel cased flags.
|
|
1377
1370
|
// if (!allowUnknownFlags) {
|
|
1378
1371
|
// // Run meow specifically with the flag setting. It will exit(2) if an
|
|
1379
1372
|
// // invalid flag is set and print a message.
|
|
1380
1373
|
// meow({
|
|
1381
1374
|
// argv,
|
|
1375
|
+
// allowUnknownFlags: false,
|
|
1376
|
+
// autoHelp: false,
|
|
1382
1377
|
// description: config.description,
|
|
1378
|
+
// flags: config.flags,
|
|
1383
1379
|
// help: config.help(command, config),
|
|
1384
1380
|
// importMeta,
|
|
1385
|
-
// flags: config.flags,
|
|
1386
|
-
// allowUnknownFlags: false,
|
|
1387
|
-
// autoHelp: false,
|
|
1388
1381
|
// })
|
|
1389
1382
|
// }
|
|
1390
1383
|
|
|
@@ -1402,7 +1395,7 @@ function meowOrExit({
|
|
|
1402
1395
|
importMeta,
|
|
1403
1396
|
flags: config.flags,
|
|
1404
1397
|
// As per https://github.com/sindresorhus/meow/issues/178
|
|
1405
|
-
// Setting allowUnknownFlags:
|
|
1398
|
+
// Setting `allowUnknownFlags: false` makes it reject camel cased flags.
|
|
1406
1399
|
// allowUnknownFlags: Boolean(allowUnknownFlags),
|
|
1407
1400
|
autoHelp: false
|
|
1408
1401
|
});
|
|
@@ -1650,7 +1643,7 @@ function findBinPathDetailsSync(binName) {
|
|
|
1650
1643
|
if (path.dirname(binPath) === shadowBinPath) {
|
|
1651
1644
|
shadowIndex = i;
|
|
1652
1645
|
} else {
|
|
1653
|
-
theBinPath = npm.
|
|
1646
|
+
theBinPath = npm.resolveBinPathSync(binPath);
|
|
1654
1647
|
break;
|
|
1655
1648
|
}
|
|
1656
1649
|
}
|
|
@@ -2618,18 +2611,14 @@ async function getAlertsMapFromPurls(purls, options_) {
|
|
|
2618
2611
|
const statusMessage = batchResult.error ?? 'No status message';
|
|
2619
2612
|
throw new Error(`Socket API server error (${statusCode}): ${statusMessage}`);
|
|
2620
2613
|
} else {
|
|
2621
|
-
|
|
2622
|
-
spinner
|
|
2623
|
-
} = constants;
|
|
2624
|
-
spinner.stop();
|
|
2614
|
+
spinner?.stop();
|
|
2625
2615
|
debug.debugFn('Received a result=false:', batchResult);
|
|
2626
2616
|
logger.logger.fail(`Received a ${batchResult.status} response from Socket API which we consider a permanent failure:`, batchResult.error, batchResult.cause ? `( ${batchResult.cause} )` : '');
|
|
2627
2617
|
break;
|
|
2628
2618
|
}
|
|
2629
2619
|
remaining -= 1;
|
|
2630
|
-
if (
|
|
2631
|
-
spinner
|
|
2632
|
-
spinner.setText(getText());
|
|
2620
|
+
if (remaining > 0) {
|
|
2621
|
+
spinner?.start(getText());
|
|
2633
2622
|
}
|
|
2634
2623
|
}
|
|
2635
2624
|
spinner?.stop();
|
|
@@ -2716,10 +2705,10 @@ function safeNpmInstall(options) {
|
|
|
2716
2705
|
const useDebug = debug.isDebug();
|
|
2717
2706
|
const terminatorPos = args.indexOf('--');
|
|
2718
2707
|
const rawBinArgs = terminatorPos === -1 ? args : args.slice(0, terminatorPos);
|
|
2719
|
-
const progressArg = rawBinArgs.findLast(npm.
|
|
2720
|
-
const binArgs = rawBinArgs.filter(a => !npm.
|
|
2708
|
+
const progressArg = rawBinArgs.findLast(npm.isNpmProgressFlag) !== '--no-progress';
|
|
2709
|
+
const binArgs = rawBinArgs.filter(a => !npm.isNpmAuditFlag(a) && !npm.isNpmFundFlag(a) && !npm.isNpmProgressFlag(a));
|
|
2721
2710
|
const otherArgs = terminatorPos === -1 ? [] : args.slice(terminatorPos);
|
|
2722
|
-
const isSilent = !useDebug && !binArgs.some(npm.
|
|
2711
|
+
const isSilent = !useDebug && !binArgs.some(npm.isNpmLoglevelFlag);
|
|
2723
2712
|
const logLevelArgs = isSilent ? ['--loglevel', 'silent'] : [];
|
|
2724
2713
|
const spawnPromise = spawn.spawn(
|
|
2725
2714
|
// Lazily access constants.execPath.
|
|
@@ -2733,7 +2722,7 @@ function safeNpmInstall(options) {
|
|
|
2733
2722
|
// Lazily access constants.instrumentWithSentryPath.
|
|
2734
2723
|
constants.instrumentWithSentryPath] : []), '--require',
|
|
2735
2724
|
// Lazily access constants.shadowNpmInjectPath.
|
|
2736
|
-
constants.shadowNpmInjectPath, npm.
|
|
2725
|
+
constants.shadowNpmInjectPath, npm.resolveBinPathSync(agentExecPath), 'install',
|
|
2737
2726
|
// Avoid code paths for 'audit' and 'fund'.
|
|
2738
2727
|
'--no-audit', '--no-fund',
|
|
2739
2728
|
// Add '--no-progress' to fix input being swallowed by the npm spinner.
|
|
@@ -3307,5 +3296,5 @@ exports.tildify = tildify;
|
|
|
3307
3296
|
exports.updateConfigValue = updateConfigValue;
|
|
3308
3297
|
exports.walkNestedMap = walkNestedMap;
|
|
3309
3298
|
exports.writeSocketJson = writeSocketJson;
|
|
3310
|
-
//# debugId=
|
|
3299
|
+
//# debugId=8665890c-d81b-4306-b3df-f3ed91367593
|
|
3311
3300
|
//# sourceMappingURL=utils.js.map
|