Appearance
Playground & HTTP API
Public playground: https://cross-framework.netlify.app/ — full documentation: https://cross-framework-doc.netlify.app/
The interactive UI lives in the Nuxt 4 app under website/. It is not part of the published npm package; it is a developer demo that calls the same conversion logic as the CLI.
Run locally
From website/:
bash
npm install
npm run devDefault dev server port is 3022 (website/nuxt.config.ts → devServer.port).
Open http://localhost:3022 in your browser.
Production / preview base URL: set NUXT_PUBLIC_SITE_URL (or your host’s equivalent) so SEO and links resolve correctly.
HTTP API
Endpoint: POST /api/convert
Body (JSON):
| Field | Type | Default | Description |
|---|---|---|---|
from | "react" | react | Source framework (only react supported). |
to | "vue" | vue | Target (only vue supported). |
sourceCode | string | "" | Full React component source. |
filename | string | "Component.tsx" | Virtual filename for the parser. |
Success: HTTP 200 with plain text body = the generated Vue SFC string.
Error: HTTP 400 with statusMessage set to the thrown error message (or "Conversion failed" if non-Error).
Implementation reference: website/server/api/convert.post.ts (calls convertCode from src/convert.ts).
Samples
The playground loads curated examples from website/samples/ — nine demos (greeting, class/style card, invoice line, roadmap steps, mount title, shopping cart, settings panel, onboarding wizard, command palette). See website/samples/index.ts for the list.