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

pbts: output is cutted to 200kb when processing large js-file #587

Closed
halex2005 opened this issue Dec 27, 2016 · 3 comments
Closed

pbts: output is cutted to 200kb when processing large js-file #587

halex2005 opened this issue Dec 27, 2016 · 3 comments

Comments

@halex2005
Copy link
Contributor

protobuf.js version: 6.3.0

I have 70 proto-files in my project and I have generated static module with pbjs successfully:

node_modules/protobufjs/bin/pbjs -p ./proto -o protoclasses.js -t static-module ./proto/**/*.proto

Then I'd like to produce typescript definitions for module:

node_modules/protobufjs/bin/pbts -o protoclasses.d.ts protoclasses.js

The pbts exits successfully, but resulting protoclasses.d.ts is broken - it's content is cutted to 200kb.

In the sources, pbts starts child process jsdoc and puts it's stdout to resulting file. NodeJS will cut stdout because of default buffer capacity is 200 kb.

I found this answer on stackoverflow useful to workaround this bug.

If I've add maxBuffer option with high value, output will not be cutted:

    var child = child_process.exec("node \"" + basedir + "/node_modules/jsdoc/jsdoc.js\" -c \"" + basedir + "/jsdoc.types.json\" -q \"module=" + encodeURIComponent(moduleName) + "\" " + files.map(function(file) { return '"' + file + '"'; }).join(' '), {
        cwd: process.cwd(),
        argv0: "node",
        stdio: "pipe",
        maxBuffer: 1024*1024*1024
    });

Will you fix this?
Which is reasonable value in your opinion?
In my case the resulting protoclasses.d.ts has 1.1mb size, it is sad that I cannot remove jsdoc comments in generated typescript definitions.

Cheers, halex2005.

@dcodeIO
Copy link
Member

dcodeIO commented Dec 27, 2016

Limit has been adjusted to 16mb and there is also a --no-comments option for pbts now.

@robin-anil
Copy link
Contributor

robin-anil commented Dec 28, 2016

@dcodeIO This seems to have fixed #576

Edit: Could be an earlier change, now the convertor seems to be visiting all protos correctly.

@halex2005
Copy link
Contributor Author

Thanks, --no-comments helps very much, 245 kb vs 2.5 mb 👍

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

No branches or pull requests

3 participants