@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.
- package/README.md +22 -22
- package/bin/npm +2 -0
- package/bin/npx +2 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +3928 -0
- package/dist/errors.d.ts +7 -0
- package/dist/link.d.ts +2 -0
- package/dist/link.js +45 -0
- package/dist/npm-cli.d.ts +2 -0
- package/dist/npm-cli.js +84 -0
- package/dist/npm-injection.d.ts +1 -0
- package/dist/npm-injection.js +913 -0
- package/dist/npm-injection2.d.ts +25 -0
- package/dist/npm-injection2.js +899 -0
- package/dist/npx-cli.d.ts +2 -0
- package/dist/npx-cli.js +60 -0
- package/dist/path-resolve.d.ts +12 -0
- package/dist/path-resolve.js +139 -0
- package/dist/sdk.d.ts +27 -0
- package/dist/sdk.js +224 -0
- package/dist/settings.d.ts +9 -0
- package/dist/type-helpers.d.ts +3 -0
- package/dist/vendor.js +25421 -0
- package/package.json +108 -52
- package/{lib/shadow/translations.json → translations.json} +20 -20
- package/cli.js +0 -72
- package/lib/commands/audit-log/index.js +0 -162
- package/lib/commands/cdxgen/index.js +0 -211
- package/lib/commands/dependencies/index.js +0 -150
- package/lib/commands/index.js +0 -15
- package/lib/commands/info/index.js +0 -287
- package/lib/commands/login/index.js +0 -170
- package/lib/commands/logout/index.js +0 -35
- package/lib/commands/npm/index.js +0 -27
- package/lib/commands/npx/index.js +0 -22
- package/lib/commands/organizations/index.js +0 -81
- package/lib/commands/raw-npm/index.js +0 -59
- package/lib/commands/raw-npx/index.js +0 -59
- package/lib/commands/report/create.js +0 -251
- package/lib/commands/report/index.js +0 -24
- package/lib/commands/report/view.js +0 -176
- package/lib/commands/repos/create.js +0 -166
- package/lib/commands/repos/delete.js +0 -93
- package/lib/commands/repos/index.js +0 -30
- package/lib/commands/repos/list.js +0 -170
- package/lib/commands/repos/update.js +0 -166
- package/lib/commands/repos/view.js +0 -128
- package/lib/commands/scan/create.js +0 -245
- package/lib/commands/scan/delete.js +0 -112
- package/lib/commands/scan/index.js +0 -30
- package/lib/commands/scan/list.js +0 -192
- package/lib/commands/scan/metadata.js +0 -113
- package/lib/commands/scan/stream.js +0 -115
- package/lib/commands/wrapper/index.js +0 -199
- package/lib/flags/command.js +0 -14
- package/lib/flags/index.js +0 -3
- package/lib/flags/output.js +0 -16
- package/lib/flags/validation.js +0 -14
- package/lib/shadow/bin/npm +0 -2
- package/lib/shadow/bin/npx +0 -2
- package/lib/shadow/link.cjs +0 -50
- package/lib/shadow/npm-cli.cjs +0 -27
- package/lib/shadow/npm-injection.cjs +0 -649
- package/lib/shadow/npx-cli.cjs +0 -27
- package/lib/shadow/package.json +0 -3
- package/lib/shadow/tty-server.cjs +0 -222
- package/lib/shadow/update-notifier.mjs +0 -3
- package/lib/utils/api-helpers.js +0 -42
- package/lib/utils/chalk-markdown.js +0 -125
- package/lib/utils/errors.js +0 -14
- package/lib/utils/flags.js +0 -27
- package/lib/utils/format-issues.js +0 -99
- package/lib/utils/formatting.js +0 -47
- package/lib/utils/issue-rules.cjs +0 -180
- package/lib/utils/meow-with-subcommands.js +0 -87
- package/lib/utils/misc.js +0 -61
- package/lib/utils/path-resolve.js +0 -204
- package/lib/utils/sdk.js +0 -99
- package/lib/utils/settings.js +0 -69
- package/lib/utils/type-helpers.cjs +0 -13
- package/lib/utils/update-notifier.js +0 -18
package/lib/shadow/link.cjs
DELETED
|
@@ -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
|
package/lib/shadow/npm-cli.cjs
DELETED
|
@@ -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()
|