Skip to content

Commit

Permalink
Merge pull request #229 from yeecord/canary
Browse files Browse the repository at this point in the history
Core: Update Nextjs to v14
  • Loading branch information
kane50613 authored Oct 28, 2023
2 parents b4e603d + 1696caa commit e4cf9bb
Show file tree
Hide file tree
Showing 35 changed files with 1,085 additions and 1,851 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const config = {
],
rules: {
"@next/next/no-html-link-for-pages": "off",
"@typescript-eslint/unbound-method": "off",
"@typescript-eslint/restrict-template-expressions": "off",
"@typescript-eslint/no-unused-vars": [
"error",
Expand All @@ -23,7 +24,7 @@ const config = {
],
"@typescript-eslint/no-unsafe-assignment": "off",
},
ignorePatterns: ["**/*.config.js", "**/*.config.cjs"],
ignorePatterns: ["**/*.config.js", "**/*.config.mjs", "**/*.config.cjs"],
reportUnusedDisableDirectives: true,
parser: "@typescript-eslint/parser",
parserOptions: {
Expand Down
2 changes: 1 addition & 1 deletion content/blog/heroku-security.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ date: 2022-04-17T07:35:50
image: /blog/heroku-security/cover.jpeg
---

import { TwitterTweetEmbed } from "react-twitter-embed";
import { TwitterTweetEmbed } from "./twitter-embed";

![Heroku Yeecord](/blog/heroku-security/cover.jpeg)

Expand Down
2 changes: 2 additions & 0 deletions content/blog/twitter-embed.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
"use client";
export { TwitterTweetEmbed } from "react-twitter-embed";
4 changes: 2 additions & 2 deletions content/docs/commands/role.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ description: 設定一個自動化的身分組系統,成員只需要點選訊

![建立身份組](/docs/role/create-roles.png)

<Admonition type="warning">
<Warning>
請注意要設定的身份組需要在機器龍身份組的下方,不然機器龍沒有權限進行給予的動作。
</Admonition>
</Warning>

### 三、機器人設定

Expand Down
4 changes: 1 addition & 3 deletions content/docs/commands/ticket.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ title: 私人頻道

## 設定私人頻道功能

<Admonition>
請確認機器人擁有 `管理頻道` 的權限,才能避免發生權限不足的錯誤!
</Admonition>
<Info>請確認機器人擁有 `管理頻道` 的權限,才能避免發生權限不足的錯誤!</Info>

### ㄧ、建立頻道

Expand Down
4 changes: 2 additions & 2 deletions content/docs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ YEE 式機器龍是一隻全中文化的 Discord 機器人,我們提供了許
</Cards>

<br />
<Admonition type="info" title="我想先通知你">
<Info title="我想先通知你">
如果在邀請或是使用時遇到問題可以查看這篇文章 [《「5
方法」排解機器人問題》](/blog/discord-bot-troubleshooting/)
</Admonition>
</Info>

## 什麼是 Discord 機器人?

Expand Down
43 changes: 0 additions & 43 deletions contentlayer.config.ts

This file was deleted.

20 changes: 15 additions & 5 deletions next.config.js → next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
const { readFileSync } = require("fs");
import { readFileSync } from "node:fs";
import createNextDocs from "next-docs-mdx/config";
import { rehypeImgSize } from "next-docs-zeta/mdx-plugins";

const withNextDocs = createNextDocs({
rootMapPath: "./src/_map.ts",
mdxOptions: {
rehypePlugins: [[rehypeImgSize, { dir: "./public" }]],
},
});

const redirectsFile = readFileSync("redirects.txt", "utf-8")
.toString()
Expand All @@ -7,7 +16,10 @@ const redirectsFile = readFileSync("redirects.txt", "utf-8")

/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: false,
pageExtensions: ["ts", "tsx", "mdx"],
experimental: {
webpackBuildWorker: true
},
async headers() {
return [
{
Expand Down Expand Up @@ -44,6 +56,4 @@ const nextConfig = {
},
};

const { withContentlayer } = require("next-contentlayer");

module.exports = withContentlayer(nextConfig);
export default withNextDocs(nextConfig);
16 changes: 10 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,29 @@
}
},
"dependencies": {
"@next/env": "^13.5.4",
"@mdx-js/loader": "^2.3.0",
"@mdx-js/react": "^2.3.0",
"@next/env": "^14.0.0",
"@next/mdx": "^14.0.0",
"@vercel/edge-config": "^0.4.1",
"class-variance-authority": "^0.7.0",
"clsx": "^2.0.0",
"contentlayer": "^0.3.4",
"framer-motion": "^10.16.4",
"lucide-react": "^0.288.0",
"next": "^13.5.4",
"next-contentlayer": "^0.3.4",
"next-docs-ui": "^2.3.2",
"next-docs-zeta": "^2.3.2",
"next": "^14.0.0",
"next-docs-mdx": "^4.0.1",
"next-docs-ui": "^4.0.1",
"next-docs-zeta": "^4.0.1",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-twitter-embed": "^4.0.4",
"sharp": "^0.32.6",
"tailwind-merge": "^1.14.0",
"zod": "^3.22.4"
},
"devDependencies": {
"@types/eslint": "^8.44.4",
"@types/mdx": "^2.0.9",
"@types/node": "^20.8.4",
"@types/react": "^18.2.28",
"@types/react-dom": "^18.2.13",
Expand Down
Loading

1 comment on commit e4cf9bb

@vercel
Copy link

@vercel vercel bot commented on e4cf9bb Oct 28, 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.