Skip to content
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

Move command line tool to a new package named protobufjs-cli #1459

Closed
wants to merge 1 commit into from

Conversation

taylorcode
Copy link
Collaborator

@taylorcode taylorcode commented Jul 28, 2020

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:

syntax = "proto3";

package sample_js_init_data;

message TestMessage {
    bool test_bool = 1;
    string test_string = 2;
}

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant