Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ __pycache__/
# ── Build outputs ────────────────────────────────────────
dist/
build/
bin/
bin/*
!bin/dot
out/
target/

*.class
*.o
*.a
Expand Down
Binary file added bin/dot
Binary file not shown.
64 changes: 32 additions & 32 deletions docs/contributor/generators/react_app.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ React + Vite application. Merges React dependencies and JSX compiler options int

## Identity

| Field | Value |
|-------|-------|
| Name | `react_app` |
| Version | `0.1.0` |
| Field | Value |
| ------- | ---------------------- |
| Name | `react_app` |
| Version | `0.2.0` |
| Package | `generators/react_app` |

---

## Dependencies

| Generator | Why |
|-----------|-----|
| Generator | Why |
| ----------------- | ---------------------------------------------------------------- |
| `typescript_base` | Requires `package.json` and `tsconfig.json` to exist for merging |

`base_project` is also in the chain via `typescript_base → base_project`.
Expand All @@ -26,56 +26,56 @@ React + Vite application. Merges React dependencies and JSX compiler options int

## Answers consumed

| Key | Type | Notes |
|-----|------|-------|
| Key | Type | Notes |
| -------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------- |
| `project_name` | string | Written as the `<title>` in `index.html` and the app heading in `src/App.tsx`. Falls back to `spec.Metadata.ProjectName`, then `"app"`. |

---

## Files written

| Path | Description |
|------|-------------|
| `index.html` | HTML entry point with `<div id="root">` and Vite script tag |
| `vite.config.ts` | Vite config with `@vitejs/plugin-react` |
| `src/main.tsx` | React DOM `createRoot` entry |
| `src/App.tsx` | Minimal `App` component returning a heading |
| Path | Description |
| ---------------- | ----------------------------------------------------------- |
| `index.html` | HTML entry point with `<div id="root">` and Vite script tag |
| `vite.config.ts` | Vite config with `@vitejs/plugin-react` |
| `src/main.tsx` | React DOM `createRoot` entry |
| `src/App.tsx` | Minimal `App` component returning a heading |

Also merges into existing files:

| Path | Keys added / updated |
|------|---------------------|
| `package.json` | `scripts.dev/build/preview`, `dependencies.react/react-dom`, `devDependencies.@types/react/react-dom/@vitejs/plugin-react/vite` |
| `tsconfig.json` | `compilerOptions.jsx = "react-jsx"`, `compilerOptions.lib` (adds DOM entries) |
| Path | Keys added / updated |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| `package.json` | `scripts.dev/build/preview`, `dependencies.react/react-dom`, `devDependencies.@types/react/react-dom/@vitejs/plugin-react/vite` |
| `tsconfig.json` | `compilerOptions.jsx = "react-jsx"`, `compilerOptions.lib` (adds DOM entries) |

---

## Validators

| Check | Type | Passes when |
|-------|------|-------------|
| `src/main.tsx` exists | `file_exists` | — |
| `src/App.tsx` exists | `file_exists` | — |
| `index.html` exists | `file_exists` | — |
| `vite.config.ts` exists | `file_exists` | — |
| Check | Type | Passes when |
| -------------------------------------- | ----------------- | -------------------- |
| `src/main.tsx` exists | `file_exists` | — |
| `src/App.tsx` exists | `file_exists` | — |
| `index.html` exists | `file_exists` | — |
| `vite.config.ts` exists | `file_exists` | — |
| `dependencies.react` in `package.json` | `json_key_exists` | React dep is present |

---

## Post-generation commands

| Command | WorkDir | Notes |
|---------|---------|-------|
| Command | WorkDir | Notes |
| -------------- | ------------ | ----------------------------------- |
| `pnpm install` | project root | Deduplicated with `typescript_base` |

## Test commands

| Command | Background | Ready delay | Notes |
|---------|-----------|-------------|-------|
| `pnpm install` | No | — | Deduplicated |
| `pnpm exec tsc --noEmit` | No | — | Type-check |
| `pnpm exec vite build` | No | — | Production build |
| `pnpm exec vite` | **Yes** | 4s | Smoke-start the dev server |
| Command | Background | Ready delay | Notes |
| ------------------------ | ---------- | ----------- | -------------------------- |
| `pnpm install` | No | — | Deduplicated |
| `pnpm exec tsc --noEmit` | No | — | Type-check |
| `pnpm exec vite build` | No | — | Production build |
| `pnpm exec vite` | **Yes** | 4s | Smoke-start the dev server |

---

Expand Down
2 changes: 1 addition & 1 deletion generators/react_app/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func (g *Generator) Generate(ctx *dotapi.Context) error {
"@types/react": "^18.3.0",
"@types/react-dom": "^18.3.0",
"@vitejs/plugin-react": "^4.3.0",
"vite": "^5.4.0",
"vite": "^8.0.14",
},
})
return nil
Expand Down
2 changes: 1 addition & 1 deletion generators/react_app/manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
// project needs the TypeScript foundation first.
var Manifest = dotapi.Manifest{
Name: "react_app",
Version: "0.1.0",
Version: "0.2.0",
Description: "React + Vite application setup",
DependsOn: []string{"typescript_base"},
Outputs: []string{
Expand Down
Loading