diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..5e85614 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Keep embedded template contents identical across build platforms. +templates/** text=auto eol=lf diff --git a/CHANGELOG.md b/CHANGELOG.md index 64e7d9c..e718387 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## Unreleased + +- Deliver all templates as embedded source files and restore `.tmpl` filenames during generation. +- Remove template ZIP packaging, downloads, external registries, and cache commands. +- Resolve template version checks and upgrade reports from the bundled registry only. + ## 1.2.0 - 2026-08-30 - Remove checked-in build artifacts and an orphan generated application file. diff --git a/README.md b/README.md index 9dd30b9..e7de5e3 100644 --- a/README.md +++ b/README.md @@ -4,13 +4,11 @@ Foundry is a single Go CLI for creating and extending projects from reusable fou ## Highlights -- external, versioned template registry support -- SHA-256 verified template ZIP downloads -- local template cache and offline generation -- `foundry template update` / `foundry template list` +- Go and Flutter templates bundled directly as source files in one executable +- offline project generation with no template downloads or packaging step +- `foundry template list` to inspect the bundled templates - `foundry add service` and `foundry add migration` for Go projects - `foundry add feature` and `foundry add package` for Flutter workspaces -- bundled templates remain available without a registry or network connection ## Bundled templates @@ -75,20 +73,7 @@ foundry new mediguide \ --org ug.go.health ``` -Select an external/cached version: - -```bash -foundry new users-service \ - --template go \ - --version 1.2.0 \ - --module github.com/your-org/users-service -``` - -Force offline operation: - -```bash -foundry new users-service --template go --version 1.2.0 --offline -``` +Both templates are available offline. Optional generation hooks may invoke installed SDKs and their package managers; use `--no-hooks` to skip them. ## Extend an existing project @@ -112,68 +97,20 @@ foundry add package foundation_analytics A Flutter feature is created as a small clean slice with `domain`, `application`, `data`, and `presentation` directories. -## External template registry - -Foundry does not require a registry. The built-in templates always remain available. A registry lets templates evolve independently from the Foundry binary. +## Template delivery -Configure it once: +All templates are maintained under `templates/` and embedded directly into the Foundry executable. Generation copies their files, restores template filenames, and substitutes project settings. -```bash -export FOUNDRY_REGISTRY_URL="https://raw.githubusercontent.com/your-org/foundry-templates/main/registry.json" -foundry template update -foundry template list -``` +| Template | Source folder | Delivery | +| --- | --- | --- | +| Go Foundations | `templates/go-foundations/` | Embedded source files | +| Flutter Foundations | `templates/flutter_foundations/` | Embedded source files | -or provide the URL explicitly: +Go source files use `.go.tmpl` and its module manifest uses `go.mod.tmpl` to keep the template separate from Foundry's Go module. Generated projects receive ordinary `.go` files and `go.mod`. -```bash -foundry template update --registry https://example.org/foundry/registry.json -``` - -Registry format: - -```json -{ - "schema": 1, - "updated_at": "2026-08-14T12:00:00Z", - "templates": [ - { - "id": "go-foundations", - "name": "Go Foundations", - "version": "1.2.0", - "description": "Production Go gRPC foundation", - "kind": "go", - "aliases": ["go", "grpc", "backend"], - "url": "https://github.com/your-org/foundry-templates/releases/download/go-foundations-v1.2.0/go-foundations.zip", - "sha256": "" - } - ] -} -``` +Template changes ship with a new Foundry build/release. There is no external template registry, template archive download, or template cache. `foundry template list` shows the available versions; `--version` can assert the bundled version but cannot select an external release. -The `url` can be a GitHub Release asset or any direct HTTP(S) ZIP. Foundry verifies the downloaded archive against `sha256` before adding it to the cache. - -Cache layout is platform-specific under the operating system's standard user-cache directory: - -```text -foundry/ -├── registry.json -└── templates/ - └── go-foundations/ - └── 1.2.0/ - └── template.zip -``` - -Set `FOUNDRY_CACHE_DIR` to use an explicit cache location, which is useful in -CI, containers, and other isolated environments. - -Once downloaded: - -```bash -foundry new demo --template go --version 1.2.0 --offline -``` - -works without a network connection. +To update a template, edit its source files and rebuild Foundry with `make build`. ## Commands @@ -185,12 +122,9 @@ foundry add migration foundry add feature foundry add package foundry template list -foundry template update --registry foundry list foundry info