Skip to content

docs(typedoc): add API reference + PR-time JSDoc gate (Sprint C)#18

Merged
IgorShevchik merged 3 commits into
mainfrom
docs/typedoc-and-badges
May 26, 2026
Merged

docs(typedoc): add API reference + PR-time JSDoc gate (Sprint C)#18
IgorShevchik merged 3 commits into
mainfrom
docs/typedoc-and-badges

Conversation

@IgorShevchik

@IgorShevchik IgorShevchik commented May 26, 2026

Copy link
Copy Markdown
Collaborator

Track 2 Sprint C — TypeDoc API reference generation + PR-time JSDoc gate. No public hosting — TypeScript users get the docs through IDE hover (the JSDoc ships in dist/esm/index.d.mts via unbuild); a public Pages deploy can land later if a real user asks. After this lands, Track 3 (release flow) is the only remaining gate before tagging v0.1.

Why no Pages

Original plan was to publish to https://bitrix24.github.io/b24rabbitmq/ via actions/deploy-pages. Dropped after re-evaluation:

  • For a 3-class typed library with full JSDoc, IDE hover is the primary user surface. TypeScript users get full API reference (signature help, doc comments) in VS Code / Cursor / JetBrains for free via the .d.mts declarations shipped to npm.
  • A public Pages site requires a one-time repo-admin toggle (Settings → Pages → Source = GitHub Actions) — friction without proportional value at pre-v0.1.
  • Can land later as a focused follow-up if a real integrator asks for a public URL.

What's in

TypeDoc setup (kept)

  • typedoc devDep (no plugins, default HTML theme).
  • typedoc.json — entry point src/index.ts, output docs/api/, includeVersion, excludePrivate / excludeProtected / excludeInternal / excludeExternals, readme: "none" (clean API-only landing), treatWarningsAsErrors: true + validation.invalidLink/notExported: true so a broken {@link} or missing entry point fails CI.
  • pnpm docs:build + pnpm docs:watch scripts. Renamed from docs to avoid silent shadowing by pnpm's built-in docs command (which opens the package's homepage URL).

PR-time JSDoc gate (kept) — the highest-value piece

  • New docs job in .github/workflows/ci.yml — runs pnpm docs:build on every PR as a build-only dry-run.
  • Broken {@link}, missing entry point, or any TypeDoc warning fails the PR BEFORE merge. JSDoc rot becomes a CI signal, not silent drift.

Lint / build hygiene (kept)

  • .gitignore adds docs/api (generated output, not version-controlled).
  • eslint.config.mjs adds ignores: ['docs/api/**'] so the generated HTML/JS doesn't get linted (which would otherwise produce 144 errors).

README polish (kept partial)

  • New npm downloads/month badge.
  • Documentation section now points TypeScript users at IDE hover plus the local pnpm docs:build HTML path.
  • Three relative directory links under "Runnable examples" → absolute GitHub URLs. Fixes display on npmjs.com (which breaks relative links).

What was removed (compared to earlier revision of this PR)

  • .github/workflows/docs.yml — the Pages deploy workflow.
  • Docs badge in README — would have pointed at a URL that didn't exist.
  • "API reference" link in README Documentation section — replaced with the IDE-hover + local-HTML note.
  • "One-time GitHub Pages setup" section in CONTRIBUTING.md — no Pages = no setup.

Acceptance (from PROJECT-BRIEF.md Sprint C, revised)

  • TypeDoc API reference under docs/api/, with every public class / type generated. Local + PR-time rather than public Pages.
  • PR-time gate so broken JSDoc fails BEFORE merge.
  • README npm downloads badge.

Files

File Change
typedoc.json new
.github/workflows/ci.yml + docs job (PR-time dry-run)
package.json + pnpm docs:build / docs:watch scripts, + typedoc devDep
pnpm-lock.yaml lockfile sync
.gitignore + docs/api
eslint.config.mjs + ignores: ['docs/api/**']
README.md + npm downloads badge, Documentation note, relative→absolute example links
PROJECT-BRIEF.md Sprint C ticked; critical path now "Track 3 is the only remaining gate"
CHANGELOG.md Unreleased / Added entry
AGENTS.md pnpm docs:build / docs:watch in commands table; pre-PR gates updated to 5
CONTRIBUTING.md pnpm docs:build in commands table

