Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
c8c8582 to
4c7d8be
Compare
4c7d8be to
203bb9b
Compare
203bb9b to
e6e775f
Compare
e6e775f to
0b4e2c4
Compare
0b4e2c4 to
3c4764b
Compare
3c4764b to
62f9c84
Compare
62f9c84 to
2593934
Compare
2593934 to
d97828c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.
Releases
evlog@2.17.0
Minor Changes
#332
ced6edaThanks @HugoRCD! - Tag every drain request with identity headers so receivers can recognize evlog traffic and the originating adapter without parsing the body.User-Agent: evlog/<version>on Node / server runtimes (browsers stripUser-Agent).X-Evlog-Source: <adapter>(axiom,datadog,otlp,posthog,sentry,better-stack,hyperdx,clientfor browser-originated drains).httpPostgainsuserAgent?: string | falseandsource?: stringoptions so custom drains can override or suppress the headers.evlog/toolkit:EVLOG_VERSION,EVLOG_USER_AGENT,withEvlogIdentityHeaders.Adapters built with
defineHttpDrain()automatically forward theirnameassource. The legacysendBatchTo*helpers inevlog/axiom,evlog/datadog,evlog/otlp,evlog/posthog,evlog/sentry, andevlog/better-stackpass it explicitly.#325
6b06511Thanks @HugoRCD! - Add typed error and audit catalogs as a thin layer overcreateErroranddefineAuditAction. Three new primitives, zero runtime registration, zero init step. The whole feature is opt-in: existingcreateError({ code, ... })anddefineAuditAction(...)call sites keep working unchanged, with no migration required.New API on the main
evlogentrypoint:defineError(code, options)— single-error factory bound to a stable code. Accepts every existingEvlogErrorfield plus atagsarray and aninternaldefaults object.messagecan be either a string or a typed function whose params become required at the call site.defineErrorCatalog(prefix, map)— bundle a record of entries under a common prefix. The wirecodefor each entry is${prefix}.${KEY}(UPPER_SNAKE_CASE keys preserved). Catalog metadata (_codes,_prefix) exposed for introspection.defineAuditCatalog(prefix, map)— symmetric primitive for audit actions. Each entry produces a thin wrapper arounddefineAuditActionwith the prefix and target type pre-applied. Exposes_actionsand_prefix.Type-level upgrade (opt-in, zero runtime cost):
RegisteredErrorCatalogsandRegisteredAuditCatalogsinterfaces (empty by default, augmentable viadeclare module 'evlog').ErrorCodeandAuditActiontypes derived from registered catalogs.ErrorOptions.codeandParsedError.codenow typed asErrorCode | (string & {})— autocomplete on registered codes everywhere (createError,parseError, custom helpers) without breaking ad-hoc string usage.Catalog factories return regular
EvlogErrorinstances andAuditInputobjects respectively, so they integrate transparently with every existing evlog primitive (HTTP serializers,parseError, wide event capture, audit pipeline, drains). Catalogs are pure data — package them as npm libraries (one prefix per package), and the typing flows transitively to consumers via the published.d.ts. No global init, no proxy, no string-based dispatch helper.#332
ced6edaThanks @HugoRCD! - AddreadFsLogs()andtailFsLogs()toevlog/fsso any external Node tool can replay or follow the local NDJSON drain without hooking into the running app. Thefsadapter has been write-only until now; this closes the loop.Both helpers accept
dir,since,until,level, and a customfilterpredicate.tailFsLogsadditionally takespollIntervalMs,fromEnd, andsignal. Files outside the date window are skipped without being opened, malformed lines are silently skipped, and partial-write chunks are reassembled across polls.Useful for post-incident triage scripts, Vitest e2e assertions on emitted wide events, replay-to-Axiom backfills, and
grep-style CLIs that pipe filtered events intojq.#332
ced6edaThanks @HugoRCD! - Add a local Server-Sent Events stream server so any consumer (browser tab, CLI, devtool) can subscribe to live wide events without going through your app's API surface. The server runs in the same Node process on its own ephemeral port; the URL is printed at startup and written to.evlog/stream.urlfor tools to discover.Strict opt-in for the framework integrations: the Nuxt module and the Next.js
defineStreamedInstrumentationhelper only boot the server whenstream: true(or a config object) is passed.startStreamServer()itself is always an explicit call — call it from any standalone script or framework wiring that doesn't have a built-in evlog config.Nuxt
Next.js — new helper in
evlog/next/stream:Standalone / any framework:
The Nuxt module also registers a tiny
/api/_evlog/stream-inforoute that returns the mini-server URL so a same-origin browser tab can discover the ephemeral port.API surface in
evlog/stream:startStreamServer(options): Promise<StreamServer>—node:httpserver bound to127.0.0.1by default, idempotent, lazy-imports Node-only modules soevlog/streamstays edge-friendly for the in-process primitive.StreamServerOptions:port,host,token,heartbeatMs,buffer,banner,urlFileDir.StreamServer:{ url, port, drain, stream, close }..evlog/stream.urland listeners onclose()+SIGINT/SIGTERM/exit.Wire format is a versioned JSON envelope
{ evlog: "1", type, data }with frameshello,replay,event, andping.Local-only by design. The server is in-process — on serverless platforms (Vercel Functions, Cloudflare Workers, AWS Lambda) each invocation is isolated, so a subscriber would only see events from its own isolate. Use a real broker for cross-instance fan-out in those environments.
Patch Changes
#335
fd830a0Thanks @HugoRCD! - Documentation site restructured into 6 audience-driven categories: Start → Learn → Integrate → Use Cases → Extend → Reference. The npm-shippedREADME.mdand a single JSDoc@seeURL have been updated to point to the new locations.Old documentation URLs continue to work via 301 redirects defined in
apps/docs/config/redirects.ts. No public API changed.If you bookmarked specific documentation pages, the most common moves are:
/getting-started/*→/start/*/logging/{simple-logging,wide-events,structured-errors}→/learn/*/logging/{ai-sdk,better-auth,audit,client-logging}/*→/use-cases/*/core-concepts/{lifecycle,sampling,typed-fields,redaction}→/learn/*/core-concepts/{configuration,performance,vite-plugin,best-practices}→/reference/*/frameworks/*→/integrate/frameworks/*/adapters/*→/integrate/adapters/*/build-on-top/*→/extend/*/enrichers/*→/use-cases/enrichersor/extend/custom-enrichers#336
872f150Thanks @HugoRCD! - Fix wide event never being emitted when the client disconnects mid-request inevlog/expressandevlog/nestjs.Both integrations now listen for the underlying socket
closeevent in addition tofinish. When the client aborts beforeres.end()resolves, the wide event is still emitted (with the samestatus,duration, and accumulated context) and tagged withconnectionClosed: trueso disconnects are observable in your drain. The first event to fire wins, so successful responses are unaffected.For background work that must outlive the HTTP response (resumable streams, post-response usage accounting), continue to use
req.log.fork('label', fn)— once the request logger has been emitted it is sealed.Closes #305.
evlog-community-adapter-skeleton@3.0.0
Patch Changes
fd830a0,ced6eda,6b06511,872f150,ced6eda,ced6eda]:evlog-community-enricher-skeleton@3.0.0
Patch Changes
fd830a0,ced6eda,6b06511,872f150,ced6eda,ced6eda]:evlog-community-framework-skeleton@3.0.0
Patch Changes
fd830a0,ced6eda,6b06511,872f150,ced6eda,ced6eda]: