Skip to content

Templates can declare setup steps (.foundry.yaml) - #6

Merged
kajvans merged 1 commit into
mainfrom
feat/template-setup-steps
Oct 16, 2026
Merged

kajvans merged 1 commit into
mainfrom
feat/template-setup-steps

Conversation

@kajvans

@kajvans kajvans commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

What

Templates can now say what happens after a project was created from them, in a .foundry.yaml at the template root:

post:            # setup commands, run in the new project
  - pnpm install
next:            # hints printed at the end
  - pnpm dev
  • post replaces the language default (npm install for a pnpm project, for example); post: [] means no setup at all.
  • Placeholders such as {{PROJECT_NAME_KEBAB}} work in these lines.
  • Each line is one program with arguments, started directly: no shell, so &&, pipes, redirects and $VARS are refused and nothing from a refused line runs.
  • --no-post still skips everything.
  • The file is never copied into a project.
  • For a template fetched with --git the post commands are not run (a repository you just downloaded is not trusted to run commands); the next hints are still shown.

Why

Our own templates (Next.js with pnpm, an Express API, an npm package) need their own setup. This keeps that in the template instead of in Foundry.

Tested

Unit tests for parsing and command validation; CLI tests for running declared steps, refusing invalid lines, post: [], placeholders in hints, --no-post and the file not being copied. Six real templates were created with it and built and tested (typecheck, build, tests, Docker images and their health checks).

post replaces the language default (for example pnpm install instead of npm install), post: [] means no
setup, placeholders work in the lines, and the file is never copied. Commands have no shell and are not run
for templates fetched with --git.
@kajvans
kajvans merged commit 0699147 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