@aptre/protobuf-es-lite 0.5.0 → 0.5.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/dist/index.d.ts CHANGED
@@ -10,7 +10,6 @@ export { int64FromString, int64ToString, uInt64ToString } from "./varint.js";
10
10
  export { protoInt64 } from "./proto-int64.js";
11
11
  export { protoBase64 } from "./proto-base64.js";
12
12
  export { protoDouble } from "./proto-double.js";
13
- export { Timestamp, Duration, Any, Empty, DoubleValue, FloatValue, Int64Value, UInt64Value, Int32Value, UInt32Value, BoolValue, StringValue, BytesValue, Value, NullValue, ListValue, Struct, } from "./google/index.js";
14
13
  export { DescComments, AnyDesc, DescEnum, DescEnumValue, DescExtension, DescField, DescFile, DescMessage, DescMethod, DescOneof, DescService, DescriptorSet, } from "./descriptor-set.js";
15
14
  export { jsonReadEnum, jsonReadField, jsonReadMapKey, jsonReadScalar, jsonReadMessage, jsonWriteEnum, jsonWriteField, jsonWriteScalar, jsonWriteMessage, jsonDebugValue, JsonValue, JsonObject, JsonReadOptions, jsonMakeReadOptions, JsonWriteOptions, JsonWriteStringOptions, jsonMakeWriteOptions, } from "./json.js";
16
15
  export { binaryReadField, binaryReadMapEntry, binaryReadScalar, binaryReadScalarLTString, binaryReadMessage, binaryWriteField, binaryWriteScalar, binaryWritePacked, binaryWriteMapEntry, binaryWriteMessage, binaryMakeReadOptions, binaryMakeWriteOptions, BinaryReadOptions, BinaryWriteOptions, } from "./binary.js";
package/dist/index.js CHANGED
@@ -10,7 +10,6 @@ export { int64FromString, int64ToString, uInt64ToString } from "./varint.js";
10
10
  export { protoInt64 } from "./proto-int64.js";
11
11
  export { protoBase64 } from "./proto-base64.js";
12
12
  export { protoDouble } from "./proto-double.js";
13
- export { Timestamp, Duration, Any, Empty, DoubleValue, FloatValue, Int64Value, UInt64Value, Int32Value, UInt32Value, BoolValue, StringValue, BytesValue, Value, NullValue, ListValue, Struct, } from "./google/index.js";
14
13
  export { jsonReadEnum, jsonReadField, jsonReadMapKey, jsonReadScalar, jsonReadMessage, jsonWriteEnum, jsonWriteField, jsonWriteScalar, jsonWriteMessage, jsonDebugValue, jsonMakeReadOptions, jsonMakeWriteOptions, } from "./json.js";
15
14
  export { binaryReadField, binaryReadMapEntry, binaryReadScalar, binaryReadScalarLTString, binaryReadMessage, binaryWriteField, binaryWriteScalar, binaryWritePacked, binaryWriteMapEntry, binaryWriteMessage, binaryMakeReadOptions, binaryMakeWriteOptions, } from "./binary.js";
16
15
  export { compareFieldZeroValue, isMessageZeroValue, getFieldZeroValue, } from "./zero-value.js";
@@ -49,10 +49,6 @@ export interface GeneratedFile {
49
49
  * See print(Printable[]) for behavior when printing Printable items.
50
50
  */
51
51
  print(fragments: TemplateStringsArray, ...printables: Printable[]): void;
52
- /**
53
- * @deprecated Please use createImportSymbol() from @bufbuild/protoplugin/ecmascript instead
54
- */
55
- export(name: string): ImportSymbol;
56
52
  /**
57
53
  * Create a string literal.
58
54
  */
@@ -40,9 +40,6 @@ export function createGeneratedFile(name, importPath, jsImportStyle, rewriteImpo
40
40
  printableToEl(printables, el, createTypeImport, runtimeImports);
41
41
  el.push("\n");
42
42
  },
43
- export(name) {
44
- return createImportSymbol(name, importPath);
45
- },
46
43
  exportDecl(declaration, name) {
47
44
  return {
48
45
  kind: "es_export_decl",
@@ -96,7 +96,7 @@ export function makeImportPath(file, bootstrapWkt, filesToGenerate) {
96
96
  if (!bootstrapWkt &&
97
97
  !filesToGenerate.includes(file) &&
98
98
  codegenInfo.wktSourceFiles.includes(file.name + ".proto")) {
99
- return codegenInfo.packageName;
99
+ return codegenInfo.packageName + "/" + file.name;
100
100
  }
101
101
  return "./" + file.name + ".pb.js";
102
102
  }
@@ -3,12 +3,8 @@
3
3
  /* eslint-disable */
4
4
 
5
5
  import type { MessageType, PartialFieldInfo } from "../src/index.js";
6
- import {
7
- createEnumType,
8
- createMessageType,
9
- ScalarType,
10
- Timestamp,
11
- } from "../src/index.js";
6
+ import { createEnumType, createMessageType, ScalarType } from "../src/index.js";
7
+ import { Timestamp } from "../src/google/protobuf/timestamp.pb.js";
12
8
 
13
9
  export const protobufPackage = "example";
14
10
 
@@ -7,6 +7,9 @@
7
7
  "@aptre/protobuf-es-lite": [
8
8
  "../src",
9
9
  ],
10
+ "@aptre/protobuf-es-lite/google/*": [
11
+ "../src/google/*",
12
+ ]
10
13
  }
11
14
  }
12
15
  }
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.5.0",
4
+ "version": "0.5.2",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "url": "git+ssh://git@github.com/aperturerobotics/protobuf-es-lite.git"
@@ -23,34 +23,79 @@
23
23
  "type": "module",
