@bufbuild/protobuf 2.0.0-beta.2 → 2.0.0-beta.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.
Files changed (83) hide show
  1. package/README.md +15 -13
  2. package/dist/cjs/clone.js +1 -2
  3. package/dist/cjs/codegenv1/boot.js +2 -3
  4. package/dist/cjs/codegenv1/embed.js +3 -4
  5. package/dist/cjs/codegenv1/enum.d.ts +2 -2
  6. package/dist/cjs/codegenv1/enum.js +2 -3
  7. package/dist/cjs/codegenv1/extension.d.ts +2 -2
  8. package/dist/cjs/codegenv1/extension.js +1 -2
  9. package/dist/cjs/codegenv1/file.js +1 -2
  10. package/dist/cjs/codegenv1/message.d.ts +2 -2
  11. package/dist/cjs/codegenv1/message.js +1 -2
  12. package/dist/cjs/codegenv1/restore-json-names.js +1 -2
  13. package/dist/cjs/codegenv1/scalar.js +2 -3
  14. package/dist/cjs/codegenv1/service.d.ts +2 -2
  15. package/dist/cjs/codegenv1/service.js +1 -2
  16. package/dist/cjs/codegenv1/symbols.d.ts +5 -5
  17. package/dist/cjs/codegenv1/symbols.js +5 -5
  18. package/dist/cjs/codegenv1/types.d.ts +9 -7
  19. package/dist/cjs/create.js +5 -4
  20. package/dist/cjs/descriptors.d.ts +4 -0
  21. package/dist/cjs/equals.js +1 -2
  22. package/dist/cjs/extensions.js +7 -8
  23. package/dist/cjs/fields.js +2 -3
  24. package/dist/cjs/from-binary.js +3 -4
  25. package/dist/cjs/from-json.js +6 -7
  26. package/dist/cjs/is-message.js +1 -2
  27. package/dist/cjs/reflect/error.js +2 -2
  28. package/dist/cjs/reflect/guard.js +5 -6
  29. package/dist/cjs/reflect/names.js +2 -3
  30. package/dist/cjs/reflect/nested-types.js +2 -3
  31. package/dist/cjs/reflect/reflect-check.js +4 -5
  32. package/dist/cjs/reflect/reflect.js +3 -4
  33. package/dist/cjs/reflect/scalar.js +3 -4
  34. package/dist/cjs/reflect/unsafe.js +7 -7
  35. package/dist/cjs/registry.js +15 -9
  36. package/dist/cjs/to-binary.js +2 -3
  37. package/dist/cjs/to-json.js +5 -6
  38. package/dist/cjs/types.d.ts +8 -8
  39. package/dist/cjs/wire/base64-encoding.js +2 -3
  40. package/dist/cjs/wire/size-delimited.js +3 -4
  41. package/dist/cjs/wire/text-encoding.js +2 -3
  42. package/dist/cjs/wire/text-format.js +2 -3
  43. package/dist/cjs/wire/varint.js +7 -8
  44. package/dist/cjs/wkt/any.js +4 -5
  45. package/dist/cjs/wkt/gen/google/protobuf/any_pb.d.ts +3 -3
  46. package/dist/cjs/wkt/gen/google/protobuf/api_pb.d.ts +5 -5
  47. package/dist/cjs/wkt/gen/google/protobuf/compiler/plugin_pb.d.ts +7 -7
  48. package/dist/cjs/wkt/gen/google/protobuf/descriptor_pb.d.ts +52 -52
  49. package/dist/cjs/wkt/gen/google/protobuf/duration_pb.d.ts +3 -3
  50. package/dist/cjs/wkt/gen/google/protobuf/empty_pb.d.ts +3 -3
  51. package/dist/cjs/wkt/gen/google/protobuf/field_mask_pb.d.ts +3 -3
  52. package/dist/cjs/wkt/gen/google/protobuf/source_context_pb.d.ts +3 -3
  53. package/dist/cjs/wkt/gen/google/protobuf/struct_pb.d.ts +6 -6
  54. package/dist/cjs/wkt/gen/google/protobuf/timestamp_pb.d.ts +3 -3
  55. package/dist/cjs/wkt/gen/google/protobuf/type_pb.d.ts +10 -10
  56. package/dist/cjs/wkt/gen/google/protobuf/wrappers_pb.d.ts +11 -11
  57. package/dist/cjs/wkt/timestamp.js +5 -6
  58. package/dist/cjs/wkt/wrappers.js +2 -3
  59. package/dist/esm/codegenv1/enum.d.ts +2 -2
  60. package/dist/esm/codegenv1/extension.d.ts +2 -2
  61. package/dist/esm/codegenv1/message.d.ts +2 -2
  62. package/dist/esm/codegenv1/service.d.ts +2 -2
  63. package/dist/esm/codegenv1/symbols.d.ts +5 -5
  64. package/dist/esm/codegenv1/symbols.js +5 -5
  65. package/dist/esm/codegenv1/types.d.ts +9 -7
  66. package/dist/esm/create.js +4 -2
  67. package/dist/esm/descriptors.d.ts +4 -0
  68. package/dist/esm/registry.js +11 -5
  69. package/dist/esm/to-json.js +2 -2
  70. package/dist/esm/types.d.ts +8 -8
  71. package/dist/esm/wkt/gen/google/protobuf/any_pb.d.ts +3 -3
  72. package/dist/esm/wkt/gen/google/protobuf/api_pb.d.ts +5 -5
  73. package/dist/esm/wkt/gen/google/protobuf/compiler/plugin_pb.d.ts +7 -7
  74. package/dist/esm/wkt/gen/google/protobuf/descriptor_pb.d.ts +52 -52
  75. package/dist/esm/wkt/gen/google/protobuf/duration_pb.d.ts +3 -3
  76. package/dist/esm/wkt/gen/google/protobuf/empty_pb.d.ts +3 -3
  77. package/dist/esm/wkt/gen/google/protobuf/field_mask_pb.d.ts +3 -3
  78. package/dist/esm/wkt/gen/google/protobuf/source_context_pb.d.ts +3 -3
  79. package/dist/esm/wkt/gen/google/protobuf/struct_pb.d.ts +6 -6
  80. package/dist/esm/wkt/gen/google/protobuf/timestamp_pb.d.ts +3 -3
  81. package/dist/esm/wkt/gen/google/protobuf/type_pb.d.ts +10 -10
  82. package/dist/esm/wkt/gen/google/protobuf/wrappers_pb.d.ts +11 -11
  83. package/package.json +8 -4
