@socketsecurity/cli-with-sentry 0.14.144 → 0.14.146

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
@@ -904,7 +904,7 @@ function emitBanner(name) {
904
904
  logger.logger.error(getAsciiHeader(name))
905
905
  }
906
906
  function getAsciiHeader(command) {
907
- const cliVersion = '0.14.144:e577de2:37d9efbe:pub' // The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION_HASH']".
907
+ const cliVersion = '0.14.146:6152991:5adb2b76:pub' // The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION_HASH']".
908
908
  const nodeVersion = process$1.version
909
909
  const apiToken = shadowNpmInject.getDefaultToken()
910
910
  const defaultOrg = shadowNpmInject.getConfigValue('defaultOrg')
@@ -3979,23 +3979,30 @@ const alertMapOptions = Object.freeze({
3979
3979
  },
3980
3980
  nothrow: true
3981
3981
  })
3982
- function assignDefaultFixOptions(options) {
3983
- if (options.autoPilot === undefined) {
3982
+ function normalizeFixOptions(options_) {
3983
+ const options = {
3984
+ __proto__: null,
3985
+ ...options_
3986
+ }
3987
+ if (typeof options.autoPilot !== 'boolean') {
3984
3988
  options.autoPilot = false
3985
3989
  }
3986
- if (options.autoMerge === undefined) {
3990
+ if (typeof options.autoMerge !== 'boolean') {
3987
3991
  options.autoMerge = !!options.autoPilot
3988
3992
  }
3989
- if (options.cwd === undefined) {
3993
+ if (typeof options.cwd !== 'string') {
3990
3994
  options.cwd = process.cwd()
3991
3995
  }
3992
- if (options.rangeStyle === undefined) {
3996
+ options.purls = Array.isArray(options.purls)
3997
+ ? options.purls.flatMap(p => p.split(/, */))
3998
+ : []
3999
+ if (typeof options.rangeStyle !== 'string') {
3993
4000
  options.rangeStyle = 'preserve'
3994
4001
  }
3995
- if (options.test === undefined) {
4002
+ if (typeof options.test !== 'boolean') {
3996
4003
  options.test = !!options.autoPilot || !!options.testScript
3997
4004
  }
3998
- if (options.testScript === undefined) {
4005
+ if (typeof options.testScript !== 'string') {
3999
4006
  options.testScript = 'test'
4000
4007
  }
4001
4008
  return options
@@ -5120,10 +5127,7 @@ async function detectAndValidatePackageEnvironment(cwd, options) {
5120
5127
 
5121
5128
  const { NPM: NPM$a, PNPM: PNPM$6 } = constants
5122
5129
  async function runFix(options_) {
5123
- const options = assignDefaultFixOptions({
5124
- __proto__: null,
5125
- ...options_
5126
- })
5130
+ const options = normalizeFixOptions(options_)
5127
5131
  const pkgEnvDetails = await detectAndValidatePackageEnvironment(options.cwd, {
5128
5132
  cmdName: CMD_NAME$1,
5129
5133
  logger: logger.logger
@@ -5143,8 +5147,8 @@ async function runFix(options_) {
5143
5147
  const { DRY_RUN_BAIL_TEXT: DRY_RUN_BAIL_TEXT$y } = constants
5144
5148
  const config$B = {
5145
5149
  commandName: 'fix',
5146
- description: 'Fix "fixable" Socket alerts',
5147
- hidden: true,
5150
+ description: 'Update dependencies with "fixable" Socket alerts',
5151
+ hidden: false,
5148
5152
  flags: {
5149
5153
  ...commonFlags,
5150
5154
  autoPilot: {
@@ -5160,7 +5164,7 @@ const config$B = {
5160
5164
  purl: {
5161
5165
  type: 'string',
5162
5166
  default: [],
5163
- description: `User provided PURL to fix`,
5167
+ description: `Provide a list of ${vendor.terminalLinkExports('package URLs (PURLs)', 'https://github.com/package-url/purl-spec?tab=readme-ov-file#purl')} to fix, as either a comma separated value or as multiple flags, instead of querying the Socket API`,
5164
5168
  isMultiple: true,
5165
5169
  shortFlag: 'p'
5166
5170
  },
@@ -5171,10 +5175,12 @@ const config$B = {
5171
5175
  Define how updated dependency versions should be written in package.json.
5172
5176
  Available styles:
5173
5177
  * caret - Use ^ range for compatible updates (e.g. ^1.2.3)
5174
- * gt - Use >= to allow any newer version (e.g. >=1.2.3)
5178
+ * gt - Use > to allow any newer version (e.g. >1.2.3)
5179
+ * gte - Use >= to allow any newer version (e.g. >=1.2.3)
5175
5180
  * lt - Use < to allow only lower versions (e.g. <1.2.3)
5181
+ * lte - Use <= to allow only lower versions (e.g. <=1.2.3)
5176
5182
  * pin - Use the exact version (e.g. 1.2.3)
5177
- * preserve - Retain the existing version range as-is
5183
+ * preserve - Retain the existing version range style as-is
5178
5184
  * tilde - Use ~ range for patch/minor updates (e.g. ~1.2.3)
5179
5185
  `
5180
5186
  },
@@ -7462,21 +7468,21 @@ async function addOverrides(pkgEnvDetails, pkgPath, options) {
7462
7468
  addedInWorkspaces: new Set(),
7463
7469
  updated: new Set(),
7464
7470
  updatedInWorkspaces: new Set(),
7465
- warnedPnpmWorkspaceRequiresNpm: false,
7466
- workspacePkgJsonPaths: await shadowNpmInject.globWorkspace(
7467
- agent,
7468
- rootPath
7469
- )
7471
+ warnedPnpmWorkspaceRequiresNpm: false
7470
7472
  }
7471
7473
  } = {
7472
7474
  __proto__: null,
7473
7475
  ...options
7474
7476
  }
7475
- const isWorkspace = state.workspacePkgJsonPaths.length > 0
7477
+ const workspacePkgJsonPaths = await shadowNpmInject.globWorkspace(
7478
+ agent,
7479
+ pkgPath
7480
+ )
7481
+ const isWorkspace = workspacePkgJsonPaths.length > 0
7476
7482
  const isWorkspaceRoot = pkgPath === rootPath
7477
7483
  const isLockScanned = isWorkspaceRoot && !prod
7478
7484
  const workspaceName = isWorkspaceRoot
7479
- ? ''
7485
+ ? 'root'
7480
7486
  : path$1.relative(rootPath, pkgPath)
7481
7487
  if (
7482
7488
  isWorkspace &&
@@ -7502,9 +7508,7 @@ async function addOverrides(pkgEnvDetails, pkgPath, options) {
7502
7508
  overridesDataByAgent.get(YARN_CLASSIC)(pkgEnvDetails)
7503
7509
  )
7504
7510
  }
7505
- spinner?.setText(
7506
- `Adding overrides${workspaceName ? ` to ${workspaceName}` : ''}...`
7507
- )
7511
+ spinner?.setText(`Adding overrides to ${workspaceName}...`)
7508
7512
  const depAliasMap = new Map()
7509
7513
  const depEntries = getDependencyEntries(pkgEnvDetails)
7510
7514
  const manifestEntries = manifestNpmOverrides.filter(({ 1: data }) =>
@@ -7550,7 +7554,7 @@ async function addOverrides(pkgEnvDetails, pkgPath, options) {
7550
7554
  thisSpec = sockOverrideSpec
7551
7555
  depObj[origPkgName] = thisSpec
7552
7556
  state.added.add(sockRegPkgName)
7553
- if (workspaceName) {
7557
+ if (!isWorkspaceRoot) {
7554
7558
  state.addedInWorkspaces.add(workspaceName)
7555
7559
  }
7556
7560
  }
@@ -7636,7 +7640,7 @@ async function addOverrides(pkgEnvDetails, pkgPath, options) {
7636
7640
  if (isWorkspace) {
7637
7641
  // Chunk package names to process them in parallel 3 at a time.
7638
7642
  await promises.pEach(
7639
- state.workspacePkgJsonPaths,
7643
+ workspacePkgJsonPaths,
7640
7644
  3,
7641
7645
  async workspacePkgJsonPath => {
7642
7646
  const otherState = await addOverrides(
@@ -7646,8 +7650,7 @@ async function addOverrides(pkgEnvDetails, pkgPath, options) {
7646
7650
  logger,
7647
7651
  pin,
7648
7652
  prod,
7649
- spinner,
7650
- state
7653
+ spinner
7651
7654
  }
7652
7655
  )
7653
7656
  for (const key of [
@@ -12258,7 +12261,7 @@ void (async () => {
12258
12261
  await vendor.updater({
12259
12262
  name: SOCKET_CLI_BIN_NAME,
12260
12263
  // The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION']".
12261
- version: '0.14.144',
12264
+ version: '0.14.146',
12262
12265
  ttl: 86_400_000 /* 24 hours in milliseconds */
12263
12266
  })
12264
12267
  try {
@@ -12326,5 +12329,5 @@ void (async () => {
12326
12329
  await shadowNpmInject.captureException(e)
12327
12330
  }
12328
12331
  })()
12329
- //# debugId=b98a5e11-2f79-43fe-9402-d9e2d8286d96
12332
+ //# debugId=6da5d585-ab38-4032-b453-f3dc4beddc3d
12330
12333
  //# sourceMappingURL=cli.js.map