diff --git a/.gitignore b/.gitignore index b9906ed..9b4183a 100644 --- a/.gitignore +++ b/.gitignore @@ -17,9 +17,11 @@ __pycache__/ # ── Build outputs ──────────────────────────────────────── dist/ build/ -bin/ +bin/* +!bin/dot out/ target/ + *.class *.o *.a diff --git a/bin/dot b/bin/dot new file mode 100755 index 0000000..3450627 Binary files /dev/null and b/bin/dot differ diff --git a/docs/contributor/generators/react_app.md b/docs/contributor/generators/react_app.md index 5e36b4c..a163e47 100644 --- a/docs/contributor/generators/react_app.md +++ b/docs/contributor/generators/react_app.md @@ -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`. @@ -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 `` 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 | --- diff --git a/generators/react_app/generator.go b/generators/react_app/generator.go index 8a11165..f9f1d3a 100644 --- a/generators/react_app/generator.go +++ b/generators/react_app/generator.go @@ -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 diff --git a/generators/react_app/manifest.go b/generators/react_app/manifest.go index 153399c..6acd901 100644 --- a/generators/react_app/manifest.go +++ b/generators/react_app/manifest.go @@ -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{