Skip to content

Commit

Permalink
Merge branch 'master' into v3-cli
Browse files Browse the repository at this point in the history
  • Loading branch information
charlypoly committed Aug 31, 2022
2 parents b42d628 + df522fa commit a87a2f5
Show file tree
Hide file tree
Showing 28 changed files with 893 additions and 670 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/website.yml
@@ -0,0 +1,40 @@
name: website

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
deployment:
runs-on: ubuntu-latest
if: github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'push'
steps:
- name: checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: the-guild-org/shared-config/setup@main
name: setup env
with:
nodeVersion: 17
packageManager: yarn

- uses: the-guild-org/shared-config/website-cf@main
name: build and deploy website
env:
NEXT_BASE_PATH: ${{ github.ref == 'refs/heads/master' && '/graphql/codegen' || '' }}
SITE_URL: ${{ github.ref == 'refs/heads/master' && 'https://the-guild.dev/graphql/codegen' || '' }}
with:
cloudflareApiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
cloudflareAccountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
githubToken: ${{ secrets.GITHUB_TOKEN }}
projectName: graphql-code-generator
prId: ${{ github.event.pull_request.number }}
websiteDirectory: ./
buildScript: yarn build && cd website && yarn build && yarn next export
artifactDir: website/out
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -16,3 +16,5 @@ tsconfig.tsbuildinfo
recompile.sh

