Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
b69c343
test(protoc-gen-pothos): add snapshot tests for objectType printer
izumin5210 Jun 7, 2025
0cb9f58
test(protoc-gen-pothos): add snapshot tests for enumType printer
izumin5210 Jun 7, 2025
1fa1f76
test(protoc-gen-pothos): add snapshot tests for inputObjectType printer
izumin5210 Jun 7, 2025
d00f784
test(protoc-gen-pothos): add snapshot tests for oneofUnionType printer
izumin5210 Jun 7, 2025
2a8359b
test(protoc-gen-nexus): add snapshot tests for objectType printer
izumin5210 Jun 7, 2025
79b69db
test(protoc-gen-nexus): add snapshot tests for enumType printer
izumin5210 Jun 7, 2025
74c8238
test(protoc-gen-nexus): add snapshot tests for inputObjectType printer
izumin5210 Jun 7, 2025
7224f84
test(protoc-gen-nexus): add tests for oneofUnionType printer
izumin5210 Jun 7, 2025
f84fd8e
refactor(protoc-gen-pothos): simplify objectType test to use direct r…
izumin5210 Jun 8, 2025
2b64ef7
refactor(protoc-gen-pothos): simplify enumType test to use direct reg…
izumin5210 Jun 8, 2025
efad7a6
refactor(protoc-gen-pothos): update inputObjectType test to use plugi…
izumin5210 Jun 8, 2025
68ade18
refactor(protoc-gen-pothos): simplify oneofUnionType test
izumin5210 Jun 8, 2025
740f8cf
refactor(protoc-gen-nexus): simplify objectType test to use direct re…
izumin5210 Jun 8, 2025
c956827
refactor(protoc-gen-nexus): simplify enumType test to use direct regi…
izumin5210 Jun 8, 2025
0da95e9
refactor(protoc-gen-nexus): update inputObjectType test to use plugin…
izumin5210 Jun 8, 2025
9473738
refactor(protoc-gen-nexus): simplify oneofUnionType test
izumin5210 Jun 8, 2025
d47111b
refactor(protoc-gen-pothos): simplify inputObjectType test to use dir…
izumin5210 Jun 8, 2025
d40f687
refactor(protoc-gen-nexus): simplify inputObjectType test to use dire…
izumin5210 Jun 8, 2025
7776f62
refactor(protoc-gen-pothos): simplify oneofUnionType test to use dire…
izumin5210 Jun 8, 2025
add22eb
refactor(protoc-gen-nexus): refactor oneofUnionType test to use direc…
izumin5210 Jun 8, 2025
2c83dfe
refactor(protoc-gen-pothos): use Protobuf enum names with dot notatio…
izumin5210 Jun 8, 2025
9a3f024
refactor(protoc-gen-nexus): use Protobuf enum names with dot notation…
izumin5210 Jun 8, 2025
d674491
remove unnecessary non-null assertion
izumin5210 Jun 8, 2025
3a13dfa
`pnpm lint`
izumin5210 Jun 8, 2025
3ea97b5
revert unrelated changes
izumin5210 Jun 8, 2025
4b656d4
refactor: convert all printer tests to use parameterized tests
izumin5210 Jun 8, 2025
1c0bf9a
lint
izumin5210 Jun 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 2 additions & 13 deletions packages/@proto-graphql/codegen-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,7 @@
"name": "@proto-graphql/codegen-core",
"version": "0.5.2",
"description": "",
"keywords": [
"graphql",
"grpc",
"nexus",
"protobuf",
"typescript"
],
"keywords": ["graphql", "grpc", "nexus", "protobuf", "typescript"],
"repository": "git@github.com:proto-graphql/proto-graphql-js.git",
"author": "izumin5210 <m@izum.in>",
"license": "MIT",
Expand All @@ -28,12 +22,7 @@
}
}
},
"files": [
"src/",
"dist/",
"!src/**/*.test.ts",
"!src/**/__tests__/"
],
"files": ["src/", "dist/", "!src/**/*.test.ts", "!src/**/__tests__/"],
"sideEffects": false,
"private": false,
"publishConfig": {
Expand Down
15 changes: 2 additions & 13 deletions packages/@proto-graphql/protoc-plugin-helpers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,7 @@
"name": "@proto-graphql/protoc-plugin-helpers",
"version": "0.4.2",
"description": "",
"keywords": [
"graphql",
"grpc",
"nexus",
"protobuf",
"typescript"
],
"keywords": ["graphql", "grpc", "nexus", "protobuf", "typescript"],
"repository": "git@github.com:proto-graphql/proto-graphql-js.git",
"author": "izumin5210 <m@izum.in>",
"license": "MIT",
Expand All @@ -28,12 +22,7 @@
}
}
},
"files": [
"src/",
"dist/",
"!src/**/*.test.ts",
"!src/**/__tests__/"
],
"files": ["src/", "dist/", "!src/**/*.test.ts", "!src/**/__tests__/"],
"sideEffects": false,
"private": false,
"publishConfig": {
Expand Down
14 changes: 2 additions & 12 deletions packages/@proto-graphql/scalars-protobuf-es/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@
"name": "@proto-graphql/scalars-protobuf-es",
"version": "0.4.2",
"description": "",
"keywords": [
"graphql",
"grpc",
"protobuf",
"typescript"
],
"keywords": ["graphql", "grpc", "protobuf", "typescript"],
"repository": "git@github.com:proto-graphql/proto-graphql-js.git",
"author": "izumin5210 <m@izum.in>",
"license": "MIT",
Expand All @@ -27,12 +22,7 @@
}
}
},
"files": [
"src/",
"dist/",
"!src/**/*.test.ts",
"!src/**/__tests__/"
],
"files": ["src/", "dist/", "!src/**/*.test.ts", "!src/**/__tests__/"],
"sideEffects": false,
"private": false,
"publishConfig": {
Expand Down
15 changes: 2 additions & 13 deletions packages/@proto-nexus/proto-fields-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,7 @@
"name": "@proto-nexus/proto-fields-plugin",
"version": "0.5.6",
"description": "Nexus plugin for building subset types from proto-nexus's artifacts",
"keywords": [
"graphql",
"grpc",
"nexus",
"protobuf",
"typescript"
],
"keywords": ["graphql", "grpc", "nexus", "protobuf", "typescript"],
"repository": "git@github.com:proto-graphql/proto-graphql-js.git",
"author": "izumin5210 <m@izum.in>",
"license": "MIT",
Expand All @@ -30,12 +24,7 @@
"engines": {
"node": ">= 14.0.0"
},
"files": [
"src/",
"dist/",
"!src/**/*.test.ts",
"!src/**/__tests__/"
],
"files": ["src/", "dist/", "!src/**/*.test.ts", "!src/**/__tests__/"],
"peerDependencies": {
"nexus": "^1.0.0"
},
Expand Down
16 changes: 2 additions & 14 deletions packages/protoc-gen-nexus/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,7 @@
"name": "protoc-gen-nexus",
"version": "0.8.2",
"description": "Generate DSL for GraphQL Nexus from Protocol Buffers IDL",
"keywords": [
"graphql",
"grpc",
"nexus",
"protobuf",
"typescript"
],
"keywords": ["graphql", "grpc", "nexus", "protobuf", "typescript"],
"bin": {
"protoc-gen-nexus": "./bin/protoc-gen-nexus.cjs"
},
Expand All @@ -31,13 +25,7 @@
}
}
},
"files": [
"bin/",
"src/",
"dist/",
"!src/**/*.test.ts",
"!src/**/__tests__/"
],
"files": ["bin/", "src/", "dist/", "!src/**/*.test.ts", "!src/**/__tests__/"],
"sideEffects": false,
"private": false,
"publishConfig": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`createEnumTypeCode > google-protobuf > 'generates code for a simple enum' 1`] = `
"import { enumType } from "nexus";

export const MyEnum = enumType({
"name": "MyEnum",
"members": [{ "name": "FOO", "value": 1, "extensions": { "protobufEnumValue": { "name": "MY_ENUM_FOO" } } }, {
"name": "BAR",
"value": 2,
"description": "This is Bar.",
"extensions": { "protobufEnumValue": { "name": "MY_ENUM_BAR" } },
}, { "name": "BAZ", "value": 3, "extensions": { "protobufEnumValue": { "name": "MY_ENUM_BAZ" } } }],
"extensions": {
"protobufEnum": { "name": "MyEnum", "fullName": "testapi.enums.MyEnum", "package": "testapi.enums" },
},
});
"
`;

