Commit Graph

190 Commits

Author SHA1 Message Date
install d81ec8e532 Update golden tests - use input/output templates 2022-09-07 10:05:24 -04:00
install bc66ebf62f proto-loader-gen-types Typename templates
- Allow for customizing the naming pattern for both restricted and permissive types
2022-09-07 10:05:24 -04:00
Michael Lumish 09f3dd9e05
Merge pull request #2172 from chm-diederichs/proto-loader-maps
include `.map` files in proto-loader npm package
2022-08-29 14:33:25 -07:00
Michael Lumish d0e7f356db proto-loader: Undo upgrade of 'long' dependency 2022-08-17 12:44:48 -07:00
Michael Lumish f49c42c4c8
Merge pull request #2196 from murgatroid99/proto-loader_dep_fix
proto-loader: Update dependencies to fix compilation error
2022-08-17 10:20:59 -07:00
Michael Lumish 9d0eb60d19 proto-loader: Update dependencies to fix compilation error 2022-08-17 09:33:14 -07:00
Simen Bekkhus d23d7bdd09
remove types
`long` ships with types now
2022-08-09 12:32:57 +02:00
Simen Bekkhus 9e3935ec83
fix: update `long` to v5 2022-08-09 12:26:33 +02:00
Christophe Diederichs 924fb9a329 include proto-loader-gen-types.js.map in release 2022-07-22 09:23:22 +01:00
Christophe Diederichs 3ab4ee3467 include .map files in proto-loader npm package 2022-07-21 17:59:11 +01:00
Michael Lumish 7b4704cc92 proto-loader: Update protobufjs dependency to 7.x 2022-07-11 11:32:04 -07:00
Michael Lumish 475559f976 proto-loader: Increment version to 0.6.13 2022-06-06 14:08:13 -07:00
Conall Ó Cofaigh e94bd36bf1
bump protobufjs to "^6.11.3" 2022-05-30 13:54:05 +01:00
Michael Lumish d8d957bf8c proto-loader: Switch long dependency back to 4.x 2022-05-05 09:27:48 -07:00
Michael Lumish 2b67d5b010 proto-loader: Don't force long@5 2022-05-03 10:16:54 -07:00
Michael Lumish 3388765cbb proto-loader: Update to Long 5.x 2022-05-02 11:03:01 -07:00
Michael Lumish ee9226e3c8 proto-loader: Update version to 0.6.9 2022-01-05 10:51:45 -08:00
Michael Lumish f049333e48 proto-loader: Decrease dependency to yargs 16 for compatibility with Node <12 2022-01-05 10:51:00 -08:00
Michael Lumish 9f5187fbaa proto-loader: Increase version to 0.6.8 2022-01-04 10:09:17 -08:00
Michael Lumish 9f3001eb97 proto-loader: Update yargs to version 17 2022-01-04 10:08:40 -08:00
Michael Lumish 2af9a05ee4 Ensure consistent null in missing file names 2021-12-09 13:18:06 -05:00
Michael Lumish 8d771044e7 Make diff command work on Mac, make file comment use consistent directory separator 2021-12-09 12:46:59 -05:00
Michael Lumish f706d524e7 Ignore trailing whitespace in proto-loader golden file test diff 2021-12-09 10:47:48 -05:00
Michael Lumish 20dbaa8e27 Make npm clean scripts platform-agnostic 2021-12-08 14:54:56 -05:00
Michael Lumish 4b20bf3fce proto-loader: Fix generated types for callbacks 2021-11-15 10:05:10 -08:00
Michael Lumish 144c41b366 proto-loader: Make serializers reject arrays 2021-10-15 09:48:42 -07:00
Michael Lumish c95219b1ea proto-loader: Avoid generating conflicting method names in service clients 2021-09-07 14:38:58 -07:00
Michael Lumish 6ba982548e proto-loader: bump to 0.6.4 2021-06-28 13:17:16 -07:00
Mike Lewis 41e09f7d12
Prevent early return in proto-loader containsDefinition
f289c343b3 introduced a bug - the
recursive for-loop descended into the first elements nested array
and returned that value without iterating over the other members
of the array. This means that the code would only work correctly
when the protofile contained a definition whose name was alphabetically
first amongst its siblings.

This commit fixes the issue by moving the call to containsDefinition
into the if statement to allow iteration to continue if
containsDefinition returns false.
2021-06-28 19:40:18 +01:00
Michael Lumish 12b2412356 proto-loader: Bump to version 0.6.3 2021-06-23 12:46:53 -07:00
Mike Lewis 61e64a3c4f
Update golden-generated in proto-loader
Signed-off-by: Mike Lewis <mtlewis@users.noreply.github.com>
2021-06-23 17:55:38 +01:00
Mike Lewis f289c343b3
Avoid unused definition imports from proto-loader
Since proto files don't always contain all types of definition, it was
possible to get into a state where generated code contained unused
imports which caused TS errors. This change makes those imports
conditional on the existence of the corresponding definitions in the
proto file.

