socket 1.0.59 → 1.0.61

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/bin/cli.js CHANGED
@@ -12,8 +12,6 @@ const { spawn } = require(
12
12
  path.join(rootPath, 'external/@socketsecurity/registry/lib/spawn.js'),
13
13
  )
14
14
 
15
- const { NODE_COMPILE_CACHE } = constants
16
-
17
15
  process.exitCode = 1
18
16
 
19
17
  spawn(
@@ -39,7 +37,8 @@ spawn(
39
37
  {
40
38
  env: {
41
39
  ...process.env,
42
- ...(NODE_COMPILE_CACHE ? { NODE_COMPILE_CACHE } : undefined),
40
+ // Lazily access constants.processEnv.
41
+ ...constants.processEnv,
43
42
  },
44
43
  stdio: 'inherit',
45
44
  },
package/dist/cli.js CHANGED
@@ -7,7 +7,7 @@ var debug = require('../external/@socketsecurity/registry/lib/debug');
7
7
  var logger = require('../external/@socketsecurity/registry/lib/logger');
8
8
  var utils = require('./utils.js');
9
9
  var fs = require('node:fs/promises');
10
- var Module = require('node:module');
10
+ var require$$5 = require('node:module');
11
11
  var constants = require('./constants.js');
12
12
  var prompts = require('../external/@socketsecurity/registry/lib/prompts');
13
13
  var fs$1 = require('node:fs');
@@ -51,7 +51,7 @@ async function fetchRepoAnalyticsData(repo, time) {
51
51
 
52
52
  // Note: Widgets does not seem to actually work as code :'(
53
53
 
54
- const require$5 =Module.createRequire(require$$0.pathToFileURL(__filename).href)
54
+ const require$5 = require$$5.createRequire((typeof document === 'undefined' ? require$$0.pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli.js', document.baseURI).href)));
55
55
  const METRICS = ['total_critical_alerts', 'total_high_alerts', 'total_medium_alerts', 'total_low_alerts', 'total_critical_added', 'total_medium_added', 'total_low_added', 'total_high_added', 'total_critical_prevented', 'total_high_prevented', 'total_medium_prevented', 'total_low_prevented'];
56
56
 
57
57
  // Note: This maps `new Date(date).getMonth()` to English three letters
@@ -471,7 +471,7 @@ async function fetchAuditLog({
471
471
  }), `audit log for ${orgSlug}`);
472
472
  }
473
473
 
474
- const require$4 =Module.createRequire(require$$0.pathToFileURL(__filename).href)
474
+ const require$4 = require$$5.createRequire((typeof document === 'undefined' ? require$$0.pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli.js', document.baseURI).href)));
475
475
  const {
476
476
  REDACTED
477
477
  } = constants;
@@ -5803,7 +5803,7 @@ async function run$A(argv, importMeta, {
5803
5803
  test: cli.input.length <= 1,
5804
5804
  message: 'Can only accept one DIR (make sure to escape spaces!)',
5805
5805
  pass: 'ok',
5806
- fail: 'received ' + cli.input.length
5806
+ fail: `received ${cli.input.length}`
5807
5807
  }, {
5808
5808
  nook: true,
5809
5809
  test: !json || !markdown,
@@ -6833,7 +6833,7 @@ async function run$v(argv, importMeta, {
6833
6833
  });
6834
6834
  }
6835
6835
 
6836
- const require$3 =Module.createRequire(require$$0.pathToFileURL(__filename).href)
6836
+ const require$3 = require$$5.createRequire((typeof document === 'undefined' ? require$$0.pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli.js', document.baseURI).href)));
6837
6837
  const {
6838
6838
  DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$u
6839
6839
  } = constants;
@@ -6886,7 +6886,7 @@ async function run$u(argv, importMeta, {
6886
6886
  await shadowBin('npm', argv);
6887
6887
  }
6888
6888
 
6889
- const require$2 =Module.createRequire(require$$0.pathToFileURL(__filename).href)
6889
+ const require$2 = require$$5.createRequire((typeof document === 'undefined' ? require$$0.pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli.js', document.baseURI).href)));
6890
6890
  const {
6891
6891
  DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$t
6892
6892
  } = constants;
@@ -7600,6 +7600,7 @@ async function applyOptimization(pkgEnvDetails, {
7600
7600
  spinner
7601
7601
  });
7602
7602
  if (!result.ok) {
7603
+ spinner.stop();
7603
7604
  return result;
7604
7605
  }
7605
7606
  }
@@ -7678,11 +7679,12 @@ async function handleOptimize({
7678
7679
  agentVersion
7679
7680
  } = pkgEnvDetails;
7680
7681
  if (agent === VLT) {
7681
- return {
7682
+ await outputOptimizeResult({
7682
7683
  ok: false,
7683
7684
  message: 'Unsupported',
7684
7685
  cause: utils.cmdPrefixMessage(CMD_NAME, `${agent} v${agentVersion} does not support overrides. Soon, though ⚡`)
7685
- };
7686
+ }, outputKind);
7687
+ return;
7686
7688
  }
7687
7689
  logger.logger.info(`Optimizing packages for ${agent} v${agentVersion}.\n`);
7688
7690
  await outputOptimizeResult(await applyOptimization(pkgEnvDetails, {
@@ -13232,7 +13234,7 @@ async function fetchThreatFeed({
13232
13234
  return await utils.queryApiSafeJson(`orgs/${orgSlug}/threat-feed?${queryParams}`, 'the Threat Feed data');
13233
13235
  }
13234
13236
 
13235
- const require$1 =Module.createRequire(require$$0.pathToFileURL(__filename).href)
13237
+ const require$1 = require$$5.createRequire((typeof document === 'undefined' ? require$$0.pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli.js', document.baseURI).href)));
13236
13238
  async function outputThreatFeed(result, outputKind) {
13237
13239
  if (!result.ok) {
13238
13240
  process.exitCode = result.code ?? 1;
@@ -14210,5 +14212,5 @@ void (async () => {
14210
14212
  await utils.captureException(e);
14211
14213
  }
14212
14214
  })();
14213
- //# debugId=b9685bcd-e040-4012-90f5-54b3bfba5ba0
14215
+ //# debugId=758b903c-de42-4d5b-988b-b07da95f2793
14214
14216
  //# sourceMappingURL=cli.js.map