exports[`createEnumTypeCode > google-protobuf > 'generates code for an enum without un…' 1`] = `
"import { enumType } from "nexus";

export const MyEnumWithoutUnspecified = enumType({
"name": "MyEnumWithoutUnspecified",
"members": [{
"name": "FOO",
"value": 0,
"extensions": { "protobufEnumValue": { "name": "MY_ENUM_WITHOUT_UNSPECIFIED_FOO" } },
}, {
"name": "BAR",
"value": 1,
"extensions": { "protobufEnumValue": { "name": "MY_ENUM_WITHOUT_UNSPECIFIED_BAR" } },
}, {
"name": "BAZ",
"value": 2,
"extensions": { "protobufEnumValue": { "name": "MY_ENUM_WITHOUT_UNSPECIFIED_BAZ" } },
}],
"extensions": {
"protobufEnum": {
"name": "MyEnumWithoutUnspecified",
"fullName": "testapi.enums.MyEnumWithoutUnspecified",
"package": "testapi.enums",
},
},
});
"
`;

exports[`createEnumTypeCode > google-protobuf > 'generates code for enum with extensio…' 1`] = `
"import { enumType } from "nexus";

export const TestPrefixPrefixedEnum = enumType({
"name": "TestPrefixPrefixedEnum",
"members": [
{ "name": "PREFIXED_FOO", "value": 1, "extensions": { "protobufEnumValue": { "name": "PREFIXED_FOO" } } },
{ "name": "PREFIXED_BAR", "value": 2, "extensions": { "protobufEnumValue": { "name": "PREFIXED_BAR" } } },
],
"extensions": {
"protobufEnum": {
"name": "PrefixedEnum",
"fullName": "testapis.extensions.PrefixedEnum",
"package": "testapis.extensions",
},
},
});
"
`;