Gates

Gate Result
pnpm lint green
pnpm typecheck green
pnpm test 66/66
pnpm test:coverage 100/100/100/100
pnpm build green (17 kB ESM, unchanged)
pnpm docs:build green (0 errors, 0 warnings)

Behavioural change

None in src/. Public exports unchanged. Bundle size unchanged.

Downstream consumer check

No public API change. bitrix24/app-template-automation-rules is unaffected.

Reviews

Pre-Pages-drop revision was reviewed by 5 parallel agents (docs / senior-dev / QA / security / CTO) — two Approve clean, three Approve-with-nits, zero blockers. All in-scope nits folded; the Pages drop addresses the remaining "admin-toggle friction" concern raised by CTO.

What's next

Track 3 — release flow: adopt changesets/release-please, tag-triggered npm publish with --provenance, branch protection on main. Then tag v0.1.

claude added 3 commits May 26, 2026 14:03
Track 2 Sprint C — TypeDoc-driven API reference, auto-published on
every push to main. Track 3 (release flow) is now the only remaining
gate before tagging v0.1.

What's added:
- typedoc (devDep) + typedoc.json: entry point src/index.ts, output
  docs/api/, includeVersion, navigationLinks to GitHub + npm,
  excludePrivate/Internal/Externals, treatWarningsAsErrors: true so
  broken {@link} or missing entry points fail CI.
- pnpm docs / pnpm docs:watch scripts in package.json.
- .github/workflows/docs.yml: runs pnpm docs on every push to main,
  uploads the dist via actions/upload-pages-artifact, deploys via
  actions/deploy-pages (no gh-pages branch). Permissions: pages:write
  + id-token:write. Concurrency group 'pages' so overlapping pushes
  don't fight over the deployment.
