Skip to content

Conversation

jaysin586
Copy link
Contributor

@jaysin586 jaysin586 commented Sep 20, 2025

Summary by CodeRabbit

  • New Features

    • Integrated error monitoring and performance tracing for the docs site.
    • Added site analytics.
    • Published a sitemap to improve SEO and discoverability.
    • Enforced a stricter Content Security Policy for enhanced security.
  • Chores

    • Updated dependencies across the project, including framework and tooling.
    • Enabled build-time integrations to improve diagnostics and source map handling.

Copy link
Contributor

coderabbitai bot commented Sep 20, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Adds Sentry to the docs site (client, server, Vite plugin with source maps). Updates Svelte and several root deps. Introduces CSP rules and experimental instrumentation in Svelte config. Adds Ahrefs analytics script, sitemap, and Cloudflare version metadata wiring via types and wrangler config.

Changes

Cohort / File(s) Summary
Dependency updates
package.json, docs/package.json
Bump: root motion, @eslint/js, @sveltejs/package, @tailwindcss/typography, eslint, svelte. Docs: add runtime @sentry/sveltekit@^10.12.0, bump svelte to ^5.39.3.
Sentry integration (client/server)
docs/src/hooks.client.ts, docs/src/hooks.server.ts
Client: initialize Sentry with DSN/env, tracing and replay; export handleError via handleErrorWithSentry(). Server: compose Sentry init/handle into exported handle using sequence(fullSentryHandle, handleParaglide); enable traces/logs, default PII, env-driven config.
Build tooling: Vite + Sentry
docs/vite.config.ts
Add @sentry/sveltekit plugin with sourceMapsUploadOptions (org: humanspeak, project: motion-svelte-page).
Security/config (SvelteKit)
docs/svelte.config.js
Add CSP (mode: hash) with directives for default/script/style/img/font/worker/connect/frame-ancestors/form-action/base-uri/upgrade-insecure-requests. Enable experimental instrumentation.server and tracing.server.
Analytics
docs/src/app.html
Insert Ahrefs analytics script tag in <head> (src, data-key, async).
Cloudflare env metadata
docs/src/worker-configuration.d.ts, docs/wrangler.jsonc
Type: add CF_VERSION_METADATA: WorkerVersionMetadata to Cloudflare.Env. Wrangler: add version_metadata binding { "binding": "CF_VERSION_METADATA" }.
Static assets
docs/static/sitemap.xml
Add sitemap with single URL https://motion.svelte.page/ and lastmod 2025-01-01.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant Browser
  participant SvelteKit as SvelteKit Server
  participant Sentry as Sentry SDK

  rect rgb(240,248,255)
    note over Browser: Client init
    Browser->>Sentry: init(dsn, env, traces/replay)
    Browser->>SvelteKit: Navigate / Request
    SvelteKit->>Sentry: Server init (env, dsn)
  end

  rect rgb(245,245,245)
    note over SvelteKit,Sentry: Server handle sequence
    SvelteKit->>Sentry: sentryHandle (trace/log capture)
    SvelteKit->>SvelteKit: handleParaglide (existing)
    SvelteKit-->>Browser: Response
  end

  rect rgb(255,250,240)
    note over Browser,Sentry: Error path
    Browser->>Browser: Error occurs
    Browser->>Sentry: handleErrorWithSentry(event)
    Sentry-->>Browser: ack
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

enhancement, minor

Poem

I hop through logs with cotton tail bright,
Tracing little crumbs in day and night.
CSP fences, sitemap trails, all neat—
Ahrefs whispers where the footprints meet.
Sentry listens when pages cry,
And with a twirl, I ship and fly. 🐇✨

✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch initial-creation

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cde8fcf and 986335d.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (10)
  • docs/package.json (2 hunks)
  • docs/src/app.html (1 hunks)
  • docs/src/hooks.client.ts (1 hunks)
  • docs/src/hooks.server.ts (2 hunks)
  • docs/src/worker-configuration.d.ts (1 hunks)
  • docs/static/sitemap.xml (1 hunks)
  • docs/svelte.config.js (1 hunks)
  • docs/vite.config.ts (2 hunks)
  • docs/wrangler.jsonc (1 hunks)
  • package.json (2 hunks)

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

@jaysin586 jaysin586 merged commit 0598ac5 into main Sep 20, 2025
3 of 4 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Sep 21, 2025
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