Skip to content

Commit

Permalink
Use @foxglove/protobufjs fork
Browse files Browse the repository at this point in the history
  • Loading branch information
jtbandes committed Sep 2, 2023
1 parent 7dcef38 commit 5651518
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 34 deletions.
4 changes: 2 additions & 2 deletions typescript/support/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
},
"dependencies": {
"@foxglove/message-definition": "^0.2.0",
"@foxglove/protobufjs": "0.0.1-toobject-bigint.1",
"@foxglove/rosmsg": "^4.2.2",
"@foxglove/rosmsg-serialization": "^2.0.1",
"@foxglove/rosmsg2-serialization": "^2.0.2",
Expand All @@ -62,7 +63,6 @@
"@foxglove/wasm-zstd": "^1.0.1",
"@protobufjs/base64": "^1.1.2",
"flatbuffers": "^23.5.26",
"flatbuffers_reflection": "^0.0.6",
"protobufjs": "^7.2.2"
"flatbuffers_reflection": "^0.0.6"
}
}
2 changes: 1 addition & 1 deletion typescript/support/src/parseChannel.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { FileDescriptorSet, IFileDescriptorSet } from "@foxglove/protobufjs/ext/descriptor";
import fs from "fs";
import { FileDescriptorSet, IFileDescriptorSet } from "protobufjs/ext/descriptor";

import { parseChannel } from "./parseChannel";

Expand Down
2 changes: 1 addition & 1 deletion typescript/support/src/parseJsonSchema.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as protobufjs from "@foxglove/protobufjs";
import { foxgloveMessageSchemas, generateJsonSchema } from "@foxglove/schemas/internal";
import * as protobufjs from "protobufjs";

import { parseJsonSchema } from "./parseJsonSchema";

Expand Down
6 changes: 3 additions & 3 deletions typescript/support/src/parseProtobufSchema.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import protobufjs from "protobufjs";
import { FileDescriptorSet } from "protobufjs/ext/descriptor";
import protobufjs from "@foxglove/protobufjs";
import { FileDescriptorSet } from "@foxglove/protobufjs/ext/descriptor";

import { protobufDefinitionsToDatatypes, stripLeadingDot } from "./protobufDefinitionsToDatatypes";
import { MessageDefinitionMap } from "./types";
Expand Down Expand Up @@ -61,7 +61,7 @@ export function parseProtobufSchema(
const deserialize = (data: ArrayBufferView) => {
return rootType.toObject(
rootType.decode(new Uint8Array(data.buffer, data.byteOffset, data.byteLength)),
{ defaults: true },
{ defaults: true, longs: BigInt },
);
};

Expand Down
2 changes: 1 addition & 1 deletion typescript/support/src/protobufDefinitionsToDatatypes.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { MessageDefinitionField } from "@foxglove/message-definition";
import protobufjs from "protobufjs";
import protobufjs from "@foxglove/protobufjs";

import { MessageDefinitionMap } from "./types";

Expand Down
4 changes: 2 additions & 2 deletions typescript/support/src/protobufDescriptors.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// eslint-disable-next-line @typescript-eslint/triple-slash-reference
/// <reference path="../typings/protobufjs.d.ts" />

import protobufjs from "protobufjs";
import { FileDescriptorSet } from "protobufjs/ext/descriptor";
import protobufjs from "@foxglove/protobufjs";
import { FileDescriptorSet } from "@foxglove/protobufjs/ext/descriptor";

export type ProtobufDescriptor = ReturnType<protobufjs.Root["toDescriptor"]>;

Expand Down
6 changes: 3 additions & 3 deletions typescript/support/typings/protobufjs.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import protobufjs from "protobufjs";
import descriptor from "protobufjs/ext/descriptor";
import protobufjs from "@foxglove/protobufjs";
import descriptor from "@foxglove/protobufjs/ext/descriptor";

// https://github.com/protobufjs/protobuf.js/issues/1499
declare module "protobufjs" {
declare module "@foxglove/protobufjs" {
interface ReflectionObject {
toDescriptor(
protoVersion: string,
Expand Down
42 changes: 21 additions & 21 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2963,6 +2963,26 @@ __metadata:
languageName: node
linkType: hard

"@foxglove/protobufjs@npm:0.0.1-toobject-bigint.1":
version: 0.0.1-toobject-bigint.1
resolution: "@foxglove/protobufjs@npm:0.0.1-toobject-bigint.1"
dependencies:
"@protobufjs/aspromise": ^1.1.2
"@protobufjs/base64": ^1.1.2
"@protobufjs/codegen": ^2.0.4
"@protobufjs/eventemitter": ^1.1.0
"@protobufjs/fetch": ^1.1.0
"@protobufjs/float": ^1.0.2
"@protobufjs/inquire": ^1.1.0
"@protobufjs/path": ^1.1.2
"@protobufjs/pool": ^1.1.0
"@protobufjs/utf8": ^1.1.0
"@types/node": ">=13.7.0"
long: ^5.0.0
checksum: bce02c9a255116927fe327a7fce1dde8682ff0e742064a0120e7944d346385e28aecc315030c5560afc0208eaf1448d2a36b87f9f424531b7dd06e1b18100808
languageName: node
linkType: hard

"@foxglove/rosbag@npm:0.2.3":
version: 0.2.3
resolution: "@foxglove/rosbag@npm:0.2.3"
Expand Down Expand Up @@ -3570,6 +3590,7 @@ __metadata:
dependencies:
"@foxglove/eslint-plugin": 0.21.0
"@foxglove/message-definition": ^0.2.0
"@foxglove/protobufjs": 0.0.1-toobject-bigint.1
"@foxglove/rosmsg": ^4.2.2
"@foxglove/rosmsg-serialization": ^2.0.1
"@foxglove/rosmsg2-serialization": ^2.0.2
Expand All @@ -3595,7 +3616,6 @@ __metadata:
flatbuffers_reflection: ^0.0.6
jest: 29.4.3
prettier: 2.8.4
protobufjs: ^7.2.2
ts-jest: 29.0.5
typescript: 4.9.5
languageName: unknown
Expand Down Expand Up @@ -12662,26 +12682,6 @@ __metadata:
languageName: node
linkType: hard

"protobufjs@npm:^7.2.2":
version: 7.2.4
resolution: "protobufjs@npm:7.2.4"
dependencies:
"@protobufjs/aspromise": ^1.1.2
"@protobufjs/base64": ^1.1.2
"@protobufjs/codegen": ^2.0.4
"@protobufjs/eventemitter": ^1.1.0
"@protobufjs/fetch": ^1.1.0
"@protobufjs/float": ^1.0.2
"@protobufjs/inquire": ^1.1.0
"@protobufjs/path": ^1.1.2
"@protobufjs/pool": ^1.1.0
"@protobufjs/utf8": ^1.1.0
"@types/node": ">=13.7.0"
long: ^5.0.0
checksum: a952cdf2a5e5250c16ae651b570849b6f5b20a5475c3eef63ffb290ad239aa2916adfc1cc676f7fc93c69f48113df268761c0c246f7f023118c85bdd1a170044
languageName: node
linkType: hard

"proxy-addr@npm:~2.0.7":
version: 2.0.7
resolution: "proxy-addr@npm:2.0.7"
Expand Down

0 comments on commit 5651518

Please sign in to comment.