@aptre/common 0.36.2 → 0.36.4

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/README.md CHANGED
@@ -308,6 +308,14 @@ that an ahead-of-time compiler builds, where the typed decoder is faster. It
308
308
  makes the generated files larger, and under a JIT the walker is as fast, so it
309
309
  is off by default.
310
310
 
311
+ ### `aptre.tsTypedEncode`
312
+
313
+ `tsTypedEncode` does the same for encoding: `protoc-gen-es-lite` generates an
314
+ encoder for every message that writes its fields in number order, with the
315
+ same bytes as the shared field walker. It needs `@aptre/protobuf-es-lite`
316
+ 1.2.4 or later. The same reasoning applies: turn it on for interpreters and
317
+ ahead-of-time compilers, and leave it off under a JIT.
318
+
311
319
  ### `aptre.tsImportBoundaries`
312
320
 
313
321
  `tsImportBoundaries` configures how generated TypeScript protobuf imports are
@@ -1,5 +1,5 @@
1
- import { OtherMsg } from "./other/other.pb.js";
2
- import type { MessageType } from "@aptre/protobuf-es-lite/message";
1
+ import { OtherMsg } from './other/other.pb.js';
2
+ import type { MessageType } from '@aptre/protobuf-es-lite/message';
3
3
  /**
4
4
  * ExampleMsg is an example message.
5
5
  *
@@ -1,15 +1,18 @@
1
1
  // @generated by protoc-gen-es-lite unknown with parameter "target=ts,ts_nocheck=false"
2
2
  // @generated from file github.com/aperturerobotics/common/example/example.proto (package example, syntax proto3)
3
3
  /* eslint-disable */
