Question: is it possible to generate BUILD files for a Yarn workspaces project?
I like using Bazel but I find it a pain that I have to maintain a duplicate list of the same dependencies:
- one in
package.json - one in
BUILD.bazel
Is there a more ergonomic way of working? Can Bazel read dependencies (and perhaps also other data sources) directly from the package.json and tsconfig files?
The typical way for bazel BUILD files to reflect contents of other files in the repo is with a bazel-gazelle extension. https://github.com/bazelbuild/bazel-gazelle#supported-languages
However that's quite a bit of work for something simple like keeping two lists in sync. Maybe you can just write a small script to compare/correct them and run that as part of your CI?
Note, there's pnpm workspaces support in https://github.com/aspect-build/rules_js/ and I'm planning to write a gazelle extension to keep package.json files in-sync with the js_package rules used by that ruleset.
This issue has been automatically marked as stale because it has not had any activity for 6 months. It will be closed if no further activity occurs in 30 days. Collaborators can add a "cleanup" or "need: discussion" label to keep it open indefinitely. Thanks for your contributions to rules_nodejs!
This issue was automatically closed because it went 30 days without any activity since it was labeled "Can Close?"