@aptre/protobuf-es-lite 0.4.6 → 0.4.8
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 +20 -21
- package/dist/binary-encoding.d.ts +1 -1
- package/dist/codegen-info.d.ts +1 -1
- package/dist/google/protobuf/any.pb.d.ts +4 -4
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -146,9 +146,9 @@ bundler configurations. If you prefer to generate TypeScript, use `target=ts`.
|
|
|
146
146
|
|
|
147
147
|
### `import_extension=.js`
|
|
148
148
|
|
|
149
|
-
By default,
|
|
150
|
-
|
|
151
|
-
|
|
149
|
+
By default, protoc-gen-es (and all other plugins based on
|
|
150
|
+
[protoplugin](./src/protoplugin)) uses a `.js` file extensions in import paths,
|
|
151
|
+
even in TypeScript files.
|
|
152
152
|
|
|
153
153
|
This is unintuitive, but necessary for [ECMAScript modules in Node.js](https://www.typescriptlang.org/docs/handbook/esm-node.html).
|
|
154
154
|
Unfortunately, not all bundlers and tools have caught up yet, and Deno
|
|
@@ -160,11 +160,10 @@ in import paths with the given value. For example, set
|
|
|
160
160
|
|
|
161
161
|
### `js_import_style`
|
|
162
162
|
|
|
163
|
-
By default,
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
`require()` calls.
|
|
163
|
+
By default, protoc-gen-es (and all other plugins based on
|
|
164
|
+
[protoplugin](./src/protoplugin)) generates ECMAScript `import` and `export`
|
|
165
|
+
statements. For use cases where CommonJS is difficult to avoid, this option can
|
|
166
|
+
be used to generate CommonJS `require()` calls.
|
|
168
167
|
|
|
169
168
|
Possible values:
|
|
170
169
|
- `js_import_style=module` generate ECMAScript `import` / `export` statements -
|
|
@@ -173,23 +172,23 @@ Possible values:
|
|
|
173
172
|
|
|
174
173
|
### `keep_empty_files=true`
|
|
175
174
|
|
|
176
|
-
By default,
|
|
177
|
-
(
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
Unless you use Bazel, it is very unlikely that you need this option.
|
|
175
|
+
By default, protoc-gen-es (and all other plugins based on
|
|
176
|
+
[protoplugin](./src/protoplugin)) omits empty files from the plugin output. This
|
|
177
|
+
option disables pruning of empty files, to allow for smooth interoperation with
|
|
178
|
+
Bazel and similar tooling that requires all output files to be declared ahead of
|
|
179
|
+
time. Unless you use Bazel, it is very unlikely that you need this option.
|
|
182
180
|
|
|
183
181
|
### `ts_nocheck=false`
|
|
184
182
|
|
|
185
|
-
By default,
|
|
186
|
-
|
|
187
|
-
|
|
183
|
+
By default, protoc-gen-es (and all other plugins based on
|
|
184
|
+
[protoplugin](./src/protoplugin)) generates an annotation at the top of each
|
|
185
|
+
file: `// @ts-nocheck`.
|
|
188
186
|
|
|
189
|
-
We generate the annotation to support a wide range of compiler configurations
|
|
190
|
-
future changes to the language. But there can be situations where the
|
|
191
|
-
shadows an underlying problem, for example an unresolvable import. To
|
|
192
|
-
the annotation and to enable type checks, set the plugin option
|
|
187
|
+
We generate the annotation to support a wide range of compiler configurations
|
|
188
|
+
and future changes to the language. But there can be situations where the
|
|
189
|
+
annotation shadows an underlying problem, for example an unresolvable import. To
|
|
190
|
+
remove the annotation and to enable type checks, set the plugin option
|
|
191
|
+
`ts_nocheck=false`.
|
|
193
192
|
|
|
194
193
|
## Developing on MacOS
|
|
195
194
|
|
|
@@ -359,7 +359,7 @@ export declare class BinaryReader implements IBinaryReader {
|
|
|
359
359
|
/**
|
|
360
360
|
* Read a `uint32` field, an unsigned 32 bit varint.
|
|
361
361
|
*/
|
|
362
|
-
uint32:
|
|
362
|
+
uint32: IBinaryReader["uint32"];
|
|
363
363
|
/**
|
|
364
364
|
* Read a `int32` field, a signed 32 bit varint.
|
|
365
365
|
*/
|
package/dist/codegen-info.d.ts
CHANGED
|
@@ -44,7 +44,7 @@ export declare const codegenInfo: {
|
|
|
44
44
|
readonly createEnumType: RuntimeSymbolInfo;
|
|
45
45
|
readonly createMessageType: RuntimeSymbolInfo;
|
|
46
46
|
};
|
|
47
|
-
readonly wktSourceFiles:
|
|
47
|
+
readonly wktSourceFiles: ReadonlyArray<string>;
|
|
48
48
|
};
|
|
49
49
|
export type RuntimeSymbolName = keyof typeof codegenInfo.symbols;
|
|
50
50
|
export type CodegenInfo = typeof codegenInfo;
|
|
@@ -137,10 +137,10 @@ declare const Any_Wkt: {
|
|
|
137
137
|
toJson(msg: Any, options?: Partial<JsonWriteOptions>): JsonValue;
|
|
138
138
|
fromJson(json: JsonValue, options?: Partial<JsonReadOptions>): Any;
|
|
139
139
|
packFrom<T extends Message<T>>(out: Any, message: Message<T>, messageType: MessageType<T>): void;
|
|
140
|
-
unpackTo<
|
|
141
|
-
unpack<
|
|
142
|
-
message: Message<
|
|
143
|
-
messageType: MessageType<
|
|
140
|
+
unpackTo<T extends Message<T>>(msg: Any, target: Message<T>, targetMessageType: MessageType<T>): boolean;
|
|
141
|
+
unpack<T extends Message<T>>(msg: Any, registry: IMessageTypeRegistry): {
|
|
142
|
+
message: Message<T>;
|
|
143
|
+
messageType: MessageType<T>;
|
|
144
144
|
} | undefined;
|
|
145
145
|
is(msg: Any, msgType: MessageType | string): boolean;
|
|
146
146
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aptre/protobuf-es-lite",
|
|
3
3
|
"description": "Lightweight Protobuf codegen for TypeScript and JavaScript.",
|
|
4
|
-
"version": "0.4.
|
|
4
|
+
"version": "0.4.8",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
7
7
|
"url": "git+ssh://git@github.com/aperturerobotics/protobuf-es-lite.git"
|
|
@@ -73,18 +73,18 @@
|
|
|
73
73
|
"lz-string": "^1.5.0"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
|
-
"@types/node": "^
|
|
77
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
78
|
-
"@typescript-eslint/parser": "^
|
|
76
|
+
"@types/node": "^22.7.5",
|
|
77
|
+
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
78
|
+
"@typescript-eslint/parser": "^8.0.0",
|
|
79
79
|
"eslint": "^9.3.0",
|
|
80
80
|
"eslint-config-prettier": "^9.1.0",
|
|
81
81
|
"eslint-plugin-unused-imports": "^4.0.0",
|
|
82
82
|
"lint-staged": ">=15.2.5",
|
|
83
83
|
"pre-commit": "^1.2.2",
|
|
84
84
|
"prettier": "^3.2.5",
|
|
85
|
-
"rimraf": "^
|
|
85
|
+
"rimraf": "^6.0.0",
|
|
86
86
|
"typescript": "^5.4.5",
|
|
87
|
-
"vitest": "^
|
|
87
|
+
"vitest": "^2.0.0"
|
|
88
88
|
},
|
|
89
89
|
"lint-staged": {
|
|
90
90
|
"package.json": "prettier --write",
|