.next/
out
public/sitemap.xml
10 changes: 5 additions & 5 deletions package.json
Expand Up @@ -47,10 +47,10 @@
"@types/jest": "28.1.8",
"@types/mkdirp": "1.0.2",
"@types/node": "16.11.56",
"@types/react": "18.0.17",
"@types/react": "18.0.18",
"@types/webpack-env": "1.18.0",
"@typescript-eslint/eslint-plugin": "5.35.1",
"@typescript-eslint/parser": "5.35.1",
"@typescript-eslint/eslint-plugin": "5.36.1",
"@typescript-eslint/parser": "5.36.1",
"@urql/exchange-graphcache": "4.4.3",
"@vue/apollo-composable": "4.0.0-alpha.19",
"@vue/composition-api": "1.7.0",
Expand All @@ -60,7 +60,7 @@
"babel-jest": "28.1.3",
"bob-the-bundler": "4.0.0",
"chalk": "4.1.2",
"dotenv": "16.0.1",
"dotenv": "16.0.2",
"eslint": "8.23.0",
"eslint-config-prettier": "8.5.0",
"eslint-config-standard": "17.0.0",
Expand Down Expand Up @@ -94,7 +94,7 @@
"tslib": "2.4.0",
"typescript": "4.7.4",
"urql": "2.2.3",
"vue": "3.2.37",
"vue": "3.2.38",
"vue-apollo-smart-ops": "0.1.0"
},
"lint-staged": {
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions website/algolia-lockfile.json
Expand Up @@ -1145,7 +1145,7 @@
"objectID": "code-generator-index",
"headings": [],
"toc": [],
"content": "a2c44aa2037429070a236ab7c430faba",
"content": "d41d8cd98f00b204e9800998ecf8427e",
"url": "https://www.graphql-code-generator.com//index",
"domain": "https://www.graphql-code-generator.com/",
"hierarchy": [],
Expand Down Expand Up @@ -1217,7 +1217,7 @@
"objectID": "code-generator-plugins-index",
"headings": [],
"toc": [],
"content": "329d4b572e55accae5af460934690e73",
"content": "d41d8cd98f00b204e9800998ecf8427e",
"url": "https://www.graphql-code-generator.com/plugins/index",
"domain": "https://www.graphql-code-generator.com/",
"hierarchy": ["Plugins"],
Expand Down
1 change: 1 addition & 0 deletions website/next-sitemap.config.cjs
Expand Up @@ -2,4 +2,5 @@

module.exports = {
siteUrl: process.env.SITE_URL || 'https://www.graphql-code-generator.com',
generateIndexSitemap: false,
};
87 changes: 32 additions & 55 deletions website/next.config.mjs
Expand Up @@ -2,16 +2,24 @@ import { withGuildDocs } from 'guild-docs/next.config';
import { CategoryToPackages } from './src/category-to-packages.mjs';

const PLUGINS_REDIRECTS = Object.entries(CategoryToPackages).flatMap(([category, packageNames]) =>
packageNames.map(packageName => ({
source: `/plugins/${packageName}`,
destination: `/plugins/${category}/${packageName}`,
}))
packageNames.map(packageName => [`/plugins/${packageName}`, `/plugins/${category}/${packageName}`])
);

export default withGuildDocs({
basePath: process.env.NEXT_BASE_PATH && process.env.NEXT_BASE_PATH !== '' ? process.env.NEXT_BASE_PATH : undefined,
eslint: {
ignoreDuringBuilds: true,
},
experimental: {
urlImports: [
'https://graphql-modules.com/assets/subheader-logo.svg',
'https://pbs.twimg.com/profile_images/1004185780313395200/ImZxrDWf_400x400.jpg',
'https://raw.githubusercontent.com/mswjs/msw/HEAD/media/msw-logo.svg',
],
images: {
unoptimized: true, // doesn't work with `next export`
allowFutureImage: true,
},
},
typescript: {
// Todo: remove it before merge to master
ignoreBuildErrors: true,
Expand All @@ -24,54 +32,23 @@ export default withGuildDocs({
return config;
},
redirects: () =>
[
{
source: '/docs/presets/:presetName',
destination: '/plugins/:presetName-preset',
},
{
source: '/docs/plugins/:pluginName',
destination: '/plugins/:pluginName',
},
{
source: '/docs/getting-started/config-reference/codegen-config',
destination: '/docs/config-reference/codegen-config',
},
{
source: '/docs/getting-started/codegen-config',
destination: '/docs/config-reference/codegen-config',
},
{
source: '/docs/getting-started/documents-field',
destination: '/docs/config-reference/documents-field',
},
{
source: '/docs/getting-started/schema-field',
destination: '/docs/config-reference/schema-field',
},
{
source: '/docs/getting-started/config-field',
destination: '/docs/config-reference/config-field',
},
{
source: '/docs/getting-started/lifecycle-hooks',
destination: '/docs/config-reference/lifecycle-hooks',
},
{
source: '/docs/getting-started/require-field',
destination: '/docs/config-reference/require-field',
},
{
source: '/docs/getting-started/naming-convention',
destination: '/docs/config-reference/naming-convention',
},
{
source: '/docs/getting-started/how-does-it-work',
destination: '/docs/advanced/how-does-it-work',
},
...PLUGINS_REDIRECTS,
].map(redirect => ({
...redirect,
permanent: true,
})),
Object.entries({
'/docs/presets/:presetName': '/plugins/:presetName-preset',
'/docs/plugins/:pluginName': '/plugins/:pluginName',
'/docs/getting-started/config-reference/codegen-config': '/docs/config-reference/codegen-config',
'/docs/getting-started/codegen-config': '/docs/config-reference/codegen-config',
'/docs/getting-started/documents-field': '/docs/config-reference/documents-field',
'/docs/getting-started/schema-field': '/docs/config-reference/schema-field',
'/docs/getting-started/config-field': '/docs/config-reference/config-field',
'/docs/getting-started/lifecycle-hooks': '/docs/config-reference/lifecycle-hooks',
'/docs/getting-started/require-field': '/docs/config-reference/require-field',
'/docs/getting-started/naming-convention': '/docs/config-reference/naming-convention',
'/docs/getting-started/how-does-it-work': '/docs/advanced/how-does-it-work',
})
.concat(PLUGINS_REDIRECTS)
.map(([from, to]) => ({
source: from,
destination: to,
permanent: true,
})),
});
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions website/next.lock/lock.json
@@ -0,0 +1,16 @@
{
"https://graphql-modules.com/assets/subheader-logo.svg": {
"resolved": "https://www.graphql-modules.com/assets/subheader-logo.svg",
"integrity": "sha512-eleU6ZkDs8fTba3J5sUDInGhqo1xacMxD/1qqxDbVxxLH2uAtkpuT/meJdwR52j1w5XCA/4Q7THYHqy8Gnv6ew==",
"contentType": "image/svg+xml"
},
"https://pbs.twimg.com/profile_images/1004185780313395200/ImZxrDWf_400x400.jpg": {
"integrity": "sha512-cG48xw2bbCeB4A3ln54VIDa+FA/1FaVALiXO7RTkZx0a6tGdQwVGzLPKHfdDLZRWct4mmE1X+iCpenB/MpiTQg==",
"contentType": "image/jpeg"
},
"https://raw.githubusercontent.com/mswjs/msw/HEAD/media/msw-logo.svg": {
"integrity": "sha512-VlGvK9swTGVafmZnTCLw9T70xQvv0Oyge/mGF1p5h1fiZ7WK2XL/dB2WrodoiF+xOtB4NAEVQKHjtc9o9amgXw==",
"contentType": "image/svg+xml"
},
"version": 1
}
4 changes: 2 additions & 2 deletions website/package.json
Expand Up @@ -19,7 +19,7 @@
"@types/dedent": "0.7.0",
"@types/jsonpath": "0.2.0",
"@types/node": "18.6.2",
"@types/react": "18.0.17",
"@types/react": "18.0.18",
"eslint-config-next": "12.2.5",
"fast-xml-parser": "4.0.9",
"jsonpath": "1.1.1",
Expand Down Expand Up @@ -65,7 +65,7 @@
"@graphql-codegen/typescript-vue-apollo-smart-ops": "2.3.3",
"@graphql-codegen/typescript-vue-urql": "2.3.3",
"@monaco-editor/react": "4.4.5",
"@theguild/components": "2.0.5",
"@theguild/components": "2.1.0-alpha-20220818233926-7ce4562",
"classnames": "2.3.1",
"date-fns": "2.29.2",
"dedent": "0.7.0",
Expand Down

0 comments on commit a87a2f5

Please sign in to comment.