Skip to content

Commit 7e67735

Browse files
committed
Update lib modules for build compatibility
1 parent 9233acb commit 7e67735

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

registry/src/lib/agent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export function execNpm(args: string[], options?: SpawnOptions | undefined) {
9797
// by the spinner when running the command with recent versions of npm.
9898
'--no-progress',
9999
// Add '--loglevel=error' if a loglevel flag is not provided and the
100-
// SOCKET_CLI_DEBUG environment variable is not truthy.
100+
// SOCKET_DEBUG environment variable is not truthy.
101101
...logLevelArgs,
102102
...npmArgs,
103103
...otherArgs,

registry/src/lib/debug.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ function getDebugJsInstance(namespace: string) {
5050
const debugJs = getDebug()
5151
if (
5252
!ENV.DEBUG &&
53-
ENV.SOCKET_CLI_DEBUG &&
53+
ENV.SOCKET_DEBUG &&
5454
(namespace === 'error' || namespace === 'notice')
5555
) {
5656
debugJs.enable(namespace)
@@ -280,7 +280,7 @@ function debugLogNs(namespacesOrOpts: NamespacesOrOptions, ...args: unknown[]) {
280280
*/
281281
/*@__NO_SIDE_EFFECTS__*/
282282
function isDebugNs(namespaces: string | undefined): boolean {
283-
return ENV.SOCKET_CLI_DEBUG && isEnabled(namespaces)
283+
return ENV.SOCKET_DEBUG && isEnabled(namespaces)
284284
}
285285

286286
/**

registry/src/lib/paths.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import CACHE_DIR from './constants/CACHE_DIR'
1818
import CACHE_GITHUB_DIR from './constants/CACHE_GITHUB_DIR'
1919
import CACHE_TTL_DIR from './constants/CACHE_TTL_DIR'
2020
import DOT_SOCKET_DIR from './constants/DOT_SOCKET_DIR'
21+
import ENV from './constants/ENV'
2122
import SOCKET_APP_PREFIX from './constants/SOCKET_APP_PREFIX'
2223
import SOCKET_CLI_APP_NAME from './constants/SOCKET_CLI_APP_NAME'
2324
import SOCKET_DLX_APP_NAME from './constants/SOCKET_DLX_APP_NAME'
@@ -50,8 +51,12 @@ export function getSocketAppDir(appName: string): string {
5051

5152
/**
5253
* Get the Socket cacache directory (~/.socket/_cacache).
54+
* Can be overridden with SOCKET_CACACHE_DIR environment variable for testing.
5355
*/
5456
export function getSocketCacacheDir(): string {
57+
if (ENV.SOCKET_CACACHE_DIR) {
58+
return normalizePath(ENV.SOCKET_CACACHE_DIR)
59+
}
5560
return normalizePath(
5661
path.join(getSocketUserDir(), `${SOCKET_APP_PREFIX}cacache`),
5762
)

0 commit comments

Comments
 (0)