From 31f5f238fb60e6d8f880d9979c03e14e92de25e2 Mon Sep 17 00:00:00 2001 From: TechQuery Date: Sat, 7 Nov 2026 06:50:32 +0800 Subject: [PATCH 1/3] [migrate] Upgrade to Bootstrap 6 and Sentry 11 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- README.md | 11 +- babel.config.js | 26 - components/Form/JSONEditor/AddBar.tsx | 11 +- components/Form/JSONEditor/index.tsx | 9 +- components/Git/ArticleEditor.tsx | 40 +- components/Git/Card.tsx | 38 +- components/Git/IssueCard.tsx | 37 +- components/Git/Logo.tsx | 2 +- components/Home/CommunityStats.tsx | 4 +- components/Home/LatestBlogs.tsx | 24 +- components/Home/Sponsors.tsx | 18 +- components/Home/UpcomingEvents.tsx | 34 +- components/LarkImage.tsx | 8 +- components/Layout/CardPage.tsx | 30 +- components/Layout/MDXLayout.tsx | 2 +- components/Navigator/MainNavigator.tsx | 101 +- components/Navigator/SearchBar.tsx | 21 +- next.config.ts | 6 +- package.json | 107 +- pages/_app.tsx | 2 +- pages/_document.tsx | 8 +- pages/activity/[[...page]].tsx | 2 +- pages/article/editor.tsx | 2 +- pages/index.tsx | 11 +- pages/scroll-list.tsx | 5 +- pages/search/[model]/index.tsx | 38 +- pages/weekly/[id].tsx | 48 +- pages/weekly/index.tsx | 11 +- patches/next@16.4.5.patch | 42 + pnpm-lock.yaml | 8616 +++++++++++------------- pnpm-workspace.yaml | 9 + sentry.client.config.ts | 3 + sentry.options.ts | 15 + sentry.server.config.ts | 3 + tsconfig.json | 1 - 35 files changed, 4342 insertions(+), 5003 deletions(-) delete mode 100644 babel.config.js create mode 100644 patches/next@16.4.5.patch create mode 100644 pnpm-workspace.yaml create mode 100644 sentry.options.ts diff --git a/README.md b/README.md index a520faae3..8c2aa473c 100644 --- a/README.md +++ b/README.md @@ -8,13 +8,13 @@ ## Technology stack -- Language: [TypeScript v5][2] + [MDX v3][10] -- Component engine: [Next.js v15][3] -- Component suite: [Bootstrap v5][4] +- Language: [TypeScript v6][2] + [MDX v3][10] +- Component engine: [Next.js v16][3] +- Component suite: [Idea-React v3][33] + [Bootstrap v6][4] - PWA framework: [Workbox v6][5] -- State management: [MobX v6][11] +- State management: [MobX v7][11] - CI / CD: GitHub [Actions][12] + [Vercel][13] -- Monitor service: [Sentry][14] +- Monitor service: [Sentry v11][14] ## Major examples @@ -179,3 +179,4 @@ pnpm container [30]: https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/#create-initialization-config-files [31]: https://open.larksuite.com/document/server-docs/getting-started/api-access-token/app-access-token-development-guide#1f8b587c [32]: https://nextjs.org/docs/deployment +[33]: https://idea-react.pages.dev/ diff --git a/babel.config.js b/babel.config.js deleted file mode 100644 index 605a645d3..000000000 --- a/babel.config.js +++ /dev/null @@ -1,26 +0,0 @@ -module.exports = { - presets: [ - // https://babeljs.io/docs/babel-preset-react - [ - '@babel/preset-react', - { - runtime: 'automatic', - development: process.env.BABEL_ENV === 'development', - }, - ], - ], - plugins: [ - // https://github.com/babel/babel/issues/16262#issuecomment-1962832499 - [ - '@babel/plugin-transform-typescript', - { - allowDeclareFields: true, - allowNamespaces: true, - allExtensions: true, - isTSX: true, - }, - ], - // https://babeljs.io/docs/babel-plugin-proposal-decorators#note-compatibility-with-babelplugin-transform-class-properties - ['@babel/plugin-proposal-decorators', { version: '2023-05' }], - ], -}; diff --git a/components/Form/JSONEditor/AddBar.tsx b/components/Form/JSONEditor/AddBar.tsx index 5d169dfce..0d89fe68a 100644 --- a/components/Form/JSONEditor/AddBar.tsx +++ b/components/Form/JSONEditor/AddBar.tsx @@ -1,6 +1,5 @@ -import { Icon } from 'idea-react'; +import { Button, Icon } from 'idea-react'; import { FC } from 'react'; -import { Button } from 'react-bootstrap'; const type_map = { string: { title: 'Inline text', icon: 'input-cursor' }, @@ -16,13 +15,7 @@ export interface AddBarProps { export const AddBar: FC = ({ onSelect }) => ( - + {languages.map(language => ( diff --git a/components/Home/LatestBlogs.tsx b/components/Home/LatestBlogs.tsx index ae94d5e80..7e76dfde1 100644 --- a/components/Home/LatestBlogs.tsx +++ b/components/Home/LatestBlogs.tsx @@ -14,7 +14,7 @@ export const LatestBlogs: FC = ({ articles }) => ( 最新文章 - + {articles.map(({ name, meta, path }) => ( diff --git a/components/Home/Sponsors.tsx b/components/Home/Sponsors.tsx index 2347ef4e7..6c38ecac7 100644 --- a/components/Home/Sponsors.tsx +++ b/components/Home/Sponsors.tsx @@ -14,7 +14,7 @@ export const Sponsors: FC = ({ sponsors }) => ( 赞助商 - + {sponsors.map(({ name, meta }) => ( diff --git a/components/Home/UpcomingEvents.tsx b/components/Home/UpcomingEvents.tsx index 7306d164c..d94ca9045 100644 --- a/components/Home/UpcomingEvents.tsx +++ b/components/Home/UpcomingEvents.tsx @@ -19,7 +19,7 @@ export const UpcomingEvents: FC = observer(({ events }) => <> {t('upcoming_events')} - + {events.map(({ name, meta, path }) => ( diff --git a/components/Layout/CardPage.tsx b/components/Layout/CardPage.tsx index 68bd7b20e..4325f6e31 100644 --- a/components/Layout/CardPage.tsx +++ b/components/Layout/CardPage.tsx @@ -18,7 +18,7 @@ export const CardPage: FC = ({ pageLinkOf, }) => ( <> - + {currentPage.map(item => ( diff --git a/components/Layout/MDXLayout.tsx b/components/Layout/MDXLayout.tsx index f010253fe..314c3aa62 100644 --- a/components/Layout/MDXLayout.tsx +++ b/components/Layout/MDXLayout.tsx @@ -3,16 +3,13 @@ import { FC } from 'react'; import { PageHead } from './PageHead'; -export const MDXLayout: FC = ({ - className = 'mt-5 pt-5 pb-3', - title, - children, - ...props -}) => ( - +export const MDXLayout: FC = ({ title, children, ...props }) => ( + + +

