Skip to content

Built-in templates: ten ready-made templates inside the binary - #4

Merged
kajvans merged 1 commit into
mainfrom
feat/builtin-templates
Oct 16, 2026
Merged

kajvans merged 1 commit into
mainfrom
feat/builtin-templates

Conversation

@kajvans

@kajvans kajvans commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

What

Foundry now ships with ten built-in templates, embedded in the binary, so foundry new works right after installing (apt, go install or an archive).

go-basic, go-http, node-basic, node-http, typescript-basic, python-basic, python-http, rust-basic, static-site, blank.

  • foundry new my-api --language Go uses the built-in template of that language when no default is set.
  • foundry template list shows built-in and saved templates (--builtin, --saved); a saved template hides a built-in one with the same name.
  • foundry template export <name> <folder> copies a built-in template so it can be changed and saved.
  • Built-in templates can be the default of a language (foundry config Go go-http).
  • They cannot be edited or removed; the error says how to make a copy.
  • The old examples/ became built-in templates.

How it is tested

  • Go tests: every template is planned with --dry-run and must have no placeholder without a value; creation, export, defaults, shadowing and the error cases.
  • scripts/test-templates.sh creates a project from every template with the real binary and runs that language's own build and tests (Go, Node, TypeScript, Python, Rust). A new CI job runs it.
  • Two details found on the way: a directory with a go.mod cannot be embedded (templates keep go.mod.txt), and the template sources live under _builtin/ so the Go tools do not compile them as part of Foundry.

go-basic, go-http, node-basic, node-http, typescript-basic, python-basic, python-http,
rust-basic, static-site and blank. foundry new works right after installing, --language falls
back to the built-in default of that language, and template export copies one for editing.
A CI job builds a project from every template and runs its own tests.
@kajvans
kajvans merged commit 406abef into main Oct 16, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant