Skip to content

Commit

Permalink
Merge branch 'main' into types/narrow-button-type
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiralite authored Aug 5, 2023
2 parents 140af37 + 7295a3a commit 78be3ea
Show file tree
Hide file tree
Showing 124 changed files with 3,118 additions and 6,218 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/publish-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install node.js v18
uses: actions/setup-node@v3
Expand Down
28 changes: 14 additions & 14 deletions apps/guide/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@
"@react-icons/all-files": "^4.1.0",
"@vercel/analytics": "^1.0.1",
"@vercel/edge-config": "^0.2.1",
"@vercel/og": "^0.5.8",
"@vercel/og": "^0.5.9",
"ariakit": "^2.0.0-next.44",
"cmdk": "^0.2.0",
"contentlayer": "0.3.1",
"next": "^13.4.11-canary.0",
"next": "^13.4.12",
"next-contentlayer": "0.3.1",
"next-themes": "^0.2.1",
"react": "^18.2.0",
Expand All @@ -62,36 +62,36 @@
"rehype-autolink-headings": "^6.1.1",
"rehype-slug": "^5.1.0",
"remark-gfm": "^3.0.1",
"sharp": "^0.32.3"
"sharp": "^0.32.4"
},
"devDependencies": {
"@next/bundle-analyzer": "^13.4.10",
"@next/bundle-analyzer": "^13.4.12",
"@testing-library/react": "^14.0.0",
"@testing-library/user-event": "^14.4.3",
"@types/html-escaper": "^3.0.0",
"@types/node": "18.16.19",
"@types/react": "^18.2.15",
"@types/node": "18.17.1",
"@types/react": "^18.2.17",
"@types/react-dom": "^18.2.7",
"@unocss/cli": "^0.53.5",
"@unocss/eslint-config": "^0.53.5",
"@unocss/reset": "^0.53.5",
"@unocss/cli": "^0.54.0",
"@unocss/eslint-config": "^0.54.0",
"@unocss/reset": "^0.54.0",
"@vitejs/plugin-react": "^4.0.3",
"@vitest/coverage-c8": "^0.33.0",
"concurrently": "^8.2.0",
"cross-env": "^7.0.3",
"eslint": "^8.45.0",
"eslint": "^8.46.0",
"eslint-config-neon": "^0.1.47",
"eslint-formatter-pretty": "^5.0.0",
"happy-dom": "^10.5.1",
"happy-dom": "^10.5.2",
"hast-util-to-string": "^2.0.0",
"hastscript": "^7.2.0",
"html-escaper": "^3.0.3",
"lighthouse": "^10.4.0",
"prettier": "^2.8.8",
"turbo": "^1.10.8",
"turbo": "^1.10.12",
"typescript": "^5.1.6",
"unocss": "^0.53.5",
"vercel": "^31.0.4",
"unocss": "^0.54.0",
"vercel": "^31.2.0",
"vitest": "^0.33.0"
},
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion apps/guide/src/app/_global-error.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { Providers } from './providers';
import { inter } from '~/util/fonts';