@@ -1,11 +1,11 @@
1
- import type { GenDescEnum, GenDescFile, GenDescMessage } from "../../../../codegenv1/types.js";
1
+ import type { GenEnum, GenFile, GenMessage } from "../../../../codegenv1/types.js";
2
2
  import type { Any, AnyJson } from "./any_pb.js";
3
3
  import type { SourceContext, SourceContextJson } from "./source_context_pb.js";
4
4
  import type { Message } from "../../../../types.js";
5
5
  /**
6
6
  * Describes the file google/protobuf/type.proto.
7
7
  */
8
- export declare const file_google_protobuf_type: GenDescFile;
8
+ export declare const file_google_protobuf_type: GenFile;
9
9
  /**
10
10
  * A protocol buffer message type.
11
11
  *
@@ -92,7 +92,7 @@ export type TypeJson = {
92
92
  * Describes the message google.protobuf.Type.
93
93
  * Use `create(TypeSchema)` to create a new message.
94
94
  */
95
- export declare const TypeSchema: GenDescMessage<Type, TypeJson>;
95
+ export declare const TypeSchema: GenMessage<Type, TypeJson>;
96
96
  /**
97
97
  * A single field of a message type.
98
98
  *
@@ -211,7 +211,7 @@ export type FieldJson = {
211
211
  * Describes the message google.protobuf.Field.
212
212
  * Use `create(FieldSchema)` to create a new message.
213
213
  */
214
- export declare const FieldSchema: GenDescMessage<Field, FieldJson>;
214
+ export declare const FieldSchema: GenMessage<Field, FieldJson>;
215
215
  /**
216
216
  * Basic field types.
217
217
  *
@@ -340,7 +340,7 @@ export type Field_KindJson = "TYPE_UNKNOWN" | "TYPE_DOUBLE" | "TYPE_FLOAT" | "TY
340
340
  /**
341
341
  * Describes the enum google.protobuf.Field.Kind.
342
342
  */
343
- export declare const Field_KindSchema: GenDescEnum<Field_Kind, Field_KindJson>;
343
+ export declare const Field_KindSchema: GenEnum<Field_Kind, Field_KindJson>;
344
344
  /**
345
345
  * Whether a field is optional, required, or repeated.
346
346
  *
@@ -379,7 +379,7 @@ export type Field_CardinalityJson = "CARDINALITY_UNKNOWN" | "CARDINALITY_OPTIONA
379
379
  /**
380
380
  * Describes the enum google.protobuf.Field.Cardinality.
381
381
  */
