Skip to content

fix(readme): restore README doctest coverage broken by PR2 (main red)#119

Merged
rickylabs merged 1 commit into
mainfrom
fix/readme-doctest-red
Jun 24, 2026
Merged

fix(readme): restore README doctest coverage broken by PR2 (main red)#119
rickylabs merged 1 commit into
mainfrom
fix/readme-doctest-red

Conversation

@rickylabs

Copy link
Copy Markdown
Owner

Fix: main is red — README doctests broken by PR2 (#117)

PR2's README revamp (f68fa916) turned main red on ci / check-test
(3 failed | 874 passed). The doctests that guard the package READMEs
were broken, not the package APIs:

Failing test Cause
packages/sdk/tests/readme-doctest_test.ts (TS fences) Usage fence relabeled ```ts```typescript; the doctest only extracts ts, so it found zero checkable fences.
packages/sdk/tests/readme-doctest_test.ts (JSON fences) The README's only ```json fence was dropped; the doctest requires ≥1 parseable JSON fence.
packages/service/tests/_fixtures/readme-examples_test.ts The createService().withAuthn().serve() / defineService(..., { auth }) example was removed, so the pinned lifecycle substrings were absent.

Fix (README-only — no source or test changes)

  • @netscript/sdk — relabel the Usage fence back to ```ts (it type-checks clean against the doctest prelude) and add a ```json import-map fence.
  • @netscript/service — restore the proven fluent-builder + auth examples (createService(...).withAuthn({ authenticator }).serve() and the defineService(..., { auth: {...} }) preset opt-in), carrying the lifecycle substrings the fixture asserts.

Validation

deno test --allow-all \
  packages/sdk/tests/readme-doctest_test.ts \
  packages/service/tests/_fixtures/readme-examples_test.ts
# ok | 4 passed | 0 failed

deno fmt --check packages/sdk/README.md packages/service/README.md
# Checked 2 files

Scope is deliberately minimal so main goes green ahead of the JSR
publish; the PR3 root-README work is unaffected.

🤖 Generated with Claude Code

PR2's README revamp turned main's README doctests red (3 failed | 874
passed on ci/check-test) by:
  - changing the @netscript/sdk Usage fence from `ts` to `typescript`
    and dropping the `json` fence (the doctest matches `ts`/`json`);
  - removing the @netscript/service createService/auth code example.

Failing tests:
  - packages/sdk/tests/readme-doctest_test.ts (ts + json fences)
  - packages/service/tests/_fixtures/readme-examples_test.ts (lifecycle APIs)

README-only fix (no source/test changes):
  - sdk: relabel the Usage fence `typescript` -> `ts` so the doctest
    type-checks it against its prelude; add a `json` import-map fence.
  - service: restore the proven createService().withAuthn().serve() and
    defineService(..., { auth: {...} }) examples carrying the pinned
    lifecycle substrings.

All 4 doctests pass locally; deno fmt --check clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014gW4zfhMMQU6txC828ijct
@rickylabs
rickylabs merged commit 66b95b6 into main Jun 24, 2026
6 checks passed
@rickylabs
rickylabs deleted the fix/readme-doctest-red branch June 24, 2026 21:48
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