Skip to content

Commit

Permalink
chore: remaining deps and lighthouse removal
Browse files Browse the repository at this point in the history
  • Loading branch information
iCrawl committed Nov 8, 2023
1 parent 34d0224 commit e72b552
Show file tree
Hide file tree
Showing 27 changed files with 558 additions and 707 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/deprecate-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ on:
- '@discordjs/builders'
- '@discordjs/collection'
- '@discordjs/core'
- create-discord-bot
- 'create-discord-bot'
- '@discordjs/formatters'
- discord.js
- 'discord.js'
- '@discordjs/next'
- '@discordjs/proxy'
- '@discordjs/rest'
Expand Down
20 changes: 0 additions & 20 deletions .github/workflows/lighthouse-main.yml

This file was deleted.

88 changes: 0 additions & 88 deletions .github/workflows/lighthouse.yml

This file was deleted.

6 changes: 3 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact"],
"eslint.useESLintClass": true,
"eslint.experimental.useFlatConfig": true,
"eslint.workingDirectories": [
{ "directory": "${workspaceFolder}" },
Expand All @@ -16,7 +15,6 @@
},
"editor.trimAutoWhitespace": false,
"files.associations": {
"*.mdx": "markdown",
"api-extractor.json": "jsonc",
"api-extractor-docs.json": "jsonc",
"tsconfig.json": "jsonc",
Expand All @@ -27,8 +25,10 @@
"files.eol": "\n",
"npm.packageManager": "pnpm",
"typescript.tsdk": "node_modules/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true,
"deno.enable": false,
"deno.enablePaths": ["./packages/create-discord-bot/template/Deno"],
"deno.lint": true,
"deno.lint": false,
"deno.unstable": false,
"deno.config": "./packages/create-discord-bot/template/Deno/deno.jsonc"
}
10 changes: 5 additions & 5 deletions apps/guide/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@
},
"devDependencies": {
"@next/bundle-analyzer": "14.0.2-canary.20",
"@testing-library/react": "^14.0.0",
"@testing-library/react": "^14.1.0",
"@testing-library/user-event": "^14.5.1",
"@types/html-escaper": "^3.0.1",
"@types/html-escaper": "^3.0.2",
"@types/node": "18.18.8",
"@types/react": "^18.2.36",
"@types/react-dom": "^18.2.14",
"@types/react": "^18.2.37",
"@types/react-dom": "^18.2.15",
"@unocss/eslint-plugin": "^0.57.2",
"@unocss/postcss": "^0.57.2",
"@unocss/reset": "^0.57.2",
Expand All @@ -92,7 +92,7 @@
"turbo": "^1.10.16",
"typescript": "^5.2.2",
"unocss": "^0.57.2",
"vercel": "^32.5.0",
"vercel": "^32.5.2",
"vitest": "^0.34.6"
},
"engines": {
Expand Down
18 changes: 7 additions & 11 deletions apps/guide/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,19 @@
"jsx": "preserve",
"baseUrl": ".",
"noEmit": true,
"skipLibCheck": true,
"plugins": [
{
"name": "next"
}
],
"paths": {
"~/*": ["./src/*"],
"contentlayer/generated": ["./.contentlayer/generated"]
},
"moduleResolution": "node",
"resolvePackageJsonExports": false,
"resolvePackageJsonImports": false,
"esModuleInterop": true,
"allowJs": true,
"incremental": true
"incremental": true,
"plugins": [
{
"name": "next"
}
]
},
"include": ["src/**/*.ts", "src/**/*.tsx", "next-env.d.ts", ".next/types/**/*.ts", ".contentlayer/generated"],
"include": ["**/*.ts", "**/*.tsx", "next-env.d.ts", ".next/types/**/*.ts", ".contentlayer/generated"],
"exclude": ["node_modules"]
}
File renamed without changes.
8 changes: 4 additions & 4 deletions apps/website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@
},
"devDependencies": {
"@next/bundle-analyzer": "14.0.2-canary.20",
"@testing-library/react": "^14.0.0",
"@testing-library/react": "^14.1.0",
"@testing-library/user-event": "^14.5.1",
"@types/node": "18.18.8",
"@types/react": "^18.2.36",
"@types/react-dom": "^18.2.14",
"@types/react": "^18.2.37",
"@types/react-dom": "^18.2.15",
"@unocss/eslint-plugin": "^0.57.2",
"@unocss/postcss": "^0.57.2",
"@unocss/reset": "^0.57.2",
Expand All @@ -97,7 +97,7 @@
"prettier": "^3.0.3",
"turbo": "^1.10.16",
"typescript": "^5.2.2",
"vercel": "^32.5.0",
"vercel": "^32.5.2",
"vitest": "^0.34.6"
},
"engines": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { ApiFunction, ApiItem } from '@discordjs/api-extractor-model';
import { ApiModel } from '@discordjs/api-extractor-model';
import dynamic from 'next/dynamic';
import {} from 'next/types';
import { notFound } from 'next/navigation';
import { cache, type PropsWithChildren } from 'react';
import { fetchModelJSON, fetchVersions } from '~/app/docAPI';
Expand All @@ -15,12 +16,12 @@ import { Providers } from './providers';
const Header = dynamic(async () => import('~/components/Header'));
const Footer = dynamic(async () => import('~/components/Footer'));

export interface VersionRouteParams {
interface VersionRouteParams {
package: string;
version: string;
}

export async function generateStaticParams() {
export const generateStaticParams = async () => {
const params: VersionRouteParams[] = [];

await Promise.all(
Expand All @@ -32,7 +33,7 @@ export async function generateStaticParams() {
);

return params;
}
};

const serializeIntoSidebarItemData = cache((item: ApiItem) => {
return {
Expand Down
41 changes: 23 additions & 18 deletions apps/website/src/app/docs/packages/[package]/[version]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,33 +1,38 @@
import { readFile } from 'node:fs/promises';
import { join } from 'node:path';
import type { SerializeOptions } from 'next-mdx-remote/dist/types';
import { MDXRemote } from 'next-mdx-remote/rsc';
import { compileMDX } from 'next-mdx-remote/rsc';
import { cache } from 'react';
import rehypeSlug from 'rehype-slug';
import remarkGfm from 'remark-gfm';
import { SyntaxHighlighter } from '~/components/SyntaxHighlighter';
import type { VersionRouteParams } from './layout';

interface VersionRouteParams {
package: string;
version: string;
}

const loadREADME = cache(async (packageName: string) => {
return readFile(join(process.cwd(), 'src', 'assets', 'readme', packageName, 'home-README.md'), 'utf8');
});

const mdxOptions = {
mdxOptions: {
remarkPlugins: [remarkGfm],
rehypePlugins: [rehypeSlug],
format: 'mdx',
},
} satisfies SerializeOptions;
export async function generateStaticParams({ params }: { params: VersionRouteParams }) {
return [{ package: params.package, version: params.version }];
}

export default async function Page({ params }: { params: VersionRouteParams }) {
const { package: packageName } = params;
const readmeSource = await loadREADME(packageName);
const readmeSource = await loadREADME(params.package);
const { content } = await compileMDX({
source: readmeSource,
// @ts-expect-error SyntaxHighlighter is assignable
components: { pre: SyntaxHighlighter },
options: {
mdxOptions: {
remarkPlugins: [remarkGfm],
rehypePlugins: [rehypeSlug],
format: 'mdx',
},
},
});

return (
<div className="relative top-4 max-w-none prose">
{/* @ts-expect-error SyntaxHighlighter is assignable */}
<MDXRemote components={{ pre: SyntaxHighlighter }} options={mdxOptions} source={readmeSource} />
</div>
);
return <div className="relative top-4 max-w-none prose">{content}</div>;
}
2 changes: 1 addition & 1 deletion apps/website/src/components/SyntaxHighlighter.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Code } from 'bright';

export function SyntaxHighlighter(props: typeof Code) {
export async function SyntaxHighlighter(props: typeof Code) {
return (
<>
<div data-theme="dark">
Expand Down
18 changes: 7 additions & 11 deletions apps/website/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,18 @@
"jsx": "preserve",
"baseUrl": ".",
"noEmit": true,
"skipLibCheck": true,
"plugins": [
{
"name": "next"
}
],
"paths": {
"~/*": ["./src/*"]
},
"moduleResolution": "node",
"resolvePackageJsonExports": false,
"resolvePackageJsonImports": false,
"esModuleInterop": true,
"allowJs": true,
"incremental": true
"incremental": true,
"plugins": [
{
"name": "next"
}
]
},
"include": ["src/**/*.ts", "src/**/*.tsx", "next-env.d.ts", ".next/types/**/*.ts"],
"include": ["**/*.ts", "**/*.tsx", "next-env.d.ts", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
}
1 change: 0 additions & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import prettier from 'eslint-config-neon/flat/prettier.js';
import react from 'eslint-config-neon/flat/react.js';
import typescript from 'eslint-config-neon/flat/typescript.js';
import merge from 'lodash.merge';
// import {join} from "node:path"

const commonFiles = '{js,mjs,cjs,ts,mts,cts,jsx,tsx}';

Expand Down
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"@commitlint/config-angular": "^18.1.0",
"@favware/cliff-jumper": "^2.2.1",
"@favware/npm-deprecate": "^1.0.7",
"@types/lodash.merge": "^4.6.8",
"@types/lodash.merge": "^4.6.9",
"@unocss/eslint-plugin": "^0.57.2",
"@vitest/coverage-v8": "^0.34.6",
"conventional-changelog-cli": "^4.1.0",
Expand All @@ -67,13 +67,16 @@
"turbo": "^1.10.16",
"typescript": "^5.2.2",
"unocss": "^0.57.2",
"vercel": "^32.5.0",
"vercel": "^32.5.2",
"vitest": "^0.34.6"
},
"pnpm": {
"peerDependencyRules": {
"ignoreMissing": [
"*"
],
"allowedAny": [
"*"
]
},
"overrides": {
Expand Down
Loading

1 comment on commit e72b552

@vercel
Copy link

@vercel vercel bot commented on e72b552 Nov 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.