Expand description
Per-instance values substituted into a file the project commits.
Ports reach a command as {{ports.x}} and as an env var. Most tools do
not take them that way: Supabase reads supabase/config.toml, Expo reads
.env, Compose reads compose.yaml. Without this, every project that
hits it writes the same config rewriter inside its prepare hook.
There is no template file. port = 54321 is not a placeholder, it is the
project’s working default — a clone without newgit still starts on it.
newgit substitutes into the committed content and writes the result into
one workspace. See Render in newgit-v1-mvp.md.
Structs§
- Applied
Replacement - A replacement with its template already rendered, so the inverse is exact.
- Render
Record - What a render actually did, recorded on the binding record so capture can reverse it without re-deriving the values from a definition that may have been edited since.
- Render
Spec - One file a resource renders per-instance values into.
- Replacement
- A literal substitution.
findis never a regex: a pattern language reintroduces the “did it match what I meant” doubt thatReplacement::countexists to remove, and it would leave the inverse undefined.
Functions§
- apply
- Substitute into
committed, the file’s committed content — never what is currently on disk. - reverse
- Undo a render: rewrite this instance’s values back to the committed ones.
- substitute
- Apply already-resolved replacements as one simultaneous batch, enforcing each rule’s declared match count against the input.
- validate_
disjoint - Two resources rendering the same path is a config error, not a merge: they would race, and the second would render over the first’s output and fail its own match check for reasons nothing in the definition explains.