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