Co-authored-by: Austin Puri <austin.puri@gmail.com>
Co-authored-by: Joe Porpeglia <josephp@spotify.com>
Signed-off-by: Mike Lewis <mtlewis@users.noreply.github.com>
2021-06-23 16:46:23 +01:00
Michael Lumish 7c2acccff5 proto-loader: Bump to 0.6.2 2021-05-06 14:28:15 -07:00
Eduardo Laranjo a5fb029e70 Add new generated golden files 2021-05-05 13:41:45 +01:00
@EduardoLaranjo 4c767ca946
Fix auto-generated service definition
relate to issue #1766
2021-05-04 19:27:24 +01:00
Michael Lumish bf2e5cb1dd
Merge pull request #1745 from murgatroid99/proto-loader_generate_service_definition
proto-loader: generator: add specific service definition interfaces
2021-04-14 13:58:19 -07:00
Michael Lumish e7dccd6656 proto-loader: Bump version to 0.6.1 2021-04-08 13:00:04 -07:00
Michael Lumish c3a49262cc proto-loader: generator: add specific service definition interfaces 2021-04-08 12:56:50 -07:00
Michael Lumish 799bd16fe6 proto-loader: generator: allow for null message values 2021-04-08 11:22:04 -07:00
Michael Lumish b920292b59
Merge pull request #1474 from murgatroid99/proto-loader_type_generator
proto-loader: Add TypeScript generator
2021-04-06 10:31:18 -07:00
Michael Lumish 65f1eb4a29 Add default values to generator usage info 2021-04-01 11:53:30 -07:00
Michael Lumish 0aa99dd4fb Merge branch 'proto-loader_type_generator' of github.com:murgatroid99/grpc-node into proto-loader_type_generator 2021-03-31 13:22:26 -07:00
Michael Lumish 3ac1e6ddb8 Address review comments 2021-03-31 13:22:08 -07:00
Michael Lumish 4742f9d57e Combine output for input files with the same basename 2021-03-31 13:04:05 -07:00
Michael Lumish 5cf93cf5fd
Fix a typo in a comment
Co-authored-by: Ian Edington <IanEdington@gmail.com>
2021-03-24 09:35:27 -07:00
于北 2ce608e1f4
Porto-loader fromJSON rm if optiondir 2021-03-19 08:33:23 +08:00
Michael Lumish 995540ceec Update golden generated files to match recent changes 2021-03-18 13:22:03 -07:00
sovlookup 1143867682 proto-loader: fromJSON add options 2021-03-18 16:21:55 +08:00
sovlookup bdd8e1a110 proto-loader: fromJSON rm newRoot 2021-03-18 15:39:24 +08:00
sovlookup fe2e93d30a proto-loader: update fromJSON test 2021-03-17 09:48:09 +08:00
sovlookup b7bf2bf6cd proto-loader: update fromJSON remove Protobuf.Root 'json' param 2021-03-17 09:41:22 +08:00
sovlookup 550a4e93f5 proto-loader: update fromJSON 2021-03-17 09:32:02 +08:00
sovlookup c2d7e4adda load protobuf.js JSON descriptor 2021-03-12 19:39:06 +08:00
Michael Lumish b2776b52b4 proto-loader: bump to 0.5.6 2021-01-19 14:36:41 -08:00
Richard Willis cf9d0fd4cc proto-loader: Fix yargs types 2021-01-08 08:11:35 +00:00
Richard Willis ac86173a20 proto-loader: Add example usage to README 2021-01-08 08:11:24 +00:00
Richard Willis d3ef8f3233 proto-loader: Replace Windows CRLF pair with Unix LF 2020-12-20 08:12:25 +00:00
Michael Lumish 999634a74d Merge branch 'master' into proto-loader_type_generator 2020-12-01 12:29:25 -08:00
A. Tate Barber d86994dc6a Split file descriptor set logic into two utility functions
This change exposes loadFileDescriptorSetFromBuffer and
loadFileDescriptorSetFromObject functions.
2020-11-30 21:20:49 -06:00
Michael Lumish 4b3e0b6a8a Update version and dependencies for final release 2020-11-24 16:18:47 -08:00
A. Tate Barber 8c50e2d40f Refactor loadFileDescriptorSetFile to not catch JSON decoding errors
This change ensures that errors are not hidden when
loadFileDescriptorSet fails to decode JSON. Instead, only JSON parsing
errors are hidden.
2020-11-23 21:54:34 -06:00
A. Tate Barber 63af3bcd6a Enable loadFileDescriptorSetFile to parse JSON files 2020-11-23 21:46:04 -06:00
A. Tate Barber bf98c167cd Refactor loadFileDescriptorSet
This change refactors the loadFileDescriptorSetFile function to take
a plain Buffer or Javascript object as input.
2020-11-23 21:24:39 -06:00
A. Tate Barber 08254e4d2e Add functions for loading and parsing binary-encoded file decriptor sets
Fixes #1627
2020-11-22 17:30:43 -06:00
Michael Lumish 94391ca64d import type * as grpc, fix ConstructorParameters usage 2020-10-22 11:09:23 -07:00
Michael Lumish f2c82cc8e5 Bump the version again to capture a merge 2020-10-21 14:36:50 -07:00
Michael Lumish 542f619124 Merge branch 'proto-loader_type_generator' of https://github.com/murgatroid99/grpc-node into proto-loader_type_generator 2020-10-21 14:35:11 -07:00
Michael Lumish 96cba74b9b Use 'import type' where possible 2020-10-21 14:33:21 -07:00
Richard Willis e85b72bbc4 Regenerate golden types 2020-10-11 12:10:52 +01:00
Richard Willis 330d1835fe proto-loader: fix typescript generation callType for client streaming 2020-10-11 12:01:32 +01:00
Richard Willis 829333c459 Regenerate golden types 2020-09-24 18:22:52 +01:00
Richard Willis acf403b704 proto-loader: use method descriptor types to define server handlers 2020-09-24 09:42:10 +01:00
Michael Lumish 677741d442 ConstructorParameters is already a TypeScript builtin 2020-09-02 13:35:43 -07:00
Michael Lumish 2d1cb15dec Fix imports for messages without packages 2020-08-31 09:40:17 -07:00
Michael Lumish 6389e92c8b Bump version to 0.6.0 2020-08-20 09:54:10 -07:00
Michael Lumish 7550c00a24 Regenerate golden files 2020-08-10 15:20:13 -07:00
Michael Lumish 471c59fa27 Fix missing type argument in client streaming server handler 2020-08-10 15:18:58 -07:00
Michael Lumish bbff8cb449 A few more service type fixes 2020-08-10 11:35:26 -07:00
Michael Lumish 128d4e9083 Add TS generator information to README 2020-08-04 13:23:02 -07:00
Michael Lumish d8e035445c Fix imports of messages defined in other messages, add missing comma 2020-08-03 10:59:10 -07:00
Michael Lumish d329387c8f Skip test properly on older versions 2020-07-21 15:07:39 -07:00
Michael Lumish 437f534930 Generate comments in golden files 2020-07-21 13:43:30 -07:00
Michael Lumish 8438fc7a12 Fix golden file test 2020-07-21 13:25:43 -07:00
Michael Lumish 831755a0b7 Merge branch 'proto-loader_type_generator' of https://github.com/murgatroid99/grpc-node into proto-loader_type_generator 2020-07-21 10:31:53 -07:00
Michael Lumish 59471863bf Add 'golden' generator output from a file in gapic-showcase 2020-07-21 10:31:19 -07:00
Michael Lumish 894f100192
Merge branch 'master' into proto-loader_type_generator 2020-07-20 14:28:27 -07:00
Michael Lumish b96cb3b8cc Make messages always optional, fix map type generation 2020-07-20 14:26:38 -07:00
Michael Lumish 4963b0d9f8 Update protobufjs dependency to ^6.10.0 2020-07-20 14:06:42 -07:00
Michael Lumish 842757c55f Fix @types/mocha compatibility issue 2020-07-15 10:36:52 -07:00
Michael Lumish cca10597d5 Add files for service definitions, remove redundant exports from root files 2020-07-13 13:13:39 -07:00
Michael Lumish 8e6dae7bb7 Add option to generate comments 2020-07-10 14:14:24 -07:00
Michael Lumish e14667207e Bump prerelease version again 2020-07-10 12:49:37 -07:00
Michael Lumish e80d89479e Refactor shared code, remove mkdirp, sort some things for stable output, add verbose option 2020-07-10 12:48:53 -07:00
Michael Lumish 4cc4a17910 Merge branch 'master' into proto-loader_type_generator 2020-07-10 10:56:04 -07:00
Michael Lumish cee9a455a6 Load google/protobuf/* into common using require 2020-07-10 09:10:13 -07:00
Michael Lumish e03118d8cb Generate .ts files instead of .d.ts for better handling by tsc 2020-07-10 08:46:03 -07:00
Michael Lumish f64599f7ed Bump to 0.6.0-pre6 2020-07-06 09:03:59 -07:00
Michael Lumish 06f63a22ca Merge branch 'proto-loader_type_generator' of https://github.com/murgatroid99/grpc-node into proto-loader_type_generator 2020-07-06 09:01:59 -07:00
Richard Willis c6d4ea5a02 Fix some type issues in the server interface 2020-07-03 09:22:02 +01:00
Michael Lumish 110cb2f1b8 Export service client interfaces 2020-06-25 12:45:46 -07:00