@periskope/baileys 6.7.18-17-13 → 6.7.18-17-14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,3 @@
1
- yarn pbjs -t static-module -w commonjs -o ./WAProto/index.js ./WAProto/WAProto.proto;
2
- yarn pbts -o ./WAProto/index.d.ts ./WAProto/index.js;
1
+ yarn pbjs -t static-module -w es6 --no-bundle -o ./index.js ./WAProto.proto;
2
+ yarn pbts -o ./index.d.ts ./index.js;
3
+ node ./fix-imports.js
@@ -0,0 +1,29 @@
1
+ import { readFileSync, writeFileSync } from 'fs';
2
+ import { argv, exit } from 'process';
3
+
4
+ const filePath = './index.js';
5
+
6
+ try {
7
+ // Read the file
8
+ let content = readFileSync(filePath, 'utf8');
9
+
10
+ // Fix the import statement
11
+ content = content.replace(
12
+ /import \* as (\$protobuf) from/g,
13
+ 'import $1 from'
14
+ );
15
+
16
+ // add missing extension to the import
17
+ content = content.replace(
18
+ /(['"])protobufjs\/minimal(['"])/g,
19
+ '$1protobufjs/minimal.js$2'
20
+ );
21
+
22
+ // Write back
23
+ writeFileSync(filePath, content, 'utf8');
24
+
25
+ console.log(`✅ Fixed imports in ${filePath}`);
26
+ } catch (error) {
27
+ console.error(`❌ Error fixing imports: ${error.message}`);
28
+ exit(1);
29
+ }