Currently, the npm backends renders the whole templates/installers/npm folder with the same context (that does NOT have a run field), which breaks "strict undefined behavior". As a result, the following bit was added in #1499:
{%- if bin is defined %}
run({{ bin }});
{%- endif %}
We should do the right thing instead, like... moving run.js.j2 outside of that directory, simply. So that we can render the npm skeleton dir/template, and then all the run.js files we need (per-binary) separately. That's out of scope for #1499 though, so I'm opening this to track a small follow-up.
Currently, the npm backends renders the whole
templates/installers/npm
folder with the same context (that does NOT have arun
field), which breaks "strict undefined behavior". As a result, the following bit was added in #1499:We should do the right thing instead, like... moving
run.js.j2
outside of that directory, simply. So that we can render the npm skeleton dir/template, and then all the run.js files we need (per-binary) separately. That's out of scope for #1499 though, so I'm opening this to track a small follow-up.