From 80e4a5bfe7fda613b96609bbc4ba462b2928d871 Mon Sep 17 00:00:00 2001 From: mizdra Date: Tue, 24 Oct 2023 03:42:36 +0900 Subject: [PATCH] Add typescript-fabbrica plugin in doc (#9694) * yarn workspace website add @mizdra/graphql-codegen-typescript-fabbrica * add typescript-fabbrica plugin in doc --- website/package.json | 3 ++- website/src/category-to-packages.mjs | 1 + website/src/lib/plugins.ts | 6 ++++++ website/src/pages/plugins/typescript/_meta.ts | 1 + .../plugins/typescript/typescript-fabbrica.mdx | 11 +++++++++++ yarn.lock | 15 ++++++++++++++- 6 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 website/src/pages/plugins/typescript/typescript-fabbrica.mdx diff --git a/website/package.json b/website/package.json index 1bab484caa8..50103e3ca7e 100644 --- a/website/package.json +++ b/website/package.json @@ -25,6 +25,7 @@ "@graphql-codegen/c-sharp": "4.3.1", "@graphql-codegen/c-sharp-operations": "2.3.1", "@graphql-codegen/cli": "5.0.0", + "@graphql-codegen/client-preset": "4.1.0", "@graphql-codegen/core": "4.0.0", "@graphql-codegen/flow": "2.3.6", "@graphql-codegen/flow-operations": "2.3.6", @@ -65,8 +66,8 @@ "@graphql-codegen/typescript-vue-apollo-smart-ops": "2.3.6", "@graphql-codegen/typescript-vue-urql": "2.3.6", "@graphql-codegen/urql-introspection": "2.2.1", - "@graphql-codegen/client-preset": "4.1.0", "@mendable/search": "0.0.155", + "@mizdra/graphql-codegen-typescript-fabbrica": "^0.3.0", "@monaco-editor/react": "4.5.2", "@theguild/components": "^6.0.1", "classnames": "2.3.2", diff --git a/website/src/category-to-packages.mjs b/website/src/category-to-packages.mjs index 7f30f170552..50ed1682539 100644 --- a/website/src/category-to-packages.mjs +++ b/website/src/category-to-packages.mjs @@ -26,6 +26,7 @@ export const CategoryToPackages = { 'typescript-apollo-client-helpers', 'typescript-apollo-next', 'typescript-document-nodes', + 'typescript-fabbrica', 'typescript-generic-sdk', 'typescript-graphql-files-modules', 'typescript-graphql-request', diff --git a/website/src/lib/plugins.ts b/website/src/lib/plugins.ts index 99eba417214..7e0622eeddc 100644 --- a/website/src/lib/plugins.ts +++ b/website/src/lib/plugins.ts @@ -277,6 +277,12 @@ export const PACKAGES: Record< icon: 'typescript', tags: ['plugin', 'typescript'], }, + 'typescript-fabbrica': { + title: 'TypeScript Mock Data Factory', + npmPackage: '@mizdra/graphql-codegen-typescript-fabbrica', + icon: 'typescript', + tags: ['plugin', 'typescript'], + }, 'typescript-generic-sdk': { title: 'TypeScript Generic SDK', npmPackage: '@graphql-codegen/typescript-generic-sdk', diff --git a/website/src/pages/plugins/typescript/_meta.ts b/website/src/pages/plugins/typescript/_meta.ts index 09510aa2a06..bf6b9280e9e 100644 --- a/website/src/pages/plugins/typescript/_meta.ts +++ b/website/src/pages/plugins/typescript/_meta.ts @@ -7,6 +7,7 @@ export default { 'typescript-apollo-client-helpers': 'apollo-client-helpers', 'typescript-apollo-next': 'apollo-next', 'typescript-document-nodes': 'document-nodes', + 'typescript-fabbrica': 'fabbrica', 'typescript-generic-sdk': 'generic-sdk', 'typescript-graphql-files-modules': 'graphql-files-modules', 'typescript-graphql-request': 'graphql-request', diff --git a/website/src/pages/plugins/typescript/typescript-fabbrica.mdx b/website/src/pages/plugins/typescript/typescript-fabbrica.mdx new file mode 100644 index 00000000000..49e0de905e1 --- /dev/null +++ b/website/src/pages/plugins/typescript/typescript-fabbrica.mdx @@ -0,0 +1,11 @@ +--- +title: typescript-fabbrica +description: GraphQL Code Generator Plugin to define mock data factory. +--- + +import { PluginApiDocs, PluginHeader } from '@/components/plugin' +import { pluginGetStaticProps } from '@/lib/plugin-get-static-props' +export const getStaticProps = pluginGetStaticProps(__filename) + + + diff --git a/yarn.lock b/yarn.lock index 3d041b99db0..dddcc74ddc2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3389,6 +3389,14 @@ html-react-parser "^4.2.0" posthog-js "^1.45.1" +"@mizdra/graphql-codegen-typescript-fabbrica@^0.3.0": + version "0.3.0" + resolved "https://registry.yarnpkg.com/@mizdra/graphql-codegen-typescript-fabbrica/-/graphql-codegen-typescript-fabbrica-0.3.0.tgz#783ffc7c4ade7b844a6c65cc1fb7bac340a2f42d" + integrity sha512-ShPEpC6GrzL1fqXqx4Ua1heid8ExrK/evJI1vozVPt6mZWebwKG0tf26v9KwQ0F8HZBufnq4BURUMXobWi9ckQ== + dependencies: + "@graphql-codegen/plugin-helpers" "^5.0.1" + "@graphql-codegen/visitor-plugin-common" "^4.0.1" + "@monaco-editor/loader@^1.3.3": version "1.3.3" resolved "https://registry.yarnpkg.com/@monaco-editor/loader/-/loader-1.3.3.tgz#7f1742bd3cc21c0362a46a4056317f6e5215cfca" @@ -8617,11 +8625,16 @@ graphql-yoga@4.0.4: lru-cache "^10.0.0" tslib "^2.5.2" -graphql@16.8.0, graphql@^16.0.0, graphql@^16.6.0: +graphql@16.8.0, graphql@^16.6.0: version "16.8.0" resolved "https://registry.yarnpkg.com/graphql/-/graphql-16.8.0.tgz#374478b7f27b2dc6153c8f42c1b80157f79d79d4" integrity sha512-0oKGaR+y3qcS5mCu1vb7KG+a89vjn06C7Ihq/dDl3jA+A8B3TKomvi3CiEcVLJQGalbu8F52LxkOym7U5sSfbg== +graphql@^16.0.0: + version "16.8.1" + resolved "https://registry.yarnpkg.com/graphql/-/graphql-16.8.1.tgz#1930a965bef1170603702acdb68aedd3f3cf6f07" + integrity sha512-59LZHPdGZVh695Ud9lRzPBVTtlX9ZCV150Er2W43ro37wVof0ctenSaskPPjN7lVTIN8mSZt8PHUNKZuNQUuxw== + gray-matter@^4.0.3: version "4.0.3" resolved "https://registry.yarnpkg.com/gray-matter/-/gray-matter-4.0.3.tgz#e893c064825de73ea1f5f7d88c7a9f7274288798"