Skip to content

Commit 95053ca

Browse files
committed
chore(release): bump version to 6.0.1
Path renames consolidating doubled-name leaves (spawn/spawn, ttl-cache/cache, globs/glob, links/link, promise-queue/queue) and regrouping process-event helpers under events/, plus five additive features: colors/socket-palette, logger/browser, browser export condition, http-request signal option, default-on read-result cache for readJson. README coverage badge bumped 98% -> 99%.
1 parent c77a385 commit 95053ca

3 files changed

Lines changed: 72 additions & 2 deletions

File tree

CHANGELOG.md

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

8+
## [6.0.1](https://github.com/SocketDev/socket-lib/releases/tag/v6.0.1) - 2026-05-25
9+
10+
Five additive features plus public-surface polish on top of 6.0.0. The path renames drop doubled-name leaves (`spawn/spawn`, `ttl-cache/cache`, `globs/glob`, `links/link`, `promise-queue/queue`) and regroup three top-level directories whose contents were the same concept (process events) under a new `events/` umbrella. Renames are path-only; no symbol renames or behavior changes.
11+
12+
### Added
13+
14+
- **`colors/socket-palette`** — Socket-branded 24-bit ANSI palette. Three themes (`'light' | 'dark' | 'synthwave'`) expose status colors (`success` / `warning` / `alert` / `error` / `info`) plus the Socket brand constants (`socketPurple` `#8c50ff`, `socketPink` `#ff00aa`). Each helper emits `\x1b[38;2;R;G;Bm` directly rather than rounding to the legacy 8-color palette, so truecolor terminals render the brand hex byte-for-byte. Hex values exposed via `palette.hex.*` for callers building their own escapes. Default theme is `'dark'`.
15+
- **`logger/browser`** — minimal `console`-backed `Logger` mirroring the public `success` / `fail` / `warn` / `error` / `info` / `log` surface, with no `node:process` / `node:console` / `node:os` imports. Usable from Chrome MV3 service workers, content scripts, and popups. Importing `@socketsecurity/lib/logger` in a bundler that resolves the `'browser'` export condition (rolldown, vite, esbuild) automatically picks up this shim; Node consumers continue to get the full `Logger` class.
16+
- **`'browser'` export condition** on 40 leaf modules. 35 zero-Node leaf utilities (`arrays`, `colors`, `errors`, `objects`, `regexps`, `strings`, `url`, `versions`, `words` families) carry a `'browser'` condition signalling browser-safety to bundlers. Five leaves with dedicated browser implementations (`logger/browser`, `http-request/browser`, `http-request/browser-fetch`) route to the alternate file. Browser-incompatible modules (`fs`, `archives`, `bin`, subprocess / TTY / OS-secrets surfaces) deliberately omit the condition. Full compatibility matrix in [`docs/browser-compatibility.md`](./docs/browser-compatibility.md).
17+
- **`http-request` `signal` option (Node-side parity).** `HttpRequestOptions.signal?: AbortSignal | undefined` is now plumbed through `request-attempt``httpModule.request()`. An aborted signal short-circuits the retry loop (caller cancel is not retryable). Brings the Node side to parity with the browser side, which already exposes `signal` via `AbortController` on `fetch()`.
18+
- **Default-on read-result cache for `fs/read-json` `readJson` / `readJsonSync`.** Process-scoped LRU cache keyed on `path + ino + size + mtimeMs`. Safe by four guards: stat-validated keys (re-read on stat mismatch), defensive clone on both insert and hit (caller mutations can't poison the entry), reviver opt-out (function identity isn't safely hashable), and per-call `cache: false` escape hatch. Cap defaults to 256 entries (env `SOCKET_LIB_READ_JSON_CACHE_MAX` or `setReadJsonCacheMax()`); TTL defaults to 5 min (env `SOCKET_LIB_READ_JSON_CACHE_TTL_MS` or `setReadJsonCacheTtlMs()`; set to `0` to disable TTL). `clearReadJsonCache()` + `getReadJsonCacheStats()` exported for tests and long-running daemons.
19+
20+
### Changed (breaking)
21+
22+
- **`spawn/*``process/spawn/*`.** Directory moved under `process/` (which already housed `process/abort`); the function leaf renames from `spawn/spawn` to `process/spawn/child` (the spawned child is what `spawn()` returns). Sibling files keep their names: `process/spawn/{errors,stdio,types,_internal}`.
23+
- **`signal-exit/*``events/exit/*`.** Directory merged into a new `events/` umbrella. Entry leaf renames from `signal-exit/register` to `events/exit/handler`. Sibling files unchanged: `events/exit/{intercept,lifecycle,signals,types,_internal}`.
24+
- **`warnings/*``events/warning/*`.** Sibling of `events/exit/` under the new `events/` umbrella. Entry leaf renames from `warnings/event-target` to `events/warning/handler`; `warnings/suppress` becomes `events/warning/suppress`.
25+
- **`ttl-cache/*``cache/ttl/*`.** Directory renamed; entry leaf renames from `ttl-cache/cache` to `cache/ttl/store`. `ttl-cache/types` becomes `cache/ttl/types`.
26+
- **`promise-queue/*` folded into existing `promises/`.** `promise-queue/queue` becomes `promises/queue`; `promise-queue/types` merges into the existing `promises/types`.
27+
- **`spinner/registry``spinner/default`.** Matches the `getDefaultSpinner()` naming pattern — the leaf is "the default spinner", not "the registry of spinners".
28+
- **`logger/logger``logger/default`.** Matches the `getDefaultLogger()` naming pattern; drops the doubled segment.
29+
- **`globs/glob``globs/match`.** Drops the doubled segment; `match` describes what the function does (pattern-match files), not what type the file is.
30+
- **`links/link``links/create`.** Drops the doubled segment; `create` describes the verb (`createSymlink`).
31+
- **`exports` map refreshed** for all renamed/moved leaves. The `./promises/types` entry stays unchanged — `promise-queue/types` content was folded into it.
32+
33+
### Removed (breaking)
34+
35+
- **Top-level directories `spawn/`, `signal-exit/`, `warnings/`, `ttl-cache/`, `promise-queue/`.** All five disappear in favor of the regrouped layouts above. No backcompat aliases.
36+
37+
### Migration
38+
39+
```diff
40+
- import { spawn, spawnSync } from '@socketsecurity/lib/spawn/spawn'
41+
- import { isSpawnError, SpawnError } from '@socketsecurity/lib/spawn/errors'
42+
- import type { SpawnOptions } from '@socketsecurity/lib/spawn/types'
43+
+ import {
44+
+ spawn,
45+
+ spawnSync,
46+
+ isSpawnError,
47+
+ SpawnError,
48+
+ } from '@socketsecurity/lib/process/spawn/child'
49+
+ import type { SpawnOptions } from '@socketsecurity/lib/process/spawn/types'
50+
51+
- import { onExit } from '@socketsecurity/lib/signal-exit/register'
52+
+ import { onExit } from '@socketsecurity/lib/events/exit/handler'
53+
54+
- import { suppressDeprecationWarnings } from '@socketsecurity/lib/warnings/suppress'
55+
+ import { suppressDeprecationWarnings } from '@socketsecurity/lib/events/warning/suppress'
56+
57+
- import { createTtlCache, TtlCache } from '@socketsecurity/lib/ttl-cache/cache'
58+
+ import { createTtlCache, TtlCache } from '@socketsecurity/lib/cache/ttl/store'
59+
60+
- import { getDefaultSpinner } from '@socketsecurity/lib/spinner/registry'
61+
+ import { getDefaultSpinner } from '@socketsecurity/lib/spinner/default'
62+
63+
- import { getDefaultLogger } from '@socketsecurity/lib/logger/logger'
64+
+ import { getDefaultLogger } from '@socketsecurity/lib/logger/default'
65+
66+
- import { PromiseQueue } from '@socketsecurity/lib/promise-queue/queue'
67+
+ import { PromiseQueue } from '@socketsecurity/lib/promises/queue'
68+
69+
- import { glob } from '@socketsecurity/lib/globs/glob'
70+
+ import { glob } from '@socketsecurity/lib/globs/match'
71+
72+
- import { createSymlink } from '@socketsecurity/lib/links/link'
73+
+ import { createSymlink } from '@socketsecurity/lib/links/create'
74+
```
75+
76+
No symbol names changed. No behavior changes.
77+
878
## [6.0.0](https://github.com/SocketDev/socket-lib/releases/tag/v6.0.0) - 2026-05-20
979

1080
Public-surface reshape. All top-level barrels are gone; import from named leaf subpaths instead. `@socketsecurity/lib/logger` and `@socketsecurity/lib/errors` stay as aliases.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![Socket Badge](https://socket.dev/api/badge/npm/package/@socketsecurity/lib)](https://socket.dev/npm/package/@socketsecurity/lib)
44
[![CI](https://github.com/SocketDev/socket-lib/actions/workflows/ci.yml/badge.svg)](https://github.com/SocketDev/socket-lib/actions/workflows/ci.yml)
5-
![Coverage](https://img.shields.io/badge/coverage-98%25-brightgreen)
5+
![Coverage](https://img.shields.io/badge/coverage-99%25-brightgreen)
66

77
[![Follow @SocketSecurity](https://img.shields.io/twitter/follow/SocketSecurity?style=social)](https://twitter.com/SocketSecurity)
88
[![Follow @socket.dev on Bluesky](https://img.shields.io/badge/Follow-@socket.dev-1DA1F2?style=social&logo=bluesky)](https://bsky.app/profile/socket.dev)

package.json

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

0 commit comments

Comments
 (0)