forked from moonrepo/moon
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new: Add variable interpolation support to templates. (moonrepo#303)
* Pull in tera. * Start on variables. * Test variables. * Add path interpolation. * Test rendering. * Rework path interpolation. * Update config docs. * More docs and var work. * Polish.
- Loading branch information
Showing
33 changed files
with
871 additions
and
100 deletions.
There are no files selected for viewing
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
16 changes: 16 additions & 0 deletions
16
crates/cli/tests/snapshots/generate_test__interpolates_destination_path.snap
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
source: crates/cli/tests/generate_test.rs | ||
assertion_line: 143 | ||
expression: get_path_safe_output(&assert) | ||
--- | ||
|
||
Variable testing | ||
A template for testing all variable config combinations. | ||
|
||
|
||
created --> ./test/control.txt | ||
created --> ./test/expressions.txt | ||
created --> ./test/file-default-0.txt | ||
|
||
|
||
|
16 changes: 16 additions & 0 deletions
16
.../cli/tests/snapshots/generate_test__overwrites_existing_files_when_interpolated_path.snap
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
source: crates/cli/tests/generate_test.rs | ||
assertion_line: 108 | ||
expression: get_path_safe_output(&assert) | ||
--- | ||
|
||
Variable testing | ||
A template for testing all variable config combinations. | ||
|
||
|
||
replaced -> ./test/control.txt | ||
replaced -> ./test/expressions.txt | ||
replaced -> ./test/file-default-0.txt | ||
|
||
|
||
|
23 changes: 23 additions & 0 deletions
23
crates/cli/tests/snapshots/generate_test__renders_and_interpolates_templates-2.snap
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
source: crates/cli/tests/generate_test.rs | ||
assertion_line: 103 | ||
expression: "fs::read_to_string(fixture.path().join(\"./test/control.txt\")).unwrap()" | ||
--- | ||
|
||
Should show | ||
|
||
|
||
Looping multenum: | ||
|
||
1. b | ||
|
||
|
||
Including partial: | ||
THIS WAS INCLUDED | ||
|
||
|
||
Filters: | ||
DEFAULT | ||
246 | ||
1 | ||
|
Oops, something went wrong.