Skip to content

Commit f813751

Browse files
committed
chore(deps): update @socketsecurity/lib to v3.0.0
Breaking changes from v2.10.3 to v3.0.0: - Replace logger export with getDefaultLogger() function - Replace spinner export with getDefaultSpinner() function - Add lazy initialization for logger and spinner in all scripts Updated all script files to use new API: - scripts/build.mjs, bump.mjs, check.mjs, clean.mjs, cover.mjs - scripts/lint.mjs, publish.mjs, test.mjs, update.mjs - scripts/update-data-npm.mjs, utils/run-command.mjs Fixed test imports to use .mjs extension consistently. Fixed lint errors (unused vars in test utils). All tests pass (867 tests), 100% coverage maintained. All checks pass (ESLint, TypeScript).
1 parent 9e08aee commit f813751

File tree

16 files changed

+43
-22
lines changed

16 files changed

+43
-22
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"@dotenvx/dotenvx": "1.49.0",
5252
"@eslint/compat": "1.3.2",
5353
"@eslint/js": "9.35.0",
54-
"@socketsecurity/lib": "2.10.3",
54+
"@socketsecurity/lib": "3.0.0",
5555
"@socketsecurity/registry": "1.5.3",
5656
"@types/node": "24.9.2",
5757
"@typescript/native-preview": "7.0.0-dev.20250926.1",

pnpm-lock.yaml

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/build.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@ import colors from 'yoctocolors-cjs'
1111

1212
import { isQuiet } from '@socketsecurity/lib/argv/flags'
1313
import { parseArgs } from '@socketsecurity/lib/argv/parse'
14-
import { logger } from '@socketsecurity/lib/logger'
14+
import { getDefaultLogger } from '@socketsecurity/lib/logger'
1515
import { printFooter, printHeader } from '@socketsecurity/lib/stdio/header'
1616

17+
const logger = getDefaultLogger()
18+
1719
import {
1820
analyzeMetafile,
1921
buildConfig,

scripts/bump.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@ import semver from 'semver'
1414
import colors from 'yoctocolors-cjs'
1515

1616
import { parseArgs } from '@socketsecurity/lib/argv/parse'
17-
import { logger } from '@socketsecurity/lib/logger'
17+
import { getDefaultLogger } from '@socketsecurity/lib/logger'
1818
import { printFooter, printHeader } from '@socketsecurity/lib/stdio/header'
1919

20+
const logger = getDefaultLogger()
21+
2022
const rootPath = path.resolve(
2123
path.dirname(fileURLToPath(import.meta.url)),
2224
'..',

scripts/check.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@
44
*/
55

66
import { parseArgs } from '@socketsecurity/lib/argv/parse'
7-
import { logger } from '@socketsecurity/lib/logger'
7+
import { getDefaultLogger } from '@socketsecurity/lib/logger'
88
import { printFooter, printHeader } from '@socketsecurity/lib/stdio/header'
99

1010
import { runCommandQuiet } from './utils/run-command.mjs'
1111

12+
const logger = getDefaultLogger()
13+
1214
/**
1315
* Run ESLint check via lint script.
1416
*/

scripts/clean.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@ import fastGlob from 'fast-glob'
1111

1212
import { isQuiet } from '@socketsecurity/lib/argv/flags'
1313
import { parseArgs } from '@socketsecurity/lib/argv/parse'
14-
import { logger } from '@socketsecurity/lib/logger'
14+
import { getDefaultLogger } from '@socketsecurity/lib/logger'
1515
import { createSectionHeader } from '@socketsecurity/lib/stdio/header'
1616

17+
const logger = getDefaultLogger()
18+
1719
const rootPath = path.resolve(
1820
path.dirname(fileURLToPath(import.meta.url)),
1921
'..',

scripts/cover.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@ import path from 'node:path'
1212
import { fileURLToPath } from 'node:url'
1313

1414
import { parseArgs } from '@socketsecurity/lib/argv/parse'
15-
import { logger } from '@socketsecurity/lib/logger'
15+
import { getDefaultLogger } from '@socketsecurity/lib/logger'
1616
import { printHeader } from '@socketsecurity/lib/stdio/header'
1717

1818
import { runCommandQuiet } from './utils/run-command.mjs'
1919

20+
const logger = getDefaultLogger()
21+
2022
const __dirname = path.dirname(fileURLToPath(import.meta.url))
2123
const rootPath = path.join(__dirname, '..')
2224

scripts/lint.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@ import path from 'node:path'
99
import { isQuiet } from '@socketsecurity/lib/argv/flags'
1010
import { parseArgs } from '@socketsecurity/lib/argv/parse'
1111
import { getChangedFiles, getStagedFiles } from '@socketsecurity/lib/git'
12-
import { logger } from '@socketsecurity/lib/logger'
12+
import { getDefaultLogger } from '@socketsecurity/lib/logger'
1313
import { printHeader } from '@socketsecurity/lib/stdio/header'
1414

1515
import { runCommandQuiet } from './utils/run-command.mjs'
1616

17+
const logger = getDefaultLogger()
18+
1719
// Files that trigger a full lint when changed
1820
const CORE_FILES = new Set([
1921
'src/constants.ts',

scripts/publish.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@ import path from 'node:path'
99
import { fileURLToPath } from 'node:url'
1010

1111
import { parseArgs } from '@socketsecurity/lib/argv/parse'
12-
import { logger } from '@socketsecurity/lib/logger'
12+
import { getDefaultLogger } from '@socketsecurity/lib/logger'
1313
import { printFooter, printHeader } from '@socketsecurity/lib/stdio/header'
1414

15+
const logger = getDefaultLogger()
16+
1517
const rootPath = path.resolve(
1618
path.dirname(fileURLToPath(import.meta.url)),
1719
'..',

scripts/test.mjs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,16 @@ import path from 'node:path'
99
import { fileURLToPath } from 'node:url'
1010

1111
import { parseArgs } from '@socketsecurity/lib/argv/parse'
12-
import { logger } from '@socketsecurity/lib/logger'
12+
import { getDefaultLogger } from '@socketsecurity/lib/logger'
1313
import { onExit } from '@socketsecurity/lib/signal-exit'
14-
import { spinner } from '@socketsecurity/lib/spinner'
14+
import { getDefaultSpinner } from '@socketsecurity/lib/spinner'
1515
import { printHeader } from '@socketsecurity/lib/stdio/header'
1616

1717
import { getTestsToRun } from './utils/changed-test-mapper.mjs'
1818

19+
const logger = getDefaultLogger()
20+
const spinner = getDefaultSpinner()
21+
1922
const WIN32 = process.platform === 'win32'
2023

2124
// Suppress non-fatal worker termination unhandled rejections
@@ -314,7 +317,6 @@ async function runTests(options, positionals = []) {
314317

315318
async function runIsolatedTests() {
316319
// Check if there are any isolated tests
317-
const { existsSync } = await import('node:fs')
318320
const { glob } = await import('fast-glob')
319321

320322
const isolatedTests = await glob('test/**/*.isolated.test.mts', {

0 commit comments

Comments
 (0)