-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #50 from izumin5210/izumin5210/multipkgs
support referencing other packages
- Loading branch information
Showing
11 changed files
with
391 additions
and
32 deletions.
There are no files selected for viewing
Binary file added
BIN
+434 Bytes
packages/@testapis/proto/src/testapis/multipkgs/subpkg1/descriptor_set.pb
Binary file not shown.
13 changes: 13 additions & 0 deletions
13
packages/@testapis/proto/src/testapis/multipkgs/subpkg1/types.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
syntax = "proto3"; | ||
|
||
package testapis.multipkgs.subpkg1; | ||
|
||
message SubpkgMessage { | ||
string body = 1; | ||
} | ||
|
||
enum SubpkgEnum { | ||
SUBPKG_ENUM_UNSPECIFIED = 0; | ||
FOO = 1; | ||
BAR = 2; | ||
} |
Binary file added
BIN
+880 Bytes
packages/@testapis/proto/src/testapis/multipkgs/subpkg2/descriptor_set.pb
Binary file not shown.
10 changes: 10 additions & 0 deletions
10
packages/@testapis/proto/src/testapis/multipkgs/subpkg2/types.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
syntax = "proto3"; | ||
|
||
package testapis.multipkgs.subpkg1; | ||
|
||
import "testapis/multipkgs/subpkg1/types.proto"; | ||
|
||
message MessageWithSubpkg { | ||
testapis.multipkgs.subpkg1.SubpkgMessage message = 1; | ||
testapis.multipkgs.subpkg1.SubpkgEnum enum = 2; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
95 changes: 95 additions & 0 deletions
95
packages/protoc-gen-nexus/src/__tests__/__integration__/__snapshots__/multipkgs.test.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`schema generation with native protobuf can make GraphQL schema from generated DSLs: schema.graphql 1`] = ` | ||
"### This file was generated by Nexus Schema | ||
### Do not make changes to this file directly | ||
\\"\\"\\"\\"\\"\\" | ||
type MessageWithSubpkg { | ||
\\"\\"\\"\\"\\"\\" | ||
enum: SubpkgEnum | ||
\\"\\"\\"\\"\\"\\" | ||
message: SubpkgMessage | ||
} | ||
\\"\\"\\"\\"\\"\\" | ||
input MessageWithSubpkgInput { | ||
\\"\\"\\"\\"\\"\\" | ||
enum: SubpkgEnum | ||
\\"\\"\\"\\"\\"\\" | ||
message: SubpkgMessageInput | ||
} | ||
type Query { | ||
ok: Boolean! | ||
} | ||
\\"\\"\\"\\"\\"\\" | ||
enum SubpkgEnum { | ||
BAR | ||
FOO | ||
} | ||
\\"\\"\\"\\"\\"\\" | ||
type SubpkgMessage { | ||
\\"\\"\\"\\"\\"\\" | ||
body: String! | ||
} | ||
\\"\\"\\"\\"\\"\\" | ||
input SubpkgMessageInput { | ||
\\"\\"\\"\\"\\"\\" | ||
body: String! | ||
} | ||
" | ||
`; | ||
|
||
exports[`schema generation with protobufjs can make GraphQL schema from generated DSLs: schema.graphql 1`] = ` | ||
"### This file was generated by Nexus Schema | ||
### Do not make changes to this file directly | ||
\\"\\"\\"\\"\\"\\" | ||
type MessageWithSubpkg { | ||
\\"\\"\\"\\"\\"\\" | ||
enum: SubpkgEnum | ||
\\"\\"\\"\\"\\"\\" | ||
message: SubpkgMessage | ||
} | ||
\\"\\"\\"\\"\\"\\" | ||
input MessageWithSubpkgInput { | ||
\\"\\"\\"\\"\\"\\" | ||
enum: SubpkgEnum | ||
\\"\\"\\"\\"\\"\\" | ||
message: SubpkgMessageInput | ||
} | ||
type Query { | ||
ok: Boolean! | ||
} | ||
\\"\\"\\"\\"\\"\\" | ||
enum SubpkgEnum { | ||
BAR | ||
FOO | ||
} | ||
\\"\\"\\"\\"\\"\\" | ||
type SubpkgMessage { | ||
\\"\\"\\"\\"\\"\\" | ||
body: String! | ||
} | ||
\\"\\"\\"\\"\\"\\" | ||
input SubpkgMessageInput { | ||
\\"\\"\\"\\"\\"\\" | ||
body: String! | ||
} | ||
" | ||
`; |
7 changes: 7 additions & 0 deletions
7
packages/protoc-gen-nexus/src/__tests__/__integration__/multipkgs.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { testSchemaGeneration } from "../__helpers__/process.test.helper"; | ||
|
||
testSchemaGeneration(["multipkgs/subpkg1", "multipkgs/subpkg2"], "protobufjs"); | ||
testSchemaGeneration( | ||
["multipkgs/subpkg1", "multipkgs/subpkg2"], | ||
"native protobuf" | ||
); |
Oops, something went wrong.