Skip to content

Commit 43385e2

Browse files
committed
fix(deps): update all packages to use catalog for @socketsecurity/lib
Updates 9 packages from pinned version 2.10.4 to catalog version 3.1.3. This fixes CommonJS/ESM import issues in build scripts that were failing with "getDefaultLogger is not a function" errors. Also fixes: - build-output.mjs: Use hoisted logger pattern for better performance - clean.mjs: Replace forbidden fs.rm() with safeDelete() from @socketsecurity/lib/fs - clean.mjs: Fix logger imports to work with updated lib version Packages updated: - bootstrap - build-infra - codet5-models-builder - minilm-builder - models - node-smol-builder - onnxruntime - sbom-generator - socket - yoga-layout
1 parent f6841f5 commit 43385e2

File tree

15 files changed

+47
-483
lines changed

15 files changed

+47
-483
lines changed

packages/bootstrap/dist/bootstrap-npm.js

Lines changed: 0 additions & 213 deletions
This file was deleted.

packages/bootstrap/dist/bootstrap-smol.js

Lines changed: 0 additions & 213 deletions
This file was deleted.

packages/bootstrap/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"@babel/types": "^7.28.5",
2323
"@socketsecurity/build-infra": "workspace:*",
2424
"@socketsecurity/cli": "workspace:*",
25-
"@socketsecurity/lib": "2.10.4",
25+
"@socketsecurity/lib": "catalog:",
2626
"del-cli": "catalog:",
2727
"esbuild": "catalog:",
2828
"magic-string": "catalog:",

packages/build-infra/lib/build-output.mjs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,45 +5,46 @@
55
*/
66

77
import loggerPkg from '@socketsecurity/lib/logger'
8-
const { getDefaultLogger } = loggerPkg
8+
9+
const logger = loggerPkg.getDefaultLogger()
910

1011
/**
1112
* Print header.
1213
*/
1314
export function printHeader(message) {
14-
getDefaultLogger().step(message)
15+
logger.step(message)
1516
}
1617

1718
/**
1819
* Print step.
1920
*/
2021
export function printStep(message) {
21-
getDefaultLogger().substep(message)
22+
logger.substep(message)
2223
}
2324

2425
/**
2526
* Print substep.
2627
*/
2728
export function printSubstep(message) {
28-
getDefaultLogger().info(` ${message}`)
29+
logger.info(` ${message}`)
2930
}
3031

3132
/**
3233
* Print success message.
3334
*/
3435
export function printSuccess(message) {
35-
getDefaultLogger().success(message)
36+
logger.success(message)
3637
}
3738

3839
/**
3940
* Print error message.
4041
*/
4142
export function printError(message, error = null) {
42-
getDefaultLogger().error(message)
43+
logger.error(message)
4344
if (error) {
44-
getDefaultLogger().error(error.message)
45+
logger.error(error.message)
4546
if (error.stack) {
46-
getDefaultLogger().error(error.stack)
47+
logger.error(error.stack)
4748
}
4849
}
4950
}
@@ -52,5 +53,5 @@ export function printError(message, error = null) {
5253
* Print warning message.
5354
*/
5455
export function printWarning(message) {
55-
getDefaultLogger().warn(message)
56+
logger.warn(message)
5657
}

packages/build-infra/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"dependencies": {
2626
"@babel/parser": "catalog:",
2727
"@babel/traverse": "catalog:",
28-
"@socketsecurity/lib": "2.10.4",
28+
"@socketsecurity/lib": "catalog:",
2929
"magic-string": "catalog:"
3030
}
3131
}

packages/codet5-models-builder/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
},
1212
"dependencies": {
1313
"@socketsecurity/build-infra": "workspace:*",
14-
"@socketsecurity/lib": "2.10.4"
14+
"@socketsecurity/lib": "catalog:"
1515
}
1616
}

packages/codet5-models-builder/scripts/clean.mjs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@
22
* Clean codet5-models build artifacts.
33
*/
44

5-
import { promises as fs } from 'node:fs'
65
import path from 'node:path'
76
import { fileURLToPath } from 'node:url'
87

98
import { cleanCheckpoint } from '@socketsecurity/build-infra/lib/checkpoint-manager'
109
import { printHeader, printSuccess } from '@socketsecurity/build-infra/lib/build-output'
11-
import { getDefaultLogger } from '@socketsecurity/lib/logger'
10+
import { safeDelete } from '@socketsecurity/lib/fs'
11+
import loggerPkg from '@socketsecurity/lib/logger'
12+
13+
const logger = loggerPkg.getDefaultLogger()
1214

1315
const __filename = fileURLToPath(import.meta.url)
1416
const __dirname = path.dirname(__filename)
@@ -21,10 +23,10 @@ async function main() {
2123
printHeader('Cleaning codet5-models')
2224

2325
// Remove models directory.
24-
await fs.rm(MODELS_DIR, { recursive: true, force: true }).catch(() => {})
26+
await safeDelete(MODELS_DIR).catch(() => {})
2527

2628
// Remove build directory.
27-
await fs.rm(BUILD_DIR, { recursive: true, force: true }).catch(() => {})
29+
await safeDelete(BUILD_DIR).catch(() => {})
2830

2931
// Clean checkpoints.
3032
await cleanCheckpoint('codet5-models')
@@ -33,6 +35,6 @@ async function main() {
3335
}
3436

3537
main().catch((e) => {
36-
getDefaultLogger().error('Clean failed:', e.message)
38+
logger.error('Clean failed:', e.message)
3739
process.exit(1)
3840
})

packages/minilm-builder/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
},
1212
"dependencies": {
1313
"@socketsecurity/build-infra": "workspace:*",
14-
"@socketsecurity/lib": "2.10.4"
14+
"@socketsecurity/lib": "catalog:"
1515
}
1616
}

packages/models/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@
2020
},
2121
"dependencies": {
2222
"@socketsecurity/build-infra": "workspace:*",
23-
"@socketsecurity/lib": "2.10.4"
23+
"@socketsecurity/lib": "catalog:"
2424
}
2525
}

packages/node-smol-builder/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"dependencies": {
33
"@socketsecurity/bootstrap": "workspace:*",
44
"@socketsecurity/build-infra": "workspace:*",
5-
"@socketsecurity/lib": "2.10.4"
5+
"@socketsecurity/lib": "catalog:"
66
},
77
"description": "Custom Node.js binary builder with Socket security patches",
88
"devDependencies": {

0 commit comments

Comments
 (0)