Allow variables in typewriter.yml file, for instance to specify output dir
Typewriter requires a typewriter.yml file to be present when running a tracking plans update. However, this is static and I would like to be able to use variables in the yml file (for instance to be able to specify folders in which my output should be placed as well as customize some scripts->after behaviours).
Feature request:
- Allow passing of variables to the typewriter command, that are then available when the
typewriter.ymlfile is being parsed or - Allow piping in a
typewriter.ymlinto the typewriter command (so notypewriter.ymlfile needed on disk necessarily) - in this way I can inject variables with values myself before running typewriter.
A workaround (I think) is in the scripts->after section I can move files from a local output dir into the output dir of my choice.
Example:
I have a variable called DEST which is my output dir. I would like to supply this when parsing the typewriter file somehow:
scripts:
after: prettier --write {{DEST}}
client:
...
trackingPlans:
- id: ...
path: {{DEST}}/plan1
- id: ...
path: {{DEST}}/plan2
Thank you team for an awesome tool!
It might make more sense to allow typewriter to use a js or ts file as config. You could also generate the yaml file dynamically on your end (as a stop gap.)