Skip to content

Commit 52b7c28

Browse files
committed
Move proto file loading to a compile step instead of download.
This resolves issues related to download path when cdpclient is used.
1 parent 184f941 commit 52b7c28

3 files changed

Lines changed: 6 additions & 3 deletions

File tree

index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import protobuf, { convertFieldsToCamelCase } from 'protobufjs'
2+
import p from './studioapi.proto.js';
23

34
/**
45
* The studio namespace.
@@ -18,7 +19,7 @@ var studio = (function() {
1819
*/
1920
studio.protocol = (function(ProtoBuf) {
2021
var obj = {},
21-
studioBuilder = ProtoBuf.loadProtoFile("./studioapi.proto");
22+
studioBuilder = ProtoBuf.loadProto(p);
2223
obj.Hello = studioBuilder.build("Hello");
2324
obj.AuthRequest = studioBuilder.build("AuthRequest");
2425
obj.AuthRequestChallengeResponse = studioBuilder.build("AuthRequest.ChallengeResponse");

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cdp-client",
3-
"version": "2.0.0",
3+
"version": "2.0.1",
44
"description": "A simple Javascript interface for the CDP Studio development platform that allows Javascript applications to interact with",
55
"main": "index.js",
66
"scripts": {

studioapi.proto renamed to studioapi.proto.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
const p = `
12
// This file describes the StudioAPI wire protocol. It can be compiled with
23
// the Google Protobuf protoc compiler into native C++, Java, Python etc.
34
@@ -232,4 +233,5 @@ message ValueRequest {
232233
// missing or zero means all samples must be provided
233234
extensions 100 to max;
234235
}
235-
236+
`;
237+
export default p;

0 commit comments

Comments
 (0)