Skip to content

Commit 82720c8

Browse files
committed
[add] Static pages for Lark Wiki documents
[fix] Giscus title mapping & other detail bugs [optimize] upgrade to Koa 3, MobX React helper 0.5 & other latest Upstream packages
1 parent f09e050 commit 82720c8

File tree

19 files changed

+2921
-2926
lines changed

19 files changed

+2921
-2926
lines changed

.dockerignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
README.md
22
node_modules/
3-
.eslintrc.json
3+
eslint.config.ts
44
.next/
55
.vercel/
66
start.sh

.env

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,7 @@ NEXT_PUBLIC_CLIENT_TABLE = tblsb0vx4fqjSrGL
1414
NEXT_PUBLIC_PROJECT_TABLE = tblCxasoUUub3buB
1515
NEXT_PUBLIC_MEMBER_TABLE = tblJ98JHGEX0o6ij
1616
NEXT_PUBLIC_MEMBER_VIEW = vewLf4M0P8
17+
18+
NEXT_PUBLIC_LARK_API_HOST = https://open.feishu.cn/open-apis/
19+
NEXT_PUBLIC_LARK_APP_ID = cli_a2c7771153f8900c
20+
NEXT_PUBLIC_LARK_WIKI_URL = https://idea2app.feishu.cn/wiki/space/7318346900506181660

components/Layout/MainNavigator.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,16 @@
11
import { AppBar, Drawer, IconButton, Menu, MenuItem, PopoverProps, Toolbar } from '@mui/material';
22
import { computed, observable } from 'mobx';
33
import { observer } from 'mobx-react';
4-
import { ObservedComponent, observePropsState } from 'mobx-react-helper';
4+
import { ObservedComponent } from 'mobx-react-helper';
55
import Link from 'next/link';
6-
import { Component } from 'react';
76

87
import { i18n, I18nContext, LanguageName } from '../../models/Translation';
98
import { SymbolIcon } from '../Icon';
109
import { ColorModeIconDropdown } from './ColorModeDropdown';
1110
import { BrandLogo, GithubIcon } from './Svg';
1211

