Repository navigation
Templates can declare setup steps (.foundry.yaml) - #6
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Templates can now say what happens after a project was created from them, in a
.foundry.yamlat the template root:postreplaces the language default (npm installfor a pnpm project, for example);post: []means no setup at all.{{PROJECT_NAME_KEBAB}}work in these lines.&&, pipes, redirects and$VARSare refused and nothing from a refused line runs.--no-poststill skips everything.--gitthepostcommands are not run (a repository you just downloaded is not trusted to run commands); thenexthints 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-postand 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).