Commit Graph

62 Commits

Author SHA1 Message Date
Michael Lumish 7d39d52b77 proto-loader: declare oneof fields as optional 2025-02-28 14:31:45 -08:00
Michael Lumish b292946de7 proto-loader: Avoid generating duplicate method declarations in some cases 2024-04-09 14:45:35 -07:00
Michael Lumish d3e16a43ea proto-loader: Revert 'Import internal files with extension' 2024-03-27 10:09:27 -07:00
Anton 83d9f1c8b9 Import files with extension 2024-03-21 09:06:58 +01:00
Michael Lumish ab02dc0be4 proto-loader: Allow the grpcLib option to be omitted in the type generator 2023-09-13 16:57:45 -07:00
Michael Lumish bc2447ccf6 proto-loader: Update to yargs@17.x 2023-04-28 10:58:09 -07:00
install 31aec874dd proto-loader-gen-types Narrow field Long check
- Explicitly list the primitive field types that use Long, instead of
  searching for `64` in the type name.
2023-02-22 11:57:26 -05:00
Daniel Rönnkvist ad298bc7c8 remove possible deprecated options from type brand output 2023-02-11 22:06:59 +01:00
Daniel Rönnkvist c20ddd3d2b write @deprecated jsdoc annotation if comments are enabled
update golden generated with @deprecated annotation
2023-02-10 17:52:59 +01:00
Taegeun Moon f1e3f6d7d3 use option method 2022-12-03 00:31:26 +09:00
Taegeun Moon 80332044c7 update typeBrandHint location 2022-12-01 14:12:10 +09:00
Taegeun Moon 256fbd8915 set defaults for brand option 2022-12-01 13:34:32 +09:00
Taegeun Moon 927c29de4a support both input and output
update readme

update readme
2022-12-01 13:34:31 +09:00
Taegeun Moon e955c47bd5 rename as outputBranded 2022-12-01 11:09:09 +09:00
Taegeun Moon 6f755fe346 add branded option for proto-loader-gen-types 2022-11-30 22:31:22 +09:00
install ef7b8e8f14 Don't allow `null` for enum field inputs/outputs 2022-11-16 10:10:13 -05:00
install c7125fbdb5 proto-loader-gen-types Avoid TS enums 2022-11-15 16:44:52 -05: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 f049333e48 proto-loader: Decrease dependency to yargs 16 for compatibility with Node <12 2022-01-05 10:51:00 -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 4b20bf3fce proto-loader: Fix generated types for callbacks 2021-11-15 10:05:10 -08:00
Michael Lumish c95219b1ea proto-loader: Avoid generating conflicting method names in service clients 2021-09-07 14:38:58 -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
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
@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 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 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
Richard Willis cf9d0fd4cc proto-loader: Fix yargs types 2021-01-08 08:11:35 +00:00
Richard Willis d3ef8f3233 proto-loader: Replace Windows CRLF pair with Unix LF 2020-12-20 08:12:25 +00:00
Michael Lumish 94391ca64d import type * as grpc, fix ConstructorParameters usage 2020-10-22 11:09:23 -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 330d1835fe proto-loader: fix typescript generation callType for client streaming 2020-10-11 12:01:32 +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 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 d8e035445c Fix imports of messages defined in other messages, add missing comma 2020-08-03 10:59:10 -07:00
Michael Lumish 437f534930 Generate comments in golden files 2020-07-21 13:43:30 -07:00
Michael Lumish b96cb3b8cc Make messages always optional, fix map type generation 2020-07-20 14:26:38 -07:00
Michael Lumish cca10597d5 Add files for service definitions, remove redundant exports from root files 2020-07-13 13:13:39 -07:00