{title}

- {children} +
{children}
); diff --git a/components/Navigator/MainNavigator.tsx b/components/Navigator/MainNavigator.tsx index 511dcd7a1..8370cce06 100644 --- a/components/Navigator/MainNavigator.tsx +++ b/components/Navigator/MainNavigator.tsx @@ -29,9 +29,28 @@ export class MainNavigator extends Component<{}, typeof i18n> { hide = action(() => (this.open = false)); - render() { + renderLinks() { const { t } = this.context; + return ( + + {t('article')} + Git pager + {t('activity')} + {t('weekly')} + {t('community')} + {t('about')} + + {t('source_code')} + + + ); + } + + render() { return ( @@ -48,33 +67,7 @@ export class MainNavigator extends Component<{}, typeof i18n> { open={this.open} onDismiss={this.hide} > - - - {t('article')} - - - Git pager - - - {t('activity')} - - - {t('weekly')} - - - {t('community')} - - - {t('about')} - - - {t('source_code')} - - + {this.renderLinks()} diff --git a/package.json b/package.json index e8ff3c282..22e49dd2d 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "copy-webpack-plugin": "^14.0.0", "core-js": "^3.51.0", "file-type": "^22.3.0", - "idea-react": "^3.0.0-beta.3", + "idea-react": "^3.0.0-beta.5", "koa": "^3.3.0", "koajax": "^3.3.1", "less": "^4.9.1", diff --git a/pages/_app.tsx b/pages/_app.tsx index 03c4c9ed8..3256dd099 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -51,13 +51,15 @@ export default class CustomApp extends App { - {asPath.startsWith('/article/') && !asPath.startsWith('/article/editor') ? ( - +
+ {asPath.startsWith('/article/') && !asPath.startsWith('/article/editor') ? ( + + + + ) : ( - - ) : ( - - )} + )} +