Skip to content

Commit 6f24d8c

Browse files
committed
Add type definitions for build constants
Create scripts/constants.d.mts to provide proper types for scripts/constants.mjs used in tests
1 parent 234465d commit 6f24d8c

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

scripts/constants.d.mts

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/** @fileoverview Type definitions for build constants. */
2+
3+
import type registryConstants from '@socketsecurity/registry/lib/constants'
4+
5+
type Constants = typeof registryConstants & {
6+
readonly CONSTANTS: 'constants'
7+
readonly ENV: typeof registryConstants.ENV & {
8+
readonly INLINED_SOCKET_CLI_LEGACY_BUILD: boolean
9+
readonly INLINED_SOCKET_CLI_PUBLISHED_BUILD: boolean
10+
readonly INLINED_SOCKET_CLI_SENTRY_BUILD: boolean
11+
}
12+
readonly INLINED_SOCKET_CLI_COANA_TECH_CLI_VERSION: string
13+
readonly INLINED_SOCKET_CLI_CYCLONEDX_CDXGEN_VERSION: string
14+
readonly INLINED_SOCKET_CLI_PYTHON_VERSION: string
15+
readonly INLINED_SOCKET_CLI_PYTHON_BUILD_TAG: string
16+
readonly INLINED_SOCKET_CLI_HOMEPAGE: string
17+
readonly INLINED_SOCKET_CLI_LEGACY_BUILD: string
18+
readonly INLINED_SOCKET_CLI_NAME: string
19+
readonly INLINED_SOCKET_CLI_PUBLISHED_BUILD: string
20+
readonly INLINED_SOCKET_CLI_SENTRY_BUILD: string
21+
readonly INLINED_SOCKET_CLI_SYNP_VERSION: string
22+
readonly INLINED_SOCKET_CLI_VERSION: string
23+
readonly INLINED_SOCKET_CLI_VERSION_HASH: string
24+
readonly INSTRUMENT_WITH_SENTRY: 'instrument-with-sentry'
25+
readonly ROLLUP_EXTERNAL_SUFFIX: '?commonjs-external'
26+
readonly SHADOW_NPM_BIN: 'shadow-npm-bin'
27+
readonly SHADOW_NPM_INJECT: 'shadow-npm-inject'
28+
readonly SHADOW_NPX_BIN: 'shadow-npx-bin'
29+
readonly SHADOW_PNPM_BIN: 'shadow-pnpm-bin'
30+
readonly SHADOW_YARN_BIN: 'shadow-yarn-bin'
31+
readonly SLASH_NODE_MODULES_SLASH: '/node_modules/'
32+
readonly SOCKET_CLI_BIN_NAME: 'socket'
33+
readonly SOCKET_CLI_BIN_NAME_ALIAS: 'cli'
34+
readonly SOCKET_CLI_SENTRY_BIN_NAME_ALIAS: 'cli-with-sentry'
35+
readonly SOCKET_CLI_LEGACY_PACKAGE_NAME: '@socketsecurity/cli'
36+
readonly SOCKET_CLI_NPM_BIN_NAME: 'socket-npm'
37+
readonly SOCKET_CLI_NPX_BIN_NAME: 'socket-npx'
38+
readonly SOCKET_CLI_PNPM_BIN_NAME: 'socket-pnpm'
39+
readonly SOCKET_CLI_YARN_BIN_NAME: 'socket-yarn'
40+
readonly SOCKET_CLI_PACKAGE_NAME: 'socket'
41+
readonly SOCKET_CLI_SENTRY_BIN_NAME: 'socket-with-sentry'
42+
readonly SOCKET_CLI_SENTRY_NPM_BIN_NAME: 'socket-npm-with-sentry'
43+
readonly SOCKET_CLI_SENTRY_NPX_BIN_NAME: 'socket-npx-with-sentry'
44+
readonly SOCKET_CLI_SENTRY_PNPM_BIN_NAME: 'socket-pnpm-with-sentry'
45+
readonly SOCKET_CLI_SENTRY_YARN_BIN_NAME: 'socket-yarn-with-sentry'
46+
readonly SOCKET_CLI_SENTRY_PACKAGE_NAME: '@socketsecurity/cli-with-sentry'
47+
readonly configPath: string
48+
readonly distPath: string
49+
readonly externalPath: string
50+
readonly rootPackageJsonPath: string
51+
readonly rootPackageLockPath: string
52+
readonly rootNodeModulesBinPath: string
53+
readonly rootPath: string
54+
readonly socketRegistryPath: string
55+
readonly srcPath: string
56+
}
57+
58+
declare const constants: Constants
59+
60+
export default constants

0 commit comments

Comments
 (0)