@socketsecurity/lib 5.26.0 → 5.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (183) hide show
  1. package/CHANGELOG.md +371 -1185
  2. package/README.md +1 -1
  3. package/dist/abort.js +7 -6
  4. package/dist/agent.js +16 -15
  5. package/dist/ansi.js +3 -2
  6. package/dist/archives.js +18 -17
  7. package/dist/argv/flags.js +29 -28
  8. package/dist/argv/parse.js +4 -3
  9. package/dist/arrays.js +3 -2
  10. package/dist/bin.js +12 -11
  11. package/dist/cacache.js +16 -11
  12. package/dist/cache-with-ttl.js +26 -21
  13. package/dist/colors.js +2 -1
  14. package/dist/constants/licenses.js +2 -1
  15. package/dist/constants/lifecycle-script-names.js +2 -1
  16. package/dist/constants/maintained-node-versions.js +2 -1
  17. package/dist/constants/node.js +4 -3
  18. package/dist/constants/package-default-socket-categories.js +2 -1
  19. package/dist/constants/packages.js +4 -3
  20. package/dist/constants/socket.js +1 -1
  21. package/dist/cover/code.js +9 -8
  22. package/dist/cover/formatters.js +12 -11
  23. package/dist/cover/type.js +5 -4
  24. package/dist/crypto.d.ts +36 -0
  25. package/dist/{effects/ultra.js → crypto.js} +26 -37
  26. package/dist/debug.js +12 -15
  27. package/dist/dlx/arborist.js +10 -9
  28. package/dist/dlx/binary.js +27 -24
  29. package/dist/dlx/cache.js +2 -10
  30. package/dist/dlx/detect.js +6 -5
  31. package/dist/dlx/integrity.js +13 -11
  32. package/dist/dlx/lockfile.js +7 -6
  33. package/dist/dlx/manifest.js +6 -5
  34. package/dist/dlx/package.js +17 -16
  35. package/dist/dlx/packages.js +6 -5
  36. package/dist/dlx/paths.d.ts +1 -1
  37. package/dist/dlx/paths.js +2 -1
  38. package/dist/effects/pulse-frames.js +4 -3
  39. package/dist/effects/shimmer-keyframes.d.ts +62 -0
  40. package/dist/effects/shimmer-keyframes.js +55 -0
  41. package/dist/effects/shimmer-terminal.d.ts +66 -0
  42. package/dist/effects/shimmer-terminal.js +57 -0
  43. package/dist/effects/shimmer.d.ts +293 -0
  44. package/dist/effects/shimmer.js +180 -0
  45. package/dist/env/rewire.js +4 -3
  46. package/dist/env.js +5 -4
  47. package/dist/errors.js +1 -1
  48. package/dist/external/@npmcli/package-json/lib/read-package.js +10 -10
  49. package/dist/external/@npmcli/package-json.js +372 -372
  50. package/dist/external/@npmcli/promise-spawn.js +24 -24
  51. package/dist/external/@socketregistry/packageurl-js.js +19 -18
  52. package/dist/external/@socketregistry/yocto-spinner.js +4 -3
  53. package/dist/external/@yarnpkg/extensions.js +2 -1
  54. package/dist/external/adm-zip.js +71 -71
  55. package/dist/external/debug.js +22 -22
  56. package/dist/external/external-pack.js +45 -45
  57. package/dist/external/fast-sort.js +5 -5
  58. package/dist/external/libnpmexec.js +4 -3
  59. package/dist/external/npm-pack.js +369 -369
  60. package/dist/external/p-map.js +9 -9
  61. package/dist/external/pico-pack.js +190 -190
  62. package/dist/external/pony-cause.js +2 -1
  63. package/dist/external/spdx-pack.js +11 -10
  64. package/dist/external/tar-fs.js +58 -58
  65. package/dist/external/which.js +13 -13
  66. package/dist/external/yargs-parser.js +71 -71
  67. package/dist/fs.js +50 -68
  68. package/dist/git.js +14 -13
  69. package/dist/github.d.ts +34 -0
  70. package/dist/github.js +248 -23
  71. package/dist/globs.d.ts +20 -0
  72. package/dist/globs.js +134 -25
  73. package/dist/http-request.d.ts +4 -3
  74. package/dist/http-request.js +39 -32
  75. package/dist/ipc-cli.js +2 -1
  76. package/dist/ipc.js +5 -4
  77. package/dist/json/edit.js +4 -3
  78. package/dist/json/format.js +3 -2
  79. package/dist/json/parse.js +7 -6
  80. package/dist/links.js +2 -1
  81. package/dist/logger.js +21 -14
  82. package/dist/memoization.js +16 -15
  83. package/dist/node/async-hooks.d.ts +6 -0
  84. package/dist/node/async-hooks.js +34 -0
  85. package/dist/node/child-process.d.ts +11 -0
  86. package/dist/node/child-process.js +34 -0
  87. package/dist/node/crypto.d.ts +6 -0
  88. package/dist/node/crypto.js +34 -0
  89. package/dist/node/events.d.ts +6 -0
  90. package/dist/node/events.js +34 -0
  91. package/dist/node/fs-promises.d.ts +6 -0
  92. package/dist/node/fs-promises.js +34 -0
  93. package/dist/node/fs.d.ts +14 -0
  94. package/dist/node/fs.js +34 -0
  95. package/dist/node/http.d.ts +6 -0
  96. package/dist/node/http.js +34 -0
  97. package/dist/node/https.d.ts +6 -0
  98. package/dist/node/https.js +34 -0
  99. package/dist/node/os.d.ts +6 -0
  100. package/dist/node/os.js +34 -0
  101. package/dist/node/path.d.ts +6 -0
  102. package/dist/node/path.js +34 -0
  103. package/dist/node/timers-promises.d.ts +6 -0
  104. package/dist/node/timers-promises.js +34 -0
  105. package/dist/node/url.d.ts +6 -0
  106. package/dist/node/url.js +34 -0
  107. package/dist/node/util.d.ts +6 -0
  108. package/dist/node/util.js +34 -0
  109. package/dist/objects.js +2 -2
  110. package/dist/packages/edit.js +8 -7
  111. package/dist/packages/exports.js +17 -16
  112. package/dist/packages/isolation.js +20 -13
  113. package/dist/packages/licenses.js +6 -3
  114. package/dist/packages/manifest.js +2 -1
  115. package/dist/packages/normalize.js +8 -4
  116. package/dist/packages/operations.js +5 -4
  117. package/dist/packages/provenance.js +7 -6
  118. package/dist/packages/specs.js +2 -1
  119. package/dist/packages/validation.js +2 -1
  120. package/dist/paths/normalize.js +32 -40
  121. package/dist/paths/packages.js +2 -1
  122. package/dist/paths/rewire.js +3 -2
  123. package/dist/performance.js +19 -18
  124. package/dist/primordials.d.ts +85 -2
  125. package/dist/primordials.js +311 -23
  126. package/dist/process-lock.js +14 -13
  127. package/dist/promise-queue.js +17 -9
  128. package/dist/promises.d.ts +29 -6
  129. package/dist/promises.js +19 -15
  130. package/dist/regexps.js +9 -8
  131. package/dist/releases/github-api.d.ts +56 -0
  132. package/dist/releases/github-api.js +275 -0
  133. package/dist/releases/github-archives.d.ts +60 -0
  134. package/dist/releases/github-archives.js +136 -0
  135. package/dist/releases/github-assets.d.ts +21 -0
  136. package/dist/releases/github-assets.js +52 -0
  137. package/dist/releases/github-auth.d.ts +16 -0
  138. package/dist/releases/github-auth.js +51 -0
  139. package/dist/releases/github-downloads.d.ts +42 -0
  140. package/dist/releases/github-downloads.js +155 -0
  141. package/dist/releases/github-types.d.ts +66 -0
  142. package/dist/{effects/types.js → releases/github-types.js} +2 -2
  143. package/dist/releases/socket-btm.d.ts +1 -1
  144. package/dist/releases/socket-btm.js +17 -17
  145. package/dist/schema/parse.js +2 -1
  146. package/dist/schema/validate.js +6 -5
  147. package/dist/sea/util.d.ts +43 -0
  148. package/dist/{sea.js → sea/util.js} +7 -7
  149. package/dist/shadow.js +2 -1
  150. package/dist/signal-exit.js +2 -2
  151. package/dist/smol/primordial.d.ts +80 -0
  152. package/dist/smol/primordial.js +46 -0
  153. package/dist/smol/util.d.ts +87 -0
  154. package/dist/smol/util.js +59 -0
  155. package/dist/smol/versions.d.ts +46 -0
  156. package/dist/smol/versions.js +46 -0
  157. package/dist/spawn.js +58 -63
  158. package/dist/spinner.d.ts +13 -6
  159. package/dist/spinner.js +75 -57
  160. package/dist/ssri.js +8 -7
  161. package/dist/stdio/footer.js +13 -12
  162. package/dist/stdio/header.js +5 -4
  163. package/dist/stdio/progress.js +13 -12
  164. package/dist/strings.js +19 -18
  165. package/dist/suppress-warnings.js +2 -2
  166. package/dist/tables.js +16 -13
  167. package/dist/temporary-executor.js +2 -1
  168. package/dist/themes/context.js +2 -1
  169. package/dist/themes/types.d.ts +1 -1
  170. package/dist/themes/utils.d.ts +8 -3
  171. package/dist/themes/utils.js +29 -5
  172. package/dist/url.js +4 -3
  173. package/dist/versions.js +27 -22
  174. package/package.json +120 -26
  175. package/dist/effects/text-shimmer.d.ts +0 -58
  176. package/dist/effects/text-shimmer.js +0 -192
  177. package/dist/effects/types.d.ts +0 -47
  178. package/dist/effects/ultra.d.ts +0 -22
  179. package/dist/releases/github.d.ts +0 -234
  180. package/dist/releases/github.js +0 -417
  181. package/dist/sea.d.ts +0 -30
  182. package/dist/themes/index.d.ts +0 -49
  183. package/dist/themes/index.js +0 -60
