-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat!: move command line tool to a new package named protobufjs-cli #1234
Conversation
ad99d66
to
9883a96
Compare
Hi, can I get a review of this :)? thanks |
This feels like a breaking change since |
I'd suggest to collect all the breaking changes (iirc there are more currently blocked for similar reasons that are worth merging) and make it a new major release. A bonus might be to first collect everything not breaking into a minor, but certainly implies quite some work, so depends on how viable it is and if someone is willing to pick this up :) |
@dcodeIO I'm happy to do this. To clarify, are you suggesting:
|
Suggestion was to do backward compatible fixes first, leading to a new minor release (6.8.9), and afterwards do anything breaking leading to a new major release (7.0.0, switch to semver going forward). I'm not sure how important doing a minor update first is, though. Might be that it's not worth it. |
1edda53
to
ff89508
Compare
Hey @dcodeIO I made one small improvement to my changes to report an error if protobufjs can't be resolved from the protobufjs-cli package. I looked over the code again and I don't think that it makes sense to do a minor release because all of the changes are related to separating out the protobufjs-cli package, and the non-breaking changes do not add any value by themselves. The non-breaking changes include:
If this sounds reasonable to you, how can we proceed? Should I increment the version number to 7.0.0 for both protobufjs and protobufjs-cli? |
A few questions:
Overall this PR looks good to me, but I didn't test it locally. Would be great if multiple people could verify that it works without issues. Incrementing the version here makes sense to me as well, even if we might collect additional PRs before doing an actual release. |
In my opinion the best way to solve this problem is to use Lerna or Yarn workspaces for developing multiple packages in the same repo. If we used Lerna we would be able to reference protobufjs by the module name "protobufjs" for both modes (local development and installed as an npm package). I've used Lerna for projects in the past and it works well. I'm happy to follow up after this PR and see what it would take to move this repo to Lerna.
yep, nice catch. The package-lock.json for eventemitter was added by accident, I must have run Why do you feel that the package-lock.json is unnecessary? If we decided to use Lerna, we would have a package-lock for each subpackage, and lerna would manage updating them.
I will post my manual test plan here. Any automated tests you recommend I am happy to add as well.
I updated it to 7.0.0 |
f8ac088
to
6a8dc73
Compare
To test my changes: I published
(note that 7.0.4 was necessary because I already published prior versions to integrate it into my project.) And sample.proto:
I then ran To test inside of the repo, I added sample.proto inside of cli/, and invoked the binaries directly with the same arguments. |
Hi @alexander-fenster, @dcodeIO, can I have your review? thanks |
cli/package.json
Outdated
"name": "protobufjs-cli", | ||
"description": "Translates between file formats and generates static code as well as TypeScript definitions.", | ||
"version": "7.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just wanted to confirm that we want to start this separate package from v7.0.0 - it's up to @dcodeIO to decide.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey @dcodeIO can you advise here so that we can get this merged, if all else looks good. Thanks
Hey @dcodeIO and @alexander-fenster, my team has another improvement to protobuf.js that is based on this fork. Should we wait to open a new PR until this is merged in? Thanks |
@taylorcode I cannot create new release (I work for a Google team that works on gRPC, client libraries, and protobuf, so we asked for write access here to help with stuff, but I cannot and don't want to make releases :) ) - it's all up to Daniel @dcodeIO as for when to merge and release. Having that said - as a user of |
sounds good thanks @alexander-fenster. Thanks for helping to verify that it works. I'll wait for @dcodeIO, and just have my teammate open a new PR after this one lands. |
hey @dcodeIO can you take another look? |
hey folks... can I have someone review this?, it's been more than 3 months since I opened this PR. |
Hi @dcodeIO reminder on this PR. I’m happy to make any changes. My team has a few other fixes that we are working on and would like to merge in instead of maintaining our own fork. |
Any news about the release date? |
After install protobufjs-cli, run cmd failed. It's same as #877 (comment) How to solve it? install ok
|
What's the status of this change's release? It's been 18 months since this PR was closed and the bot keeps opening and closing release PRs that include this feature -- at the time of writing, there are two concurrent pending release tasks. |
I ran into issue #716 when trying to integrate pbjs and pbts into my build system. We must mirror our dependencies for reproducible builds.
@dcodeIO recommended that we convert cli/ into a new package. I see that the work here was started, but left in an incomplete state.
This PR attempts to finish decoupling protobufjs-cli from the parent package, so that it can be installed separately and so we can remove the behind the scenes npm install.
I recommend reviewing commit by commit, I tried to keep them as single purpose as possible. Please consider this is my first time contributing to this project.
To test my changes I ran
npm run test
in the parent package. To test the binaries exposed by protobujs-cli package and verify that they do not depend on the parent package, I moved the /cli folder outside of the parent repo and invoked the binaries directly. I confirmed with the following commands:pbjs --target static-module --wrap es6 protos/sample.proto
provided a proto with the content:
It logs generated js.
When output to a file
generated_js/sample.js
, and running the following command:pbts generated_js/sample.js
It logs the generated typings file content.