Skip to content

feat(source-react-runtime): add xyd-source-react-runtime, remove xyd-…#107

Merged
zdunecki merged 5 commits into
masterfrom
feat/xyd-source-react-runtime
Apr 23, 2026
Merged

feat(source-react-runtime): add xyd-source-react-runtime, remove xyd-…#107
zdunecki merged 5 commits into
masterfrom
feat/xyd-source-react-runtime

Conversation

@zdunecki

Copy link
Copy Markdown
Member

…source-react-babel-runtime

Replace the naive babel-runtime approach (regex-based component matching + TypeDoc) with a typia-powered plugin that uses the TypeScript compiler for battle-tested type resolution.

xyd-source-react-runtime:

  • Auto-detects exported React components and createContext() calls
  • Uses typia's TS transform to generate JSON Schema from props
  • Converts JSON Schema to xyd uniform format via @xyd-js/openapi
  • Works as Vite plugin, Rollup plugin, and esbuild plugin adapter
  • No manual annotations or typia imports needed by consumers
  • Exports: xydSourceReactRuntime (vite/rollup), xydSourceReactRuntimeEsbuild

Tested across 8 fixtures:

  • 1-3: vite lib (basic, cross-file types, real todo app)
  • 4: vite app mode
  • 5: rollup + @rollup/plugin-typescript
  • 6: esbuild
  • 7: real react-router v7 app (react-router build)
  • 8: real tanstack router app (@tanstack/router-plugin/vite)

Each fixture is a self-contained app with its own build config and package.json build script. Tests run pnpm build and compare output.js.

Also exports schemaObjectToUniformDefinitionProperties from @xyd-js/openapi.

…source-react-babel-runtime

Replace the naive babel-runtime approach (regex-based component matching +
TypeDoc) with a typia-powered plugin that uses the TypeScript compiler for
battle-tested type resolution.

xyd-source-react-runtime:
- Auto-detects exported React components and createContext<T>() calls
- Uses typia's TS transform to generate JSON Schema from props
- Converts JSON Schema to xyd uniform format via @xyd-js/openapi
- Works as Vite plugin, Rollup plugin, and esbuild plugin adapter
- No manual annotations or typia imports needed by consumers
- Exports: xydSourceReactRuntime (vite/rollup), xydSourceReactRuntimeEsbuild

Tested across 8 fixtures:
- 1-3: vite lib (basic, cross-file types, real todo app)
- 4: vite app mode
- 5: rollup + @rollup/plugin-typescript
- 6: esbuild
- 7: real react-router v7 app (react-router build)
- 8: real tanstack router app (@tanstack/router-plugin/vite)

Each fixture is a self-contained app with its own build config and
package.json build script. Tests run `pnpm build` and compare output.js.

Also exports schemaObjectToUniformDefinitionProperties from @xyd-js/openapi.
@netlify

netlify Bot commented Apr 23, 2026

Copy link
Copy Markdown

Deploy Preview for xyd-apidocs-demo ready!

Name Link
🔨 Latest commit c48a613
🔍 Latest deploy log https://app.netlify.com/projects/xyd-apidocs-demo/deploys/69ea326d2b56fa0008c4f845
😎 Deploy Preview https://deploy-preview-107--xyd-apidocs-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Apr 23, 2026

Copy link
Copy Markdown

Deploy Preview for xyd-website canceled.

Name Link
🔨 Latest commit c48a613
🔍 Latest deploy log https://app.netlify.com/projects/xyd-website/deploys/69ea326dd0c990000853cce1

@netlify

netlify Bot commented Apr 23, 2026

Copy link
Copy Markdown

Deploy Preview for xyd-storybook ready!

Name Link
🔨 Latest commit c48a613
🔍 Latest deploy log https://app.netlify.com/projects/xyd-storybook/deploys/69ea326d91b983000838c974
😎 Deploy Preview https://deploy-preview-107--xyd-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@zdunecki zdunecki marked this pull request as ready for review April 23, 2026 15:01
@zdunecki zdunecki merged commit 23166ce into master Apr 23, 2026
5 checks passed
@zdunecki zdunecki deleted the feat/xyd-source-react-runtime branch April 23, 2026 15:49
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