feat: manifest-driven component extensions + Vite host-route template#144
Open
lklyne wants to merge 2 commits into
Open
feat: manifest-driven component extensions + Vite host-route template#144lklyne wants to merge 2 commits into
lklyne wants to merge 2 commits into
Conversation
11 tasks
Moves the component-render extension set from a hardcoded regex to a userData JSON manifest (`component-extensions.json`), seeded with tsx/jsx/ svelte/vue on first run. Editing the manifest changes which files are claimed without rebuilding the app. Also ships a self-contained vite host-route template (`resources/specular-host.ts`) that serves `/__specular?path=` for React, Svelte, and Vue projects — a single file stamped into a user's repo, no npm package required. Closes #135 https://claude.ai/code/session_0184cpNby69nR6eFzVHy7rrD
The Vite host-route template ships as an extraResource bundled by forge.config.ts and copied into user projects on demand; nothing inside Specular imports it, so fallow flagged it as unreachable. Declaring it as a manual entry makes the "intentional leaf" status explicit, matching the pattern used for vite.*.config.ts. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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 #135
Summary
.tsx/.jsxregex to acomponent-extensions.jsonfile in the app'suserDatadirectory. Seeded withtsx,jsx,svelte,vueon first run; a missing or corrupt file falls back silently to defaults. Editing the manifest changes which files are claimed as components with no rebuild.initComponentExtensions(userDataDir)called at boot insrc/main/index.tsbeforeregisterBuiltInPlugins(), following the same injection pattern asinitDevServerManager.resources/specular-host.ts): a self-contained Vite plugin (copy-paste, no npm package) that registersGET /__specular?path=and returns an HTML host page with lazy-loaded React/Svelte/Vue mount shims and HMR support. Bundled as an extra resource inforge.config.ts.resources/skills/specular/SKILL.mdand.claude/skills/specular/SKILL.mdwith a "Component rendering" section explaining the manifest and how to stamp the template into a project.claims()tests andresolveUrltests for.svelte/.vuefiles; all 593 unit tests pass.Test plan
pnpm test:unitpasses (593 tests, all green).svelteor.vuefile from a connected repo — entity broadcastsrendererTag: 'component'component-extensions.jsonin userData to removesvelte, relaunch —.sveltefiles no longer claimedresources/specular-host.tsinto a React/Svelte/Vue project, wire intovite.config, visit/__specular?path=src/MyComponent.tsx— component renders liveGenerated by Claude Code