Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
Thank you for following the naming conventions! 🙏 |
commit: |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a first-class SvelteKit integration to evlog via a new evlog/sveltekit entry point, aligning SvelteKit with the existing framework adapters (Express/Fastify/Elysia/etc.) and extending docs/examples accordingly.
Changes:
- Add
evlog/sveltekitadapter withhandle,handleError,createEvlogHooks(), anduseLogger()(AsyncLocalStorage-based request scoping). - Add a SvelteKit example app + documentation pages and landing-page framework tab.
- Add a comprehensive Vitest suite for the SvelteKit adapter and wire up build/package exports.
Reviewed changes
Copilot reviewed 27 out of 29 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| skills/evlog/SKILL.md | Updates skill guide to mention SvelteKit and adds setup/usage snippets. |
| packages/evlog/tsdown.config.ts | Adds SvelteKit build entry and externalizes @sveltejs/kit. |
| packages/evlog/test/sveltekit.test.ts | Adds SvelteKit adapter tests (hooks lifecycle, errors, pipeline, useLogger, filtering). |
| packages/evlog/src/sveltekit/index.ts | Implements the SvelteKit adapter (handle + handleError hooks, ALS logger scoping). |
| packages/evlog/package.json | Adds ./sveltekit export, typesVersions entry, and peer dep on @sveltejs/kit. |
| packages/evlog/README.md | Adds SvelteKit line to the framework quickstart table. |
| package.json | Adds example:sveltekit script. |
| examples/sveltekit/vite.config.ts | New SvelteKit example config. |
| examples/sveltekit/tsconfig.json | New SvelteKit example TypeScript config. |
| examples/sveltekit/svelte.config.js | New SvelteKit example adapter configuration. |
| examples/sveltekit/src/routes/users/[id]/+server.ts | Example route demonstrating useLogger() + context accumulation. |
| examples/sveltekit/src/routes/slow/+server.ts | Example route demonstrating tail sampling via a slow request. |
| examples/sveltekit/src/routes/health/+server.ts | Example health route using locals.log. |
| examples/sveltekit/src/routes/crash/+server.ts | Example route throwing an unexpected error. |
| examples/sveltekit/src/routes/checkout/+server.ts | Example route throwing an EvlogError via createError. |
| examples/sveltekit/src/routes/+page.svelte | Interactive UI to call example routes and show responses. |
| examples/sveltekit/src/hooks.server.ts | Example hook setup with drain + enrichers + tail sampling. |
| examples/sveltekit/src/app.html | SvelteKit base HTML template. |
| examples/sveltekit/src/app.d.ts | App locals typing for log: RequestLogger. |
| examples/sveltekit/package.json | Example workspace package definition and dependencies. |
| examples/sveltekit/.gitignore | Ignores .svelte-kit build directory. |
| bun.lock | Updates lockfile for new example/workspace dependencies. |
| apps/docs/content/6.examples/7.sveltekit.md | Adds a full SvelteKit example doc page. |
| apps/docs/content/1.getting-started/2.installation.md | Adds SvelteKit installation/setup section. |
| apps/docs/content/0.landing.md | Adds SvelteKit snippet to landing framework tabs. |
| apps/docs/app/components/features/FeatureFrameworks.vue | Adds SvelteKit as a selectable framework tab. |
| .github/workflows/semantic-pull-request.yml | Allows sveltekit as a semantic PR scope. |
| .github/pull_request_template.md | Documents sveltekit as an allowed PR scope. |
| .changeset/sveltekit-integration.md | Declares a minor release for the new SvelteKit integration. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Add `evlog/sveltekit` entry point with `createEvlogHooks()` returning `handle` and `handleError` hooks, plus `useLogger()` for request-scoped logging via AsyncLocalStorage - Handle SvelteKit's unique error flow: intercept 500 responses when `handleError` already logged an EvlogError with a specific status, returning structured JSON instead of SvelteKit's generic error page - Support full evlog pipeline: drain, enrich, tail sampling, route filtering - Add example app with 5 demo routes: /health, /users/:id, /checkout (402), /crash (unexpected), /slow (tail sampling) - Add 33 tests covering hooks creation, request lifecycle, error handling, useLogger, route filtering, enrichment, and tail sampling - Update docs, CI scopes, changeset, and README Co-Authored-By: Claude Opus 4.6 <[email protected]>
Remove unnecessary async on mock functions, fix brace-style on inline mock objects, and add missing await in skipped route path. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Replace the minimal hooks setup with a full checkout route handler showing useLogger(), log.set(), and createError() — matching the pattern used by all other framework tabs. Co-Authored-By: Claude Opus 4.6 <[email protected]>
- Replace `App.Error` with local `AppError` type in
`SvelteKitHandleServerError` so the adapter's types remain
self-contained without requiring SvelteKit ambient types
- Unify EvlogError response shape: the intercept-500 branch now uses
`serializeEvlogErrorResponse` (same as the catch branch), ensuring
clients always receive the same `{ message, status, data }` shape
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Co-Authored-By: Claude Opus 4.6 <[email protected]>
74ea952 to
7d68483
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.
Summary
evlog/sveltekitentry point withcreateEvlogHooks()returninghandleandhandleErrorhooks, plususeLogger()for request-scoped logging via AsyncLocalStorageresolve()catches route errors internally — intercept 500 responses whenhandleErrorlogged anEvlogError, returning structured JSON at the correct status/health,/users/:id,/checkout(402 EvlogError),/crash(unexpected error),/slow(tail sampling)useLogger, route filtering, enrichment, and tail samplingCloses EVL-91