From e5241cc63e9aebdd46a489d8e68daf524bc6a205 Mon Sep 17 00:00:00 2001 From: Negotiamini Date: Tue, 15 Jun 2021 16:59:12 -0400 Subject: [PATCH] [deploy_website] Update generate-schema.md (#3074) corrected grammar --- .github/workflows/website.yml | 2 ++ scripts/install-typedocs-typescript-version.js | 16 ++++++++++++++++ website/docs/generate-schema.md | 2 +- 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 scripts/install-typedocs-typescript-version.js diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml index be451470b8d..58e422f91b3 100644 --- a/.github/workflows/website.yml +++ b/.github/workflows/website.yml @@ -35,6 +35,8 @@ jobs: key: ${{ runner.os }}-16-16-yarn-${{ hashFiles('yarn.lock') }} restore-keys: | ${{ runner.os }}-16-16-yarn- + - name: Align TypeScript version with typedoc + run: node scripts/install-typedocs-typescript-version.js - name: Install Dependencies using Yarn run: yarn install --ignore-engines && git checkout yarn.lock - name: Deploy 🚀 diff --git a/scripts/install-typedocs-typescript-version.js b/scripts/install-typedocs-typescript-version.js new file mode 100644 index 00000000000..5246e012eca --- /dev/null +++ b/scripts/install-typedocs-typescript-version.js @@ -0,0 +1,16 @@ +const { writeFileSync } = require('fs'); +const { resolve } = require('path'); +const { argv, cwd } = require('process'); + +const typeDocsVersion = require('typedoc/package.json'); +const pkgPath = resolve(cwd(), './package.json'); + +const pkg = require(pkgPath); + +const version = argv[2]; + +pkg.resolutions = pkg.resolutions || {}; + +pkg.resolutions.typescript = typeDocsVersion.peerDependencies.typescript; + +writeFileSync(pkgPath, JSON.stringify(pkg, null, 2), 'utf8'); diff --git a/website/docs/generate-schema.md b/website/docs/generate-schema.md index 04f1ed2a040..9f8acafa0e4 100644 --- a/website/docs/generate-schema.md +++ b/website/docs/generate-schema.md @@ -229,7 +229,7 @@ const jsSchema = makeExecutableSchema({ }); ``` -- `typeDefs` is a required argument and should be an GraphQL schema language string or array of GraphQL schema language strings or a function that takes no arguments and returns an array of GraphQL schema language strings. The order of the strings in the array is not important, but it must include a schema definition. +- `typeDefs` is a required argument and should be a GraphQL schema language string or an array of GraphQL schema language strings or a function that takes no arguments and returns an array of GraphQL schema language strings. The order of the strings in the array is not important, but it must include a schema definition. - `resolvers` is an optional argument _(empty object by default)_ and should be an object or an array of objects that follow the pattern explained in [article on resolvers](/docs/resolvers/)