- **src/utils/** - Logger, ANSI color helpers (`colors.ts` — `green` / `yellow` / `red` / `cyan` / `gray` / `bold` / `dim` inline wrappers; kept in a separate module from `logger.ts` so test files that `vi.mock('../../../src/utils/logger.js', ...)` don't accidentally strip color helpers and crash any code path that imports them), per-resource status-line formatter (`resource-line.ts` — `formatResourceLine(op, logicalId, resourceType, verbOverride?)` builds the shared `<glyph> <id> (<type>) <verb>` line printed by `cdkd deploy` / `cdkd destroy` for created / updated / deleted; every successful op renders a check ✓ — never a cross ✗ — and is distinguished by COLOR not glyph (green created / yellow updated / green-check-plus-red-verb deleted), so no success line is ever mistaken for the red ✗ "Failed to delete" failure path; `verbOverride` swaps the verb word, e.g. `'updated (metadata)'`), live progress renderer (multi-line in-flight task display), error handler (incl. `normalizeAwsError` for AWS SDK v3 synthetic UnknownError → actionable HTTP-status-keyed messages), AWS client factory, AWS region resolver (`aws-region-resolver.ts` — caches bucket-region lookups via `GetBucketLocation` so the state-bucket S3 client can be rebuilt for the bucket's actual region), state-bucket client rebuilder (`bucket-region-client.ts` — `rebuildClientForBucketRegion(client, bucket, opts)`, the single shared helper extracted in issue #827 from the three near-identical `ensureClientForBucket()` copies in `S3StateBackend` / `LockManager` / `ExportIndexStore`; does the cached-region probe + same-region short-circuit (returns `null` = keep the original client) + credential-reusing rebuild that does NOT destroy a shared client by default, with per-store knobs `destroyOldClient` / `reuseClientCredentials` / `profile` / `credentials` / `tolerateNonStandardClient`; kept in its OWN module — not folded into `aws-region-resolver.ts` — so the per-store tests' `vi.mock('aws-region-resolver.js')` of `resolveBucketRegion` is still intercepted cross-module, and each store retains its own `clientResolved` / `resolveInFlight` memoization), stack output buffer (`stack-context.ts` — `AsyncLocalStorage`-backed per-stack log buffer used by `cdkd deploy` when more than one stack is running concurrently; the logger pushes into the active buffer instead of writing to stdout, and the deploy CLI flushes each buffer atomically when its stack finishes so per-stack output blocks don't interleave), single-flight cleanup memoizer (`single-flight.ts` — wraps an async cleanup function so concurrent / repeated callers await the SAME underlying invocation; used by `cdkd local invoke` / `local start-api` to close the SIGINT-during-outer-finally race against shared mutable state like `containerId` / `servers[]` / tmpdir sets), docker subprocess helper (`docker-cmd.ts` — `getDockerCmd()` resolves the CLI binary via `CDK_DOCKER` env var for podman / finch / nerdctl parity; `runDockerStreaming` / `spawnStreaming` route every docker subprocess call through streaming spawn so BuildKit's progress output doesn't hit Node's `execFile` `maxBuffer` ceiling, mirror chunks to stdout/stderr when the logger is at debug level (`--verbose`), and reject with a `SpawnError` carrying the captured streams)
0 commit comments