@socketsecurity/cli-with-sentry 0.15.44 → 0.15.46

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 CHANGED
@@ -3690,7 +3690,7 @@ function getSocketBranchName(purl, newVersion, workspace) {
3690
3690
  const fmtFullName = getSocketBranchFullNameComponent(purlObj);
3691
3691
  const fmtVersion = getSocketBranchPackageVersionComponent(purlObj.version);
3692
3692
  const fmtNewVersion = formatBranchName(newVersion);
3693
- return `socket/${fmtType}_${fmtWorkspace}_${fmtFullName}_${fmtVersion}_${fmtNewVersion}`;
3693
+ return `socket/${fmtType}/${fmtWorkspace}/${fmtFullName}_${fmtVersion}_${fmtNewVersion}`;
3694
3694
  }
3695
3695
  function getSocketBranchPattern(options) {
3696
3696
  const {
@@ -3708,7 +3708,7 @@ function getSocketBranchPattern(options) {
3708
3708
  const escFullName = purlObj ? `${escMaybeNamespace}${regexps.escapeRegExp(formatBranchName(purlObj.name))}` : '[^_]+';
3709
3709
  const escVersion = purlObj ? regexps.escapeRegExp(formatBranchName(purlObj.version)) : '[^_]+';
3710
3710
  const escNewVersion = newVersion ? regexps.escapeRegExp(formatBranchName(newVersion)) : '[^_]+';
3711
- return new RegExp(`^socket/(${escType})_(${escWorkspace})_(${escFullName})_(${escVersion})_(${escNewVersion})$`);
3711
+ return new RegExp(`^socket/(${escType})/(${escWorkspace})/(${escFullName})_(${escVersion})_(${escNewVersion})$`);
3712
3712
  }
3713
3713
  function createSocketBranchParser(options) {
3714
3714
  const pattern = getSocketBranchPattern(options);
@@ -4392,6 +4392,11 @@ async function npmFix(pkgEnvDetails, {
4392
4392
  activeBranches.push(parsedBranch);
4393
4393
  }
4394
4394
  }
4395
+ if (activeBranches.length) {
4396
+ debug.debugFn(`found: ${activeBranches.length} active branches\n`, activeBranches);
4397
+ } else if (openPrs.length) {
4398
+ debug.debugFn('miss: 0 active branches found');
4399
+ }
4395
4400
  infos = infos.filter(info => !activeBranches.find(b => b.newVersion === info.firstPatchedVersionIdentifier));
4396
4401
  }
4397
4402
  if (!infos.length) {
@@ -4877,10 +4882,18 @@ async function pnpmFix(pkgEnvDetails, {
4877
4882
  const activeBranches = [];
4878
4883
  for (const pr of openPrs) {
4879
4884
  const parsedBranch = branchParser(pr.headRefName);
4885
+ debug.debugFn(`parse: ${pr.headRefName}\n`, parsedBranch);
4886
+ debug.debugFn(`check: branchPurlType ${branchPurlType} === ${parsedBranch?.type}`);
4887
+ debug.debugFn(`check: branchFullName ${branchFullName} === ${parsedBranch?.fullName}`);
4880
4888
  if (branchPurlType === parsedBranch?.type && branchFullName === parsedBranch?.fullName) {
4881
4889
  activeBranches.push(parsedBranch);
4882
4890
  }
4883
4891
  }
4892
+ if (activeBranches.length) {
4893
+ debug.debugFn(`found: ${activeBranches.length} active branches\n`, activeBranches);
4894
+ } else if (openPrs.length) {
4895
+ debug.debugFn('miss: 0 active branches found');
4896
+ }
4884
4897
  infos = infos.filter(info => !activeBranches.find(b => b.newVersion === info.firstPatchedVersionIdentifier));
4885
4898
  }
4886
4899
  if (!infos.length) {
@@ -13940,12 +13953,15 @@ function addSocketWrapper(file) {
13940
13953
  if (err) {
13941
13954
  return new Error(`There was an error setting up the alias: ${err}`);
13942
13955
  }
13943
- // TODO: pretty sure you need to source the file or restart
13944
- // any terminal session before changes are reflected.
13945
- logger.logger.log(`
13946
- The alias was added to ${file}. Running 'npm install' will now be wrapped in Socket's "safe npm" 🎉
13947
- If you want to disable it at any time, run \`socket wrapper --disable\`
13948
- `.trim());
13956
+ logger.logger.success(`The alias was added to ${file}. Running 'npm install' will now be wrapped in Socket's "safe npm" 🎉`);
13957
+ logger.logger.log(` If you want to disable it at any time, run \`socket wrapper --disable\``);
13958
+ logger.logger.log('');
13959
+ logger.logger.info(`This will only be active in new terminal sessions going forward.`);
13960
+ logger.logger.log(` You will need to restart your terminal or run this command to activate the alias in the current session:`);
13961
+ logger.logger.log('');
13962
+ logger.logger.log(` source ${file}`);
13963
+ logger.logger.log('');
13964
+ logger.logger.log(`(You only need to do this once)`);
13949
13965
  });
13950
13966
  }
13951
13967
 
@@ -13953,7 +13969,12 @@ function checkSocketWrapperSetup(file) {
13953
13969
  const fileContent = fs$1.readFileSync(file, 'utf8');
13954
13970
  const linesWithSocketAlias = fileContent.split('\n').filter(l => l === 'alias npm="socket npm"' || l === 'alias npx="socket npx"');
13955
13971
  if (linesWithSocketAlias.length) {
13956
- logger.logger.log(`The Socket npm/npx wrapper is set up in your bash profile (${file})`);
13972
+ logger.logger.log(`The Socket npm/npx wrapper is set up in your bash profile (${file}).`);
13973
+ logger.logger.log('');
13974
+ logger.logger.log(`If you haven't already since enabling; Restart your terminal or run this command to activate it in the current session:`);
13975
+ logger.logger.log('');
13976
+ logger.logger.log(` source ${file}`);
13977
+ logger.logger.log('');
13957
13978
  return true;
13958
13979
  }
13959
13980
  return false;
@@ -14046,9 +14067,9 @@ function removeSocketWrapper(file) {
14046
14067
  logger.logger.error(err);
14047
14068
  return;
14048
14069
  }
14049
- // TODO: pretty sure you need to source the file or restart
14050
- // any terminal session before changes are reflected.
14051
- logger.logger.log(`The alias was removed from ${file}. Running 'npm install' will now run the standard npm command.`);
14070
+ logger.logger.success(`The alias was removed from ${file}. Running 'npm install' will now run the standard npm command in new terminals going forward.`);
14071
+ logger.logger.log('');
14072
+ logger.logger.info(`Note: We cannot deactivate the alias from current terminal sessions. You have to restart existing terminal sessions to finalize this step.`);
14052
14073
  });
14053
14074
  });
14054
14075
  }
@@ -14247,5 +14268,5 @@ void (async () => {
14247
14268
  await utils.captureException(e);
14248
14269
  }
14249
14270
  })();
14250
- //# debugId=4d928533-b1b0-4544-a736-d405169a5523
14271
+ //# debugId=ad52decd-77a1-456a-85fe-05c2c8c57de5
14251
14272
  //# sourceMappingURL=cli.js.map