- .gitignore + eslint.config.mjs ignores for docs/api/** (generated).
- README: new Docs badge (links to https://bitrix24.github.io/b24rabbitmq/)
  + npm downloads badge. Documentation section now leads with the API
  reference link.
- README cleanup: three relative directory links under "Runnable
  examples" converted to absolute GitHub URLs — fixes display on
  npmjs.com (which breaks relative links) and silences TypeDoc's
  "relative path is not a file" warnings on the copied README.

Behavioural changes: none in src/. Public exports unchanged.

Gates: lint, typecheck, test (66/66), coverage 100/100/100/100,
build, docs all green. Generated bundle still 17 kB ESM.

PROJECT-BRIEF Sprint C ticked; critical path now lists Track 3 as
the only remaining v0.1 gate. AGENTS.md gains pnpm docs / docs:watch
in the commands table.
… pnpm builtin

Five parallel review angles (docs / senior-dev / QA / security / CTO)
— two Approve clean, three Approve-with-nits, zero blockers. In-scope
nits folded.

Docs:
- typedoc.json `excludeProtected: false` -> `true`. Drops four
  subclass-plumbing methods (setupExchanges / setupQueues /
  registerExchange / registerQueue) from the public API landing page;
  Base.connect stays (public, throws by design).
- typedoc.json `readme: "README.md"` -> `"none"`. README has many
  repo-relative anchors (PROJECT-BRIEF.md, docs/ARCHITECTURE.md, etc.)
  that would 404 on the Pages site. Auto-generated module index makes
  a cleaner API-reference landing.

Senior-dev:
- .github/workflows/docs.yml: pin pnpm/action-setup@v4 to version 10
  (matches packageManager in package.json).
- Add `if-no-files-found: error` to actions/upload-pages-artifact so
  an empty docs/api/ from a config regression fails fast instead of
  deploying a blank site.
- Add `timeout-minutes: 10` to both jobs so a stuck deploy doesn't
  block the `pages` concurrency group indefinitely (relevant because
  cancel-in-progress: false).

QA:
- .github/workflows/ci.yml: new `docs` job (PR-time TypeDoc dry-run,
  build-only, no Pages deploy). Broken {@link} or missing entry
  point now fails the PR BEFORE merge instead of flipping the Docs
  badge red on `main`.
- AGENTS.md commands table + the pre-PR "gates must pass" line now
  list `pnpm docs:build` as a fifth gate.
- CONTRIBUTING.md gains a "One-time GitHub Pages setup" section
  under Maintainer notes documenting the Settings -> Pages ->
  Source = "GitHub Actions" toggle.

Script-name collision (caught while validating gates locally):
- `pnpm docs` is a pnpm BUILT-IN command that opens the package's
  homepage URL. Our `docs` script was being silently shadowed —
  `pnpm docs` printed the homepage instead of running TypeDoc, and
  produced no error. Renamed the script `docs` -> `docs:build`
  (paired with the existing `docs:watch`) so `pnpm docs:build`
  unambiguously runs the script. Updated all references:
  package.json, docs.yml, ci.yml, AGENTS.md, CONTRIBUTING.md,
  CHANGELOG.md.

Gates: lint, typecheck, test (66/66), coverage 100/100/100/100,
build, docs:build all green.
After discussion, dropped the public Pages hosting from Sprint C.
Reasoning: for a 3-class typed library with full JSDoc, IDE hover
(via the .d.mts that ships in dist/) is the primary user surface.
A public Pages site added admin-toggle friction (Settings -> Pages
-> Source = GitHub Actions, requires repo admin) and an external
URL to maintain without proportional value at pre-v0.1. Can land
later as a follow-up PR if a real user asks.

What stays:
- typedoc devDep + typedoc.json
- pnpm docs:build / pnpm docs:watch scripts
- PR-time `docs` job in .github/workflows/ci.yml — runs pnpm
  docs:build on every PR with treatWarningsAsErrors: true so
  broken {@link}, missing entry points, or other TypeDoc warnings
  fail BEFORE merge
- .gitignore + eslint.config.mjs ignores for docs/api/**
- npm downloads badge in README

What's removed:
- .github/workflows/docs.yml (the Pages deploy workflow)
- Docs badge in README (pointed at a URL that wouldn't exist)
- README "API reference" link replaced with a Documentation note
  pointing users at IDE hover + the `pnpm docs:build` local-HTML
  path
- CONTRIBUTING.md "One-time GitHub Pages setup" section (no
  Pages = no setup)

PROJECT-BRIEF Sprint C entries updated to reflect the new shape
(no public hosting, JSDoc-via-IDE-hover is the primary surface)
and to record the reasoning so future agents don't re-derive it.

CHANGELOG Unreleased / Added entry rewritten to match.

Gates: lint, typecheck, test (66/66), coverage 100/100/100/100,
build, docs:build all green. PR-time docs gate validated locally.
@IgorShevchik IgorShevchik changed the title docs(typedoc): add API reference + GitHub Pages auto-publish (Sprint C) docs(typedoc): add API reference + PR-time JSDoc gate (Sprint C) May 26, 2026
@IgorShevchik IgorShevchik merged commit 97e4886 into main May 26, 2026
7 checks passed
@IgorShevchik IgorShevchik deleted the docs/typedoc-and-badges branch May 29, 2026 04:24
IgorShevchik pushed a commit that referenced this pull request May 29, 2026
Manual reconciliation between release-please's auto-generated
[0.1.0] block (short subject lines from commits, plus 4 stale
uuidv7/type-msg leftovers from pre-0.0.4 history) and the
hand-written Unreleased block we maintained through PRs #10-#21
(rich per-entry descriptions with behavioural-change callouts).

This is the one-shot reconciliation flagged in CONTRIBUTING.md
"Release flow -> CHANGELOG reconciliation on the first auto-
release" — subsequent releases will land cleanly because the
hand-written approach ends with v0.1.

Kept from release-please:
- [0.1.0] heading with compare link and 2026-05-28 date.

Replaced with hand-written content:
- Added (3): release-please+OIDC #19/#21, TypeDoc #18,
  Logger DI #15.
- Changed (3): types any->unknown #16, consumer reconnect #14,
  producer prefetch #13.
- Removed (1): RabbitRPC dropped #12.
- Bug Fixes (2): ack/nack idempotency #17,
  base/registerQueue merge #10.

Dropped:
- 4 stale `fix(uuidv7): improve` entries from pre-0.0.4 history
  (already covered in [0.0.3] / [0.0.2] sections below).
- 1 stale `fix(type/Message): improve` (already in [0.0.4]).
- 7 noise `docs: improve` / `docs(en): fix nav` entries from
  pre-reanimation that release-please surfaced without
  bootstrap-sha.

Also captures PR #16 (chore(types)) + PR #19 / #21 (chore(release))
which release-please hides under the chore: hidden setting.
The hand-written entries describe what actually shipped.

Gates: lint, typecheck, test (66/66), build, docs:build all green.

Note: this commit is pushed to the release-please branch (not
main) — it amends release-please PR #20 in-place. The push from
a non-GITHUB_TOKEN identity also triggers PR-time CI, which the
original release-please-bot push could not because of GitHub's
loop-prevention rule.
IgorShevchik pushed a commit that referenced this pull request May 29, 2026
First trustworthy release of @bitrix24/b24rabbitmq after the
full reanimation cycle. All three roadmap tracks closed:

- Track 1 (Correctness): every Phase 1 defect fixed test-first
  with characterisation locks (PRs #10, #12, #13, #14, #15,
  #16, #17).
- Track 2 (Onboarding & positioning): runnable examples,
  README integrator section, TypeDoc API reference + PR-time
  JSDoc gate (PRs #5, #18).
- Track 3 (Process & infrastructure): release-please-driven
  release flow, tag-triggered npm publish with OIDC trusted
  publishing + provenance, ci aggregator job for branch
  protection (PRs #19, #21, #22).

See the reconciled `[0.1.0]` block in CHANGELOG.md for the
rich per-PR descriptions and behavioural-change callouts.

Merging this PR creates the v0.1.0 git tag + GitHub Release,
which triggers .github/workflows/npm-publish.yml to publish
@bitrix24/b24rabbitmq@0.1.0 to npm via OIDC trusted
publishing with --provenance attestation.

Gates: lint, typecheck, unit tests (node 20 + 22), build,
docs:build, commit messages, ci aggregator — all green on
PR #20.
IgorShevchik added a commit that referenced this pull request May 29, 2026
…ager wins (#25)

The first workflow_dispatch run of npm-publish.yml on v0.1.0
(https://github.com/bitrix24/b24rabbitmq/actions/runs/26621673812)
failed at Install pnpm:

  Error: Multiple versions of pnpm specified:
    - version 10 in the GitHub Action config with the key "version"
    - version pnpm@10.10.0 in the package.json with the key
      "packageManager"
  Remove one of these versions to avoid version mismatch errors
  like ERR_PNPM_BAD_PM_VERSION

The explicit `version: 10` on pnpm/action-setup@v4 was added in
PR #18 on a senior-dev review nit. On the action version current
at runtime, two sources of truth is no longer accepted.

Drop the workflow version: input. Let pnpm/action-setup@v4 read
packageManager: pnpm@10.10.0 from package.json directly. Same
pattern already used in ci.yml.

Bonus: the same failed run also logs:
  "Node.js 20 is deprecated. The following actions target Node.js
  20 but are being forced to run on Node.js 24: actions/checkout@v4,
  pnpm/action-setup@v4."
That's exactly the intended behaviour of the
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24=true flag added in PR #23 —
informational, not an error.

Post-merge: re-trigger npm-publish.yml via workflow_dispatch on
main.

Gates: lint, typecheck, test (66/66), build, docs:build, ci
aggregator — all 8 green on PR #25. No src/ changes.
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.

2 participants