@@ -8,12 +8,16 @@ type RegistryEnv = typeof registryConstants.ENV
8
8
9
9
type Constants = {
10
10
readonly API_V0_URL : 'https://api.socket.dev/v0'
11
+ readonly BABEL_RUNTIME : '@babel/runtime'
12
+ readonly CDXGEN : 'cdxgen'
13
+ readonly CYCLONEDX_CDXGEN : '@cyclonedx/cdxgen'
11
14
readonly ENV : RegistryEnv & {
12
15
UPDATE_SOCKET_OVERRIDES_IN_PACKAGE_LOCK_FILE : boolean
13
16
}
14
17
readonly DIST_TYPE : 'module-sync' | 'require'
15
18
readonly NPM_REGISTRY_URL : 'https://registry.npmjs.org'
16
19
readonly SOCKET_CLI_ISSUES_URL : 'https://github.com/SocketDev/socket-cli/issues'
20
+ readonly SYNP : 'synp'
17
21
readonly UPDATE_SOCKET_OVERRIDES_IN_PACKAGE_LOCK_FILE : 'UPDATE_SOCKET_OVERRIDES_IN_PACKAGE_LOCK_FILE'
18
22
readonly cdxgenBinPath : string
19
23
readonly distPath : string
@@ -35,14 +39,14 @@ const {
35
39
} = registryConstants
36
40
37
41
const API_V0_URL = 'https://api.socket.dev/v0'
38
-
42
+ const BABEL_RUNTIME = '@babel/runtime'
43
+ const CDXGEN = 'cdxgen'
44
+ const CYCLONEDX_CDXGEN = `@cyclonedx/${ CDXGEN } `
39
45
const NPM_REGISTRY_URL = 'https://registry.npmjs.org'
40
-
41
46
const SOCKET_CLI_ISSUES_URL = 'https://github.com/SocketDev/socket-cli/issues'
42
-
47
+ const SYNP = 'synp'
43
48
const UPDATE_SOCKET_OVERRIDES_IN_PACKAGE_LOCK_FILE =
44
49
'UPDATE_SOCKET_OVERRIDES_IN_PACKAGE_LOCK_FILE'
45
-
46
50
const ENV : Constants [ 'ENV' ] = Object . freeze ( {
47
51
...registryConstants . ENV ,
48
52
// Flag set by the optimize command to bypass the packagesHaveRiskyIssues check.
@@ -56,9 +60,9 @@ const rootDistPath = path.join(rootPath, 'dist')
56
60
const rootBinPath = path . join ( rootPath , 'bin' )
57
61
const rootPkgJsonPath = path . join ( rootPath , PACKAGE_JSON )
58
62
const nmBinPath = path . join ( rootPath , 'node_modules/.bin' )
59
- const cdxgenBinPath = path . join ( nmBinPath , 'cdxgen' )
63
+ const cdxgenBinPath = path . join ( nmBinPath , CDXGEN )
60
64
const shadowBinPath = path . join ( rootPath , 'shadow-bin' )
61
- const synpBinPath = path . join ( nmBinPath , 'synp' )
65
+ const synpBinPath = path . join ( nmBinPath , SYNP )
62
66
63
67
const LAZY_DIST_TYPE = ( ) =>
64
68
registryConstants . SUPPORTS_NODE_REQUIRE_MODULE ? 'module-sync' : 'require'
@@ -68,11 +72,15 @@ const lazyDistPath = () => path.join(rootDistPath, constants.DIST_TYPE)
68
72
const constants = < Constants > createConstantsObject (
69
73
{
70
74
API_V0_URL ,
75
+ BABEL_RUNTIME ,
76
+ CDXGEN ,
77
+ CYCLONEDX_CDXGEN ,
71
78
ENV ,
72
79
// Lazily defined values are initialized as `undefined` to keep their key order.
73
80
DIST_TYPE : undefined ,
74
81
NPM_REGISTRY_URL ,
75
82
SOCKET_CLI_ISSUES_URL ,
83
+ SYNP ,
76
84
UPDATE_SOCKET_OVERRIDES_IN_PACKAGE_LOCK_FILE ,
77
85
cdxgenBinPath,
78
86
distPath : undefined ,
0 commit comments