rules_nodejs icon indicating copy to clipboard operation
rules_nodejs copied to clipboard

feat(examples): use protobufjs with multiple proto targets

Open Katee opened this issue 3 years ago • 0 comments

PR Checklist

Please check if your PR fulfills the following requirements:

  • [x] Tests for the changes have been added (for bug fixes / features)
  • [ ] Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • [ ] Bugfix
  • [x] Feature (please, look at the "Scope of the project" section in the README.md file)
  • [ ] Code style update (formatting, local variables)
  • [ ] Refactoring (no functional changes, no api changes)
  • [ ] Build related changes
  • [ ] CI related changes
  • [ ] Documentation content changes
  • [ ] Other... Please describe:

What is the current behavior?

Currently examples/protobufjs/defs.bzl does not support building multiple different protos.

What is the new behavior?

Multiple different protos can be combined in one protobufjs_library target.

Does this PR introduce a breaking change?

  • [ ] Yes
  • [x] No

All usages of protobufjs_library have been updated so that proto (a single label) is now protos (a list of labels). I believe this is not a breaking change because projects that include bazelbuild/rules_nodejs do not have access to examples/protobufjs/defs.bzl.

Other information

It seems likely there is a library function that does the same thing as _sanitize_label.

The changes here and in https://github.com/bazelbuild/rules_nodejs/pull/3543 are compatible.

Katee avatar Aug 30 '22 18:08 Katee