proto: fix proto generation, tsc: fix node imports of compiled code

This commit is contained in:
Rajeh Taher
2025-07-19 23:16:35 +03:00
parent 29f0ac83f8
commit 8dc852ee89
33 changed files with 123 additions and 42 deletions
+2 -2
View File
@@ -1,3 +1,3 @@
yarn pbjs -t static-module -w es6 --no-bundle -o ./WAProto/index.js ./WAProto/WAProto.proto;
yarn pbts -o ./WAProto/index.d.ts ./WAProto/index.js;
yarn pbjs -t static-module -w es6 --no-bundle -o ./index.js ./WAProto.proto;
yarn pbts -o ./index.d.ts ./index.js;
node ./fix-imports.js
+6
View File
@@ -13,6 +13,12 @@ try {
'import $1 from'
);
// add missing extension to the import
content = content.replace(
/(['"])protobufjs\/minimal(['"])/g,
'$1protobufjs/minimal.js$2'
);
// Write back
writeFileSync(filePath, content, 'utf8');
+1 -1
View File
@@ -1,5 +1,5 @@
/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/
import $protobuf from "protobufjs/minimal";
import $protobuf from "protobufjs/minimal.js";
// Common aliases
const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;