-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* move * rename * more * more * more * more * more * more * more * moree * moree * moree * moree * more * more * more * [skip ci] * more * fix icons * update docs to use Nextra 4 * [skip ci] * fix lint [skip ci] * more [skip ci] * more * upd * pnpm dedupe * yoyo * aa * aa * build pass
- Loading branch information
1 parent
892f7e3
commit 007f3f2
Showing
133 changed files
with
789 additions
and
970 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* eslint-disable react-hooks/rules-of-hooks -- false positive, useMDXComponents are not react hooks */ | ||
|
||
import { generateStaticParamsFor, importPage } from '@theguild/components/pages'; | ||
import { useMDXComponents } from '../../mdx-components'; | ||
|
||
export const generateStaticParams = generateStaticParamsFor('mdxPath'); | ||
|
||
export async function generateMetadata(props: Props) { | ||
const params = await props.params; | ||
const { metadata } = await importPage(params.mdxPath); | ||
return metadata; | ||
} | ||
|
||
const Wrapper = useMDXComponents().wrapper; | ||
|
||
type Props = { | ||
params: Promise<{ | ||
mdxPath: string[]; | ||
}>; | ||
}; | ||
|
||
export default async function Page(props: Props) { | ||
const params = await props.params; | ||
const result = await importPage(params.mdxPath); | ||
const { default: MDXContent, toc, metadata } = result; | ||
return ( | ||
<Wrapper toc={toc} metadata={metadata}> | ||
<MDXContent {...props} params={params} /> | ||
</Wrapper> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
import { rules } from '@graphql-eslint/eslint-plugin'; | ||
|
||
const { schemaRules, operationsRules, schemaAndOperationsRules } = Object.entries(rules) | ||
.sort(([a], [b]) => a.localeCompare(b)) | ||
.reduce<{ | ||
schemaRules: string[]; | ||
operationsRules: string[]; | ||
schemaAndOperationsRules: []; | ||
}>( | ||
(acc, [ruleId, curr]) => { | ||
// @ts-expect-error -- fixme | ||
const { category } = curr.meta.docs; | ||
if (category === 'Schema') { | ||
acc.schemaRules.push(ruleId); | ||
} else if (category === 'Operations') { | ||
acc.operationsRules.push(ruleId); | ||
} else { | ||
// @ts-expect-error -- fixme | ||
acc.schemaAndOperationsRules.push(ruleId); | ||
} | ||
return acc; | ||
}, | ||
{ schemaRules: [], operationsRules: [], schemaAndOperationsRules: [] }, | ||
); | ||
|
||
export default { | ||
docs: { | ||
title: 'Documentation', | ||
type: 'page', | ||
items: { | ||
index: '', | ||
'getting-started': '', | ||
'parser-options': '', | ||
usage: { | ||
title: 'Usage', | ||
items: { | ||
_1: { | ||
type: 'separator', | ||
title: 'Basic', | ||
}, | ||
graphql: '', | ||
js: '', | ||
'schema-and-documents': '', | ||
'multiple-projects': '', | ||
programmatic: '', | ||
_2: { | ||
type: 'separator', | ||
title: 'Advanced', | ||
}, | ||
svelte: '', | ||
vue: '', | ||
astro: '', | ||
prettier: '', | ||
}, | ||
}, | ||
_1: { | ||
type: 'separator', | ||
title: 'Users', | ||
}, | ||
configs: '', | ||
'disabling-rules': '', | ||
vscode: '', | ||
_2: { | ||
type: 'separator', | ||
title: 'Developers', | ||
}, | ||
parser: '', | ||
'custom-rules': '', | ||
}, | ||
}, | ||
rules: { | ||
title: 'Rules', | ||
type: 'page', | ||
items: { | ||
index: { | ||
theme: { | ||
layout: 'full', | ||
}, | ||
}, | ||
prettier: '', | ||
'deprecated-rules': '', | ||
_1: { | ||
title: 'Schema & Operations Rules', | ||
type: 'separator', | ||
}, | ||
...Object.fromEntries(schemaAndOperationsRules.map(key => [key, ''])), | ||
_2: { | ||
title: 'Schema Rules', | ||
type: 'separator', | ||
}, | ||
...Object.fromEntries(schemaRules.map(key => [key, ''])), | ||
_3: { | ||
title: 'Operations Rules', | ||
type: 'separator', | ||
}, | ||
...Object.fromEntries(operationsRules.map(key => [key, ''])), | ||
}, | ||
}, | ||
play: { | ||
title: 'Playground', | ||
type: 'page', | ||
theme: { | ||
footer: false, | ||
}, | ||
}, | ||
}; |
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
2 changes: 1 addition & 1 deletion
2
website/src/icons/prettier.svg → website/app/icons/prettier.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import { ComponentPropsWithoutRef, FC, ReactNode } from 'react'; | ||
import { Banner, PRODUCTS } from '@theguild/components'; | ||
import { getDefaultMetadata, GuildLayout } from '@theguild/components/server'; | ||
import '@theguild/components/style.css'; | ||
|
||
const description = PRODUCTS.ESLINT.title; | ||
const websiteName = 'GraphQL-ESLint'; | ||
|
||
export const metadata = getDefaultMetadata({ | ||
description, | ||
websiteName, | ||
productName: 'ESLINT', | ||
}); | ||
|
||
const Anchor: FC<ComponentPropsWithoutRef<'a'>> = ({ children, ...props }) => { | ||
return ( | ||
<a | ||
target="_blank" | ||
rel="noreferrer" | ||
className="_text-primary-600 _underline _decoration-from-font [text-underline-position:from-font]" | ||
{...props} | ||
> | ||
{children} | ||
</a> | ||
); | ||
}; | ||
|
||
const RootLayout: FC<{ | ||
children: ReactNode; | ||
}> = async ({ children }) => { | ||
return ( | ||
<GuildLayout | ||
websiteName={websiteName} | ||
description={description} | ||
logo={<PRODUCTS.ESLINT.logo className="text-lg" />} | ||
layoutProps={{ | ||
banner: ( | ||
<Banner dismissible={false}> | ||
🚧 This is WIP documentation for v4 of the plugin. For v3 click{' '} | ||
<Anchor href="https://074c6ee9.graphql-eslint.pages.dev/docs">here</Anchor>. | ||
</Banner> | ||
), | ||
docsRepositoryBase: 'https://github.com/dimaMachina/graphql-eslint/tree/master/website', | ||
}} | ||
navbarProps={{ | ||
navLinks: [ | ||
{ children: 'Rules', href: '/rules' }, | ||
{ children: 'Playground', href: '/play' }, | ||
], | ||
}} | ||
> | ||
{children} | ||
</GuildLayout> | ||
); | ||
}; | ||
|
||
export default RootLayout; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.