export default function GlobalError({ error }: { error: Error }) {
export default function GlobalError({ error }: { readonly error: Error }) {
console.error(error);

return (
Expand Down
2 changes: 1 addition & 1 deletion apps/guide/src/app/error.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';

export default function Error({ error }: { error: Error }) {
export default function Error({ error }: { readonly error: Error }) {
console.error(error);

return (
Expand Down
2 changes: 1 addition & 1 deletion apps/guide/src/app/guide/[...slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export async function generateStaticParams() {
return allContents.map((content) => ({ slug: [content.slug] }));
}

export default function Page({ params }: { params: { slug: string[] } }) {
export default function Page({ params }: { readonly params: { slug: string[] } }) {
const content = allContents.find((content) => content.slug === params.slug?.join('/'));

if (!content) {
Expand Down
8 changes: 4 additions & 4 deletions apps/guide/src/components/DiscordAPITypesLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,26 @@ interface DiscordAPITypesLinkOptions {
*
* @example `'RESTJSONErrorCodes'`
*/
parent?: string;
readonly parent?: string;
/**
* The scope of where this link lives.
*
* @remarks API does not have a scope.
*/
scope?: 'gateway' | 'globals' | 'payloads' | 'rest' | 'rpc' | 'utils' | 'voice';
readonly scope?: 'gateway' | 'globals' | 'payloads' | 'rest' | 'rpc' | 'utils' | 'voice';
/**
* The symbol belonging to the parent.
*
* @example '`MaximumNumberOfGuildsReached'`
*/
symbol?: string;
readonly symbol?: string;
/**
* The type of the {@link DiscordAPITypesLinkOptions.parent}.
*
* @example `'enum'`
* @example `'interface'`
*/
type?: string;
readonly type?: string;
}

export function DiscordAPITypesLink({
Expand Down
12 changes: 6 additions & 6 deletions apps/guide/src/components/DocsLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,40 +8,40 @@ interface DocsLinkOptions {
*
* @remarks Functions automatically infer this.
*/
brackets?: boolean;
readonly brackets?: boolean;
/**
* The package.
*
* @defaultValue `'discord.js'`
*/
package?: (typeof PACKAGES)[number];
readonly package?: (typeof PACKAGES)[number];
/**
* The initial documentation class, function, interface etc.
*
* @example `'Client'`
*/
parent?: string;
readonly parent?: string;
/**
* Whether to reference a static property.
*
* @remarks
* This should only be used for the https://discord.js.org domain
* as static properties are not identified in the URL.
*/
static?: boolean;
readonly static?: boolean;
/**
* The symbol belonging to the parent.
*
* @example '`login'`
*/
symbol?: string;
readonly symbol?: string;
/**
* The type of the {@link DocsLinkOptions.parent}.
*
* @example `'class'`
* @example `'Function'`
*/
type?: string;
readonly type?: string;
}

export function DocsLink({
Expand Down
2 changes: 1 addition & 1 deletion apps/guide/src/components/Mdx.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { H4 } from './H4';
import { DocsLink } from '~/components/DocsLink';
import { ResultingCode } from '~/components/ResultingCode';

export function Mdx({ code }: { code: string }) {
export function Mdx({ code }: { readonly code: string }) {
const Component = useMDXComponent(code);

return (
Expand Down
2 changes: 1 addition & 1 deletion apps/guide/src/components/Outline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const LINK_HEIGHT = 30;
const INDICATOR_SIZE = 10;
const INDICATOR_OFFSET = (LINK_HEIGHT - INDICATOR_SIZE) / 2;

export function Outline({ headings }: { headings: any[] }) {
export function Outline({ headings }: { readonly headings: any[] }) {
// eslint-disable-next-line react/hook-use-state
const [active /* setActive */] = useState(0);

Expand Down
10 changes: 9 additions & 1 deletion apps/guide/src/components/PageButton.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
export function PageButton({ url, title, direction }: { direction: 'next' | 'prev'; title: string; url: string }) {
export function PageButton({
url,
title,
direction,
}: {
readonly direction: 'next' | 'prev';
readonly title: string;
readonly url: string;
}) {
return (
<a
className="flex flex-row flex-col transform-gpu cursor-pointer select-none appearance-none place-items-center gap-2 rounded bg-light-600 px-4 py-3 leading-none no-underline outline-none active:translate-y-px active:bg-light-800 dark:bg-dark-600 hover:bg-light-700 focus:ring focus:ring-width-2 focus:ring-blurple dark:active:bg-dark-400 dark:hover:bg-dark-500"
Expand Down
28 changes: 14 additions & 14 deletions apps/website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@
"@react-icons/all-files": "^4.1.0",
"@vercel/analytics": "^1.0.1",
"@vercel/edge-config": "^0.2.1",
"@vercel/og": "^0.5.8",
"@vercel/og": "^0.5.9",
"ariakit": "^2.0.0-next.44",
"bright": "^0.8.3",
"bright": "^0.8.4",
"class-variance-authority": "^0.7.0",
"cmdk": "^0.2.0",
"meilisearch": "^0.33.0",
"next": "^13.4.11-canary.0",
"next": "^13.4.12",
"next-mdx-remote": "^4.4.1",
"next-themes": "^0.2.1",
"react": "^18.2.0",
Expand All @@ -71,33 +71,33 @@
"rehype-raw": "^6.1.1",
"rehype-slug": "^5.1.0",
"remark-gfm": "^3.0.1",
"sharp": "^0.32.3",
"sharp": "^0.32.4",
"swr": "^2.2.0"
},
"devDependencies": {
"@next/bundle-analyzer": "^13.4.10",
"@next/bundle-analyzer": "^13.4.12",
"@testing-library/react": "^14.0.0",
"@testing-library/user-event": "^14.4.3",
"@types/node": "18.16.19",
"@types/react": "^18.2.15",
"@types/node": "18.17.1",
"@types/react": "^18.2.17",
"@types/react-dom": "^18.2.7",
"@unocss/cli": "^0.53.5",
"@unocss/eslint-config": "^0.53.5",
"@unocss/reset": "^0.53.5",
"@unocss/cli": "^0.54.0",
"@unocss/eslint-config": "^0.54.0",
"@unocss/reset": "^0.54.0",
"@vitejs/plugin-react": "^4.0.3",
"@vitest/coverage-c8": "^0.33.0",
"concurrently": "^8.2.0",
"cpy-cli": "^5.0.0",
"cross-env": "^7.0.3",
"eslint": "^8.45.0",
"eslint": "^8.46.0",
"eslint-config-neon": "^0.1.47",
"eslint-formatter-pretty": "^5.0.0",
"happy-dom": "^10.5.1",
"happy-dom": "^10.5.2",
"lighthouse": "^10.4.0",
"prettier": "^2.8.8",
"turbo": "^1.10.8",
"turbo": "^1.10.12",
"typescript": "^5.1.6",
"vercel": "^31.0.4",
"vercel": "^31.2.0",
"vitest": "^0.33.0"
},
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion apps/website/src/app/_global-error.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export const metadata: Metadata = {
},
};

export default function GlobalError({ error }: { error: Error }) {
export default function GlobalError({ error }: { readonly error: Error }) {
console.error(error);

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export async function generateStaticParams({ params: { package: packageName, ver
}));
}

function Member({ member }: { member?: ApiItem }) {
function Member({ member }: { readonly member?: ApiItem }) {
switch (member?.kind) {
case 'Class':
return <Class clazz={member as ApiClass} />;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';

export default function Error({ error }: { error: Error }) {
export default function Error({ error }: { readonly error: Error }) {
console.error(error);

return (
Expand Down
2 changes: 1 addition & 1 deletion apps/website/src/app/error.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';

export default function Error({ error }: { error: Error }) {
export default function Error({ error }: { readonly error: Error }) {
console.error(error);

return (
Expand Down
7 changes: 5 additions & 2 deletions apps/website/src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,12 @@ export default function Page() {
Discord bots.
</h1>
<p className="my-6 leading-normal text-neutral-700 dark:text-neutral-300">{DESCRIPTION}</p>
<div className="flex gap-4 md:flex-row">
<Link className={buttonVariants()} href="/docs">
<div className="flex flex-wrap place-content-center gap-4 md:flex-row">
<a className={buttonVariants()} href="https://old.discordjs.dev/#/docs" rel="noopener noreferrer">
Docs
</a>
<Link className={buttonVariants()} href="/docs">
Module docs
</Link>
<a
className={buttonVariants({ variant: 'secondary' })}
Expand Down
2 changes: 1 addition & 1 deletion apps/website/src/components/Anchor.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { FiLink } from '@react-icons/all-files/fi/FiLink';

export function Anchor({ href }: { href: string }) {
export function Anchor({ href }: { readonly href: string }) {
return (
<a className="mr-1 inline-block rounded outline-none focus:ring focus:ring-width-2 focus:ring-blurple" href={href}>
<FiLink size={20} />
Expand Down
7 changes: 5 additions & 2 deletions apps/website/src/components/Badges.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ export enum BadgeColor {
Warning = 'bg-yellow-500',
}

export function Badge({ children, color = BadgeColor.Primary }: PropsWithChildren<{ color?: BadgeColor | undefined }>) {
export function Badge({
children,
color = BadgeColor.Primary,
}: PropsWithChildren<{ readonly color?: BadgeColor | undefined }>) {
return (
<span
className={`h-5 flex flex-row place-content-center place-items-center rounded-full px-3 text-center text-xs font-semibold uppercase text-white ${color}`}
Expand All @@ -18,7 +21,7 @@ export function Badge({ children, color = BadgeColor.Primary }: PropsWithChildre
);
}

export function Badges({ item }: { item: ApiDocumentedItem }) {
export function Badges({ item }: { readonly item: ApiDocumentedItem }) {
const isStatic = ApiStaticMixin.isBaseClassOf(item) && item.isStatic;
const isProtected = ApiProtectedMixin.isBaseClassOf(item) && item.isProtected;
const isReadonly = ApiReadonlyMixin.isBaseClassOf(item) && item.isReadonly;
Expand Down
6 changes: 3 additions & 3 deletions apps/website/src/components/CodeHeading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ export interface CodeListingProps {
/**
* The value of this heading.
*/
children: ReactNode;
readonly children: ReactNode;
/**
* Additional class names to apply to the root element.
*/
className?: string | undefined;
readonly className?: string | undefined;
/**
* The href of this heading.
*/
href?: string | undefined;
readonly href?: string | undefined;
}

export function CodeHeading({ href, className, children }: CodeListingProps) {
Expand Down
4 changes: 2 additions & 2 deletions apps/website/src/components/ExcerptText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ export interface ExcerptTextProps {
/**
* The tokens to render.
*/
excerpt: Excerpt;
readonly excerpt: Excerpt;
/**
* The model to resolve item references from.
*/
model: ApiModel;
readonly model: ApiModel;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion apps/website/src/components/InheritanceText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { ApiDeclaredItem } from '@microsoft/api-extractor-model';
import { ItemLink } from './ItemLink';
import { resolveItemURI } from './documentation/util';

export function InheritanceText({ parent }: { parent: ApiDeclaredItem }) {
export function InheritanceText({ parent }: { readonly parent: ApiDeclaredItem }) {
return (
<span className="font-semibold">
Inherited from{' '}
Expand Down
Loading

0 comments on commit 78be3ea

Please sign in to comment.