diff --git a/README.md b/README.md index 3e7fb4e..46065bc 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,20 @@ go build -trimpath -o foundry.exe ./cmd/foundry .\foundry.exe version ``` +## Command categories and workspaces + +| Category | Commands | Where to run | +| --- | --- | --- | +| Discover | `help`, `list`, `template list`, `info`, `doctor`, `version` | Any directory | +| Create | `foundry`, `new` | Parent folder of the new project; or specify `--destination` | +| Extend Go | `add service`, `repository`, `usecase`, `proto`, `migration` | Generated Go root, or select it with `--project` | +| Extend Flutter | `add feature`, `add package`, `mason` | Generated Flutter workspace root; `add` accepts `--project` | +| Maintain | `upgrade --check` | Any generated root, or select it with `--project` | +| Develop and validate | Make, Melos, npm, Cargo | The relevant generated workspace root | +| Contribute and release Foundry | Root `make` targets and release scripts | Foundry's own repository | + +Start with the [workspace guide](docs/workspaces.md) for the support matrix and end-to-end examples for Go, Flutter, Vanilla JS, React, and Rust. Use the [command reference](docs/commands.md) for flags, scripts, prerequisites, outputs, and side effects. `foundry help` shows the same CLI categories. + ## Create projects Interactive: diff --git a/docs/commands.md b/docs/commands.md index 899f2e1..6c375d9 100644 --- a/docs/commands.md +++ b/docs/commands.md @@ -2,6 +2,20 @@ This guide covers the Foundry executable, development of Foundry itself, and commands inside generated projects. Run `foundry help` for CLI syntax, `make help` in either Make-based project for targets, and a shell script with `--help` for its inputs. Rust's PowerShell script uses `-Help`. +## Choose a command category + +The [workspace guide](workspaces.md) explains which commands apply to each workspace and gives creation-to-validation recipes. This page is the detailed reference. + +| Category | Scope | Reference | +| --- | --- | --- | +| Discovery | Any directory: help, templates, version, tool availability | [Inspect and generate](#inspect-and-generate) | +| Creation | Parent folder: interactive generation or `new` | [Creation flags and delivery](#inspect-and-generate) | +| Go scaffolding | Generated Go root: service, repository, use case, proto, migration | [Extend a project](#extend-a-project) | +| Flutter scaffolding | Workspace root: feature, package, Mason bricks | [Extend a project](#extend-a-project) | +| Maintenance | Generated roots: read-only template version comparison | [Maintenance and errors](#maintenance-and-errors) | +| Workspace development | Native tools for setup, run, format, lint, test, build, clean | Sections 5–8 below | +| Foundry development and distribution | This repository's Make targets, smoke tests, executable release archives | [Develop and release Foundry](#4-develop-and-release-foundry) | + ## 1. Shared command meanings Use each ecosystem's native command. The names differ where the ecosystem already has a standard; their responsibilities are consistent. diff --git a/docs/workspaces.md b/docs/workspaces.md new file mode 100644 index 0000000..c87538f --- /dev/null +++ b/docs/workspaces.md @@ -0,0 +1,187 @@ +# Commands by workspace + +Use Foundry to create projects, add supported scaffolds, and inspect template versions. Use each generated project's native tools to install dependencies, run the application, validate changes, and build outputs. Foundry does not provide `run`, `test`, `build`, or `deploy` subcommands. + +## Identify your workspace + +| Workspace | Root markers | Scope | +| --- | --- | --- | +| Foundry source repository | `assets.go`, `cmd/foundry/`, `templates/` | Develop the generator and embedded templates; produce the Foundry executable | +| Generated Go | `.foundry.yaml`, `go.mod`, `cmd/server/`, `Makefile` | One backend application | +| Generated Flutter | `.foundry.yaml`, root `pubspec.yaml` with `workspace:`, `apps/`, `packages/`, `mason.yaml` | Multiple apps and shared packages managed together | +| Generated Vanilla JS | `.foundry.yaml`, `package.json`, `src/main.js` | One Vite browser application | +| Generated React | `.foundry.yaml`, `package.json`, `src/main.jsx` | One React/Vite browser application | +| Generated Rust | `.foundry.yaml`, `Cargo.toml`, `rust-toolchain.toml` | One application package with a library and executable; not yet a multi-crate Cargo workspace | + +The source folders under Foundry's `templates/` are inputs to generation. Generate a project into a separate directory before running its development workflow. In particular, Go templates still have `.tmpl` suffixes and Rust contains crate-name tokens. + +Generated `.foundry.yaml` records the template ID/version and project settings. Keep it for `foundry upgrade --check`. It does not select a directory automatically or make Foundry search ancestor folders. Run commands at the appropriate root, or use `--project` where supported. Paths are relative to your current directory. + +## Foundry command categories + +| Category | Commands | Working directory and effect | +| --- | --- | --- | +| Discovery | `foundry help`, `foundry list`, `foundry template list`, `foundry info