feat: make RFC 0001 captureStyles reachable from every plugin surface - #60
Open
Narrator wants to merge 1 commit into
Open
feat: make RFC 0001 captureStyles reachable from every plugin surface#60Narrator wants to merge 1 commit into
Narrator wants to merge 1 commit into
Conversation
The style-capture feature landed wired through the middle of the stack but unreachable from any supported config surface: the react/vue build plugins silently dropped captureStyles, styleOptions, and serialization from the generated runtime init, and the next/nuxt option surfaces did not expose the flag at all. Users could only enable RFC 0001 by hand-rolling RuntimeManager.initialize(). One top-level `captureStyles` flag now drives both tiers everywhere — build-time styleSource attribution (transform) and runtime componentStyles snapshots — with `runtime.captureStyles` as a per-tier override: - @domscribe/react + @domscribe/vue (vite): generated init embeds the full serializable runtime options (serialization, captureStyles, styleOptions) instead of a cherry-picked subset - @domscribe/react + @domscribe/vue (webpack): DefinePlugin runtime globals gain the same fields; auto-init already spreads them - @domscribe/transform (turbopack loader): new `runtime` option emitted as window.__DOMSCRIBE_RUNTIME_OPTIONS__ in the preamble - @domscribe/next: captureStyles + runtime options on DomscribeNextOptions, threaded through both bundler paths; auto-init reads the preamble global - @domscribe/nuxt: captureStyles + runtime options on the module, injected via head-script global; client plugin reads it This also makes the verify_after_edit MCP tools (RFC 0002) fully usable from a plugin config: with captureStyles on, verification returns per-property style deltas instead of geometry-only checks. READMEs updated for all four packages. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QdBkwcY2Wx1KSCgPWV5xtS
|
View your CI Pipeline Execution ↗ for commit 8c1cfc8
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗ ☁️ Nx Cloud last updated this comment at |
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.
Closes the RFC 0001 configuration gap: style capture landed wired through the middle of the stack (transform extraction, runtime
StyleCapturer, relay/MCP surface) but was unreachable from any supported plugin config. The React/Vue build plugins silently droppedcaptureStyles,styleOptions, andserializationfrom the generated runtime init, and the Next/Nuxt option surfaces didn't expose the flag at all — the only way to enable RFC 0001 was hand-rollingRuntimeManager.initialize().What this adds
One top-level
captureStylesflag now drives both tiers on every surface — build-timestyleSourceattribution in the manifest and runtimecomponentStylessnapshots — withruntime.captureStylesas an independent per-tier override:Changes by package
@domscribe/react+@domscribe/vue(Vite) — the virtual init module now embeds the full serializable runtime options (serialization,captureStyles,styleOptions) as one JSON spread instead of a cherry-picked field list, so future runtime options flow through automatically. New top-levelcaptureStyleson the plugin options (also feeds the base transform plugin's build tier).@domscribe/react+@domscribe/vue(Webpack) — the__DOMSCRIBE_RUNTIME_OPTIONS__DefinePlugin global gains the same fields; the existing auto-init modules already spread them.@domscribe/transform(Turbopack loader) — newruntimeoption (loosely typed; the loader can't depend on@domscribe/runtimeper module boundaries) emitted aswindow.__DOMSCRIBE_RUNTIME_OPTIONS__in the client preamble, only when configured.@domscribe/next—captureStyles+runtime: DomscribeRuntimeOptionsonDomscribeNextOptions, threaded through both the Turbopack and Webpack loader paths; auto-init reads the preamble global and spreads it intoinitialize().@domscribe/nuxt— same two options on the module; runtime options injected via the head-script global (only when configured, preserving the no-script-when-nothing-to-say behavior); the client plugin reads and spreads them. Webpack fallback path passescaptureStylesto the base plugin.Why now
This makes the
verify_after_editMCP tools (#58) fully usable from plugin config: withcaptureStyleson, verification returns per-property computed-style deltas instead of geometry-only change detection.Testing
nx run-many -t lint test build typecheckgreen for all 15 projectsruntime.captureStylesoverride,serialization/styleOptionspassthrough, the Turbopack runtime global (present and absent), the Nuxt head-script global, and both auto-init spreads🤖 Generated with Claude Code
https://claude.ai/code/session_01QdBkwcY2Wx1KSCgPWV5xtS
Generated by Claude Code