@foxglove/schemas 0.7.1 → 0.7.3
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.
- package/.github/workflows/ci.yml +51 -1
- package/.vscode/settings.json +10 -1
- package/Linux.flatc.binary.clang++-12.zip +0 -0
- package/README.md +5 -25
- package/flatc +0 -0
- package/internal/generateFlatbufferSchema.d.ts +6 -0
- package/internal/generateFlatbufferSchema.d.ts.map +1 -0
- package/internal/generateFlatbufferSchema.js +172 -0
- package/internal/generateFlatbufferSchema.js.map +1 -0
- package/internal/generateFlatbufferSchema.test.d.ts +2 -0
- package/internal/generateFlatbufferSchema.test.d.ts.map +1 -0
- package/internal/generateFlatbufferSchema.test.js +120 -0
- package/internal/generateFlatbufferSchema.test.js.map +1 -0
- package/internal/generateFlatbufferSchema.test.ts +118 -0
- package/internal/generateFlatbufferSchema.ts +189 -0
- package/internal/generateProto.test.js +1 -1
- package/internal/generateProto.test.js.map +1 -1
- package/internal/generateProto.test.ts +1 -1
- package/internal/schemas.d.ts.map +1 -1
- package/internal/schemas.js +21 -11
- package/internal/schemas.js.map +1 -1
- package/internal/schemas.test.js +1 -1
- package/internal/schemas.test.js.map +1 -1
- package/internal/schemas.test.ts +1 -1
- package/internal/schemas.ts +23 -11
- package/internal/testFixtures.d.ts.map +1 -1
- package/internal/testFixtures.js +11 -1
- package/internal/testFixtures.js.map +1 -1
- package/internal/testFixtures.ts +12 -1
- package/internal/types.d.ts +2 -1
- package/internal/types.d.ts.map +1 -1
- package/internal/types.ts +2 -1
- package/package.json +1 -1
- package/python/Makefile +39 -0
- package/python/Pipfile +17 -0
- package/python/Pipfile.lock +329 -0
- package/python/foxglove-schemas-protobuf/README.md +23 -0
- package/python/foxglove-schemas-protobuf/foxglove_schemas_protobuf/__init__.py +0 -0
- package/python/foxglove-schemas-protobuf/foxglove_schemas_protobuf/py.typed +0 -0
- package/python/foxglove-schemas-protobuf/pyproject.toml +11 -0
- package/python/foxglove-schemas-protobuf/setup.cfg +21 -0
- package/python/foxglove-schemas-protobuf/tests/test_schemas.py +5 -0
- package/schemas/README.md +8 -2
- package/schemas/flatbuffer/ArrowPrimitive.fbs +29 -0
- package/schemas/flatbuffer/ByteVector.fbs +8 -0
- package/schemas/flatbuffer/CameraCalibration.fbs +78 -0
- package/schemas/flatbuffer/CircleAnnotation.fbs +30 -0
- package/schemas/flatbuffer/Color.fbs +20 -0
- package/schemas/flatbuffer/CompressedImage.fbs +24 -0
- package/schemas/flatbuffer/CubePrimitive.fbs +21 -0
- package/schemas/flatbuffer/CylinderPrimitive.fbs +27 -0
- package/schemas/flatbuffer/Duration.fbs +10 -0
- package/schemas/flatbuffer/FrameTransform.fbs +27 -0
- package/schemas/flatbuffer/GeoJSON.fbs +11 -0
- package/schemas/flatbuffer/Grid.fbs +40 -0
- package/schemas/flatbuffer/ImageAnnotations.fbs +17 -0
- package/schemas/flatbuffer/KeyValuePair.fbs +14 -0
- package/schemas/flatbuffer/LaserScan.fbs +32 -0
- package/schemas/flatbuffer/LinePrimitive.fbs +49 -0
- package/schemas/flatbuffer/LocationFix.fbs +34 -0
- package/schemas/flatbuffer/Log.fbs +42 -0
- package/schemas/flatbuffer/ModelPrimitive.fbs +33 -0
- package/schemas/flatbuffer/PackedElementField.fbs +37 -0
- package/schemas/flatbuffer/Point2.fbs +14 -0
- package/schemas/flatbuffer/Point3.fbs +17 -0
- package/schemas/flatbuffer/PointCloud.fbs +30 -0
- package/schemas/flatbuffer/PointsAnnotation.fbs +45 -0
- package/schemas/flatbuffer/Pose.fbs +17 -0
- package/schemas/flatbuffer/PoseInFrame.fbs +20 -0
- package/schemas/flatbuffer/PosesInFrame.fbs +20 -0
- package/schemas/flatbuffer/Quaternion.fbs +20 -0
- package/schemas/flatbuffer/RawImage.fbs +33 -0
- package/schemas/flatbuffer/SceneEntity.fbs +62 -0
- package/schemas/flatbuffer/SceneEntityDeletion.fbs +27 -0
- package/schemas/flatbuffer/SceneUpdate.fbs +17 -0
- package/schemas/flatbuffer/SpherePrimitive.fbs +21 -0
- package/schemas/flatbuffer/TextPrimitive.fbs +29 -0
- package/schemas/flatbuffer/Time.fbs +9 -0
- package/schemas/flatbuffer/TriangleListPrimitive.fbs +29 -0
- package/schemas/flatbuffer/Vector2.fbs +14 -0
- package/schemas/flatbuffer/Vector3.fbs +17 -0
- package/schemas/jsonschema/CameraCalibration.json +2 -2
- package/schemas/jsonschema/CompressedImage.json +1 -1
- package/schemas/jsonschema/CubePrimitive.json +1 -1
- package/schemas/jsonschema/RawImage.json +1 -1
- package/schemas/jsonschema/SceneEntity.json +1 -1
- package/schemas/jsonschema/SceneUpdate.json +1 -1
- package/schemas/jsonschema/index.d.ts +4510 -35
- package/schemas/jsonschema/index.d.ts.map +1 -1
- package/schemas/jsonschema/index.js +7 -7
- package/schemas/jsonschema/index.js.map +1 -1
- package/schemas/jsonschema/index.ts +42 -42
- package/schemas/proto/foxglove/CameraCalibration.proto +3 -1
- package/schemas/proto/foxglove/CompressedImage.proto +2 -0
- package/schemas/proto/foxglove/CubePrimitive.proto +1 -1
- package/schemas/proto/foxglove/RawImage.proto +2 -0
- package/schemas/ros1/CameraCalibration.msg +3 -1
- package/schemas/ros1/CompressedImage.msg +2 -0
- package/schemas/ros1/CubePrimitive.msg +1 -1
- package/schemas/ros1/RawImage.msg +2 -0
- package/schemas/ros2/CameraCalibration.msg +3 -1
- package/schemas/ros2/CompressedImage.msg +2 -0
- package/schemas/ros2/CubePrimitive.msg +1 -1
- package/schemas/ros2/RawImage.msg +2 -0
- package/schemas/typescript/CameraCalibration.d.ts +6 -2
- package/schemas/typescript/CameraCalibration.d.ts.map +1 -1
- package/schemas/typescript/CameraCalibration.ts +6 -2
- package/schemas/typescript/CompressedImage.d.ts +5 -1
- package/schemas/typescript/CompressedImage.d.ts.map +1 -1
- package/schemas/typescript/CompressedImage.ts +5 -1
- package/schemas/typescript/CubePrimitive.d.ts +1 -1
- package/schemas/typescript/CubePrimitive.d.ts.map +1 -1
- package/schemas/typescript/CubePrimitive.ts +1 -1
- package/schemas/typescript/RawImage.d.ts +5 -1
- package/schemas/typescript/RawImage.d.ts.map +1 -1
- package/schemas/typescript/RawImage.ts +5 -1
- package/scripts/updateGeneratedFiles.js +14 -2
- package/scripts/updateGeneratedFiles.js.map +1 -1
- package/scripts/updateGeneratedFiles.ts +26 -2
package/.github/workflows/ci.yml
CHANGED
|
@@ -3,7 +3,7 @@ name: CI
|
|
|
3
3
|
on:
|
|
4
4
|
push:
|
|
5
5
|
branches: [main]
|
|
6
|
-
tags: ["releases
|
|
6
|
+
tags: ["releases/**"]
|
|
7
7
|
pull_request:
|
|
8
8
|
branches: ["*"]
|
|
9
9
|
|
|
@@ -36,6 +36,18 @@ jobs:
|
|
|
36
36
|
echo "Generated schemas are up to date!"
|
|
37
37
|
fi
|
|
38
38
|
|
|
39
|
+
- name: Validate Flatbuffer definitions
|
|
40
|
+
run: |
|
|
41
|
+
curl -LO https://github.com/google/flatbuffers/releases/download/v22.10.26/Linux.flatc.binary.clang++-12.zip
|
|
42
|
+
echo "0821af82a3a736b0ba9235c02219df24d1f042dd Linux.flatc.binary.clang++-12.zip" | shasum -a 1 -c
|
|
43
|
+
unzip Linux.flatc.binary.clang++-12.zip
|
|
44
|
+
output=$(./flatc --ts -o /dev/null ./schemas/flatbuffer/*.fbs)
|
|
45
|
+
if [ -n "$output" ]; then
|
|
46
|
+
echo "::error::Flatbuffer schema compilation had warnings or errors. Fix them to proceed:"
|
|
47
|
+
echo "$output"
|
|
48
|
+
exit 1
|
|
49
|
+
fi
|
|
50
|
+
|
|
39
51
|
- name: Validate protobuf definitions
|
|
40
52
|
run: protoc --proto_path=schemas/proto schemas/proto/**/*.proto --descriptor_set_out=/dev/null
|
|
41
53
|
|
|
@@ -45,6 +57,44 @@ jobs:
|
|
|
45
57
|
env:
|
|
46
58
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
|
|
47
59
|
|
|
60
|
+
python:
|
|
61
|
+
runs-on: ubuntu-latest
|
|
62
|
+
defaults:
|
|
63
|
+
run:
|
|
64
|
+
working-directory: python
|
|
65
|
+
steps:
|
|
66
|
+
- uses: actions/checkout@v3
|
|
67
|
+
- uses: arduino/setup-protoc@v1
|
|
68
|
+
- uses: actions/setup-python@v4
|
|
69
|
+
with:
|
|
70
|
+
python-version: 3.7
|
|
71
|
+
cache: pipenv
|
|
72
|
+
- run: pip install pipenv==2022.7.24
|
|
73
|
+
|
|
74
|
+
- run: make test
|
|
75
|
+
- run: make build
|
|
76
|
+
|
|
77
|
+
- name: Publish foxglove-schemas-protobuf to TestPyPI
|
|
78
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
79
|
+
if: ${{ !github.event.pull_request.head.repo.fork && github.actor != 'dependabot[bot]' }}
|
|
80
|
+
with:
|
|
81
|
+
user: __token__
|
|
82
|
+
password: ${{ secrets.TESTPYPI_API_TOKEN }}
|
|
83
|
+
packages_dir: python/foxglove-schemas-protobuf/dist
|
|
84
|
+
repository_url: https://test.pypi.org/legacy/
|
|
85
|
+
skip_existing: true
|
|
86
|
+
|
|
87
|
+
- name: Publish foxglove-schemas-protobuf to PyPI
|
|
88
|
+
if: |
|
|
89
|
+
!github.event.pull_request.head.repo.fork &&
|
|
90
|
+
github.actor != 'dependabot[bot]' &&
|
|
91
|
+
startsWith(github.ref, 'refs/tags/releases/python/foxglove-schemas-protobuf/v')
|
|
92
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
93
|
+
with:
|
|
94
|
+
user: __token__
|
|
95
|
+
password: ${{ secrets.PYPI_API_TOKEN }}
|
|
96
|
+
packages_dir: python/foxglove-schemas-protobuf/dist
|
|
97
|
+
|
|
48
98
|
ros:
|
|
49
99
|
runs-on: ubuntu-latest
|
|
50
100
|
strategy:
|
package/.vscode/settings.json
CHANGED
|
@@ -16,5 +16,14 @@
|
|
|
16
16
|
"eslint.options": {
|
|
17
17
|
"reportUnusedDisableDirectives": "error"
|
|
18
18
|
},
|
|
19
|
-
"jest.jestCommandLine": "yarn test"
|
|
19
|
+
"jest.jestCommandLine": "yarn test",
|
|
20
|
+
|
|
21
|
+
"python.formatting.provider": "black",
|
|
22
|
+
"python.analysis.typeCheckingMode": "strict",
|
|
23
|
+
"python.linting.flake8Enabled": true,
|
|
24
|
+
"python.linting.enabled": true,
|
|
25
|
+
"python.linting.flake8Args": ["--config", "python/.flake8"],
|
|
26
|
+
"[python]": {
|
|
27
|
+
"editor.defaultFormatter": "ms-python.python"
|
|
28
|
+
}
|
|
20
29
|
}
|
|
Binary file
|
package/README.md
CHANGED
|
@@ -2,31 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Message schemas supported by [Foxglove Studio](https://studio.foxglove.dev)
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
</td>
|
|
11
|
-
<td>
|
|
12
|
-
|
|
13
|
-
[](https://www.npmjs.com/package/@foxglove/schemas)
|
|
14
|
-
|
|
15
|
-
</td></tr>
|
|
16
|
-
<tr><td>
|
|
17
|
-
|
|
18
|
-
`foxglove_msgs`
|
|
19
|
-
|
|
20
|
-
</td>
|
|
21
|
-
<td>
|
|
22
|
-
|
|
23
|
-
<!-- Not yet released in Melodic -->
|
|
24
|
-
<!-- [](https://index.ros.org/p/foxglove_msgs/github-foxglove-schemas/#melodic) -->
|
|
25
|
-
|
|
26
|
-
[](https://index.ros.org/p/foxglove_msgs/github-foxglove-schemas/#noetic) [](https://index.ros.org/p/foxglove_msgs/github-foxglove-schemas/#foxy) [](https://index.ros.org/p/foxglove_msgs/github-foxglove-schemas/#galactic) [](https://index.ros.org/p/foxglove_msgs/github-foxglove-schemas/#humble) [](https://index.ros.org/p/foxglove_msgs/github-foxglove-schemas/#rolling)
|
|
27
|
-
|
|
28
|
-
</td></tr>
|
|
29
|
-
</table>
|
|
5
|
+
| Language/Framework | Package name | Version |
|
|
6
|
+
| --------------------- | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
7
|
+
| JavaScript/TypeScript | `@foxglove/schemas` | [](https://www.npmjs.com/package/@foxglove/schemas) |
|
|
8
|
+
| Python + Protobuf | `foxglove-schemas-protobuf` | [](https://pypi.org/project/foxglove-schemas-protobuf/) |
|
|
9
|
+
| ROS | `foxglove_msgs` | [](https://index.ros.org/p/foxglove_msgs/github-foxglove-schemas/#melodic) [](https://index.ros.org/p/foxglove_msgs/github-foxglove-schemas/#noetic) [](https://index.ros.org/p/foxglove_msgs/github-foxglove-schemas/#foxy) [](https://index.ros.org/p/foxglove_msgs/github-foxglove-schemas/#galactic) [](https://index.ros.org/p/foxglove_msgs/github-foxglove-schemas/#humble) [](https://index.ros.org/p/foxglove_msgs/github-foxglove-schemas/#rolling) |
|
|
30
10
|
|
|
31
11
|
## Introduction
|
|
32
12
|
|
package/flatc
ADDED
|
Binary file
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { FoxgloveEnumSchema, FoxgloveSchema } from "./types";
|
|
2
|
+
export declare const BYTE_VECTOR_FB = "\nnamespace foxglove;\n\n/// Used for nesting byte vectors\ntable ByteVector {\n data:[uint8];\n}\nroot_type ByteVector;\n";
|
|
3
|
+
export declare const TIME_FB = "\nnamespace foxglove;\n\nstruct Time {\n /// Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z\n sec:uint32;\n /// Nano-second fractions from 0 to 999,999,999 inclusive\n nsec:uint32;\n}\n";
|
|
4
|
+
export declare const DURATION_FB = "\nnamespace foxglove;\n\nstruct Duration {\n /// Signed seconds of the span of time. Must be from -315,576,000,000 to +315,576,000,000 inclusive.\n sec:int32;\n /// if sec === 0 : -999,999,999 <= nsec <= +999,999,999 \n /// otherwise sign of sec must match sign of nsec or be 0 and abs(nsec) <= 999,999,999\n nsec:int32;\n}\n";
|
|
5
|
+
export declare function generateFlatbuffers(schema: FoxgloveSchema, nestedEnums: FoxgloveEnumSchema[]): string;
|
|
6
|
+
//# sourceMappingURL=generateFlatbufferSchema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generateFlatbufferSchema.d.ts","sourceRoot":"","sources":["generateFlatbufferSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAqB,cAAc,EAAE,MAAM,SAAS,CAAC;AAGhF,eAAO,MAAM,cAAc,gIAQ1B,CAAC;AAGF,eAAO,MAAM,OAAO,wNASnB,CAAC;AAEF,eAAO,MAAM,WAAW,+UAUvB,CAAC;AAiBF,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,cAAc,EACtB,WAAW,EAAE,kBAAkB,EAAE,GAChC,MAAM,CAqIR"}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generateFlatbuffers = exports.DURATION_FB = exports.TIME_FB = exports.BYTE_VECTOR_FB = void 0;
|
|
4
|
+
// Flatbuffers only supports nested vectors via table
|
|
5
|
+
exports.BYTE_VECTOR_FB = `
|
|
6
|
+
namespace foxglove;
|
|
7
|
+
|
|
8
|
+
/// Used for nesting byte vectors
|
|
9
|
+
table ByteVector {
|
|
10
|
+
data:[uint8];
|
|
11
|
+
}
|
|
12
|
+
root_type ByteVector;
|
|
13
|
+
`;
|
|
14
|
+
// Same as protobuf wellknown types
|
|
15
|
+
exports.TIME_FB = `
|
|
16
|
+
namespace foxglove;
|
|
17
|
+
|
|
18
|
+
struct Time {
|
|
19
|
+
/// Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z
|
|
20
|
+
sec:uint32;
|
|
21
|
+
/// Nano-second fractions from 0 to 999,999,999 inclusive
|
|
22
|
+
nsec:uint32;
|
|
23
|
+
}
|
|
24
|
+
`;
|
|
25
|
+
exports.DURATION_FB = `
|
|
26
|
+
namespace foxglove;
|
|
27
|
+
|
|
28
|
+
struct Duration {
|
|
29
|
+
/// Signed seconds of the span of time. Must be from -315,576,000,000 to +315,576,000,000 inclusive.
|
|
30
|
+
sec:int32;
|
|
31
|
+
/// if sec === 0 : -999,999,999 <= nsec <= +999,999,999
|
|
32
|
+
/// otherwise sign of sec must match sign of nsec or be 0 and abs(nsec) <= 999,999,999
|
|
33
|
+
nsec:int32;
|
|
34
|
+
}
|
|
35
|
+
`;
|
|
36
|
+
function primitiveToFlatbuffers(type) {
|
|
37
|
+
switch (type) {
|
|
38
|
+
case "uint32":
|
|
39
|
+
return "uint32";
|
|
40
|
+
case "bytes":
|
|
41
|
+
return "[uint8]";
|
|
42
|
+
case "string":
|
|
43
|
+
return "string";
|
|
44
|
+
case "boolean":
|
|
45
|
+
return "bool";
|
|
46
|
+
case "float64":
|
|
47
|
+
return "double";
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
function generateFlatbuffers(schema, nestedEnums) {
|
|
51
|
+
const enumDefinitions = [];
|
|
52
|
+
for (const enumSchema of nestedEnums) {
|
|
53
|
+
const fields = enumSchema.values.map(({ name, value, description }) => {
|
|
54
|
+
if (description != undefined) {
|
|
55
|
+
return `/// ${description}\n ${name} = ${value},`;
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
return `${name} = ${value},`;
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
enumDefinitions.push(
|
|
62
|
+
// `///` comments required to show up in compiled flatbuffer schemas
|
|
63
|
+
`/// ${enumSchema.description}\nenum ${enumSchema.name} : ubyte {\n ${fields.join("\n\n ")}\n}\n`);
|
|
64
|
+
}
|
|
65
|
+
let definition;
|
|
66
|
+
const imports = new Set();
|
|
67
|
+
switch (schema.type) {
|
|
68
|
+
case "enum": {
|
|
69
|
+
const fields = schema.values.map(({ name, value, description }) => {
|
|
70
|
+
if (description != undefined) {
|
|
71
|
+
return `/// ${description}\n ${name} = ${value},`;
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
return `${name} = ${value},`;
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
// `///` comments required to show up in compiled flatbuffer schemas
|
|
78
|
+
definition = `/// ${schema.description}\nenum ${schema.name} : ubyte {\n ${fields.join("\n\n ")}\n}\n`;
|
|
79
|
+
break;
|
|
80
|
+
}
|
|
81
|
+
case "message": {
|
|
82
|
+
const fields = schema.fields.map((field) => {
|
|
83
|
+
const isArray = field.array != undefined;
|
|
84
|
+
let type;
|
|
85
|
+
switch (field.type.type) {
|
|
86
|
+
case "enum":
|
|
87
|
+
type = field.type.enum.name;
|
|
88
|
+
break;
|
|
89
|
+
case "nested":
|
|
90
|
+
type = `foxglove.${field.type.schema.name}`;
|
|
91
|
+
imports.add(field.type.schema.name);
|
|
92
|
+
break;
|
|
93
|
+
case "primitive":
|
|
94
|
+
if (field.type.name === "time") {
|
|
95
|
+
type = "Time";
|
|
96
|
+
imports.add(`Time`);
|
|
97
|
+
}
|
|
98
|
+
else if (field.type.name === "duration") {
|
|
99
|
+
type = "Duration";
|
|
100
|
+
imports.add(`Duration`);
|
|
101
|
+
}
|
|
102
|
+
else if (field.type.name === "bytes" && isArray) {
|
|
103
|
+
type = "ByteVector";
|
|
104
|
+
imports.add("ByteVector");
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
type = primitiveToFlatbuffers(field.type.name);
|
|
108
|
+
}
|
|
109
|
+
break;
|
|
110
|
+
}
|
|
111
|
+
let lengthComment;
|
|
112
|
+
if (typeof field.array === "number") {
|
|
113
|
+
// can't specify length of vector outside of struct, all of these are tables
|
|
114
|
+
lengthComment = ` /// length ${field.array}\n`;
|
|
115
|
+
}
|
|
116
|
+
let defaultValue;
|
|
117
|
+
if (field.defaultValue != undefined && !isArray) {
|
|
118
|
+
if (field.type.type === "primitive" &&
|
|
119
|
+
!(field.type.name === "duration" || field.type.name === "time")) {
|
|
120
|
+
if (typeof field.defaultValue === "string") {
|
|
121
|
+
defaultValue = `"${field.defaultValue}"`;
|
|
122
|
+
}
|
|
123
|
+
else if (typeof field.defaultValue === "number") {
|
|
124
|
+
if (Number.isInteger(field.defaultValue) && field.type.name === "float64") {
|
|
125
|
+
// if it is a floating point number that is an integer, we need to add a decimal point
|
|
126
|
+
defaultValue = `${field.defaultValue}.0`;
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
defaultValue = field.defaultValue.toString();
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
else if (typeof field.defaultValue === "boolean") {
|
|
133
|
+
// uses same 'false'/'true' as js
|
|
134
|
+
defaultValue = field.defaultValue.toString();
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
else if (field.type.type === "enum") {
|
|
138
|
+
// default enums are just the enum string of the enum and don't require other formatting
|
|
139
|
+
// ie: type numericType: NumericType = INT32;
|
|
140
|
+
defaultValue = field.defaultValue;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
if (field.defaultValue != undefined && defaultValue == undefined) {
|
|
144
|
+
throw new Error("Flatbuffers does not support non-scalar default values");
|
|
145
|
+
}
|
|
146
|
+
return `${field.description
|
|
147
|
+
.trim()
|
|
148
|
+
.split("\n")
|
|
149
|
+
.map((line) => ` /// ${line}\n`)
|
|
150
|
+
.join("")}${
|
|
151
|
+
// can't have inline comments, so the lengthComment needs to be above
|
|
152
|
+
lengthComment ?? ""
|
|
153
|
+
// convert field.name to lowercase for flatbuffer compilation compliance
|
|
154
|
+
} ${field.name.toLowerCase()}:${isArray ? `[${type}]` : type}${defaultValue ? ` = ${defaultValue}` : ""};`;
|
|
155
|
+
});
|
|
156
|
+
definition = `${enumDefinitions.join("\n\n")}/// ${schema.description}\ntable ${schema.name} {\n${fields.join("\n\n")}\n}\n\nroot_type ${schema.name};`;
|
|
157
|
+
break;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
const outputSections = [
|
|
161
|
+
`// Generated by https://github.com/foxglove/schemas`,
|
|
162
|
+
Array.from(imports)
|
|
163
|
+
.sort()
|
|
164
|
+
.map((name) => `include "${name}.fbs";`)
|
|
165
|
+
.join("\n"),
|
|
166
|
+
`namespace foxglove;`,
|
|
167
|
+
definition,
|
|
168
|
+
].filter(Boolean);
|
|
169
|
+
return outputSections.join("\n\n") + "\n";
|
|
170
|
+
}
|
|
171
|
+
exports.generateFlatbuffers = generateFlatbuffers;
|
|
172
|
+
//# sourceMappingURL=generateFlatbufferSchema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generateFlatbufferSchema.js","sourceRoot":"","sources":["generateFlatbufferSchema.ts"],"names":[],"mappings":";;;AAEA,qDAAqD;AACxC,QAAA,cAAc,GAAG;;;;;;;;CAQ7B,CAAC;AAEF,mCAAmC;AACtB,QAAA,OAAO,GAAG;;;;;;;;;CAStB,CAAC;AAEW,QAAA,WAAW,GAAG;;;;;;;;;;CAU1B,CAAC;AAEF,SAAS,sBAAsB,CAAC,IAAqD;IACnF,QAAQ,IAAI,EAAE;QACZ,KAAK,QAAQ;YACX,OAAO,QAAQ,CAAC;QAClB,KAAK,OAAO;YACV,OAAO,SAAS,CAAC;QACnB,KAAK,QAAQ;YACX,OAAO,QAAQ,CAAC;QAClB,KAAK,SAAS;YACZ,OAAO,MAAM,CAAC;QAChB,KAAK,SAAS;YACZ,OAAO,QAAQ,CAAC;KACnB;AACH,CAAC;AAED,SAAgB,mBAAmB,CACjC,MAAsB,EACtB,WAAiC;IAEjC,MAAM,eAAe,GAAa,EAAE,CAAC;IACrC,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE;QACpC,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,EAAE,EAAE;YACpE,IAAI,WAAW,IAAI,SAAS,EAAE;gBAC5B,OAAO,OAAO,WAAW,OAAO,IAAI,MAAM,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GAC3D,YAAY,CAAC,CAAC,CAAC,MAAM,YAAY,EAAE,CAAC,CAAC,CAAC,EACxC,GAAG,CAAC;YACN,CAAC,CAAC,CAAC;YAEH,UAAU,GAAG,GAAG,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,MAAM,CAAC,WAAW,WACnE,MAAM,CAAC,IACT,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,oBAAoB,MAAM,CAAC,IAAI,GAAG,CAAC;YAC7D,MAAM;SACP;KACF;IAED,MAAM,cAAc,GAAG;QACrB,qDAAqD;QAErD,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC;aAChB,IAAI,EAAE;aACN,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,YAAY,IAAI,QAAQ,CAAC;aACvC,IAAI,CAAC,IAAI,CAAC;QAEb,qBAAqB;QAErB,UAAU;KACX,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAElB,OAAO,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;AAC5C,CAAC;AAxID,kDAwIC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generateFlatbufferSchema.test.d.ts","sourceRoot":"","sources":["generateFlatbufferSchema.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const generateFlatbufferSchema_1 = require("./generateFlatbufferSchema");
|
|
4
|
+
const testFixtures_1 = require("./testFixtures");
|
|
5
|
+
describe("generateFlatbuffers", () => {
|
|
6
|
+
it("generates Message .fbs files", () => {
|
|
7
|
+
expect((0, generateFlatbufferSchema_1.generateFlatbuffers)(testFixtures_1.exampleMessage, [testFixtures_1.exampleEnum])).toMatchInlineSnapshot(`
|
|
8
|
+
"// Generated by https://github.com/foxglove/schemas
|
|
9
|
+
|
|
10
|
+
include "ByteVector.fbs";
|
|
11
|
+
include "Duration.fbs";
|
|
12
|
+
include "NestedMessage.fbs";
|
|
13
|
+
include "Time.fbs";
|
|
14
|
+
|
|
15
|
+
namespace foxglove;
|
|
16
|
+
|
|
17
|
+
/// An example enum
|
|
18
|
+
enum ExampleEnum : ubyte {
|
|
19
|
+
/// Value A
|
|
20
|
+
A = 1,
|
|
21
|
+
|
|
22
|
+
/// Value B
|
|
23
|
+
B = 2,
|
|
24
|
+
}
|
|
25
|
+
/// An example type
|
|
26
|
+
table ExampleMessage {
|
|
27
|
+
/// duration field
|
|
28
|
+
field_duration:Duration;
|
|
29
|
+
|
|
30
|
+
/// time field
|
|
31
|
+
field_time:Time;
|
|
32
|
+
|
|
33
|
+
/// boolean field
|
|
34
|
+
field_boolean:bool = true;
|
|
35
|
+
|
|
36
|
+
/// bytes field
|
|
37
|
+
field_bytes:[uint8];
|
|
38
|
+
|
|
39
|
+
/// float64 field
|
|
40
|
+
field_float64:double = 1.0;
|
|
41
|
+
|
|
42
|
+
/// uint32 field
|
|
43
|
+
field_uint32:uint32 = 5;
|
|
44
|
+
|
|
45
|
+
/// string field
|
|
46
|
+
field_string:string = "string-type";
|
|
47
|
+
|
|
48
|
+
/// duration array field
|
|
49
|
+
field_duration_array:[Duration];
|
|
50
|
+
|
|
51
|
+
/// time array field
|
|
52
|
+
field_time_array:[Time];
|
|
53
|
+
|
|
54
|
+
/// boolean array field
|
|
55
|
+
field_boolean_array:[bool];
|
|
56
|
+
|
|
57
|
+
/// bytes array field
|
|
58
|
+
field_bytes_array:[ByteVector];
|
|
59
|
+
|
|
60
|
+
/// float64 array field
|
|
61
|
+
field_float64_array:[double];
|
|
62
|
+
|
|
63
|
+
/// uint32 array field
|
|
64
|
+
field_uint32_array:[uint32];
|
|
65
|
+
|
|
66
|
+
/// string array field
|
|
67
|
+
field_string_array:[string];
|
|
68
|
+
|
|
69
|
+
/// duration fixed-length array field
|
|
70
|
+
/// length 3
|
|
71
|
+
field_duration_fixed_array:[Duration];
|
|
72
|
+
|
|
73
|
+
/// time fixed-length array field
|
|
74
|
+
/// length 3
|
|
75
|
+
field_time_fixed_array:[Time];
|
|
76
|
+
|
|
77
|
+
/// boolean fixed-length array field
|
|
78
|
+
/// length 3
|
|
79
|
+
field_boolean_fixed_array:[bool];
|
|
80
|
+
|
|
81
|
+
/// bytes fixed-length array field
|
|
82
|
+
/// length 3
|
|
83
|
+
field_bytes_fixed_array:[ByteVector];
|
|
84
|
+
|
|
85
|
+
/// float64 fixed-length array field
|
|
86
|
+
/// length 3
|
|
87
|
+
field_float64_fixed_array:[double];
|
|
88
|
+
|
|
89
|
+
/// uint32 fixed-length array field
|
|
90
|
+
/// length 3
|
|
91
|
+
field_uint32_fixed_array:[uint32];
|
|
92
|
+
|
|
93
|
+
/// string fixed-length array field
|
|
94
|
+
/// length 3
|
|
95
|
+
field_string_fixed_array:[string];
|
|
96
|
+
|
|
97
|
+
/// An enum field
|
|
98
|
+
field_enum:ExampleEnum;
|
|
99
|
+
|
|
100
|
+
/// An enum array field
|
|
101
|
+
field_enum_array:[ExampleEnum];
|
|
102
|
+
|
|
103
|
+
/// A nested field
|
|
104
|
+
field_nested:foxglove.NestedMessage;
|
|
105
|
+
|
|
106
|
+
/// A nested array field
|
|
107
|
+
/// With
|
|
108
|
+
/// a
|
|
109
|
+
/// very
|
|
110
|
+
/// long
|
|
111
|
+
/// description
|
|
112
|
+
field_nested_array:[foxglove.NestedMessage];
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
root_type ExampleMessage;
|
|
116
|
+
"
|
|
117
|
+
`);
|
|
118
|
+
});
|
|
119
|
+
});
|
|
120
|
+
//# sourceMappingURL=generateFlatbufferSchema.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generateFlatbufferSchema.test.js","sourceRoot":"","sources":["generateFlatbufferSchema.test.ts"],"names":[],"mappings":";;AAAA,yEAAiE;AACjE,iDAA6D;AAE7D,QAAQ,CAAC,qBAAqB,EAAE,GAAG,EAAE;IACnC,EAAE,CAAC,8BAA8B,EAAE,GAAG,EAAE;QACtC,MAAM,CAAC,IAAA,8CAAmB,EAAC,6BAAc,EAAE,CAAC,0BAAW,CAAC,CAAC,CAAC,CAAC,qBAAqB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA8GhF,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { generateFlatbuffers } from "./generateFlatbufferSchema";
|
|
2
|
+
import { exampleEnum, exampleMessage } from "./testFixtures";
|
|
3
|
+
|
|
4
|
+
describe("generateFlatbuffers", () => {
|
|
5
|
+
it("generates Message .fbs files", () => {
|
|
6
|
+
expect(generateFlatbuffers(exampleMessage, [exampleEnum])).toMatchInlineSnapshot(`
|
|
7
|
+
"// Generated by https://github.com/foxglove/schemas
|
|
8
|
+
|
|
9
|
+
include "ByteVector.fbs";
|
|
10
|
+
include "Duration.fbs";
|
|
11
|
+
include "NestedMessage.fbs";
|
|
12
|
+
include "Time.fbs";
|
|
13
|
+
|
|
14
|
+
namespace foxglove;
|
|
15
|
+
|
|
16
|
+
/// An example enum
|
|
17
|
+
enum ExampleEnum : ubyte {
|
|
18
|
+
/// Value A
|
|
19
|
+
A = 1,
|
|
20
|
+
|
|
21
|
+
/// Value B
|
|
22
|
+
B = 2,
|
|
23
|
+
}
|
|
24
|
+
/// An example type
|
|
25
|
+
table ExampleMessage {
|
|
26
|
+
/// duration field
|
|
27
|
+
field_duration:Duration;
|
|
28
|
+
|
|
29
|
+
/// time field
|
|
30
|
+
field_time:Time;
|
|
31
|
+
|
|
32
|
+
/// boolean field
|
|
33
|
+
field_boolean:bool = true;
|
|
34
|
+
|
|
35
|
+
/// bytes field
|
|
36
|
+
field_bytes:[uint8];
|
|
37
|
+
|
|
38
|
+
/// float64 field
|
|
39
|
+
field_float64:double = 1.0;
|
|
40
|
+
|
|
41
|
+
/// uint32 field
|
|
42
|
+
field_uint32:uint32 = 5;
|
|
43
|
+
|
|
44
|
+
/// string field
|
|
45
|
+
field_string:string = "string-type";
|
|
46
|
+
|
|
47
|
+
/// duration array field
|
|
48
|
+
field_duration_array:[Duration];
|
|
49
|
+
|
|
50
|
+
/// time array field
|
|
51
|
+
field_time_array:[Time];
|
|
52
|
+
|
|
53
|
+
/// boolean array field
|
|
54
|
+
field_boolean_array:[bool];
|
|
55
|
+
|
|
56
|
+
/// bytes array field
|
|
57
|
+
field_bytes_array:[ByteVector];
|
|
58
|
+
|
|
59
|
+
/// float64 array field
|
|
60
|
+
field_float64_array:[double];
|
|
61
|
+
|
|
62
|
+
/// uint32 array field
|
|
63
|
+
field_uint32_array:[uint32];
|
|
64
|
+
|
|
65
|
+
/// string array field
|
|
66
|
+
field_string_array:[string];
|
|
67
|
+
|
|
68
|
+
/// duration fixed-length array field
|
|
69
|
+
/// length 3
|
|
70
|
+
field_duration_fixed_array:[Duration];
|
|
71
|
+
|
|
72
|
+
/// time fixed-length array field
|
|
73
|
+
/// length 3
|
|
74
|
+
field_time_fixed_array:[Time];
|
|
75
|
+
|
|
76
|
+
/// boolean fixed-length array field
|
|
77
|
+
/// length 3
|
|
78
|
+
field_boolean_fixed_array:[bool];
|
|
79
|
+
|
|
80
|
+
/// bytes fixed-length array field
|
|
81
|
+
/// length 3
|
|
82
|
+
field_bytes_fixed_array:[ByteVector];
|
|
83
|
+
|
|
84
|
+
/// float64 fixed-length array field
|
|
85
|
+
/// length 3
|
|
86
|
+
field_float64_fixed_array:[double];
|
|
87
|
+
|
|
88
|
+
/// uint32 fixed-length array field
|
|
89
|
+
/// length 3
|
|
90
|
+
field_uint32_fixed_array:[uint32];
|
|
91
|
+
|
|
92
|
+
/// string fixed-length array field
|
|
93
|
+
/// length 3
|
|
94
|
+
field_string_fixed_array:[string];
|
|
95
|
+
|
|
96
|
+
/// An enum field
|
|
97
|
+
field_enum:ExampleEnum;
|
|
98
|
+
|
|
99
|
+
/// An enum array field
|
|
100
|
+
field_enum_array:[ExampleEnum];
|
|
101
|
+
|
|
102
|
+
/// A nested field
|
|
103
|
+
field_nested:foxglove.NestedMessage;
|
|
104
|
+
|
|
105
|
+
/// A nested array field
|
|
106
|
+
/// With
|
|
107
|
+
/// a
|
|
108
|
+
/// very
|
|
109
|
+
/// long
|
|
110
|
+
/// description
|
|
111
|
+
field_nested_array:[foxglove.NestedMessage];
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
root_type ExampleMessage;
|
|
115
|
+
"
|
|
116
|
+
`);
|
|
117
|
+
});
|
|
118
|
+
});
|