socket 1.0.58 → 1.0.60

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
@@ -3716,6 +3716,7 @@ async function agentFix(pkgEnvDetails, actualTree, alertsMap, installer, {
3716
3716
  };
3717
3717
  const handleInstallFail = () => {
3718
3718
  cleanupInfoEntriesLoop();
3719
+ spinner?.stop();
3719
3720
  return {
3720
3721
  ok: false,
3721
3722
  message: 'Install failed',
@@ -4119,6 +4120,9 @@ async function install$1(pkgEnvDetails, options) {
4119
4120
  const args = ['--ignore-scripts', '--no-audit', '--no-fund', '--no-progress', '--no-save', '--silent', ...(extraArgs ?? [])];
4120
4121
  const quotedCmd = `\`${pkgEnvDetails.agent} install ${args.join(' ')}\``;
4121
4122
  debug.debugFn('stdio', `spawn: ${quotedCmd}`);
4123
+ const isSpinning = spinner?.isSpinning;
4124
+ spinner?.stop();
4125
+ let errored = false;
4122
4126
  try {
4123
4127
  await utils.runAgentInstall(pkgEnvDetails, {
4124
4128
  args,
@@ -4130,17 +4134,23 @@ async function install$1(pkgEnvDetails, options) {
4130
4134
  debug.debugDir('inspect', {
4131
4135
  error: e
4132
4136
  });
4133
- return null;
4137
+ errored = true;
4134
4138
  }
4135
- try {
4136
- return await getActualTree(cwd);
4137
- } catch (e) {
4138
- debug.debugFn('error', 'caught: Arborist error');
4139
- debug.debugDir('inspect', {
4140
- error: e
4141
- });
4139
+ let actualTree = null;
4140
+ if (!errored) {
4141
+ try {
4142
+ actualTree = await getActualTree(cwd);
4143
+ } catch (e) {
4144
+ debug.debugFn('error', 'caught: Arborist error');
4145
+ debug.debugDir('inspect', {
4146
+ error: e
4147
+ });
4148
+ }
4142
4149
  }
4143
- return null;
4150
+ if (isSpinning) {
4151
+ spinner.start();
4152
+ }
4153
+ return actualTree;
4144
4154
  }
4145
4155
  async function npmFix(pkgEnvDetails, fixConfig) {
4146
4156
  const {
@@ -4262,6 +4272,9 @@ async function install(pkgEnvDetails, options) {
4262
4272
  '--config.confirmModulesPurge=false', ...(extraArgs ?? [])];
4263
4273
  const quotedCmd = `\`${pkgEnvDetails.agent} install ${args.join(' ')}\``;
4264
4274
  debug.debugFn('stdio', `spawn: ${quotedCmd}`);
4275
+ const isSpinning = spinner?.isSpinning;
4276
+ spinner?.stop();
4277
+ let errored = false;
4265
4278
  try {
4266
4279
  await utils.runAgentInstall(pkgEnvDetails, {
4267
4280
  args,
@@ -4273,17 +4286,23 @@ async function install(pkgEnvDetails, options) {
4273
4286
  debug.debugDir('inspect', {
4274
4287
  error: e
4275
4288
  });
4276
- return null;
4289
+ errored = true;
4277
4290
  }
4278
- try {
4279
- return await getActualTree(cwd);
4280
- } catch (e) {
4281
- debug.debugFn('error', 'caught: Arborist error');
4282
- debug.debugDir('inspect', {
4283
- error: e
4284
- });
4291
+ let actualTree = null;
4292
+ if (!errored) {
4293
+ try {
4294
+ actualTree = await getActualTree(cwd);
4295
+ } catch (e) {
4296
+ debug.debugFn('error', 'caught: Arborist error');
4297
+ debug.debugDir('inspect', {
4298
+ error: e
4299
+ });
4300
+ }
4285
4301
  }
4286
- return null;
4302
+ if (isSpinning) {
4303
+ spinner.start();
4304
+ }
4305
+ return actualTree;
4287
4306
  }
4288
4307
  async function pnpmFix(pkgEnvDetails, fixConfig) {
4289
4308
  const {
@@ -7520,7 +7539,7 @@ async function updateLockfile(pkgEnvDetails, options) {
7520
7539
  __proto__: null,
7521
7540
  ...options
7522
7541
  };
7523
- const isSpinning = !!spinner?.['isSpinning'];
7542
+ const isSpinning = !!spinner?.isSpinning;
7524
7543
  if (!isSpinning) {
7525
7544
  spinner?.start();
7526
7545
  }
@@ -7581,6 +7600,7 @@ async function applyOptimization(pkgEnvDetails, {
7581
7600
  spinner
7582
7601
  });
7583
7602
  if (!result.ok) {
7603
+ spinner.stop();
7584
7604
  return result;
7585
7605
  }
7586
7606
  }
@@ -7659,11 +7679,12 @@ async function handleOptimize({
7659
7679
  agentVersion
7660
7680
  } = pkgEnvDetails;
7661
7681
  if (agent === VLT) {
7662
- return {
7682
+ await outputOptimizeResult({
7663
7683
  ok: false,
7664
7684
  message: 'Unsupported',
7665
7685
  cause: utils.cmdPrefixMessage(CMD_NAME, `${agent} v${agentVersion} does not support overrides. Soon, though ⚡`)
7666
- };
7686
+ }, outputKind);
7687
+ return;
7667
7688
  }
7668
7689
  logger.logger.info(`Optimizing packages for ${agent} v${agentVersion}.\n`);
7669
7690
  await outputOptimizeResult(await applyOptimization(pkgEnvDetails, {
@@ -14191,5 +14212,5 @@ void (async () => {
14191
14212
  await utils.captureException(e);
14192
14213
  }
14193
14214
  })();
14194
- //# debugId=1ea5a8dd-5995-4b46-91ba-648181473483
14215
+ //# debugId=3e924cea-502a-45fa-add8-c7154304d157
14195
14216
  //# sourceMappingURL=cli.js.map