Skip to content

Commit cfbfdbc

Browse files
committed
chore(release): bump socket-lib to v2.10.4
- Add safe directory creation utilities (safeMkdir/safeMkdirSync) - Refactor DLX modules to use getFs() lazy-loading pattern - Replace 'node:' prefixed imports with bare imports - Restore v1.x environment variable fallback chains
1 parent 12c6cb9 commit cfbfdbc

2 files changed

Lines changed: 34 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,39 @@ 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+
## [2.10.4](https://github.com/SocketDev/socket-lib/releases/tag/v2.10.4) - 2025-10-31
9+
10+
### Added
11+
12+
- **Safe directory creation utilities**: Added `safeMkdir()` and `safeMkdirSync()` functions to the `fs` module that gracefully handle concurrent directory creation
13+
- Automatically ignores `EEXIST` errors when directory already exists (prevents race conditions)
14+
- Re-throws all other errors for proper error handling
15+
- Uses TypeScript `unknown` type for proper type narrowing in error handling
16+
- Exported from `@socketsecurity/lib/fs`
17+
18+
### Changed
19+
20+
- **DLX modules now use lazy-loaded file system access**: Refactored `dlx.ts`, `dlx-package.ts`, and `dlx-binary.ts` to use `getFs()` pattern for better bundler compatibility
21+
- Prevents Webpack bundling errors with Node.js built-in modules
22+
- Lazy initialization of `fs` module only when needed
23+
- Maintains consistent pattern across entire DLX subsystem
24+
- **Consistent bare imports for Node.js built-ins**: Replaced all `'node:'` prefixed imports with bare imports (e.g., `'node:fs'``'fs'`) across 17 source files
25+
- Better compatibility with legacy bundlers and build tools
26+
- Maintains functionality while improving tooling support
27+
- **All directory creation now uses safe utilities**: Updated all `fs.promises.mkdir()` and `fs.mkdirSync()` calls to use `safeMkdir()` and `safeMkdirSync()` throughout DLX modules
28+
- Eliminates manual `EEXIST` error handling code duplication
29+
- Cleaner, more maintainable codebase
30+
31+
### Fixed
32+
33+
- **v1.x environment variable backward compatibility**: Restored complete environment variable fallback chains from CLI v1.1.25
34+
- `SOCKET_CLI_API_BASE_URL` now falls back to `SOCKET_SECURITY_API_BASE_URL`
35+
- `SOCKET_CLI_API_PROXY` has 6-level fallback chain (including HTTPS_PROXY, https_proxy, HTTP_PROXY, http_proxy)
36+
- `SOCKET_CLI_API_TOKEN` has 4-level fallback chain (SOCKET_CLI_API_KEY, SOCKET_SECURITY_API_TOKEN, SOCKET_SECURITY_API_KEY)
37+
- `SOCKET_CLI_ORG_SLUG` falls back to `SOCKET_ORG_SLUG`
38+
- `SOCKET_CLI_GITHUB_TOKEN` has 3-level fallback chain (SOCKET_SECURITY_GITHUB_PAT, GITHUB_TOKEN)
39+
- Ensures seamless migration from CLI v1.x to v2.x
40+
841
## [2.10.3](https://github.com/SocketDev/socket-lib/releases/tag/v2.10.3) - 2025-10-31
942

1043
### Fixed

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": "2.10.3",
3+
"version": "2.10.4",
44
"license": "MIT",
55
"description": "Core utilities and infrastructure for Socket.dev security tools",
66
"keywords": [

0 commit comments

Comments
 (0)