Skip to content

Commit 6d546b6

Browse files
committed
fix(scripts): use #socketsecurity/lib path alias for stable imports
Scripts were using inconsistent import patterns (@socketsecurity/lib vs #socketsecurity/lib), causing lint failures in CI. The lint job runs before build, so self-referential @socketsecurity/lib imports fail when dist/ doesn't exist yet. Changed all script imports to use #socketsecurity/lib/* which maps to the stable external package @socketsecurity/lib-stable/* via package.json imports field.
1 parent e99cbc7 commit 6d546b6

File tree

5 files changed

+36
-5
lines changed

5 files changed

+36
-5
lines changed

CHANGELOG.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,37 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [3.2.1](https://github.com/SocketDev/socket-lib/releases/tag/v3.2.1) - 2025-11-02
9+
10+
### Changed
11+
12+
- **Logger/Spinner**: Use module-level constants to prevent duplicate instances
13+
- Call `getDefaultLogger()` and `getDefaultSpinner()` once at module scope
14+
- Reduces function call overhead and prevents multiple instance creation
15+
- Applied in `src/dlx-manifest.ts`, `src/stdio/mask.ts`, and `src/spinner.ts`
16+
- Follows DRY principle and aligns with socket-registry/socket-sdk-js patterns
17+
18+
### Fixed
19+
20+
- **Scripts**: Fixed undefined logger variable in update script
21+
- Replaced undefined `log` references with `_logger` throughout `scripts/update.mjs`
22+
- Resolves ESLint errors that blocked test execution
23+
- **Tests**: Improved stdout test stability by checking call delta instead of absolute counts
24+
- Fixed flaky CI failures where spy call count was 101 instead of expected 100
25+
- More robust approach handles potential state leakage between tests
26+
- **Tests**: Removed unnecessary 10ms delay in cache-with-ttl test
27+
- Cache with memoization enabled updates in-memory storage synchronously
28+
- Delay was insufficient in CI and unnecessary given synchronous behavior
29+
- Resolves flaky CI failures where cached values returned undefined
30+
31+
## [3.2.0](https://github.com/SocketDev/socket-lib/releases/tag/v3.2.0) - 2025-11-02
32+
33+
### Added
34+
35+
- **DLX**: Unified manifest for packages and binaries
36+
- Centralized manifest system for tracking DLX-compatible packages
37+
- Simplifies package and binary lookups for dependency-free execution
38+
839
## [3.1.3](https://github.com/SocketDev/socket-lib/releases/tag/v3.1.3) - 2025-11-02
940

1041
### Changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@socketsecurity/lib",
3-
"version": "3.2.0",
3+
"version": "3.2.1",
44
"license": "MIT",
55
"description": "Core utilities and infrastructure for Socket.dev security tools",
66
"keywords": [

scripts/test.mjs

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

1111
import { getDefaultLogger } from '#socketsecurity/lib/logger'
12-
import { getDefaultSpinner } from '@socketsecurity/lib/spinner'
12+
import { getDefaultSpinner } from '#socketsecurity/lib/spinner'
1313
import { printHeader } from '#socketsecurity/lib/stdio/header'
1414

1515
import { getLocalPackageAliases } from './utils/get-local-package-aliases.mjs'

scripts/utils/changed-test-mapper.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import path from 'node:path'
99
import {
1010
getChangedFilesSync,
1111
getStagedFilesSync,
12-
} from '@socketsecurity/lib/git'
13-
import { normalizePath } from '@socketsecurity/lib/path'
12+
} from '#socketsecurity/lib/git'
13+
import { normalizePath } from '#socketsecurity/lib/path'
1414

1515
const rootPath = path.resolve(process.cwd())
1616

scripts/utils/interactive-runner.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Standardized across all socket-* repositories.
44
*/
55

6-
import { runWithMask } from '@socketsecurity/lib/stdio/mask'
6+
import { runWithMask } from '#socketsecurity/lib/stdio/mask'
77

88
/**
99
* Run a command with interactive output control.

0 commit comments

Comments
 (0)