Skip to content

Commit 09deda6

Browse files
committed
Fix incorrect require paths in paths.ts and sorts.ts
The files were moved from src/lib/ to src/ during refactoring, but the relative paths to constants and external modules weren't updated. Changes: - src/paths.ts: Change require('../constants/*') to require('./constants/*') - src/sorts.ts: Change require('../external/*') to require('./external/*') These paths were broken because '../' from src/ goes to project root, but the constants and external directories are in src/.
1 parent 24fd2e6 commit 09deda6

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

src/paths.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export function getSocketUserDir(): string {
3333
return normalizePath(
3434
path.join(
3535
os.homedir(),
36-
/*@__INLINE__*/ require('../constants/paths').DOT_SOCKET_DIR,
36+
/*@__INLINE__*/ require('./constants/paths').DOT_SOCKET_DIR,
3737
),
3838
)
3939
}
@@ -45,7 +45,7 @@ export function getSocketAppDir(appName: string): string {
4545
return normalizePath(
4646
path.join(
4747
getSocketUserDir(),
48-
`${/*@__INLINE__*/ require('../constants/socket').SOCKET_APP_PREFIX}${appName}`,
48+
`${/*@__INLINE__*/ require('./constants/socket').SOCKET_APP_PREFIX}${appName}`,
4949
),
5050
)
5151
}
@@ -61,7 +61,7 @@ export function getSocketCacacheDir(): string {
6161
return normalizePath(
6262
path.join(
6363
getSocketUserDir(),
64-
`${/*@__INLINE__*/ require('../constants/socket').SOCKET_APP_PREFIX}cacache`,
64+
`${/*@__INLINE__*/ require('./constants/socket').SOCKET_APP_PREFIX}cacache`,
6565
),
6666
)
6767
}
@@ -73,7 +73,7 @@ export function getSocketDlxDir(): string {
7373
return normalizePath(
7474
path.join(
7575
getSocketUserDir(),
76-
`${/*@__INLINE__*/ require('../constants/socket').SOCKET_APP_PREFIX}${/*@__INLINE__*/ require('../constants/socket').SOCKET_DLX_APP_NAME}`,
76+
`${/*@__INLINE__*/ require('./constants/socket').SOCKET_APP_PREFIX}${/*@__INLINE__*/ require('./constants/socket').SOCKET_DLX_APP_NAME}`,
7777
),
7878
)
7979
}
@@ -85,7 +85,7 @@ export function getSocketAppCacheDir(appName: string): string {
8585
return normalizePath(
8686
path.join(
8787
getSocketAppDir(appName),
88-
/*@__INLINE__*/ require('../constants/paths').CACHE_DIR,
88+
/*@__INLINE__*/ require('./constants/paths').CACHE_DIR,
8989
),
9090
)
9191
}
@@ -97,7 +97,7 @@ export function getSocketAppCacheTtlDir(appName: string): string {
9797
return normalizePath(
9898
path.join(
9999
getSocketAppCacheDir(appName),
100-
/*@__INLINE__*/ require('../constants/paths').CACHE_TTL_DIR,
100+
/*@__INLINE__*/ require('./constants/paths').CACHE_TTL_DIR,
101101
),
102102
)
103103
}
@@ -107,7 +107,7 @@ export function getSocketAppCacheTtlDir(appName: string): string {
107107
*/
108108
export function getSocketCliDir(): string {
109109
return getSocketAppDir(
110-
/*@__INLINE__*/ require('../constants/socket').SOCKET_CLI_APP_NAME,
110+
/*@__INLINE__*/ require('./constants/socket').SOCKET_CLI_APP_NAME,
111111
)
112112
}
113113

@@ -116,7 +116,7 @@ export function getSocketCliDir(): string {
116116
*/
117117
export function getSocketRegistryDir(): string {
118118
return getSocketAppDir(
119-
/*@__INLINE__*/ require('../constants/socket').SOCKET_REGISTRY_APP_NAME,
119+
/*@__INLINE__*/ require('./constants/socket').SOCKET_REGISTRY_APP_NAME,
120120
)
121121
}
122122

@@ -127,9 +127,9 @@ export function getSocketRegistryGithubCacheDir(): string {
127127
return normalizePath(
128128
path.join(
129129
getSocketAppCacheTtlDir(
130-
/*@__INLINE__*/ require('../constants/socket').SOCKET_REGISTRY_APP_NAME,
130+
/*@__INLINE__*/ require('./constants/socket').SOCKET_REGISTRY_APP_NAME,
131131
),
132-
/*@__INLINE__*/ require('../constants/github').CACHE_GITHUB_DIR,
132+
/*@__INLINE__*/ require('./constants/github').CACHE_GITHUB_DIR,
133133
),
134134
)
135135
}

src/sorts.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export function naturalSorter<T>(
5656
arrayToSort: T[],
5757
): ReturnType<FastSortFunction> {
5858
if (_naturalSorter === undefined) {
59-
const fastSort = /*@__PURE__*/ require('../external/fast-sort')
59+
const fastSort = /*@__PURE__*/ require('./external/fast-sort')
6060
// biome-ignore lint/suspicious/noExplicitAny: Fast-sort API requires dynamic method access.
6161
_naturalSorter = (fastSort as any).createNewSortInstance({
6262
comparer: naturalCompare,
@@ -78,7 +78,7 @@ export function compareStr(a: string, b: string): number {
7878
*/
7979
/*@__NO_SIDE_EFFECTS__*/
8080
export function compareSemver(a: string, b: string): number {
81-
const semver = /*@__PURE__*/ require('../external/semver')
81+
const semver = /*@__PURE__*/ require('./external/semver')
8282
const validA = semver.valid(a)
8383
const validB = semver.valid(b)
8484

0 commit comments

Comments
 (0)