Skip to content
New issue

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

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

Already on GitHub? # to your account

Allow variables in typewriter.yml file, for instance to specify output dir #288

Open
tmf-chris opened this issue Feb 28, 2023 · 1 comment

Comments

@tmf-chris
Copy link

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:

  1. Allow passing of variables to the typewriter command, that are then available when the typewriter.yml file is being parsed or
  2. Allow piping in a typewriter.yml into the typewriter command (so no typewriter.yml file 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!

@silesky
Copy link
Contributor

silesky commented Apr 26, 2023

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.)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants