rules_nodejs
rules_nodejs copied to clipboard
Generated macros for npm package bin should trigger `npm_package_bin` if `stdout` is used
🚀 feature request
Relevant Rules
Any generated macro for npm packages with bin entries.
Description
I am using emscripten-library-generator, which has a bin that writes to stdout (and no option to write somewhere else). I would like to write:
load("@npm//emscripten-library-generator:index.bzl", "emscripten_library_generator")
emscripten_library_generator(
name = "gen",
...
stdout = "library.js",
)
This currently triggers:
ERROR: [snip path]: //:gen: no such attribute 'stdout' in 'nodejs_binary' rule
Describe the solution you'd like
If one of the generated macros is used with the stdout attribute, it should use npm_package_bin rather than nodejs_binary.
Describe alternatives you've considered
Revert to using genrule.