Skip to content

docs: add a libraries section for SDK and package authors - #694

Open
evlogai[bot] wants to merge 4 commits into
mainfrom
EVL-408/docs-libraries
Open

evlogai[bot] wants to merge 4 commits into
mainfrom
EVL-408/docs-libraries

Conversation

@evlogai

@evlogai evlogai Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

What

Adds library-author guidance to the docs, restructured as a dedicated top-level section rather than a single use-case page. Library and SDK authors are a major adoption vector: their users inherit evlog's output shape, so how a library emits, structures errors, and stays testable decides what thousands of host applications log.

New section: /libraries (4 pages)

  • Overview — why a library shipping evlog differs from an app adopting it: the host owns configuration, drains, and sampling; the library only emits. Frames the three follow-up pages.
  • Emitting Events — never call initLogger() (it is process-wide and last-call-wins via the symbol registry); use the object form log.info({ source, message }) so a source field identifies your package on the host's wide events; tag the event for your library; join the host's request with the AuditableLogger the framework integration passes in; depend on evlog as a peer dependency and expect the multi-major warning.
  • Structured Errors — declare a catalog with defineErrorCatalog('myprefix', ...) so host applications get stable myprefix.CODE errors with status, typed templated message, why, fix, link, and backend-only internal context.
  • Testing — lock behavior with a collecting drain or the memory drain (async tick required), and pin error codes via the generated factories.

Side effects of the renumbering

  • extend7, reference8, compare9 directory prefixes. Public URLs are unchanged (numeric prefixes are not part of slugs), only on-disk ordering.
  • Path references updated in the content-lint scanner, its tests and README, the docs date test, the evi content selection test, and the authored skills (create-enricher, write-evlog-content surfaces).
  • Cross-links pointing to the old use-case page updated (/learn/simple-logging, /integrate/frameworks/standalone, /extend overview, /use-cases overview, catalogs page).

Verification

  • All four new pages score 100 under pnpm content:lint; docs lint clean; docs tests 143 passed; content-lint tests 155 passed.
  • Executed against packages/evlog/src: object form drains with source preserved; defineErrorCatalog factories produce prefix.CODE, typed message functions, status defaulting to 500, internal omitted from toJSON; EvlogError.isEvlogError on a caught copy; collecting drain types compile under strict TS.

@vercel
vercel Bot temporarily deployed to Preview – evlog-telemetry September 10, 2026 21:04 Inactive
@vercel

vercel Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
evlog-docs Ready Ready Preview, v0 Sep 13, 2026 10:08am UTC
evlog-render-lab Ready Ready Preview Sep 13, 2026 10:08am UTC
3 Skipped Deployments
Project Deployment Actions Updated
evi Skipped Skipped Sep 13, 2026 10:08am UTC
evlog-telemetry Skipped Skipped Sep 13, 2026 10:08am UTC
just-use-evlog Skipped Skipped Sep 13, 2026 10:08am UTC

Request Review

@evlogai
evlogai Bot marked this pull request as ready for review September 10, 2026 21:04
@coderabbitai

coderabbitai Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: b3f65bd7-9fb0-4cf2-8714-3d2c6a786b89

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@evlogai
evlogai Bot requested a review from HugoRCD September 10, 2026 21:04
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Sep 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for following the naming conventions! 🙏

@pkg-pr-new

pkg-pr-new Bot commented Sep 10, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/@evlog/cli@694
npm i https://pkg.pr.new/evlog@694
npm i https://pkg.pr.new/@evlog/nuxthub@694
npm i https://pkg.pr.new/@evlog/telemetry@694

commit: d795629

…alogs

Lead the overview with a real before/after from @github-tools/sdk instead of the
initLogger() rule, introduce the package once as the running example, and add
three pages the section was missing: writing why/fix/link for models, exporting
the catalog to Markdown/JSON/llms.txt, and a five-step migration from bare throws.
Reorder Emitting Events to lead with the request-logger pattern, ground Structured
Errors in the real catalog with the exact toJSON/parseError shapes, add the
section navigation file, and fix the dead /use-cases/libraries link in Extend.

This branch was successfully deployed

2 active and 3 inactive deployments
Preview – evlog-docs d7956294 Deployed Sep 13, 2026 by vercel[bot]
Preview – evlog-render-lab d7956294 Deployed Sep 13, 2026 by vercel[bot]
Preview – evlog-telemetry d7956294 Deployed Sep 13, 2026 by vercel[bot]
Preview – evi d7956294 Deployed Sep 13, 2026 by vercel[bot]
Preview – just-use-evlog d7956294 Deployed Sep 13, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant