Skip to content

Commit f4f3793

Browse files
committed
Update prpto gen script
1 parent a8e63df commit f4f3793

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

protos/update.sh

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ cp googleapis/google/type/latlng.proto \
6565

6666
popd
6767

68-
# Use npx to run local binaries, as $(npm bin) is deprecated
6968
PBJS="npx pbjs"
7069
PBTS="npx pbts"
7170

@@ -77,10 +76,11 @@ ${PBJS} -t static-module -w commonjs -o compiledFirestore.js \
7776
${PBJS} -t static-module -w es6 -o compiledFirestore.mjs \
7877
data.proto any.proto
7978

79+
# Generate Types
80+
${PBTS} -o compiledFirestore.d.ts compiledFirestore.js
81+
#
8082
# Fix imports for Node ESM in the generated .mjs file.
8183
# See: https://github.com/protobufjs/protobuf.js/issues/1929
82-
83-
# Use a portable sed command that works on both Mac (BSD) and Linux (GNU)
8484
if [[ "$OSTYPE" == "darwin"* ]]; then
8585
# 1. Append .js extension: Node ESM requires full paths for subpath imports not in 'exports'.
8686
sed -i '' 's|protobufjs/minimal|protobufjs/minimal.js|g' compiledFirestore.mjs
@@ -94,5 +94,3 @@ else
9494
sed -i 's|import \* as \$protobuf|import \$protobuf|g' compiledFirestore.mjs
9595
fi
9696

97-
# Generate Types
98-
${PBTS} -o compiledFirestore.d.ts compiledFirestore.js

0 commit comments

Comments
 (0)