@@ -8,12 +8,16 @@ type RegistryEnv = typeof registryConstants.ENV
88
99type Constants = {
1010 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'
1114 readonly ENV : RegistryEnv & {
1215 UPDATE_SOCKET_OVERRIDES_IN_PACKAGE_LOCK_FILE : boolean
1316 }
1417 readonly DIST_TYPE : 'module-sync' | 'require'
1518 readonly NPM_REGISTRY_URL : 'https://registry.npmjs.org'
1619 readonly SOCKET_CLI_ISSUES_URL : 'https://github.com/SocketDev/socket-cli/issues'
20+ readonly SYNP : 'synp'
1721 readonly UPDATE_SOCKET_OVERRIDES_IN_PACKAGE_LOCK_FILE : 'UPDATE_SOCKET_OVERRIDES_IN_PACKAGE_LOCK_FILE'
1822 readonly cdxgenBinPath : string
1923 readonly distPath : string
@@ -35,14 +39,14 @@ const {
3539} = registryConstants
3640
3741const 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 } `
3945const NPM_REGISTRY_URL = 'https://registry.npmjs.org'
40-
4146const SOCKET_CLI_ISSUES_URL = 'https://github.com/SocketDev/socket-cli/issues'
42-
47+ const SYNP = 'synp'
4348const UPDATE_SOCKET_OVERRIDES_IN_PACKAGE_LOCK_FILE =
4449 'UPDATE_SOCKET_OVERRIDES_IN_PACKAGE_LOCK_FILE'
45-
4650const ENV : Constants [ 'ENV' ] = Object . freeze ( {
4751 ...registryConstants . ENV ,
4852 // Flag set by the optimize command to bypass the packagesHaveRiskyIssues check.
@@ -56,9 +60,9 @@ const rootDistPath = path.join(rootPath, 'dist')
5660const rootBinPath = path . join ( rootPath , 'bin' )
5761const rootPkgJsonPath = path . join ( rootPath , PACKAGE_JSON )
5862const nmBinPath = path . join ( rootPath , 'node_modules/.bin' )
59- const cdxgenBinPath = path . join ( nmBinPath , 'cdxgen' )
63+ const cdxgenBinPath = path . join ( nmBinPath , CDXGEN )
6064const shadowBinPath = path . join ( rootPath , 'shadow-bin' )
61- const synpBinPath = path . join ( nmBinPath , 'synp' )
65+ const synpBinPath = path . join ( nmBinPath , SYNP )
6266
6367const LAZY_DIST_TYPE = ( ) =>
6468 registryConstants . SUPPORTS_NODE_REQUIRE_MODULE ? 'module-sync' : 'require'
@@ -68,11 +72,15 @@ const lazyDistPath = () => path.join(rootDistPath, constants.DIST_TYPE)
6872const constants = < Constants > createConstantsObject (
6973 {
7074 API_V0_URL ,
75+ BABEL_RUNTIME ,
76+ CDXGEN ,
77+ CYCLONEDX_CDXGEN ,
7178 ENV ,
7279 // Lazily defined values are initialized as `undefined` to keep their key order.
7380 DIST_TYPE : undefined ,
7481 NPM_REGISTRY_URL ,
7582 SOCKET_CLI_ISSUES_URL ,
83+ SYNP ,
7684 UPDATE_SOCKET_OVERRIDES_IN_PACKAGE_LOCK_FILE ,
7785 cdxgenBinPath,
7886 distPath : undefined ,
0 commit comments