@socketsecurity/cli 0.11.0 → 0.12.0

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 (82) hide show
  1. package/README.md +22 -22
  2. package/bin/npm +2 -0
  3. package/bin/npx +2 -0
  4. package/dist/cli.d.ts +3 -0
  5. package/dist/cli.d.ts.map +1 -0
  6. package/dist/cli.js +3928 -0
  7. package/dist/errors.d.ts +7 -0
  8. package/dist/link.d.ts +2 -0
  9. package/dist/link.js +45 -0
  10. package/dist/npm-cli.d.ts +2 -0
  11. package/dist/npm-cli.js +84 -0
  12. package/dist/npm-injection.d.ts +1 -0
  13. package/dist/npm-injection.js +913 -0
  14. package/dist/npm-injection2.d.ts +25 -0
  15. package/dist/npm-injection2.js +899 -0
  16. package/dist/npx-cli.d.ts +2 -0
  17. package/dist/npx-cli.js +60 -0
  18. package/dist/path-resolve.d.ts +12 -0
  19. package/dist/path-resolve.js +139 -0
  20. package/dist/sdk.d.ts +27 -0
  21. package/dist/sdk.js +224 -0
  22. package/dist/settings.d.ts +9 -0
  23. package/dist/type-helpers.d.ts +3 -0
  24. package/dist/vendor.js +25421 -0
  25. package/package.json +108 -52
  26. package/{lib/shadow/translations.json → translations.json} +20 -20
  27. package/cli.js +0 -72
  28. package/lib/commands/audit-log/index.js +0 -162
  29. package/lib/commands/cdxgen/index.js +0 -211
  30. package/lib/commands/dependencies/index.js +0 -150
  31. package/lib/commands/index.js +0 -15
  32. package/lib/commands/info/index.js +0 -287
  33. package/lib/commands/login/index.js +0 -170
  34. package/lib/commands/logout/index.js +0 -35
  35. package/lib/commands/npm/index.js +0 -27
  36. package/lib/commands/npx/index.js +0 -22
  37. package/lib/commands/organizations/index.js +0 -81
  38. package/lib/commands/raw-npm/index.js +0 -59
  39. package/lib/commands/raw-npx/index.js +0 -59
  40. package/lib/commands/report/create.js +0 -251
  41. package/lib/commands/report/index.js +0 -24
  42. package/lib/commands/report/view.js +0 -176
  43. package/lib/commands/repos/create.js +0 -166
  44. package/lib/commands/repos/delete.js +0 -93
  45. package/lib/commands/repos/index.js +0 -30
  46. package/lib/commands/repos/list.js +0 -170
  47. package/lib/commands/repos/update.js +0 -166
  48. package/lib/commands/repos/view.js +0 -128
  49. package/lib/commands/scan/create.js +0 -245
  50. package/lib/commands/scan/delete.js +0 -112
  51. package/lib/commands/scan/index.js +0 -30
  52. package/lib/commands/scan/list.js +0 -192
  53. package/lib/commands/scan/metadata.js +0 -113
  54. package/lib/commands/scan/stream.js +0 -115
  55. package/lib/commands/wrapper/index.js +0 -199
  56. package/lib/flags/command.js +0 -14
  57. package/lib/flags/index.js +0 -3
  58. package/lib/flags/output.js +0 -16
  59. package/lib/flags/validation.js +0 -14
  60. package/lib/shadow/bin/npm +0 -2
  61. package/lib/shadow/bin/npx +0 -2
  62. package/lib/shadow/link.cjs +0 -50
  63. package/lib/shadow/npm-cli.cjs +0 -27
  64. package/lib/shadow/npm-injection.cjs +0 -649
  65. package/lib/shadow/npx-cli.cjs +0 -27
  66. package/lib/shadow/package.json +0 -3
  67. package/lib/shadow/tty-server.cjs +0 -222
  68. package/lib/shadow/update-notifier.mjs +0 -3
  69. package/lib/utils/api-helpers.js +0 -42
  70. package/lib/utils/chalk-markdown.js +0 -125
  71. package/lib/utils/errors.js +0 -14
  72. package/lib/utils/flags.js +0 -27
  73. package/lib/utils/format-issues.js +0 -99
  74. package/lib/utils/formatting.js +0 -47
  75. package/lib/utils/issue-rules.cjs +0 -180
  76. package/lib/utils/meow-with-subcommands.js +0 -87
  77. package/lib/utils/misc.js +0 -61
  78. package/lib/utils/path-resolve.js +0 -204
  79. package/lib/utils/sdk.js +0 -99
  80. package/lib/utils/settings.js +0 -69
  81. package/lib/utils/type-helpers.cjs +0 -13
  82. package/lib/utils/update-notifier.js +0 -18
@@ -1,50 +0,0 @@
1
- /* eslint-disable no-console */
2
- const { realpathSync } = require('fs')
3
- const path = require('path')
4
-
5
- const which = require('which')
6
-
7
- if (process.platform === 'win32') {
8
- console.error('Socket dependency manager Windows suppport is limited to WSL at this time.')
9
- process.exit(1)
10
- }
11
-
12
- /**
13
- * @param {string} realDirname path to shadow/bin
14
- * @param {'npm' | 'npx'} binname
15
- * @returns {string} path to original bin
16
- */
17
- function installLinks (realDirname, binname) {
18
- const realShadowBinDir = realDirname
19
- // find package manager being shadowed by this process
20
- const bins = which.sync(binname, {
21
- all: true
22
- })
23
- let shadowIndex = -1
24
- const binpath = bins.find((binPath, i) => {
25
- const isShadow = realpathSync(path.dirname(binPath)) === realShadowBinDir
26
- if (isShadow) {
27
- shadowIndex = i
28
- }
29
- return !isShadow
30
- })
31
- if (binpath && process.platform === 'win32') {
32
- return binpath
33
- }
34
- if (!binpath) {
35
- console.error(`Socket unable to locate ${binname}; ensure it is available in the PATH environment variable`)
36
- process.exit(127)
37
- }
38
- if (shadowIndex === -1) {
39
- const bindir = path.join(realDirname)
40
- process.env['PATH'] = `${
41
- bindir
42
- }${
43
- process.platform === 'win32' ? ';' : ':'
44
- }${
45
- process.env['PATH']
46
- }`
47
- }
48
- return binpath
49
- }
50
- module.exports = installLinks
@@ -1,27 +0,0 @@
1
- #!/usr/bin/env node
2
- // THIS FILE USES .cjs to get around the extension-free entrypoint problem with ESM
3
- 'use strict'
4
- const { spawn } = require('child_process')
5
- const { realpathSync } = require('fs')
6
- const path = require('path')
7
-
8
- const realFilename = realpathSync(__filename)
9
- const realDirname = path.dirname(realFilename)
10
-
11
- /**
12
- */
13
- async function main () {
14
- const npmpath = await require('./link.cjs')(path.join(realDirname, 'bin'), 'npm')
15
- process.exitCode = 1
16
- const injectionpath = path.join(realDirname, 'npm-injection.cjs')
17
- spawn(process.execPath, ['--require', injectionpath, npmpath, ...process.argv.slice(2)], {
18
- stdio: 'inherit'
19
- }).on('exit', (code, signal) => {
20
- if (signal) {
21
- process.kill(process.pid, signal)
22
- } else if (code !== null) {
23
- process.exit(code)
24
- }
25
- })
26
- }
27
- main()