Skip to content

chore(deps): drop yaml and @inquirer/confirm for Bun built-ins#65

Merged
arzafran merged 1 commit into
mainfrom
chore/minimize-runtime-deps
Jun 19, 2026
Merged

chore(deps): drop yaml and @inquirer/confirm for Bun built-ins#65
arzafran merged 1 commit into
mainfrom
chore/minimize-runtime-deps

Conversation

@arzafran

Copy link
Copy Markdown
Member

What this does

Cuts cc-settings' runtime dependencies from 3 to 1 — only zod remains. cc-settings has no bundler, so the win isn't bundle size: it's the install footprint (every ~/.claude install drops ~12 packages and ~1.5 MB, and these sit where every hook runs) and the staleness surface (two fewer libraries to keep current). Both replacements are Bun/Node platform built-ins, so the code modernizes without losing capability.

Summary

  • yamlBun.YAML (frontmatter.ts, the sole importer). Bun.YAML ships in Bun since 1.2.21. One behaviour change: it exposes no reliable block-relative line/col on parse errors (the thrown line/column map to the JS call site; originalLine/Column aren't block-relative either), so parseFrontmatterStrict — used by lint:skills/lint:knowledge — now reports the error message without a position. Frontmatter blocks are a handful of lines, so the message alone stays actionable; the lint formatter degrades cleanly.
  • @inquirer/confirmnode:readline/promises (prompts.ts, the sole importer). This was a ~10-package transitive tree for one yes/no prompt. The promptYn API, the non-TTY default fallback, and the EOF→default behaviour are unchanged — only the rendering is plainer.
  • engines.bun >=1.1.30>=1.2.21 (the release that introduced Bun.YAML). The functional bootstrap gate setup.sh:BUN_MIN is bumped, plus the README / MANUAL / CLAUDE.md / mcp-configs docs.

Test Plan

  • bun run typecheck clean
  • bun test — 614 pass (1 pre-existing env-dependent teamKnowledgeAwareness failure, unrelated to this change)
  • bun run lint exit 0 · bun run lint:skills 0/0 · bun run schemas:check in sync
  • node_modules top-level 27 → 15 packages
  • Smoke: promptYn returns default under non-TTY; parseFrontmatter/parseFrontmatterStrict parse valid blocks and surface a message on malformed ones

Runtime dependencies 3 → 1 (only zod remains). Removes ~12 installed
packages (including the @InQuirer tree) and ~1.5 MB from every ~/.claude
install, shrinking the surface to keep fresh.

- yaml → Bun.YAML (frontmatter.ts). The strict path reports the error
  message only; Bun.YAML exposes no reliable block-relative line/col, so
  parseFrontmatterStrict (lint:skills / lint:knowledge) drops the position.
  Frontmatter blocks are a few lines, so the message alone is actionable.
- @inquirer/confirm → node:readline/promises (prompts.ts). Same promptYn
  API and non-TTY fallback, no transitive tree.
- engines.bun >=1.1.30 → >=1.2.21 (the release that added Bun.YAML);
  setup.sh BUN_MIN and the README/MANUAL/CLAUDE/mcp-configs docs match.
@arzafran arzafran merged commit bc30fc7 into main Jun 19, 2026
15 checks passed
arzafran added a commit that referenced this pull request Jun 22, 2026
… swap (#68)

An independent Codex cross-model review of the yaml→Bun.YAML and
@inquirer/confirm→node:readline migration (#65) surfaced two real Medium
regressions, both reproduced and confirmed:

- Bun.YAML silently keeps the last value on duplicate mapping keys, where the
  `yaml` package threw "Map keys must be unique". parseFrontmatterStrict now
  detects duplicate top-level keys itself, so lint:skills / lint:knowledge keep
  catching them. The scan is column-0 only — nested mappings, list items, and
  block-scalar continuations are always indented, so they never false-trip
  (covered by a test).
- promptYn (readline) hung on Ctrl+C: readline's close() does not unblock a
  pending question() — only an AbortSignal rejects it. Wired a
  SIGINT→AbortController so Ctrl+C falls back to the default, restoring the
  behavior @inquirer/confirm gave for free.

Full suite 618 pass / 0 fail; lint:skills/lint:knowledge clean on the real corpus.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant