Skip to content

Commit fe66d80

Browse files
authored
V2: Move Registry to the top level exports (#841)
1 parent d1cd584 commit fe66d80

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+210
-185
lines changed

packages/protobuf-bench/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ server would usually do.
1010

1111
| code generator | bundle size | minified | compressed |
1212
|---------------------|------------------------:|-----------------------:|-------------------:|
13-
| protobuf-es | 126,744 b | 66,286 b | 16,005 b |
13+
| protobuf-es | 126,776 b | 66,286 b | 15,998 b |
1414
| protobuf-javascript | 394,384 b | 288,654 b | 45,122 b |

packages/protobuf-test/src/reflect/registry.test.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,17 @@ import {
1818
type FileRegistry,
1919
createFileRegistry,
2020
createRegistry,
21-
LongType,
2221
protoCamelCase,
23-
ScalarType,
2422
} from "@bufbuild/protobuf/reflect";
25-
import type {
26-
DescEnum,
27-
DescExtension,
28-
DescFile,
29-
DescMessage,
30-
DescOneof,
31-
DescService,
23+
import {
24+
type DescEnum,
25+
type DescExtension,
26+
type DescFile,
27+
type DescMessage,
28+
type DescOneof,
29+
type DescService,
30+
LongType,
31+
ScalarType,
3232
} from "@bufbuild/protobuf";
3333
import {
3434
type FileDescriptorSet,

packages/protobuf/src/clone.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,10 @@
1313
// limitations under the License.
1414

1515
import type { MessageShape } from "./types.js";
16-
import type { DescField, DescMessage } from "./desc-types.js";
16+
import { type DescField, type DescMessage, ScalarType } from "./descriptors.js";
1717
import type { ReflectMessage } from "./reflect/reflect-types.js";
1818
import { reflect } from "./reflect/reflect.js";
1919
import { isReflectMessage } from "./reflect/guard.js";
20-
import { ScalarType } from "./reflect/scalar.js";
2120

2221
/**
2322
* Create a deep copy of a message, including extensions and unknown fields.

packages/protobuf/src/codegenv1/boot.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ import type {
2626
FieldOptions,
2727
EnumDescriptorProto,
2828
} from "../wkt/gen/google/protobuf/descriptor_pb.js";
29-
import type { DescFile } from "../desc-types.js";
29+
import type { DescFile } from "../descriptors.js";
3030
import { restoreJsonNames } from "./restore-json-names.js";
31-
import { createFileRegistry } from "../reflect/registry.js";
31+
import { createFileRegistry } from "../registry.js";
3232
import { assert } from "../reflect/assert.js";
3333

3434
/**

packages/protobuf/src/codegenv1/embed.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import type {
1717
DescExtension,
1818
DescMessage,
1919
DescService,
20-
} from "../desc-types.js";
20+
} from "../descriptors.js";
2121
import { protoCamelCase } from "../reflect/names.js";
2222
import { assert } from "../reflect/assert.js";
2323
import { isFieldSet, clearField } from "../fields.js";

packages/protobuf/src/codegenv1/enum.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
import type { DescEnum, DescFile } from "../desc-types.js";
15+
import type { DescEnum, DescFile } from "../descriptors.js";
1616
import type { GenDescEnum } from "./types.js";
1717

1818
/**

packages/protobuf/src/codegenv1/extension.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// limitations under the License.
1414

1515
import type { Message } from "../types.js";
16-
import type { DescFile } from "../desc-types.js";
16+
import type { DescFile } from "../descriptors.js";
1717
import type { GenDescExtension } from "./types.js";
1818

1919
/**

packages/protobuf/src/codegenv1/file.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414

1515
import { base64Decode } from "../wire/index.js";
1616
import { FileDescriptorProtoDesc } from "../wkt/gen/google/protobuf/descriptor_pb.js";
17-
import type { DescFile } from "../desc-types.js";
18-
import { createFileRegistry } from "../reflect/registry.js";
17+
import type { DescFile } from "../descriptors.js";
18+
import { createFileRegistry } from "../registry.js";
1919
import { assert } from "../reflect/assert.js";
2020
import { restoreJsonNames } from "./restore-json-names.js";
2121
import { fromBinary } from "../from-binary.js";

packages/protobuf/src/codegenv1/message.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// limitations under the License.
1414

1515
import type { Message } from "../types.js";
16-
import type { DescFile } from "../desc-types.js";
16+
import type { DescFile } from "../descriptors.js";
1717
import type { GenDescMessage } from "./types.js";
1818

1919
/**

packages/protobuf/src/codegenv1/service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// limitations under the License.
1414

1515
import type { GenDescService, GenDescServiceShape } from "./types.js";
16-
import type { DescFile } from "../desc-types.js";
16+
import type { DescFile } from "../descriptors.js";
1717

1818
/**
1919
* Hydrate a service descriptor.

0 commit comments

Comments
 (0)