Skip to content

Commit 5ddabe9

Browse files
committed
refactor: move Next.js app to apps/www/ in monorepo
Move the Next.js documentation site into apps/www/ to create a cleaner monorepo structure with apps/* and packages/* workspaces. Root package.json now delegates all scripts to the app via pnpm --filter tool-ui-www.
1 parent daffbd4 commit 5ddabe9

File tree

783 files changed

+901
-1082
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

783 files changed

+901
-1082
lines changed

.claude/agents/tool-ui-designer.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ You design new Tool UI components for this repo.
1616
## Context
1717

1818
Tool UI is a copy/paste component library for AI assistant interfaces.
19-
The product is the source code inside `components/tool-ui/*`, so APIs must be explicit and easy to modify.
19+
The product is the source code inside `apps/www/components/tool-ui/*`, so APIs must be explicit and easy to modify.
2020

2121
## Process
2222

@@ -40,12 +40,12 @@ Ask deeper questions only when needed:
4040
### 3. Pattern Exploration
4141

4242
Before finalizing, inspect current patterns:
43-
- `components/tool-ui/*` similar components
44-
- `components/tool-ui/shared/schema.ts`
45-
- `components/tool-ui/shared/contract.ts`
46-
- `components/tool-ui/shared/actions-config.ts`
47-
- `components/tool-ui/shared/action-buttons.tsx`
48-
- `components/tool-ui/option-list/*` and `components/tool-ui/plan/*`
43+
- `apps/www/components/tool-ui/*` similar components
44+
- `apps/www/components/tool-ui/shared/schema.ts`
45+
- `apps/www/components/tool-ui/shared/contract.ts`
46+
- `apps/www/components/tool-ui/shared/actions-config.ts`
47+
- `apps/www/components/tool-ui/shared/action-buttons.tsx`
48+
- `apps/www/components/tool-ui/option-list/*` and `apps/www/components/tool-ui/plan/*`
4949

5050
### 4. Produce Design Spec
5151

.claude/agents/tool-ui-documenter.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@ You document new components and wire them into docs/examples surfaces.
1818
You receive:
1919
- component slug + label
2020
- implemented component + schema
21-
- presets from `lib/presets/<slug>.ts`
21+
- presets from `apps/www/lib/presets/<slug>.ts`
2222

2323
## Required Work
2424

2525
### 1. Create docs page files
2626

2727
Create/update:
28-
- `app/docs/<slug>/page.tsx`
29-
- `app/docs/<slug>/content.mdx`
30-
- `app/docs/<slug>/opengraph-image.tsx`
28+
- `apps/www/app/docs/<slug>/page.tsx`
29+
- `apps/www/app/docs/<slug>/content.mdx`
30+
- `apps/www/app/docs/<slug>/opengraph-image.tsx`
3131

3232
Rules:
3333
- `page.tsx` must use `ComponentDocsTabs`
@@ -38,14 +38,14 @@ Rules:
3838
### 2. Register docs metadata + previews
3939

4040
Update all of:
41-
- `lib/docs/component-registry.ts`
42-
- `lib/docs/preview-config.tsx`
43-
- `app/docs/_components/preset-selector.tsx`
41+
- `apps/www/lib/docs/component-registry.ts`
42+
- `apps/www/lib/docs/preview-config.tsx`
43+
- `apps/www/app/docs/_components/preset-selector.tsx`
4444

4545
### 3. Keep docs aligned with maintainer contracts
4646

4747
Document:
48-
- source/install paths in `components/tool-ui/<slug>`
48+
- source/install paths in `apps/www/components/tool-ui/<slug>`
4949
- serializable contract + parse helpers
5050
- action + receipt behavior (use `choice` terminology)
5151
- accessibility notes for interaction-heavy components

.claude/agents/tool-ui-examples.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ You receive:
2424

2525
### 1. Create Presets
2626

27-
Create `lib/presets/<slug>.ts` with 4-5 presets.
27+
Create `apps/www/lib/presets/<slug>.ts` with 4-5 presets.
2828

2929
Requirements:
3030
- use believable, specific scenarios
@@ -35,11 +35,11 @@ Requirements:
3535

3636
### 2. Gallery Entry
3737

38-
Update `app/docs/gallery/page.tsx` with the most representative visual preset when appropriate.
38+
Update `apps/www/app/docs/gallery/page.tsx` with the most representative visual preset when appropriate.
3939

4040
### 3. Landing Showcase (Optional)
4141

42-
Update `app/components/home/chat-showcase.tsx` only if the component is visually distinctive and improves landing clarity.
42+
Update `apps/www/app/components/home/chat-showcase.tsx` only if the component is visually distinctive and improves landing clarity.
4343

4444
## Preset Quality Bar
4545

.claude/agents/tool-ui-implementer.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Then extend scaffolded files instead of creating ad-hoc structure.
4141

4242
### 2. Component Directory Contract
4343

44-
Ensure `components/tool-ui/<slug>/` includes:
44+
Ensure `apps/www/components/tool-ui/<slug>/` includes:
4545
- `_adapter.tsx`
4646
- `schema.ts`
4747
- `<slug>.tsx`
@@ -78,12 +78,12 @@ Rules:
7878

7979
- Use `createToolUiErrorBoundary` from `../shared/error-boundary`
8080
- Export component, error boundary, schema, parse/safeParse helpers, and types
81-
- Update aggregate exports in `components/tool-ui/index.ts`
81+
- Update aggregate exports in `apps/www/components/tool-ui/index.ts`
8282

8383
### 6. Tests for Non-Trivial Behavior
8484

8585
For logic-heavy behavior, add focused tests in:
86-
- `lib/tests/tool-ui/<slug>/...`
86+
- `apps/www/lib/tests/tool-ui/<slug>/...`
8787

8888
Good candidates:
8989
- deterministic ids/keys
@@ -93,11 +93,11 @@ Good candidates:
9393

9494
## Reference Files
9595

96-
- `components/tool-ui/option-list/*`
97-
- `components/tool-ui/plan/*`
98-
- `components/tool-ui/message-draft/*`
99-
- `components/tool-ui/shared/*`
100-
- `scripts/new-tool-ui-component.ts`
96+
- `apps/www/components/tool-ui/option-list/*`
97+
- `apps/www/components/tool-ui/plan/*`
98+
- `apps/www/components/tool-ui/message-draft/*`
99+
- `apps/www/components/tool-ui/shared/*`
100+
- `apps/www/scripts/new-tool-ui-component.ts`
101101

102102
## Final Checklist
103103

.claude/agents/tool-ui-reviewer.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ You are the final quality gate before completion.
1717
## Input
1818

1919
Review the full component integration:
20-
- `components/tool-ui/<slug>/`
21-
- `lib/presets/<slug>.ts`
22-
- `app/docs/<slug>/`
20+
- `apps/www/components/tool-ui/<slug>/`
21+
- `apps/www/lib/presets/<slug>.ts`
22+
- `apps/www/app/docs/<slug>/`
2323
- docs/preview registry wiring files
2424

2525
## Phase 1: Hard Gates (Blocking)
@@ -46,18 +46,18 @@ Verify component directory contains:
4646
- `README.md`
4747

4848
Verify docs + preset exist:
49-
- `lib/presets/<slug>.ts`
50-
- `app/docs/<slug>/page.tsx`
51-
- `app/docs/<slug>/content.mdx`
52-
- `app/docs/<slug>/opengraph-image.tsx`
49+
- `apps/www/lib/presets/<slug>.ts`
50+
- `apps/www/app/docs/<slug>/page.tsx`
51+
- `apps/www/app/docs/<slug>/content.mdx`
52+
- `apps/www/app/docs/<slug>/opengraph-image.tsx`
5353

5454
## Phase 3: Wiring Checks (Blocking)
5555

5656
Verify all registration points:
57-
- `lib/docs/component-registry.ts`
58-
- `lib/docs/preview-config.tsx`
59-
- `app/docs/_components/preset-selector.tsx`
60-
- `app/docs/<slug>/page.tsx` uses `ComponentDocsTabs`
57+
- `apps/www/lib/docs/component-registry.ts`
58+
- `apps/www/lib/docs/preview-config.tsx`
59+
- `apps/www/app/docs/_components/preset-selector.tsx`
60+
- `apps/www/app/docs/<slug>/page.tsx` uses `ComponentDocsTabs`
6161

6262
## Phase 4: Contract/Pattern Checks (Warnings unless severe)
6363

@@ -67,7 +67,7 @@ Check for:
6767
- receipt semantics use `choice` (not `confirmed`/`decision`)
6868
- deterministic id/key behavior for non-trivial interactions
6969
- direct shared imports in component logic (avoid `../shared` barrel imports)
70-
- meaningful tests in `lib/tests/tool-ui/<slug>/` when behavior is non-trivial
70+
- meaningful tests in `apps/www/lib/tests/tool-ui/<slug>/` when behavior is non-trivial
7171

7272
## Output Format
7373

.claude/commands/component.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Create new React component
55
Create a new component: $ARGUMENTS
66

77
Follow project patterns:
8-
- **Location**: `app/components/` (or specify subdirectory)
8+
- **Location**: `apps/www/app/components/` (or specify subdirectory)
99
- **Style**: Functional component with TypeScript
1010
- **Props**: Properly typed interface
1111
- **Styling**: Tailwind CSS classes
@@ -20,4 +20,4 @@ Include:
2020
4. Responsive design considerations
2121
5. Error boundaries if needed
2222

23-
Check `app/components/` for similar patterns to follow.
23+
Check `apps/www/app/components/` for similar patterns to follow.

.claude/commands/generate-tool-ui.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Implementation must follow current repo contracts:
3939
- schema contract via `defineToolUiContract` + `parseSerializableX` + `safeParseSerializableX`
4040
- receipt prop is `choice` (never `confirmed` / `decision`)
4141
- maintain component directory file contract (including `README.md`)
42-
- update aggregate exports in `components/tool-ui/index.ts`
42+
- update aggregate exports in `apps/www/components/tool-ui/index.ts`
4343

4444
### 3. Examples + Docs (Parallel)
4545

@@ -70,10 +70,10 @@ The documenter/reviewer must ensure all of these are wired:
7070

7171
| File | Purpose |
7272
|------|---------|
73-
| `lib/docs/component-registry.ts` | Component metadata + docs nav categorization |
74-
| `lib/docs/preview-config.tsx` | Interactive preview config + `ComponentId` coverage |
75-
| `app/docs/_components/preset-selector.tsx` | Examples tab preset mapping |
76-
| `app/docs/{name}/page.tsx` | `ComponentDocsTabs` docs/examples surface |
73+
| `apps/www/lib/docs/component-registry.ts` | Component metadata + docs nav categorization |
74+
| `apps/www/lib/docs/preview-config.tsx` | Interactive preview config + `ComponentId` coverage |
75+
| `apps/www/app/docs/_components/preset-selector.tsx` | Examples tab preset mapping |
76+
| `apps/www/app/docs/{name}/page.tsx` | `ComponentDocsTabs` docs/examples surface |
7777

7878
## Notes
7979

.claude/docs/component-workflow.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,32 @@ Procedures for common component operations in Tool UI.
44

55
## Adding a New Component
66

7-
1. Create `components/tool-ui/{name}/` with standard files:
7+
1. Create `apps/www/components/tool-ui/{name}/` with standard files:
88
- `index.tsx` (barrel exports)
99
- `{name}.tsx` (main component)
1010
- `schema.ts` (Zod schema + types)
1111
- `_adapter.tsx` (shadcn re-exports)
1212
- `error-boundary.tsx`
1313

14-
2. Create `lib/presets/{name}.ts` with 4-5 example presets
14+
2. Create `apps/www/lib/presets/{name}.ts` with 4-5 example presets
1515

16-
3. Add to `lib/docs/component-registry.ts`
16+
3. Add to `apps/www/lib/docs/component-registry.ts`
1717

18-
4. Add to `lib/docs/preview-config.tsx`
18+
4. Add to `apps/www/lib/docs/preview-config.tsx`
1919

2020
5. Create doc page:
21-
- `app/docs/{name}/page.tsx`
22-
- `app/docs/{name}/content.mdx`
23-
- `app/docs/{name}/opengraph-image.tsx`
21+
- `apps/www/app/docs/{name}/page.tsx`
22+
- `apps/www/app/docs/{name}/content.mdx`
23+
- `apps/www/app/docs/{name}/opengraph-image.tsx`
2424

25-
6. Add to `app/docs/gallery/page.tsx`
25+
6. Add to `apps/www/app/docs/gallery/page.tsx`
2626

2727
## Renaming a Preset
2828

29-
1. Update type in `lib/presets/{component}.ts`
29+
1. Update type in `apps/www/lib/presets/{component}.ts`
3030
2. Update object key in same file
3131
3. `grep` for old name across codebase
32-
4. Update `defaultPreset` in `preview-config.tsx` if needed
32+
4. Update `defaultPreset` in `apps/www/lib/docs/preview-config.tsx` if needed
3333
5. Update `content.mdx` and `gallery/page.tsx` references
3434

3535
## Preset Guidelines

.claude/docs/mdx-authoring.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# MDX Authoring
22

3-
Guide for writing doc pages in Tool UI (`app/docs/{component}/content.mdx`).
3+
Guide for writing doc pages in Tool UI (`apps/www/app/docs/{component}/content.mdx`).
44

55
## Configuration
66

7-
MDX is configured in `next.config.ts:14` with `@next/mdx` and `remark-gfm`.
7+
MDX is configured in `apps/www/next.config.ts:14` with `@next/mdx` and `remark-gfm`.
88

99
**Turbopack limitation:** Plugins must be strings (`"remark-gfm"`) not function imports. Turbopack requires serializable config.
1010

@@ -22,7 +22,7 @@ Standard markdown table syntax works:
2222

2323
### Custom Components
2424

25-
Available via `mdx-components.tsx`:
25+
Available via `apps/www/mdx-components.tsx`:
2626

2727
- `TypeTable` - Props documentation
2828
- `Files`, `Folder`, `File` - Directory trees
@@ -43,7 +43,7 @@ Content wraps in `.prose` class from `docs-content.tsx`. Use `not-prose` class t
4343

4444
### Auto-linking
4545

46-
Tool UI component names in text auto-link to their docs pages. Configured in `lib/mdx/with-auto-link.ts`.
46+
Tool UI component names in text auto-link to their docs pages. Configured in `apps/www/lib/mdx/with-auto-link.ts`.
4747

4848
## Page Structure
4949

@@ -53,4 +53,4 @@ Each doc page needs:
5353
2. `content.mdx` - The actual documentation
5454
3. `opengraph-image.tsx` - OG image generation
5555

56-
See `app/docs/approval-card/` for reference implementation.
56+
See `apps/www/app/docs/approval-card/` for reference implementation.

.claude/docs/operations.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22

33
## Adding a New Component
44

5-
1. Create `components/tool-ui/{name}/` with standard files
6-
2. Create `lib/presets/{name}.ts`
7-
3. Add to `lib/docs/component-registry.ts`
8-
4. Add to `lib/docs/preview-config.tsx`
9-
5. Create `app/docs/{name}/page.tsx` and `content.mdx`
10-
6. Create `app/docs/{name}/opengraph-image.tsx`
11-
7. Add to `app/docs/gallery/page.tsx`
5+
1. Create `apps/www/components/tool-ui/{name}/` with standard files
6+
2. Create `apps/www/lib/presets/{name}.ts`
7+
3. Add to `apps/www/lib/docs/component-registry.ts`
8+
4. Add to `apps/www/lib/docs/preview-config.tsx`
9+
5. Create `apps/www/app/docs/{name}/page.tsx` and `content.mdx`
10+
6. Create `apps/www/app/docs/{name}/opengraph-image.tsx`
11+
7. Add to `apps/www/app/docs/gallery/page.tsx`
1212

1313
## Renaming a Preset
1414

15-
1. Update type in `lib/presets/{component}.ts`
15+
1. Update type in `apps/www/lib/presets/{component}.ts`
1616
2. Update object key
1717
3. `grep` for old name across codebase
18-
4. Update `defaultPreset` in `preview-config.tsx` if needed
18+
4. Update `defaultPreset` in `apps/www/lib/docs/preview-config.tsx` if needed
1919
5. Update `content.mdx` and `gallery/page.tsx` references

0 commit comments

Comments
 (0)