Skip to content

docs: document the entire public surface; internalize Zod (#29)#31

Merged
ben-laird merged 2 commits into
mainfrom
docs/issue-29-public-surface-jsdoc
Jun 6, 2026
Merged

docs: document the entire public surface; internalize Zod (#29)#31
ben-laird merged 2 commits into
mainfrom
docs/issue-29-public-surface-jsdoc

Conversation

@ben-laird

Copy link
Copy Markdown
Owner

Closes #29.

Clears all 238 deno doc --lint errors (227 missing-JSDoc + 11 private-type-ref) across the public surface of @dv-cli/dv and @dv-cli/clipc, then flips the CI doc-lint step to a hard gate.

What changed

JSDoc sweep (the 227 missing-jsdoc)

Every exported symbol on the @dv-cli/dv library entry now carries JSDoc — the runners, their option/result interfaces (and each field), FinalizedFile/CascadedUpdate, the plugin commands, and the Plan contract. Existing // notes were converted to /** */ (wording preserved), with accurate one-liners added where there were none.

Public-surface type plumbing (the 11 private-type-ref)

  • Re-export domain types reachable through the public option/result shapes (ChangeType, Package, PluginReference, PluginAssignment, ResolvedPlugin, SlugRandomSource, ConfigMigrationStepResult, MigrationChange, PLUGIN_OP_NAMES) so consumers can import them by name instead of through indexed-access types. Each got JSDoc at its source.
  • Plan is now hand-written interfaces instead of z.infer aliases. The Zod schemas are annotated z.ZodType<…> against those interfaces, so the schema and the public type can't drift — while Zod's internal output/schema types stay off the public surface. schemas:check confirms the generated plan.json is byte-identical.

Internalize Zod in clipc ⚠️ breaking

Per maintainer steer (leaking Zod from clipc's public surface was the wrong design):

  • rawCliErrorPayloadSchema / rawCliErrorEnvelopeSchema are no longer exported from the package surface.
  • Consumers validate error envelopes via the new Zod-free parseCliErrorEnvelope / safeParseCliErrorEnvelope (returns a plain { success, data | issues }). The RawCliError* contract interfaces are unchanged.
  • The raw schema stays available to the in-repo JSON Schema generator through a new ./internal/error-schema subpath export (invisible to the documented . surface / doc-lint).

CI

deno doc --lint flips from continue-on-error: true to a hard gate.

Acceptance

  • deno task doc:lint reports 0 errors
  • CI doc-lint step is a hard gate

Verification

fmt:check, lint, check, test (376 passing), schemas:check (in sync), and publish:check (slow-types clean, incl. the new clipc subpath) all green. Dogfooded with dv add — two Records filed; dv status previews @dv-cli/clipc 0.3.1 → 0.4.0 (minor, breaking capped at minor pre-1.0) and @dv-cli/dv 0.8.1 → 0.9.0.

🤖 Generated with Claude Code

ben-laird and others added 2 commits June 6, 2026 10:21
Clears the 238 `deno doc --lint` errors across the public surface of
`@dv-cli/dv` and `@dv-cli/clipc`, then flips the CI doc-lint step from
`continue-on-error` to a hard gate.

JSDoc sweep
- Documents every exported symbol on the `@dv-cli/dv` library entry —
  runners, their option/result interfaces (and each field), and the
  Plan contract — converting the existing `//` notes to `/** */`.

Public-surface type plumbing
- Re-exports the domain types reachable through the public option/result
  shapes (ChangeType, Package, PluginReference, PluginAssignment,
  ResolvedPlugin, SlugRandomSource, ConfigMigrationStepResult,
  MigrationChange, PLUGIN_OP_NAMES) so they're nameable rather than
  reached through indexed-access types.
- Rewrites the Plan contract as hand-written interfaces instead of
  `z.infer` aliases. The Zod schemas are annotated `z.ZodType<…>`
  against those interfaces, so the two cannot drift while Zod's
  internal types stay off the public surface.

Internalize Zod in clipc (breaking)
- `rawCliError{Payload,Envelope}Schema` are no longer exported from the
  package surface — Zod is now an implementation detail of clipc.
  Consumers validate via the new Zod-free `parseCliErrorEnvelope` /
  `safeParseCliErrorEnvelope`. The raw schema stays available to the
  in-repo JSON Schema generator through a `./internal/error-schema`
  subpath export.

CI
- `deno doc --lint` is now a hard gate (was non-blocking pending #29).

Records filed for both packages (dogfooded via `dv add`); `dv status`
previews clipc 0.3.1 → 0.4.0 and dv 0.8.1 → 0.9.0.

Closes #29.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The roadmap-ledger proposal added in #26 links to the internal specs
(language, design, ROADMAP) that are deliberately off the public site,
so VitePress flagged 8 dead links and failed the docs build on main.
Proposals are implementer-facing design docs — exclude the directory
like the rest of the internal spec library.

Surfaced by this branch's CI run; the breakage predates it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ben-laird ben-laird merged commit 5081626 into main Jun 6, 2026
1 check passed
@ben-laird ben-laird deleted the docs/issue-29-public-surface-jsdoc branch June 6, 2026 17:52
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.

Document the entire public surface (raise JSR score, clear doc-lint backlog)

1 participant