Skip to content

Commit

Permalink
fix: make protobuf types a regular dependency (#705)
Browse files Browse the repository at this point in the history
Prior to this commit, the @types/google-protobuf dep was a dev
dependency rather than a regular dependency.

This meant that when we published the SDK, it wasn't treated as
a required dependency for end users. This is problematic because
our middleware API includes the protobuf `Message` type.

I'm not sure what changed recently; possibly something in the
upstream grpc-js library, but for whatever reason this started
causing build failures in the example projects when trying to
build them against 1.30.0. They were failing with an error
about missing the type definition for `Message`.

This commit makes the types dependency a first-class dep. We
will need to be a little careful about this, it's not ideal to
be exposing types from an upstream dependency in our API signatures
and at some point we might want to create our own wrapper type
that basically redefines the relevant parts of the protobuf
Message type, but this should get the builds working for now.
  • Loading branch information
cprice404 authored Aug 10, 2023
1 parent c97671a commit d4a52f9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions packages/client-sdk-nodejs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/client-sdk-nodejs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
"license": "Apache-2.0",
"devDependencies": {
"@gomomento/common-integration-tests": "file:../common-integration-tests",
"@types/google-protobuf": "3.15.6",
"@types/jest": "^27.0.2",
"@types/node": "14.18.3",
"@types/uuid": "^8.3.1",
Expand All @@ -53,6 +52,7 @@
"@gomomento/generated-types": "0.69.0",
"@gomomento/sdk-core": "file:../core",
"@grpc/grpc-js": "1.9.0",
"@types/google-protobuf": "3.15.6",
"google-protobuf": "3.21.2",
"jwt-decode": "3.1.2"
},
Expand Down

0 comments on commit d4a52f9

Please sign in to comment.