feat(lib)!: v6.1.0 — consolidate spawn/events/cache directories + drop doubled-segment leaves#195
Merged
Merged
Conversation
… into events/, ttl-cache into cache/, rename leaves to drop doubled segments
BREAKING CHANGE: Consolidates v6.0 per-leaf directory split. No backcompat aliases — socket-lib has no external users yet; the fleet cascade after publish updates all consumers.
Directory moves:
- src/spawn/{spawn,errors,stdio,types,_internal}.ts → src/process/spawn/{child,errors,stdio,types,_internal}.ts
- src/warnings/{event-target,suppress}.ts → src/events/warning/{handler,suppress}.ts
- src/signal-exit/{register,intercept,lifecycle,signals,types,_internal}.ts → src/events/exit/{handler,intercept,lifecycle,signals,types,_internal}.ts
- src/ttl-cache/{cache,types}.ts → src/cache/ttl/{store,types}.ts
- src/promise-queue/queue.ts → src/promises/queue.ts (types merged into existing src/promises/types.ts)
Leaf renames (drop doubled segments, align with default-getter naming):
- src/spinner/registry.ts → src/spinner/default.ts (matches getDefaultSpinner)
- src/logger/logger.ts → src/logger/default.ts (matches getDefaultLogger)
- src/globs/glob.ts → src/globs/match.ts
- src/links/link.ts → src/links/create.ts
The src/spawn/, src/warnings/, src/signal-exit/, src/ttl-cache/, and src/promise-queue/ directories are removed entirely.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
v6.0 shipped a per-leaf-module split that produced doubled segments (
/spawn/spawn,/ttl-cache/cache) and incoherent groupings —signal-exit/,warnings/, andprocess/abortare all process-event surfaces but lived in three different top-level directories. v6.1 fixes both shapes in one breaking pass:events/andprocess//spawn/spawn→/process/spawn/child, etc.)getDefaultLogger→logger/default,getDefaultSpinner→spinner/default)promise-queue/into the existingpromises/directory; merge its 11-linetypes.tsinto the 219-linepromises/types.ts(combined ~230, well under the 500-line soft cap)This is pre-user: socket-lib has no external consumers yet, only the fleet repos which cascade after v6.1.0 publishes. No backcompat aliases — the v6.0 paths are gone.
Renames
Removed directories: `src/spawn/`, `src/warnings/`, `src/signal-exit/`, `src/ttl-cache/`, `src/promise-queue/`.
Consumer migration
For a representative downstream `eco/npm/exec.ts`-style file, the v6.0 → v6.1 import diff:
```diff
-import { spawn } from '@socketsecurity/lib/spawn/spawn'
-import { isSpawnError } from '@socketsecurity/lib/spawn/errors'
-import type { SpawnOptions } from '@socketsecurity/lib/spawn/types'
-import { getDefaultLogger } from '@socketsecurity/lib/logger/logger'
-import { getDefaultSpinner } from '@socketsecurity/lib/spinner/registry'
-import { createTtlCache } from '@socketsecurity/lib/ttl-cache/cache'
-import type { TtlCache } from '@socketsecurity/lib/ttl-cache/types'
-import { onExit } from '@socketsecurity/lib/signal-exit/register'
-import { suppressWarnings } from '@socketsecurity/lib/warnings/suppress'
-import { PromiseQueue } from '@socketsecurity/lib/promise-queue/queue'
-import type { QueuedTask } from '@socketsecurity/lib/promise-queue/types'
-import { glob } from '@socketsecurity/lib/globs/glob'
-import { link } from '@socketsecurity/lib/links/link'
+import { spawn } from '@socketsecurity/lib/process/spawn/child'
+import { isSpawnError } from '@socketsecurity/lib/process/spawn/errors'
+import type { SpawnOptions } from '@socketsecurity/lib/process/spawn/types'
+import { getDefaultLogger } from '@socketsecurity/lib/logger/default'
+import { getDefaultSpinner } from '@socketsecurity/lib/spinner/default'
+import { createTtlCache } from '@socketsecurity/lib/cache/ttl/store'
+import type { TtlCache } from '@socketsecurity/lib/cache/ttl/types'
+import { onExit } from '@socketsecurity/lib/events/exit/handler'
+import { suppressWarnings } from '@socketsecurity/lib/events/warning/suppress'
+import { PromiseQueue } from '@socketsecurity/lib/promises/queue'
+import type { QueuedTask } from '@socketsecurity/lib/promises/types'
+import { glob } from '@socketsecurity/lib/globs/match'
+import { link } from '@socketsecurity/lib/links/create'
```
Verification
Notes for review
Test plan