socket 1.1.15 → 1.1.18

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.
Files changed (103) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/cli.js +14 -15
  3. package/dist/cli.js.map +1 -1
  4. package/dist/constants.js +35 -37
  5. package/dist/constants.js.map +1 -1
  6. package/dist/shadow-npm-bin.js +6 -6
  7. package/dist/shadow-npm-bin.js.map +1 -1
  8. package/dist/shadow-pnpm-bin.js +3 -5
  9. package/dist/shadow-pnpm-bin.js.map +1 -1
  10. package/dist/shadow-yarn-bin.js +2 -2
  11. package/dist/shadow-yarn-bin.js.map +1 -1
  12. package/dist/tsconfig.dts.tsbuildinfo +1 -1
  13. package/dist/types/commands/fix/coana-fix.d.mts.map +1 -1
  14. package/dist/types/commands/optimize/apply-optimization.d.mts.map +1 -1
  15. package/dist/types/commands/optimize/update-lockfile.d.mts.map +1 -1
  16. package/dist/types/commands/patch/cmd-patch.d.mts.map +1 -1
  17. package/dist/types/commands/patch/handle-patch.d.mts.map +1 -1
  18. package/dist/types/commands/yarn/cmd-yarn.d.mts +1 -1
  19. package/dist/types/commands/yarn/cmd-yarn.d.mts.map +1 -1
  20. package/dist/types/constants.d.mts +15 -19
  21. package/dist/types/constants.d.mts.map +1 -1
  22. package/dist/types/shadow/pnpm/bin.d.mts.map +1 -1
  23. package/dist/types/utils/agent.d.mts.map +1 -1
  24. package/dist/types/utils/dlx.d.mts.map +1 -1
  25. package/dist/types/utils/package-environment.d.mts.map +1 -1
  26. package/dist/types/utils/path-resolve.d.mts.map +1 -1
  27. package/dist/utils.js +65 -27
  28. package/dist/utils.js.map +1 -1
  29. package/dist/vendor.js +522 -524
  30. package/external/@socketsecurity/registry/external/@inquirer/confirm.js +45 -205
  31. package/external/@socketsecurity/registry/external/@inquirer/input.js +45 -205
  32. package/external/@socketsecurity/registry/external/@inquirer/password.js +181 -205
  33. package/external/@socketsecurity/registry/external/@inquirer/search.js +47 -207
  34. package/external/@socketsecurity/registry/external/@inquirer/select.js +183 -207
  35. package/external/@socketsecurity/registry/external/@npmcli/package-json/index.js +388 -2280
  36. package/external/@socketsecurity/registry/external/browserslist.js +11534 -567
  37. package/external/@socketsecurity/registry/external/cacache.js +2575 -4914
  38. package/external/@socketsecurity/registry/external/libnpmpack.js +64667 -166061
  39. package/external/@socketsecurity/registry/external/make-fetch-happen.js +384 -4044
  40. package/external/@socketsecurity/registry/external/normalize-package-data.js +30 -278
  41. package/external/@socketsecurity/registry/external/npm-package-arg.js +28 -9
  42. package/external/@socketsecurity/registry/external/pacote.js +46680 -66482
  43. package/external/@socketsecurity/registry/external/spdx-correct.js +19 -0
  44. package/external/@socketsecurity/registry/external/spdx-expression-parse.js +19 -0
  45. package/external/@socketsecurity/registry/lib/agent.js +390 -0
  46. package/external/@socketsecurity/registry/lib/arrays.js +31 -0
  47. package/external/@socketsecurity/registry/lib/bin.js +650 -0
  48. package/external/@socketsecurity/registry/lib/constants/bun-lock.js +3 -0
  49. package/external/@socketsecurity/registry/lib/constants/bun-lockb.js +3 -0
  50. package/external/@socketsecurity/registry/lib/constants/bun.js +3 -0
  51. package/external/@socketsecurity/registry/lib/constants/dot-git-dir.js +3 -0
  52. package/external/@socketsecurity/registry/lib/constants/dot-socket-dir.js +3 -0
  53. package/external/@socketsecurity/registry/lib/constants/empty-value.js +3 -0
  54. package/external/@socketsecurity/registry/lib/constants/env.js +17 -3
  55. package/external/@socketsecurity/registry/lib/constants/ext-yaml.js +3 -0
  56. package/external/@socketsecurity/registry/lib/constants/ext-yml.js +3 -0
  57. package/external/@socketsecurity/registry/lib/constants/index.js +20 -11
  58. package/external/@socketsecurity/registry/lib/constants/npm-exec-path.js +2 -2
  59. package/external/@socketsecurity/registry/lib/constants/npm-real-exec-path.js +1 -1
  60. package/external/@socketsecurity/registry/lib/constants/npm-shrinkwrap-json.js +3 -0
  61. package/external/@socketsecurity/registry/lib/constants/pnpm-exec-path.js +5 -0
  62. package/external/@socketsecurity/registry/lib/constants/pnpm-lock-yaml.js +3 -0
  63. package/external/@socketsecurity/registry/lib/constants/unknown-error.js +3 -0
  64. package/external/@socketsecurity/registry/lib/constants/unknown-value.js +3 -0
  65. package/external/@socketsecurity/registry/lib/constants/vlt-lock-json.js +3 -0
  66. package/external/@socketsecurity/registry/lib/constants/vlt.js +3 -0
  67. package/external/@socketsecurity/registry/lib/constants/yarn-berry.js +3 -0
  68. package/external/@socketsecurity/registry/lib/constants/yarn-classic.js +3 -0
  69. package/external/@socketsecurity/registry/lib/constants/yarn-exec-path.js +5 -0
  70. package/external/@socketsecurity/registry/lib/constants/yarn.js +3 -0
  71. package/external/@socketsecurity/registry/lib/debug.js +53 -0
  72. package/external/@socketsecurity/registry/lib/env.js +18 -0
  73. package/external/@socketsecurity/registry/lib/fs.js +218 -2
  74. package/external/@socketsecurity/registry/lib/functions.js +5 -0
  75. package/external/@socketsecurity/registry/lib/globs.js +22 -1
  76. package/external/@socketsecurity/registry/lib/json.js +16 -0
  77. package/external/@socketsecurity/registry/lib/logger.js +157 -0
  78. package/external/@socketsecurity/registry/lib/objects.js +103 -0
  79. package/external/@socketsecurity/registry/lib/packages.js +88 -0
  80. package/external/@socketsecurity/registry/lib/path.js +51 -1
  81. package/external/@socketsecurity/registry/lib/promises.js +55 -0
  82. package/external/@socketsecurity/registry/lib/regexps.js +5 -0
  83. package/external/@socketsecurity/registry/lib/sorts.js +17 -0
  84. package/external/@socketsecurity/registry/lib/spawn.js +105 -7
  85. package/external/@socketsecurity/registry/lib/streams.js +26 -0
  86. package/external/@socketsecurity/registry/lib/strings.js +123 -9
  87. package/external/@socketsecurity/registry/lib/url.js +21 -0
  88. package/external/@socketsecurity/registry/lib/words.js +16 -0
  89. package/external/@socketsecurity/registry/manifest.json +5 -4
  90. package/package.json +6 -5
  91. package/external/@socketsecurity/registry/external/ansi-regex.js +0 -13
  92. package/external/@socketsecurity/registry/lib/constants/node-workspaces.js +0 -3
  93. package/external/@socketsecurity/registry/lib/constants/parse-args-config.js +0 -14
  94. package/external/@socketsecurity/registry/lib/constants/skip-tests-by-ecosystem.js +0 -43
  95. package/external/@socketsecurity/registry/lib/constants/template-cjs-browser.js +0 -3
  96. package/external/@socketsecurity/registry/lib/constants/template-cjs-esm.js +0 -3
  97. package/external/@socketsecurity/registry/lib/constants/template-cjs.js +0 -3
  98. package/external/@socketsecurity/registry/lib/constants/template-es-shim-constructor.js +0 -3
  99. package/external/@socketsecurity/registry/lib/constants/template-es-shim-prototype-method.js +0 -3
  100. package/external/@socketsecurity/registry/lib/constants/template-es-shim-static-method.js +0 -3
  101. package/external/@socketsecurity/registry/lib/constants/win32-ensure-tests-by-ecosystem.js +0 -3
  102. package/external/@socketsecurity/registry/lib/npm.js +0 -404
  103. /package/external/@socketsecurity/registry/lib/constants/{hidden-package-lock-json.js → dot-package-lock-json.js} +0 -0