382
- export declare const Field_CardinalitySchema: GenDescEnum<Field_Cardinality, Field_CardinalityJson>;
382
+ export declare const Field_CardinalitySchema: GenEnum<Field_Cardinality, Field_CardinalityJson>;
383
383
  /**
384
384
  * Enum type definition.
385
385
  *
@@ -456,7 +456,7 @@ export type EnumJson = {
456
456
  * Describes the message google.protobuf.Enum.
457
457
  * Use `create(EnumSchema)` to create a new message.
458
458
  */
459
- export declare const EnumSchema: GenDescMessage<Enum, EnumJson>;
459
+ export declare const EnumSchema: GenMessage<Enum, EnumJson>;
460
460
  /**
461
461
  * Enum value definition.
462
462
  *
@@ -503,7 +503,7 @@ export type EnumValueJson = {
503
503
  * Describes the message google.protobuf.EnumValue.
504
504
  * Use `create(EnumValueSchema)` to create a new message.
505
505
  */
506
- export declare const EnumValueSchema: GenDescMessage<EnumValue, EnumValueJson>;
506
+ export declare const EnumValueSchema: GenMessage<EnumValue, EnumValueJson>;
507
507
  /**
508
508
  * A protocol buffer option, which can be attached to a message, field,
509
509
  * enumeration, etc.
@@ -547,7 +547,7 @@ export type OptionJson = {
547
547
  * Describes the message google.protobuf.Option.
548
548
  * Use `create(OptionSchema)` to create a new message.
549
549
  */
550
- export declare const OptionSchema: GenDescMessage<Option, OptionJson>;
550
+ export declare const OptionSchema: GenMessage<Option, OptionJson>;
551
551
  /**
552
552
  * The syntax in which a protocol buffer element is defined.
553
553
  *
@@ -580,4 +580,4 @@ export type SyntaxJson = "SYNTAX_PROTO2" | "SYNTAX_PROTO3" | "SYNTAX_EDITIONS";
580
580
  /**
581
581
  * Describes the enum google.protobuf.Syntax.
582
582
  */
583
- export declare const SyntaxSchema: GenDescEnum<Syntax, SyntaxJson>;
583
+ export declare const SyntaxSchema: GenEnum<Syntax, SyntaxJson>;
@@ -1,9 +1,9 @@
1
- import type { GenDescFile, GenDescMessage } from "../../../../codegenv1/types.js";
1
+ import type { GenFile, GenMessage } from "../../../../codegenv1/types.js";
2
2
  import type { Message } from "../../../../types.js";
3
3
  /**
4
4
  * Describes the file google/protobuf/wrappers.proto.
5
5
  */
6
- export declare const file_google_protobuf_wrappers: GenDescFile;
6
+ export declare const file_google_protobuf_wrappers: GenFile;
7
7
  /**
8
8
  * Wrapper message for `double`.
9
9
  *
@@ -27,7 +27,7 @@ export type DoubleValueJson = number | "NaN" | "Infinity" | "-Infinity";
27
27
  * Describes the message google.protobuf.DoubleValue.
28
28
  * Use `create(DoubleValueSchema)` to create a new message.
29
29
  */
30
- export declare const DoubleValueSchema: GenDescMessage<DoubleValue, DoubleValueJson>;
30
+ export declare const DoubleValueSchema: GenMessage<DoubleValue, DoubleValueJson>;
31
31
  /**
32
32
  * Wrapper message for `float`.
33
33
  *
@@ -51,7 +51,7 @@ export type FloatValueJson = number | "NaN" | "Infinity" | "-Infinity";
51
51
  * Describes the message google.protobuf.FloatValue.
52
52
  * Use `create(FloatValueSchema)` to create a new message.
53
53
  */
54
- export declare const FloatValueSchema: GenDescMessage<FloatValue, FloatValueJson>;
54
+ export declare const FloatValueSchema: GenMessage<FloatValue, FloatValueJson>;
55
55
  /**
56
56
  * Wrapper message for `int64`.
57
57
  *
@@ -75,7 +75,7 @@ export type Int64ValueJson = string;
75
75
  * Describes the message google.protobuf.Int64Value.
76
76
  * Use `create(Int64ValueSchema)` to create a new message.
77
77
  */
