Skip to content

Commit

Permalink
refactor: docs design
Browse files Browse the repository at this point in the history
  • Loading branch information
iCrawl committed Aug 14, 2022
1 parent d08da8a commit c29134c
Show file tree
Hide file tree
Showing 45 changed files with 1,910 additions and 1,940 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@
"@typescript-eslint/eslint-plugin": "^5.33.0",
"@typescript-eslint/parser": "^5.33.0",
"conventional-changelog-cli": "^2.2.2",
"eslint": "^8.21.0",
"eslint": "^8.22.0",
"eslint-config-marine": "^9.4.1",
"eslint-config-prettier": "^8.5.0",
"eslint-import-resolver-typescript": "^3.4.0",
"eslint-import-resolver-typescript": "^3.4.1",
"eslint-plugin-import": "^2.26.0",
"fast-glob": "^3.2.11",
"husky": "^8.0.1",
Expand Down
6 changes: 3 additions & 3 deletions packages/actions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@
"tslib": "^2.4.0"
},
"devDependencies": {
"@types/node": "^16.11.47",
"@types/node": "^16.11.48",
"c8": "^7.12.0",
"eslint": "^8.21.0",
"eslint": "^8.22.0",
"prettier": "^2.7.1",
"rollup-plugin-typescript2": "0.32.1",
"typescript": "^4.7.4",
"unbuild": "^0.8.4",
"unbuild": "^0.8.8",
"vitest": "^0.21.1"
},
"engines": {
Expand Down
6 changes: 3 additions & 3 deletions packages/builders/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@
"@discordjs/docgen": "workspace:^",
"@favware/cliff-jumper": "^1.8.6",
"@microsoft/api-extractor": "^7.29.2",
"@types/node": "^16.11.47",
"@types/node": "^16.11.48",
"c8": "^7.12.0",
"downlevel-dts": "^0.10.0",
"eslint": "^8.21.0",
"eslint": "^8.22.0",
"prettier": "^2.7.1",
"rollup-plugin-typescript2": "0.32.1",
"typescript": "^4.7.4",
"unbuild": "^0.8.4",
"unbuild": "^0.8.8",
"vitest": "^0.21.1"
},
"engines": {
Expand Down
6 changes: 3 additions & 3 deletions packages/collection/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@
"@discordjs/docgen": "workspace:^",
"@favware/cliff-jumper": "^1.8.6",
"@microsoft/api-extractor": "^7.29.2",
"@types/node": "^16.11.47",
"@types/node": "^16.11.48",
"c8": "^7.12.0",
"downlevel-dts": "^0.10.0",
"eslint": "^8.21.0",
"eslint": "^8.22.0",
"prettier": "^2.7.1",
"rollup-plugin-typescript2": "0.32.1",
"typescript": "^4.7.4",
"unbuild": "^0.8.4",
"unbuild": "^0.8.8",
"vitest": "^0.21.1"
},
"engines": {
Expand Down
4 changes: 2 additions & 2 deletions packages/discord.js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@
"devDependencies": {
"@discordjs/docgen": "workspace:^",
"@favware/cliff-jumper": "^1.8.6",
"@types/node": "^16.11.47",
"@types/node": "^16.11.48",
"dtslint": "^4.2.1",
"eslint": "^8.21.0",
"eslint": "^8.22.0",
"jest": "^28.1.3",
"prettier": "^2.7.1",
"tsd": "^0.22.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/docgen/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@
"devDependencies": {
"@favware/cliff-jumper": "^1.8.6",
"@types/jsdoc-to-markdown": "^7.0.3",
"@types/node": "^16.11.47",
"eslint": "^8.21.0",
"@types/node": "^16.11.48",
"eslint": "^8.22.0",
"prettier": "^2.7.1",
"rollup-plugin-typescript2": "0.32.1",
"typescript": "^4.7.4",
"unbuild": "^0.8.4"
"unbuild": "^0.8.8"
},
"engines": {
"node": ">=16.9.0"
Expand Down
6 changes: 3 additions & 3 deletions packages/proxy-container/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@
"tslib": "^2.4.0"
},
"devDependencies": {
"@types/node": "^16.11.47",
"eslint": "^8.21.0",
"@types/node": "^16.11.48",
"eslint": "^8.22.0",
"prettier": "^2.7.1",
"rollup-plugin-typescript2": "0.32.1",
"typescript": "^4.7.4",
"unbuild": "^0.8.4"
"unbuild": "^0.8.8"
},
"engines": {
"node": ">=16.9.0"
Expand Down
6 changes: 3 additions & 3 deletions packages/proxy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,16 @@
"@discordjs/docgen": "workspace:^",
"@favware/cliff-jumper": "^1.8.6",
"@microsoft/api-extractor": "^7.29.2",
"@types/node": "^16.11.47",
"@types/node": "^16.11.48",
"@types/supertest": "^2.0.12",
"c8": "^7.12.0",
"downlevel-dts": "^0.10.0",
"eslint": "^8.21.0",
"eslint": "^8.22.0",
"prettier": "^2.7.1",
"rollup-plugin-typescript2": "0.32.1",
"supertest": "^6.2.4",
"typescript": "^4.7.4",
"unbuild": "^0.8.4",
"unbuild": "^0.8.8",
"vitest": "^0.21.1"
},
"engines": {
Expand Down
6 changes: 3 additions & 3 deletions packages/rest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@
"@discordjs/docgen": "workspace:^",
"@favware/cliff-jumper": "^1.8.6",
"@microsoft/api-extractor": "^7.29.2",
"@types/node": "^16.11.47",
"@types/node": "^16.11.48",
"c8": "^7.12.0",
"downlevel-dts": "^0.10.0",
"eslint": "^8.21.0",
"eslint": "^8.22.0",
"prettier": "^2.7.1",
"rollup-plugin-typescript2": "0.32.1",
"typescript": "^4.7.4",
"unbuild": "^0.8.4",
"unbuild": "^0.8.8",
"vitest": "^0.21.1"
},
"engines": {
Expand Down
6 changes: 3 additions & 3 deletions packages/scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@
"tslib": "^2.4.0"
},
"devDependencies": {
"@types/node": "^16.11.47",
"@types/node": "^16.11.48",
"c8": "^7.12.0",
"eslint": "^8.21.0",
"eslint": "^8.22.0",
"prettier": "^2.7.1",
"rollup-plugin-typescript2": "0.32.1",
"typescript": "^4.7.4",
"unbuild": "^0.8.4",
"unbuild": "^0.8.8",
"vitest": "^0.21.1"
},
"engines": {
Expand Down
6 changes: 3 additions & 3 deletions packages/voice/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,17 @@
"@favware/cliff-jumper": "^1.8.6",
"@microsoft/api-extractor": "^7.29.2",
"@types/jest": "^28.1.6",
"@types/node": "^16.11.47",
"@types/node": "^16.11.48",
"downlevel-dts": "^0.10.0",
"eslint": "^8.21.0",
"eslint": "^8.22.0",
"jest": "^28.1.3",
"jest-websocket-mock": "^2.4.0",
"mock-socket": "^9.1.5",
"prettier": "^2.7.1",
"rollup-plugin-typescript2": "0.32.1",
"tweetnacl": "^1.0.3",
"typescript": "^4.7.4",
"unbuild": "^0.8.4"
"unbuild": "^0.8.8"
},
"engines": {
"node": ">=16.9.0"
Expand Down
34 changes: 17 additions & 17 deletions packages/website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,49 +47,49 @@
},
"homepage": "https://discord.js.org",
"dependencies": {
"@emotion/react": "^11.10.0",
"@emotion/server": "^11.10.0",
"@mantine/core": "^5.1.6",
"@mantine/hooks": "^5.1.6",
"@mantine/next": "^5.1.6",
"@mantine/nprogress": "^5.1.6",
"@mantine/spotlight": "^5.1.6",
"@microsoft/api-extractor-model": "^7.23.0",
"@microsoft/tsdoc": "0.14.1",
"@microsoft/tsdoc-config": "0.16.1",
"@vscode/codicons": "^0.0.32",
"framer-motion": "^7.0.1",
"next": "^12.2.4",
"framer-motion": "^7.1.0",
"next": "^12.2.5",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-icons": "^4.4.0",
"react-syntax-highlighter": "^15.5.0",
"sharp": "^0.30.7"
},
"devDependencies": {
"@testing-library/cypress": "^8.0.3",
"@testing-library/dom": "^8.17.1",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.3.0",
"@testing-library/user-event": "^14.4.3",
"@types/node": "^16.11.47",
"@types/node": "^16.11.48",
"@types/react-dom": "^18.0.6",
"@types/react-syntax-highlighter": "^15.5.4",
"@typescript-eslint/eslint-plugin": "^5.33.0",
"@typescript-eslint/parser": "^5.33.0",
"@unocss/cli": "^0.45.5",
"@unocss/preset-web-fonts": "^0.45.5",
"@unocss/reset": "^0.45.5",
"@vitejs/plugin-react": "^2.0.0",
"@unocss/cli": "^0.45.6",
"@unocss/preset-web-fonts": "^0.45.6",
"@vitejs/plugin-react": "^2.0.1",
"c8": "^7.12.0",
"concurrently": "^7.3.0",
"cypress": "^10.4.0",
"eslint": "^8.21.0",
"eslint": "^8.22.0",
"eslint-config-marine": "^9.4.1",
"eslint-config-prettier": "^8.5.0",
"eslint-import-resolver-typescript": "^3.4.0",
"eslint-import-resolver-typescript": "^3.4.1",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-react": "^7.30.1",
"eslint-plugin-react-hooks": "^4.6.0",
"happy-dom": "^6.0.4",
"msw": "^0.44.2",
"prettier": "^2.7.1",
"typescript": "^4.7.4",
"unocss": "^0.45.5",
"vercel": "^27.4.0",
"unocss": "^0.45.6",
"vercel": "^28.0.1",
"vitest": "^0.21.1"
},
"engines": {
Expand Down
46 changes: 22 additions & 24 deletions packages/website/src/components/CodeListing.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Group, Stack, Title } from '@mantine/core';
import type { ReactNode } from 'react';
import { CommentSection } from './Comment';
import { HyperlinkedText } from './HyperlinkedText';
Expand All @@ -9,36 +10,33 @@ export enum CodeListingSeparatorType {
Value = '=',
}

export interface CodeListingProps {
name: string;
summary?: ReturnType<DocItem['toJSON']>['summary'];
typeTokens: TokenDocumentation[];
separator?: CodeListingSeparatorType;
children?: ReactNode;
className?: string | undefined;
}

export function CodeListing({
name,
className,
separator = CodeListingSeparatorType.Type,
summary,
typeTokens,
children,
}: CodeListingProps) {
}: {
name: string;
summary?: ReturnType<DocItem['toJSON']>['summary'];
typeTokens: TokenDocumentation[];
separator?: CodeListingSeparatorType;
children?: ReactNode;
className?: string | undefined;
}) {
return (
<div className={className}>
<div key={name} className="flex flex-col">
<div className="w-full flex flex-row gap-3">
<h4 className="font-mono m-0">{`${name}`}</h4>
<h4 className="m-0">{separator}</h4>
<h4 className="font-mono m-0 break-all">
<HyperlinkedText tokens={typeTokens} />
</h4>
</div>
{summary && <CommentSection textClassName="text-dark-100 dark:text-gray-300" node={summary} />}
{children}
</div>
</div>
<Stack key={name}>
<Group>
<Title order={4} className="font-mono">
{name}
</Title>
<Title order={4}>{separator}</Title>
<Title order={4} className="font-mono break-all">
<HyperlinkedText tokens={typeTokens} />
</Title>
</Group>
{summary && <CommentSection node={summary} />}
{children}
</Stack>
);
}
Loading

0 comments on commit c29134c

Please sign in to comment.