Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update Refinery component templates' syntax #25

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

robbkidd
Copy link
Member

@robbkidd robbkidd commented Feb 5, 2025

https://app.asana.com/0/1208469935858869/1209310061786981

Which problem is this PR solving?

  • Syntax has changed some for component templates since some were written.

Short description of the changes

  • Update template syntax
  • Add tests

@kentquirk
Copy link
Contributor

I hope you don't mind a friendly commit. I guess I could have done it as a PR but as this is still a draft, I figured it would be OK.

What I've done is change it so that if a template emits something that looks like a list: [ x, y, z ], it will take it apart and store it as a slice. This means the YAML renderer will do the right thing.

I also changed the name and semantics of firstNonblank to firstNonZero, and made it so that if it's given a list, it uses the syntax above. I think this means that firstNonZero behaves the way we want it to even if the objects are lists instead of plain data.

But also, if we just generate a template that has square brackets around it, it will be emitted as a list when rendered to a config.

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.

2 participants