@bufbuild/protobuf 2.0.0-beta.1 → 2.0.0-beta.2
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
|
@@ -8,7 +8,7 @@ This package provides the runtime library for the code generator plugin
|
|
|
8
8
|
A complete implementation of [Protocol Buffers](https://developers.google.com/protocol-buffers) in TypeScript,
|
|
9
9
|
suitable for web browsers and Node.js.
|
|
10
10
|
|
|
11
|
-
**Protobuf-ES** is intended to be a solid, modern alternative to existing Protobuf implementations for the JavaScript ecosystem.
|
|
11
|
+
**Protobuf-ES** is intended to be a solid, modern alternative to existing Protobuf implementations for the JavaScript ecosystem. It is the first project in this space to provide a comprehensive plugin framework and decouple the base types from RPC functionality.
|
|
12
12
|
|
|
13
13
|
Some additional features that set it apart from the others:
|
|
14
14
|
|
|
@@ -17,7 +17,7 @@ Some additional features that set it apart from the others:
|
|
|
17
17
|
- Generation of idiomatic JavaScript and TypeScript code.
|
|
18
18
|
- Generation of [much smaller bundles](https://github.com/bufbuild/protobuf-es/blob/main/packages/bundle-size)
|
|
19
19
|
- Implementation of all proto3 features, including the [canonical JSON format](https://developers.google.com/protocol-buffers/docs/proto3#json).
|
|
20
|
-
- Implementation of all proto2 features, except for extensions and the text format.
|
|
20
|
+
- Implementation of all proto2 features, except for extensions and the text format.
|
|
21
21
|
- Usage of standard JavaScript APIs instead of the [Closure Library](http://googlecode.blogspot.com/2009/11/introducing-closure-tools.html)
|
|
22
22
|
- Compatibility is covered by the protocol buffers [conformance tests](https://github.com/bufbuild/protobuf-es/blob/main/packages/protobuf-conformance).
|
|
23
23
|
- Descriptor and reflection support
|
|
@@ -40,4 +40,3 @@ For more information on Buf, check out the official [Buf documentation](https://
|
|
|
40
40
|
## Examples
|
|
41
41
|
|
|
42
42
|
A complete code example can be found in the **Protobuf-ES** repo [here](https://github.com/bufbuild/protobuf-es/tree/main/packages/protobuf-example).
|
|
43
|
-
|
package/dist/cjs/registry.js
CHANGED
|
@@ -83,7 +83,7 @@ function createFileRegistry(...args) {
|
|
|
83
83
|
deps.push(dep);
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
|
-
return
|
|
86
|
+
return deps.concat(...deps.map(recurseDeps));
|
|
87
87
|
}
|
|
88
88
|
for (const file of [input, ...recurseDeps(input)].reverse()) {
|
|
89
89
|
addFile(file, registry);
|
|
@@ -21,7 +21,7 @@ export declare function sizeDelimitedEncode<Desc extends DescMessage>(messageDes
|
|
|
21
21
|
* This size-delimited format is compatible with other implementations.
|
|
22
22
|
* For details, see https://github.com/protocolbuffers/protobuf/issues/10229
|
|
23
23
|
*/
|
|
24
|
-
export declare function sizeDelimitedDecodeStream<Desc extends DescMessage>(messageDesc: Desc, iterable: AsyncIterable<Uint8Array>, options?: BinaryReadOptions):
|
|
24
|
+
export declare function sizeDelimitedDecodeStream<Desc extends DescMessage>(messageDesc: Desc, iterable: AsyncIterable<Uint8Array>, options?: BinaryReadOptions): AsyncIterableIterator<MessageShape<Desc>>;
|
|
25
25
|
/**
|
|
26
26
|
* Decodes the size from the given size-delimited message, which may be
|
|
27
27
|
* incomplete.
|
package/dist/esm/registry.js
CHANGED
|
@@ -78,7 +78,7 @@ export function createFileRegistry(...args) {
|
|
|
78
78
|
deps.push(dep);
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
-
return
|
|
81
|
+
return deps.concat(...deps.map(recurseDeps));
|
|
82
82
|
}
|
|
83
83
|
for (const file of [input, ...recurseDeps(input)].reverse()) {
|
|
84
84
|
addFile(file, registry);
|
|
@@ -21,7 +21,7 @@ export declare function sizeDelimitedEncode<Desc extends DescMessage>(messageDes
|
|
|
21
21
|
* This size-delimited format is compatible with other implementations.
|
|
22
22
|
* For details, see https://github.com/protocolbuffers/protobuf/issues/10229
|
|
23
23
|
*/
|
|
24
|
-
export declare function sizeDelimitedDecodeStream<Desc extends DescMessage>(messageDesc: Desc, iterable: AsyncIterable<Uint8Array>, options?: BinaryReadOptions):
|
|
24
|
+
export declare function sizeDelimitedDecodeStream<Desc extends DescMessage>(messageDesc: Desc, iterable: AsyncIterable<Uint8Array>, options?: BinaryReadOptions): AsyncIterableIterator<MessageShape<Desc>>;
|
|
25
25
|
/**
|
|
26
26
|
* Decodes the size from the given size-delimited message, which may be
|
|
27
27
|
* incomplete.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bufbuild/protobuf",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.2",
|
|
4
4
|
"license": "(Apache-2.0 AND BSD-3-Clause)",
|
|
5
5
|
"description": "A complete implementation of Protocol Buffers in TypeScript, suitable for web browsers and Node.js.",
|
|
6
6
|
"repository": {
|
|
@@ -9,14 +9,17 @@
|
|
|
9
9
|
"directory": "packages/protobuf"
|
|
10
10
|
},
|
|
11
11
|
"scripts": {
|
|
12
|
-
"
|
|
12
|
+
"prebuild": "rm -rf ./dist/*",
|
|
13
13
|
"build": "npm run build:cjs && npm run build:esm",
|
|
14
|
-
"build:cjs": "../../node_modules/typescript/bin/tsc --project tsconfig.json --module commonjs --verbatimModuleSyntax false --moduleResolution node10 --outDir ./dist/cjs
|
|
15
|
-
"build:esm": "../../node_modules/typescript/bin/tsc --project tsconfig.json --outDir ./dist/esm
|
|
14
|
+
"build:cjs": "../../node_modules/typescript/bin/tsc --project tsconfig.json --module commonjs --verbatimModuleSyntax false --moduleResolution node10 --outDir ./dist/cjs && echo >./dist/cjs/package.json '{\"type\":\"commonjs\"}'",
|
|
15
|
+
"build:esm": "../../node_modules/typescript/bin/tsc --project tsconfig.json --outDir ./dist/esm",
|
|
16
16
|
"bootstrap:inject": "node scripts/bootstrap-inject.mjs src",
|
|
17
17
|
"prebootstrap:wkt": "rm -rf .tmp && mkdir -p .tmp && cp -rp src/wkt/gen/* .tmp",
|
|
18
18
|
"bootstrap:wkt": "protoc --es_out=src/wkt/gen --es_opt=bootstrap_wkt=true,target=ts,import_extension=.js,json_types=true --proto_path $(upstream-include wkt) $(upstream-files wkt) && license-header src/wkt/gen",
|
|
19
19
|
"postbootstrap:wkt": "diff >/dev/null -r .tmp src/wkt/gen && cp -rp .tmp/* src/wkt/gen || true",
|
|
20
|
+
"format": "prettier --write --ignore-unknown '.' '!dist' '!src/wkt/gen'",
|
|
21
|
+
"license-header": "license-header --ignore 'src/wire/varint.ts'",
|
|
22
|
+
"lint": "eslint --max-warnings 0 .",
|
|
20
23
|
"attw": "attw --pack"
|
|
21
24
|
},
|
|
22
25
|
"type": "module",
|