fix(generate-proto): Use forceLong=string option

Noticed YouTube returning very large int64 values, causing the protobuf library to throw.
This commit is contained in:
Luan
2025-09-14 19:58:07 -03:00
parent 4d0a4a0f14
commit c240c97c23
20 changed files with 211 additions and 341 deletions

View File

@@ -45,7 +45,7 @@ if (!protoFiles.length) {
}
protoFiles.forEach((file) => {
const command = `protoc --proto_path=${protoDir} --plugin=protoc-gen-ts=${protocGenTs} --ts_opt=env=browser --ts_opt=importSuffix=.js --ts_out=${outDir} --ts_opt=outputJsonMethods=false --ts_opt=outputPartialMethods=false --ts_opt=removeEnumPrefix=true ${file}`;
const command = `protoc --proto_path=${protoDir} --plugin=protoc-gen-ts=${protocGenTs} --ts_opt=env=browser --ts_opt=forceLong=string --ts_opt=importSuffix=.js --ts_out=${outDir} --ts_opt=outputJsonMethods=false --ts_opt=outputPartialMethods=false --ts_opt=removeEnumPrefix=true ${file}`;
exec(command, (error, _stdout, stderr) => {
if (error) {
console.error(`Error compiling ${file}:`, stderr);