78
- export declare const Int64ValueSchema: GenDescMessage<Int64Value, Int64ValueJson>;
78
+ export declare const Int64ValueSchema: GenMessage<Int64Value, Int64ValueJson>;
79
79
  /**
80
80
  * Wrapper message for `uint64`.
81
81
  *
@@ -99,7 +99,7 @@ export type UInt64ValueJson = string;
99
99
  * Describes the message google.protobuf.UInt64Value.
100
100
  * Use `create(UInt64ValueSchema)` to create a new message.
101
101
  */
102
- export declare const UInt64ValueSchema: GenDescMessage<UInt64Value, UInt64ValueJson>;
102
+ export declare const UInt64ValueSchema: GenMessage<UInt64Value, UInt64ValueJson>;
103
103
  /**
104
104
  * Wrapper message for `int32`.
105
105
  *
@@ -123,7 +123,7 @@ export type Int32ValueJson = number;
123
123
  * Describes the message google.protobuf.Int32Value.
124
124
  * Use `create(Int32ValueSchema)` to create a new message.
125
125
  */
126
- export declare const Int32ValueSchema: GenDescMessage<Int32Value, Int32ValueJson>;
126
+ export declare const Int32ValueSchema: GenMessage<Int32Value, Int32ValueJson>;
127
127
  /**
128
128
  * Wrapper message for `uint32`.
129
129
  *
@@ -147,7 +147,7 @@ export type UInt32ValueJson = number;
147
147
  * Describes the message google.protobuf.UInt32Value.
148
148
  * Use `create(UInt32ValueSchema)` to create a new message.
149
149
  */
150
- export declare const UInt32ValueSchema: GenDescMessage<UInt32Value, UInt32ValueJson>;
150
+ export declare const UInt32ValueSchema: GenMessage<UInt32Value, UInt32ValueJson>;
151
151
  /**
152
152
  * Wrapper message for `bool`.
153
153
  *
@@ -171,7 +171,7 @@ export type BoolValueJson = boolean;
171
171
  * Describes the message google.protobuf.BoolValue.
172
172
  * Use `create(BoolValueSchema)` to create a new message.
173
173
  */
174
- export declare const BoolValueSchema: GenDescMessage<BoolValue, BoolValueJson>;
174
+ export declare const BoolValueSchema: GenMessage<BoolValue, BoolValueJson>;
175
175
  /**
176
176
  * Wrapper message for `string`.
177
177
  *
@@ -195,7 +195,7 @@ export type StringValueJson = string;
195
195
  * Describes the message google.protobuf.StringValue.
196
196
  * Use `create(StringValueSchema)` to create a new message.
197
197
  */
198
- export declare const StringValueSchema: GenDescMessage<StringValue, StringValueJson>;
198
+ export declare const StringValueSchema: GenMessage<StringValue, StringValueJson>;
199
199
  /**
200
200
  * Wrapper message for `bytes`.
201
201
  *
@@ -219,4 +219,4 @@ export type BytesValueJson = string;
219
219
  * Describes the message google.protobuf.BytesValue.
220
220
  * Use `create(BytesValueSchema)` to create a new message.
221
221
  */
222
- export declare const BytesValueSchema: GenDescMessage<BytesValue, BytesValueJson>;
222
+ export declare const BytesValueSchema: GenMessage<BytesValue, BytesValueJson>;
package/package.json CHANGED
@@ -1,8 +1,14 @@
1
1
  {
2
2
  "name": "@bufbuild/protobuf",
3
- "version": "2.0.0-beta.2",
3
+ "version": "2.0.0-beta.3",
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
+ "keywords": [
7
+ "protobuf",
8
+ "schema",
9
+ "typescript",
10
+ "ecmascript"
11
+ ],
6
12
  "repository": {
7
13
  "type": "git",
8
14
  "url": "https://github.com/bufbuild/protobuf-es.git",
@@ -14,9 +20,7 @@
14
20
  "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
21
  "build:esm": "../../node_modules/typescript/bin/tsc --project tsconfig.json --outDir ./dist/esm",
16
22
  "bootstrap:inject": "node scripts/bootstrap-inject.mjs src",
17
- "prebootstrap:wkt": "rm -rf .tmp && mkdir -p .tmp && cp -rp src/wkt/gen/* .tmp",
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
- "postbootstrap:wkt": "diff >/dev/null -r .tmp src/wkt/gen && cp -rp .tmp/* src/wkt/gen || true",
23
+ "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",
20
24
  "format": "prettier --write --ignore-unknown '.' '!dist' '!src/wkt/gen'",
21
25
  "license-header": "license-header --ignore 'src/wire/varint.ts'",
22
26
  "lint": "eslint --max-warnings 0 .",