package/CHANGELOG.md CHANGED
@@ -4,6 +4,21 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
6
6
 
7
+ ## [1.1.18](https://github.com/SocketDev/socket-cli/releases/tag/v1.1.18) - 2025-09-18
8
+
9
+ ### Fixed
10
+ - Enhanced Node.js version compatibility by downgrading yargs-parser for Node versions below 20
11
+
12
+ ## [1.1.17](https://github.com/SocketDev/socket-cli/releases/tag/v1.1.17) - 2025-09-18
13
+
14
+ ### Fixed
15
+ - Enhanced Windows compatibility for package manager detection and execution
16
+
17
+ ## [1.1.16](https://github.com/SocketDev/socket-cli/releases/tag/v1.1.16) - 2025-09-16
18
+
19
+ ### Fixed
20
+ - Enhanced pnpm wrapper compatibility with dlx commands for better package execution support
21
+
7
22
  ## [1.1.15](https://github.com/SocketDev/socket-cli/releases/tag/v1.1.15) - 2025-09-16
8
23
 
9
24
  ### Changed
package/dist/cli.js CHANGED
@@ -25,7 +25,6 @@ var packages = require('../external/@socketsecurity/registry/lib/packages');
25
25
  var require$$12 = require('../external/@socketsecurity/registry/lib/promises');
