@socketsecurity/cli-with-sentry 0.15.44 → 0.15.45
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 +26 -13
- package/dist/cli.js.map +1 -1
- package/dist/constants.js +3 -3
- package/dist/constants.js.map +1 -1
- package/dist/types/commands/fix/pnpm-fix.d.mts.map +1 -1
- package/dist/types/commands/wrapper/add-socket-wrapper.d.mts.map +1 -1
- package/dist/types/commands/wrapper/check-socket-wrapper-setup.d.mts.map +1 -1
- package/dist/types/commands/wrapper/remove-socket-wrapper.d.mts.map +1 -1
- package/package.json +1 -1
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}
|
|
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})
|
|
3711
|
+
return new RegExp(`^socket/(${escType})/(${escWorkspace})/(${escFullName})_(${escVersion})_(${escNewVersion})$`);
|
|
3712
3712
|
}
|
|
3713
3713
|
function createSocketBranchParser(options) {
|
|
3714
3714
|
const pattern = getSocketBranchPattern(options);
|
|
@@ -4881,6 +4881,11 @@ async function pnpmFix(pkgEnvDetails, {
|
|
|
4881
4881
|
activeBranches.push(parsedBranch);
|
|
4882
4882
|
}
|
|
4883
4883
|
}
|
|
4884
|
+
if (activeBranches.length) {
|
|
4885
|
+
debug.debugFn(`found: ${activeBranches.length} active branches\n`, activeBranches);
|
|
4886
|
+
} else {
|
|
4887
|
+
debug.debugFn('miss: 0 active branches found');
|
|
4888
|
+
}
|
|
4884
4889
|
infos = infos.filter(info => !activeBranches.find(b => b.newVersion === info.firstPatchedVersionIdentifier));
|
|
4885
4890
|
}
|
|
4886
4891
|
if (!infos.length) {
|
|
@@ -13940,12 +13945,15 @@ function addSocketWrapper(file) {
|
|
|
13940
13945
|
if (err) {
|
|
13941
13946
|
return new Error(`There was an error setting up the alias: ${err}`);
|
|
13942
13947
|
}
|
|
13943
|
-
|
|
13944
|
-
|
|
13945
|
-
logger.logger.log(
|
|
13946
|
-
|
|
13947
|
-
|
|
13948
|
-
|
|
13948
|
+
logger.logger.success(`The alias was added to ${file}. Running 'npm install' will now be wrapped in Socket's "safe npm" 🎉`);
|
|
13949
|
+
logger.logger.log(` If you want to disable it at any time, run \`socket wrapper --disable\``);
|
|
13950
|
+
logger.logger.log('');
|
|
13951
|
+
logger.logger.info(`This will only be active in new terminal sessions going forward.`);
|
|
13952
|
+
logger.logger.log(` You will need to restart your terminal or run this command to activate the alias in the current session:`);
|
|
13953
|
+
logger.logger.log('');
|
|
13954
|
+
logger.logger.log(` source ${file}`);
|
|
13955
|
+
logger.logger.log('');
|
|
13956
|
+
logger.logger.log(`(You only need to do this once)`);
|
|
13949
13957
|
});
|
|
13950
13958
|
}
|
|
13951
13959
|
|
|
@@ -13953,7 +13961,12 @@ function checkSocketWrapperSetup(file) {
|
|
|
13953
13961
|
const fileContent = fs$1.readFileSync(file, 'utf8');
|
|
13954
13962
|
const linesWithSocketAlias = fileContent.split('\n').filter(l => l === 'alias npm="socket npm"' || l === 'alias npx="socket npx"');
|
|
13955
13963
|
if (linesWithSocketAlias.length) {
|
|
13956
|
-
logger.logger.log(`The Socket npm/npx wrapper is set up in your bash profile (${file})
|
|
13964
|
+
logger.logger.log(`The Socket npm/npx wrapper is set up in your bash profile (${file}).`);
|
|
13965
|
+
logger.logger.log('');
|
|
13966
|
+
logger.logger.log(`If you haven't already since enabling; Restart your terminal or run this command to activate it in the current session:`);
|
|
13967
|
+
logger.logger.log('');
|
|
13968
|
+
logger.logger.log(` source ${file}`);
|
|
13969
|
+
logger.logger.log('');
|
|
13957
13970
|
return true;
|
|
13958
13971
|
}
|
|
13959
13972
|
return false;
|
|
@@ -14046,9 +14059,9 @@ function removeSocketWrapper(file) {
|
|
|
14046
14059
|
logger.logger.error(err);
|
|
14047
14060
|
return;
|
|
14048
14061
|
}
|
|
14049
|
-
|
|
14050
|
-
|
|
14051
|
-
logger.logger.
|
|
14062
|
+
logger.logger.success(`The alias was removed from ${file}. Running 'npm install' will now run the standard npm command in new terminals going forward.`);
|
|
14063
|
+
logger.logger.log('');
|
|
14064
|
+
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
14065
|
});
|
|
14053
14066
|
});
|
|
14054
14067
|
}
|
|
@@ -14247,5 +14260,5 @@ void (async () => {
|
|
|
14247
14260
|
await utils.captureException(e);
|
|
14248
14261
|
}
|
|
14249
14262
|
})();
|
|
14250
|
-
//# debugId=
|
|
14263
|
+
//# debugId=a7078a69-7665-417e-a14a-4c06fdddafa4
|
|
14251
14264
|
//# sourceMappingURL=cli.js.map
|