socket 0.14.145 → 0.14.147

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.145:72b5678:19fa9236:pub' // The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION_HASH']".
907
+ const cliVersion = '0.14.147:be0fdf7:129207b8: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
@@ -5116,10 +5123,7 @@ async function detectAndValidatePackageEnvironment(cwd, options) {
5116
5123
 
5117
5124
  const { NPM: NPM$a, PNPM: PNPM$6 } = constants
5118
5125
  async function runFix(options_) {
5119
- const options = assignDefaultFixOptions({
5120
- __proto__: null,
5121
- ...options_
5122
- })
5126
+ const options = normalizeFixOptions(options_)
5123
5127
  const pkgEnvDetails = await detectAndValidatePackageEnvironment(options.cwd, {
5124
5128
  cmdName: CMD_NAME$1,
5125
5129
  logger: logger.logger
@@ -5139,8 +5143,8 @@ async function runFix(options_) {
5139
5143
  const { DRY_RUN_BAIL_TEXT: DRY_RUN_BAIL_TEXT$y } = constants
5140
5144
  const config$B = {
5141
5145
  commandName: 'fix',
5142
- description: 'Fix "fixable" Socket alerts',
5143
- hidden: true,
5146
+ description: 'Update dependencies with "fixable" Socket alerts',
5147
+ hidden: false,
5144
5148
  flags: {
5145
5149
  ...commonFlags,
5146
5150
  autoPilot: {
@@ -5156,7 +5160,7 @@ const config$B = {
5156
5160
  purl: {
5157
5161
  type: 'string',
5158
5162
  default: [],
5159
- description: `User provided PURL to fix`,
5163
+ 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`,
5160
5164
  isMultiple: true,
5161
5165
  shortFlag: 'p'
5162
5166
  },
@@ -5167,10 +5171,12 @@ const config$B = {
5167
5171
  Define how updated dependency versions should be written in package.json.
5168
5172
  Available styles:
5169
5173
  * caret - Use ^ range for compatible updates (e.g. ^1.2.3)
5170
- * gt - Use >= to allow any newer version (e.g. >=1.2.3)
5174
+ * gt - Use > to allow any newer version (e.g. >1.2.3)
5175
+ * gte - Use >= to allow any newer version (e.g. >=1.2.3)
5171
5176
  * lt - Use < to allow only lower versions (e.g. <1.2.3)
5177
+ * lte - Use <= to allow only lower versions (e.g. <=1.2.3)
5172
5178
  * pin - Use the exact version (e.g. 1.2.3)
5173
- * preserve - Retain the existing version range as-is
5179
+ * preserve - Retain the existing version range style as-is
5174
5180
  * tilde - Use ~ range for patch/minor updates (e.g. ~1.2.3)
5175
5181
  `
5176
5182
  },
@@ -7472,7 +7478,7 @@ async function addOverrides(pkgEnvDetails, pkgPath, options) {
7472
7478
  const isWorkspaceRoot = pkgPath === rootPath
7473
7479
  const isLockScanned = isWorkspaceRoot && !prod
7474
7480
  const workspaceName = isWorkspaceRoot
7475
- ? ''
7481
+ ? 'root'
7476
7482
  : path$1.relative(rootPath, pkgPath)
7477
7483
  if (
7478
7484
  isWorkspace &&
@@ -7498,9 +7504,7 @@ async function addOverrides(pkgEnvDetails, pkgPath, options) {
7498
7504
  overridesDataByAgent.get(YARN_CLASSIC)(pkgEnvDetails)
7499
7505
  )
7500
7506
  }
7501
- spinner?.setText(
7502
- `Adding overrides${workspaceName ? ` to ${workspaceName}` : ''}...`
7503
- )
7507
+ spinner?.setText(`Adding overrides to ${workspaceName}...`)
7504
7508
  const depAliasMap = new Map()
7505
7509
  const depEntries = getDependencyEntries(pkgEnvDetails)
7506
7510
  const manifestEntries = manifestNpmOverrides.filter(({ 1: data }) =>
@@ -7546,7 +7550,7 @@ async function addOverrides(pkgEnvDetails, pkgPath, options) {
7546
7550
  thisSpec = sockOverrideSpec
7547
7551
  depObj[origPkgName] = thisSpec
7548
7552
  state.added.add(sockRegPkgName)
7549
- if (workspaceName) {
7553
+ if (!isWorkspaceRoot) {
7550
7554
  state.addedInWorkspaces.add(workspaceName)
7551
7555
  }
7552
7556
  }
@@ -12253,7 +12257,7 @@ void (async () => {
12253
12257
  await vendor.updater({
12254
12258
  name: SOCKET_CLI_BIN_NAME,
12255
12259
  // The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION']".
12256
- version: '0.14.145',
12260
+ version: '0.14.147',
12257
12261
  ttl: 86_400_000 /* 24 hours in milliseconds */
12258
12262
  })
12259
12263
  try {
@@ -12321,5 +12325,5 @@ void (async () => {
12321
12325
  await shadowNpmInject.captureException(e)
12322
12326
  }
12323
12327
  })()
12324
- //# debugId=be11d525-2d0b-4048-8e64-5391d6a93d04
12328
+ //# debugId=bbd43241-7b59-4dff-9ee3-8f60c7e28f1d
12325
12329
  //# sourceMappingURL=cli.js.map