diff --git a/docs/api-index.md b/docs/api-index.md index d0b4949c9..b20b38575 100644 --- a/docs/api-index.md +++ b/docs/api-index.md @@ -5,7 +5,7 @@ Each entry links to the source module and shows the first sentence of its `@file > Regenerate with `node scripts/fix/generate-api-index.mts` after adding or removing exports. Do not edit this file by hand. -**Jump to:** [Top-level](#top-level) · [abort/](#abort) · [ai/](#ai) · [ansi/](#ansi) · [archives/](#archives) · [argv/](#argv) · [arrays/](#arrays) · [bin/](#bin) · [cacache/](#cacache) · [checks/](#checks) · [colors/](#colors) · [compression/](#compression) · [constants/](#constants) · [cover/](#cover) · [crypto/](#crypto) · [debug/](#debug) · [dlx/](#dlx) · [eco/](#eco) · [effects/](#effects) · [env/](#env) · [errors/](#errors) · [external-tools/](#external-tools) · [fs/](#fs) · [git/](#git) · [github/](#github) · [globs/](#globs) · [http-request/](#http-request) · [ipc-cli/](#ipc-cli) · [ipc/](#ipc) · [json/](#json) · [links/](#links) · [logger/](#logger) · [memo/](#memo) · [node/](#node) · [objects/](#objects) · [packages/](#packages) · [paths/](#paths) · [perf/](#perf) · [pkg-ext/](#pkg-ext) · [primordials/](#primordials) · [process/](#process) · [promise-queue/](#promise-queue) · [promises/](#promises) · [regexps/](#regexps) · [releases/](#releases) · [schema/](#schema) · [sea/](#sea) · [secrets/](#secrets) · [shadow/](#shadow) · [signal-exit/](#signal-exit) · [smol/](#smol) · [sorts/](#sorts) · [spawn/](#spawn) · [spinner/](#spinner) · [ssri/](#ssri) · [stdio/](#stdio) · [streams/](#streams) · [strings/](#strings) · [tables/](#tables) · [temporal/](#temporal) · [themes/](#themes) · [ttl-cache/](#ttl-cache) · [url/](#url) · [versions/](#versions) · [warnings/](#warnings) · [words/](#words) +**Jump to:** [Top-level](#top-level) · [abort/](#abort) · [ai/](#ai) · [ansi/](#ansi) · [archives/](#archives) · [argv/](#argv) · [arrays/](#arrays) · [bin/](#bin) · [cacache/](#cacache) · [cache/](#cache) · [checks/](#checks) · [colors/](#colors) · [compression/](#compression) · [constants/](#constants) · [cover/](#cover) · [crypto/](#crypto) · [debug/](#debug) · [dlx/](#dlx) · [eco/](#eco) · [effects/](#effects) · [env/](#env) · [errors/](#errors) · [events/](#events) · [external-tools/](#external-tools) · [fs/](#fs) · [git/](#git) · [github/](#github) · [globs/](#globs) · [http-request/](#http-request) · [ipc-cli/](#ipc-cli) · [ipc/](#ipc) · [json/](#json) · [links/](#links) · [logger/](#logger) · [memo/](#memo) · [node/](#node) · [objects/](#objects) · [packages/](#packages) · [paths/](#paths) · [perf/](#perf) · [pkg-ext/](#pkg-ext) · [primordials/](#primordials) · [process/](#process) · [promises/](#promises) · [regexps/](#regexps) · [releases/](#releases) · [schema/](#schema) · [sea/](#sea) · [secrets/](#secrets) · [shadow/](#shadow) · [smol/](#smol) · [sorts/](#sorts) · [spinner/](#spinner) · [ssri/](#ssri) · [stdio/](#stdio) · [streams/](#streams) · [strings/](#strings) · [tables/](#tables) · [temporal/](#temporal) · [themes/](#themes) · [url/](#url) · [versions/](#versions) · [words/](#words) ## Top-level @@ -13,7 +13,7 @@ Each entry links to the source module and shows the first sentence of its `@file | --------------------------------------------------------------- | ------------------ | | [`@socketsecurity/lib-stable/errors`](../src/errors/message.ts) | _(no description)_ | | [`@socketsecurity/lib-stable/integrity`](../src/integrity.ts) | _(no description)_ | -| [`@socketsecurity/lib-stable/logger`](../src/logger/logger.ts) | _(no description)_ | +| [`@socketsecurity/lib-stable/logger`](../src/logger/default.ts) | _(no description)_ | ## abort/ @@ -89,6 +89,13 @@ Each entry links to the source module and shows the first sentence of its `@file | [`@socketsecurity/lib-stable/cacache/types`](../src/cacache/types.ts) | _(no description)_ | | [`@socketsecurity/lib-stable/cacache/write`](../src/cacache/write.ts) | _(no description)_ | +## cache/ + +| Subpath | Description | +| ------------------------------------------------------------------------- | ------------------ | +| [`@socketsecurity/lib-stable/cache/ttl/store`](../src/cache/ttl/store.ts) | _(no description)_ | +| [`@socketsecurity/lib-stable/cache/ttl/types`](../src/cache/ttl/types.ts) | _(no description)_ | + ## checks/ | Subpath | Description | @@ -268,6 +275,18 @@ Each entry links to the source module and shows the first sentence of its `@file | [`@socketsecurity/lib-stable/errors/predicates`](../src/errors/predicates.ts) | _(no description)_ | | [`@socketsecurity/lib-stable/errors/stack`](../src/errors/stack.ts) | _(no description)_ | +## events/ + +| Subpath | Description | +| ----------------------------------------------------------------------------------------- | ------------------ | +| [`@socketsecurity/lib-stable/events/exit/handler`](../src/events/exit/handler.ts) | _(no description)_ | +| [`@socketsecurity/lib-stable/events/exit/intercept`](../src/events/exit/intercept.ts) | _(no description)_ | +| [`@socketsecurity/lib-stable/events/exit/lifecycle`](../src/events/exit/lifecycle.ts) | _(no description)_ | +| [`@socketsecurity/lib-stable/events/exit/signals`](../src/events/exit/signals.ts) | _(no description)_ | +| [`@socketsecurity/lib-stable/events/exit/types`](../src/events/exit/types.ts) | _(no description)_ | +| [`@socketsecurity/lib-stable/events/warning/handler`](../src/events/warning/handler.ts) | _(no description)_ | +| [`@socketsecurity/lib-stable/events/warning/suppress`](../src/events/warning/suppress.ts) | _(no description)_ | + ## external-tools/ | Subpath | Description | @@ -386,7 +405,7 @@ Each entry links to the source module and shows the first sentence of its `@file | Subpath | Description | | ----------------------------------------------------------------------- | ------------------ | | [`@socketsecurity/lib-stable/globs/defaults`](../src/globs/defaults.ts) | _(no description)_ | -| [`@socketsecurity/lib-stable/globs/glob`](../src/globs/glob.ts) | _(no description)_ | +| [`@socketsecurity/lib-stable/globs/match`](../src/globs/match.ts) | _(no description)_ | | [`@socketsecurity/lib-stable/globs/matcher`](../src/globs/matcher.ts) | _(no description)_ | | [`@socketsecurity/lib-stable/globs/stream`](../src/globs/stream.ts) | _(no description)_ | | [`@socketsecurity/lib-stable/globs/types`](../src/globs/types.ts) | _(no description)_ | @@ -435,10 +454,10 @@ Each entry links to the source module and shows the first sentence of its `@file ## links/ -| Subpath | Description | -| ----------------------------------------------------------------- | ------------------ | -| [`@socketsecurity/lib-stable/links/link`](../src/links/link.ts) | _(no description)_ | -| [`@socketsecurity/lib-stable/links/types`](../src/links/types.ts) | _(no description)_ | +| Subpath | Description | +| ------------------------------------------------------------------- | ------------------ | +| [`@socketsecurity/lib-stable/links/create`](../src/links/create.ts) | _(no description)_ | +| [`@socketsecurity/lib-stable/links/types`](../src/links/types.ts) | _(no description)_ | ## logger/ @@ -446,7 +465,7 @@ Each entry links to the source module and shows the first sentence of its `@file | --------------------------------------------------------------------------------------- | ------------------ | | [`@socketsecurity/lib-stable/logger/colors`](../src/logger/colors.ts) | _(no description)_ | | [`@socketsecurity/lib-stable/logger/console`](../src/logger/console.ts) | _(no description)_ | -| [`@socketsecurity/lib-stable/logger/logger`](../src/logger/logger.ts) | _(no description)_ | +| [`@socketsecurity/lib-stable/logger/default`](../src/logger/default.ts) | _(no description)_ | | [`@socketsecurity/lib-stable/logger/symbols`](../src/logger/symbols.ts) | _(no description)_ | | [`@socketsecurity/lib-stable/logger/symbols-builder`](../src/logger/symbols-builder.ts) | _(no description)_ | | [`@socketsecurity/lib-stable/logger/types`](../src/logger/types.ts) | _(no description)_ | @@ -574,21 +593,19 @@ Each entry links to the source module and shows the first sentence of its `@file | [`@socketsecurity/lib-stable/process/lock-instance`](../src/process/lock-instance.ts) | _(no description)_ | | [`@socketsecurity/lib-stable/process/lock-manager`](../src/process/lock-manager.ts) | _(no description)_ | | [`@socketsecurity/lib-stable/process/lock-types`](../src/process/lock-types.ts) | _(no description)_ | +| [`@socketsecurity/lib-stable/process/spawn/child`](../src/process/spawn/child.ts) | _(no description)_ | +| [`@socketsecurity/lib-stable/process/spawn/errors`](../src/process/spawn/errors.ts) | _(no description)_ | +| [`@socketsecurity/lib-stable/process/spawn/stdio`](../src/process/spawn/stdio.ts) | _(no description)_ | +| [`@socketsecurity/lib-stable/process/spawn/types`](../src/process/spawn/types.ts) | _(no description)_ | | [`@socketsecurity/lib-stable/process/transient`](../src/process/transient.ts) | _(no description)_ | -## promise-queue/ - -| Subpath | Description | -| --------------------------------------------------------------------------------- | ------------------ | -| [`@socketsecurity/lib-stable/promise-queue/queue`](../src/promise-queue/queue.ts) | _(no description)_ | -| [`@socketsecurity/lib-stable/promise-queue/types`](../src/promise-queue/types.ts) | _(no description)_ | - ## promises/ | Subpath | Description | | ------------------------------------------------------------------------------- | ------------------ | | [`@socketsecurity/lib-stable/promises/iterate`](../src/promises/iterate.ts) | _(no description)_ | | [`@socketsecurity/lib-stable/promises/options`](../src/promises/options.ts) | _(no description)_ | +| [`@socketsecurity/lib-stable/promises/queue`](../src/promises/queue.ts) | _(no description)_ | | [`@socketsecurity/lib-stable/promises/resolvers`](../src/promises/resolvers.ts) | _(no description)_ | | [`@socketsecurity/lib-stable/promises/retry`](../src/promises/retry.ts) | _(no description)_ | | [`@socketsecurity/lib-stable/promises/types`](../src/promises/types.ts) | _(no description)_ | @@ -648,16 +665,6 @@ Each entry links to the source module and shows the first sentence of its `@file | [`@socketsecurity/lib-stable/shadow/skip`](../src/shadow/skip.ts) | _(no description)_ | | [`@socketsecurity/lib-stable/shadow/types`](../src/shadow/types.ts) | _(no description)_ | -## signal-exit/ - -| Subpath | Description | -| ------------------------------------------------------------------------------------- | ------------------ | -| [`@socketsecurity/lib-stable/signal-exit/intercept`](../src/signal-exit/intercept.ts) | _(no description)_ | -| [`@socketsecurity/lib-stable/signal-exit/lifecycle`](../src/signal-exit/lifecycle.ts) | _(no description)_ | -| [`@socketsecurity/lib-stable/signal-exit/register`](../src/signal-exit/register.ts) | _(no description)_ | -| [`@socketsecurity/lib-stable/signal-exit/signals`](../src/signal-exit/signals.ts) | _(no description)_ | -| [`@socketsecurity/lib-stable/signal-exit/types`](../src/signal-exit/types.ts) | _(no description)_ | - ## smol/ | Subpath | Description | @@ -680,24 +687,15 @@ Each entry links to the source module and shows the first sentence of its `@file | [`@socketsecurity/lib-stable/sorts/strings`](../src/sorts/strings.ts) | _(no description)_ | | [`@socketsecurity/lib-stable/sorts/types`](../src/sorts/types.ts) | _(no description)_ | -## spawn/ - -| Subpath | Description | -| ------------------------------------------------------------------- | ------------------ | -| [`@socketsecurity/lib-stable/spawn/errors`](../src/spawn/errors.ts) | _(no description)_ | -| [`@socketsecurity/lib-stable/spawn/spawn`](../src/spawn/spawn.ts) | _(no description)_ | -| [`@socketsecurity/lib-stable/spawn/stdio`](../src/spawn/stdio.ts) | _(no description)_ | -| [`@socketsecurity/lib-stable/spawn/types`](../src/spawn/types.ts) | _(no description)_ | - ## spinner/ -| Subpath | Description | -| --------------------------------------------------------------------------- | ------------------ | -| [`@socketsecurity/lib-stable/spinner/format`](../src/spinner/format.ts) | _(no description)_ | -| [`@socketsecurity/lib-stable/spinner/registry`](../src/spinner/registry.ts) | _(no description)_ | -| [`@socketsecurity/lib-stable/spinner/spinner`](../src/spinner/spinner.ts) | _(no description)_ | -| [`@socketsecurity/lib-stable/spinner/types`](../src/spinner/types.ts) | _(no description)_ | -| [`@socketsecurity/lib-stable/spinner/with`](../src/spinner/with.ts) | _(no description)_ | +| Subpath | Description | +| ------------------------------------------------------------------------- | ------------------ | +| [`@socketsecurity/lib-stable/spinner/default`](../src/spinner/default.ts) | _(no description)_ | +| [`@socketsecurity/lib-stable/spinner/format`](../src/spinner/format.ts) | _(no description)_ | +| [`@socketsecurity/lib-stable/spinner/spinner`](../src/spinner/spinner.ts) | _(no description)_ | +| [`@socketsecurity/lib-stable/spinner/types`](../src/spinner/types.ts) | _(no description)_ | +| [`@socketsecurity/lib-stable/spinner/with`](../src/spinner/with.ts) | _(no description)_ | ## ssri/ @@ -766,13 +764,6 @@ Each entry links to the source module and shows the first sentence of its `@file | [`@socketsecurity/lib-stable/themes/themes`](../src/themes/themes.ts) | _(no description)_ | | [`@socketsecurity/lib-stable/themes/types`](../src/themes/types.ts) | _(no description)_ | -## ttl-cache/ - -| Subpath | Description | -| ------------------------------------------------------------------------- | ------------------ | -| [`@socketsecurity/lib-stable/ttl-cache/cache`](../src/ttl-cache/cache.ts) | _(no description)_ | -| [`@socketsecurity/lib-stable/ttl-cache/types`](../src/ttl-cache/types.ts) | _(no description)_ | - ## url/ | Subpath | Description | @@ -792,13 +783,6 @@ Each entry links to the source module and shows the first sentence of its `@file | [`@socketsecurity/lib-stable/versions/range`](../src/versions/range.ts) | _(no description)_ | | [`@socketsecurity/lib-stable/versions/types`](../src/versions/types.ts) | _(no description)_ | -## warnings/ - -| Subpath | Description | -| ------------------------------------------------------------------------------------- | ------------------ | -| [`@socketsecurity/lib-stable/warnings/event-target`](../src/warnings/event-target.ts) | _(no description)_ | -| [`@socketsecurity/lib-stable/warnings/suppress`](../src/warnings/suppress.ts) | _(no description)_ | - ## words/ | Subpath | Description | diff --git a/package.json b/package.json index aa4eaf5f3..8981e18a6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@socketsecurity/lib", - "version": "6.0.0", + "version": "6.1.0", "description": "Core utilities and infrastructure for Socket.dev security tools", "keywords": [ "Socket.dev", @@ -269,6 +269,16 @@ "types": "./dist/cacache/write.d.ts", "default": "./dist/cacache/write.js" }, + "./cache/ttl/store": { + "source": "./src/cache/ttl/store.ts", + "types": "./dist/cache/ttl/store.d.ts", + "default": "./dist/cache/ttl/store.js" + }, + "./cache/ttl/types": { + "source": "./src/cache/ttl/types.ts", + "types": "./dist/cache/ttl/types.d.ts", + "default": "./dist/cache/ttl/types.js" + }, "./checks/primordials": { "source": "./src/checks/primordials.ts", "types": "./dist/checks/primordials.d.ts", @@ -869,6 +879,41 @@ "types": "./dist/errors/stack.d.ts", "default": "./dist/errors/stack.js" }, + "./events/exit/handler": { + "source": "./src/events/exit/handler.ts", + "types": "./dist/events/exit/handler.d.ts", + "default": "./dist/events/exit/handler.js" + }, + "./events/exit/intercept": { + "source": "./src/events/exit/intercept.ts", + "types": "./dist/events/exit/intercept.d.ts", + "default": "./dist/events/exit/intercept.js" + }, + "./events/exit/lifecycle": { + "source": "./src/events/exit/lifecycle.ts", + "types": "./dist/events/exit/lifecycle.d.ts", + "default": "./dist/events/exit/lifecycle.js" + }, + "./events/exit/signals": { + "source": "./src/events/exit/signals.ts", + "types": "./dist/events/exit/signals.d.ts", + "default": "./dist/events/exit/signals.js" + }, + "./events/exit/types": { + "source": "./src/events/exit/types.ts", + "types": "./dist/events/exit/types.d.ts", + "default": "./dist/events/exit/types.js" + }, + "./events/warning/handler": { + "source": "./src/events/warning/handler.ts", + "types": "./dist/events/warning/handler.d.ts", + "default": "./dist/events/warning/handler.js" + }, + "./events/warning/suppress": { + "source": "./src/events/warning/suppress.ts", + "types": "./dist/events/warning/suppress.d.ts", + "default": "./dist/events/warning/suppress.js" + }, "./external-tools/bazel/asset-names": { "source": "./src/external-tools/bazel/asset-names.ts", "types": "./dist/external-tools/bazel/asset-names.d.ts", @@ -1339,10 +1384,10 @@ "types": "./dist/globs/defaults.d.ts", "default": "./dist/globs/defaults.js" }, - "./globs/glob": { - "source": "./src/globs/glob.ts", - "types": "./dist/globs/glob.d.ts", - "default": "./dist/globs/glob.js" + "./globs/match": { + "source": "./src/globs/match.ts", + "types": "./dist/globs/match.d.ts", + "default": "./dist/globs/match.js" }, "./globs/matcher": { "source": "./src/globs/matcher.ts", @@ -1474,10 +1519,10 @@ "types": "./dist/json/types.d.ts", "default": "./dist/json/types.js" }, - "./links/link": { - "source": "./src/links/link.ts", - "types": "./dist/links/link.d.ts", - "default": "./dist/links/link.js" + "./links/create": { + "source": "./src/links/create.ts", + "types": "./dist/links/create.d.ts", + "default": "./dist/links/create.js" }, "./links/types": { "source": "./src/links/types.ts", @@ -1485,9 +1530,9 @@ "default": "./dist/links/types.js" }, "./logger": { - "source": "./src/logger/logger.ts", - "types": "./dist/logger/logger.d.ts", - "default": "./dist/logger/logger.js" + "source": "./src/logger/default.ts", + "types": "./dist/logger/default.d.ts", + "default": "./dist/logger/default.js" }, "./logger/colors": { "source": "./src/logger/colors.ts", @@ -1499,10 +1544,10 @@ "types": "./dist/logger/console.d.ts", "default": "./dist/logger/console.js" }, - "./logger/logger": { - "source": "./src/logger/logger.ts", - "types": "./dist/logger/logger.d.ts", - "default": "./dist/logger/logger.js" + "./logger/default": { + "source": "./src/logger/default.ts", + "types": "./dist/logger/default.d.ts", + "default": "./dist/logger/default.js" }, "./logger/symbols": { "source": "./src/logger/symbols.ts", @@ -1914,21 +1959,31 @@ "types": "./dist/process/lock-types.d.ts", "default": "./dist/process/lock-types.js" }, + "./process/spawn/child": { + "source": "./src/process/spawn/child.ts", + "types": "./dist/process/spawn/child.d.ts", + "default": "./dist/process/spawn/child.js" + }, + "./process/spawn/errors": { + "source": "./src/process/spawn/errors.ts", + "types": "./dist/process/spawn/errors.d.ts", + "default": "./dist/process/spawn/errors.js" + }, + "./process/spawn/stdio": { + "source": "./src/process/spawn/stdio.ts", + "types": "./dist/process/spawn/stdio.d.ts", + "default": "./dist/process/spawn/stdio.js" + }, + "./process/spawn/types": { + "source": "./src/process/spawn/types.ts", + "types": "./dist/process/spawn/types.d.ts", + "default": "./dist/process/spawn/types.js" + }, "./process/transient": { "source": "./src/process/transient.ts", "types": "./dist/process/transient.d.ts", "default": "./dist/process/transient.js" }, - "./promise-queue/queue": { - "source": "./src/promise-queue/queue.ts", - "types": "./dist/promise-queue/queue.d.ts", - "default": "./dist/promise-queue/queue.js" - }, - "./promise-queue/types": { - "source": "./src/promise-queue/types.ts", - "types": "./dist/promise-queue/types.d.ts", - "default": "./dist/promise-queue/types.js" - }, "./promises/iterate": { "source": "./src/promises/iterate.ts", "types": "./dist/promises/iterate.d.ts", @@ -1939,6 +1994,11 @@ "types": "./dist/promises/options.d.ts", "default": "./dist/promises/options.js" }, + "./promises/queue": { + "source": "./src/promises/queue.ts", + "types": "./dist/promises/queue.d.ts", + "default": "./dist/promises/queue.js" + }, "./promises/resolvers": { "source": "./src/promises/resolvers.ts", "types": "./dist/promises/resolvers.d.ts", @@ -2079,31 +2139,6 @@ "types": "./dist/shadow/types.d.ts", "default": "./dist/shadow/types.js" }, - "./signal-exit/intercept": { - "source": "./src/signal-exit/intercept.ts", - "types": "./dist/signal-exit/intercept.d.ts", - "default": "./dist/signal-exit/intercept.js" - }, - "./signal-exit/lifecycle": { - "source": "./src/signal-exit/lifecycle.ts", - "types": "./dist/signal-exit/lifecycle.d.ts", - "default": "./dist/signal-exit/lifecycle.js" - }, - "./signal-exit/register": { - "source": "./src/signal-exit/register.ts", - "types": "./dist/signal-exit/register.d.ts", - "default": "./dist/signal-exit/register.js" - }, - "./signal-exit/signals": { - "source": "./src/signal-exit/signals.ts", - "types": "./dist/signal-exit/signals.d.ts", - "default": "./dist/signal-exit/signals.js" - }, - "./signal-exit/types": { - "source": "./src/signal-exit/types.ts", - "types": "./dist/signal-exit/types.d.ts", - "default": "./dist/signal-exit/types.js" - }, "./smol/detect": { "source": "./src/smol/detect.ts", "types": "./dist/smol/detect.d.ts", @@ -2164,36 +2199,16 @@ "types": "./dist/sorts/types.d.ts", "default": "./dist/sorts/types.js" }, - "./spawn/errors": { - "source": "./src/spawn/errors.ts", - "types": "./dist/spawn/errors.d.ts", - "default": "./dist/spawn/errors.js" - }, - "./spawn/spawn": { - "source": "./src/spawn/spawn.ts", - "types": "./dist/spawn/spawn.d.ts", - "default": "./dist/spawn/spawn.js" - }, - "./spawn/stdio": { - "source": "./src/spawn/stdio.ts", - "types": "./dist/spawn/stdio.d.ts", - "default": "./dist/spawn/stdio.js" - }, - "./spawn/types": { - "source": "./src/spawn/types.ts", - "types": "./dist/spawn/types.d.ts", - "default": "./dist/spawn/types.js" + "./spinner/default": { + "source": "./src/spinner/default.ts", + "types": "./dist/spinner/default.d.ts", + "default": "./dist/spinner/default.js" }, "./spinner/format": { "source": "./src/spinner/format.ts", "types": "./dist/spinner/format.d.ts", "default": "./dist/spinner/format.js" }, - "./spinner/registry": { - "source": "./src/spinner/registry.ts", - "types": "./dist/spinner/registry.d.ts", - "default": "./dist/spinner/registry.js" - }, "./spinner/spinner": { "source": "./src/spinner/spinner.ts", "types": "./dist/spinner/spinner.d.ts", @@ -2372,16 +2387,6 @@ "types": "./dist/themes/types.d.ts", "default": "./dist/themes/types.js" }, - "./ttl-cache/cache": { - "source": "./src/ttl-cache/cache.ts", - "types": "./dist/ttl-cache/cache.d.ts", - "default": "./dist/ttl-cache/cache.js" - }, - "./ttl-cache/types": { - "source": "./src/ttl-cache/types.ts", - "types": "./dist/ttl-cache/types.d.ts", - "default": "./dist/ttl-cache/types.js" - }, "./url/parse": { "source": "./src/url/parse.ts", "types": "./dist/url/parse.d.ts", @@ -2427,16 +2432,6 @@ "types": "./dist/versions/types.d.ts", "default": "./dist/versions/types.js" }, - "./warnings/event-target": { - "source": "./src/warnings/event-target.ts", - "types": "./dist/warnings/event-target.d.ts", - "default": "./dist/warnings/event-target.js" - }, - "./warnings/suppress": { - "source": "./src/warnings/suppress.ts", - "types": "./dist/warnings/suppress.d.ts", - "default": "./dist/warnings/suppress.js" - }, "./words/article": { "source": "./src/words/article.ts", "types": "./dist/words/article.d.ts", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 96291d28a..d976384ec 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -717,6 +717,16 @@ importers: specifier: 'catalog:' version: '@socketsecurity/lib@6.0.0(typescript@5.9.2)' + .claude/hooks/squash-history-reminder: + dependencies: + '@socketsecurity/lib-stable': + specifier: 'catalog:' + version: '@socketsecurity/lib@6.0.0(typescript@5.9.2)' + devDependencies: + '@types/node': + specifier: 'catalog:' + version: 24.9.2 + .claude/hooks/stale-process-sweeper: {} .claude/hooks/token-guard: {} diff --git a/scripts/fix/generate-package-exports.mts b/scripts/fix/generate-package-exports.mts index 1514d2ff2..eee99736c 100644 --- a/scripts/fix/generate-package-exports.mts +++ b/scripts/fix/generate-package-exports.mts @@ -240,7 +240,7 @@ async function main(): Promise { // would violate the "no barrel files" CLAUDE.md rule; an exports-map // alias is just a re-pointer with no source file behind it. const fleetCompatAliases: Array<[string, string]> = [ - ['./logger', './logger/logger'], + ['./logger', './logger/default'], ['./errors', './errors/message'], ] for (const { 0: alias, 1: target } of fleetCompatAliases) { diff --git a/src/ai/discover.mts b/src/ai/discover.mts index 7700f7123..59eeee565 100644 --- a/src/ai/discover.mts +++ b/src/ai/discover.mts @@ -20,7 +20,7 @@ import path from 'node:path' import { whichSync } from '../bin/which' import { errorMessage } from '../errors/message' -import { getDefaultLogger } from '../logger/logger' +import { getDefaultLogger } from '../logger/default' import { JSONParse, JSONStringify } from '../primordials/json' const logger = getDefaultLogger() diff --git a/src/ai/spawn.mts b/src/ai/spawn.mts index 9146bb230..dac240c1a 100644 --- a/src/ai/spawn.mts +++ b/src/ai/spawn.mts @@ -14,8 +14,8 @@ import { errorMessage } from '../errors/message' import { ObjectKeys } from '../primordials/object' -import { spawn } from '../spawn/spawn' -import { isSpawnError } from '../spawn/errors' +import { spawn } from '../process/spawn/child' +import { isSpawnError } from '../process/spawn/errors' import { discoverAiAgents } from './discover.mts' diff --git a/src/ai/worktree.mts b/src/ai/worktree.mts index 16883ead4..19d81c6cd 100644 --- a/src/ai/worktree.mts +++ b/src/ai/worktree.mts @@ -18,8 +18,8 @@ import { existsSync } from 'node:fs' import path from 'node:path' import { errorMessage } from '../errors/message' -import { spawnSync } from '../spawn/spawn' -import { isSpawnError } from '../spawn/errors' +import { spawnSync } from '../process/spawn/child' +import { isSpawnError } from '../process/spawn/errors' import type { WorktreeCleanup } from './types.mts' diff --git a/src/bin/check-primordials.ts b/src/bin/check-primordials.ts index 7a313d36b..7a10463d9 100644 --- a/src/bin/check-primordials.ts +++ b/src/bin/check-primordials.ts @@ -16,7 +16,7 @@ import path from 'node:path' import process from 'node:process' import { errorMessage } from '../errors/message' -import { getDefaultLogger } from '../logger/logger' +import { getDefaultLogger } from '../logger/default' import { ArrayIsArray } from '../primordials/array' import { ErrorCtor } from '../primordials/error' import { JSONParse, JSONStringify } from '../primordials/json' diff --git a/src/bin/check.ts b/src/bin/check.ts index 3a1055c2d..f7fe98346 100644 --- a/src/bin/check.ts +++ b/src/bin/check.ts @@ -7,7 +7,7 @@ * prim → primordials. */ -import { getDefaultLogger } from '../logger/logger' +import { getDefaultLogger } from '../logger/default' import { runCheckPrimordials } from './check-primordials' diff --git a/src/bin/exec.ts b/src/bin/exec.ts index cd0f281b4..a58ea9e18 100644 --- a/src/bin/exec.ts +++ b/src/bin/exec.ts @@ -22,13 +22,13 @@ import { WIN32 } from '../constants/platform' import { isPath } from '../paths/normalize' import { ArrayIsArray } from '../primordials/array' import { ErrorCtor } from '../primordials/error' -import { spawn } from '../spawn/spawn' +import { spawn } from '../process/spawn/child' import { binPathCache, getFs } from './_internal' import { resolveRealBinSync } from './resolve' import { whichReal } from './which' -import type { SpawnOptions } from '../spawn/types' +import type { SpawnOptions } from '../process/spawn/types' /** * Execute a binary with the given arguments. diff --git a/src/bin/socket-lib.ts b/src/bin/socket-lib.ts index f4a833c87..d126327bb 100644 --- a/src/bin/socket-lib.ts +++ b/src/bin/socket-lib.ts @@ -12,7 +12,7 @@ import process from 'node:process' -import { getDefaultLogger } from '../logger/logger' +import { getDefaultLogger } from '../logger/default' import { runCheck } from './check' diff --git a/src/ttl-cache/cache.ts b/src/cache/ttl/store.ts similarity index 94% rename from src/ttl-cache/cache.ts rename to src/cache/ttl/store.ts index 1aab9553b..bd9a9e5d8 100644 --- a/src/ttl-cache/cache.ts +++ b/src/cache/ttl/store.ts @@ -16,21 +16,21 @@ * treated as expired. */ -import { clear as cacacheClear } from '../cacache/clear' -import { safeGet as cacacheSafeGet } from '../cacache/read' -import { put as cacachePut, remove as cacacheRemove } from '../cacache/write' -import { DateNow } from '../primordials/date' -import { TypeErrorCtor } from '../primordials/error' -import { JSONParse, JSONStringify } from '../primordials/json' -import { MapCtor } from '../primordials/map-set' -import { MathMax } from '../primordials/math' -import { RegExpCtor, RegExpPrototypeTest } from '../primordials/regexp' +import { clear as cacacheClear } from '../../cacache/clear' +import { safeGet as cacacheSafeGet } from '../../cacache/read' +import { put as cacachePut, remove as cacacheRemove } from '../../cacache/write' +import { DateNow } from '../../primordials/date' +import { TypeErrorCtor } from '../../primordials/error' +import { JSONParse, JSONStringify } from '../../primordials/json' +import { MapCtor } from '../../primordials/map-set' +import { MathMax } from '../../primordials/math' +import { RegExpCtor, RegExpPrototypeTest } from '../../primordials/regexp' import { StringPrototypeIncludes, StringPrototypeReplaceAll, StringPrototypeSlice, StringPrototypeStartsWith, -} from '../primordials/string' +} from '../../primordials/string' import type { ClearOptions, @@ -233,8 +233,8 @@ export function createTtlCache(options?: TtlCacheOptions): TtlCache { /* c8 ignore stop */ // Check persistent cache for entries not in memory. - const cacheDir = (await import('../paths/socket')).getSocketCacacheDir() - const cacacheModule = await import('../cacache/_internal') + const cacheDir = (await import('../../paths/socket')).getSocketCacacheDir() + const cacacheModule = await import('../../cacache/_internal') const stream = cacacheModule.getCacache().ls.stream(cacheDir) for await (const cacheEntry of stream) { diff --git a/src/ttl-cache/types.ts b/src/cache/ttl/types.ts similarity index 97% rename from src/ttl-cache/types.ts rename to src/cache/ttl/types.ts index 83c453eb3..00cb08478 100644 --- a/src/ttl-cache/types.ts +++ b/src/cache/ttl/types.ts @@ -1,5 +1,5 @@ /** - * @file Public type surface for `ttl-cache/*` modules — the `TtlCache` + * @file Public type surface for `cache/ttl/*` modules — the `TtlCache` * interface (the seven-method API returned by `createTtlCache`), the * `TtlCacheEntry` storage shape, and the `TtlCacheOptions` / `ClearOptions` * configuration records. Pure types, no runtime side effects. diff --git a/src/cover/code.ts b/src/cover/code.ts index 257e64fd3..7acb431ff 100644 --- a/src/cover/code.ts +++ b/src/cover/code.ts @@ -6,7 +6,7 @@ import process from 'node:process' import { readJson } from '../fs/read-json' import { isPlainObject } from '../objects/predicates' -import { spawn } from '../spawn/spawn' +import { spawn } from '../process/spawn/child' import { ArrayIsArray } from '../primordials/array' diff --git a/src/cover/type.ts b/src/cover/type.ts index fa3ccdb7c..b92239fa9 100644 --- a/src/cover/type.ts +++ b/src/cover/type.ts @@ -4,7 +4,7 @@ import process from 'node:process' -import { spawn } from '../spawn/spawn' +import { spawn } from '../process/spawn/child' import type { GetTypeCoverageOptions, TypeCoverageResult } from './types' diff --git a/src/debug/_internal.ts b/src/debug/_internal.ts index 721b72043..f6ef9f62f 100644 --- a/src/debug/_internal.ts +++ b/src/debug/_internal.ts @@ -9,7 +9,7 @@ import isUnicodeSupported from '../external/@socketregistry/is-unicode-supported' import debugJs from '../external/debug' -import { getDefaultLogger } from '../logger/logger' +import { getDefaultLogger } from '../logger/default' import { MapCtor } from '../primordials/map-set' import { ReflectApply } from '../primordials/reflect' diff --git a/src/debug/output.ts b/src/debug/output.ts index 3245b4bba..22f3e80f5 100644 --- a/src/debug/output.ts +++ b/src/debug/output.ts @@ -11,7 +11,7 @@ import debugJs from '../external/debug' import { ArrayPrototypeAt, ArrayPrototypeSlice } from '../primordials/array' import { DateNow } from '../primordials/date' import { ReflectApply } from '../primordials/reflect' -import { getDefaultSpinner } from '../spinner/registry' +import { getDefaultSpinner } from '../spinner/default' import { applyLinePrefix } from '../strings/format' import { getPointingTriangle, getUtil, logger } from './_internal' diff --git a/src/dlx/binary-types.ts b/src/dlx/binary-types.ts index 9dbf585b9..1cf15a8b3 100644 --- a/src/dlx/binary-types.ts +++ b/src/dlx/binary-types.ts @@ -9,8 +9,8 @@ */ import type { HashSpec } from '../integrity' -import type { spawn } from '../spawn/spawn' -import type { SpawnOptions } from '../spawn/types' +import type { spawn } from '../process/spawn/child' +import type { SpawnOptions } from '../process/spawn/types' export interface DlxBinaryOptions { /** diff --git a/src/dlx/binary.ts b/src/dlx/binary.ts index 0945fc153..9def05d5d 100644 --- a/src/dlx/binary.ts +++ b/src/dlx/binary.ts @@ -21,7 +21,7 @@ import { DLX_BINARY_CACHE_TTL } from '../constants/time' import { readJson } from '../fs/read-json' import { safeMkdir } from '../fs/safe' import { normalizePath } from '../paths/normalize' -import { spawn } from '../spawn/spawn' +import { spawn } from '../process/spawn/child' import { generateCacheKey } from './cache' import { normalizeHash } from '../integrity' @@ -41,7 +41,7 @@ import { import { downloadBinaryFile } from './binary-download' import type { DlxBinaryOptions, DlxBinaryResult } from './binary-types' -import type { SpawnExtra, SpawnOptions } from '../spawn/types' +import type { SpawnExtra, SpawnOptions } from '../process/spawn/types' /** * Download and execute a binary from a URL with caching. diff --git a/src/dlx/manifest.ts b/src/dlx/manifest.ts index 7c9f130fa..18af28975 100644 --- a/src/dlx/manifest.ts +++ b/src/dlx/manifest.ts @@ -26,7 +26,7 @@ import { errorMessage } from '../errors/message' import { readFileUtf8Sync } from '../fs/read-file' import { safeDeleteSync, safeMkdirSync } from '../fs/safe' -import { getDefaultLogger } from '../logger/logger' +import { getDefaultLogger } from '../logger/default' import { getSocketDlxDir } from '../paths/socket' import { processLock } from '../process/lock-instance' diff --git a/src/dlx/package.ts b/src/dlx/package.ts index 01ed0daee..6fb6840db 100644 --- a/src/dlx/package.ts +++ b/src/dlx/package.ts @@ -40,7 +40,7 @@ import { safeMkdir } from '../fs/safe' import { normalizePath } from '../paths/normalize' import { getSocketCacacheDir, getSocketDlxDir } from '../paths/socket' import { processLock } from '../process/lock-instance' -import { spawn } from '../spawn/spawn' +import { spawn } from '../process/spawn/child' import { generateCacheKey } from './cache' import { getNodeFs } from '../node/fs' @@ -55,7 +55,7 @@ import type { DownloadPackageResult, EnsurePackageInstallOptions, } from './types' -import type { SpawnExtra, SpawnOptions } from '../spawn/types' +import type { SpawnExtra, SpawnOptions } from '../process/spawn/types' import { ErrorCtor } from '../primordials/error' diff --git a/src/dlx/types.ts b/src/dlx/types.ts index 2fcc68b2e..c05bb3a73 100644 --- a/src/dlx/types.ts +++ b/src/dlx/types.ts @@ -11,8 +11,8 @@ import type { HashSpec } from '../integrity' import type { LockfileSpec } from './lockfile' -import type { spawn } from '../spawn/spawn' -import type { SpawnOptions } from '../spawn/types' +import type { spawn } from '../process/spawn/child' +import type { SpawnOptions } from '../process/spawn/types' export interface DownloadPackageResult { /** diff --git a/src/eco/npm/npm/exec.ts b/src/eco/npm/npm/exec.ts index 796a26b94..de8a1031a 100644 --- a/src/eco/npm/npm/exec.ts +++ b/src/eco/npm/npm/exec.ts @@ -19,7 +19,7 @@ import { ArrayPrototypeIndexOf, ArrayPrototypeSlice, } from '../../../primordials/array' -import { spawn } from '../../../spawn/spawn' +import { spawn } from '../../../process/spawn/child' import { isNpmAuditFlag, @@ -28,7 +28,7 @@ import { isNpmProgressFlag, } from './flags' -import type { SpawnOptions } from '../../../spawn/types' +import type { SpawnOptions } from '../../../process/spawn/types' /** * Execute npm commands with optimized flags and settings. diff --git a/src/eco/npm/pnpm/exec.ts b/src/eco/npm/pnpm/exec.ts index 856ad11a4..e1dc26db9 100644 --- a/src/eco/npm/pnpm/exec.ts +++ b/src/eco/npm/pnpm/exec.ts @@ -21,7 +21,7 @@ import { PNPM_INSTALL_LIKE_COMMANDS, } from './flags' -import type { SpawnOptions } from '../../../spawn/types' +import type { SpawnOptions } from '../../../process/spawn/types' export interface PnpmOptions extends SpawnOptions { allowLockfileUpdate?: boolean diff --git a/src/eco/npm/script.ts b/src/eco/npm/script.ts index 81597b25d..a137d56dc 100644 --- a/src/eco/npm/script.ts +++ b/src/eco/npm/script.ts @@ -28,13 +28,13 @@ import { import { findUpSync } from '../../fs/find-up' import { getOwn } from '../../objects/inspect' import { ArrayIsArray } from '../../primordials/array' -import { spawn } from '../../spawn/spawn' +import { spawn } from '../../process/spawn/child' import { execNpm } from './npm/exec' import { execPnpm } from './pnpm/exec' import { execYarn } from './yarnpkg/yarn/exec' -import type { SpawnOptions } from '../../spawn/types' +import type { SpawnOptions } from '../../process/spawn/types' export interface ExecScriptOptions extends SpawnOptions { prepost?: boolean | undefined diff --git a/src/eco/npm/yarnpkg/yarn/exec.ts b/src/eco/npm/yarnpkg/yarn/exec.ts index 49d3fc393..32e853cd0 100644 --- a/src/eco/npm/yarnpkg/yarn/exec.ts +++ b/src/eco/npm/yarnpkg/yarn/exec.ts @@ -20,7 +20,7 @@ import { isPnpmIgnoreScriptsFlag } from '../../pnpm/flags' import { SetCtor } from '../../../../primordials/map-set' -import type { SpawnOptions } from '../../../../spawn/types' +import type { SpawnOptions } from '../../../../process/spawn/types' // Commands that support --ignore-scripts in yarn (similar to npm/pnpm). const yarnInstallLikeCommands = new SetCtor([ diff --git a/src/signal-exit/_internal.ts b/src/events/exit/_internal.ts similarity index 98% rename from src/signal-exit/_internal.ts rename to src/events/exit/_internal.ts index f93dd3370..004a8b547 100644 --- a/src/signal-exit/_internal.ts +++ b/src/events/exit/_internal.ts @@ -1,5 +1,5 @@ /** - * @file Private internals for `signal-exit/*` modules — the shared + * @file Private internals for `events/exit/*` modules — the shared * module-singleton state plus the lazy accessors that read and mutate it. * Owns the emitter, signal list, and `loaded` flag. `lifecycle` * (load/unload/getSignalListeners) and `intercept` diff --git a/src/signal-exit/register.ts b/src/events/exit/handler.ts similarity index 97% rename from src/signal-exit/register.ts rename to src/events/exit/handler.ts index e1df1f5ac..89f03e9e8 100644 --- a/src/signal-exit/register.ts +++ b/src/events/exit/handler.ts @@ -5,7 +5,7 @@ * out. */ -import { TypeErrorCtor } from '../primordials/error' +import { TypeErrorCtor } from '../../primordials/error' import { getEmitter, globalProcess, isLoaded } from './_internal' import { load, unload } from './lifecycle' diff --git a/src/signal-exit/intercept.ts b/src/events/exit/intercept.ts similarity index 94% rename from src/signal-exit/intercept.ts rename to src/events/exit/intercept.ts index 520a77afc..c256fd990 100644 --- a/src/signal-exit/intercept.ts +++ b/src/events/exit/intercept.ts @@ -5,8 +5,8 @@ * / `afterexit` through the signal-exit emitter. */ -import { ErrorCtor } from '../primordials/error' -import { ReflectApply } from '../primordials/reflect' +import { ErrorCtor } from '../../primordials/error' +import { ReflectApply } from '../../primordials/reflect' import { emit, diff --git a/src/signal-exit/lifecycle.ts b/src/events/exit/lifecycle.ts similarity index 100% rename from src/signal-exit/lifecycle.ts rename to src/events/exit/lifecycle.ts diff --git a/src/signal-exit/signals.ts b/src/events/exit/signals.ts similarity index 100% rename from src/signal-exit/signals.ts rename to src/events/exit/signals.ts diff --git a/src/signal-exit/types.ts b/src/events/exit/types.ts similarity index 92% rename from src/signal-exit/types.ts rename to src/events/exit/types.ts index 3d78a5fc1..c5ec7d646 100644 --- a/src/signal-exit/types.ts +++ b/src/events/exit/types.ts @@ -1,5 +1,5 @@ /** - * @file Public type surface for `signal-exit/*` modules — the `OnExitOptions` + * @file Public type surface for `events/exit/*` modules — the `OnExitOptions` * consumed by `onExit`, plus the shared internal types for the signal * emitter, emitted-signal map, and listener map. Pure types, no runtime side * effects. diff --git a/src/warnings/event-target.ts b/src/events/warning/handler.ts similarity index 95% rename from src/warnings/event-target.ts rename to src/events/warning/handler.ts index 7ed2a63f9..e0b53f496 100644 --- a/src/warnings/event-target.ts +++ b/src/events/warning/handler.ts @@ -6,7 +6,7 @@ * `process.emitWarning` wrapping involved. */ -import { ObjectGetOwnPropertySymbols } from '../primordials/object' +import { ObjectGetOwnPropertySymbols } from '../../primordials/object' /** * Set max listeners on an EventTarget (like AbortSignal) to avoid TypeError. @@ -22,7 +22,7 @@ import { ObjectGetOwnPropertySymbols } from '../primordials/object' * property directly to avoid depending on 'node:events' module. * * @example - * import { setMaxEventTargetListeners } from '@socketsecurity/lib/warnings/event-target' + * import { setMaxEventTargetListeners } from '@socketsecurity/lib/events/warning/handler' * * const controller = new AbortController() * setMaxEventTargetListeners(controller.signal) diff --git a/src/warnings/suppress.ts b/src/events/warning/suppress.ts similarity index 94% rename from src/warnings/suppress.ts rename to src/events/warning/suppress.ts index 35c9f063d..11f6bb694 100644 --- a/src/warnings/suppress.ts +++ b/src/events/warning/suppress.ts @@ -6,8 +6,8 @@ import process from 'node:process' -import { SetCtor } from '../primordials/map-set' -import { ReflectApply } from '../primordials/reflect' +import { SetCtor } from '../../primordials/map-set' +import { ReflectApply } from '../../primordials/reflect' // Store the original emitWarning function to avoid repeat wrapping. let originalEmitWarning: typeof process.emitWarning | undefined @@ -80,7 +80,7 @@ export function setupSuppression(): void { * so repeat invocations are cheap. * * @example - * import { suppressMaxListenersWarning } from '@socketsecurity/lib/warnings/suppress' + * import { suppressMaxListenersWarning } from '@socketsecurity/lib/events/warning/suppress' * * suppressMaxListenersWarning() */ @@ -93,7 +93,7 @@ export function suppressMaxListenersWarning(): void { * Suppress all process warnings of a specific type. * * @example - * import { suppressWarningType } from '@socketsecurity/lib/warnings/suppress' + * import { suppressWarningType } from '@socketsecurity/lib/events/warning/suppress' * * suppressWarningType('ExperimentalWarning') * @@ -109,7 +109,7 @@ export function suppressWarningType(warningType: string): void { * Suppress warnings temporarily within a callback. * * @example - * import { withSuppressedWarnings } from '@socketsecurity/lib/warnings/suppress' + * import { withSuppressedWarnings } from '@socketsecurity/lib/events/warning/suppress' * * const result = await withSuppressedWarnings( * 'ExperimentalWarning', diff --git a/src/git/_internal.ts b/src/git/_internal.ts index 004d39202..a5e2ee897 100644 --- a/src/git/_internal.ts +++ b/src/git/_internal.ts @@ -15,7 +15,7 @@ import { JSONStringify } from '../primordials/json' import { MapCtor } from '../primordials/map-set' import { ObjectKeys } from '../primordials/object' import { StringPrototypeSubstring } from '../primordials/string' -import { spawn, spawnSync } from '../spawn/spawn' +import { spawn, spawnSync } from '../process/spawn/child' import { stripAnsi } from '../ansi/strip' import { findGitRoot, getCachedRealpath, getCwd, getPath } from './repo' diff --git a/src/github/refs-cache.ts b/src/github/refs-cache.ts index dd86b01bf..b446df7ad 100644 --- a/src/github/refs-cache.ts +++ b/src/github/refs-cache.ts @@ -10,11 +10,11 @@ * - Disable everything with the `DISABLE_GITHUB_CACHE` env var */ -import { createTtlCache } from '../ttl-cache/cache' +import { createTtlCache } from '../cache/ttl/store' import { DEFAULT_CACHE_TTL_MS } from './constants' -import type { TtlCache } from '../ttl-cache/types' +import type { TtlCache } from '../cache/ttl/types' let _githubCache: TtlCache | undefined diff --git a/src/github/token.ts b/src/github/token.ts index 35ad7ebeb..8c9825ab6 100644 --- a/src/github/token.ts +++ b/src/github/token.ts @@ -8,9 +8,9 @@ import { getGhToken, getGithubToken } from '../env/github' import { getSocketCliGithubToken } from '../env/socket-cli' -import { spawn } from '../spawn/spawn' +import { spawn } from '../process/spawn/child' -import type { SpawnOptions } from '../spawn/types' +import type { SpawnOptions } from '../process/spawn/types' /** * Get GitHub authentication token from environment variables. Checks multiple diff --git a/src/globs/glob.ts b/src/globs/match.ts similarity index 100% rename from src/globs/glob.ts rename to src/globs/match.ts diff --git a/src/http-request/download-types.ts b/src/http-request/download-types.ts index e0d70d252..c12390d86 100644 --- a/src/http-request/download-types.ts +++ b/src/http-request/download-types.ts @@ -7,7 +7,7 @@ */ import type { IncomingHttpHeaders } from 'node:http' -import type { Logger } from '../logger/logger' +import type { Logger } from '../logger/default' /** * Configuration options for file downloads. @@ -57,7 +57,7 @@ export interface HttpDownloadOptions { * * @example * ;```ts - * import { getDefaultLogger } from '@socketsecurity/lib/logger/logger' + * import { getDefaultLogger } from '@socketsecurity/lib/logger/default' * * const logger = getDefaultLogger() * await httpDownload('https://example.com/file.zip', '/tmp/file.zip', { diff --git a/src/links/link.ts b/src/links/create.ts similarity index 96% rename from src/links/link.ts rename to src/links/create.ts index 946a8b474..cb233af9f 100644 --- a/src/links/link.ts +++ b/src/links/create.ts @@ -23,7 +23,7 @@ import type { LinkOptions } from './types' * * @example * ;```ts - * import { link } from '@socketsecurity/lib/links/link' + * import { link } from '@socketsecurity/lib/links/create' * * // Use current theme * console.log(link('Documentation', 'https://socket.dev')) @@ -87,7 +87,7 @@ export function link(text: string, url: string, options?: LinkOptions): string { * * @example * ;```ts - * import { links } from '@socketsecurity/lib/links/link' + * import { links } from '@socketsecurity/lib/links/create' * * const formatted = links([ * ['Documentation', 'https://socket.dev'], diff --git a/src/logger/_internal.ts b/src/logger/_internal.ts index 42a365019..2f1a32db5 100644 --- a/src/logger/_internal.ts +++ b/src/logger/_internal.ts @@ -1,5 +1,5 @@ /** - * @file Private state shared between the `logger/logger` class (which owns the + * @file Private state shared between the `logger/default` class (which owns the * public `Logger` surface) and `logger/console-init` (which mutates * `Logger.prototype` to mirror `globalConsole`). The `_` prefix keeps this * module out of the generated package.json `exports` map (the `dist/**\/_*` diff --git a/src/logger/console.ts b/src/logger/console.ts index df1e35b49..ac424e710 100644 --- a/src/logger/console.ts +++ b/src/logger/console.ts @@ -36,7 +36,7 @@ import { privateConsole, privateConstructorArgs, } from './_internal' -import { Logger } from './logger' +import { Logger } from './default' import { getKGroupIndentationWidthSymbol } from './symbols' let _Console: typeof import('node:console').Console | undefined diff --git a/src/logger/logger.ts b/src/logger/default.ts similarity index 100% rename from src/logger/logger.ts rename to src/logger/default.ts diff --git a/src/logger/symbols-builder.ts b/src/logger/symbols-builder.ts index b16cf75a9..7162f899f 100644 --- a/src/logger/symbols-builder.ts +++ b/src/logger/symbols-builder.ts @@ -1,6 +1,6 @@ /** * @file Free-function helpers for per-instance log-symbol construction + symbol - * stripping. Extracted from `logger/logger.ts` (the `Logger` class) so the + * stripping. Extracted from `logger/default.ts` (the `Logger` class) so the * class stays under the 1000-line hard cap and so other callers (alt loggers, * format helpers) can reuse the same logic without instantiating a `Logger`. * diff --git a/src/logger/types.ts b/src/logger/types.ts index 43c041f25..f1674b5a6 100644 --- a/src/logger/types.ts +++ b/src/logger/types.ts @@ -5,7 +5,7 @@ * effects so this module stays cheap to import everywhere. */ -import type { Logger } from './logger' +import type { Logger } from './default' /** * Log symbols for terminal output with colored indicators. diff --git a/src/packages/isolation.ts b/src/packages/isolation.ts index 9e4f28593..287d2ff20 100644 --- a/src/packages/isolation.ts +++ b/src/packages/isolation.ts @@ -9,7 +9,7 @@ import { WIN32 } from '../constants/platform' import { errorMessage } from '../errors/message' import { isAbsolute, isPath, trimLeadingDotSlash } from '../paths/normalize' import { getOsTmpDir } from '../paths/socket' -import { spawn } from '../spawn/spawn' +import { spawn } from '../process/spawn/child' import { readPackageJson } from './operations' import type { PackageJson } from './types' diff --git a/src/process/lock-manager.ts b/src/process/lock-manager.ts index 9007a7893..51f57cb0d 100644 --- a/src/process/lock-manager.ts +++ b/src/process/lock-manager.ts @@ -44,13 +44,13 @@ import { errorMessage } from '../errors/message' import { safeDeleteSync } from '../fs/safe' -import { getDefaultLogger } from '../logger/logger' +import { getDefaultLogger } from '../logger/default' import { DateNow } from '../primordials/date' import { ErrorCtor } from '../primordials/error' import { MapCtor, SetCtor } from '../primordials/map-set' import { MathMax } from '../primordials/math' import { pRetry } from '../promises/retry' -import { onExit } from '../signal-exit/register' +import { onExit } from '../events/exit/handler' import { getFs, getPath } from './_internal' diff --git a/src/spawn/_internal.ts b/src/process/spawn/_internal.ts similarity index 86% rename from src/spawn/_internal.ts rename to src/process/spawn/_internal.ts index 666ab0fec..9548ca9f3 100644 --- a/src/spawn/_internal.ts +++ b/src/process/spawn/_internal.ts @@ -5,10 +5,10 @@ * Underscore prefix excludes this file from the public exports map. */ -import { stripAnsi } from '../ansi/strip' -import { MapCtor, WeakMapCtor } from '../primordials/map-set' +import { stripAnsi } from '../../ansi/strip' +import { MapCtor, WeakMapCtor } from '../../primordials/map-set' // @ts-expect-error - external vendored module -import type npmCliPromiseSpawnType from '../external/@npmcli/promise-spawn' +import type npmCliPromiseSpawnType from '../../external/@npmcli/promise-spawn' // Cache for lazy stack trace computation. export const stackCache = new WeakMapCtor() @@ -29,7 +29,7 @@ let _npmCliPromiseSpawn: typeof npmCliPromiseSpawnType | undefined /*@__NO_SIDE_EFFECTS__*/ export function getNpmCliPromiseSpawn() { if (_npmCliPromiseSpawn === undefined) { - _npmCliPromiseSpawn = /*@__PURE__*/ require('../external/@npmcli/promise-spawn') + _npmCliPromiseSpawn = /*@__PURE__*/ require('../../external/@npmcli/promise-spawn') } return _npmCliPromiseSpawn! } diff --git a/src/spawn/spawn.ts b/src/process/spawn/child.ts similarity index 97% rename from src/spawn/spawn.ts rename to src/process/spawn/child.ts index df7df6e9c..cb7019f7f 100644 --- a/src/spawn/spawn.ts +++ b/src/process/spawn/child.ts @@ -20,15 +20,15 @@ import process from 'node:process' -import { whichSync } from '../bin/which' -import { getAbortSignal } from '../process/abort' -import { getNodeChildProcess } from '../node/child-process' -import { getNodeFs } from '../node/fs' -import { getNodePath } from '../node/path' -import { getOwn } from '../objects/inspect' -import { isPath } from '../paths/normalize' -import { RegExpPrototypeTest } from '../primordials/regexp' -import { getDefaultSpinner } from '../spinner/registry' +import { whichSync } from '../../bin/which' +import { getAbortSignal } from '../../process/abort' +import { getNodeChildProcess } from '../../node/child-process' +import { getNodeFs } from '../../node/fs' +import { getNodePath } from '../../node/path' +import { getOwn } from '../../objects/inspect' +import { isPath } from '../../paths/normalize' +import { RegExpPrototypeTest } from '../../primordials/regexp' +import { getDefaultSpinner } from '../../spinner/default' import { getNpmCliPromiseSpawn, @@ -51,7 +51,7 @@ import type { SpawnSyncReturns, } from './types' // @ts-expect-error - external vendored module -import type npmCliPromiseSpawnType from '../external/@npmcli/promise-spawn' +import type npmCliPromiseSpawnType from '../../external/@npmcli/promise-spawn' const abortSignal = getAbortSignal() const spinner = getDefaultSpinner() diff --git a/src/spawn/errors.ts b/src/process/spawn/errors.ts similarity index 95% rename from src/spawn/errors.ts rename to src/process/spawn/errors.ts index afde466d5..e87b43c8f 100644 --- a/src/spawn/errors.ts +++ b/src/process/spawn/errors.ts @@ -11,15 +11,15 @@ * `stackWithCauses` cost. */ -import { stackWithCauses } from '../errors/stack' -import { hasOwn } from '../objects/predicates' -import { ErrorCtor } from '../primordials/error' +import { stackWithCauses } from '../../errors/stack' +import { hasOwn } from '../../objects/predicates' +import { ErrorCtor } from '../../primordials/error' import { ObjectDefineProperties, ObjectDefineProperty, ObjectGetOwnPropertyDescriptors, -} from '../primordials/object' -import { ReflectDeleteProperty } from '../primordials/reflect' +} from '../../primordials/object' +import { ReflectDeleteProperty } from '../../primordials/reflect' import { stackCache } from './_internal' import type { SpawnError } from './types' diff --git a/src/spawn/stdio.ts b/src/process/spawn/stdio.ts similarity index 98% rename from src/spawn/stdio.ts rename to src/process/spawn/stdio.ts index ffdfbd24d..e871e4925 100644 --- a/src/spawn/stdio.ts +++ b/src/process/spawn/stdio.ts @@ -13,7 +13,7 @@ * where all three streams use the same mode. */ -import { isArray } from '../arrays/predicates' +import { isArray } from '../../arrays/predicates' import type { StdioType } from './types' diff --git a/src/spawn/types.ts b/src/process/spawn/types.ts similarity index 98% rename from src/spawn/types.ts rename to src/process/spawn/types.ts index d4d17b045..acfe6c382 100644 --- a/src/spawn/types.ts +++ b/src/process/spawn/types.ts @@ -20,8 +20,8 @@ import type { SendHandle, Serializable, StdioOptions } from 'node:child_process' import type { EventEmitter } from 'node:events' -import type { Remap } from '../objects/types' -import type { SpinnerInstance } from '../spinner/types' +import type { Remap } from '../../objects/types' +import type { SpinnerInstance } from '../../spinner/types' // Define BufferEncoding type for TypeScript compatibility. export type BufferEncoding = globalThis.BufferEncoding @@ -315,7 +315,7 @@ export interface WritableStreamType { * @property {number | undefined} gid - Group identity (POSIX) * @property {boolean | string | undefined} shell - Run command in shell. * @property {AbortSignal | undefined} signal - Abort signal. - * @property {import('../spinner/types').SpinnerInstance | undefined} spinner - + * @property {import('../../spinner/types').SpinnerInstance | undefined} spinner - * Spinner instance to pause during execution. * @property {StdioType | undefined} stdio - Stdio configuration. * @property {boolean | undefined} stdioString - Convert output to strings diff --git a/src/promise-queue/types.ts b/src/promise-queue/types.ts deleted file mode 100644 index 54b96aa71..000000000 --- a/src/promise-queue/types.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** - * @file Public type surface for `promise-queue/*` modules — the `QueuedTask` - * storage shape used by the bounded-concurrency `PromiseQueue`. Pure types, - * no runtime side effects. - */ - -export type QueuedTask = { - fn: () => Promise - resolve: (value: T) => void - reject: (error: unknown) => void -} diff --git a/src/promise-queue/queue.ts b/src/promises/queue.ts similarity index 100% rename from src/promise-queue/queue.ts rename to src/promises/queue.ts diff --git a/src/promises/types.ts b/src/promises/types.ts index 02d01811b..ea8022b1d 100644 --- a/src/promises/types.ts +++ b/src/promises/types.ts @@ -1,7 +1,8 @@ /** * @file Public type surface for `promises/*` modules: `RetryOptions`, - * `IterationOptions`, and `PromiseWithResolvers`. Pure types, no runtime side - * effects. + * `IterationOptions`, `PromiseWithResolvers`, and the `QueuedTask` storage + * shape used by the bounded-concurrency `PromiseQueue`. Pure types, no + * runtime side effects. */ /** @@ -217,3 +218,16 @@ export interface PromiseWithResolvers { */ reject: (reason?: unknown) => void } + +/** + * Queued-task storage shape for the bounded-concurrency `PromiseQueue`. + * + * Each entry pairs a deferred task function with the resolver / rejecter for + * the promise returned to the caller, so the queue can run tasks under a + * concurrency cap and forward results when they settle. + */ +export type QueuedTask = { + fn: () => Promise + resolve: (value: T) => void + reject: (error: unknown) => void +} diff --git a/src/releases/github-archives.ts b/src/releases/github-archives.ts index 385f4b7ae..81eaa3ab1 100644 --- a/src/releases/github-archives.ts +++ b/src/releases/github-archives.ts @@ -7,7 +7,7 @@ import { extractArchive } from '../archives/extract' import type { ArchiveFormat } from '../archives/types' import { safeDelete, safeMkdir } from '../fs/safe' -import { getDefaultLogger } from '../logger/logger' +import { getDefaultLogger } from '../logger/default' import { ErrorCtor } from '../primordials/error' import { downloadReleaseAsset } from './github-downloads' diff --git a/src/releases/github-downloads.ts b/src/releases/github-downloads.ts index bdb88d19a..55a935405 100644 --- a/src/releases/github-downloads.ts +++ b/src/releases/github-downloads.ts @@ -6,13 +6,13 @@ import process from 'node:process' import { safeMkdir } from '../fs/safe' import { httpDownload } from '../http-request/download' -import { getDefaultLogger } from '../logger/logger' +import { getDefaultLogger } from '../logger/default' import { ErrorCtor } from '../primordials/error' import { StringPrototypeEndsWith, StringPrototypeStartsWith, } from '../primordials/string' -import { spawn } from '../spawn/spawn' +import { spawn } from '../process/spawn/child' import { getReleaseAssetUrl } from './github-asset-url' import { getLatestRelease } from './github-listing' diff --git a/src/spinner/registry.ts b/src/spinner/default.ts similarity index 99% rename from src/spinner/registry.ts rename to src/spinner/default.ts index 079e54770..48eb3074a 100644 --- a/src/spinner/registry.ts +++ b/src/spinner/default.ts @@ -72,7 +72,7 @@ export function getCliSpinners( * * @example * ;```ts - * import { getDefaultSpinner } from '@socketsecurity/lib/spinner/registry' + * import { getDefaultSpinner } from '@socketsecurity/lib/spinner/default' * * const spinner = getDefaultSpinner() * spinner.start('Loading…') diff --git a/src/spinner/spinner.ts b/src/spinner/spinner.ts index 13faeba42..310ea6795 100644 --- a/src/spinner/spinner.ts +++ b/src/spinner/spinner.ts @@ -23,7 +23,7 @@ import { configToSpec, frameColors } from '../effects/shimmer' import { colorsToAnsi } from '../effects/shimmer-terminal' import { getCI } from '../env/ci' import yoctoSpinner from '../external/@socketregistry/yocto-spinner' -import { getDefaultLogger } from '../logger/logger' +import { getDefaultLogger } from '../logger/default' import { LOG_SYMBOLS, incLogCallCountSymbol, @@ -43,7 +43,7 @@ import { getTheme } from '../themes/context' import { THEMES } from '../themes/themes' import { resolveColor } from '../themes/resolve' -import { getCliSpinners } from './registry' +import { getCliSpinners } from './default' import { COLOR_INHERIT, ciSpinner, diff --git a/src/spinner/with.ts b/src/spinner/with.ts index 48bb5f42e..f4b7e6226 100644 --- a/src/spinner/with.ts +++ b/src/spinner/with.ts @@ -132,7 +132,7 @@ export async function withSpinner( * * @example * ;```ts - * import { getDefaultSpinner } from '@socketsecurity/lib/spinner/registry' + * import { getDefaultSpinner } from '@socketsecurity/lib/spinner/default' * import { withSpinnerRestore } from '@socketsecurity/lib/spinner/with' * * const spinner = getDefaultSpinner() diff --git a/src/stdio/divider.ts b/src/stdio/divider.ts index 92de9afb7..8f52b012f 100644 --- a/src/stdio/divider.ts +++ b/src/stdio/divider.ts @@ -3,7 +3,7 @@ * for visual separation in CLI output. */ -import { getDefaultLogger } from '../logger/logger' +import { getDefaultLogger } from '../logger/default' import { repeatString } from '../strings/format' const logger = getDefaultLogger() diff --git a/src/stdio/footer.ts b/src/stdio/footer.ts index 486b085a1..4a58f9afd 100644 --- a/src/stdio/footer.ts +++ b/src/stdio/footer.ts @@ -8,7 +8,7 @@ import { repeatString } from '../strings/format' import { ArrayPrototypePush } from '../primordials/array' -import { getDefaultLogger } from '../logger/logger' +import { getDefaultLogger } from '../logger/default' import { LOG_SYMBOLS } from '../logger/symbols' import { DateCtor, DateNow } from '../primordials/date' diff --git a/src/stdio/header.ts b/src/stdio/header.ts index c827377b7..0b5112b1b 100644 --- a/src/stdio/header.ts +++ b/src/stdio/header.ts @@ -6,7 +6,7 @@ import colors from '../external/yoctocolors-cjs' import { centerText, repeatString } from '../strings/format' -import { getDefaultLogger } from '../logger/logger' +import { getDefaultLogger } from '../logger/default' import { ArrayPrototypePush } from '../primordials/array' const logger = getDefaultLogger() diff --git a/src/stdio/prompts.ts b/src/stdio/prompts.ts index d1c5010c3..7d82ed05d 100644 --- a/src/stdio/prompts.ts +++ b/src/stdio/prompts.ts @@ -20,7 +20,7 @@ import * as selectModuleImport from '../external/@inquirer/select' import yoctocolorsCjs from '../external/yoctocolors-cjs' import type { ColorValue } from '../colors/types' -import { getDefaultSpinner } from '../spinner/registry' +import { getDefaultSpinner } from '../spinner/default' import { getTheme } from '../themes/context' import { THEMES, type ThemeName } from '../themes/themes' import type { Theme } from '../themes/types' diff --git a/test/integration/esm-imports.test.mjs b/test/integration/esm-imports.test.mjs index 1d30380f1..3ba4b3804 100644 --- a/test/integration/esm-imports.test.mjs +++ b/test/integration/esm-imports.test.mjs @@ -14,12 +14,12 @@ import { describe, expect, it } from 'vitest' describe('ESM imports from CommonJS', () => { describe('globs module', () => { it('should import glob function', async () => { - const { glob } = await import('@socketsecurity/lib/globs/glob') + const { glob } = await import('@socketsecurity/lib/globs/match') expect(typeof glob).toBe('function') }) it('should import globSync function', async () => { - const { globSync } = await import('@socketsecurity/lib/globs/glob') + const { globSync } = await import('@socketsecurity/lib/globs/match') expect(typeof globSync).toBe('function') }) @@ -37,7 +37,7 @@ describe('ESM imports from CommonJS', () => { it('should import all leaves together', async () => { const [globMod, defaultsMod, matcherMod] = await Promise.all([ - import('@socketsecurity/lib/globs/glob'), + import('@socketsecurity/lib/globs/match'), import('@socketsecurity/lib/globs/defaults'), import('@socketsecurity/lib/globs/matcher'), ]) diff --git a/test/integration/git.test.mts b/test/integration/git.test.mts index 41419d592..19fa57d2c 100644 --- a/test/integration/git.test.mts +++ b/test/integration/git.test.mts @@ -14,7 +14,7 @@ import path from 'node:path' import process from 'node:process' import { findGitRoot } from '@socketsecurity/lib/git/repo' -import { spawn } from '@socketsecurity/lib/spawn/spawn' +import { spawn } from '@socketsecurity/lib/process/spawn/child' import { describe, expect, it } from 'vitest' import { runWithTempDir } from '../unit/util/temp-file-helper' diff --git a/test/integration/spawn.test.mts b/test/integration/spawn.test.mts index b2d39bd94..36bde289d 100644 --- a/test/integration/spawn.test.mts +++ b/test/integration/spawn.test.mts @@ -11,7 +11,7 @@ */ import process from 'node:process' -import { spawn, spawnSync } from '@socketsecurity/lib/spawn/spawn' +import { spawn, spawnSync } from '@socketsecurity/lib/process/spawn/child' import { describe, expect, it } from 'vitest' describe('spawn integration', () => { diff --git a/test/isolated/http-request-core.test.mts b/test/isolated/http-request-core.test.mts index ba60811e3..8cb68b384 100644 --- a/test/isolated/http-request-core.test.mts +++ b/test/isolated/http-request-core.test.mts @@ -24,7 +24,7 @@ import { httpJson, httpText } from '../../src/http-request/convenience' import { getSocketCallerUserAgent } from '../../src/http-request/user-agent' import { httpDownload } from '../../src/http-request/download' import { httpRequest } from '../../src/http-request/request' -import { Logger } from '../../src/logger/logger' +import { Logger } from '../../src/logger/default' import { fixture, setupHttpFixture } from './http-request-fixtures' import { runWithTempDir } from '../unit/util/temp-file-helper' diff --git a/test/isolated/logger.test.mts b/test/isolated/logger.test.mts index 2a316dbf5..a4b5b5d61 100644 --- a/test/isolated/logger.test.mts +++ b/test/isolated/logger.test.mts @@ -15,7 +15,7 @@ import { Writable } from 'node:stream' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { Logger } from '../../src/logger/logger' +import { Logger } from '../../src/logger/default' import { LOG_SYMBOLS, incLogCallCountSymbol, diff --git a/test/unit/bin.test.mts b/test/unit/bin.test.mts index e88eda9d5..dee27e9d5 100644 --- a/test/unit/bin.test.mts +++ b/test/unit/bin.test.mts @@ -29,7 +29,7 @@ import { whichReal, whichRealSync } from '../../src/bin/which' import { isError } from '@socketsecurity/lib/errors/predicates' import { describe, expect, it } from 'vitest' import { runWithTempDir } from './util/temp-file-helper' -import { getDefaultLogger } from '@socketsecurity/lib/logger/logger' +import { getDefaultLogger } from '@socketsecurity/lib/logger/default' import { safeDelete } from '@socketsecurity/lib/fs/safe' const logger = getDefaultLogger() diff --git a/test/unit/cover/code.test.mts b/test/unit/cover/code.test.mts index 10b68a0e3..7bbe118a3 100644 --- a/test/unit/cover/code.test.mts +++ b/test/unit/cover/code.test.mts @@ -12,9 +12,9 @@ import path from 'node:path' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -vi.mock('@socketsecurity/lib/spawn/spawn') +vi.mock('@socketsecurity/lib/process/spawn/child') -import { spawn } from '@socketsecurity/lib/spawn/spawn' +import { spawn } from '@socketsecurity/lib/process/spawn/child' import { getCodeCoverage } from '@socketsecurity/lib/cover/code' let tmpDir: string diff --git a/test/unit/cover/type.test.mts b/test/unit/cover/type.test.mts index c22d4671e..a1fa7d0ee 100644 --- a/test/unit/cover/type.test.mts +++ b/test/unit/cover/type.test.mts @@ -14,9 +14,9 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' // Mock spawn at the package specifier — src resolution is enabled in // vitest.config.mts via the 'source' export condition. -vi.mock('@socketsecurity/lib/spawn/spawn') +vi.mock('@socketsecurity/lib/process/spawn/child') -import { spawn } from '@socketsecurity/lib/spawn/spawn' +import { spawn } from '@socketsecurity/lib/process/spawn/child' import { getTypeCoverage } from '@socketsecurity/lib/cover/type' describe('cover/type', () => { diff --git a/test/unit/debug.test.mts b/test/unit/debug.test.mts index cafe65333..d35d928b9 100644 --- a/test/unit/debug.test.mts +++ b/test/unit/debug.test.mts @@ -22,7 +22,7 @@ import { debugtime, } from '../../src/debug/output' import { clearEnv, resetEnv, setEnv } from '../../src/env/rewire' -import { getDefaultLogger } from '../../src/logger/logger' +import { getDefaultLogger } from '../../src/logger/default' const logger = getDefaultLogger() diff --git a/test/unit/git.test.mts b/test/unit/git.test.mts index 0ac9e229a..046d929ed 100644 --- a/test/unit/git.test.mts +++ b/test/unit/git.test.mts @@ -351,9 +351,10 @@ describe('git', () => { }) it('should handle files in subdirectories', async () => { - // src/logger.ts was reshaped into src/logger/logger.ts as part - // of the v6.0.0 sub-leaf split. - const result = await isChanged('src/logger/logger.ts', { + // src/logger.ts was reshaped into src/logger/default.ts (v6.1 + // renamed the leaf from `logger` to `default` so it lines up + // with `getDefaultLogger`). + const result = await isChanged('src/logger/default.ts', { cwd: projectRoot, }) expect(typeof result).toBe('boolean') diff --git a/test/unit/git/extended.test.mts b/test/unit/git/extended.test.mts index d92cc4fe5..eeac418b3 100644 --- a/test/unit/git/extended.test.mts +++ b/test/unit/git/extended.test.mts @@ -33,7 +33,7 @@ import { isUnstagedSync, } from '@socketsecurity/lib/git/unstaged' import { normalizePath } from '@socketsecurity/lib/paths/normalize' -import { spawnSync } from '@socketsecurity/lib/spawn/spawn' +import { spawnSync } from '@socketsecurity/lib/process/spawn/child' import { describe, expect, it, vi } from 'vitest' import { runWithTempDir } from '../util/temp-file-helper' import { safeDelete } from '@socketsecurity/lib/fs/safe' diff --git a/test/unit/globs.test.mts b/test/unit/globs.test.mts index 894dd3582..4707b99ae 100644 --- a/test/unit/globs.test.mts +++ b/test/unit/globs.test.mts @@ -20,7 +20,7 @@ import os from 'node:os' import path from 'node:path' import process from 'node:process' import { defaultIgnore } from '@socketsecurity/lib/globs/defaults' -import { glob, globSync } from '@socketsecurity/lib/globs/glob' +import { glob, globSync } from '@socketsecurity/lib/globs/match' import { getGlobMatcher } from '@socketsecurity/lib/globs/matcher' import { globStreamLicenses } from '@socketsecurity/lib/globs/stream' import { afterEach, beforeEach, describe, expect, it } from 'vitest' diff --git a/test/unit/links.test.mts b/test/unit/links.test.mts index fd8d35f81..1fba90e1b 100644 --- a/test/unit/links.test.mts +++ b/test/unit/links.test.mts @@ -4,7 +4,7 @@ import { describe, expect, it } from 'vitest' -import { link, links } from '@socketsecurity/lib/links/link' +import { link, links } from '@socketsecurity/lib/links/create' describe('links', () => { describe('link()', () => { diff --git a/test/unit/logger.test.mts b/test/unit/logger.test.mts index 500bca5b2..a6195a9d2 100644 --- a/test/unit/logger.test.mts +++ b/test/unit/logger.test.mts @@ -8,7 +8,7 @@ import { Writable } from 'node:stream' -import { Logger } from '../../src/logger/logger' +import { Logger } from '../../src/logger/default' import { LOG_SYMBOLS } from '../../src/logger/symbols' import { describe, expect, it, beforeEach } from 'vitest' diff --git a/test/unit/logger/advanced.test.mts b/test/unit/logger/advanced.test.mts index b5f666525..2c47936b6 100644 --- a/test/unit/logger/advanced.test.mts +++ b/test/unit/logger/advanced.test.mts @@ -16,7 +16,7 @@ import { Writable } from 'node:stream' -import { Logger } from '../../../src/logger/logger' +import { Logger } from '../../../src/logger/default' import { describe, expect, it, beforeEach } from 'vitest' // Disable concurrent execution for this suite to prevent state sharing between tests diff --git a/test/unit/logger/singleton.test.mts b/test/unit/logger/singleton.test.mts index f64a1a6a2..399ce9fac 100644 --- a/test/unit/logger/singleton.test.mts +++ b/test/unit/logger/singleton.test.mts @@ -9,7 +9,7 @@ * centralized logging without explicit Logger instantiation. */ -import { getDefaultLogger } from '../../../src/logger/logger' +import { getDefaultLogger } from '../../../src/logger/default' import { describe, expect, it } from 'vitest' describe('getDefaultLogger', () => { diff --git a/test/unit/logger/themes.test.mts b/test/unit/logger/themes.test.mts index 489e70cb9..512cdd62e 100644 --- a/test/unit/logger/themes.test.mts +++ b/test/unit/logger/themes.test.mts @@ -10,7 +10,7 @@ import { Writable } from 'node:stream' -import { Logger } from '../../../src/logger/logger' +import { Logger } from '../../../src/logger/default' import { LOG_SYMBOLS } from '../../../src/logger/symbols' import { THEMES } from '@socketsecurity/lib/themes/themes' import { describe, expect, it, beforeEach } from 'vitest' diff --git a/test/unit/logger/uncovered.test.mts b/test/unit/logger/uncovered.test.mts index a16ec2310..457a3db0c 100644 --- a/test/unit/logger/uncovered.test.mts +++ b/test/unit/logger/uncovered.test.mts @@ -9,7 +9,7 @@ import { Writable } from 'node:stream' import { describe, expect, it } from 'vitest' -import { Logger } from '../../../src/logger/logger' +import { Logger } from '../../../src/logger/default' class CaptureStream extends Writable { chunks: string[] = [] diff --git a/test/unit/promise-queue.test.mts b/test/unit/promise-queue.test.mts index dfa4bb4f6..e1e5efb09 100644 --- a/test/unit/promise-queue.test.mts +++ b/test/unit/promise-queue.test.mts @@ -11,7 +11,7 @@ * rate-limited parallel operations (API calls, file I/O). */ -import { PromiseQueue } from '@socketsecurity/lib/promise-queue/queue' +import { PromiseQueue } from '@socketsecurity/lib/promises/queue' import { describe, expect, it } from 'vitest' // Helper to create a delayed promise diff --git a/test/unit/signal-exit.test.mts b/test/unit/signal-exit.test.mts index bca79be1e..d05ddc4fb 100644 --- a/test/unit/signal-exit.test.mts +++ b/test/unit/signal-exit.test.mts @@ -11,9 +11,9 @@ */ import process from 'node:process' -import { load, unload } from '@socketsecurity/lib/signal-exit/lifecycle' -import { onExit } from '@socketsecurity/lib/signal-exit/register' -import { signals } from '@socketsecurity/lib/signal-exit/signals' +import { load, unload } from '@socketsecurity/lib/events/exit/lifecycle' +import { onExit } from '@socketsecurity/lib/events/exit/handler' +import { signals } from '@socketsecurity/lib/events/exit/signals' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' describe('signal-exit', () => { diff --git a/test/unit/spawn.test.mts b/test/unit/spawn.test.mts index 7beaed58b..5e3ebccc8 100644 --- a/test/unit/spawn.test.mts +++ b/test/unit/spawn.test.mts @@ -14,9 +14,9 @@ import process from 'node:process' import { describe, expect, it } from 'vitest' -import { spawn, spawnSync } from '@socketsecurity/lib/spawn/spawn' -import { isSpawnError } from '@socketsecurity/lib/spawn/errors' -import { isStdioType } from '@socketsecurity/lib/spawn/stdio' +import { spawn, spawnSync } from '@socketsecurity/lib/process/spawn/child' +import { isSpawnError } from '@socketsecurity/lib/process/spawn/errors' +import { isStdioType } from '@socketsecurity/lib/process/spawn/stdio' import { itUnixOnly, itWindowsOnly } from './util/skip-helpers' diff --git a/test/unit/spawn/error.test.mts b/test/unit/spawn/error.test.mts index 54e26fc35..4e1d9c4ba 100644 --- a/test/unit/spawn/error.test.mts +++ b/test/unit/spawn/error.test.mts @@ -5,8 +5,11 @@ import { describe, expect, it } from 'vitest' -import { spawn } from '../../../src/spawn/spawn' -import { enhanceSpawnError, isSpawnError } from '../../../src/spawn/errors' +import { spawn } from '../../../src/process/spawn/child' +import { + enhanceSpawnError, + isSpawnError, +} from '../../../src/process/spawn/errors' describe('spawn — enhanceSpawnError', () => { it('returns undefined inputs unchanged', () => { diff --git a/test/unit/spinner.test.mts b/test/unit/spinner.test.mts index 800b3b694..c790309d1 100644 --- a/test/unit/spinner.test.mts +++ b/test/unit/spinner.test.mts @@ -15,7 +15,7 @@ import process from 'node:process' import { beforeEach, describe, expect, it, vi } from 'vitest' import { Spinner } from '@socketsecurity/lib/spinner/spinner' -import { getCliSpinners } from '@socketsecurity/lib/spinner/registry' +import { getCliSpinners } from '@socketsecurity/lib/spinner/default' import { withSpinner, withSpinnerSync } from '@socketsecurity/lib/spinner/with' describe('spinner', () => { diff --git a/test/unit/ttl-cache/errors.test.mts b/test/unit/ttl-cache/errors.test.mts index 2d534dc6c..8034a08a8 100644 --- a/test/unit/ttl-cache/errors.test.mts +++ b/test/unit/ttl-cache/errors.test.mts @@ -10,7 +10,7 @@ import path from 'node:path' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { createTtlCache } from '../../../src/ttl-cache/cache' +import { createTtlCache } from '../../../src/cache/ttl/store' import { resetEnv, setEnv } from '../../../src/env/rewire' import { safeDelete } from '../../../src/fs/safe' import { invalidateCaches } from '../../../src/paths/rewire' diff --git a/test/unit/ttl-cache/getall.test.mts b/test/unit/ttl-cache/getall.test.mts index 2e14af1b7..824e9e28f 100644 --- a/test/unit/ttl-cache/getall.test.mts +++ b/test/unit/ttl-cache/getall.test.mts @@ -11,7 +11,7 @@ import path from 'node:path' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { createTtlCache } from '../../../src/ttl-cache/cache' +import { createTtlCache } from '../../../src/cache/ttl/store' import { resetEnv, setEnv } from '../../../src/env/rewire' import { safeDelete } from '../../../src/fs/safe' import { invalidateCaches } from '../../../src/paths/rewire' diff --git a/test/unit/ttl-cache/index.test.mts b/test/unit/ttl-cache/index.test.mts index a3022993f..474c9915c 100644 --- a/test/unit/ttl-cache/index.test.mts +++ b/test/unit/ttl-cache/index.test.mts @@ -15,7 +15,7 @@ import os from 'node:os' import * as path from 'node:path' -import { createTtlCache } from '@socketsecurity/lib/ttl-cache/cache' +import { createTtlCache } from '@socketsecurity/lib/cache/ttl/store' import { resetEnv, setEnv } from '@socketsecurity/lib/env/rewire' import { invalidateCaches } from '@socketsecurity/lib/paths/rewire' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' diff --git a/test/unit/ttl-cache/lru.test.mts b/test/unit/ttl-cache/lru.test.mts index 3e2b3ec3d..9dc58be82 100644 --- a/test/unit/ttl-cache/lru.test.mts +++ b/test/unit/ttl-cache/lru.test.mts @@ -9,7 +9,7 @@ import os from 'node:os' import path from 'node:path' -import { createTtlCache } from '@socketsecurity/lib/ttl-cache/cache' +import { createTtlCache } from '@socketsecurity/lib/cache/ttl/store' import { resetEnv, setEnv } from '@socketsecurity/lib/env/rewire' import { safeDelete } from '@socketsecurity/lib/fs/safe' import { invalidateCaches } from '@socketsecurity/lib/paths/rewire' diff --git a/test/unit/warnings/suppress.test.mts b/test/unit/warnings/suppress.test.mts index 0ccfa10a8..20b450dc4 100644 --- a/test/unit/warnings/suppress.test.mts +++ b/test/unit/warnings/suppress.test.mts @@ -16,8 +16,8 @@ import { suppressMaxListenersWarning, suppressWarningType, withSuppressedWarnings, -} from '@socketsecurity/lib/warnings/suppress' -import { setMaxEventTargetListeners } from '@socketsecurity/lib/warnings/event-target' +} from '@socketsecurity/lib/events/warning/suppress' +import { setMaxEventTargetListeners } from '@socketsecurity/lib/events/warning/handler' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' describe('warnings/suppress', () => {