exports[`createEnumTypeCode > google-protobuf > 'generates code for nested enum' 1`] = `
"import { enumType } from "nexus";

export const ParentMessageNestedEnum = enumType({
"name": "ParentMessageNestedEnum",
"members": [{ "name": "FOO", "value": 1, "extensions": { "protobufEnumValue": { "name": "FOO" } } }, {
"name": "BAR",
"value": 2,
"extensions": { "protobufEnumValue": { "name": "BAR" } },
}],
"extensions": {
"protobufEnum": {
"name": "NestedEnum",
"fullName": "testapis.nested.ParentMessage.NestedEnum",
"package": "testapis.nested",
},
},
});
"
`;

exports[`createEnumTypeCode > protobufjs > 'generates code for a simple enum' 1`] = `
"import { enumType } from "nexus";

export const MyEnum = enumType({
"name": "MyEnum",
"members": [{ "name": "FOO", "value": 1, "extensions": { "protobufEnumValue": { "name": "MY_ENUM_FOO" } } }, {
"name": "BAR",
"value": 2,
"description": "This is Bar.",
"extensions": { "protobufEnumValue": { "name": "MY_ENUM_BAR" } },
}, { "name": "BAZ", "value": 3, "extensions": { "protobufEnumValue": { "name": "MY_ENUM_BAZ" } } }],
"extensions": {
"protobufEnum": { "name": "MyEnum", "fullName": "testapi.enums.MyEnum", "package": "testapi.enums" },
},
});
"
`;

exports[`createEnumTypeCode > protobufjs > 'generates code for an enum without un…' 1`] = `
"import { enumType } from "nexus";

export const MyEnumWithoutUnspecified = enumType({
"name": "MyEnumWithoutUnspecified",
"members": [{
"name": "FOO",
"value": 0,
"extensions": { "protobufEnumValue": { "name": "MY_ENUM_WITHOUT_UNSPECIFIED_FOO" } },
}, {
"name": "BAR",
"value": 1,
"extensions": { "protobufEnumValue": { "name": "MY_ENUM_WITHOUT_UNSPECIFIED_BAR" } },
}, {
"name": "BAZ",
"value": 2,
"extensions": { "protobufEnumValue": { "name": "MY_ENUM_WITHOUT_UNSPECIFIED_BAZ" } },
}],
"extensions": {
"protobufEnum": {
"name": "MyEnumWithoutUnspecified",
"fullName": "testapi.enums.MyEnumWithoutUnspecified",
"package": "testapi.enums",
},
},
});
"
`;

exports[`createEnumTypeCode > protobufjs > 'generates code for nested enum' 1`] = `
"import { enumType } from "nexus";

export const ParentMessageNestedEnum = enumType({
"name": "ParentMessageNestedEnum",
"members": [{ "name": "FOO", "value": 1, "extensions": { "protobufEnumValue": { "name": "FOO" } } }, {
"name": "BAR",
"value": 2,
"extensions": { "protobufEnumValue": { "name": "BAR" } },
}],
"extensions": {
"protobufEnum": {
"name": "NestedEnum",
"fullName": "testapis.nested.ParentMessage.NestedEnum",
"package": "testapis.nested",
},
},
});
"
`;
Loading
Loading