26
26
  var regexps = require('../external/@socketsecurity/registry/lib/regexps');
27
27
  var require$$0$1 = require('node:crypto');
28
- var registryConstants = require('../external/@socketsecurity/registry/lib/constants');
29
28
  var require$$1 = require('node:util');
30
29
  var os = require('node:os');
31
30
  var promises = require('node:stream/promises');
@@ -3560,7 +3559,7 @@ async function coanaFix(fixConfig) {
3560
3559
  }
3561
3560
  };
3562
3561
  }
3563
- const fixCResult = await utils.spawnCoanaDlx(['compute-fixes-and-upgrade-purls', cwd, '--manifests-tar-hash', tarHash, '--apply-fixes-to', ...(isAll ? ['all'] : ghsas), ...(fixConfig.rangeStyle ? ['--range-style', fixConfig.rangeStyle] : []), ...(glob ? ['--glob', glob] : []), ...(onlyCompute ? ['--dry-run'] : []), ...(outputFile ? ['--output-file', outputFile] : []), ...fixConfig.unknownFlags], fixConfig.orgSlug, {
3562
+ const fixCResult = await utils.spawnCoanaDlx(['compute-fixes-and-upgrade-purls', cwd, '--manifests-tar-hash', tarHash, '--apply-fixes-to', ...(isAll ? ['all'] : ghsas), ...(fixConfig.rangeStyle ? ['--range-style', fixConfig.rangeStyle] : []), ...(glob ? ['--glob', glob] : []), ...(onlyCompute ? [constants.FLAG_DRY_RUN] : []), ...(outputFile ? ['--output-file', outputFile] : []), ...fixConfig.unknownFlags], fixConfig.orgSlug, {
3564
3563
  cwd,
3565
3564
  spinner,
3566
3565
  stdio: 'inherit'
@@ -4611,7 +4610,7 @@ const {
4611
4610
  const nodejsPlatformTypes = new Set(['javascript', 'js', 'nodejs', constants.NPM, constants.PNPM, 'ts', 'tsx', 'typescript']);
4612
4611
  function argvToArray(argvObj) {
4613
4612
  if (argvObj['help']) {
4614
- return ['--help'];
4613
+ return [constants.FLAG_HELP];
4615
4614
  }
4616
4615
  const result = [];
4617
4616
  for (const {
@@ -4940,7 +4939,7 @@ async function run$F(argv, importMeta, context) {
4940
4939
  const argsToProcess = utils.filterFlags(argv, {
4941
4940
  ...flags.commonFlags,
4942
4941
  ...flags.outputFlags
4943
- }, ['--no-banner', '--help', '-h']);
4942
+ }, ['--no-banner', constants.FLAG_HELP, '-h']);
4944
4943
  const yargv = {
4945
4944
  ...vendor.yargsParser(argsToProcess, yargsConfig)
4946
4945
  };
@@ -6759,7 +6758,7 @@ async function lsPnpm(pkgEnvDetails, options) {
6759
6758
  stdout = (await spawn.spawn(pkgEnvDetails.agentExecPath,
6760
6759
  // Pnpm uses the alternative spelling of parsable.
6761
6760
  // https://en.wiktionary.org/wiki/parsable
6762
- ['ls', '--parseable', '--prod', '--depth', 'Infinity'], {
6761
+ ['ls', '--parseable', constants.FLAG_PROD, '--depth', 'Infinity'], {
6763
6762
  cwd,
6764
6763
  shell: constants.default.WIN32
6765
6764
  })).stdout;
@@ -6812,7 +6811,7 @@ async function lsYarnClassic(pkgEnvDetails, options) {
6812
6811
  // https://github.com/yarnpkg/yarn/releases/tag/v1.0.0
6813
6812
  // > Fix: Excludes dev dependencies from the yarn list output when the
6814
6813
  // environment is production
6815
- return (await spawn.spawn(pkgEnvDetails.agentExecPath, ['list', '--prod'], {
6814
+ return (await spawn.spawn(pkgEnvDetails.agentExecPath, ['list', constants.FLAG_PROD], {
6816
6815
  cwd,
6817
6816
  shell: constants.default.WIN32
6818
6817
  })).stdout;
@@ -9052,7 +9051,7 @@ async function computeSHA256(filepath) {
9052
9051
  return {
9053
9052
  ok: false,
9054
9053
  message: 'Failed to compute file hash',
9055
- cause: `Unable to read file ${filepath}: ${e instanceof Error ? e.message : 'Unknown error'}`
9054
+ cause: `Unable to read file ${filepath}: ${e instanceof Error ? e.message : constants.UNKNOWN_ERROR}`
9056
9055
  };
9057
9056
  }
9058
9057
  }
@@ -9172,9 +9171,9 @@ async function handlePatch({
9172
9171
  spinner
9173
9172
  }) {
9174
9173
  try {
9175
- const dotSocketDirPath = path.join(cwd, constants.DOT_SOCKET);
9176
- const manifestPath = path.join(dotSocketDirPath, 'manifest.json');
9177
- const manifestContent = await fs$1.promises.readFile(manifestPath, 'utf-8');
9174
+ const dotSocketDirPath = path.join(cwd, constants.DOT_SOCKET_DIR);
9175
+ const manifestPath = path.join(dotSocketDirPath, constants.MANIFEST_JSON);
9176
+ const manifestContent = await fs$1.promises.readFile(manifestPath, constants.UTF8);
9178
9177
  const manifestData = JSON.parse(manifestContent);
9179
9178
  const purls = purlObjs.map(String);
9180
9179
  const validated = PatchManifestSchema.parse(manifestData);
@@ -9235,7 +9234,7 @@ async function handlePatch({
9235
9234
  let message = 'Failed to apply patches';
9236
9235
  let cause = e?.message || constants.UNKNOWN_ERROR;
9237
9236
  if (e instanceof SyntaxError) {
9238
- message = `Invalid JSON in ${registryConstants.MANIFEST_JSON}`;
9237
+ message = `Invalid JSON in ${constants.MANIFEST_JSON}`;
9239
9238
  cause = e.message;
9240
9239
  } else if (e instanceof Error && 'issues' in e) {
9241
9240
  message = 'Schema validation failed';
@@ -9318,13 +9317,13 @@ async function run$m(argv, importMeta, {
9318
9317
  // Note: path.resolve vs .join:
9319
9318
  // If given path is absolute then cwd should not affect it.
9320
9319
  cwd = path.resolve(process.cwd(), cwd);
9321
- const dotSocketDirPath = path.join(cwd, constants.DOT_SOCKET);
9320
+ const dotSocketDirPath = path.join(cwd, constants.DOT_SOCKET_DIR);
9322
9321
  if (!fs$1.existsSync(dotSocketDirPath)) {
9323
- throw new utils.InputError(`No ${constants.DOT_SOCKET} directory found in current directory`);
9322
+ throw new utils.InputError(`No ${constants.DOT_SOCKET_DIR} directory found in current directory`);
9324
9323
  }
9325
9324
  const manifestPath = path.join(dotSocketDirPath, constants.MANIFEST_JSON);
9326
9325
  if (!fs$1.existsSync(manifestPath)) {
9327
- throw new utils.InputError(`No ${constants.MANIFEST_JSON} found in ${constants.DOT_SOCKET} directory`);
9326
+ throw new utils.InputError(`No ${constants.MANIFEST_JSON} found in ${constants.DOT_SOCKET_DIR} directory`);
9328
9327
  }
9329
9328
  const {
9330
9329
  spinner
@@ -14735,5 +14734,5 @@ void (async () => {
14735
14734
  await utils.captureException(e);
14736
14735
  }
14737
14736
  })();
14738
- //# debugId=243906f3-caec-435c-aaca-fe5ec4aeb381
14737
+ //# debugId=b2633ba4-7e32-440b-9581-735f53ff9fc8
14739
14738
  //# sourceMappingURL=cli.js.map