Skip to content

Commit 02392f5

Browse files
committed
Fix CI build errors and restructure exports
1 parent 6bf12f5 commit 02392f5

File tree

10 files changed

+145
-21
lines changed

10 files changed

+145
-21
lines changed

registry/src/cli.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @fileoverview CLI utilities for Socket Registry v2.0.
33
*/
44

5-
export * from './cli/logger.js'
6-
export * from './cli/spinner.js'
7-
export * from './cli/prompts.js'
8-
export * from './cli/progress.js'
5+
export * from './cli/logger'
6+
export * from './cli/spinner'
7+
export * from './cli/prompts'
8+
export * from './cli/progress'
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
declare module 'fast-sort' {
2+
export function createNewSortInstance(config?: any): any
3+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
declare const makeFetchHappen: any
2+
export = makeFetchHappen

registry/src/index.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,38 +4,38 @@
44
*/
55

66
// Core module exports
7-
export * as constants from './constants.js'
8-
export * as utils from './utils.js'
9-
export * as packages from './packages.js'
10-
export * as cli from './cli.js'
11-
export * from './types.js'
7+
export * as constants from './constants'
8+
export * as utils from './utils'
9+
export * as packages from './packages'
10+
export * as cli from './cli'
11+
export * from './types'
1212

1313
// Direct exports for commonly used items
14-
export { SocketRegistry } from './packages/registry.js'
14+
export { SocketRegistry } from './packages/registry'
1515

1616
// Re-export specific utilities for convenience
1717
export {
1818
readPackageJson,
1919
writePackageJson,
2020
installPackage,
2121
validatePackageJson,
22-
} from './packages.js'
22+
} from './packages'
2323

2424
export {
2525
logger,
2626
createSpinner,
2727
confirm,
2828
input,
29-
} from './cli.js'
29+
} from './cli'
3030

3131
// Version export
3232
export const version = '2.0.0'
3333

3434
// Default export with all modules
3535
export default {
3636
version,
37-
constants: await import('./constants.js').then(m => m.default),
38-
utils: await import('./utils.js'),
39-
packages: await import('./packages.js'),
40-
cli: await import('./cli.js'),
37+
constants: await import('./constants').then(m => m.default),
38+
utils: await import('./utils'),
39+
packages: await import('./packages'),
40+
cli: await import('./cli'),
4141
}

registry/src/lib/packages.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ import {
7171
isValidPackageName,
7272
} from './packages/validation'
7373

74-
import type { CategoryString } from '../index'
74+
import type { CategoryString } from '../types'
7575

7676
// Type for package.json exports field.
7777
type PackageExports = {

registry/src/packages.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/**
2+
* @fileoverview Package-related functionality re-exported from lib modules.
3+
*/
4+
5+
// Re-export all package utilities from lib
6+
export * from './lib/packages'
7+
8+
// Additional exports for compatibility
9+
export { readPackageJson, readPackageJsonSync } from './lib/packages/operations'
10+
11+
// Placeholder exports to be implemented
12+
export async function writePackageJson(_path: string, _data: any) {
13+
// TODO: Implement writePackageJson.
14+
throw new Error('writePackageJson not yet implemented')
15+
}
16+
17+
export async function installPackage(_name: string) {
18+
// TODO: Implement installPackage.
19+
throw new Error('installPackage not yet implemented')
20+
}
21+
22+
export async function validatePackageJson(_data: any) {
23+
// TODO: Implement validatePackageJson.
24+
return true
25+
}

registry/src/packages/registry.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/**
2+
* @fileoverview Socket Registry class implementation.
3+
*/
4+
5+
/**
6+
* Main Socket Registry class for managing packages.
7+
*/
8+
export class SocketRegistry {
9+
constructor() {
10+
// Implementation placeholder
11+
}
12+
}

registry/src/types.ts

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
/**
2+
* @fileoverview Type definitions for Socket Registry.
3+
*/
4+
5+
// Type definitions
6+
enum Categories {
7+
CLEANUP = 'cleanup',
8+
LEVELUP = 'levelup',
9+
SPEEDUP = 'speedup',
10+
TUNEUP = 'tuneup',
11+
}
12+
13+
export type CategoryString = `${Categories}`
14+
15+
enum Interop {
16+
BROWSERIFY = 'browserify',
17+
CJS = 'cjs',
18+
ESM = 'esm',
19+
}
20+
21+
export type InteropString = `${Interop}`
22+
23+
// Based on SocketPURL_Type from socket-sdk-js
24+
enum PURL_Type {
25+
APK = 'apk',
26+
BITBUCKET = 'bitbucket',
27+
COCOAPODS = 'cocoapods',
28+
CARGO = 'cargo',
29+
CHROME = 'chrome',
30+
COMPOSER = 'composer',
31+
CONAN = 'conan',
32+
CONDA = 'conda',
33+
CRAN = 'cran',
34+
DEB = 'deb',
35+
DOCKER = 'docker',
36+
GEM = 'gem',
37+
GENERIC = 'generic',
38+
GITHUB = 'github',
39+
GOLANG = 'golang',
40+
HACKAGE = 'hackage',
41+
HEX = 'hex',
42+
HUGGINGFACE = 'huggingface',
43+
MAVEN = 'maven',
44+
MLFLOW = 'mlflow',
45+
NPM = 'npm',
46+
NUGET = 'nuget',
47+
OCI = 'oci',
48+
PUB = 'pub',
49+
PYPI = 'pypi',
50+
QPKG = 'qpkg',
51+
RPM = 'rpm',
52+
SWID = 'swid',
53+
SWIFT = 'swift',
54+
VCS = 'vcs',
55+
}
56+
57+
export type PURLString = `${PURL_Type}`

registry/src/utils.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/**
2+
* @fileoverview Utility functions re-exported from lib modules.
3+
*/
4+
5+
// Re-export all utility modules from lib
6+
export * from './lib/arrays'
7+
export * from './lib/fs'
8+
export * from './lib/json'
9+
export * from './lib/memoization'
10+
export * from './lib/objects'
11+
export * from './lib/path'
12+
export * from './lib/promises'
13+
export * from './lib/regexps'
14+
export * from './lib/sorts'
15+
export * from './lib/strings'
16+
export * from './lib/url'
17+
export * from './lib/words'
18+
19+
// Export specific functions from lib/functions to avoid conflicts
20+
export { noop } from './lib/functions'

registry/tsconfig.json

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"compilerOptions": {
33
"allowImportingTsExtensions": false,
44
"allowJs": true,
5-
"declaration": true,
5+
"declaration": false,
66
"declarationMap": false,
77
"esModuleInterop": false,
88
"forceConsistentCasingInFileNames": true,
@@ -26,8 +26,13 @@
2626
"allowSyntheticDefaultImports": true,
2727
"noImplicitAny": false,
2828
"noUnusedLocals": true,
29-
"noUnusedParameters": true
29+
"noUnusedParameters": true,
30+
"paths": {
31+
"cacache": ["./src/external/cacache"],
32+
"make-fetch-happen": ["./src/external/make-fetch-happen"],
33+
"fast-sort": ["./src/external/fast-sort"]
34+
}
3035
},
31-
"include": ["src/**/*.ts"],
32-
"exclude": ["node_modules", "dist", "lib", "test", "src/external/**/*"]
36+
"include": ["src/**/*.ts", "src/external/*.d.ts"],
37+
"exclude": ["node_modules", "dist", "lib", "test"]
3338
}

0 commit comments

Comments
 (0)