Skip to content

Commit 7ad65f9

Browse files
Copilothotlong
andcommitted
Add TypeDoc API docs config, Storybook deploy workflow, and Getting Started MDX (P4.2/P4.3)
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent 6542683 commit 7ad65f9

5 files changed

Lines changed: 390 additions & 126 deletions

File tree

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Deploy Storybook
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- 'packages/**'
8+
- '.storybook/**'
9+
- 'pnpm-lock.yaml'
10+
11+
permissions:
12+
contents: read
13+
pages: write
14+
id-token: write
15+
16+
concurrency:
17+
group: pages
18+
cancel-in-progress: false
19+
20+
jobs:
21+
build:
22+
name: Build Storybook
23+
runs-on: ubuntu-latest
24+
25+
steps:
26+
- name: Checkout code
27+
uses: actions/checkout@v6
28+
29+
- name: Setup pnpm
30+
uses: pnpm/action-setup@v4
31+
32+
- name: Setup Node.js
33+
uses: actions/setup-node@v6
34+
with:
35+
node-version: '20'
36+
cache: 'pnpm'
37+
38+
- name: Turbo Cache
39+
uses: actions/cache@v5
40+
with:
41+
path: node_modules/.cache/turbo
42+
key: turbo-${{ runner.os }}-${{ github.sha }}
43+
restore-keys: |
44+
turbo-${{ runner.os }}-
45+
46+
- name: Install dependencies
47+
run: pnpm install --frozen-lockfile
48+
49+
- name: Build packages
50+
run: pnpm build
51+
52+
- name: Build Storybook
53+
run: pnpm storybook:build
54+
55+
- name: Upload Pages artifact
56+
uses: actions/upload-pages-artifact@v3
57+
with:
58+
path: storybook-static
59+
60+
deploy:
61+
name: Deploy to GitHub Pages
62+
needs: build
63+
runs-on: ubuntu-latest
64+
environment:
65+
name: github-pages
66+
url: ${{ steps.deployment.outputs.page_url }}
67+
68+
steps:
69+
- name: Deploy to GitHub Pages
70+
id: deployment
71+
uses: actions/deploy-pages@v4

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"cli": "node packages/cli/dist/cli.js",
3636
"objectui": "node packages/cli/dist/cli.js",
3737
"create-plugin": "node packages/create-plugin/dist/index.js",
38+
"docs:api": "typedoc",
3839
"storybook": "storybook dev -p 6006",
3940
"storybook:build": "storybook build",
4041
"storybook:test": "test-storybook --testTimeout=90000",
@@ -120,6 +121,8 @@
120121
"tslib": "^2.6.0",
121122
"tsx": "^4.21.0",
122123
"turbo": "^2.8.3",
124+
"typedoc": "^0.28.16",
125+
"typedoc-plugin-markdown": "^4.10.0",
123126
"typescript": "^5.9.3",
124127
"typescript-eslint": "^8.53.1",
125128
"vite-plugin-compression2": "^2.4.0",
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
import { Meta } from '@storybook/blocks';
2+
3+
<Meta title="Getting Started" />
4+
5+
# ObjectUI Component Library
6+
7+
ObjectUI is a **server-driven UI engine** that renders enterprise interfaces from JSON metadata.
8+
Built on **React**, **Tailwind CSS**, and **Shadcn UI (Radix)**, it bridges the speed of
9+
low-code with the design quality of hand-crafted components.
10+
11+
## Installation
12+
13+
```bash
14+
# Core packages
15+
pnpm add @object-ui/types @object-ui/core @object-ui/react
16+
17+
# UI layer
18+
pnpm add @object-ui/components @object-ui/fields @object-ui/layout
19+
```
20+
21+
Peer dependencies — make sure these are in your project:
22+
23+
```bash
24+
pnpm add react react-dom tailwindcss
25+
```
26+
27+
## Quick Usage
28+
29+
```tsx
30+
import { ObjectRenderer } from '@object-ui/react';
31+
32+
const schema = {
33+
type: 'Card',
34+
props: { title: 'Hello' },
35+
children: [
36+
{
37+
type: 'Text',
38+
props: { content: 'Rendered from JSON!' },
39+
},
40+
],
41+
};
42+
43+
export default function App() {
44+
return <ObjectRenderer schema={schema} />;
45+
}
46+
```
47+
48+
The `ObjectRenderer` resolves each node in the schema tree against the **Component Registry**,
49+
producing a fully interactive React tree.
50+
51+
## Accessibility
52+
53+
Every component in ObjectUI follows the **WAI-ARIA** authoring practices provided by
54+
[Radix UI](https://www.radix-ui.com/). This means:
55+
56+
- Correct ARIA roles and attributes out of the box
57+
- Full keyboard navigation support
58+
- Focus management for overlays, dialogs, and menus
59+
- Screen-reader-friendly labels and live regions
60+
61+
Run the Storybook accessibility addon (included) to audit any story for violations.
62+
63+
## Theme Configuration
64+
65+
ObjectUI uses Tailwind CSS for styling. Customise the design tokens through your
66+
`tailwind.config` and CSS variables:
67+
68+
```css
69+
@layer base {
70+
:root {
71+
--background: 0 0% 100%;
72+
--foreground: 222 84% 5%;
73+
--primary: 222 47% 11%;
74+
--primary-foreground: 210 40% 98%;
75+
/* ...other tokens */
76+
}
77+
}
78+
```
79+
80+
All Shadcn-based components pick up these tokens automatically — no prop drilling required.
81+
82+
## Explore
83+
84+
Use the sidebar to browse every component. Each story shows:
85+
86+
- **Live preview** — interact directly in the canvas
87+
- **Controls** — tweak props in real time
88+
- **Docs** — auto-generated API tables (when tagged with `autodocs`)
89+
- **Accessibility** — axe audit panel

0 commit comments

Comments
 (0)