Skip to content

Commit

Permalink
Fix syntax of example in readme
Browse files Browse the repository at this point in the history
fix: remove lingering console.log

chore(docs): syntax of example in readme (graphql-nexus#89)

chore(docs): mention more about updating snapshots

chore(docs): syntax of example in readme (graphql-nexus#91)

docs: add jsdoc for $settings (graphql-nexus#90)

Co-authored-by: Jason Kuhrt <jasonkuhrt@me.com>

docs: list enum members in jsdoc (graphql-nexus#92)

chore: update roadmap

docs: update to nexus@^1.1 api (graphql-nexus#95)

chore(docs): tweak scalar writing

feat: add support for BigInt scalar (graphql-nexus#56)

Co-authored-by: Jason Kuhrt <jasonkuhrt@me.com>

Add docs webite

Update theme.config.js

Fix theme.config eslint

Add missing typescript dep

Limit docs workflow to run only when changing docs directory

Fix formatting
  • Loading branch information
iddan committed Jul 8, 2021
1 parent 67ce824 commit 4720a2c
Show file tree
Hide file tree
Showing 11 changed files with 5,992 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: docs

on:
pull_request:
paths:
- docs/**

defaults:
run:
working-directory: docs

jobs:
prettier:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Install Dependencies
run: yarn --frozen-lockfile
- run: yarn -s format:check

eslint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Install Dependencies
run: yarn --frozen-lockfile
- run: yarn -s lint:check

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: 16.x
- run: yarn --frozen-lockfile
- run: yarn -s build
- run: yarn -s export
- run: gh-pages --dist=out
1 change: 1 addition & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
out/
2 changes: 2 additions & 0 deletions docs/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.next/
out/
3 changes: 3 additions & 0 deletions docs/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/// <reference types="next" />
/// <reference types="next/types/global" />
/// <reference types="next/image-types/global" />
26 changes: 26 additions & 0 deletions docs/next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/* eslint-disable */

const remarkGfm = require('remark-gfm')
const withNextra = require('nextra')

module.exports = withNextra('nextra-theme-docs', './theme.config.js')(withRemarkGFM())

/**
* Use Remark GFM in MDX Webpack Loader.
* Can be removed once shuding/nextra#184 is released.
*
* @returns {import('next').NextConfig}
* @see https://github.com/shuding/nextra/pull/184/
*/
function withRemarkGFM() {
return {
webpack(config, options) {
const markdownRule = config.module.rules.find((rule) => rule.test?.toString() === '/\\.mdx?$/')
const mdxLoaderConfig = markdownRule.use.find(({ loader }) => loader === '@mdx-js/loader')
mdxLoaderConfig.options = {
remarkPlugins: [remarkGfm],
}
return config
},
}
}
28 changes: 28 additions & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"license": "MIT",
"scripts": {
"dev": "next dev",
"build": "next build",
"export": "next export",
"format": "prettier --write .",
"format:check": "prettier --check .",
"lint": "eslint . --ext .ts,.tsx --fix",
"lint:check": "eslint . --ext .ts,.tsx --max-warnings 0"
},
"dependencies": {
"next": "^11.0.1",
"nextra": "^0.4.5",
"nextra-theme-docs": "^1.1.7",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"remark-gfm": "^1.0.0"
},
"devDependencies": {
"@types/react": "^17.0.14",
"eslint": "^7.30.0",
"eslint-config-next": "^11.0.1",
"gh-pages": "^3.2.3",
"prettier": "^2.3.2",
"typescript": "^4.3.5"
}
}
10 changes: 10 additions & 0 deletions docs/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { FC } from 'react'
import { AppProps } from 'next/app'
import 'nextra-theme-docs/style.css'

const App: FC<AppProps> = ({ Component, pageProps }) => {
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
return <Component {...pageProps} />
}

export default App
Loading

0 comments on commit 4720a2c

Please sign in to comment.