diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 172c8ce..98ca57a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,6 +16,9 @@ jobs: - uses: actions/checkout@v4 if: ${{ env.VERCEL_TOKEN && env.VERCEL_ORG_ID && env.VERCEL_PROJECT_ID }} + - name: Clone latest submodules + run: git submodule update --init --recursive --remote + - name: Deploy to Vercel id: vercel-deployment uses: amondnet/vercel-action@v25 diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..a1bb9db --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "public/wiki/policy"] + path = public/wiki/policy + url = https://github.com/fpsig/open-source-policy diff --git a/components/Layout/MDXLayout.tsx b/components/Layout/MDXLayout.tsx new file mode 100644 index 0000000..d6ee1f5 --- /dev/null +++ b/components/Layout/MDXLayout.tsx @@ -0,0 +1,18 @@ +import { FC } from 'react'; +import { Container, ContainerProps } from 'react-bootstrap'; + +import { PageHead } from './PageHead'; + +export const MDXLayout: FC = ({ + className = 'mt-5 pt-5 pb-3', + title, + children, + ...props +}) => ( + + +

{title}

+ + {children} +
+); diff --git a/components/Navigator/MainNavigator.tsx b/components/Navigator/MainNavigator.tsx index bb03258..b19c347 100644 --- a/components/Navigator/MainNavigator.tsx +++ b/components/Navigator/MainNavigator.tsx @@ -27,6 +27,7 @@ const topNavBarMenu = ({ t }: typeof i18n): MenuItem[] => [ name: t('hackathon'), }, { href: '/license-filter', name: t('license_filter') }, + { href: '/wiki', name: t('wiki') }, ]; export interface MainNavigatorProps { diff --git a/eslint.config.ts b/eslint.config.ts index f28e328..2590175 100644 --- a/eslint.config.ts +++ b/eslint.config.ts @@ -1,6 +1,5 @@ import cspellPlugin from '@cspell/eslint-plugin'; import eslint from '@eslint/js'; -// @ts-expect-error eslint-plugin-next doesn't come with TypeScript definitions import nextPlugin from '@next/eslint-plugin-next'; import stylistic from '@stylistic/eslint-plugin'; import eslintConfigPrettier from 'eslint-config-prettier'; @@ -31,12 +30,7 @@ export default tsEslint.config( }, { // config with just ignores is the replacement for `.eslintignore` - ignores: [ - '**/node_modules/**', - '**/public/**', - '**/.next/**', - '.github/scripts/**', - ], + ignores: ['**/node_modules/**', '**/public/**', '**/.next/**', '.github/scripts/**'], }, // extends ... @@ -53,6 +47,7 @@ export default tsEslint.config( warnOnUnsupportedTypeScriptVersion: false, }, }, + // @ts-expect-error https://github.com/vercel/next.js/issues/81695 rules: { // spellchecker '@cspell/spellchecker': [ @@ -60,15 +55,7 @@ export default tsEslint.config( { cspell: { language: 'en', - dictionaries: [ - 'typescript', - 'node', - 'html', - 'css', - 'bash', - 'npm', - 'pnpm', - ], + dictionaries: ['typescript', 'node', 'html', 'css', 'bash', 'npm', 'pnpm'], }, }, ], @@ -91,8 +78,7 @@ export default tsEslint.config( 'error', { selector: "TSPropertySignature[key.name='children']", - message: - 'Please use PropsWithChildren instead of defining children manually', + message: 'Please use PropsWithChildren instead of defining children manually', }, ], 'consistent-return': 'warn', @@ -109,10 +95,7 @@ export default tsEslint.config( // React 'react/no-unescaped-entities': 'off', 'react/self-closing-comp': ['error', { component: true, html: true }], - 'react/jsx-curly-brace-presence': [ - 'error', - { props: 'never', children: 'never' }, - ], + 'react/jsx-curly-brace-presence': ['error', { props: 'never', children: 'never' }], 'react/jsx-no-target-blank': 'warn', 'react/jsx-sort-props': [ 'error', diff --git a/next-env.d.ts b/next-env.d.ts index 52e831b..254b73c 100644 --- a/next-env.d.ts +++ b/next-env.d.ts @@ -1,5 +1,6 @@ /// /// +/// // NOTE: This file should not be edited // see https://nextjs.org/docs/pages/api-reference/config/typescript for more information. diff --git a/package.json b/package.json index 3d66b2e..af49d2b 100644 --- a/package.json +++ b/package.json @@ -12,68 +12,70 @@ "test": "lint-staged && npm run lint" }, "dependencies": { - "@koa/router": "^13.1.1", + "@koa/router": "^14.0.0", "@mdx-js/loader": "^3.1.0", "@mdx-js/react": "^3.1.0", - "@next/mdx": "^15.3.5", - "core-js": "^3.44.0", + "@next/mdx": "^15.5.0", + "core-js": "^3.45.1", "file-type": "^21.0.0", "idea-react": "^2.0.0-rc.13", - "koa": "^2.16.1", + "koa": "^3.0.1", "koajax": "^3.1.2", "license-filter": "^0.2.5", - "marked": "^16.0.0", + "marked": "^16.2.0", "mime": "^4.0.7", "mobx": "^6.13.7", "mobx-github": "^0.3.11", "mobx-i18n": "^0.7.1", - "mobx-lark": "^2.2.0", + "mobx-lark": "^2.4.0", "mobx-react": "^9.2.0", "mobx-react-helper": "^0.5.1", "mobx-restful": "^2.1.0", - "mobx-restful-table": "^2.5.2", - "next": "^15.3.5", + "mobx-restful-table": "^2.5.3", + "next": "^15.5.0", "next-pwa": "^5.6.0", - "next-ssr-middleware": "^1.0.1", - "react": "^19.1.0", + "next-ssr-middleware": "^1.0.2", + "react": "^19.1.1", "react-bootstrap": "^2.10.10", - "react-dom": "^19.1.0", + "react-dom": "^19.1.1", "react-typed-component": "^1.0.6", - "undici": "^7.11.0", - "web-utility": "^4.4.3" + "undici": "^7.15.0", + "web-utility": "^4.5.1", + "yaml": "^2.8.1" }, "devDependencies": { "@babel/plugin-proposal-decorators": "^7.28.0", "@babel/plugin-transform-typescript": "^7.28.0", "@babel/preset-react": "^7.27.1", - "@cspell/eslint-plugin": "^9.1.5", - "@eslint/js": "^9.31.0", + "@cspell/eslint-plugin": "^9.2.0", + "@eslint/js": "^9.34.0", + "@next/eslint-plugin-next": "^15.5.0", "@softonus/prettier-plugin-duplicate-remover": "^1.1.2", - "@stylistic/eslint-plugin": "^5.1.0", + "@stylistic/eslint-plugin": "^5.2.3", "@types/eslint-config-prettier": "^6.11.3", - "@types/koa": "^2.15.0", + "@types/koa": "^3.0.0", "@types/koa__router": "^12.0.4", "@types/next-pwa": "^5.6.9", - "@types/node": "^22.16.3", - "@types/react": "^19.1.8", - "@types/react-dom": "^19.1.6", - "eslint": "^9.31.0", - "eslint-config-next": "^15.3.5", - "eslint-config-prettier": "^10.1.5", + "@types/node": "^22.17.2", + "@types/react": "^19.1.11", + "@types/react-dom": "^19.1.7", + "eslint": "^9.34.0", + "eslint-config-next": "^15.5.0", + "eslint-config-prettier": "^10.1.8", "eslint-plugin-react": "^7.37.5", "eslint-plugin-simple-import-sort": "^12.1.1", "globals": "^16.3.0", "husky": "^9.1.7", - "jiti": "^2.4.2", - "less": "^4.3.0", + "jiti": "^2.5.1", + "less": "^4.4.1", "less-loader": "^12.3.0", - "lint-staged": "^16.1.2", + "lint-staged": "^16.1.5", "next-with-less": "^3.0.1", "prettier": "^3.6.2", "prettier-plugin-css-order": "^2.1.2", - "sass": "^1.89.2", - "typescript": "~5.8.3", - "typescript-eslint": "^8.36.0" + "sass": "^1.90.0", + "typescript": "~5.9.2", + "typescript-eslint": "^8.40.0" }, "resolutions": { "next": "$next" diff --git a/pages/_app.tsx b/pages/_app.tsx index 3ef27ad..0f9aaa9 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -10,12 +10,7 @@ import { Image } from 'react-bootstrap'; import { MainNavigator } from '../components/Navigator/MainNavigator'; import { PageContent } from '../components/PageContent'; import { isServer } from '../models/configuration'; -import { - createI18nStore, - I18nContext, - I18nProps, - loadSSRLanguage, -} from '../models/Translation'; +import { createI18nStore, I18nContext, I18nProps, loadSSRLanguage } from '../models/Translation'; configure({ enforceActions: 'never' }); @@ -46,7 +41,8 @@ export default class CustomApp extends App { render() { const { Component, pageProps, router } = this.props, { t } = this.i18nStore; - const thisFullYear = new Date().getFullYear(); + const thisFullYear = new Date().getFullYear(), + { asPath } = router; return ( @@ -59,7 +55,7 @@ export default class CustomApp extends App {
- {router.route.startsWith('/article/') ? ( + {asPath.startsWith('/article/') || asPath.startsWith('/wiki/') ? ( @@ -71,8 +67,7 @@ export default class CustomApp extends App {