ts-proto 1.123.1 → 1.124.0

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/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # [1.124.0](https://github.com/stephenh/ts-proto/compare/v1.123.1...v1.124.0) (2022-09-03)
2
+
3
+
4
+ ### Features
5
+
6
+ * Bump ts poet for dprint perf increase ([#668](https://github.com/stephenh/ts-proto/issues/668)) ([961d388](https://github.com/stephenh/ts-proto/commit/961d388fa7dc7cb25fbe700526cbd481f3a48ae1))
7
+
1
8
  ## [1.123.1](https://github.com/stephenh/ts-proto/compare/v1.123.0...v1.123.1) (2022-08-27)
2
9
 
3
10
 
package/README.markdown CHANGED
@@ -482,7 +482,7 @@ const sendRequest: RpcImpl = (service, method, data) => {
482
482
  // Conventionally in gRPC, the request path looks like
483
483
  // "package.names.ServiceName/MethodName",
484
484
  // we therefore construct such a string
485
- const path = `${service}/${method}`;
485
+ const path = `/${service}/${method}`;
486
486
 
487
487
  return new Promise((resolve, reject) => {
488
488
  // makeUnaryRequest transmits the result (and error) with a callback
package/build/options.js CHANGED
@@ -168,6 +168,7 @@ function parseParameter(parameter) {
168
168
  function getTsPoetOpts(_options) {
169
169
  const imports = ["protobufjs/minimal" + _options.importSuffix];
170
170
  return {
171
+ prefix: `/* eslint-disable */`,
171
172
  dprintOptions: { preferSingleLine: true, lineWidth: 120 },
172
173
  ...(_options.esModuleInterop ? { forceDefaultImport: imports } : { forceModuleImport: imports }),
173
174
  };
package/build/plugin.js CHANGED
@@ -20,16 +20,16 @@ async function main() {
20
20
  const filesToGenerate = options.emitImportedFiles ? request.protoFile : (0, utils_1.protoFilesToGenerate)(request);
21
21
  const files = await Promise.all(filesToGenerate.map(async (file) => {
22
22
  const [path, code] = (0, main_1.generateFile)(ctx, file);
23
- const spec = await code.toStringWithImports({ ...(0, options_1.getTsPoetOpts)(options), path });
24
- return { name: path, content: (0, utils_1.prefixDisableLinter)(spec) };
23
+ const content = code.toString({ ...(0, options_1.getTsPoetOpts)(options), path });
24
+ return { name: path, content };
25
25
  }));
26
26
  if (options.outputTypeRegistry) {
27
27
  const utils = (0, main_1.makeUtils)(options);
28
28
  const ctx = { options, typeMap, utils };
29
29
  const path = "typeRegistry.ts";
30
30
  const code = (0, generate_type_registry_1.generateTypeRegistry)(ctx);
31
- const spec = await code.toStringWithImports({ ...(0, options_1.getTsPoetOpts)(options), path });
32
- files.push({ name: path, content: (0, utils_1.prefixDisableLinter)(spec) });
31
+ const content = code.toString({ ...(0, options_1.getTsPoetOpts)(options), path });
32
+ files.push({ name: path, content });
33
33
  }
34
34
  const response = ts_proto_descriptors_1.CodeGeneratorResponse.fromPartial({
35
35
  file: files,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ts-proto",
3
- "version": "1.123.1",
3
+ "version": "1.124.0",
4
4
  "description": "",
5
5
  "main": "build/plugin.js",
6
6
  "repository": "github:stephenh/ts-proto",
@@ -67,7 +67,7 @@
67
67
  "dataloader": "^1.4.0",
68
68
  "object-hash": "^1.3.1",
69
69
  "protobufjs": "^6.11.3",
70
- "ts-poet": "^5.1.0",
70
+ "ts-poet": "^6.1.0",
71
71
  "ts-proto-descriptors": "1.7.1"
72
72
  }
73
73
  }