24
24
  "exports": {
25
25
  ".": {
26
+ "types": "./dist/index.d.ts",
26
27
  "import": "./dist/index.js",
27
- "require": "./dist/index.js",
28
- "types": "./dist/index.d.ts"
28
+ "require": "./dist/index.js"
29
29
  },
30
30
  "./descriptor-set": {
31
+ "types": "./dist/descriptor-set.d.ts",
31
32
  "import": "./dist/descriptor-set.js",
32
- "require": "./dist/descriptor-set.js",
33
- "types": "./dist/descriptor-set.d.ts"
33
+ "require": "./dist/descriptor-set.js"
34
34
  },
35
35
  "./create-descriptor-set": {
36
+ "types": "./dist/create-descriptor-set.d.ts",
36
37
  "import": "./dist/create-descriptor-set.js",
37
- "require": "./dist/create-descriptor-set.js",
38
- "types": "./dist/create-descriptor-set.d.ts"
38
+ "require": "./dist/create-descriptor-set.js"
39
39
  },
40
40
  "./protoplugin": {
41
+ "types": "./dist/protoplugin/index.d.ts",
41
42
  "import": "./dist/protoplugin/index.js",
42
- "require": "./dist/protoplugin/index.js",
43
- "types": "./dist/protoplugin/index.d.ts"
43
+ "require": "./dist/protoplugin/index.js"
44
44
  },
45
45
  "./protoplugin/ecmascript": {
46
+ "types": "./dist/protoplugin/ecmascript/index.d.ts",
46
47
  "import": "./dist/protoplugin/ecmascript/index.js",
47
- "require": "./dist/protoplugin/ecmascript/index.js",
48
- "types": "./dist/protoplugin/ecmascript/index.d.ts"
48
+ "require": "./dist/protoplugin/ecmascript/index.js"
49
49
  },
50
50
  "./google": {
51
+ "types": "./dist/google/index.d.ts",
51
52
  "import": "./dist/google/index.js",
52
- "require": "./dist/google/index.js",
53
- "types": "./dist/google/index.d.ts"
53
+ "require": "./dist/google/index.js"
54
+ },
55
+ "./google/protobuf/type": {
56
+ "types": "./dist/google/protobuf/type.pb.d.ts",
57
+ "import": "./dist/google/protobuf/type.pb.js",
58
+ "require": "./dist/google/protobuf/type.pb.js"
59
+ },
60
+ "./google/protobuf/timestamp": {
61
+ "types": "./dist/google/protobuf/timestamp.pb.d.ts",
62
+ "import": "./dist/google/protobuf/timestamp.pb.js",
63
+ "require": "./dist/google/protobuf/timestamp.pb.js"
64
+ },
65
+ "./google/protobuf/duration": {
66
+ "types": "./dist/google/protobuf/duration.pb.d.ts",
67
+ "import": "./dist/google/protobuf/duration.pb.js",
68
+ "require": "./dist/google/protobuf/duration.pb.js"
69
+ },
70
+ "./google/protobuf/any": {
71
+ "types": "./dist/google/protobuf/any.pb.d.ts",
72
+ "import": "./dist/google/protobuf/any.pb.js",
73
+ "require": "./dist/google/protobuf/any.pb.js"
74
+ },
75
+ "./google/protobuf/empty": {
76
+ "types": "./dist/google/protobuf/empty.pb.d.ts",
77
+ "import": "./dist/google/protobuf/empty.pb.js",
78
+ "require": "./dist/google/protobuf/empty.pb.js"
79
+ },
80
+ "./google/protobuf/wrappers": {
81
+ "types": "./dist/google/protobuf/wrappers.pb.d.ts",
82
+ "import": "./dist/google/protobuf/wrappers.pb.js",
83
+ "require": "./dist/google/protobuf/wrappers.pb.js"
84
+ },
85
+ "./google/protobuf/struct": {
86
+ "types": "./dist/google/protobuf/struct.pb.d.ts",
87
+ "import": "./dist/google/protobuf/struct.pb.js",
88
+ "require": "./dist/google/protobuf/struct.pb.js"
89
+ },
90
+ "./google/protobuf/api": {
91
+ "types": "./dist/google/protobuf/api.pb.d.ts",
92
+ "import": "./dist/google/protobuf/api.pb.js",
93
+ "require": "./dist/google/protobuf/api.pb.js"
94
+ },
95
+ "./google/protobuf/source_context": {
96
+ "types": "./dist/google/protobuf/source_context.pb.d.ts",
97
+ "import": "./dist/google/protobuf/source_context.pb.js",
98
+ "require": "./dist/google/protobuf/source_context.pb.js"
54
99
  }
55
100
  },
56
101
  "engines": {
package/tsconfig.json CHANGED
@@ -5,7 +5,17 @@
5
5
  "src/descriptor-set.ts",
6
6
  "src/create-descriptor-set.ts",
7
7
  "src/protoplugin/index.ts",
8
- "src/protoplugin/ecmascript/index.ts"
8
+ "src/protoplugin/ecmascript/index.ts",
9
+ "src/google/index.ts",
10
+ "src/google/protobuf/type.pb.ts",
11
+ "src/google/protobuf/timestamp.pb.ts",
12
+ "src/google/protobuf/duration.pb.ts",
13
+ "src/google/protobuf/any.pb.ts",
14
+ "src/google/protobuf/empty.pb.ts",
15
+ "src/google/protobuf/wrappers.pb.ts",
16
+ "src/google/protobuf/struct.pb.ts",
17
+ "src/google/protobuf/api.pb.ts",
18
+ "src/google/protobuf/source_context.pb.ts"
9
19
  ],
10
20
  "extends": "./tsconfig.base.json",
11
21
  "compilerOptions": {