package/CHANGELOG.md CHANGED
@@ -5,1573 +5,1028 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
- ## [5.26.0](https://github.com/SocketDev/socket-lib/releases/tag/v5.26.0) - 2026-04-26
8
+ ## [5.27.0](https://github.com/SocketDev/socket-lib/releases/tag/v5.27.0) - 2026-05-04
9
+
10
+ ### Added
11
+
12
+ - **45 new `primordials` exports** rounding out the surface to 296 total:
13
+ - `BigIntCtor`
14
+ - Math: 24 methods (Acos, Atan2, Hypot, Pow, etc.) + 8 constants (E, PI, SQRT2, etc.); `MathF16round` typed `| undefined` for ES2025
15
+ - Number constants: `EPSILON`, `MAX_SAFE_INTEGER`, `MAX_VALUE`, `MIN_SAFE_INTEGER`, `MIN_VALUE`, `NEGATIVE_INFINITY`, `POSITIVE_INFINITY`
16
+ - Symbol: 10 well-knowns (`HasInstance`, `KeyFor`, `Match`, `Species`, etc.); `SymbolAsyncDispose` / `SymbolDispose` typed `| undefined` for ES2024; prototype helpers (`Description`, `ToString`, `ValueOf`)
17
+ - Function: `FunctionPrototypeToString`
18
+ - Array (ES2023 Change Array By Copy): `ArrayPrototypeToSpliced`, `ArrayPrototypeWith`
19
+ - Globals: `InfinityValue`, `NaNValue`, `globalThisRef`
20
+ - Object (annex B): `ObjectPrototype{Define,Lookup}{Getter,Setter}`
21
+ - Error (V8 stack-trace API, `| undefined`): `ErrorCaptureStackTrace`, `ErrorPrepareStackTrace`, `ErrorStackTraceLimit` (function-shaped, reads live value)
22
+
23
+ - **`smol/*` (new exports)** — feature-detect + lazy-loaders for socket-btm's smol Node binary:
24
+ - `smol/detect` — `isSmol()`: memoized boolean, mirrors `isSeaBinary()`
25
+ - `smol/util` — `getSmolUtil()`: native `uncurryThis` / `applyBind` (~2x faster), or `undefined`
26
+ - `smol/primordial` — `getSmolPrimordial()`: V8 Fast API typed `Math.*` / `Number.is*` (~30-50% faster on hot loops), or `undefined`
27
+ - `primordials` transparently routes through these on smol; **zero call-site changes**, identical behavior on stock Node, smol, browsers, Deno, Bun
28
+
29
+ - **`node/*` (new exports)** — per-builtin lazy-loaders for `node:*` modules. Each is `/*@__NO_SIDE_EFFECTS__*/`-marked so bundlers tree-shake the `require()` when unused:
30
+ - `node/fs` (`getNodeFs`), `node/path` (`getNodePath`), `node/crypto` (`getNodeCrypto`), `node/http` (`getNodeHttp`), `node/https` (`getNodeHttps`), `node/os` (`getNodeOs`), `node/util` (`getNodeUtil`), `node/url` (`getNodeUrl`), `node/events` (`getNodeEvents`)
31
+ - `node/child-process` (`getNodeChildProcess`), `node/async-hooks` (`getNodeAsyncHooks`), `node/fs-promises` (`getNodeFsPromises`), `node/timers-promises` (`getNodeTimersPromises`)
32
+ - Replaces ~30 ad-hoc copies of the same lazy-loader boilerplate previously scattered across `http-request.ts`, `spawn.ts`, `fs.ts`, `crypto.ts`, etc.
33
+
34
+ ## [5.26.1](https://github.com/SocketDev/socket-lib/releases/tag/v5.26.1) - 2026-05-01
35
+
36
+ ### Added
37
+
38
+ - `crypto` (new export) — `hash(algorithm, data, encoding)` one-shot helper that prefers Node's native `crypto.hash` (added v21.7.0 / v20.12.0; ~30% faster than `createHash().update().digest()` on small inputs) with a streaming fallback. `getNativeHash` exposed as `@internal` for tests
39
+ - `promises` `fromAsync<T>(source)` — drains an async iterable into an array, per [TC39 Array.fromAsync](https://tc39.es/proposal-array-from-async/). Backed by the new `ArrayFromAsync` primordial (Node 22+) with a `for await` + push fallback
40
+ - `primordials` `ArrayFromAsync` — ES2024 primordial. Unbound, matching `ArrayFrom`
41
+ - `globs` `glob` / `globSync` route through `node:fs.glob` / `node:fs.globSync` (Node 22+) when caller options reduce to `cwd` + `ignore` (mapped to `exclude`); fall back to fast-glob for the wider option surface. Output paths are normalized to forward slashes on Windows to match fast-glob's contract
42
+ - `effects/shimmer` — pure-functional shimmer engine
43
+ - `effects/shimmer-terminal` — terminal (ANSI) renderer for the engine
44
+ - `effects/shimmer-keyframes` — SVG keyframe batcher for the engine
45
+ - `releases/github-types`, `github-assets`, `github-auth`, `github-api`, `github-downloads`, `github-archives` — six focused submodules replacing the single `releases/github` export
46
+
47
+ ### Changed
48
+
49
+ - `http-request` retry/backoff sites use `setTimeout` from `node:timers/promises` instead of hand-rolled `new Promise(r => setTimeout(r, ms))`
50
+ - `dlx/cache`, `dlx/integrity`, `dlx/binary` — 4 one-shot hash sites switched to the new `crypto.hash()` helper
51
+ - `package.json` — pin `publishConfig: {access: "public", provenance: true}` so attestation is a property of the package, not a property of the workflow's `--provenance` CLI flag. Survives any direct-publish path that bypasses `provenance.yml`. `access: "public"` also load-bears for first-publish of `@scoped` packages on a fresh npm registry session.
52
+ - `promise-queue.runNext` — replace the `PromiseResolve().then().catch().finally()` chain with an async IIFE + try/catch/finally. Same semantics (defers `task.fn()` by one microtask so synchronous throws become rejections), more explicit about the success/error/cleanup flow.
53
+ - `packages/isolation.resolveRealPath` — replace `realpath().catch(fallback)` with try/await/catch. Same fall-back-on-ENOENT behavior, clearer that the catch is intentional.
54
+ - **BREAKING**: `spinner` `ShimmerInfo` shape — `{ direction, speed, frame }` (was: `currentDir`, `mode`, `speed`, `step`). User-facing `ShimmerConfig` is unchanged
55
+ - `getLatestRelease` / `getReleaseAssetUrl` return `undefined` (was: `null`) when no result is found, and no longer log on success/retry — errors throw, success returns
56
+
57
+ ### Removed
58
+
59
+ - **BREAKING**: `effects/text-shimmer`, `effects/ultra`, `effects/types` subpath exports. Migrate to `effects/shimmer` (+ `effects/shimmer-terminal`); `RAINBOW_GRADIENT` now lives in `themes/utils`
60
+ - **BREAKING**: `themes` barrel export. Import from `themes/themes`, `themes/context`, `themes/utils`, or `themes/types`
61
+ - **BREAKING**: `releases/github` subpath export. Migrate to the focused submodules (see Added)
62
+ - `getLatestRelease({ quiet })` / `getReleaseAssetUrl({ quiet })` — the helpers no longer log
9
63
 
10
64
  ### Fixed
11
65
 
12
- - `@socketsecurity/lib/primordials` `StringPrototypeReplace` / `StringPrototypeReplaceAll` `replaceValue` parameter now accepts the callback form (`(substring, ...args) => string`) in addition to a literal string, matching `String.prototype.replace`'s actual signature
66
+ - `globs` `getGlobMatcher` narrow the `path.matchesGlob` fast-path that an earlier draft introduced. `path.matchesGlob` doesn't honor the picomatch defaults (`dot: true`, `nocase: true`) that callers expect, so taking the fast-path under those defaults silently changed observable behavior — including breaking the case-insensitive default everywhere a single-pattern matcher was used. The fast-path now activates only when the caller has explicitly opted out of both defaults (`nocase: false` AND `dot: false`), signaling "I want strict, case-sensitive, no-dotfile-match" — exactly what `path.matchesGlob` provides
67
+ - `globs` `glob` / `globSync` — normalize results to forward slashes via `paths/normalize.normalizePath` regardless of which backend (`node:fs.glob` or `fast-glob`) was used. Restores fast-glob's forward-slash contract on Windows, where `node:fs.glob` returns native-OS separators
68
+ - `globs` `glob` / `globSync` / `globStreamLicenses` — strip a trailing `/` from `ignore` patterns before passing them to fast-glob. The gitignore convention of writing directory entries as `dist/` was silently dropped at the deep-filter level (fast-glob walked the entire subtree before discarding results), which on a large `dist/` could push memory past the limit. fast-glob v3.3.3 and the unreleased v4 both have the bug; tracked at [mrmlnc/fast-glob#437](https://github.com/mrmlnc/fast-glob/issues/437). Same workaround as [SocketDev/socket-cli#1288](https://github.com/SocketDev/socket-cli/pull/1288).
69
+ - `releases/github-api` `getLatestRelease` and `getReleaseAssetUrl` transparently fall back to GraphQL when GitHub REST returns 200 + empty body (search-degraded incident shape)
70
+ - `github` `resolveRefToSha` and `fetchGhsaDetails` get the same GraphQL fallback for the same incident shape
71
+ - All fallbacks only fire on the empty-body signature; real 404s, rate-limits, and 5xx still propagate
72
+
73
+ ## [5.26.0](https://github.com/SocketDev/socket-lib/releases/tag/v5.26.0) - 2026-04-27
74
+
75
+ ### Added
76
+
77
+ - `github` `GitHubEmptyBodyError` — exported error class for GitHub's "search degraded" 200 OK + empty body incident shape
78
+ - `nothrow` option on `getLatestRelease` and `getReleaseAssetUrl` — return `undefined` instead of throwing when both REST and GraphQL backends are degraded
79
+
80
+ ### Changed
81
+
82
+ - `getLatestRelease` / `getReleaseAssetUrl` return `undefined` (was: `null`) when no result is found, and no longer log on success/retry — errors throw, success returns
83
+ - `fetchGhsaDetails` GraphQL fallback normalizes severity to lowercase to match REST shape
84
+
85
+ ### Removed
86
+
87
+ - `getLatestRelease({ quiet })` / `getReleaseAssetUrl({ quiet })` — no longer accepted (the helpers don't log anymore)
88
+
89
+ ### Fixed
90
+
91
+ - `releases/github` `getLatestRelease` and `getReleaseAssetUrl` fall back to GraphQL on the empty-body incident shape
92
+ - `github` `resolveRefToSha` and `fetchGhsaDetails` get the same GraphQL fallback
93
+ - All fallbacks fire only on `GitHubEmptyBodyError`; real 404s / rate-limits / 5xx still propagate
94
+
95
+ ## [5.25.1](https://github.com/SocketDev/socket-lib/releases/tag/v5.25.1) - 2026-04-27
96
+
97
+ ### Fixed
98
+
99
+ - `primordials` `StringPrototypeReplace` / `StringPrototypeReplaceAll` — `replaceValue` accepts the callback form, matching `String.prototype.replace`
13
100
 
14
101
  ## [5.25.0](https://github.com/SocketDev/socket-lib/releases/tag/v5.25.0) - 2026-04-26
15
102
 
16
103
  ### Added
17
104
 
18
- - `@socketsecurity/lib/primordials` — new public module exposing safe references to ~100 built-in constructors, static methods, and prototype methods captured at module-load time. Mirrors the Node.js-internal primordials convention: static methods retain their name (`ObjectKeys`, `ArrayIsArray`, `JSONParse`, `ReflectApply`); prototype methods are uncurried via `uncurryThis` (`StringPrototypeSlice(str, 0, 3)` instead of `str.slice(0, 3)`); constructors get a `Ctor` suffix (`MapCtor`, `SetCtor`, `ErrorCtor`, …) to avoid shadowing the capital-case global. Library internals migrated to use these helpers so prototype-pollution attacks on the caller realm can't redirect them. Surface includes `Function`, `Math`, and the full Error subclass set (`TypeErrorCtor`, `RangeErrorCtor`, `SyntaxErrorCtor`, `ReferenceErrorCtor`, `URIErrorCtor`, `EvalErrorCtor`, `AggregateErrorCtor`) after audit-driven coverage passes
105
+ - `primordials` — public module exposing ~100 safe references to built-in constructors, static methods, and prototype methods captured at load time. Static methods keep their name (`ObjectKeys`, `JSONParse`); prototype methods are uncurried (`StringPrototypeSlice(str, 0, 3)`); constructors use a `Ctor` suffix (`MapCtor`, `ErrorCtor`)
19
106
 
20
107
  ## [5.24.0](https://github.com/SocketDev/socket-lib/releases/tag/v5.24.0) - 2026-04-22
21
108
 
22
109
  ### Removed
23
110
 
24
- - `@socketsecurity/lib/env/socket-cli-shadow` — deleted. Unused after Socket CLI's shadow infrastructure was removed
111
+ - `env/socket-cli-shadow` — deleted (unused)
25
112
 
26
113
  ### Fixed
27
114
 
28
- - `packPackage()` / `extractPackage()` now work for non-registry specs (local dir/tarball, remote tarball URL, git). The bundled pacote fetchers (`dir.js`, `file.js`, `remote.js`, `git.js`) were over-stubbed and broke every non-registry path
29
- - `EditablePackageJson.prepare()` no longer throws `git.find is not a function`. `@npmcli/git` is reached from `normalize.gitHead`, not just `arb.audit()`, so it can't be stubbed
30
- - `packPackage(<dir>)` now runs `prepack` / `postpack` scripts instead of throwing `runScript is not a function`. `@npmcli/run-script` is reachable whenever `ignoreScripts` isn't set
115
+ - `packPackage()` / `extractPackage()` work for non-registry specs (local dir/tarball, remote tarball, git)
116
+ - `EditablePackageJson.prepare()` no longer throws `git.find is not a function`
117
+ - `packPackage(<dir>)` runs `prepack` / `postpack` scripts instead of throwing
31
118
 
32
119
  ## [5.23.0](https://github.com/SocketDev/socket-lib/releases/tag/v5.23.0) - 2026-04-22
33
120
 
34
121
  ### Added
35
122
 
36
- - `@socketsecurity/lib/errors` `isError(value)` — spec-compliant ES2025 [`Error.isError`](https://tc39.es/ecma262/#sec-error.iserror) with an `@@toStringTag`-based shim for older engines. Recognizes cross-realm Errors (worker threads, vm contexts, iframes) that same-realm `instanceof Error` misses
37
- - `@socketsecurity/lib/errors` `errorMessage(value)` — extracts a readable message from any caught value (Error with cause chain via `messageWithCauses`, primitive, plain object, or nullish) with the shared `UNKNOWN_ERROR` (`'Unknown error'`) fallback. Replaces the `e instanceof Error ? e.message : String(e)` pattern
38
- - `@socketsecurity/lib/errors` `errorStack(value)` — companion helper returning the cause-aware stack for Error instances (via `stackWithCauses`) and `undefined` otherwise
39
- - `@socketsecurity/lib/errors` `isErrnoException(value)` — narrows to `NodeJS.ErrnoException` (an Error with a non-empty uppercase-prefixed `.code`, matching the libuv `UV_E*` / Node `ERR_*` conventions), cross-realm safe
40
- - `@socketsecurity/lib/errors` re-exports `UNKNOWN_ERROR` from `constants/core` so callers don't need a separate import
123
+ - `errors` `isError(value)` — spec-compliant ES2025 [`Error.isError`](https://tc39.es/ecma262/#sec-error.iserror), cross-realm safe
124
+ - `errors` `errorMessage(value)` — readable message from any caught value (Error, primitive, object, nullish) with cause-chain support
125
+ - `errors` `errorStack(value)` — cause-aware stack or `undefined`
126
+ - `errors` `isErrnoException(value)` — narrows to `NodeJS.ErrnoException`, cross-realm safe
127
+ - `errors` re-exports `UNKNOWN_ERROR`
41
128
 
42
129
  ### Changed
43
130
 
44
- - `@socketsecurity/lib/errors` pony-cause `messageWithCauses` / `stackWithCauses` / `findCauseByReference` / `getErrorCause` — patched to use `isError` internally so cross-realm Errors are recognized (previously returned `''` for any Error thrown in a different realm)
131
+ - pony-cause `messageWithCauses` / `stackWithCauses` / `findCauseByReference` / `getErrorCause` use `isError` internally cross-realm Errors are recognized (previously returned `''`)
45
132
 
46
133
  ## [5.22.0](https://github.com/SocketDev/socket-lib/releases/tag/v5.22.0) - 2026-04-21
47
134
 
48
135
  ### Changed
49
136
 
50
- - `@socketsecurity/lib/releases/socket-btm` `getPlatformArch()` / `getBinaryAssetName()` — aligned with pnpm pack-app's `<os>-<arch>[-<libc>]` target format. The Windows OS segment is now `win32` (was `win`); `getPlatformArch('win32', 'x64')` returns `'win32-x64'` and `getBinaryAssetName('node', 'win32', 'x64')` returns `'node-win32-x64.exe'`. Callers that string-match on the output need updates
137
+ - `releases/socket-btm` `getPlatformArch()` / `getBinaryAssetName()` — aligned with pnpm pack-app's `<os>-<arch>[-<libc>]` format. Windows OS segment is now `win32` (was `win`)
51
138
 
52
139
  ## [5.21.0](https://github.com/SocketDev/socket-lib/releases/tag/v5.21.0) - 2026-04-20
53
140
 
54
141
  ### Added
55
142
 
56
- - `@socketsecurity/lib/schema/validate` — non-throwing Zod/TypeBox validator returning `{ ok, value } | { ok, errors }` with normalized paths
57
- - `@socketsecurity/lib/schema/parse` — throwing variant for fail-fast trust boundaries
58
- - `@socketsecurity/lib/schema/types` — `Schema<T>`, `ValidateResult<T>`, `ValidationIssue`, `AnySchema`, `Infer<S>`
59
- - `@socketsecurity/lib/promises` `withResolvers()` — spec-compliant [`Promise.withResolvers`](https://tc39.es/ecma262/#sec-promise.withResolvers) helper with `PromiseWithResolvers<T>` type. Uses the native implementation when available
143
+ - `schema/validate` — non-throwing Zod/TypeBox validator returning `{ ok, value } | { ok, errors }`
144
+ - `schema/parse` — throwing variant for fail-fast trust boundaries
145
+ - `schema/types` — `Schema<T>`, `ValidateResult<T>`, `ValidationIssue`, `AnySchema`, `Infer<S>`
146
+ - `promises` `withResolvers()` — spec-compliant [`Promise.withResolvers`](https://tc39.es/ecma262/#sec-promise.withResolvers); uses native when available
60
147
 
61
148
  ### Changed
62
149
 
63
- - `@socketsecurity/lib/regexps` `escapeRegExp()` — now spec-compliant with TC39 [`RegExp.escape`](https://tc39.es/ecma262/#sec-regexp.escape); uses the native implementation when available. **Caller-visible shape change**: escaped output now uses `\xHH` for many characters that previously passed through literally (e.g. `escapeRegExp('a')` is now `'\x61'`). Functional equivalence (the compiled regex matches the original input) is preserved; only callers that string-match on escape output need updates
64
- - `@socketsecurity/lib/memoization` `MemoizeOptions<Args>` — dropped the unused second type parameter. Consumers who wrote `MemoizeOptions<Args, Result>` must drop the second argument
65
- - `@socketsecurity/lib/packages/specs` `getRepoUrlDetails()` — now accepts `git+https://` / `git+ssh://` GitHub URLs and rejects lookalike hosts (`githubXcom`, `fake-github.com.attacker.tld`). scp-style `git@github.com:…` URLs (no `://`) now return `{ user: '', project: '' }` — callers must normalize to https/ssh upstream
66
- - `@socketsecurity/lib/url` `urlSearchParamAsBoolean()` — accepts the same truthy vocabulary as `envAsBoolean` (`1` / `true` / `yes` / `on`, case-insensitive). Empty-string input now falls through to `defaultValue` instead of returning `false`
150
+ - `regexps` `escapeRegExp()` — now spec-compliant with TC39 [`RegExp.escape`](https://tc39.es/ecma262/#sec-regexp.escape). **Output shape changed**: many characters now escape to `\xHH` (e.g. `'a'` `'\x61'`); compiled regex behavior is preserved
151
+ - `memoization` `MemoizeOptions<Args>` — dropped unused second type parameter
152
+ - `packages/specs` `getRepoUrlDetails()` — accepts `git+https://` / `git+ssh://` GitHub URLs; rejects lookalike hosts. scp-style `git@github.com:…` returns `{ user: '', project: '' }`
153
+ - `url` `urlSearchParamAsBoolean()` — accepts the same truthy vocabulary as `envAsBoolean` (`1` / `true` / `yes` / `on`); empty string falls through to `defaultValue`
67
154
 
68
155
  ### Removed
69
156
 
70
- - `@socketsecurity/lib/validation/*` subpath retired — exports re-homed:
71
- - `validateSchema` / `parseSchema` `@socketsecurity/lib/schema/validate` / `@socketsecurity/lib/schema/parse`
72
- - `safeJsonParse` → `@socketsecurity/lib/json/parse`
73
- - Types → `@socketsecurity/lib/schema/types` and `@socketsecurity/lib/json/types`
74
- - `memoizeDebounced` from `@socketsecurity/lib/memoization` — was misnamed and had no consumers. Use `memoize` / `memoizeAsync` with a `ttl` instead
157
+ - `validation/*` subpath retired — exports re-homed: `validateSchema` / `parseSchema` → `schema/validate` / `schema/parse`; `safeJsonParse` → `json/parse`; types → `schema/types` and `json/types`
158
+ - `memoization` `memoizeDebounced` use `memoize` / `memoizeAsync` with a `ttl` instead
75
159
 
76
160
  ### Fixed
77
161
 
78
- - `@socketsecurity/lib/versions` `maxVersion()` / `minVersion()` — return the latest/earliest prerelease for all-prerelease inputs (previously returned `undefined`)
79
- - `@socketsecurity/lib/fs` `findUp()` / `findUpSync()` — traverse up to and **including** the filesystem root (previously missed matches at `/.foo`)
80
- - `@socketsecurity/lib/words` `capitalize()` — safe for non-BMP characters (emoji, astral-plane scripts); previously produced broken surrogate pairs
81
- - `@socketsecurity/lib/words` `determineArticle()` — case-insensitive vowel match (`Apple` → `an Apple`)
82
- - `@socketsecurity/lib/archives` `extractZip()` / `extractTar()` / `extractTarGz()` — missing-archive errors now uniformly surface as `ENOENT` with `code` / `path` / message (previously `extractZip` surfaced adm-zip's generic `"Invalid filename"`)
83
- - `@socketsecurity/lib/promise-queue` — bounded queue now rejects the newest submission when full, preserving in-flight work
84
- - `@socketsecurity/lib/cacache` / `@socketsecurity/lib/cache-with-ttl` — wildcard key deletion anchors both ends of the pattern (`deleteAll('foo*bar')` no longer sweeps `foo123bar-extra`)
85
- - `@socketsecurity/lib/process-lock` — sub-second `staleMs` values now honored at full precision; TOCTOU window on lock acquisition closed
86
- - `@socketsecurity/lib/suppress-warnings` `withSuppressedWarnings()` — no longer wipes concurrent suppressions on exit
87
- - Unbounded LRU caches in `@socketsecurity/lib/dlx` capped (binary path, package.json path); negative package.json lookups now expire after 10s
88
- - Glob cache keys for array-valued options (e.g. `ignore`) are order-insensitive
162
+ - `versions` `maxVersion()` / `minVersion()` — return latest/earliest prerelease for all-prerelease inputs
163
+ - `fs` `findUp()` / `findUpSync()` — traverse up to and including the filesystem root
164
+ - `words` `capitalize()` — safe for non-BMP characters (emoji, astral-plane scripts)
165
+ - `words` `determineArticle()` — case-insensitive vowel match
166
+ - `archives` `extractZip` / `extractTar` / `extractTarGz` — missing-archive errors uniformly surface as `ENOENT`
167
+ - `promise-queue` — bounded queue rejects newest submission when full, preserving in-flight work
168
+ - `cacache` / `cache-with-ttl` — wildcard key deletion anchors both ends of the pattern
169
+ - `process-lock` — sub-second `staleMs` values honored at full precision; TOCTOU window on acquisition closed
170
+ - `suppress-warnings` `withSuppressedWarnings()` — no longer wipes concurrent suppressions on exit
171
+ - `dlx` LRU caches capped (binary path, package.json path); negative package.json lookups expire after 10s
172
+ - Glob cache keys for array-valued options are order-insensitive
89
173
 
90
174
  ### Performance
91
175
 
92
- - `@socketsecurity/lib/memoization` — `memoize()` / `memoizeAsync()` cache-hit bookkeeping dropped from O(n) to O(1). Noticeable on caches with many entries
93
- - `@socketsecurity/lib/cacache` wildcard `clear()` no longer recompiles the match regex per streamed entry
176
+ - `memoization` cache-hit bookkeeping is now O(1) (was O(n))
177
+ - `cacache` wildcard `clear()` no longer recompiles the match regex per entry
94
178
 
95
179
  ## [5.20.1](https://github.com/SocketDev/socket-lib/releases/tag/v5.20.1) - 2026-04-19
96
180
 
97
181
  ### Fixed
98
182
 
99
- - `@socketsecurity/lib/ipc` — harden stub-file writes against symlink/TOCTOU attacks on shared-tmp filesystems (POSIX ownership + mode validation, `O_EXCL | O_NOFOLLOW` open)
100
- - `@socketsecurity/lib/cache-with-ttl` `getOrFetch()` — close concurrent-caller race that let two cold-cache awaits both skip the inflight-dedupe check and fire the fetcher twice
101
- - `@socketsecurity/lib/cache-with-ttl` — cap the in-memory memo layer with LRU eviction (`memoMaxSize`, default 1000); long-running processes no longer grow unbounded
102
- - `@socketsecurity/lib/memoization` `memoizeAsync()` — refresh cache entry timestamp on resolve so slow fetches (longer than `ttl`) aren't classified as expired the moment they land
103
- - `@socketsecurity/lib/tables` — `displayWidth` now measures rendered terminal cells (via `stringWidth`) instead of UTF-16 code units; CJK / emoji / combining marks align correctly
104
- - `@socketsecurity/lib/paths/packages` — `resolvePackageJsonDirname` / `resolvePackageJsonPath` no longer mis-identify files like `/foo/my-package.json` as package manifests
105
- - `@socketsecurity/lib/json/edit` — `@example` import path corrected
183
+ - `ipc` — stub-file writes hardened against symlink/TOCTOU attacks (`O_EXCL | O_NOFOLLOW`, ownership + mode validation)
184
+ - `cache-with-ttl` `getOrFetch()` — closes concurrent-caller race that fired the fetcher twice
185
+ - `cache-with-ttl` — in-memory memo layer capped via LRU (`memoMaxSize`, default 1000)
186
+ - `memoization` `memoizeAsync()` — refreshes entry timestamp on resolve so slow fetches aren't immediately classified as expired
187
+ - `tables` — `displayWidth` measures rendered terminal cells via `stringWidth` (CJK / emoji / combining marks align correctly)
188
+ - `paths/packages` — `resolvePackageJsonDirname` / `resolvePackageJsonPath` no longer mis-identify files like `/foo/my-package.json`
106
189
 
107
190
  ## [5.20.0](https://github.com/SocketDev/socket-lib/releases/tag/v5.20.0) - 2026-04-19
108
191
 
109
192
  ### Added
110
193
 
111
- - `@socketsecurity/lib/validation/validate-schema` — universal Zod-style schema validator with `validateSchema` (tagged result) and `parseSchema` (throwing); `Infer<S>`, `ValidateResult<T>`, `ValidationIssue`, `AnySchema` types. No runtime `zod` dependency
194
+ - `validation/validate-schema` — universal Zod-style schema validator with `validateSchema` (tagged result) and `parseSchema` (throwing). No runtime `zod` dep
112
195
 
113
- > **Deprecated in 5.21.0**: moved to `@socketsecurity/lib/schema/*`.
196
+ > **Deprecated in 5.21.0**: moved to `schema/*`.
114
197
 
115
198
  ### Fixed
116
199
 
117
- - `@socketsecurity/lib/promise-queue` — synchronous throws inside a queued task now convert to proper rejections instead of escaping as uncaught exceptions
118
- - `@socketsecurity/lib/stdio/progress` `formatTime()` — clamp negative milliseconds so over-ticking / clock-skewed bars don't render negative ETAs
119
- - `@socketsecurity/lib/dlx/lockfile` — scratch-directory cleanup can no longer clobber the real exception from the main block
120
- - `@socketsecurity/lib/dlx/package` `parsePackageSpec` — normalize a bare trailing `@` (e.g. `"pkg@"`) to `version: undefined`
121
- - `@socketsecurity/lib/stdio/prompts` — tighten an internal destructure type away from `as any`
122
- - `@socketsecurity/lib/http-request` — hoist checksum regex literals out of a per-line loop
200
+ - `promise-queue` — sync throws inside a queued task convert to proper rejections (no longer escape as uncaught)
201
+ - `stdio/progress` `formatTime()` — clamps negative milliseconds (no negative ETAs)
202
+ - `dlx/lockfile` — scratch-directory cleanup no longer clobbers the real exception
203
+ - `dlx/package` `parsePackageSpec` — bare trailing `@` (e.g. `"pkg@"`) normalizes to `version: undefined`
123
204
 
124
205
  ## [5.19.1](https://github.com/SocketDev/socket-lib/releases/tag/v5.19.1) - 2026-04-19
125
206
 
126
207
  ### Fixed
127
208
 
128
- Restore `@socketsecurity/lib/stdio/prompts`, `@socketsecurity/lib/stdio/progress`, and `@socketsecurity/lib/stdio/clear` — accidentally removed in 5.19.0 without a major-bump callout. Downstream consumers that import `stdio/prompts` directly are unbroken.
209
+ - Restored `stdio/prompts`, `stdio/progress`, and `stdio/clear` — accidentally removed in 5.19.0
129
210
 
130
211
  ## [5.19.0](https://github.com/SocketDev/socket-lib/releases/tag/v5.19.0) - 2026-04-19
131
212
 
132
213
  ### Added
133
214
 
134
- - `@socketsecurity/lib/dlx/integrity` — hash verification utilities: `HashSpec`, `NormalizedHash`, `ComputedHashes`, `normalizeHash()`, `computeHashes()`, `verifyHash()` (constant-time via `crypto.timingSafeEqual`), `DlxHashMismatchError`
135
- - `@socketsecurity/lib/dlx/arborist` — hardened `@npmcli/arborist` wrappers: `safeIdealTree()`, `safeReify()`, `writeSafeNpmrc()`. Locks down `audit`, `fund`, `ignoreScripts`, `saveBundle`, etc. Supports `before?: Date` for release-age enforcement
136
- - `@socketsecurity/lib/dlx/lockfile` `generatePackagePin()` returns `{ name, version, hash, packageJson, lockfile }` for a resolved package. Default `minReleaseDays: 7` refuses versions published in the last week (`0` to disable); `minReleaseMins` accepted as pnpm-style alias
137
- - `DlxPackageOptions.hash`, `DlxPackageOptions.lockfile`, `DlxBinaryOptions.hash` — first-class integrity + lockfile options on the dlx entry points
215
+ - `dlx/integrity` — hash verification utilities (`normalizeHash`, `computeHashes`, `verifyHash` with constant-time compare, `DlxHashMismatchError`)
216
+ - `dlx/arborist` — hardened `@npmcli/arborist` wrappers (`safeIdealTree`, `safeReify`, `writeSafeNpmrc`). Locks down audit/fund/scripts/etc. Supports `before?: Date` for release-age enforcement
217
+ - `dlx/lockfile` `generatePackagePin()` returns `{ name, version, hash, packageJson, lockfile }`. Default `minReleaseDays: 7` refuses versions published in the last week
218
+ - `DlxPackageOptions.hash`, `.lockfile`, `DlxBinaryOptions.hash` — integrity + lockfile options on dlx entry points
138
219
 
139
220
  ### Fixed
140
221
 
141
- - `pacote` shim exposes `tarball`, `manifest`, `packument` alongside `extract`. Fixes a latent runtime crash in `fetchPackageManifest` / `fetchPackagePackument` callers
222
+ - `pacote` shim exposes `tarball`, `manifest`, `packument` alongside `extract`
142
223
 
143
224
  ### Changed
144
225
 
145
- Reduced bundle size of `dist/external/npm-pack.js` (−771 KB, −30.5%) and `dist/external/zod.js` (−306 KB, −51.2%) by stubbing code paths our callers never reach (Sigstore attestation, arborist audit/query, zod locale translations, etc.)
226
+ - `dist/external/npm-pack.js` 30% smaller; `dist/external/zod.js` 51% smaller (unused code paths stubbed)
146
227
 
147
228
  ## [5.18.2](https://github.com/SocketDev/socket-lib/releases/tag/v5.18.2) - 2026-04-14
148
229
 
149
230
  ### Removed
150
231
 
151
- - Remove unused `plugins/` directory and `./plugins/babel-plugin-inline-require-calls` export no downstream consumers; socket-cli maintains its own local copies
232
+ - `plugins/` directory + `./plugins/babel-plugin-inline-require-calls` — unused
152
233
 
153
234
  ## [5.18.1](https://github.com/SocketDev/socket-lib/releases/tag/v5.18.1) - 2026-04-14
154
235
 
155
236
  ### Changed
156
237
 
157
- - Deduplicated the `dist/external/npm-pack` bundle via `pnpm overrides` (pacote 21.5.0, make-fetch-happen 15.0.5, and 7 transitive `@npmcli/*` packages) — 22 duplicate packages removed, ~130 KB smaller
238
+ - `dist/external/npm-pack` deduplicated via `pnpm overrides` — 22 duplicate packages removed, ~130 KB smaller
158
239
 
159
240
  ## [5.18.0](https://github.com/SocketDev/socket-lib/releases/tag/v5.18.0) - 2026-04-14
160
241
 
161
242
  ### Added
162
243
 
163
- - `@socketsecurity/lib/dlx` — Socket Firewall API check before package downloads. Resolves the dependency tree and blocks on critical/high severity alerts
244
+ - `dlx` — Socket Firewall API check before package downloads. Resolves the dependency tree and blocks on critical/high alerts
164
245
 
165
246
  ### Changed
166
247
 
167
- - `@socketsecurity/lib/http-request` default `User-Agent` updated from `socket-registry/1.0` to `socketsecurity-lib/{version}`
248
+ - `http-request` default `User-Agent` is now `socketsecurity-lib/{version}` (was `socket-registry/1.0`)
168
249
 
169
250
  ## [5.17.0](https://github.com/SocketDev/socket-lib/releases/tag/v5.17.0) - 2026-04-14
170
251
 
171
252
  ### Added
172
253
 
173
- - `@socketsecurity/lib/paths` `isUnixPath()` — detect MSYS/Git Bash drive-letter notation (`/c/...`)
254
+ - `paths` `isUnixPath()` — detects MSYS/Git Bash drive-letter notation (`/c/...`)
174
255
 
175
256
  ### Changed
176
257
 
177
- - `@socketsecurity/lib/paths` `normalizePath()` converts MSYS drive letters on Windows (`/c/path` → `C:/path`)
178
- - `@socketsecurity/lib/paths` `fromUnixPath()` produces native Windows paths with backslashes (`/c/path` → `C:\path`), making it the true inverse of `toUnixPath()`
258
+ - `paths` `normalizePath()` converts MSYS drive letters on Windows (`/c/path` → `C:/path`)
259
+ - `paths` `fromUnixPath()` produces native Windows paths with backslashes (`/c/path` → `C:\path`)
179
260
 
180
261
  ## [5.16.0](https://github.com/SocketDev/socket-lib/releases/tag/v5.16.0) - 2026-04-14
181
262
 
182
263
  ### Added
183
264
 
184
- - `@socketsecurity/lib/paths` `fromUnixPath()` — convert MSYS/Git Bash Unix-style paths (`/c/path`) back to native Windows format (`C:/path`), inverse of `toUnixPath` (#168)
265
+ - `paths` `fromUnixPath()` — convert MSYS/Git Bash paths back to native Windows format (#168)
185
266
 
186
267
  ### Fixed
187
268
 
188
- - `@socketsecurity/lib/dlx` `isInSocketDlx` normalize the dlx directory path for Windows compatibility
269
+ - `dlx` `isInSocketDlx` normalizes the dlx directory path on Windows
189
270
 
190
271
  ## [5.15.0](https://github.com/SocketDev/socket-lib/releases/tag/v5.15.0) - 2026-04-06
191
272
 
192
273
  ### Added
193
274
 
194
- - `@socketsecurity/lib/http-request` `stream` option on `HttpRequestOptions` resolves with `HttpResponse` immediately after headers arrive, leaving `rawResponse` unconsumed for piping to files
195
- - `@socketsecurity/lib/http-request` — `headers`, `ok`, `status`, `statusText` fields on `HttpDownloadResult`
275
+ - `http-request` `stream` option resolves immediately after headers arrive, leaving the body unconsumed for piping
276
+ - `http-request` — `headers`, `ok`, `status`, `statusText` fields on `HttpDownloadResult`
196
277
 
197
278
  ## [5.14.0](https://github.com/SocketDev/socket-lib/releases/tag/v5.14.0) - 2026-04-06
198
279
 
199
280
  ### Added
200
281
 
201
- - `@socketsecurity/lib/http-request`:
202
- - `HttpResponseError` class — thrown on non-2xx when `throwOnError` is enabled; carries the full `HttpResponse`
282
+ - `http-request`:
283
+ - `HttpResponseError` — thrown on non-2xx when `throwOnError` is set
203
284
  - `throwOnError` option — non-2xx responses throw instead of resolving with `ok: false`
204
- - `onRetry` callback — customize retry behavior per-attempt (`false` to stop, a `number` to override delay, `undefined` for default backoff)
205
- - Streaming body support — `body` accepts `Readable` streams (incl. `form-data`), auto-merges `getHeaders()` when present
206
- - `parseRetryAfterHeader()` — standalone RFC 7231 §7.1.3 parser
207
- - `sanitizeHeaders()` — redact sensitive headers for safe logging
285
+ - `onRetry` callback — customize retry per attempt
286
+ - Streaming body support — `body` accepts `Readable` streams (incl. `form-data`)
287
+ - `parseRetryAfterHeader()` — RFC 7231 §7.1.3 parser
288
+ - `sanitizeHeaders()` — redact sensitive headers for logging
208
289
 
209
290
  ### Changed
210
291
 
211
- - `@socketsecurity/lib/http-request` `HttpRequestOptions.body` widened to `Buffer | Readable | string`; `onResponse` hook errors no longer leave promises pending
292
+ - `http-request` `HttpRequestOptions.body` widened to `Buffer | Readable | string`; `onResponse` errors no longer leave promises pending
212
293
 
213
294
  ## [5.13.0](https://github.com/SocketDev/socket-lib/releases/tag/v5.13.0) - 2026-04-05
214
295
 
215
- ### Added — http-request
296
+ ### Added
216
297
 
217
- - `readIncomingResponse()` — reads and buffers a Node.js `IncomingResponse` into an `HttpResponse` (#143)
218
- - Useful for converting raw responses from code that bypasses `httpRequest()` (e.g. multipart form-data uploads) into the standard `HttpResponse` interface
219
- - `IncomingResponse` type alias — disambiguates `IncomingMessage` as a client-side response
220
- - `IncomingRequest` type alias — disambiguates `IncomingMessage` as a server-side request
298
+ - `http-request` `readIncomingResponse()` — reads and buffers a Node.js response into an `HttpResponse` (#143)
299
+ - `http-request` `IncomingResponse` / `IncomingRequest` type aliases disambiguate `IncomingMessage` direction
221
300
 
222
- ### Changed — http-request
301
+ ### Changed
223
302
 
224
- - Internal `httpRequestAttempt` callbacks now use `IncomingResponse` type
225
303
  - `HttpResponse.rawResponse` type narrowed from `IncomingMessage` to `IncomingResponse`
226
304
 
227
305
  ## [5.12.0](https://github.com/SocketDev/socket-lib/releases/tag/v5.12.0) - 2026-04-04
228
306
 
229
- ### Added — http-request
307
+ ### Added
230
308
 
231
- - Lifecycle hooks (`onRequest`/`onResponse`) on `HttpRequestOptions` (#133)
232
- - Fire per-attemptretries and redirects each trigger separate hook calls
233
- - `HttpHooks`, `HttpHookRequestInfo`, `HttpHookResponseInfo` types exported
234
- - `maxResponseSize` option to reject responses exceeding a byte limit
235
- - Works through redirects, `httpJson`, and `httpText`
236
- - `rawResponse` property on `HttpResponse` exposing the underlying `IncomingMessage`
237
- - `enrichErrorMessage()` exported for reusable error enrichment
309
+ - `http-request` lifecycle hooks (`onRequest` / `onResponse`) on `HttpRequestOptions` — fire per-attempt; retries and redirects each trigger separate calls (#133)
310
+ - `http-request` `maxResponseSize` option reject responses exceeding a byte limit (works through redirects, `httpJson`, `httpText`)
311
+ - `http-request` `HttpResponse.rawResponse` underlying `IncomingMessage`
312
+ - `http-request` `enrichErrorMessage()` exported
238
313
 
239
- ### Changed — http-request
314
+ ### Changed
240
315
 
241
- - Error messages now include HTTP method and URL for easier debugging
242
- - `HttpResponse.headers` type changed from `Record<string, string | string[] | undefined>` to `IncomingHttpHeaders`
316
+ - Error messages now include HTTP method and URL
317
+ - `HttpResponse.headers` type changed to `IncomingHttpHeaders`
243
318
 
244
319
  ## [5.11.4](https://github.com/SocketDev/socket-lib/releases/tag/v5.11.4) - 2026-03-28
245
320
 
246
- ### Changed
321
+ ### Performance
247
322
 
248
- - **perf**: Lazy-load heavy external sub-bundles across 7 modules (#119)
249
- - `sorts.ts`: Defer semver (2.5 MB via npm-pack) and fastSort until first use
250
- - `versions.ts`: Defer semver until first use
251
- - `archives.ts`: Defer adm-zip (102 KB) and tar-fs (105 KB) until extraction
252
- - `globs.ts`: Defer fast-glob and picomatch (260 KB via pico-pack) until glob execution
253
- - `fs.ts`: Defer del (260 KB via pico-pack) until safeDelete call
254
- - `spawn.ts`: Defer @npmcli/promise-spawn (17 KB) until async spawn
255
- - `strings.ts`: Defer get-east-asian-width (10 KB) until stringWidth call
256
- - Importing lightweight exports (isObject, httpJson, localeCompare, readJsonSync, stripAnsi) no longer loads heavy externals at module init time
323
+ - Lazy-load heavy external sub-bundles across 7 modules (#119) — `sorts`, `versions`, `archives`, `globs`, `fs`, `spawn`, `strings`. Lightweight imports no longer load heavy externals at init
257
324
 
258
325
  ## [5.11.3](https://github.com/SocketDev/socket-lib/releases/tag/v5.11.3) - 2026-03-26
259
326
 
260
327
  ### Fixed
261
328
 
262
- - **build**: Deduplicate shared deps across external bundles (#110)
263
- - **quality**: Comprehensive quality scan fixes across codebase (#111)
264
- - **releases**: Add in-memory TTL cache for GitHub API responses
265
- - **releases**: Guard against missing assets in GitHub release response (#112)
266
- - **process-lock**: Fix Windows path separator handling for lock directory creation (#112)
329
+ - `releases` in-memory TTL cache for GitHub API responses; guard against missing assets in release response (#112)
330
+ - `process-lock` Windows path separator handling for lock directory creation (#112)
267
331
 
268
332
  ## [5.11.2](https://github.com/SocketDev/socket-lib/releases/tag/v5.11.2) - 2026-03-24
269
333
 
270
334
  ### Added
271
335
 
272
- - **http-request**: Custom CA certificate support for TLS connections
273
- - `httpRequest`, `httpJson`, `httpText` accept `ca` option for custom certificate authorities
274
- - `httpDownload` accepts `ca` option, threaded through redirects and retries
275
- - `fetchChecksums` accepts `ca` option, passed through to underlying request
276
- - Enables SSL_CERT_FILE support when NODE_EXTRA_CA_CERTS is unavailable at process startup
336
+ - `http-request` custom CA certificate support (`ca` option on `httpRequest`, `httpJson`, `httpText`, `httpDownload`, `fetchChecksums`). Enables `SSL_CERT_FILE` support when `NODE_EXTRA_CA_CERTS` is unavailable at process startup
277
337
 
278
338
  ## [5.11.1](https://github.com/SocketDev/socket-lib/releases/tag/v5.11.1) - 2026-03-24
279
339
 
280
340
  ### Added
281
341
 
282
- - **dlx/binary**: Added `sha256` option to `dlxBinary()`, `downloadBinary()`, and `downloadBinaryFile()`
283
- - Enables SHA-256 checksum verification for binary downloads via httpDownload
284
- - Verification happens during download (fails early if checksum mismatches)
285
- - Complements existing `integrity` option (SRI sha512 format, verified post-download)
342
+ - `dlx/binary` `sha256` option on `dlxBinary()`, `downloadBinary()`, `downloadBinaryFile()`. Verification happens during download (fails early on mismatch). Complements the existing `integrity` (SRI sha512) option
286
343
 
287
344
  ## [5.11.0](https://github.com/SocketDev/socket-lib/releases/tag/v5.11.0) - 2026-03-23
288
345
 
289
346
  ### Added
290
347
 
291
- - **http-request**: Checksum verification for secure downloads
292
- - `parseChecksums(text)`: Parse checksums file text into filename→hash map
293
- - Supports GNU style (`hash filename`), BSD style (`SHA256 (file) = hash`), and single-space format
294
- - Handles Windows CRLF and Unix LF line endings
295
- - Returns null-prototype object to prevent prototype pollution
296
- - `fetchChecksums(url, options?)`: Fetch and parse checksums from URL
297
- - Supports `headers` and `timeout` options
298
- - `httpDownload` now accepts `sha256` option to verify downloaded files
299
- - Verification happens before atomic rename (file not saved if hash mismatches)
300
- - Accepts uppercase hashes (normalized to lowercase internally)
348
+ - `http-request` `parseChecksums(text)` parse GNU / BSD / single-space checksum file formats; CRLF and LF line endings; null-prototype map
349
+ - `http-request` `fetchChecksums(url, options?)` fetch and parse checksums from URL; supports `headers` and `timeout`
350
+ - `http-request` `httpDownload` `sha256` option verifies before atomic rename (file not saved on mismatch); accepts uppercase hashes
301
351
 
302
352
  ## [5.10.0](https://github.com/SocketDev/socket-lib/releases/tag/v5.10.0) - 2026-03-14
303
353
 
304
354
  ### Changed
305
355
 
306
- - **releases/socket-btm**: Refactored `downloadSocketBtmRelease()` API for caller-controlled download paths
307
- - Tool name moved from config object to required first parameter
308
- - Config object is now optional second parameter (was required)
309
- - Removed automatic `/${toolName}/${platformArch}` directory nesting - callers now have full control over download directory structure
310
- - All optional parameters in config types now explicitly typed as `| undefined`
311
- - Migration example:
312
- - Before: `downloadSocketBtmRelease({ tool: 'lief', downloadDir: 'build' })`
313
- - After: `downloadSocketBtmRelease('lief', { downloadDir: 'build' })`
314
- - Rationale: Previous automatic path nesting created unexpected directory structures (e.g., `build/downloaded/lief/darwin-arm64/lief/assets/`) making it impossible for callers to predict exact file locations
356
+ - **BREAKING**: `releases/socket-btm` `downloadSocketBtmRelease()` tool name moved to required first parameter; config object now optional second parameter. Automatic `/${toolName}/${platformArch}` directory nesting removed (callers now control the full path).
357
+ - Before: `downloadSocketBtmRelease({ tool: 'lief', downloadDir: 'build' })`
358
+ - After: `downloadSocketBtmRelease('lief', { downloadDir: 'build' })`
315
359
 
316
360
  ## [5.9.1](https://github.com/SocketDev/socket-lib/releases/tag/v5.9.1) - 2026-03-14
317
361
 
318
362
  ### Fixed
319
363
 
320
- - **fs**: `safeDelete()` and `safeDeleteSync()` now properly implement retry logic
321
- - Previously `maxRetries` was incorrectly passed as `concurrency` to del (parallelism, not retries)
322
- - `safeDelete()` now wraps `deleteAsync()` with `pRetry()` for exponential backoff
323
- - `safeDeleteSync()` implements sync retry loop with `Atomics.wait()` for non-blocking sleep
324
- - Both use `backoffFactor: 2` (delay doubles each retry: 200ms → 400ms → 800ms by default)
325
- - `maxRetries` and `retryDelay` options in `RemoveOptions` now work as documented
364
+ - `fs` `safeDelete()` and `safeDeleteSync()` now properly implement retry logic. Previously `maxRetries` was incorrectly passed as `concurrency` to `del`. Both now use exponential backoff (`backoffFactor: 2`); `maxRetries` and `retryDelay` in `RemoveOptions` work as documented
326
365
 
327
366
  ## [5.9.0](https://github.com/SocketDev/socket-lib/releases/tag/v5.9.0) - 2026-03-14
328
367
 
329
368
  ### Changed
330
369
 
331
- - **releases/socket-btm**: `getPlatformArch()` now normalizes Windows platform to `win` instead of `win32`
332
- - Returns `win-x64`, `win-arm64` instead of `win32-x64`, `win32-arm64`
333
- - Consistent with `getBinaryAssetName()` which already uses `win` for Windows assets
334
- - Aligns with socket-btm and Node.js convention: use `win` for file/folder names, `win32` for platform checks (`process.platform`)
335
- - Added `PLATFORM_MAP` for explicit platform name mapping (darwin, linux, win32 → win)
336
- - Now throws `Error: Unsupported platform` for unknown platform values
370
+ - **BREAKING**: `releases/socket-btm` `getPlatformArch()` normalizes Windows to `win` (was `win32`) — returns `win-x64`, `win-arm64`. Throws on unknown platforms. (Reverted in 5.22.0 back to `win32`)
337
371
 
338
372
  ## [5.8.2](https://github.com/SocketDev/socket-lib/releases/tag/v5.8.2) - 2026-03-13
339
373
 
340
374
  ### Fixed
341
375
 
342
- - **http-request**: Download to temp file then atomically rename to prevent corruption
343
- - Downloads now write to `{destPath}.download` temp file first
344
- - On success, atomically renames to the destination path
345
- - On failure, cleans up temp file and preserves any existing file at destination
346
- - Prevents partial/corrupted files from CI caching causing extraction failures
376
+ - `http-request` downloads write to `{destPath}.download` temp file then atomically rename. Prevents partial/corrupted files from CI caching causing extraction failures
347
377
 
348
378
  ## [5.8.1](https://github.com/SocketDev/socket-lib/releases/tag/v5.8.1) - 2026-03-11
349
379
 
350
380
  ### Performance
351
381
 
352
- - **windows**: Add comprehensive caching for expensive PATH resolution operations
353
- - `getBinPath()`, `getBinPathSync()`: Cache binary path lookups
354
- - `findRealBin()`: Cache `all:true` lookups and use single `whichSync({ all: true })` call
355
- - `getVoltaBinPath()`: Cache Volta binary resolution
356
- - `spawn()`: Cache binary path resolution before spawning
357
- - `getGitPath()`: Cache git binary path
358
- - `getCachedRealpath()`: New helper caching `realpathSync()` calls for git operations
359
- - `findGitRoot()`: Cache git root directory lookups
360
- - `findPackageJson()`: Cache package.json path lookups
361
- - `readPackageJson()`: Cache parsed package.json content
362
- - `resolveBinaryPath()`: Cache binary path resolution with Windows extension handling
363
- - `NPM_BIN_PATH`, `NPM_REAL_EXEC_PATH`: Share npm path resolution to avoid duplicate `which.sync()` calls
364
- - `ProcessLockManager.isStale()`: Use single `statSync({ throwIfNoEntry: false })` instead of `existsSync()` + `statSync()`
365
- - All caches validate entries with `existsSync()` and remove stale entries automatically
382
+ - Comprehensive caching for expensive PATH/realpath/git/package.json lookups across `bin`, `spawn`, `git`, `paths`, and `process-lock`. All caches validate entries via `existsSync()` and evict stale ones
366
383
 
367
384
  ## [5.8.0](https://github.com/SocketDev/socket-lib/releases/tag/v5.8.0) - 2026-03-10
368
385
 
369
386
  ### Added
370
387
 
371
- - **archives**: Added secure archive extraction utilities with support for ZIP, TAR, TAR.GZ, and TGZ formats
372
- - Configurable limits: `maxFileSize` (default 100MB), `maxTotalSize` (default 1GB)
373
- - Cross-platform path normalization
374
- - External dependencies: adm-zip@0.5.16, tar-fs@3.1.2 (bundled, +212KB)
375
- - Security features: path traversal protection, file size limits, total size limits, symlink blocking
376
- - Strip option to remove leading path components (like tar `--strip-components`)
377
- - `detectArchiveFormat()` - Detect archive type from file extension
378
- - `extractArchive()` - Generic extraction with auto-format detection
379
- - `extractTar()`, `extractTarGz()`, `extractZip()` - Format-specific extractors
380
-
381
- - **releases/github**: Added archive extraction support for GitHub releases
382
- - Auto-detects format from asset filename
383
- - Enhanced `downloadAndExtractZip()` to use generic archive helpers
384
- - Supports ZIP, TAR, TAR.GZ, and TGZ assets
385
- - `downloadAndExtractArchive()` - Generic archive download and extraction
388
+ - `archives` secure archive extraction for ZIP / TAR / TAR.GZ / TGZ. Configurable `maxFileSize` (100MB) and `maxTotalSize` (1GB). Path-traversal protection, symlink blocking, strip option. Exports: `detectArchiveFormat`, `extractArchive`, `extractTar`, `extractTarGz`, `extractZip`
389
+ - `releases/github` `downloadAndExtractArchive()` generic archive download and extract; auto-detects format
386
390
 
387
391
  ### Changed
388
392
 
389
- - **dependencies**: Deduplicated 14 external bundle packages to single versions using pnpm overrides and patches
393
+ - 14 external bundle packages deduplicated via pnpm overrides + patches
390
394
 
391
395
  ## [5.7.0](https://github.com/SocketDev/socket-lib/releases/tag/v5.7.0) - 2026-02-12
392
396
 
393
397
  ### Added
394
398
 
395
- - **env**: Added `isInEnv()` helper function to check if an environment variable key exists, regardless of its value
396
- - Returns `true` even for empty strings, `"false"`, `"0"`, etc.
397
- - Follows same override resolution order as `getEnvValue()` (isolated overrides shared overrides → process.env)
398
- - Useful for detecting presence of environment variables independent of their value
399
-
400
- - **dlx**: Added new exported helper functions
401
- - `downloadBinaryFile()` - Downloads a binary file from a URL to the dlx cache directory
402
- - `ensurePackageInstalled()` - Ensures an npm package is installed and cached via Arborist
403
- - `getBinaryCacheMetadataPath()` - Gets the file path to dlx binary cache metadata (`.dlx-metadata.json`)
404
- - `isBinaryCacheValid()` - Checks if a cached dlx binary is still valid based on TTL and timestamp
405
- - `makePackageBinsExecutable()` - Makes npm package binaries executable on Unix systems
406
- - `parsePackageSpec()` - Parses npm package spec strings (e.g., `pkg@1.0.0`) into name and version
407
- - `resolveBinaryPath()` - Resolves the absolute path to a binary within an installed package
408
- - `writeBinaryCacheMetadata()` - Writes dlx binary cache metadata with integrity, size, and source info
409
-
410
- - **releases**: Added `createAssetMatcher()` utility function for GitHub release asset pattern matching
411
- - Creates matcher functions that test strings against glob patterns, prefix/suffix, or RegExp
412
- - Used for dynamic asset discovery in GitHub releases (e.g., matching platform-specific binaries)
399
+ - `env` `isInEnv(key)` `true` whenever the key exists, regardless of value (empty string, `"false"`, `"0"` all count)
400
+ - `dlx` helpers exposed: `downloadBinaryFile`, `ensurePackageInstalled`, `getBinaryCacheMetadataPath`, `isBinaryCacheValid`, `makePackageBinsExecutable`, `parsePackageSpec`, `resolveBinaryPath`, `writeBinaryCacheMetadata`
401
+ - `releases` `createAssetMatcher()` matcher fn for glob / prefix-suffix / RegExp asset patterns
413
402
 
414
403
  ### Changed
415
404
 
416
- - **env**: Updated `getCI()` to use `isInEnv()` for more accurate CI detection
417
- - Now returns `true` whenever the `CI` key exists in the environment, not just when truthy
418
- - Matches standard CI detection behavior where the presence of the key (not its value) indicates a CI environment
405
+ - `env` `getCI()` now uses `isInEnv('CI')` `true` whenever the key exists, matching standard CI-detection convention
419
406
 
420
407
  ### Fixed
421
408
 
422
- - **github**: Fixed JSON parsing crash vulnerability by adding try-catch around `JSON.parse()` in GitHub API responses
423
- - Prevents crashes on malformed, incomplete, or binary responses
424
- - Error messages now include the response URL for better debugging
425
-
426
- - **dlx/binary**: Fixed clock skew vulnerabilities in cache validation
427
- - Cache entries with future timestamps (clock skew) are now treated as expired
428
- - Metadata writes now use atomic write-then-rename pattern to prevent corruption
429
- - Added TOCTOU race protection by re-checking binary existence after metadata read
430
-
431
- - **dlx/cache cleanup**: Fixed handling of future timestamps during cache cleanup
432
- - Entries with future timestamps (due to clock skew) are now properly treated as expired
433
-
434
- - **dlx/package**: Fixed scoped package parsing bug where `@scope/package` was incorrectly parsed
435
- - Changed condition from `startsWith('@')` to `atIndex === 0` for more precise detection
436
- - Fixes installation failures for scoped packages like `@socketregistry/lib`
437
-
438
- - **cache-with-ttl**: Added clock skew detection to TTL cache
439
- - Far-future `expiresAt` values (>2x TTL) are now treated as expired
440
- - Protects against cache poisoning from clock skew
441
-
442
- - **packages/specs**: Fixed unconditional `.git` truncation in Git URL parsing
443
- - Now only removes `.git` suffix when URL actually ends with `.git`
444
- - Prevents incorrect truncation of URLs containing `.git` in the middle
445
-
446
- - **releases/github**: Fixed TOCTOU race condition in binary download verification
447
- - Re-checks binary existence after reading version file
448
- - Ensures binary is re-downloaded if missing despite version file presence
449
-
450
- - **provenance**: Fixed incorrect package name in provenance workflow
451
- - Changed from `@socketregistry/lib` to `@socketsecurity/lib`
409
+ - `github` try/catch around `JSON.parse()` in API responses; error messages include the response URL
410
+ - `dlx/binary` clock-skew protection (future timestamps treated as expired); atomic metadata write-then-rename; TOCTOU re-check of binary existence after metadata read
411
+ - `dlx/cache` future-timestamped entries treated as expired during cleanup
412
+ - `dlx/package` — scoped-package parsing uses `atIndex === 0` (was `startsWith('@')`); fixes `@scope/pkg` installation failures
413
+ - `cache-with-ttl` clock-skew detection (far-future `expiresAt` > 2x TTL treated as expired)
414
+ - `packages/specs` only strips `.git` when URL actually ends with it (no more mid-URL truncation)
415
+ - `releases/github` TOCTOU on binary download verification (re-checks after reading version file)
416
+ - `provenance` workflow corrected package name `@socketregistry/lib` `@socketsecurity/lib`
452
417
 
453
418
  ## [5.6.0](https://github.com/SocketDev/socket-lib/releases/tag/v5.6.0) - 2026-02-08
454
419
 
455
420
  ### Added
456
421
 
457
- - **http-request**: Added automatic default headers for JSON and text requests
458
- - `httpJson()` now automatically sets `Accept: application/json` header
459
- - `httpJson()` automatically sets `Content-Type: application/json` when body is present
460
- - `httpText()` now automatically sets `Accept: text/plain` header
461
- - `httpText()` automatically sets `Content-Type: text/plain` when body is present
462
- - User-provided headers always override defaults
463
- - Simplifies API usage - no need to manually set common headers
422
+ - `http-request` `httpJson()` / `httpText()` automatically set `Accept` and `Content-Type` headers (when body present); user headers override
464
423
 
465
424
  ### Changed
466
425
 
467
- - **http-request**: Renamed HTTP helper functions to support all HTTP methods (BREAKING CHANGE)
468
- - `httpGetJson()` → `httpJson()` - Now supports GET, POST, PUT, DELETE, PATCH, etc.
469
- - `httpGetText()` → `httpText()` - Now supports all HTTP methods via `method` option
470
- - Functions now accept `method` parameter in options (defaults to 'GET')
471
- - More flexible API that matches modern fetch-style conventions
472
- - **Migration**: Replace `httpGetJson()` calls with `httpJson()` and `httpGetText()` with `httpText()`
426
+ - **BREAKING**: `http-request` `httpGetJson()` `httpJson()` and `httpGetText()` `httpText()`. Functions now accept `method` (defaults to `'GET'`), supporting all HTTP verbs
473
427
 
474
428
  ### Fixed
475
429
 
476
- - **http-request**: Fixed Content-Type header incorrectly sent with empty string body
477
- - Empty string body (`""`) no longer triggers Content-Type header
478
- - Changed condition from `if (body !== undefined)` to `if (body)` for semantic correctness
479
- - Empty string represents "no content" and should not declare a Content-Type
480
- - Affects `httpJson()` and `httpText()` functions
481
- - Fixes potential API compatibility issues with servers expecting no Content-Type for empty bodies
482
- - Added comprehensive test coverage for empty string edge case
430
+ - `http-request` empty-string body no longer triggers `Content-Type`
483
431
 
484
432
  ## [5.5.3](https://github.com/SocketDev/socket-lib/releases/tag/v5.5.3) - 2026-01-20
485
433
 
486
434
  ### Fixed
487
435
 
488
- - **deps**: Added patch for execa@2.1.0 to fix signal-exit v4 compatibility. The package was using default import syntax with signal-exit v4, which now exports onExit as a named export.
436
+ - Patched `execa@2.1.0` for `signal-exit` v4 compatibility (named export)
489
437
 
490
438
  ## [5.5.2](https://github.com/SocketDev/socket-lib/releases/tag/v5.5.2) - 2026-01-20
491
439
 
492
440
  ### Changed
493
441
 
494
- - **dlx/package**: Use `getSocketCacacheDir()` instead of `getPacoteCachePath()` for Arborist cache configuration
495
- - Ensures consistent use of Socket's shared cacache directory (`~/.socket/_cacache`)
496
- - Removes dependency on pacote cache path extraction which could fail
497
- - Simplifies cache configuration by using reliable Socket path utility
442
+ - `dlx/package` uses `getSocketCacacheDir()` (was `getPacoteCachePath()`) for Arborist cache config — removes dependency on pacote cache-path extraction
498
443
 
499
444
  ## [5.5.1](https://github.com/SocketDev/socket-lib/releases/tag/v5.5.1) - 2026-01-12
500
445
 
501
446
  ### Fixed
502
447
 
503
- - Fixed dotenvx compatibility with pre-commit hooks
504
- - Fixed empty releases being returned when finding latest release
448
+ - dotenvx compatibility with pre-commit hooks
449
+ - Empty releases being returned by latest-release lookup
505
450
 
506
451
  ## [5.5.0](https://github.com/SocketDev/socket-lib/releases/tag/v5.5.0) - 2026-01-12
507
452
 
508
453
  ### Added
509
454
 
510
- - **dlx/detect**: Executable type detection utilities for DLX cache and local file paths
511
- - `detectDlxExecutableType()`: Detects Node.js packages vs native binaries in DLX cache by checking for node_modules/ directory
512
- - `detectExecutableType()`: Generic entry point that routes to appropriate detection strategy
513
- - `detectLocalExecutableType()`: Detects executables on local filesystem by checking package.json bin field or file extension
514
- - `isJsFilePath()`: Validates if a file path has .js, .mjs, or .cjs extension
515
- - `isNativeBinary()`: Simplified helper that returns true for native binary executables
516
- - `isNodePackage()`: Simplified helper that returns true for Node.js packages
455
+ - `dlx/detect` `detectDlxExecutableType`, `detectExecutableType`, `detectLocalExecutableType`, `isJsFilePath`, `isNativeBinary`, `isNodePackage`. Distinguishes Node packages from native binaries in DLX cache and on local filesystem
517
456
 
518
457
  ### Fixed
519
458
 
520
- - **releases/github**: Sort releases by published_at to reliably find latest release instead of relying on creation order
459
+ - `releases/github` sort releases by `published_at` to reliably find latest (was relying on creation order)
521
460
 
522
461
  ## [5.4.1](https://github.com/SocketDev/socket-lib/releases/tag/v5.4.1) - 2026-01-10
523
462
 
524
463
  ### Fixed
525
464
 
526
- - **build**: Removed debug module stub to bundle real debug package. The stub was missing `enable()` and `disable()` methods, causing errors when downstream projects re-bundled the lib.
465
+ - Removed `debug` module stub to bundle the real package stub was missing `enable()` / `disable()`
527
466
 
528
467
  ## [5.4.0](https://github.com/SocketDev/socket-lib/releases/tag/v5.4.0) - 2026-01-07
529
468
 
530
469
  ### Added
531
470
 
532
- - **releases/github**: Extended release functions to accept glob patterns for asset discovery
533
- - `getReleaseAssetUrl()` now accepts glob patterns: `'yoga-sync-*.mjs'`, `'models-*.tar.gz'`
534
- - `downloadReleaseAsset()` now accepts glob patterns for automatic asset discovery
535
- - `getLatestRelease()` now accepts asset patterns to find releases with matching assets
536
- - Supports wildcards, brace expansion, RegExp patterns, and prefix/suffix objects
537
- - Uses picomatch for robust glob pattern matching
538
-
539
- - **releases/socket-btm**: Extended `downloadSocketBtmRelease()` to accept glob patterns
540
- - `asset` parameter now accepts wildcards: `'yoga-sync-*.mjs'`, `'models-*.tar.gz'`
541
- - Automatically discovers and downloads latest matching asset
542
- - Eliminates need for hardcoded asset names in build scripts
471
+ - `releases/github` `getReleaseAssetUrl()`, `downloadReleaseAsset()`, `getLatestRelease()` accept glob patterns (wildcards, brace expansion, RegExp) via picomatch
472
+ - `releases/socket-btm` `downloadSocketBtmRelease()` `asset` parameter accepts glob patterns
543
473
 
544
474
  ## [5.3.0](https://github.com/SocketDev/socket-lib/releases/tag/v5.3.0) - 2026-01-07
545
475
 
546
476
  ### Added
547
477
 
548
- - **releases/socket-btm**: Exported helper functions for external use
549
- - `detectLibc()`: Detect musl vs glibc on Linux systems
550
- - `getBinaryAssetName()`: Get GitHub asset name for platform/arch
551
- - `getBinaryName()`: Get binary filename with platform-appropriate extension
552
- - `getPlatformArch()`: Get platform-arch identifier for directory structure
553
-
554
- - **releases/github**: Exported `getAuthHeaders()` for GitHub API authentication
555
- - Returns headers with `Accept`, `X-GitHub-Api-Version`, and optional `Authorization`
556
- - Checks `GH_TOKEN` and `GITHUB_TOKEN` environment variables
478
+ - `releases/socket-btm` exports: `detectLibc`, `getBinaryAssetName`, `getBinaryName`, `getPlatformArch`
479
+ - `releases/github` exports `getAuthHeaders()` checks `GH_TOKEN` / `GITHUB_TOKEN`
557
480
 
558
481
  ## [5.2.1](https://github.com/SocketDev/socket-lib/releases/tag/v5.2.1) - 2026-01-06
559
482
 
560
483
  ### Fixed
561
484
 
562
- - **releases**: Fixed "Text file busy" errors when executing downloaded binaries
563
- - Changed `downloadGitHubRelease()` to use synchronous `chmodSync()` instead of async `chmod()`
564
- - Ensures file system operations complete before binary execution
565
- - Prevents race conditions in CI/CD environments where async operations may not fully flush to disk
485
+ - `releases` `downloadGitHubRelease()` uses sync `chmodSync()` to prevent "Text file busy" race in CI
566
486
 
567
487
  ## [5.2.0](https://github.com/SocketDev/socket-lib/releases/tag/v5.2.0) - 2026-01-06
568
488
 
569
489
  ### Added
570
490
 
571
- - **releases**: Added GitHub release download utilities for cross-project use
572
- - Added `downloadGitHubRelease()` for downloading releases from any GitHub repository
573
- - Added `downloadSocketBtmRelease()` specialized wrapper for socket-btm releases
574
- - Features version caching with `.version` files to avoid redundant downloads
575
- - Supports cross-platform binary downloads (darwin, linux, win32) with automatic platform/arch detection
576
- - Includes Linux musl/glibc support with musl as default for broader compatibility
577
- - Automatically removes macOS quarantine attributes from downloaded binaries
578
- - Supports generic asset downloads (WASM files, models, etc.)
579
- - API inspired by industry tools: `brew`, `cargo`, `gh` for intuitive usage
580
- - Package exports: `@socketsecurity/lib/releases/github` and `@socketsecurity/lib/releases/socket-btm`
491
+ - `releases/github` `downloadGitHubRelease()` for any GitHub repo
492
+ - `releases/socket-btm` `downloadSocketBtmRelease()` wrapper. Version caching via `.version` files; cross-platform with auto platform/arch detection; Linux musl/glibc support; macOS quarantine attribute auto-removal; generic asset downloads (WASM, models)
581
493
 
582
494
  ## [5.1.4](https://github.com/SocketDev/socket-lib/releases/tag/v5.1.4) - 2025-12-30
583
495
 
584
496
  ### Fixed
585
497
 
586
- - **dependencies**: Removed unnecessary `http2` module dependency from `@sigstore/sign@4.1.0`
587
- - Added pnpm override to force `@sigstore/sign@4.1.0` across all dependencies
588
- - Created patch to inline HTTP header and status constants instead of importing `http2` module
589
- - Eliminates loading of Node.js `http2` module for HTTP/1.1-only operations
498
+ - Removed unnecessary `http2` module dependency from `@sigstore/sign@4.1.0` via pnpm override + patch — eliminates loading `node:http2` for HTTP/1.1-only operations
590
499
 
591
500
  ## [5.1.3](https://github.com/SocketDev/socket-lib/releases/tag/v5.1.3) - 2025-12-29
592
501
 
593
502
  ### Fixed
594
503
 
595
- - **http-request**: Fixed `httpDownload()` to properly handle HTTP redirects (3xx status codes)
596
- - Added `followRedirects` option (default: `true`) to enable automatic redirect following
597
- - Added `maxRedirects` option (default: `5`) to limit redirect chain length
598
- - Now supports downloading from services that use CDN redirects, such as GitHub release assets
599
- - Prevents GitHub API quota exhaustion by following `browser_download_url` redirects instead of using API endpoints
600
- - Resolves "Request quota exhausted" errors when downloading GitHub release assets
504
+ - `http-request` `httpDownload()` follows 3xx redirects. New `followRedirects` (default `true`) and `maxRedirects` (default `5`) options. Resolves "Request quota exhausted" when downloading GitHub release assets
601
505
 
602
506
  ## [5.1.2](https://github.com/SocketDev/socket-lib/releases/tag/v5.1.2) - 2025-12-28
603
507
 
604
508
  ### Fixed
605
509
 
606
- - **paths**: Fixed missing `getPathValue()` caching in `getSocketDlxDir()`
607
- - Now uses `getPathValue()` for performance, consistent with `getSocketUserDir()` and `getSocketCacacheDir()`
608
- - Adds test override support via `setPath('socket-dlx-dir', ...)`
609
- - Test helper `mockHomeDir()` now properly invalidates path cache with `resetPaths()` calls
610
- - Resolves cache persistence issues in test environments
510
+ - `paths` `getSocketDlxDir()` now uses `getPathValue()` caching consistent with the other Socket-dir helpers. Adds test override via `setPath('socket-dlx-dir', ...)`
611
511
 
612
512
  ## [5.1.1](https://github.com/SocketDev/socket-lib/releases/tag/v5.1.1) - 2025-12-28
613
513
 
614
514
  ### Added
615
515
 
616
- - **paths**: Added `SOCKET_HOME` environment variable support to customize Socket base directory
617
- - `getSocketUserDir()` now checks `SOCKET_HOME` before defaulting to `~/.socket`
618
- - `getSocketDlxDir()` inherits `SOCKET_HOME` support (priority: `SOCKET_DLX_DIR` > `SOCKET_HOME/_dlx` > `~/.socket/_dlx`)
619
- - Enables flexible directory configuration for restricted or custom environments
516
+ - `paths` `SOCKET_HOME` env var support customize Socket base directory. Priority: `SOCKET_DLX_DIR` > `SOCKET_HOME/_dlx` > `~/.socket/_dlx`
620
517
 
621
518
  ### Changed
622
519
 
623
- - **paths**: Enhanced directory resolution with temporary directory fallback
624
- - `getUserHomeDir()` now falls back to `os.tmpdir()` when home directory is unavailable
625
- - Improves resilience in containerized and restricted environments
626
- - Priority order: `HOME` > `USERPROFILE` > `os.homedir()` > `os.tmpdir()`
520
+ - `paths` `getUserHomeDir()` falls back to `os.tmpdir()` when home dir is unavailable. Priority: `HOME` > `USERPROFILE` > `os.homedir()` > `os.tmpdir()`
627
521
 
628
522
  ## [5.1.0](https://github.com/SocketDev/socket-lib/releases/tag/v5.1.0) - 2025-12-17
629
523
 
630
524
  ### Added
631
525
 
632
- - **types**: Added `ALPM` and `VSCODE` to `PURL_Type` enum
633
- - `ALPM`: Arch Linux Package Manager ecosystem
634
- - `VSCODE`: Visual Studio Code extensions ecosystem
526
+ - `types` `PURL_Type` — added `ALPM` (Arch Linux) and `VSCODE` (VS Code extensions)
635
527
 
636
528
  ## [5.0.2](https://github.com/SocketDev/socket-lib/releases/tag/v5.0.2) - 2025-12-15
637
529
 
638
530
  ### Changed
639
531
 
640
- - **signal-exit**: `signals()` now auto-initializes its internal state
641
- - Commit: [`8cb0576`](https://github.com/SocketDev/socket-lib/commit/8cb0576)
532
+ - `signal-exit` `signals()` auto-initializes its internal state
642
533
 
643
534
  ## [5.0.1](https://github.com/SocketDev/socket-lib/releases/tag/v5.0.1) - 2025-12-11
644
535
 
645
536
  ### Added
646
537
 
647
- - **http-request**: Enhanced `httpDownload()` with automatic progress logging via Logger integration
648
- - New `logger` option: Pass a Logger instance for automatic progress tracking
649
- - New `progressInterval` option: Configure progress reporting frequency (default: 10%)
650
- - Progress format: `Progress: XX% (Y.Y MB / Z.Z MB)`
651
- - `onProgress` callback takes precedence over `logger` when both are provided
652
- - Commit: [`91e5db5`](https://github.com/SocketDev/socket-lib/commit/91e5db5)
538
+ - `http-request` `httpDownload()` automatic progress logging `logger` option for a Logger instance, `progressInterval` option (default `10%`). `onProgress` callback takes precedence over `logger`
653
539
 
654
540
  ## [5.0.0](https://github.com/SocketDev/socket-lib/releases/tag/v5.0.0) - 2025-12-04
655
541
 
656
542
  ### Added
657
543
 
658
- - **json/edit**: New `EditableJson` base class for generic JSON file manipulation with formatting preservation
659
- - Extracted from `EditablePackageJson` to enable code reuse via composition pattern
660
- - Supports reading, modifying, and writing JSON files while preserving formatting
661
- - Export: `@socketsecurity/lib/json/edit`
662
-
663
- - **json/format**: New JSON formatting utilities for consistent JSON manipulation
664
- - Functions for analyzing and preserving JSON formatting patterns
665
- - Export: `@socketsecurity/lib/json/format`
666
-
667
- - **json/parse**: New JSON parsing utilities
668
- - `isJsonPrimitive()`: Check if value is a JSON primitive type
669
- - `jsonParse()`: Parse JSON with error handling
670
- - Export: `@socketsecurity/lib/json/parse`
671
-
672
- - **json/types**: New JSON type definitions and interfaces
673
- - Export: `@socketsecurity/lib/json/types`
674
-
675
- - **dlx/cache**: New DLX cache utilities
676
- - `generateCacheKey()`: Generate cache keys for DLX packages
677
- - Export: `@socketsecurity/lib/dlx/cache`
678
-
679
- - **dlx/dir**: New DLX directory management utilities
680
- - `clearDlx()`, `clearDlxSync()`: Clear DLX directory
681
- - `dlxDirExists()`, `dlxDirExistsAsync()`: Check if DLX directory exists
682
- - `ensureDlxDir()`, `ensureDlxDirSync()`: Ensure DLX directory exists
683
- - Export: `@socketsecurity/lib/dlx/dir`
684
-
685
- - **dlx/packages**: New DLX package management utilities
686
- - `isDlxPackageInstalled()`, `isDlxPackageInstalledAsync()`: Check if package is installed
687
- - `listDlxPackages()`, `listDlxPackagesAsync()`: List installed packages
688
- - `removeDlxPackage()`, `removeDlxPackageSync()`: Remove installed packages
689
- - Export: `@socketsecurity/lib/dlx/packages`
690
-
691
- - **dlx/paths**: New DLX path utilities
692
- - `getDlxPackageDir()`: Get package directory path
693
- - `getDlxInstalledPackageDir()`: Get installed package directory path
694
- - `getDlxPackageJsonPath()`: Get package.json path
695
- - `getDlxPackageNodeModulesDir()`: Get node_modules directory path
696
- - `isInSocketDlx()`: Check if path is in DLX directory
697
- - Export: `@socketsecurity/lib/dlx/paths`
544
+ - `json/edit` `EditableJson` base class for generic JSON file manipulation with formatting preservation
545
+ - `json/format` JSON formatting utilities
546
+ - `json/parse` `isJsonPrimitive`, `jsonParse` (with error handling)
547
+ - `json/types` — JSON type definitions
548
+ - `dlx/cache` `generateCacheKey()` — DLX package cache keys
549
+ - `dlx/dir` `clearDlx`, `clearDlxSync`, `dlxDirExists`, `dlxDirExistsAsync`, `ensureDlxDir`, `ensureDlxDirSync`
550
+ - `dlx/packages` `isDlxPackageInstalled`, `listDlxPackages`, `removeDlxPackage` (+ async/sync variants)
551
+ - `dlx/paths` — `getDlxPackageDir`, `getDlxInstalledPackageDir`, `getDlxPackageJsonPath`, `getDlxPackageNodeModulesDir`, `isInSocketDlx`
698
552
 
699
553
  ### Changed
700
554
 
701
- - **BREAKING**: Reorganized module paths for better structure and discoverability
702
- - `@socketsecurity/lib/json/editable` → `@socketsecurity/lib/json/edit`
703
- - `@socketsecurity/lib/packages/editable` → `@socketsecurity/lib/packages/edit`
704
- - `@socketsecurity/lib/maintained-node-versions` `@socketsecurity/lib/constants/maintained-node-versions`
705
- - `@socketsecurity/lib/package-default-node-range` → `@socketsecurity/lib/constants/package-default-node-range`
706
- - `@socketsecurity/lib/package-default-socket-categories` → `@socketsecurity/lib/constants/package-default-socket-categories`
707
- - `@socketsecurity/lib/lifecycle-script-names` → `@socketsecurity/lib/constants/lifecycle-script-names`
708
- - `@socketsecurity/lib/dlx` → Split into `@socketsecurity/lib/dlx/cache`, `@socketsecurity/lib/dlx/dir`, `@socketsecurity/lib/dlx/packages`, `@socketsecurity/lib/dlx/paths`
709
- - `@socketsecurity/lib/dlx-binary` → `@socketsecurity/lib/dlx/binary`
710
- - `@socketsecurity/lib/dlx-manifest` → `@socketsecurity/lib/dlx/manifest`
711
- - `@socketsecurity/lib/dlx-package` → `@socketsecurity/lib/dlx/package`
712
-
713
- - **json**: Reorganized JSON utilities into modular submodules (json/edit, json/format, json/parse, json/types)
714
- - Removed barrel index file in favor of direct submodule imports
715
- - Better separation of concerns and tree-shaking
716
-
717
- - **dlx**: Split monolithic DLX module into focused submodules (cache, dir, packages, paths)
718
- - Improved modularity and maintainability
719
- - Better code organization and discoverability
555
+ - **BREAKING**: Module path reorganization:
556
+ - `json/editable` → `json/edit`
557
+ - `packages/editable` → `packages/edit`
558
+ - `maintained-node-versions`, `package-default-node-range`, `package-default-socket-categories`, `lifecycle-script-names` → moved under `constants/`
559
+ - `dlx`split into `dlx/cache`, `dlx/dir`, `dlx/packages`, `dlx/paths`
560
+ - `dlx-binary` → `dlx/binary`; `dlx-manifest` → `dlx/manifest`; `dlx-package` → `dlx/package`
720
561
 
721
562
  ## [4.4.0](https://github.com/SocketDev/socket-lib/releases/tag/v4.4.0) - 2025-11-25
722
563
 
723
564
  ### Added
724
565
 
725
- - **fs**: Exported `normalizeEncoding()` function for robust encoding string normalization
726
- - Handles case-insensitive encoding names (e.g., 'UTF-8', 'utf8', 'UTF8')
727
- - Supports encoding aliases (e.g., 'binary' → 'latin1', 'ucs-2' → 'utf16le')
728
- - Fast-path optimization for common encodings
729
- - Defaults to 'utf8' for invalid or null encodings
730
- - Export: `@socketsecurity/lib/fs`
566
+ - `fs` `normalizeEncoding()` case-insensitive encoding normalization with aliases (`binary` → `latin1`, `ucs-2` → `utf16le`); defaults to `utf8`
731
567
 
732
568
  ### Fixed
733
569
 
734
- - **fs**: `safeReadFile()` and `safeReadFileSync()` type signatures and encoding handling
735
- - Corrected type overloads: `encoding: null` `Buffer | undefined`, no encoding `string | undefined` (UTF-8 default)
736
- - Fixed implementation to properly handle `encoding: null` for Buffer returns
737
-
738
- - **suppress-warnings**: `withSuppressedWarnings()` now properly restores warning state
739
- - Fixed state restoration to only remove warning types that were added by the function
740
- - Prevents accidental removal of warnings that were already suppressed
741
- - Ensures correct cleanup behavior when warning types are nested or reused
570
+ - `fs` `safeReadFile` / `safeReadFileSync` — corrected type overloads (`encoding: null` → `Buffer`; no encoding → `string`)
571
+ - `suppress-warnings` `withSuppressedWarnings()` properly restores state, only removing warnings the function added
742
572
 
743
573
  ## [4.3.0](https://github.com/SocketDev/socket-lib/releases/tag/v4.3.0) - 2025-11-20
744
574
 
745
575
  ### Added
746
576
 
747
- - **globs**: New `glob()` and `globSync()` wrapper functions for fast-glob
748
- - Provides convenient wrappers around fast-glob with normalized options
749
- - Maintains consistent API with existing glob functionality
750
- - Export: `@socketsecurity/lib/globs`
577
+ - `globs` `glob()` / `globSync()` wrapper functions for fast-glob with normalized options
751
578
 
752
579
  ## [4.1.0](https://github.com/SocketDev/socket-lib/releases/tag/v4.1.0) - 2025-11-17
753
580
 
754
581
  ### Added
755
582
 
756
- - **constants/node**: New version helper functions for cleaner version detection
757
- - `getNodeMinorVersion()`: Extract minor version number
758
- - `getNodePatchVersion()`: Extract patch version number
583
+ - `constants/node` `getNodeMinorVersion()`, `getNodePatchVersion()`
759
584
 
760
585
  ### Fixed
761
586
 
762
- - **constants/node**: Improve Node.js flag management in `getNodeHardenFlags()`
763
- - Properly guard `--experimental-permission` for Node 20-23 only
764
- - Properly guard `--permission` for Node 24+ only
765
- - Properly guard `--force-node-api-uncaught-exceptions-policy` for Node 22+ (was incorrectly applied to all versions)
766
- - Automatically include permission grants from `getNodePermissionFlags()` for Node 24+
767
- - Remove `--experimental-policy` flag (no policy file provided)
587
+ - `constants/node` `getNodeHardenFlags()` — `--experimental-permission` guarded for Node 20-23; `--permission` for Node 24+; `--force-node-api-uncaught-exceptions-policy` for Node 22+. Removed `--experimental-policy`
768
588
 
769
589
  ## [4.0.1](https://github.com/SocketDev/socket-lib/releases/tag/v4.0.1) - 2025-11-17
770
590
 
771
591
  ### Changed
772
592
 
773
- - Removed # path imports and replaced with relative paths
593
+ - Replaced `#`-path imports with relative paths
774
594
 
775
595
  ## [4.0.0](https://github.com/SocketDev/socket-lib/releases/tag/v4.0.0) - 2025-11-15
776
596
 
777
597
  ### Changed
778
598
 
779
- - **paths**: Reorganized path utilities into dedicated `paths/*` submodules for improved modularity
780
- - **imports**: Converted lazy require() calls to ES6 static imports for better tree-shaking and bundler compatibility
599
+ - **BREAKING**: `paths` reorganized into dedicated `paths/*` submodules
600
+ - Lazy `require()` calls converted to ES6 static imports for better tree-shaking
781
601
 
782
602
  ## [3.5.0](https://github.com/SocketDev/socket-lib/releases/tag/v3.5.0) - 2025-11-14
783
603
 
784
604
  ### Added
785
605
 
786
- - **argv/quote**: New utilities for quoting command-line arguments when using `spawn()` with `shell: true`
787
- - `posixQuote(arg)`: Quote arguments for POSIX shells (bash, sh, zsh) using single quotes
788
- - `win32Quote(arg)`: Quote arguments for Windows cmd.exe using double quotes
606
+ - `argv/quote` `posixQuote(arg)` (single-quote for bash/sh/zsh) and `win32Quote(arg)` (double-quote for cmd.exe). Use when invoking `spawn()` with `shell: true`
789
607
 
790
608
  ## [3.4.0](https://github.com/SocketDev/socket-lib/releases/tag/v3.4.0) - 2025-11-14
791
609
 
792
610
  ### Added
793
611
 
794
- - **Spinner**: New `skip()` and `skipAndStop()` methods for displaying skipped operations
795
- - `skip(text)`: Display skip message alongside spinner (e.g., "Skipping optional step...")
796
- - `skipAndStop(text)`: Display skip message and stop spinner in one call
797
- - Uses cyan ↻ (refresh/reload) symbol with @ ASCII fallback
798
- - Normalizes text formatting consistently with other spinner methods
799
- - Useful for communicating skipped steps during long-running operations
800
-
801
- - **Logger**: New `skip()` method and symbol for skipped operations
802
- - `LOG_SYMBOLS.skip`: New cyan ↻ symbol for skip output (@ ASCII fallback)
803
- - `skip(message)`: Display skip messages with dedicated symbol
804
- - Complements existing info/step/success/error/warning/reason methods
612
+ - `Spinner` `skip(text)` / `skipAndStop(text)` display skip messages with cyan ↻ symbol
613
+ - `Logger` `skip(message)` and `LOG_SYMBOLS.skip`
805
614
 
806
615
  ## [3.3.11](https://github.com/SocketDev/socket-lib/releases/tag/v3.3.11) - 2025-11-14
807
616
 
808
617
  ### Fixed
809
618
 
810
- - **prompts**: Fix "inquirerPrompt is not a function" error in interactive prompts
811
- - Properly handle inquirer modules with multiple exports (select, search)
619
+ - `prompts` "inquirerPrompt is not a function" when inquirer modules expose multiple exports (select, search)
812
620
 
813
621
  ## [3.3.10](https://github.com/SocketDev/socket-lib/releases/tag/v3.3.10) - 2025-11-14
814
622
 
815
623
  ### Fixed
816
624
 
817
- - **deps**: Add string-width and wrap-ansi overrides for bundling compatibility
818
- - Forces string-width@8.1.0 and wrap-ansi@9.0.2 for compatibility with strip-ansi@7.1.2
625
+ - `string-width@8.1.0` and `wrap-ansi@9.0.2` overrides for `strip-ansi@7.1.2` compatibility
819
626
 
820
627
  ## [3.3.9](https://github.com/SocketDev/socket-lib/releases/tag/v3.3.9) - 2025-11-14
821
628
 
822
629
  ### Fixed
823
630
 
824
- - **deps**: Add strip-ansi override to fix bundling compatibility
825
- - Forces strip-ansi@7.1.2 for compatibility with ansi-regex@6.2.2
631
+ - `strip-ansi@7.1.2` override for `ansi-regex@6.2.2` compatibility
826
632
 
827
633
  ## [3.3.8](https://github.com/SocketDev/socket-lib/releases/tag/v3.3.8) - 2025-11-14
828
634
 
829
635
  ### Fixed
830
636
 
831
- - **spinner**: Clear remaining artifacts after withSpinner stops
832
- - Fixed rogue spinner characters persisting after spinner completes
637
+ - `spinner` clear remaining artifacts after `withSpinner` stops (rogue spinner characters)
833
638
 
834
639
  ## [3.3.7](https://github.com/SocketDev/socket-lib/releases/tag/v3.3.7) - 2025-11-13
835
640
 
836
641
  ### Changed
837
642
 
838
- - **refactor**: Add explicit `.js` extensions to external require calls
839
- - Improves module resolution clarity and compatibility with modern bundlers
840
- - Updated 18 require calls across 10 source files
643
+ - Explicit `.js` extensions on external `require()` calls for modern bundler compat
841
644
 
842
645
  ## [3.3.6](https://github.com/SocketDev/socket-lib/releases/tag/v3.3.6) - 2025-11-13
843
646
 
844
647
  ### Changed
845
648
 
846
- - **deps**: Add pnpm overrides to consolidate package versions
847
- - Force single versions: `@npmcli/arborist@9.1.6`, `@npmcli/run-script@10.0.0`, `semver@7.7.2`, `ansi-regex@6.2.2`, `lru-cache@11.2.2`
848
- - Update patch from `@npmcli/run-script@9.1.0` to `@npmcli/run-script@10.0.0`
849
- - Reduces duplicate dependencies and potential version conflicts
649
+ - pnpm overrides consolidate `@npmcli/arborist@9.1.6`, `@npmcli/run-script@10.0.0`, `semver@7.7.2`, `ansi-regex@6.2.2`, `lru-cache@11.2.2` to single versions
850
650
 
851
651
  ## [3.3.5](https://github.com/SocketDev/socket-lib/releases/tag/v3.3.5) - 2025-11-13
852
652
 
853
653
  ### Fixed
854
654
 
855
- - **build**: Add patches to prevent node-gyp bundling issues
655
+ - Patches to prevent `node-gyp` bundling issues
856
656
 
857
657
  ## [3.3.4](https://github.com/SocketDev/socket-lib/releases/tag/v3.3.4) - 2025-11-13
858
658
 
859
659
  ### Fixed
860
660
 
861
- - **build**: Mark node-gyp as external in npm-pack bundle
661
+ - `node-gyp` marked external in `npm-pack` bundle
862
662
 
863
663
  ## [3.3.3](https://github.com/SocketDev/socket-lib/releases/tag/v3.3.3) - 2025-11-13
864
664
 
865
665
  ### Fixed
866
666
 
867
- - **build**: Break node-gyp string to prevent bundler issues with ESM/CJS interop
667
+ - `node-gyp` string broken to prevent bundler ESM/CJS interop issues
868
668
 
869
669
  ## [3.3.2](https://github.com/SocketDev/socket-lib/releases/tag/v3.3.2) - 2025-11-13
870
670
 
871
671
  ### Changed
872
672
 
873
- - **dlx**: Install package dependencies after download
874
- - **external**: Optimize npm package bundle sizes (~3MB reduction)
673
+ - `dlx` installs package dependencies after download
674
+ - npm package bundle sizes reduced ~3 MB
875
675
 
876
676
  ## [3.3.1](https://github.com/SocketDev/socket-lib/releases/tag/v3.3.1) - 2025-11-11
877
677
 
878
678
  ### Added
879
679
 
880
- - Added `SOCKET_DOCS_CONTACT_URL` constant for documentation contact support page
881
- - Added `checkbox` prompt support
680
+ - `SOCKET_DOCS_CONTACT_URL` constant
681
+ - `checkbox` prompt support
882
682
 
883
683
  ## [3.3.0](https://github.com/SocketDev/socket-lib/releases/tag/v3.3.0) - 2025-11-07
884
684
 
885
685
  ### Added
886
686
 
887
- - **Spinner**: New `reason()` and `reasonAndStop()` methods for displaying working/thinking output
888
- - `reason(text)`: Display reason text alongside spinner (e.g., "Analyzing dependencies...")
889
- - `reasonAndStop(text)`: Display reason text and stop spinner in one call
890
- - Normalizes text formatting consistently with other spinner methods
891
- - Useful for communicating progress steps during long-running operations
892
-
893
- - **Logger**: New `reason()` method and symbol for working/thinking output
894
- - `LOG_SYMBOLS.reason`: New symbol for reason output (distinct from info/step symbols)
895
- - `reason(message)`: Display reason messages with dedicated symbol
896
- - Complements existing info/step/success/error/warning methods
687
+ - `Spinner` `reason(text)` / `reasonAndStop(text)` display working/thinking output
688
+ - `Logger` `reason(message)` and `LOG_SYMBOLS.reason`
897
689
 
898
690
  ## [3.2.8](https://github.com/SocketDev/socket-lib/releases/tag/v3.2.8) - 2025-11-05
899
691
 
900
692
  ### Fixed
901
693
 
902
- - **build**: Fix CommonJS export script edge cases
903
- - Fixed stray semicolons after comment placeholders in transformed modules
904
- - Fixed incorrect transformation of `module.exports.default` to `module.module.exports`
905
- - Ensures external dependencies and default exports work correctly
694
+ - CommonJS export script edge cases (stray semicolons after comment placeholders; incorrect `module.exports.default` → `module.module.exports`)
906
695
 
907
696
  ## [3.2.7](https://github.com/SocketDev/socket-lib/releases/tag/v3.2.7) - 2025-11-05
908
697
 
909
698
  ### Fixed
910
699
 
911
- - **build-externals**: Disable minification to preserve exports
912
- - External dependencies are no longer minified during bundling
913
- - Prevents export name mangling that breaks CommonJS interop
914
- - Fixes `semver.parse()` and `semver.major()` being undefined
915
-
916
- - **build**: Fix CommonJS export interop for TypeScript default exports
917
- - Modules with `export default` now work without requiring `.default` accessor
918
-
919
- ### Changed
920
-
921
- - **docs**: Moved packages README to correct location (`src/packages/README.md`)
700
+ - External dependency minification disabled to preserve exports (was breaking `semver.parse()`, `semver.major()`)
701
+ - CommonJS export interop for TypeScript `export default` no longer needs `.default` accessor
922
702
 
923
703
  ## [3.2.6](https://github.com/SocketDev/socket-lib/releases/tag/v3.2.6) - 2025-11-05
924
704
 
925
705
  ### Fixed
926
706
 
927
- - **logger**: Replace yoctocolors-cjs rgb() with manual ANSI codes
928
- - The yoctocolors-cjs package doesn't have an rgb() method
929
- - Manually construct ANSI escape sequences for RGB colors (ESC[38;2;r;g;bm...ESC[39m)
930
- - Affects `src/logger.ts` and `src/stdio/prompts.ts` applyColor() functions
707
+ - `logger` and `stdio/prompts` — manual ANSI escape sequences for RGB colors (yoctocolors-cjs has no `rgb()` method)
931
708
 
932
709
  ## [3.2.5](https://github.com/SocketDev/socket-lib/releases/tag/v3.2.5) - 2025-11-05
933
710
 
934
711
  ### Added
935
712
 
936
- - **scripts**: Add path alias resolution script (`fix-path-aliases.mjs`)
937
- - Resolves internal path aliases (`#lib/*`, `#constants/*`, etc.) to relative paths in built CommonJS files
938
-
939
- - **build**: Integrate path alias resolution into build pipeline
940
- - Add path alias plugin to esbuild config
941
- - Integrate `fix-path-aliases.mjs` into build process
942
- - Ensures path aliases work correctly in compiled CommonJS output
713
+ - Path alias resolution in build pipeline — `#lib/*` / `#constants/*` aliases resolve to relative paths in compiled CommonJS
943
714
 
944
715
  ## [3.2.4](https://github.com/SocketDev/socket-lib/releases/tag/v3.2.4) - 2025-11-04
945
716
 
946
717
  ### Added
947
718
 
948
- - **Logger**: New `time()` method for timing operations with automatic duration reporting
949
- - Starts a named timer and returns a `stop()` function
950
- - Automatically logs completion with formatted duration (e.g., "Operation completed in 1.23s")
951
- - Useful for performance monitoring and debugging
719
+ - `Logger` `time()` start a named timer; returns `stop()` that logs completion with formatted duration
952
720
 
953
721
  ### Fixed
954
722
 
955
- - **Spinner effects**: Fixed star spinner frames by adding trailing space for consistent spacing
956
- - **Build system**: Fixed external dependency bundling issues
957
- - Bundle `@npmcli/package-json` with subpath exports support
958
- - Use `src/external` files as bundle entry points for proper module resolution
959
- - Bundle libnpmexec from npm instead of using vendored version
960
- - Prevent circular dependencies with `createForceNodeModulesPlugin()` to force resolution from node_modules
961
-
962
- ## [3.2.3](https://github.com/SocketDev/socket-lib/releases/tag/v3.2.3) - 2025-11-03
963
-
964
- ### Internal
965
-
966
- - **Build system**: Added stub infrastructure for external dependency bundling
967
- - Created organized `scripts/build-externals/stubs/` directory with utility and active stubs
968
- - Added conservative stubs for unused dependencies: `encoding`/`iconv-lite` and `debug`
969
- - Reduces external bundle size by ~18KB (9KB from encoding stubs, 9KB from debug stubs)
723
+ - Star spinner frames added trailing space for consistent spacing
970
724
 
971
725
  ## [3.2.2](https://github.com/SocketDev/socket-lib/releases/tag/v3.2.2) - 2025-11-03
972
726
 
973
727
  ### Added
974
728
 
975
- - **DLX**: Binary permission management with chmod 0o755 for all package binaries
976
- - New `makePackageBinsExecutable()` function ensures all binaries in installed packages are executable
977
- - Aligns with npm's cmd-shim approach for binary permissions
978
- - Handles both single and multiple binary packages
979
- - No-op on Windows (permissions not needed)
980
-
981
- - **DLX**: npm-compatible bin resolution via vendored `getBinFromManifest`
982
- - Cherry-picked `getBinFromManifest` from libnpmexec@10.1.8 (~1.5 KB)
983
- - Avoids 1.1 MB bundle by vendoring single function instead of full package
984
- - Provides battle-tested npm bin resolution strategy
985
- - Maintains user-friendly fallbacks for edge cases
986
-
987
- ### Changed
988
-
989
- - **DLX**: Enhanced `findBinaryPath()` with npm's resolution strategy
990
- - Primary: npm's `getBinFromManifest` (handles standard cases and aliases)
991
- - Fallback: user-provided `binaryName` parameter
992
- - Fallback: last segment of package name
993
- - Last resort: first binary in list
729
+ - `dlx` `makePackageBinsExecutable()` chmod 0o755 on all package binaries (no-op on Windows)
730
+ - `dlx` `findBinaryPath()` adopts npm's resolution strategy (vendored `getBinFromManifest` from libnpmexec)
994
731
 
995
732
  ### Performance
996
733
 
997
- - **Optimized package size**: Reduced bundle size through strategic export minimization and vendoring
998
- - Vendored `getBinFromManifest` function instead of bundling full libnpmexec (~1.1 MB savings)
999
- - Minimized external module exports for better tree-shaking:
1000
- - `fast-sort`: Now exports only `{ createNewSortInstance }` (2.1 KB, 96% reduction from ~56 KB)
1001
- - `fast-glob`: Now exports only `{ globStream }` (82 KB bundle)
1002
- - `del`: Now exports only `{ deleteAsync, deleteSync }` (100 KB bundle)
1003
- - `streaming-iterables`: Now exports only `{ parallelMap, transform }` (11 KB, 93% reduction from ~168 KB)
1004
- - Total savings: ~1.3 MB (1.1 MB from vendoring + 211 KB from minimized exports)
1005
- - Establishes pattern for future external module additions
734
+ - Bundle size reduced ~1.3 MB total vendored `getBinFromManifest` (1.1 MB savings) + minimized exports for `fast-sort`, `fast-glob`, `del`, `streaming-iterables`
1006
735
 
1007
736
  ## [3.2.1](https://github.com/SocketDev/socket-lib/releases/tag/v3.2.1) - 2025-11-02
1008
737
 
1009
738
  ### Changed
1010
739
 
1011
- - **Logger/Spinner**: Use module-level constants to prevent duplicate and rogue spinner indicators
1012
- - Call `getDefaultLogger()` and `getDefaultSpinner()` once at module scope instead of repeated calls
1013
- - Prevents multiple spinner instances that can cause duplicate or lingering indicators in terminal output
1014
- - Applied in `src/dlx-manifest.ts`, `src/stdio/mask.ts`, and `src/spinner.ts`
1015
- - Follows DRY principle and aligns with socket-registry/socket-sdk-js patterns
1016
-
1017
- ### Fixed
1018
-
1019
- - **Scripts**: Fixed undefined logger variable in update script
1020
- - Replaced undefined `log` references with `_logger` throughout `scripts/update.mjs`
1021
- - Resolves ESLint errors that blocked test execution
1022
- - **Tests**: Improved stdout test stability by checking call delta instead of absolute counts
1023
- - Fixed flaky CI failures where spy call count was 101 instead of expected 100
1024
- - More robust approach handles potential state leakage between tests
1025
- - **Tests**: Removed unnecessary 10ms delay in cache-with-ttl test
1026
- - Cache with memoization enabled updates in-memory storage synchronously
1027
- - Delay was insufficient in CI and unnecessary given synchronous behavior
1028
- - Resolves flaky CI failures where cached values returned undefined
740
+ - `Logger` / `Spinner` call `getDefaultLogger()` / `getDefaultSpinner()` once at module scope to prevent duplicate spinner indicators
1029
741
 
1030
742
  ## [3.2.0](https://github.com/SocketDev/socket-lib/releases/tag/v3.2.0) - 2025-11-02
1031
743
 
1032
744
  ### Added
1033
745
 
1034
- - **DLX**: Unified manifest for packages and binaries
1035
- - Centralized manifest system for tracking DLX-compatible packages
1036
- - Simplifies package and binary lookups for dependency-free execution
746
+ - `dlx` unified manifest for packages and binaries
1037
747
 
1038
748
  ## [3.1.3](https://github.com/SocketDev/socket-lib/releases/tag/v3.1.3) - 2025-11-02
1039
749
 
1040
750
  ### Changed
1041
751
 
1042
- - **Dependencies**: Updated `@socketregistry/packageurl-js` to 1.3.5
752
+ - `@socketregistry/packageurl-js` updated to 1.3.5
1043
753
 
1044
754
  ## [3.1.2](https://github.com/SocketDev/socket-lib/releases/tag/v3.1.2) - 2025-11-02
1045
755
 
1046
756
  ### Fixed
1047
757
 
1048
- - **External dependencies**: Fixed incorrectly marked external dependencies to use wrapper pattern
1049
- - Updated `src/constants/agents.ts` to use `require('../external/which')` instead of direct imports
1050
- - Updated `src/zod.ts` to export from `./external/zod'` instead of direct imports
1051
- - Maintains zero dependencies policy by ensuring all runtime dependencies go through the external wrapper pattern
1052
- - **Spinner**: Fixed undefined properties in setShimmer by handling defaults correctly
758
+ - `Spinner` `setShimmer` handle undefined properties via defaults
759
+ - External deps now go through the wrapper pattern (`require('../external/which')`, etc.) maintains zero-deps policy
1053
760
 
1054
761
  ## [3.1.1](https://github.com/SocketDev/socket-lib/releases/tag/v3.1.1) - 2025-11-02
1055
762
 
1056
763
  ### Fixed
1057
764
 
1058
- - **Cache TTL**: Fixed flaky test by handling persistent cache write failures gracefully
1059
- - Wrapped `cacache.put` in try/catch to prevent failures when persistent cache writes fail or are slow
1060
- - In-memory cache is updated synchronously before the persistent write, so immediate reads succeed regardless of persistent cache state
1061
- - Improves reliability in test environments and when cache directory has issues
765
+ - `cache-with-ttl` `cacache.put` wrapped in try/catch so persistent-cache write failures don't break in-memory reads
1062
766
 
1063
767
  ## [3.1.0](https://github.com/SocketDev/socket-lib/releases/tag/v3.1.0) - 2025-11-01
1064
768
 
1065
769
  ### Changed
1066
770
 
1067
- - **File system utilities**: `safeMkdir` and `safeMkdirSync` now default to `recursive: true`
1068
- - Nested directories are created by default, simplifying common usage patterns
771
+ - `fs` `safeMkdir` / `safeMkdirSync` default to `recursive: true`
1069
772
 
1070
773
  ## [3.0.6](https://github.com/SocketDev/socket-lib/releases/tag/v3.0.6) - 2025-11-01
1071
774
 
1072
775
  ### Added
1073
776
 
1074
- - **Build validation**: Added guard against `link:` protocol dependencies in package.json
1075
- - New `validate-no-link-deps.mjs` script automatically runs during `pnpm run check`
1076
- - Prevents accidental publication with `link:` dependencies which can cause issues
1077
- - Recommends using `workspace:` for monorepos or `catalog:` for centralized version management
1078
- - Validates all dependency fields: dependencies, devDependencies, peerDependencies, optionalDependencies
777
+ - Build validation guard against `link:` protocol dependencies in `package.json` (`validate-no-link-deps.mjs` runs during `pnpm run check`)
1079
778
 
1080
779
  ### Changed
1081
780
 
1082
- - **Dependencies**: Updated `@socketregistry/packageurl-js` to 1.3.3
1083
- - **Git hooks**: Committed pre-commit and pre-push hook configurations for version control
1084
- - **Scripts**: Removed shebang from `validate-no-link-deps` script (Node.js script, not shell)
781
+ - `@socketregistry/packageurl-js` updated to 1.3.3
1085
782
 
1086
783
  ## [3.0.5](https://github.com/SocketDev/socket-lib/releases/tag/v3.0.5) - 2025-11-01
1087
784
 
1088
785
  ### Fixed
1089
786
 
1090
- - **Critical: Prompts API breaking changes**: Restored working prompts implementation that was accidentally replaced with non-functional stub in v3.0.0
1091
- - Consolidated all prompts functionality into `src/stdio/prompts.ts`
1092
- - Removed unimplemented stub from `src/prompts/` that was throwing "not yet implemented" errors
1093
- - Removed `./prompts` package export (use `@socketsecurity/lib/stdio/prompts` instead)
1094
- - Restored missing exports: `password`, `search`, `Separator`, and added `createSeparator()` helper
1095
- - Fixed `Choice` type to use correct `name` property (matching `@inquirer` API, not erroneous `label`)
787
+ - **Critical**: prompts API restored non-functional stub from v3.0.0 replaced with working implementation. `@socketsecurity/lib/stdio/prompts` exports `password`, `search`, `Separator`, `createSeparator()`. `Choice.name` (was erroneously `label`)
1096
788
 
1097
789
  ### Added
1098
790
 
1099
- - **Theme integration for prompts**: Prompts now automatically use the active theme colors
1100
- - Prompt messages styled with `colors.prompt`
1101
- - Descriptions and disabled items styled with `colors.textDim`
1102
- - Answers and highlights styled with `colors.primary`
1103
- - Error messages styled with `colors.error`
1104
- - Success indicators styled with `colors.success`
1105
- - Exported `createInquirerTheme()` function for converting Socket themes to @inquirer format
1106
- - Consistent visual experience with Logger and Spinner theme integration
1107
-
1108
- - **Theme parameter support**: Logger, Prompts, and text effects now accept optional `theme` parameter
1109
- - Pass theme names (`'socket'`, `'sunset'`, `'terracotta'`, `'lush'`, `'ultra'`) or Theme objects
1110
- - **Logger**: `new Logger({ theme: 'sunset' })` - uses theme-specific symbol colors
1111
- - **Prompts**: `await input({ message: 'Name:', theme: 'ultra' })` - uses theme for prompt styling
1112
- - **Text effects**: `applyShimmer(text, state, { theme: 'terracotta' })` - uses theme for shimmer colors
1113
- - Instance-specific themes override global theme context when provided
1114
- - Falls back to global theme context when no instance theme specified
1115
- - **Note**: Spinner already had theme parameter support in v3.0.0
791
+ - Prompts adopt the active theme (`colors.prompt`, `textDim`, `primary`, `error`, `success`); `createInquirerTheme()` exported
792
+ - Theme parameter support `Logger`, prompts, and text effects accept `theme: 'socket' | 'sunset' | 'terracotta' | 'lush' | 'ultra'` (or a Theme object)
1116
793
 
1117
794
  ### Removed
1118
795
 
1119
- - **Unused index entrypoint**: Removed `src/index.ts` and package exports for `"."` and `"./index"`
1120
- - This was a leftover from socket-registry and not needed for this library
1121
- - Users should import specific modules directly (e.g., `@socketsecurity/lib/logger`)
1122
- - Breaking: `import { getDefaultLogger } from '@socketsecurity/lib'` no longer works
1123
- - Use: `import { getDefaultLogger } from '@socketsecurity/lib/logger'` instead
796
+ - **BREAKING**: `src/index.ts` deleted; main index `"."` / `"./index"` exports gone. Import specific modules: `@socketsecurity/lib/logger` instead of `@socketsecurity/lib`
1124
797
 
1125
798
  ## [3.0.4](https://github.com/SocketDev/socket-lib/releases/tag/v3.0.4) - 2025-11-01
1126
799
 
1127
800
  ### Changed
1128
801
 
1129
- - **Sunset theme**: Updated colors from azure blue to warm orange/purple gradient matching Coana branding
1130
- - **Terracotta theme**: Renamed from `brick` to `terracotta` for better clarity
802
+ - Sunset theme azure blue warm orange/purple gradient (Coana branding)
803
+ - `brick` theme renamed to `terracotta`
1131
804
 
1132
805
  ## [3.0.3](https://github.com/SocketDev/socket-lib/releases/tag/v3.0.3) - 2025-11-01
1133
806
 
1134
807
  ### Fixed
1135
808
 
1136
- - **Critical: Node.js ESM/CJS interop completely fixed**: Disabled minification to ensure proper ESM named import detection
1137
- - Root cause: esbuild minification was breaking Node.js ESM's CJS named export detection
1138
- - Solution: Disabled minification entirely (`minify: false` in esbuild config)
1139
- - Libraries should not be minified - consumers minify during their own build process
1140
- - Unminified esbuild output uses clear `__export` patterns that Node.js ESM natively understands
1141
- - Removed `fix-commonjs-exports.mjs` build script - no longer needed with unminified code
1142
- - ESM imports now work reliably: `import { getDefaultLogger } from '@socketsecurity/lib/logger'`
1143
- - Verified with real-world ESM module testing (`.mjs` files importing from CJS `.js` dist)
809
+ - **Critical**: Node.js ESM/CJS interop disabled esbuild minification (was breaking ESM named-import detection from CJS dist). ESM imports now work reliably
1144
810
 
1145
811
  ## [3.0.2](https://github.com/SocketDev/socket-lib/releases/tag/v3.0.2) - 2025-11-01
1146
812
 
1147
813
  ### Fixed
1148
814
 
1149
- - **Critical: Node.js ESM named imports from CommonJS**: Fixed build output to ensure Node.js ESM can properly detect named exports from CommonJS modules
1150
- - Previously, esbuild's minified export pattern placed `module.exports` before variable definitions, causing "Cannot access before initialization" errors
1151
- - Build script now uses `@babel/parser` + `magic-string` for safe AST parsing and transformation
1152
- - Exports are now correctly placed at end of files after all variable definitions
1153
- - Enables proper ESM named imports: `import { getDefaultLogger, Logger } from '@socketsecurity/lib/logger'`
1154
- - Fixes socket-cli issue where named imports were failing with obscure initialization errors
815
+ - **Critical**: Node.js ESM named imports from CommonJS `module.exports` placed before variable defs caused "Cannot access before initialization". Build now uses `@babel/parser` + `magic-string` to position exports at end of file
1155
816
 
1156
817
  ## [3.0.1](https://github.com/SocketDev/socket-lib/releases/tag/v3.0.1) - 2025-11-01
1157
818
 
1158
819
  ### Added
1159
820
 
1160
- - **Convenience exports from main index**: Added logger and spinner exports to ease v2→v3 migration
1161
- - Logger: `getDefaultLogger()`, `Logger`, `LOG_SYMBOLS` now available from `@socketsecurity/lib`
1162
- - Spinner: `getDefaultSpinner()`, `Spinner` now available from `@socketsecurity/lib`
1163
- - Both main index (`@socketsecurity/lib`) and subpath (`@socketsecurity/lib/logger`, `@socketsecurity/lib/spinner`) imports now work
1164
- - Both import paths return the same singleton instances
821
+ - Convenience re-exports of `getDefaultLogger`, `Logger`, `LOG_SYMBOLS`, `getDefaultSpinner`, `Spinner` from main index for v2→v3 migration
1165
822
 
1166
823
  ### Fixed
1167
824
 
1168
- - **Critical: Spinner crashes when calling logger**: Fixed spinner internal calls to use `getDefaultLogger()` instead of removed `logger` export
1169
- - Spinner methods (`start()`, `stop()`, `success()`, `fail()`, etc.) no longer crash with "logger is not defined" errors
1170
- - All 5 internal logger access points updated to use the correct v3 API
1171
- - Resolves runtime errors when using spinners with hoisted variables
1172
-
1173
- ### Changed
1174
-
1175
- - **Migration path improvement**: Users can now import logger/spinner from either main index or subpaths, reducing breaking change impact from v3.0.0
825
+ - **Critical**: Spinner internal calls to removed `logger` export use `getDefaultLogger()` (5 call sites)
1176
826
 
1177
827
  ## [3.0.0](https://github.com/SocketDev/socket-lib/releases/tag/v3.0.0) - 2025-11-01
1178
828
 
1179
829
  ### Added
1180
830
 
1181
- - Theme system with 5 built-in themes: `socket`, `sunset`, `terracotta`, `lush`, `ultra`
1182
- - `setTheme()`, `getTheme()`, `withTheme()`, `withThemeSync()` for theme management
1183
- - `createTheme()`, `extendTheme()`, `resolveColor()` helper functions
1184
- - `onThemeChange()` event listener for theme reactivity
1185
- - `link()` function for themed terminal hyperlinks in `@socketsecurity/lib/links`
1186
- - Logger and spinner now inherit theme colors automatically
1187
- - Spinner methods: `enableShimmer()`, `disableShimmer()`, `setShimmer()`, `updateShimmer()`
1188
- - DLX cross-platform binary resolution (`.cmd`, `.bat`, `.ps1` on Windows)
1189
- - DLX programmatic options aligned with CLI conventions (`force`, `quiet`, `package`)
831
+ - Theme system 5 built-in themes (`socket`, `sunset`, `terracotta`, `lush`, `ultra`); `setTheme`, `getTheme`, `withTheme`, `withThemeSync`, `createTheme`, `extendTheme`, `resolveColor`, `onThemeChange`
832
+ - `links` `link()` themed terminal hyperlinks
833
+ - Logger and spinner inherit theme colors
834
+ - Spinner methods: `enableShimmer`, `disableShimmer`, `setShimmer`, `updateShimmer`
835
+ - `dlx` cross-platform binary resolution (`.cmd`, `.bat`, `.ps1` on Windows)
1190
836
 
1191
837
  ### Changed
1192
838
 
1193
- - Theme context uses AsyncLocalStorage instead of manual stack management
1194
- - Promise retry options renamed: `factor` → `backoffFactor`, `minTimeout` → `baseDelayMs`, `maxTimeout` → `maxDelayMs`
839
+ - Theme context uses `AsyncLocalStorage` instead of manual stack
840
+ - **BREAKING**: Promise retry options renamed `factor` → `backoffFactor`, `minTimeout` → `baseDelayMs`, `maxTimeout` → `maxDelayMs`
1195
841
 
1196
842
  ### Removed
1197
843
 
1198
- **BREAKING CHANGES:**
1199
-
1200
- - `pushTheme()` and `popTheme()` - use `withTheme()` or `withThemeSync()` instead
1201
- - `logger` export - use `getDefaultLogger()` instead
1202
- - `spinner` export - use `getDefaultSpinner()` instead
1203
- - `download-lock.ts` - use `process-lock.ts` instead
844
+ - **BREAKING**: `pushTheme()` / `popTheme()` — use `withTheme()` / `withThemeSync()`
845
+ - **BREAKING**: `logger` / `spinner` exports — use `getDefaultLogger()` / `getDefaultSpinner()`
846
+ - **BREAKING**: `download-lock.ts` use `process-lock.ts`
1204
847
  - Promise option aliases: `factor`, `minTimeout`, `maxTimeout`
1205
848
 
1206
- ---
1207
-
1208
- # Changelog
1209
-
1210
- All notable changes to this project will be documented in this file.
1211
-
1212
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
1213
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
1214
-
1215
849
  ## [2.10.3](https://github.com/SocketDev/socket-lib/releases/tag/v2.10.3) - 2025-10-31
1216
850
 
1217
851
  ### Fixed
1218
852
 
1219
- - Updated `@socketregistry/packageurl-js` to 1.3.1 to resolve an unintended external dependency
1220
- - **Documentation**: Corrected JSDoc `@example` import paths from `@socketsecurity/registry` to `@socketsecurity/lib` across utility modules
1221
- - Updated examples in `memoization.ts`, `performance.ts`, `spinner.ts`, `suppress-warnings.ts`, and `tables.ts`
1222
- - Ensures documentation reflects correct package name after v1.0.0 rename
853
+ - `@socketregistry/packageurl-js` updated to 1.3.1 (resolves unintended external dep)
854
+ - JSDoc `@example` import paths corrected after v1.0.0 rename (`@socketsecurity/registry` `@socketsecurity/lib`)
1223
855
 
1224
856
  ## [2.10.2](https://github.com/SocketDev/socket-lib/releases/tag/v2.10.2) - 2025-10-31
1225
857
 
1226
858
  ### Changed
1227
859
 
1228
- - **Package spec parsing**: Refactored to use official `npm-package-arg` library for robust handling of all npm package specification formats (versions, ranges, tags, git URLs)
1229
- - Improves reliability when parsing complex package specs
1230
- - Better handles edge cases in version ranges and scoped packages
1231
- - Falls back to simple parsing if npm-package-arg fails
860
+ - Package spec parsing uses official `npm-package-arg` library for full npm spec support (versions, ranges, tags, git URLs); falls back to simple parsing if it fails
1232
861
 
1233
862
  ### Fixed
1234
863
 
1235
- - **Scoped package version parsing**: Fixed critical bug where parsePackageSpec was stripping the `@` prefix from scoped packages with versions
1236
- - Example: `@coana-tech/cli@~14.12.51` was incorrectly parsed as `coana-tech/cli@~14.12.51`
1237
- - Caused package installation failures for scoped packages in DLX system
864
+ - **Critical**: `parsePackageSpec` no longer strips the `@` prefix from scoped+versioned specs (e.g., `@coana-tech/cli@~14.12.51`)
1238
865
 
1239
866
  ## [2.10.1](https://github.com/SocketDev/socket-lib/releases/tag/v2.10.1) - 2025-10-31
1240
867
 
1241
868
  ### Fixed
1242
869
 
1243
- - **Process lock directory creation**: Use recursive mkdir to ensure parent directories exist when creating lock directory
1244
- - **Node.js debug flags**: Remove buggy `getNodeDebugFlags()` function that returned debug flags without required argument values
870
+ - Process lock recursive mkdir for parent dirs
871
+ - Removed buggy `getNodeDebugFlags()` (returned flags without required argument values)
1245
872
 
1246
873
  ## [2.10.0](https://github.com/SocketDev/socket-lib/releases/tag/v2.10.0) - 2025-10-30
1247
874
 
1248
875
  ### Added
1249
876
 
1250
- - **Unified DLX metadata schema**: Standardized `.dlx-metadata.json` format across TypeScript and C++ implementations
1251
- - Exported `DlxMetadata` interface as canonical schema reference
1252
- - Core fields: `version`, `cache_key`, `timestamp`, `checksum`, `checksum_algorithm`, `platform`, `arch`, `size`, `source`
1253
- - Support for `source` tracking (download vs decompression origin)
1254
- - Reserved `extra` field for implementation-specific data
1255
- - Comprehensive documentation with examples for both download and decompression use cases
877
+ - Unified `.dlx-metadata.json` schema `DlxMetadata` interface exported. Fields: `version`, `cache_key`, `timestamp`, `checksum`, `checksum_algorithm`, `platform`, `arch`, `size`, `source` (`{ type, url }`); reserved `extra` for impl-specific data
1256
878
 
1257
879
  ### Changed
1258
880
 
1259
- - **DLX binary metadata structure**: Updated `writeBinaryCacheMetadata()` to use unified schema with additional fields
1260
- - Now includes `cache_key` (first 16 chars of SHA-512 hash)
1261
- - Added `size` field for cached binary size
1262
- - Added `checksum_algorithm` field (currently "sha256")
1263
- - Restructured to use `source.type` and `source.url` for origin tracking
1264
- - Maintains backward compatibility in `listDlxCache()` reader
881
+ - `dlx` `writeBinaryCacheMetadata()` adopts the unified schema (`cache_key` = SHA-512 prefix, `size`, `checksum_algorithm`, `source.type`/`source.url`)
1265
882
 
1266
883
  ## [2.9.1](https://github.com/SocketDev/socket-lib/releases/tag/v2.9.1) - 2025-10-30
1267
884
 
1268
885
  ### Added
1269
886
 
1270
- - **Smart binary detection in dlxPackage**: Automatically finds the correct binary even when package name doesn't match binary name
1271
- - If package has single binary, uses it automatically regardless of name
1272
- - Resolves packages like `@socketsecurity/cli` (binary: `socket`) without manual configuration
1273
- - Falls back to intelligent name matching for multi-binary packages
1274
- - **Optional binaryName parameter**: Added `binaryName` option to `DlxPackageOptions` for explicit binary selection when auto-detection isn't sufficient
887
+ - `dlxPackage` smart binary detection uses single-binary packages directly regardless of name. Optional `binaryName` for explicit selection on multi-binary packages
1275
888
 
1276
889
  ### Fixed
1277
890
 
1278
- - **Binary resolution for scoped packages**: Fixed issue where `dlxPackage` couldn't find binaries when package name didn't match binary name (e.g., `@socketsecurity/cli` with `bin: { socket: '...' }`)
891
+ - Binary resolution for scoped packages where package name binary name (e.g., `@socketsecurity/cli` exposes `bin: { socket: '...' }`)
1279
892
 
1280
893
  ## [2.9.0](https://github.com/SocketDev/socket-lib/releases/tag/v2.9.0) - 2025-10-30
1281
894
 
1282
895
  ### Added
1283
896
 
1284
- - **Socket.dev URL constants**: Added centralized URL constants for Socket.dev services
1285
- - `SOCKET_WEBSITE_URL`: Main Socket.dev website
1286
- - `SOCKET_CONTACT_URL`: Contact page
1287
- - `SOCKET_DASHBOARD_URL`: Dashboard homepage
1288
- - `SOCKET_API_TOKENS_URL`: API tokens settings page
1289
- - `SOCKET_PRICING_URL`: Pricing information
1290
- - `SOCKET_STATUS_URL`: Service status page
1291
- - `SOCKET_DOCS_URL`: Documentation site
1292
- - Available via `@socketsecurity/lib/constants/socket`
897
+ - `constants/socket` URL constants `SOCKET_WEBSITE_URL`, `SOCKET_CONTACT_URL`, `SOCKET_DASHBOARD_URL`, `SOCKET_API_TOKENS_URL`, `SOCKET_PRICING_URL`, `SOCKET_STATUS_URL`, `SOCKET_DOCS_URL`
1293
898
 
1294
899
  ### Changed
1295
900
 
1296
- - **Enhanced error messages across library**: Comprehensive audit and improvement of error handling
1297
- - Added actionable error messages with resolution steps throughout modules
1298
- - Improved file system operation errors (permissions, read-only filesystems, path issues)
1299
- - Enhanced DLX error messages with clear troubleshooting guidance
1300
- - Better error context in process locking, binary downloads, and package operations
1301
- - Consistent error formatting with helpful user guidance
1302
- - **Consolidated process locking**: Standardized on directory-based lock format across all modules
1303
- - All locking operations now use `process-lock` module exclusively
1304
- - Lock directories provide atomic guarantees across all filesystems including NFS
1305
- - Consistent mtime-based stale detection with 5-second timeout (aligned with npm npx)
1306
- - Automatic cleanup on process exit with proper signal handling
901
+ - Error messages across the library actionable resolution steps for fs, dlx, process-lock, downloads
902
+ - All locking consolidated on `process-lock` (atomic mkdir-based; 5s stale timeout aligned with npm npx)
1307
903
 
1308
904
  ## [2.8.4](https://github.com/SocketDev/socket-lib/releases/tag/v2.8.4) - 2025-10-30
1309
905
 
1310
906
  ### Added
1311
907
 
1312
- - **DLX binary helper functions mirror dlx-package pattern**
1313
- - `downloadBinary`: Download binary with caching (without execution)
1314
- - `executeBinary`: Execute cached binary without re-downloading
1315
- - Renamed internal `downloadBinary` to `downloadBinaryFile` to avoid naming conflicts
1316
- - Maintains feature parity with `downloadPackage`/`executePackage` from dlx-package
908
+ - `dlx` `downloadBinary` (cache without execution) and `executeBinary` (run cached binary). Internal `downloadBinary` renamed to `downloadBinaryFile` to avoid the naming conflict
1317
909
 
1318
910
  ## [2.8.3](https://github.com/SocketDev/socket-lib/releases/tag/v2.8.3) - 2025-10-30
1319
911
 
1320
912
  ### Fixed
1321
913
 
1322
- - **Logger now fully defers all console access for Node.js internal bootstrap compatibility**: Completed lazy initialization to prevent ERR_CONSOLE_WRITABLE_STREAM errors
1323
- - Deferred `Object.getOwnPropertySymbols(console)` call until first logger use
1324
- - Deferred `kGroupIndentationWidth` symbol lookup
1325
- - Deferred `Object.entries(console)` and prototype method initialization
1326
- - Ensures logger can be safely imported in Node.js internal bootstrap contexts (e.g., `lib/internal/bootstrap/*.js`) before stdout is initialized
1327
- - Builds on v2.8.2 console deferring to complete early bootstrap compatibility
914
+ - `Logger` defers `Object.getOwnPropertySymbols(console)`, `kGroupIndentationWidth`, and `Object.entries(console)` until first use safe to import in Node.js internal bootstrap contexts
1328
915
 
1329
916
  ## [2.8.2](https://github.com/SocketDev/socket-lib/releases/tag/v2.8.2) - 2025-10-29
1330
917
 
1331
918
  ### Changed
1332
919
 
1333
- - Enhanced Logger class to defer Console creation until first use
1334
- - Eliminates early bootstrap errors when importing logger before stdout is ready
1335
- - Enables safe logger imports during Node.js early initialization phase
1336
- - Simplified internal storage with WeakMap-only pattern for constructor args
920
+ - `Logger` defers `Console` creation until first use — eliminates early-bootstrap errors when imported before stdout is ready
1337
921
 
1338
922
  ## [2.8.1](https://github.com/SocketDev/socket-lib/releases/tag/v2.8.1) - 2025-10-29
1339
923
 
1340
924
  ### Changed
1341
925
 
1342
- - **Consolidated DLX cache key generation**: Extracted `generateCacheKey` function to shared `dlx.ts` module
1343
- - Eliminates code duplication between `dlx-binary.ts` and `dlx-package.ts`
1344
- - Enables consistent cache key generation across the Socket ecosystem
1345
- - Exports function for use in dependent packages (e.g., socket-cli)
1346
- - Maintains SHA-512 truncated to 16 chars strategy from v2.8.0
926
+ - `dlx` `generateCacheKey` extracted to shared module. Exported for downstream consumers (e.g. socket-cli)
1347
927
 
1348
928
  ## [2.8.0](https://github.com/SocketDev/socket-lib/releases/tag/v2.8.0) - 2025-10-29
1349
929
 
1350
930
  ### Changed
1351
931
 
1352
- - **Enhanced DLX cache key generation with npm/npx compatibility**: Updated cache key strategy to align with npm/npx ecosystem patterns
1353
- - Changed from SHA-256 (64 chars) to SHA-512 truncated to 16 chars (matching npm/npx)
1354
- - Optimized for Windows MAX_PATH compatibility (260 character limit)
1355
- - Accepts collision risk for shorter paths (~1 in 18 quintillion with 1000 entries)
1356
- - Added support for PURL-style package specifications (e.g., `npm:prettier@3.0.0`, `pypi:requests@2.31.0`)
1357
- - Documented Socket's shorthand format (without `pkg:` prefix) handled by `@socketregistry/packageurl-js`
1358
- - References npm/cli v11.6.2 implementation for consistency
932
+ - `dlx` cache keys SHA-512 truncated to 16 chars (was SHA-256 / 64 chars), matching npm/npx. Better Windows `MAX_PATH` compatibility. Supports PURL specs (`npm:prettier@3.0.0`, `pypi:requests@2.31.0`)
1359
933
 
1360
934
  ## [2.7.0](https://github.com/SocketDev/socket-lib/releases/tag/v2.7.0) - 2025-10-28
1361
935
 
1362
936
  ### Added
1363
937
 
1364
- - **DLX cache locking for concurrent installation protection**: Added process-lock protection to dlx-package installation operations
1365
- - Lock file created at `~/.socket/_dlx/<hash>/.lock` (similar to npm npx's `concurrency.lock`)
1366
- - Prevents concurrent installations from corrupting the same package cache
1367
- - Uses 5-second stale timeout and 2-second periodic touching (aligned with npm npx)
1368
- - Double-check pattern verifies installation after acquiring lock to avoid redundant work
1369
- - Completes 100% alignment with npm's npx locking strategy
938
+ - `dlx` cache locking `~/.socket/_dlx/<hash>/.lock` (npm-npx-style `concurrency.lock`). Prevents concurrent installations from corrupting the same package cache. 5s stale timeout, 2s periodic touch
1370
939
 
1371
940
  ## [2.6.0](https://github.com/SocketDev/socket-lib/releases/tag/v2.6.0) - 2025-10-28
1372
941
 
1373
942
  ### Changed
1374
943
 
1375
- - **Process locking aligned with npm npx**: Enhanced process-lock module to match npm's npx locking strategy
1376
- - Reduced stale timeout from 10 seconds to 5 seconds (matches npm npx)
1377
- - Added periodic lock touching (2-second interval) to prevent false stale detection during long operations
1378
- - Implemented second-level granularity for mtime comparison to avoid APFS floating-point precision issues
1379
- - Added automatic touch timer cleanup on process exit
1380
- - Timers use `unref()` to prevent keeping process alive
1381
- - Aligns with npm's npx implementation per https://github.com/npm/cli/pull/8512
944
+ - `process-lock` aligned with npm npx 5s stale timeout (was 10s), 2s periodic touch, second-level mtime comparison (avoids APFS float precision), `unref()` timers, automatic cleanup on exit
1382
945
 
1383
946
  ## [2.5.0](https://github.com/SocketDev/socket-lib/releases/tag/v2.5.0) - 2025-10-28
1384
947
 
1385
948
  ### Added
1386
949
 
1387
- - **Process locking utilities**: Added `ProcessLockManager` class providing cross-platform inter-process synchronization using file-system based locks
1388
- - Atomic lock acquisition via `mkdir()` for thread-safe operations
1389
- - Stale lock detection with automatic cleanup (default 10 seconds, aligned with npm's npx strategy)
1390
- - Exponential backoff with jitter for retry attempts
1391
- - Process exit handlers for guaranteed cleanup even on abnormal termination
1392
- - Three main APIs: `acquire()`, `release()`, and `withLock()` (recommended)
1393
- - Comprehensive test suite with `describe.sequential` for proper isolation
1394
- - Export: `@socketsecurity/lib/process-lock`
950
+ - `process-lock` `ProcessLockManager` cross-platform inter-process sync via filesystem locks. Atomic `mkdir()` acquisition; stale-lock detection (10s default); exponential backoff with jitter; exit-handler cleanup. APIs: `acquire`, `release`, `withLock` (recommended)
1395
951
 
1396
952
  ### Changed
1397
953
 
1398
- - **Script refactoring**: Renamed `spinner.succeed()` to `spinner.success()` for consistency
1399
- - **Script cleanup**: Removed redundant spinner cleanup in interactive-runner
954
+ - `spinner.succeed()` renamed to `spinner.success()`
1400
955
 
1401
956
  ## [2.4.0](https://github.com/SocketDev/socket-lib/releases/tag/v2.4.0) - 2025-10-28
1402
957
 
1403
958
  ### Changed
1404
959
 
1405
- - **Download locking aligned with npm**: Reduced default `staleTimeout` in `downloadWithLock()` from 300 seconds to 10 seconds to align with npm's npx locking strategy
1406
- - Prevents stale locks from blocking downloads for extended periods
1407
- - Matches npm's battle-tested timeout range (5-10 seconds)
1408
- - Binary downloads now protected against concurrent corruption
1409
- - **Binary download protection**: `dlxBinary.downloadBinary()` now uses `downloadWithLock()` to prevent corruption when multiple processes download the same binary concurrently
1410
- - Eliminates race conditions during parallel binary downloads
1411
- - Maintains checksum verification and executable permissions
960
+ - `downloadWithLock()` default `staleTimeout` 300s 10s (aligns with npm npx)
961
+ - `dlxBinary.downloadBinary()` uses `downloadWithLock()` to prevent corruption from concurrent binary downloads
1412
962
 
1413
963
  ## [2.3.0](https://github.com/SocketDev/socket-lib/releases/tag/v2.3.0) - 2025-10-28
1414
964
 
1415
965
  ### Added
1416
966
 
1417
- - **Binary utility wrapper functions**: Added `which()` and `whichSync()` wrapper functions to `bin` module
1418
- - Cross-platform binary lookup that respects PATH environment variable
1419
- - Synchronous and asynchronous variants for different use cases
1420
- - Integrates with existing binary resolution utilities
967
+ - `bin` `which()` / `whichSync()` cross-platform binary lookup respecting `PATH`
1421
968
 
1422
969
  ## [2.2.1](https://github.com/SocketDev/socket-lib/releases/tag/v2.2.1) - 2025-10-28
1423
970
 
1424
971
  ### Fixed
1425
972
 
1426
- - **Logger write() method**: Fixed `write()` to bypass Console formatting when outputting raw text
1427
- - Previously, `write()` used Console's internal `_stdout` stream which applied unintended formatting like group indentation
1428
- - Now stores a reference to the original stdout stream in a dedicated private field (`#originalStdout`) during construction
1429
- - The `write()` method uses this stored reference to write directly to the raw stream, bypassing all Console formatting layers
1430
- - Ensures raw text output without any formatting applied, fixing test failures in CI environments where writes after `indent()` were unexpectedly formatted
973
+ - `Logger` `write()` bypasses Console formatting (group indentation, etc.) now writes directly to the raw stdout reference captured at construction
1431
974
 
1432
975
  ## [2.2.0](https://github.com/SocketDev/socket-lib/releases/tag/v2.2.0) - 2025-10-28
1433
976
 
1434
977
  ### Added
1435
978
 
1436
- - **Logger step symbol**: `logger.step()` now displays a cyan arrow symbol (or > in ASCII) before step messages for improved visual separation
1437
- - New `LOG_SYMBOLS.step` symbol added to the symbol palette
1438
- - Automatic stripping of existing symbols from step messages
1439
- - Maintains existing blank line behavior for clear step separation
979
+ - `Logger` `step()` cyan arrow `→` prefix (or `>` in ASCII fallback). New `LOG_SYMBOLS.step`
1440
980
 
1441
981
  ## [2.1.0](https://github.com/SocketDev/socket-lib/releases/tag/v2.1.0) - 2025-10-28
1442
982
 
1443
983
  ### Added
1444
984
 
1445
- - Package manager detection utilities (`detectPackageManager()`, `getPackageManagerInfo()`, `getPackageManagerUserAgent()`)
1446
- - `isInSocketDlx()` utility to check if file path is within `~/.socket/_dlx/`
1447
- - `downloadPackage()` and `executePackage()` functions for separate download and execution of packages
985
+ - Package manager detection `detectPackageManager()`, `getPackageManagerInfo()`, `getPackageManagerUserAgent()`
986
+ - `isInSocketDlx()` check if a path is under `~/.socket/_dlx/`
987
+ - `downloadPackage()` / `executePackage()` separate download and execution
1448
988
 
1449
989
  ## [2.0.0](https://github.com/SocketDev/socket-lib/releases/tag/v2.0.0) - 2025-10-27
1450
990
 
1451
- ### Breaking Changes
1452
-
1453
- **Environment Variable System Refactor**
1454
-
1455
- This release completely refactors the environment variable system, consolidating 60+ individual env constant files into grouped getter modules with AsyncLocalStorage-based test rewiring.
1456
-
1457
- **Consolidated env files** - Individual files replaced with grouped modules:
1458
-
1459
- - `env/github.ts` - All GitHub-related env vars (GITHUB_TOKEN, GH_TOKEN, GITHUB_API_URL, etc.)
1460
- - `env/socket.ts` - Socket-specific env vars (SOCKET_API_TOKEN, SOCKET_CACACHE_DIR, etc.)
1461
- - `env/socket-cli.ts` - Socket CLI env vars (SOCKET_CLI_API_TOKEN, SOCKET_CLI_CONFIG, etc.)
1462
- - `env/npm.ts` - NPM-related env vars
1463
- - `env/locale.ts` - Locale env vars (LANG, LC_ALL, LC_MESSAGES)
1464
- - `env/windows.ts` - Windows-specific env vars (USERPROFILE, LOCALAPPDATA, APPDATA, COMSPEC)
1465
- - `env/xdg.ts` - XDG base directory env vars
1466
- - `env/temp-dir.ts` - Temp directory env vars (TEMP, TMP, TMPDIR)
1467
- - `env/test.ts` - Test framework env vars (VITEST, JEST_WORKER_ID)
1468
-
1469
- **Constants → Getter functions** - All env constants converted to functions:
1470
-
1471
- ```typescript
1472
- // Before (v1.x):
1473
- import { GITHUB_TOKEN } from '#env/github-token'
1474
-
1475
- // After (v2.x):
1476
- import { getGithubToken } from '#env/github'
1477
- ```
1478
-
1479
- **Deleted files** - Removed 60+ individual env constant files:
991
+ ### Changed
1480
992
 
1481
- - `env/github-token.ts`, `env/socket-api-token.ts`, etc. Consolidated into grouped files
1482
- - `env/getters.ts` Functions moved to their respective grouped files
993
+ - **BREAKING**: Environment variable system refactor — 60+ individual `env/<NAME>.ts` files consolidated into grouped getter modules:
994
+ - `env/github`, `env/socket`, `env/socket-cli`, `env/npm`, `env/locale`, `env/windows`, `env/xdg`, `env/temp-dir`, `env/test`
995
+ - All env constants converted to functions: `import { GITHUB_TOKEN } from '#env/github-token'` → `import { getGithubToken } from '#env/github'`
1483
996
 
1484
997
  ### Added
1485
998
 
1486
- **AsyncLocalStorage-Based Test Rewiring**
1487
-
1488
- New `env/rewire.ts` and `path/rewire.ts` modules provides context-isolated environment variable overrides for testing:
1489
-
1490
- ```typescript
1491
- import { withEnv, setEnv, resetEnv, getEnvValue } from '#env/rewire'
1492
-
1493
- // Option 1: Isolated context with AsyncLocalStorage
1494
- await withEnv({ CI: '1', NODE_ENV: 'test' }, async () => {
1495
- // CI env var is '1' only within this block
1496
- // Concurrent tests don't interfere
1497
- })
1498
-
1499
- // Option 2: Traditional beforeEach/afterEach pattern
1500
- beforeEach(() => {
1501
- setEnv('CI', '1')
1502
- })
1503
-
1504
- afterEach(() => {
1505
- resetEnv()
1506
- })
1507
- ```
1508
-
1509
- **Features:**
1510
-
1511
- - Allows toggling between snapshot and live behavior
1512
- - Compatible with `vi.stubEnv()` as fallback
1513
-
1514
- ### Changed
1515
-
1516
- - Updated all dynamic `require()` statements to use path aliases (`#constants/*`, `#packages/*`)
1517
- - Improved logger blank line tracking per stream (separate stderr/stdout tracking)
1518
- - Exported `getCacache()` function for external use
999
+ - `env/rewire` and `paths/rewire` — AsyncLocalStorage-based env/path overrides for testing. `withEnv({...}, async () => {})` for isolated context, or `setEnv` / `resetEnv` for `beforeEach`/`afterEach`
1000
+ - `getCacache()` exported
1519
1001
 
1520
1002
  ## [1.3.6](https://github.com/SocketDev/socket-lib/releases/tag/v1.3.6) - 2025-10-26
1521
1003
 
1522
1004
  ### Fixed
1523
1005
 
1524
- - Fixed `debug` module functions being incorrectly tree-shaken as no-ops in bundled output
1525
- - Removed incorrect `/*@__NO_SIDE_EFFECTS__*/` annotations from `debug()`, `debugDir()`, `debugLog()`, and their `*Ns` variants
1526
- - These functions have side effects (logging output, spinner manipulation) and should not be removed by bundlers
1527
- - Fixes issue where `debugLog()` and `debugDir()` were compiled to empty no-op functions
1006
+ - `debug` functions no longer tree-shaken as no-ops removed incorrect `/*@__NO_SIDE_EFFECTS__*/` annotations on `debug`, `debugDir`, `debugLog` (+ `*Ns` variants)
1528
1007
 
1529
1008
  ## [1.3.5](https://github.com/SocketDev/socket-lib/releases/tag/v1.3.5) - 2025-10-26
1530
1009
 
1531
1010
  ### Added
1532
1011
 
1533
- - Added `createEnvProxy()` utility function to `env` module for Windows-compatible environment variable access
1534
- - Provides case-insensitive environment variable access (e.g., PATH, Path, path all work)
1535
- - Smart priority system: overrides > exact match > case-insensitive fallback
1536
- - Full Proxy implementation with proper handlers for get, set, has, ownKeys, getOwnPropertyDescriptor
1537
- - Opt-in helper for users who need Windows env var compatibility
1538
- - Well-documented with usage examples and performance notes
1539
- - Added `findCaseInsensitiveEnvKey()` utility function to `env` module
1540
- - Searches for environment variable keys using case-insensitive matching
1541
- - Optimized with length fast path to minimize expensive `toUpperCase()` calls
1542
- - Useful for cross-platform env var access where case may vary (e.g., PATH vs Path vs path)
1543
- - Added comprehensive test suite for `env` module with 71 tests
1544
- - Covers `envAsBoolean()`, `envAsNumber()`, `envAsString()` conversion utilities
1545
- - Tests `createEnvProxy()` with Windows environment variables and edge cases
1546
- - Validates `findCaseInsensitiveEnvKey()` optimization and behavior
1012
+ - `env` `createEnvProxy()` Windows-compatible case-insensitive env var access (`PATH`, `Path`, `path` all work). Priority: overrides > exact match > case-insensitive fallback
1013
+ - `env` `findCaseInsensitiveEnvKey()` — case-insensitive key search with length fast-path
1547
1014
 
1548
1015
  ### Fixed
1549
1016
 
1550
- - Fixed `spawn` module to preserve Windows `process.env` Proxy behavior
1551
- - When no custom environment variables are provided, use `process.env` directly instead of spreading it
1552
- - Preserves Windows case-insensitive environment variable access (PATH vs Path)
1553
- - Fixes empty CLI output issue on Windows CI runners
1554
- - Only spreads `process.env` when merging custom environment variables
1017
+ - `spawn` preserves Windows `process.env` Proxy behavior (uses `process.env` directly when no custom env merges, keeping Windows case-insensitive access)
1555
1018
 
1556
1019
  ## [1.3.4](https://github.com/SocketDev/socket-lib/releases/tag/v1.3.4) - 2025-10-26
1557
1020
 
1558
1021
  ### Added
1559
1022
 
1560
- - Added Node.js SIGUSR1 signal handler prevention utilities in `constants/node` module
1561
- - `supportsNodeDisableSigusr1Flag()`: Detects if Node supports `--disable-sigusr1` flag (v22.14+, v23.7+, v24.8+)
1562
- - `getNodeDisableSigusr1Flags()`: Returns appropriate flags to prevent debugger attachment
1563
- - Returns `['--disable-sigusr1']` on supported versions (prevents Signal I/O Thread creation)
1564
- - Falls back to `['--no-inspect']` on Node 18+ (blocks debugger but still creates thread)
1565
- - Enables production CLI environments to prevent SIGUSR1 debugger signal handling for security
1023
+ - `constants/node` `supportsNodeDisableSigusr1Flag()`, `getNodeDisableSigusr1Flags()`. Returns `['--disable-sigusr1']` on Node 22.14+/23.7+/24.8+, falls back to `['--no-inspect']` on Node 18+
1566
1024
 
1567
1025
  ## [1.3.3](https://github.com/SocketDev/socket-lib/releases/tag/v1.3.3) - 2025-10-24
1568
1026
 
1569
1027
  ### Fixed
1570
1028
 
1571
- - Fixed lazy getter bug in `objects` module where `defineGetter`, `defineLazyGetter`, and `defineLazyGetters` had incorrect `/*@__NO_SIDE_EFFECTS__*/` annotations
1572
- - These functions mutate objects by defining properties, so marking them as side-effect-free caused esbuild to incorrectly tree-shake the calls during bundling
1573
- - Lazy getters were returning `undefined` instead of their computed values
1574
- - Removed double wrapping in `defineLazyGetters` where `createLazyGetter` was being called unnecessarily
1029
+ - `objects` `defineGetter`, `defineLazyGetter`, `defineLazyGetters` removed incorrect `/*@__NO_SIDE_EFFECTS__*/` annotations (these mutate objects). Lazy getters were returning `undefined` after esbuild tree-shaking
1575
1030
 
1576
1031
  ## [1.3.2](https://github.com/SocketDev/socket-lib/releases/tag/v1.3.2) - 2025-10-24
1577
1032
 
@@ -1583,10 +1038,7 @@ afterEach(() => {
1583
1038
 
1584
1039
  ### Fixed
1585
1040
 
1586
- - Fixed @inquirer modules (`input`, `password`, `search`) not being properly bundled into `dist/external/`
1587
- - Resolves build failures in downstream packages (socket-cli) that depend on socket-lib
1588
- - Added missing packages to bundling configuration in `scripts/build-externals.mjs`
1589
- - All @inquirer packages now ship as zero-dependency bundles
1041
+ - `@inquirer` modules (`input`, `password`, `search`) properly bundled into `dist/external/` — fixes build failures in downstream socket-cli
1590
1042
 
1591
1043
  ### Added
1592
1044
 
@@ -1599,96 +1051,72 @@ afterEach(() => {
1599
1051
 
1600
1052
  ### Added
1601
1053
 
1602
- - Added `validateFiles()` utility function to `fs` module for defensive file access validation
1603
- - Returns `ValidateFilesResult` with `validPaths` and `invalidPaths` arrays
1604
- - Filters out unreadable files before processing (common with Yarn Berry PnP virtual filesystem, pnpm symlinks)
1605
- - Prevents ENOENT errors when files exist in glob results but are not accessible
1606
- - Comprehensive test coverage for all validation scenarios
1054
+ - `fs` `validateFiles()` returns `{ validPaths, invalidPaths }`. Filters unreadable files before processing (Yarn Berry PnP, pnpm symlinks)
1607
1055
 
1608
1056
  ## [1.2.0](https://github.com/SocketDev/socket-lib/releases/tag/v1.2.0) - 2025-10-23
1609
1057
 
1610
1058
  ### Added
1611
1059
 
1612
- - Added `dlx-package` module for installing and executing npm packages directly
1613
- - Content-addressed caching using SHA256 hash (like npm's \_npx)
1614
- - Auto-force for version ranges (^, ~, >, <) to get latest within range
1615
- - Cross-platform support with comprehensive tests (30 tests)
1616
- - Parses scoped and unscoped package specs correctly
1617
- - Resolves binaries from package.json bin field
1060
+ - `dlx-package` install and execute npm packages directly. Content-addressed cache (SHA256). Auto-force for version ranges (`^`, `~`, `>`, `<`). Resolves binaries from `package.json` `bin`
1618
1061
 
1619
1062
  ### Changed
1620
1063
 
1621
- - Unified DLX storage under `~/.socket/_dlx/` directory
1622
- - Binary downloads now use `~/.socket/_dlx/` instead of non-existent cache path
1623
- - Both npm packages and binaries share parent directory with content-addressed hashing
1624
- - Updated paths.ts documentation to clarify unified directory structure
1064
+ - Unified DLX storage under `~/.socket/_dlx/` (binary downloads + npm packages share content-addressed parent)
1625
1065
 
1626
1066
  ## [1.1.2] - 2025-10-23
1627
1067
 
1628
1068
  ### Fixed
1629
1069
 
1630
- - Fixed broken relative import paths in `packages/isolation.ts` and `packages/provenance.ts` that prevented bundling by external tools
1070
+ - Broken relative import paths in `packages/isolation.ts` / `packages/provenance.ts`
1631
1071
 
1632
1072
  ## [1.1.1] - 2025-10-23
1633
1073
 
1634
1074
  ### Fixed
1635
1075
 
1636
- - Fixed shimmer text effects not respecting CI environment detection (now disabled in CI to prevent ANSI escape codes in logs)
1076
+ - Shimmer text effects respect CI detection (disabled in CI to avoid ANSI escapes in logs)
1637
1077
 
1638
1078
  ## [1.1.0] - 2025-10-23
1639
1079
 
1640
1080
  ### Added
1641
1081
 
1642
- - Added `filterOutput` option to `stdio/mask` for filtering output chunks before display/buffering
1643
- - Added `overrideExitCode` option to `stdio/mask` for customizing exit codes based on captured output
1644
- - Added comprehensive JSDoc documentation across entire library for enhanced VSCode IntelliSense
1645
- - Detailed @param, @returns, @template, @throws tags
1646
- - Practical @example blocks with real-world usage patterns
1647
- - @default tags showing default values
1648
- - Enhanced interface property documentation
1649
-
1650
- ### Changed
1651
-
1652
- - Improved TypeScript type hints and tooltips throughout library
1653
- - Enhanced documentation for all core utilities (arrays, fs, git, github, http-request, json, logger, objects, path, promises, spawn, spinner, strings)
1654
- - Enhanced documentation for stdio utilities (clear, divider, footer, header, mask, progress, prompts, stderr, stdout)
1655
- - Enhanced documentation for validation utilities (json-parser, types)
1082
+ - `stdio/mask` `filterOutput` (filter output chunks before display) and `overrideExitCode` (customize exit codes from captured output)
1083
+ - Comprehensive JSDoc across the library for IntelliSense (`@param`, `@returns`, `@example`, `@default`)
1656
1084
 
1657
1085
  ## [1.0.5] - 2025-10-22
1658
1086
 
1659
1087
  ### Added
1660
1088
 
1661
- - Added support for custom retry delays from onRetry callback
1089
+ - Custom retry delays from `onRetry` callback
1662
1090
 
1663
1091
  ## [1.0.4] - 2025-10-21
1664
1092
 
1665
1093
  ### Fixed
1666
1094
 
1667
- - Fixed external dependency paths in root-level source files (corrected require paths from `../external/` to `./external/` in bin, cacache, fs, globs, spawn, spinner, and streams modules)
1095
+ - External dep paths in root-level dist files (`../external/` `./external/`)
1668
1096
 
1669
1097
  ## [1.0.3] - 2025-10-21
1670
1098
 
1671
1099
  ### Fixed
1672
1100
 
1673
- - Fixed external dependency import paths in packages and stdio modules (corrected require paths from `../../external/` to `../external/`)
1101
+ - External dep import paths in `packages/` and `stdio/` modules (`../../external/` `../external/`)
1674
1102
 
1675
1103
  ## [1.0.2] - 2025-10-21
1676
1104
 
1677
1105
  ### Fixed
1678
1106
 
1679
- - Fixed module resolution error in packages/normalize module (corrected require path from `../../constants/socket` to `../constants/socket`)
1107
+ - `packages/normalize` module resolution (`../../constants/socket` `../constants/socket`)
1680
1108
 
1681
1109
  ## [1.0.1] - 2025-10-21
1682
1110
 
1683
1111
  ### Fixed
1684
1112
 
1685
- - Fixed relative import paths in compiled CommonJS output (changed `require("../external/...")` to `require("./external/...")` for root-level dist files)
1113
+ - Relative imports in compiled CommonJS root-level dist files use `./external/...`
1686
1114
 
1687
1115
  ## [1.0.0] - 2025-10-20
1688
1116
 
1689
1117
  ### Changed
1690
1118
 
1691
- - Consolidated parseArgs into argv/parse module
1119
+ - `parseArgs` consolidated into `argv/parse`
1692
1120
 
1693
1121
  ---
1694
1122
 
@@ -1696,254 +1124,12 @@ afterEach(() => {
1696
1124
 
1697
1125
  ---
1698
1126
 
1699
- ## [1.5.3] - 2025-10-07
1700
-
1701
- ### Added
1702
-
1703
- - Fix bad build and add validation to prevent in future
1704
-
1705
- ## [1.5.2] - 2025-10-07
1706
-
1707
- ### Added
1708
-
1709
- - Added coverage utilities to parse v8 and type coverage reports
1710
-
1711
- ### Fixed
1712
-
1713
- - Fixed `isPath` function to exclude URLs with protocols
1714
- - Fixed `isolatePackage` to handle file: URLs and npm-package-arg paths correctly
1715
-
1716
- ## [1.5.1] - 2025-10-05
1717
-
1718
- ### Added
1719
-
1720
- - Added `isolatePackage` to `lib/packages/isolation` for creating isolated package test environments
1127
+ These entries cover versions 1.0.0 → 1.5.3 of the previous package name (`@socketsecurity/registry`, Sep 2025 – Oct 2025). The version-number line restarted at 1.0.0 when the package was renamed to `@socketsecurity/lib`, so the current 1.x and 5.x lines do **not** continue from these old versions. Listed here for archival reference only.
1721
1128
 
1722
- ### Changed
1723
-
1724
- - Removed `dependencies/index` barrel file to prevent eager loading of all dependency modules
1725
-
1726
- ## [1.5.0] - 2025-10-05
1727
-
1728
- ### Added
1729
-
1730
- - Added support for testing local development packages in addition to socket-registry packages
1731
- - Exposed isolation module as part of public API via `lib/packages`
1732
-
1733
- ### Changed
1734
-
1735
- - Renamed `setupPackageTest` to `isolatePackage` for clearer intent
1736
- - Refactored `installPackageForTesting` to accept explicit `sourcePath` and `packageName` parameters
1737
- - Simplified package installation logic by removing path detection from low-level function
1738
- - Consolidated `setupPackageTest` and `setupMultiEntryTest` into single `isolatePackage` function with options
1739
-
1740
- ## [1.4.6] - 2025-10-05
1741
-
1742
- ### Added
1743
-
1744
- - Added comprehensive package.json exports validation tests
1745
-
1746
- ## [1.4.5] - 2025-10-05
1747
-
1748
- ### Added
1749
-
1750
- - Added performance monitoring utilities with timer, measurement, and reporting functions
1751
- - Added memoization utilities with LRU, TTL, weak references, and promise deduplication support
1752
- - Added table formatting utilities (`formatTable`, `formatSimpleTable`) for CLI output
1753
- - Added progress tracking to spinner with `updateProgress()` and `incrementProgress()` methods
1754
- - Added `isDir` and `safeStats` async helpers to fs module
1755
-
1756
- ### Changed
1757
-
1758
- - Removed `platform` and `arch` options from `dlxBinary` function as cross-platform binary execution is not supported
1759
-
1760
- ### Fixed
1761
-
1762
- - Fixed Windows shell execution in `dlxBinary` by adding cache directory to PATH
1763
-
1764
- ## [1.4.4] - 2025-10-05
1765
-
1766
- ### Fixed
1767
-
1768
- - Fixed subpath exports
1769
-
1770
- ## [1.4.3] - 2025-10-04
1771
-
1772
- ### Added
1773
-
1774
- - Spinner lifecycle utilities (`withSpinner`, `withSpinnerRestore`, `withSpinnerSync`) for automatic spinner cleanup with try/finally blocks
1775
-
1776
- ## [1.4.2] - 2025-10-04
1777
-
1778
- ### Added
1779
-
1780
- - Added `GITHUB_API_BASE_URL` constant for GitHub API endpoint configuration
1781
- - Added `SOCKET_API_BASE_URL` constant for Socket API endpoint configuration
1782
- - Added generic TTL cache utility (`createTtlCache`) with in-memory memoization and persistent storage support
1783
-
1784
- ### Changed
1785
-
1786
- - Refactored GitHub caching to use the new `cache-with-ttl` utility for better performance and consistency
1787
-
1788
- ## [1.4.1] - 2025-10-04
1789
-
1790
- ### Changed
1791
-
1792
- - Update maintained Node.js versions of `constants.maintainedNodeVersions`
1793
-
1794
- ## [1.4.0] - 2025-10-04
1795
-
1796
- ### Added
1797
-
1798
- - Added `PromiseQueue` utility for controlled concurrency operations
1799
- - Added lazy dependency loaders and test utilities
1800
- - Added HTTP utilities with retry logic and download locking
1801
- - Added `.claude` directory for scratch documents
1802
- - Added `noUnusedLocals` and `noUnusedParameters` to TypeScript config
1803
-
1804
- ### Changed
1805
-
1806
- - Refactored all library functions to use options objects for better API consistency
1807
- - `lib/strings.ts` - String manipulation functions
1808
- - `lib/url.ts` - URL handling functions
1809
- - `lib/words.ts` - Word manipulation functions
1810
- - Refactored `lib/packages` module into specialized submodules for improved code organization
1811
- - `lib/packages/editable.ts` - Package editing functionality
1812
- - `lib/packages/exports.ts` - Export resolution utilities
1813
- - `lib/packages/licenses.ts` - License handling and validation
1814
- - `lib/packages/manifest.ts` - Manifest data operations
1815
- - `lib/packages/normalize.ts` - Path normalization utilities
1816
- - `lib/packages/operations.ts` - Package installation and modification operations
1817
- - `lib/packages/paths.ts` - Package path utilities
1818
- - `lib/packages/provenance.ts` - Package provenance verification
1819
- - `lib/packages/specs.ts` - Package spec parsing
1820
- - `lib/packages/validation.ts` - Package validation utilities
1821
- - Moved configuration files (vitest, eslint, knip, oxlint, taze) to `.config` directory
1822
- - Replaced `fetch()` with Node.js native `http`/`https` modules for better reliability
1823
- - Replaced `any` types with meaningful types across library utilities
1824
- - Improved pnpm security with build script allowlist
1825
- - Updated vitest coverage thresholds to 80%
1826
- - Consolidated test files to reduce duplication
1827
- - Note: Public API remains unchanged; these are internal organizational improvements
1828
-
1829
- ### Fixed
1830
-
1831
- - Fixed resource leaks and race conditions in socket-registry
1832
- - Fixed `yarn-cache-path` constant to return string type consistently
1833
- - Fixed Yarn Windows temp path detection in `shouldSkipShadow`
1834
- - Fixed path normalization for Windows compatibility across all path utilities
1835
- - Fixed cache path tests for Windows case sensitivity
1836
- - Fixed type errors in promises, parse-args, logger, and specs tests
1837
- - Fixed GitHub tests to mock `httpRequest` correctly
1838
- - Fixed SEA build tests to mock `httpRequest`
1839
- - Decoded URL percent-encoding in `pathLikeToString` fallback
1840
-
1841
- ## [1.3.10] - 2025-10-03
1842
-
1843
- ### Added
1844
-
1845
- - New utility modules for DLX, shadow, SEA, cacache, and versions functionality
1846
- - getSocketHomePath alias to paths module
1847
- - del dependency and external wrapper for safer file deletion
1848
- - @fileoverview tags to lib modules
1849
- - camelCase expansion for kebab-case arguments in parseArgs
1850
- - Coerce and configuration options to parseArgs
1851
-
1852
- ### Changed
1853
-
1854
- - Updated file removal to use del package for safer deletion
1855
- - Normalized path returns in fs and Socket directory utilities
1856
- - Removed default exports from git and parse-args modules
1857
- - Enhanced test coverage across multiple modules (parse-args, prompts, strings, env, spawn, json)
1858
-
1859
- ## [1.3.9] - 2025-10-03
1860
-
1861
- ### Changed
1862
-
1863
- - Internal build and distribution updates
1864
-
1865
- ## [1.3.8] - 2025-10-03
1866
-
1867
- ### Added
1868
-
1869
- - Added unified directory structure for Socket ecosystem tools
1870
- - New path utilities module for cross-platform directory resolution
1871
- - Directory structure constants for Socket CLI, Registry, Firewall, and DLX
1872
-
1873
- ## [1.3.7] - 2025-10-02
1874
-
1875
- ### Changed
1876
-
1877
- - Updated manifest.json entries
1878
-
1879
- ## [1.3.6] - 2025-10-01
1880
-
1881
- ### Fixed
1882
-
1883
- - Fixed indent-string interoperability with older v1 and v2 versions
1884
-
1885
- ## [1.3.5] - 2025-10-01
1886
-
1887
- ### Added
1888
-
1889
- - Added lib/git utilities module
1890
-
1891
- ### Fixed
1892
-
1893
- - Fixed invalid manifest entries
1894
- - Fixed parseArgs strip-aliased bug
1895
-
1896
- ## [1.3.4] - 2025-10-01
1897
-
1898
- ### Changed
1899
-
1900
- - Updated various package override versions
1129
+ ### Highlights
1901
1130
 
1902
- ## [1.3.3] - 2025-10-01
1903
-
1904
- ### Fixed
1905
-
1906
- - Fixed normalizePath collapsing multiple leading `..` segments incorrectly
1907
-
1908
- ## [1.3.2] - 2025-10-01
1909
-
1910
- ### Added
1911
-
1912
- - Added 'sfw' to isBlessedPackageName method check
1913
- - Added ENV.DEBUG normalization for debug package compatibility
1914
- - `DEBUG='1'` or `DEBUG='true'` automatically expands to `DEBUG='*'` (enables all namespaces)
1915
- - `DEBUG='0'` or `DEBUG='false'` automatically converts to empty string (disables all output)
1916
- - Namespace patterns like `DEBUG='app:*'` are preserved unchanged
1917
-
1918
- ## [1.3.1] - 2025-09-30
1919
-
1920
- ### Changed
1921
-
1922
- - Renamed debug functions from *Complex to *Ns
1923
-
1924
- ### Fixed
1925
-
1926
- - Fixed regression with lib/prompts module imports
1927
-
1928
- ## [1.3.0] - 2025-09-29
1929
-
1930
- ### Changed
1931
-
1932
- - Updated registry subpath exports
1933
-
1934
- ### Fixed
1935
-
1936
- - Fixed Node.js built-in module imports in CommonJS output
1937
-
1938
- ## [1.2.2] - 2025-09-29
1939
-
1940
- ### Changed
1941
-
1942
- - Internal improvements to module structure
1943
-
1944
- ## [1.2.1] - 2025-09-29
1945
-
1946
- ### Changed
1131
+ - **1.5.x** (Oct 2025) — `isolatePackage` for isolated package test environments; v8 coverage utilities; `dependencies/index` barrel removed
1132
+ - **1.4.x** (Oct 2025) — Performance monitoring + memoization utilities; table formatting (`formatTable`, `formatSimpleTable`); spinner progress; `isDir`, `safeStats` async fs helpers
1133
+ - **1.3.x** (Sep–Oct 2025) — Initial constants restructure, build configuration, package exports
1947
1134
 
1948
- - Restructured constants module with new architecture
1949
- - Updated build configuration and package exports
1135
+ For full details, see git history under the `@socketsecurity/registry` package name.