mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-18 12:33:30 +01:00
build: use module
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
/**
|
/**
|
||||||
* @type {import('next').NextConfig}
|
* @type {import('next').NextConfig}
|
||||||
*/
|
*/
|
||||||
module.exports = {
|
export default {
|
||||||
reactStrictMode: true,
|
reactStrictMode: true,
|
||||||
swcMinify: true,
|
swcMinify: true,
|
||||||
eslint: {
|
eslint: {
|
||||||
|
|||||||
@@ -16,16 +16,7 @@
|
|||||||
"lint": "prettier --check . && TIMING=1 eslint src --ext mjs,js,ts,tsx",
|
"lint": "prettier --check . && TIMING=1 eslint src --ext mjs,js,ts,tsx",
|
||||||
"format": "prettier --write . && TIMING=1 eslint src --ext mjs,js,ts,tsx --fix"
|
"format": "prettier --write . && TIMING=1 eslint src --ext mjs,js,ts,tsx --fix"
|
||||||
},
|
},
|
||||||
"main": "./dist/index.js",
|
"type": "module",
|
||||||
"module": "./dist/index.mjs",
|
|
||||||
"types": "./dist/index.d.ts",
|
|
||||||
"directories": {
|
|
||||||
"lib": "src",
|
|
||||||
"test": "__tests__"
|
|
||||||
},
|
|
||||||
"files": [
|
|
||||||
"dist"
|
|
||||||
],
|
|
||||||
"contributors": [
|
"contributors": [
|
||||||
"Crawl <icrawltogo@gmail.com>"
|
"Crawl <icrawltogo@gmail.com>"
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import {
|
|||||||
VscSymbolParameter,
|
VscSymbolParameter,
|
||||||
} from 'react-icons/vsc';
|
} from 'react-icons/vsc';
|
||||||
import { PrismAsyncLight as SyntaxHighlighter } from 'react-syntax-highlighter';
|
import { PrismAsyncLight as SyntaxHighlighter } from 'react-syntax-highlighter';
|
||||||
import { vscDarkPlus } from 'react-syntax-highlighter/dist/cjs/styles/prism';
|
import vscDarkPlus from 'react-syntax-highlighter/dist/cjs/styles/prism';
|
||||||
import { HyperlinkedText } from './HyperlinkedText';
|
import { HyperlinkedText } from './HyperlinkedText';
|
||||||
import { Section } from './Section';
|
import { Section } from './Section';
|
||||||
import { TableOfContentItems } from './TableOfContentItems';
|
import { TableOfContentItems } from './TableOfContentItems';
|
||||||
|
|||||||
@@ -243,8 +243,8 @@ export function SidebarLayout({
|
|||||||
</MediaQuery>
|
</MediaQuery>
|
||||||
|
|
||||||
<MediaQuery smallerThan="md" styles={{ display: 'none' }}>
|
<MediaQuery smallerThan="md" styles={{ display: 'none' }}>
|
||||||
<Skeleton visible={router.isFallback || !router.isReady} radius="xs">
|
<Skeleton visible={router.isFallback} radius="xs">
|
||||||
{router.isReady ? <Breadcrumbs>{breadcrumbs}</Breadcrumbs> : null}
|
<Breadcrumbs>{breadcrumbs}</Breadcrumbs>
|
||||||
</Skeleton>
|
</Skeleton>
|
||||||
</MediaQuery>
|
</MediaQuery>
|
||||||
</Box>
|
</Box>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { DocNodeKind, StandardTags } from '@microsoft/tsdoc';
|
|||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
import { Fragment, ReactNode } from 'react';
|
import { Fragment, ReactNode } from 'react';
|
||||||
import { PrismAsyncLight as SyntaxHighlighter } from 'react-syntax-highlighter';
|
import { PrismAsyncLight as SyntaxHighlighter } from 'react-syntax-highlighter';
|
||||||
import { vscDarkPlus } from 'react-syntax-highlighter/dist/cjs/styles/prism';
|
import vscDarkPlus from 'react-syntax-highlighter/dist/cjs/styles/prism';
|
||||||
import { BlockComment } from './BlockComment';
|
import { BlockComment } from './BlockComment';
|
||||||
import type { DocBlockJSON } from '~/DocModel/comment/CommentBlock';
|
import type { DocBlockJSON } from '~/DocModel/comment/CommentBlock';
|
||||||
import type { AnyDocNodeJSON } from '~/DocModel/comment/CommentNode';
|
import type { AnyDocNodeJSON } from '~/DocModel/comment/CommentNode';
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { Container, Title, Group, Button, Box, createStyles } from '@mantine/core';
|
import { Container, Title, Group, Button, Box, createStyles } from '@mantine/core';
|
||||||
|
import Head from 'next/head';
|
||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
|
|
||||||
const useStyles = createStyles((theme) => ({
|
const useStyles = createStyles((theme) => ({
|
||||||
@@ -20,16 +21,21 @@ export default function FourOhFourPage() {
|
|||||||
const { classes } = useStyles();
|
const { classes } = useStyles();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Container pt={96} pb={96}>
|
<>
|
||||||
<Box className={classes.label}>404</Box>
|
<Head>
|
||||||
<Title align="center">Not found.</Title>
|
<title key="title">discord.js | 404</title>
|
||||||
<Group position="center">
|
</Head>
|
||||||
<Link href="/docs/packages" passHref>
|
<Container pt={96} pb={96}>
|
||||||
<Button component="a" variant="filled" size="md" mt="xl">
|
<Box className={classes.label}>404</Box>
|
||||||
Take me back
|
<Title align="center">Not found.</Title>
|
||||||
</Button>
|
<Group position="center">
|
||||||
</Link>
|
<Link href="/docs/packages" passHref>
|
||||||
</Group>
|
<Button component="a" variant="filled" size="md" mt="xl">
|
||||||
</Container>
|
Take me back
|
||||||
|
</Button>
|
||||||
|
</Link>
|
||||||
|
</Group>
|
||||||
|
</Container>
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { readFile } from 'node:fs/promises';
|
import { readFile } from 'node:fs/promises';
|
||||||
import { join } from 'node:path';
|
import { join } from 'node:path';
|
||||||
|
import { cwd } from 'node:process';
|
||||||
import { Affix, Box, Button, LoadingOverlay, Transition } from '@mantine/core';
|
import { Affix, Box, Button, LoadingOverlay, Transition } from '@mantine/core';
|
||||||
import { useMediaQuery, useWindowScroll } from '@mantine/hooks';
|
import { useMediaQuery, useWindowScroll } from '@mantine/hooks';
|
||||||
import { ApiFunction, ApiItemKind, type ApiPackage } from '@microsoft/api-extractor-model';
|
import { ApiFunction, ApiItemKind, type ApiPackage } from '@microsoft/api-extractor-model';
|
||||||
@@ -43,10 +44,7 @@ export const getStaticPaths: GetStaticPaths = async () => {
|
|||||||
let data: any[] = [];
|
let data: any[] = [];
|
||||||
let versions: string[] = [];
|
let versions: string[] = [];
|
||||||
if (process.env.NEXT_PUBLIC_LOCAL_DEV) {
|
if (process.env.NEXT_PUBLIC_LOCAL_DEV) {
|
||||||
const res = await readFile(
|
const res = await readFile(join(cwd(), '..', packageName, 'docs', 'docs.api.json'), 'utf-8');
|
||||||
join(__dirname, '..', '..', '..', '..', '..', packageName, 'docs', 'docs.api.json'),
|
|
||||||
'utf-8',
|
|
||||||
);
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||||
data = JSON.parse(res);
|
data = JSON.parse(res);
|
||||||
} else {
|
} else {
|
||||||
@@ -130,7 +128,7 @@ export const getStaticProps: GetStaticProps = async ({ params }) => {
|
|||||||
const [memberName, overloadIndex] = member?.split(':') ?? [];
|
const [memberName, overloadIndex] = member?.split(':') ?? [];
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const readme = await readFile(join(__dirname, '..', '..', '..', '..', '..', packageName, 'README.md'), 'utf-8');
|
const readme = await readFile(join(cwd(), '..', packageName, 'README.md'), 'utf-8');
|
||||||
|
|
||||||
const mdxSource = await serialize(readme, {
|
const mdxSource = await serialize(readme, {
|
||||||
mdxOptions: {
|
mdxOptions: {
|
||||||
@@ -143,10 +141,7 @@ export const getStaticProps: GetStaticProps = async ({ params }) => {
|
|||||||
|
|
||||||
let data;
|
let data;
|
||||||
if (process.env.NEXT_PUBLIC_LOCAL_DEV) {
|
if (process.env.NEXT_PUBLIC_LOCAL_DEV) {
|
||||||
const res = await readFile(
|
const res = await readFile(join(cwd(), '..', packageName, 'docs', 'docs.api.json'), 'utf-8');
|
||||||
join(__dirname, '..', '..', '..', '..', '..', packageName, 'docs', 'docs.api.json'),
|
|
||||||
'utf-8',
|
|
||||||
);
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||||
data = JSON.parse(res);
|
data = JSON.parse(res);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user