Skip to content

feat: manifest-driven component extensions + Vite host-route template#144

Open
lklyne wants to merge 2 commits into
mainfrom
claude/issue-135
Open

feat: manifest-driven component extensions + Vite host-route template#144
lklyne wants to merge 2 commits into
mainfrom
claude/issue-135

Conversation

@lklyne
Copy link
Copy Markdown
Owner

@lklyne lklyne commented May 17, 2026

Closes #135

Summary

  • Manifest-driven extension set: moves the component-render plugin's hardcoded .tsx/.jsx regex to a component-extensions.json file in the app's userData directory. Seeded with tsx, jsx, svelte, vue on 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 in src/main/index.ts before registerBuiltInPlugins(), following the same injection pattern as initDevServerManager.
  • Vite host-route template (resources/specular-host.ts): a self-contained Vite plugin (copy-paste, no npm package) that registers GET /__specular?path= and returns an HTML host page with lazy-loaded React/Svelte/Vue mount shims and HMR support. Bundled as an extra resource in forge.config.ts.
  • Skill docs updated in both resources/skills/specular/SKILL.md and .claude/skills/specular/SKILL.md with a "Component rendering" section explaining the manifest and how to stamp the template into a project.
  • Tests extended: new manifest-driven claims() tests and resolveUrl tests for .svelte/.vue files; all 593 unit tests pass.

Test plan

  • pnpm test:unit passes (593 tests, all green)
  • Drop a .svelte or .vue file from a connected repo — entity broadcasts rendererTag: 'component'
  • Edit component-extensions.json in userData to remove svelte, relaunch — .svelte files no longer claimed
  • Copy resources/specular-host.ts into a React/Svelte/Vue project, wire into vite.config, visit /__specular?path=src/MyComponent.tsx — component renders live

Generated by Claude Code

claude and others added 2 commits May 20, 2026 01:33
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>
@lklyne lklyne force-pushed the claude/issue-135 branch from b14355d to 77f6259 Compare May 20, 2026 08:35
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.

Multi-framework component rendering (Svelte/Vue), agent-stampable

2 participants