Allow for custom npm packages in imported protos

Open
#165 1 comment 8 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
30/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript
Domain
devtools

Research direction

Start with generator/js_generator.cc at lines 116-119, linked in the issue, and trace how imports for google-protobuf are emitted. Determine how .proto options should specify package names for other generated protobuf packages; done means generated code uses those configured package names for the corresponding imports.

Written by the indexing model from the issue text.

Description

enhancement good first issue packaging & distribution triaged

Here is a link to the line where it speaks to our issue.
https://github.com/protocolbuffers/protobuf-javascript/blob/6113588085fea6149c51a750bd21b5cf9334a07d/generator/js_generator.cc#L116-L119

We currently make use of a variety of google protos other than those in the google-protobuf npm package. To make use of these, we have to explicitly include them in the npm package that we publish containing our generated protobufs. It would be ideal if we could publish the generated google protobufs we use in a separate npm package and use options in the .proto files to specify the name of the package to which these are published, and for this package to be used in the generated code whenever one of these protobufs is implemeneted. Similar to how this is for the "google-protobuf" imports

Dominant language
JavaScript
Stars
471
Forks
92
PR merge metrics
No merged PRs in 30d

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from protocolbuffers/protobuf-javascript

All issues in protocolbuffers/protobuf-javascript

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.