From ab2a5d51816b8c4b1ea61ebcacce6fb261e104ac Mon Sep 17 00:00:00 2001 From: Mathieu Acthernoene Date: Fri, 6 Jan 2017 11:38:48 +0100 Subject: [PATCH] Rename js-grpc folder, add enums to example file --- Makefile | 2 +- examples/{js-grpc => flow}/Makefile | 0 examples/{js-grpc => flow}/output/test/test_grpc_js.js | 9 ++++++++- examples/{js-grpc => flow}/protos/test.proto | 9 +++++++++ .../{{.File.Package}}/{{.File.Package}}_grpc_js.js.tmpl | 0 5 files changed, 18 insertions(+), 2 deletions(-) rename examples/{js-grpc => flow}/Makefile (100%) rename examples/{js-grpc => flow}/output/test/test_grpc_js.js (98%) rename examples/{js-grpc => flow}/protos/test.proto (92%) rename examples/{js-grpc => flow}/templates/{{.File.Package}}/{{.File.Package}}_grpc_js.js.tmpl (100%) diff --git a/Makefile b/Makefile index 83cdc7a..e898e34 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ install: .PHONY: test test: build cd examples/dummy && make - cd examples/js-grpc && make + cd examples/flow && make .PHONY: docker.build docker.build: diff --git a/examples/js-grpc/Makefile b/examples/flow/Makefile similarity index 100% rename from examples/js-grpc/Makefile rename to examples/flow/Makefile diff --git a/examples/js-grpc/output/test/test_grpc_js.js b/examples/flow/output/test/test_grpc_js.js similarity index 98% rename from examples/js-grpc/output/test/test_grpc_js.js rename to examples/flow/output/test/test_grpc_js.js index dfb27c4..be399ae 100644 --- a/examples/js-grpc/output/test/test_grpc_js.js +++ b/examples/flow/output/test/test_grpc_js.js @@ -3,7 +3,10 @@ import grpc from 'grpc' import pbFile from './pbFile.js' - +type TestEnum = + | 'ELEMENT_A' + | 'ELEMENT_B' +; type TestMessage = {| a?: string; @@ -16,6 +19,10 @@ type TestMessage = {| p?: Array; q?: Array; r?: Array; + s?: + | 'ELEMENT_C' + | 'ELEMENT_D' + ; |}; type TestNoStreamRequest = {| diff --git a/examples/js-grpc/protos/test.proto b/examples/flow/protos/test.proto similarity index 92% rename from examples/js-grpc/protos/test.proto rename to examples/flow/protos/test.proto index cd7ebe7..e15ee88 100644 --- a/examples/js-grpc/protos/test.proto +++ b/examples/flow/protos/test.proto @@ -11,6 +11,11 @@ service TestService { rpc TestStreamBoth(stream TestStreamBothRequest) returns (stream TestStreamBothReply); } +enum TestEnum { + ELEMENT_A = 0; + ELEMENT_B = 1; +} + message TestMessage { string a = 1; int32 b = 2; @@ -22,6 +27,10 @@ message TestMessage { repeated int64 p = 16; repeated float q = 17; repeated double r = 18; + enum s { + ELEMENT_C = 0; + ELEMENT_D = 1; + } } message TestNoStreamRequest { TestMessage message = 1; } diff --git a/examples/js-grpc/templates/{{.File.Package}}/{{.File.Package}}_grpc_js.js.tmpl b/examples/flow/templates/{{.File.Package}}/{{.File.Package}}_grpc_js.js.tmpl similarity index 100% rename from examples/js-grpc/templates/{{.File.Package}}/{{.File.Package}}_grpc_js.js.tmpl rename to examples/flow/templates/{{.File.Package}}/{{.File.Package}}_grpc_js.js.tmpl