Skip to content

test(sveltekit-e2e): prove Kit 3 preprocess wiring from the README (#11) - #204

Merged
krassx merged 2 commits into
mainfrom
fix/issue-11-compat
Nov 17, 2026
Merged

krassx merged 2 commits into
mainfrom
fix/issue-11-compat

Conversation

@krassx

@krassx krassx commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Refs #11

Audit of #11 against current main: Astro 7 (CI Node >=22.23.4), Preact 11 smoke, React Router 8, Kit 3 handleError, and the README pointers were already done in #145/#157. This PR closes the last verifiable item: the sveltekit README's Kit 3 sveltekit({ preprocess: [componentAnnotatePreprocessor()] }) example is now exercised by sveltekit-e2e against real Kit 3.1 (SSR HTML must carry data-bugsee-component; mutation-checked by removing preprocess). The fixture imports the plugin from built dist because Kit 3 reloads vite.config in a plain-Node post-build process that cannot resolve workspace extensionless TS.

Test/fixture only, no SDK behaviour change. Still open: Rollup 5 (prerelease 5.0.0-2), keep watching.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WeiJxSd4XxSkeZk5vaw6dX

@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Tests

    • Added an end-to-end check that confirms server-rendered page headings include component annotation data.
    • The test setup now builds the annotation plugin before the fixture app and reports build output if the build fails.
  • Documentation

    • Updated guidance on configuring component annotation in SvelteKit and checking rendered HTML.

The SvelteKit e2e fixture now builds the component annotation plugin before building the app and configures the plugin as a SvelteKit preprocessor. A new test fetches the index page and checks that its rendered <h1> has data-bugsee-component="routes". The progress note documents this setup and identifies Rollup 5 monitoring as the remaining open item.

Sequence Diagram(s)

sequenceDiagram
  participant E2E as SvelteKit e2e setup
  participant Annotate as component annotate package
  participant Vite as Vite/SvelteKit fixture
  participant Server as fixture server
  participant Test as SSR assertion
  E2E->>Annotate: build plugin
  E2E->>Vite: build fixture with configured preprocessor
  Vite->>Annotate: preprocess route component
  Test->>Server: GET /
  Server-->>Test: return rendered HTML
  Test->>Test: check h1 data-bugsee-component
Loading

Possibly related issues

  • bugsee/bugsee-javascript#11 — This PR adds a SvelteKit e2e test using Kit 3.1 and the documented preprocess configuration, addressing the issue’s suggested Kit 3 e2e follow-up.

Possibly related PRs

  • bugsee/bugsee-javascript#145 — That PR introduced the Kit 3 fixture layout that this PR updates with the preprocess configuration and e2e assertion.

Change: Other

Merge Risk: Minimal · up to ac31e

This adds test and fixture coverage for the SvelteKit preprocessor setup and does not change SDK behavior. No actionable merge-blocking risk is identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the test added for the SvelteKit e2e suite and the Kit 3 preprocess wiring from the README, which matches the main change. The changeset adds an e2e test that checks data-bugsee-compon…
Description check Passed The description states the purpose of the change. It says the README's Kit 3 preprocess example is now exercised by the sveltekit-e2e test, that the fixture imports the plugin from built dist, and tha…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the test added for the SvelteKit e2e suite and the Kit 3 preprocess wiring from the README, which matches the main change. The changeset adds an e2e test that checks data-bugsee-component in SSR HTML, builds the annotate plugin, and wires componentAnnotatePreprocessor into vite.config.ts. The '(#11)' reference is an issue number and is not a problem. The title is specific and accurate.

Full details: Description check

Explanation

The description states the purpose of the change. It says the README's Kit 3 preprocess example is now exercised by the sveltekit-e2e test, that the fixture imports the plugin from built dist, and that the change is test/fixture-only. These points match the summary of the changed files, so the description is related to the changeset.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7aa0e6a5-b879-470d-bbda-e99fbbed287e
Commits

Reviewing files that changed from the base of the PR and between 361015b and ac31e91.

Files ignored due to path filters: 1

  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
Files selected for processing: 4

  • docs/PROGRESS.md
  • packages/sveltekit-e2e/package.json
  • packages/sveltekit-e2e/test/sveltekit.e2e.ts
  • packages/sveltekit-e2e/vite.config.ts

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@claude

claude Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Claude finished @krassx's task in 22s —— View job


Review of #204: Kit 3 preprocess wiring e2e

I read the diff and the surrounding code: the annotate package's tsup build, component-name.ts, the fixture route, turbo's test:e2e pipeline, and the .gitignore entry for dist/. I did not run the e2e suite or the build.

Findings: none that need a code change.

Things I checked that hold up:

  • Build order. The new workspace:* dependency means turbo's test:e2e (dependsOn: ["^build"]) now builds @bugsee/svelte-plugin-component-annotate before the suite runs. The explicit pnpm --filter … build in beforeAll is redundant under turbo, but it makes a bare vitest run in the package work. The failure path throws with stdout and stderr, so it is easy to diagnose.
  • Dist import. vite.config.ts imports ../svelte-plugin-component-annotate/dist/index.js. dist/ is gitignored and produced by tsup (type: module, so dist/index.js is ESM). sveltekit-e2e has no tsconfig, so it is not part of typecheck and the missing-at-lint-time dist is not a problem. The comment explaining why it uses dist rather than source is accurate and useful.
  • Assertion. routes/+page.svelte goes through componentNameFromFilename, which maps +page to the enclosing directory. That gives routes, so <h1> is consistent with component-name.ts:4,19.
  • Lockfile. The pnpm-lock.yaml change is the matching link: entry and nothing else.
  • Scope. The change is test and fixture only, with no SDK behaviour change. docs/PROGRESS.md is updated as the repo requires.

Minor, non-blocking (P3):

  • The exact-string assertion depends on Svelte's SSR attribute serialisation of a bare <h1>. If the fixture page ever gains a class or attribute, this breaks. Using toMatch(/<h1[^>]*data-bugsee-component="routes"/) would be more robust. This is optional.

Overall risk: Low
Merge recommendation: Approve and merge once CI's e2e job is green.
Most important issues to fix: None.
Positives:

  • It closes a real gap: the README's Kit 3 preprocess example is now exercised against a real Kit 3.1 build.
  • The author reports a mutation check, removing preprocess makes the test fail.
  • The dist-import constraint is documented in place.
  • The PR leaves Rollup 5 explicitly open.

@claude

claude Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Claude finished @krassx's task in 16s —— View job


Re-review of #204 (after 62dbf91b)

I read the full diff against origin/main and checked the annotate package's tsup config, its exports and the fixture route. I did not run the build or the e2e suite.

Earlier finding fixed. The one P3 from my last review (exact-string <h1> assertion) is resolved. 62dbf91b changes it to toMatch(/<h1[^>]*data-bugsee-component="routes"/), which tolerates extra attributes on the heading.

New findings: none. I re-checked the points that could break CI:

  • Dist import resolves. tsup.config.base.ts builds format: ['esm','cjs'] into dist/. The package is type: module, so dist/index.js is ESM and exports componentAnnotatePreprocessor. That is what vite.config.ts imports.
  • Build order. beforeAll builds the plugin before vite build. This is redundant under turbo (the workspace:* dependency pulls it in via ^build), but it lets a bare vitest run work. A failure throws with stdout and stderr.
  • No typecheck or lint gap. sveltekit-e2e has no tsconfig, and dist/ is gitignored, so a missing dist at lint time does not matter.
  • Expected component name. The fixture is src/routes/+page.svelte with a bare <h1>. +page maps to the enclosing directory, routes, which matches the assertion.
  • Lockfile and docs. The pnpm-lock.yaml change is only the matching link: entry. docs/PROGRESS.md is updated.
  • Scope. The change is test and fixture only, with no SDK behaviour change.

Overall risk: Low
Merge recommendation: Approve and merge once CI's e2e job is green.
Most important issues to fix: None.
Positives:

  • The README's Kit 3 preprocess example is now exercised against a real Kit 3.1 build.
  • The author reports a mutation check, removing preprocess makes the test fail.
  • The reason for importing from dist is documented in the config file.
  • The remaining open item (Rollup 5) is stated explicitly.

krassx and others added 2 commits November 16, 2026 14:34
… wiring runs the annotate preprocessor (#11)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WeiJxSd4XxSkeZk5vaw6dX
…eview nit)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WeiJxSd4XxSkeZk5vaw6dX
@krassx
krassx force-pushed the fix/issue-11-compat branch from 62dbf91 to ac31e91 Compare November 16, 2026 09:34
@claude

claude Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Claude finished @krassx's task in 16s —— View job


Re-review of #204 (head ac31e91f)

I read the full diff against origin/main. I also read the annotate package's package.json and tsup config, component-name.ts, the componentAnnotatePreprocessor export and the fixture route. I did not run the build, the e2e suite or the tests.

Earlier finding: the P3 from my first review (exact-string <h1> assertion) is fixed. The test now uses toMatch(/<h1[^>]*data-bugsee-component="routes"/), which tolerates extra attributes on the heading.

New findings: none. I re-checked the points that could break CI:

  • Dist import resolves. tsup.config.base.ts builds format: ['esm','cjs'] with outDir: 'dist'. The package is type: module, so dist/index.js is ESM. src/index.ts:34 exports componentAnnotatePreprocessor, which is the name vite.config.ts imports.
  • Build order. The beforeAll build step is redundant under turbo, because the new workspace:* dependency already pulls the plugin in through ^build. It lets a bare vitest run in the package work, and a failure throws with stdout and stderr.
  • No typecheck or lint gap. sveltekit-e2e has no tsconfig, and dist/ is gitignored (.gitignore:2), so a missing dist at lint time is harmless.
  • Expected component name. The fixture is src/routes/+page.svelte with a bare <h1>. componentNameFromFilename maps +page to the enclosing directory, routes, which matches the assertion.
  • Lockfile and docs. The pnpm-lock.yaml change is only the matching link: entry. docs/PROGRESS.md has the follow-up note.
  • Scope. The change is test and fixture only, with no SDK behaviour change.

Overall risk: Low
Merge recommendation: Approve and merge once CI's e2e job is green.
Most important issues to fix: None.
Positives:

  • The README's Kit 3 preprocess example is now exercised against a real Kit 3.1 build.
  • The PR reports a mutation check: removing preprocess fails the test.
  • The reason for importing from dist is documented next to the import.
  • The remaining open item (Rollup 5, still prerelease) is stated explicitly.

@krassx
krassx merged commit bdbd112 into main Nov 17, 2026
@krassx
krassx deleted the fix/issue-11-compat branch November 17, 2026 08:54
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