13-
export interface MainNavigator extends ObservedComponent<{}, typeof i18n> {}
14-
1512
@observer
16-
@observePropsState
17-
export class MainNavigator extends Component {
13+
export class MainNavigator extends ObservedComponent<{}, typeof i18n> {
1814
static contextType = I18nContext;
1915

2016
@observable accessor menuExpand = false;
@@ -29,6 +25,7 @@ export class MainNavigator extends Component {
2925
{ title: 'GitHub-reward', href: '/project/reward/issue', target: '_top' },
3026
{ title: t('member'), href: '/member' },
3127
{ title: t('open_source_project'), href: '/open-source' },
28+
{ title: t('wiki'), href: '/wiki' },
3229
];
3330
}
3431

eslint.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import cspellPlugin from '@cspell/eslint-plugin';
22
import eslint from '@eslint/js';
3-
// @ts-expect-error eslint-plugin-next doesn't come with TypeScript definitions
43
import nextPlugin from '@next/eslint-plugin-next';
54
import stylistic from '@stylistic/eslint-plugin';
65
import eslintConfigPrettier from 'eslint-config-prettier';
@@ -48,6 +47,7 @@ export default tsEslint.config(
4847
warnOnUnsupportedTypeScriptVersion: false,
4948
},
5049
},
50+
// @ts-expect-error https://github.com/vercel/next.js/issues/81695
5151
rules: {
5252
// spellchecker
5353
'@cspell/spellchecker': [

models/Document.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { DocumentModel } from 'mobx-lark';
2+
3+
import { lark } from '../pages/api/Lark/core';
4+
import { LarkWikiDomain } from './configuration';
5+
6+
export class MyDocumentModel extends DocumentModel {
7+
client = lark.client;
8+
}
9+
10+
export default new MyDocumentModel(LarkWikiDomain);

models/Wiki.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { WikiNodeModel } from 'mobx-lark';
2+
3+
import { lark } from '../pages/api/Lark/core';
4+
import { LarkWikiDomain, LarkWikiId } from './configuration';
5+
6+
export class MyWikiNodeModel extends WikiNodeModel {
7+
client = lark.client;
8+
}
9+
10+
export default new MyWikiNodeModel(LarkWikiDomain, LarkWikiId);

models/configuration.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,8 @@ export const LarkAppMeta = {
2525
secret: process.env.LARK_APP_SECRET!,
2626
};
2727
export const LarkBaseId = process.env.NEXT_PUBLIC_LARK_BASE!;
28+
29+
const { hostname, pathname } = new URL(process.env.NEXT_PUBLIC_LARK_WIKI_URL!);
30+
31+
export const LarkWikiDomain = hostname;
32+
export const LarkWikiId = pathname.split('/').pop()!;

next-env.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/// <reference types="next" />
22
/// <reference types="next/image-types/global" />
3+
/// <reference path="./.next/types/routes.d.ts" />
34

45
// NOTE: This file should not be edited
56
// see https://nextjs.org/docs/pages/api-reference/config/typescript for more information.

package.json

Lines changed: 46 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -8,77 +8,78 @@
88
},
99
"dependencies": {
1010
"@emotion/react": "^11.14.0",
11-
"@emotion/styled": "^11.14.0",
11+
"@emotion/styled": "^11.14.1",
1212
"@giscus/react": "^3.1.0",
13-
"@koa/bodyparser": "^5.1.1",
14-
"@koa/router": "^13.1.0",
15-
"@mui/lab": "7.0.0-beta.12",
16-
"@mui/material": "^7.1.0",
17-
"@sentry/nextjs": "^9.16.1",
18-
"file-type": "^20.5.0",
13+
"@koa/bodyparser": "^6.0.0",
14+
"@koa/router": "^14.0.0",
15+
"@mui/lab": "^7.0.0-beta.16",
16+
"@mui/material": "^7.3.1",
17+
"@sentry/nextjs": "^10.5.0",
18+
"file-type": "^21.0.0",
1919
"jsonwebtoken": "^9.0.2",
20-
"koa": "^2.16.1",
20+
"koa": "^3.0.1",
2121
"koa-jwt": "^4.0.4",
2222
"koajax": "^3.1.2",
2323
"lodash": "^4.17.21",
24-
"marked": "^15.0.11",
24+
"marked": "^16.2.0",
2525
"mime": "^4.0.7",
2626
"mobx": "^6.13.7",
27-
"mobx-github": "^0.3.5",
27+
"mobx-github": "^0.3.11",
2828
"mobx-i18n": "^0.7.1",
29-
"mobx-lark": "^2.2.0",
29+
"mobx-lark": "^2.4.0",
3030
"mobx-react": "^9.2.0",
31-
"mobx-react-helper": "^0.3.6",
31+
"mobx-react-helper": "^0.5.1",
3232
"mobx-restful": "^2.1.0",
33-
"next": "^15.3.2",
33+
"next": "^15.5.0",
3434
"next-pwa": "~5.6.0",
35-
"next-ssr-middleware": "^1.0.0",
36-
"react": "^19.1.0",
37-
"react-dom": "^19.1.0",
38-
"web-utility": "^4.4.3",
39-
"webpack": "^5.99.8"
35+
"next-ssr-middleware": "^1.0.2",
36+
"react": "^19.1.1",
37+
"react-dom": "^19.1.1",
38+
"web-utility": "^4.5.1",
39+
"webpack": "^5.101.3"
4040
},
4141
"devDependencies": {
42-
"@babel/plugin-proposal-decorators": "^7.27.1",
43-
"@babel/plugin-transform-typescript": "^7.27.1",
42+
"@babel/plugin-proposal-decorators": "^7.28.0",
43+
"@babel/plugin-transform-typescript": "^7.28.0",
4444
"@babel/preset-react": "^7.27.1",
45-
"@cspell/eslint-plugin": "^9.0.0",
46-
"@eslint/compat": "^1.2.9",
47-
"@eslint/js": "^9.26.0",
48-
"@next/eslint-plugin-next": "^15.3.2",
49-
"@stylistic/eslint-plugin": "^4.2.0",
50-
"@tailwindcss/postcss": "^4.1.5",
45+
"@cspell/eslint-plugin": "^9.2.0",
46+
"@eslint/compat": "^1.3.2",
47+
"@eslint/js": "^9.33.0",
48+
"@next/eslint-plugin-next": "^15.5.0",
49+
"@stylistic/eslint-plugin": "^5.2.3",
50+
"@tailwindcss/postcss": "^4.1.12",
5151
"@types/eslint-config-prettier": "^6.11.3",
52-
"@types/jsonwebtoken": "^9.0.9",
53-
"@types/koa": "^2.15.0",
52+
"@types/jsonwebtoken": "^9.0.10",
53+
"@types/koa": "^3.0.0",
5454
"@types/koa__router": "^12.0.4",
55-
"@types/lodash": "^4.17.16",
55+
"@types/lodash": "^4.17.20",
5656
"@types/next-pwa": "^5.6.9",
57-
"@types/node": "^22.15.15",
58-
"@types/react": "^19.1.3",
59-
"eslint": "^9.26.0",
60-
"eslint-config-next": "^15.3.2",
61-
"eslint-config-prettier": "^10.1.3",
57+
"@types/node": "^22.17.2",
58+
"@types/react": "^19.1.10",
59+
"eslint": "^9.33.0",
60+
"eslint-config-next": "^15.5.0",
61+
"eslint-config-prettier": "^10.1.8",
6262
"eslint-plugin-react": "^7.37.5",
6363
"eslint-plugin-simple-import-sort": "^12.1.1",
64-
"globals": "^16.1.0",
64+
"globals": "^16.3.0",
6565
"husky": "^9.1.7",
66-
"jiti": "^2.4.2",
67-
"lint-staged": "^15.5.2",
68-
"postcss": "^8.5.3",
69-
"prettier": "^3.5.3",
66+
"jiti": "^2.5.1",
67+
"lint-staged": "^16.1.5",
68+
"postcss": "^8.5.6",
69+
"prettier": "^3.6.2",
7070
"prettier-plugin-css-order": "^2.1.2",
71-
"prettier-plugin-tailwindcss": "^0.6.11",
72-
"tailwindcss": "^4.1.5",
73-
"typescript": "~5.8.3",
74-
"typescript-eslint": "^8.32.0"
71+
"prettier-plugin-tailwindcss": "^0.6.14",
72+
"tailwindcss": "^4.1.12",
73+
"typescript": "~5.9.2",
74+
"typescript-eslint": "^8.40.0"
7575
},
7676
"resolutions": {
7777
"next": "$next"
7878
},
7979
"pnpm": {
8080
"onlyBuiltDependencies": [
8181
"@sentry/cli",
82+
"@tailwindcss/oxide",
8283
"sharp",
8384
"unrs-resolver"
8485
]
@@ -103,8 +104,8 @@
103104
"build": "next build",
104105
"export": "next build && next export",
105106
"start": "next start",
106-
"lint": "next lint --fix && git add .",
107-
"test": "lint-staged && npm run lint && tsc --noEmit",
107+
"lint": "next lint --fix && git add . && tsc --noEmit",
108+
"test": "lint-staged && npm run lint",
108109
"pack-image": "docker build -t idea2app/web-server .",
109110
"container": "docker rm -f web-server && docker run --name web-server -p 3000:3000 -d idea2app/web-server"
110111
}

pages/_app.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@ export default class CustomApp extends App<I18nProps> {
6262
}
6363

6464
render() {
65-
const { Component, pageProps, router } = this.props,
66-
{ t } = this.i18nStore;
65+
const { Component, pageProps } = this.props;
6766

6867
return (
6968
<I18nContext.Provider value={this.i18nStore}>

0 commit comments

Comments
 (0)