4
- import { OtherMsg } from "./other/other.pb.js";
5
- import { createMessageType } from "@aptre/protobuf-es-lite/message";
6
- export const ExampleMsg = /* @__PURE__ */ createMessageType("example.ExampleMsg", () => [
7
- [1, "example_field", 9],
8
- [2, "other_msg", 11, 0, OtherMsg.codec],
4
+ import { OtherMsg } from './other/other.pb.js';
5
+ import { createMessageType } from '@aptre/protobuf-es-lite/message';
6
+ export const ExampleMsg =
7
+ /* @__PURE__ */ createMessageType('example.ExampleMsg', () => [
8
+ [1, 'example_field', 9],
9
+ [2, 'other_msg', 11, 0, OtherMsg.codec],
9
10
  ]);
10
- export const EchoMsg = /* @__PURE__ */ createMessageType("example.EchoMsg", () => [
11
- [1, "body", 9],
11
+ export const EchoMsg =
12
+ /* @__PURE__ */ createMessageType('example.EchoMsg', () => [
13
+ [1, 'body', 9],
12
14
  ]);
13
- export const TypedMsg = /* @__PURE__ */ createMessageType("example.TypedMsg", () => [
14
- [1, "body", 9],
15
+ export const TypedMsg =
16
+ /* @__PURE__ */ createMessageType('example.TypedMsg', () => [
17
+ [1, 'body', 9],
15
18
  ]);
@@ -1,13 +1,13 @@
1
- import { EchoMsg } from "./example.pb.js";
2
- import { MethodKind } from "@aptre/protobuf-es-lite";
3
- import { ProtoRpc, ServerContext } from "starpc";
1
+ import { EchoMsg } from './example.pb.js';
2
+ import { MethodKind } from '@aptre/protobuf-es-lite';
3
+ import { ProtoRpc, ServerContext } from 'starpc';
4
4
  /**
5
5
  * Echoer service returns the given message.
6
6
  *
7
7
  * @generated from service example.Echoer
8
8
  */
9
9
  export declare const EchoerDefinition: {
10
- readonly typeName: "example.Echoer";
10
+ readonly typeName: 'example.Echoer';
11
11
  readonly methods: {
12
12
  /**
13
13
  * Echo returns the given message.
@@ -15,7 +15,7 @@ export declare const EchoerDefinition: {
15
15
  * @generated from rpc example.Echoer.Echo
16
16
  */
17
17
  readonly Echo: {
18
- readonly name: "Echo";
18
+ readonly name: 'Echo';
19
19
  readonly I: import("@aptre/protobuf-es-lite").MessageType<EchoMsg>;
20
20
  readonly O: import("@aptre/protobuf-es-lite").MessageType<EchoMsg>;
21
21
  readonly kind: MethodKind.Unary;
@@ -1,15 +1,15 @@
1
1
  // @generated by protoc-gen-es-starpc none with parameter "target=ts,ts_nocheck=false"
2
2
  // @generated from file github.com/aperturerobotics/common/example/example.proto (package example, syntax proto3)
3
3
  /* eslint-disable */
4
- import { EchoMsg } from "./example.pb.js";
5
- import { MethodKind } from "@aptre/protobuf-es-lite";
4
+ import { EchoMsg } from './example.pb.js';
5
+ import { MethodKind } from '@aptre/protobuf-es-lite';
6
6
  /**
7
7
  * Echoer service returns the given message.
8
8
  *
9
9
  * @generated from service example.Echoer
10
10
  */
11
11
  export const EchoerDefinition = {
12
- typeName: "example.Echoer",
12
+ typeName: 'example.Echoer',
13
13
  methods: {
14
14
  /**
15
15
  * Echo returns the given message.
@@ -17,12 +17,12 @@ export const EchoerDefinition = {
17
17
  * @generated from rpc example.Echoer.Echo
18
18
  */
19
19
  Echo: {
20
- name: "Echo",
20
+ name: 'Echo',
21
21
  I: EchoMsg,
22
22
  O: EchoMsg,
23
23
  kind: MethodKind.Unary,
24
24
  },
25
- }
25
+ },
26
26
  };
27
27
  export const EchoerServiceName = EchoerDefinition.typeName;
28
28
  export class EchoerClient {
@@ -1,4 +1,4 @@
1
- import type { MessageType } from "@aptre/protobuf-es-lite/message";
1
+ import type { MessageType } from '@aptre/protobuf-es-lite/message';
2
2
  /**
3
3
  * OtherMsg is a different message from ExampleMsg.
4
4
  *
@@ -1,7 +1,8 @@
1
1
  // @generated by protoc-gen-es-lite unknown with parameter "target=ts,ts_nocheck=false"
2
2
  // @generated from file github.com/aperturerobotics/common/example/other/other.proto (package example.other, syntax proto3)
3
3
  /* eslint-disable */
4
- import { createMessageType } from "@aptre/protobuf-es-lite/message";
5
- export const OtherMsg = /* @__PURE__ */ createMessageType("example.other.OtherMsg", () => [
6
- [1, "foo_field", 13],
4
+ import { createMessageType } from '@aptre/protobuf-es-lite/message';
5
+ export const OtherMsg =
6
+ /* @__PURE__ */ createMessageType('example.other.OtherMsg', () => [
7
+ [1, 'foo_field', 13],
7
8
  ]);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aptre/common",
3
3
  "description": "Common project configuration files and dependencies.",
4
- "version": "0.36.2",
4
+ "version": "0.36.4",
5
5
  "license": "MIT",
6
6
  "author": {
7
7
  "name": "Aperture Robotics LLC.",
@@ -54,8 +54,8 @@
54
54
  "format:js:changed": "git diff --name-only --diff-filter=d HEAD | grep '\\(\\.ts\\|\\.tsx\\|\\.html\\|\\.css\\|\\.scss\\)$' | xargs -I {} oxfmt {}",
55
55
  "format:js:all": "oxfmt './**/*.{ts,tsx,js,html,css,scss}'",
56
56
  "gen": "rimraf ./.tools && go mod tidy && cd ./tools && go mod tidy && cd ../ && bash embed.bash && npm run format && npm run go:aptre:gen",
57
- "gen:force": "rimraf ./.tools && go mod tidy && cd ./tools && go mod tidy && cd ../ && bash embed.bash && npm run format && npm run go:aptre:gen --force",
58
- "go:aptre:gen": "go run github.com/aperturerobotics/common/cmd/aptre generate",
57
+ "gen:force": "rimraf ./.tools && go mod tidy && cd ./tools && go mod tidy && cd ../ && bash embed.bash && npm run format && npm run go:aptre:gen -- --force",
58
+ "go:aptre:gen": "go run github.com/aperturerobotics/common/cmd/aptre generate -e 'tests/rust-graph/*/*.proto' -e 'tests/rust-graph/*/*/*.proto'",
59
59
  "go:aptre": "go run github.com/aperturerobotics/common/cmd/aptre",
60
60
  "test": "npm run test:js && npm run test:go",
61
61
  "test:js": "vitest run && npm run typecheck",
@@ -79,14 +79,14 @@
79
79
  "typescript": "^7.0.0"
80
80
  },
81
81
  "dependencies": {
82
- "@aptre/protobuf-es-lite": "1.2.3",
82
+ "@aptre/protobuf-es-lite": "1.2.4",
83
83
  "starpc": "^0.52.3",
84
84
  "vitest": "^5.0.0"
85
85
  },
86
86
  "resolutions": {
87
- "@aptre/protobuf-es-lite": "1.2.3"
87
+ "@aptre/protobuf-es-lite": "1.2.4"
88
88
  },
89
89
  "overrides": {
90
- "@aptre/protobuf-es-lite": "1.2.3"
90
+ "@aptre/protobuf-es-lite": "1.2.4"
91
91
  }
92
92
  }