Move command line tool to a new package named protobufjs-cli #1459
+1,823
−2,742
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
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.
Original PR with additional context:
#1234