Skip to content

Commit 8090002

Browse files
authored
[add] Static example pages for Lark Wiki documents (#8)
1 parent afa51fa commit 8090002

File tree

20 files changed

+2501
-2210
lines changed

20 files changed

+2501
-2210
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: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@ NEXT_PUBLIC_SENTRY_DSN =
66
SENTRY_ORG =
77
SENTRY_PROJECT =
88

9-
NEXT_PUBLIC_LARK_API_HOST = https://open.larksuite.com/open-apis/
10-
NEXT_PUBLIC_LARK_APP_ID =
9+
NEXT_PUBLIC_LARK_API_HOST = https://open.feishu.cn/open-apis/
10+
NEXT_PUBLIC_LARK_APP_ID = cli_a2c7771153f8900c
11+
NEXT_PUBLIC_LARK_WIKI_URL = https://idea2app.feishu.cn/wiki/space/7318346900506181660

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ pnpm container
123123
[17]: https://pullrequestbadge.com/
124124
[18]: https://code.visualstudio.com/
125125
[19]: https://github.com/new?template_name=Lark-Next-Bootstrap-ts&template_owner=idea2app
126-
[20]: https://github.com/idea2app/Lark-Next-Bootstrap-ts/blob/80967ed49045af9dbcf4d3695a2c39d53a6f71f1/.github/workflows/pull-request.yml#L9-L11
126+
[20]: https://github.com/idea2app/Lark-Next-Bootstrap-ts/blob/afa51fad3b16e598bf3b10010b2dc47405b016a3/.github/workflows/main.yml#L9-L11
127127
[21]: https://github.com/idea2app/Lark-Next-Bootstrap-ts/blob/363e023e5dd472c8ea53ec96eac25ec5122e667b/.github/workflows/Lark-notification.yml#L39
128128
[22]: https://github.com/idea2app/Lark-Next-Bootstrap-ts/settings/secrets/actions
129129
[23]: https://github.com/idea2app/Lark-Next-Bootstrap-ts/issues/new/choose

components/Navigator/MainNavigator.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ export const MainNavigator: FC = observer(() => {
2828
<Nav className="me-auto">
2929
<Nav.Link href="/article">{t('article')}</Nav.Link>
3030

31+
<Nav.Link href="/wiki">{t('wiki')}</Nav.Link>
32+
3133
<Nav.Link href="/component">{t('component')}</Nav.Link>
3234

3335
<Nav.Link href="/pagination">{t('pagination')}</Nav.Link>

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';
@@ -53,6 +52,7 @@ export default tsEslint.config(
5352
warnOnUnsupportedTypeScriptVersion: false,
5453
},
5554
},
55+
// @ts-expect-error https://github.com/vercel/next.js/issues/81695
5656
rules: {
5757
// spellchecker
5858
'@cspell/spellchecker': [

models/Base.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { DataObject } from 'mobx-restful';
77
import { buildURLData } from 'web-utility';
88

99
import { GITHUB_TOKEN, LARK_API_HOST } from './configuration';
10+
1011
export const larkClient = new HTTPClient({
1112
baseURI: LARK_API_HOST,
1213
responseType: 'json',

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
@@ -21,3 +21,8 @@ export const LarkAppMeta = {
2121
id: process.env.NEXT_PUBLIC_LARK_APP_ID!,
2222
secret: process.env.LARK_APP_SECRET!,
2323
};
24+
25+
const { hostname, pathname } = new URL(process.env.NEXT_PUBLIC_LARK_WIKI_URL!);
26+
27+
export const LarkWikiDomain = hostname;
28+
export const LarkWikiId = pathname.split('/').pop()!;

package.json

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -10,88 +10,88 @@
1010
"@editorjs/code": "^2.9.3",
1111
"@editorjs/editorjs": "^2.30.8",
1212
"@editorjs/header": "^2.8.8",
13-
"@editorjs/image": "^2.10.2",
13+
"@editorjs/image": "^2.10.3",
1414
"@editorjs/link": "^2.6.2",
1515
"@editorjs/list": "^2.0.8",
1616
"@editorjs/paragraph": "^2.11.7",
1717
"@editorjs/quote": "^2.7.6",
18-
"@koa/router": "^13.1.0",
18+
"@koa/router": "^14.0.0",
1919
"@mdx-js/loader": "^3.1.0",
2020
"@mdx-js/react": "^3.1.0",
21-
"@next/mdx": "^15.3.3",
22-
"@sentry/nextjs": "^9.30.0",
21+
"@next/mdx": "^15.4.5",
22+
"@sentry/nextjs": "^10.1.0",
2323
"copy-webpack-plugin": "^13.0.0",
24-
"core-js": "^3.43.0",
24+
"core-js": "^3.45.0",
2525
"editorjs-html": "^4.0.5",
2626
"file-type": "^21.0.0",
2727
"formidable": "^3.5.4",
2828
"idea-react": "^2.0.0-rc.13",
2929
"jsonwebtoken": "^9.0.2",
30-
"koa": "^2.16.1",
30+
"koa": "^3.0.1",
3131
"koajax": "^3.1.2",
32-
"less": "^4.3.0",
32+
"less": "^4.4.0",
3333
"less-loader": "^12.3.0",
3434
"lodash": "^4.17.21",
35-
"marked": "^15.0.12",
35+
"marked": "^16.1.2",
3636
"mime": "^4.0.7",
3737
"mobx": "^6.13.7",
3838
"mobx-github": "^0.3.11",
3939
"mobx-i18n": "^0.7.1",
40-
"mobx-lark": "^2.2.0",
40+
"mobx-lark": "^2.4.0",
4141
"mobx-react": "^9.2.0",
42-
"mobx-react-helper": "^0.4.1",
42+
"mobx-react-helper": "^0.5.1",
4343
"mobx-restful": "^2.1.0",
4444
"mobx-restful-table": "^2.5.2",
45-
"next": "^15.3.3",
45+
"next": "^15.4.5",
4646
"next-pwa": "~5.6.0",
47-
"next-ssr-middleware": "^1.0.1",
47+
"next-ssr-middleware": "^1.0.2",
4848
"next-with-less": "^3.0.1",
4949
"prismjs": "^1.30.0",
50-
"react": "^19.1.0",
50+
"react": "^19.1.1",
5151
"react-bootstrap": "^2.10.10",
5252
"react-bootstrap-editor": "^2.1.1",
53-
"react-dom": "^19.1.0",
53+
"react-dom": "^19.1.1",
5454
"react-editor-js": "^2.1.0",
5555
"remark-frontmatter": "^5.0.0",
5656
"remark-gfm": "^4.0.1",
5757
"remark-mdx-frontmatter": "^5.2.0",
58-
"undici": "^7.10.0",
59-
"web-utility": "^4.4.3",
60-
"webpack": "^5.99.9",
58+
"undici": "^7.13.0",
59+
"web-utility": "^4.5.1",
60+
"webpack": "^5.101.0",
6161
"yaml": "^2.8.0"
6262
},
6363
"devDependencies": {
64-
"@babel/plugin-proposal-decorators": "^7.27.1",
65-
"@babel/plugin-transform-typescript": "^7.27.1",
64+
"@babel/plugin-proposal-decorators": "^7.28.0",
65+
"@babel/plugin-transform-typescript": "^7.28.0",
6666
"@babel/preset-react": "^7.27.1",
67-
"@cspell/eslint-plugin": "^9.1.1",
68-
"@eslint/compat": "^1.3.0",
67+
"@cspell/eslint-plugin": "^9.2.0",
68+
"@eslint/compat": "^1.3.1",
6969
"@eslint/eslintrc": "^3.3.1",
70-
"@eslint/js": "^9.29.0",
71-
"@next/eslint-plugin-next": "^15.3.3",
70+
"@eslint/js": "^9.32.0",
71+
"@next/eslint-plugin-next": "^15.4.5",
7272
"@softonus/prettier-plugin-duplicate-remover": "^1.1.2",
73-
"@stylistic/eslint-plugin": "^4.4.1",
73+
"@stylistic/eslint-plugin": "^5.2.2",
7474
"@types/eslint-config-prettier": "^6.11.3",
7575
"@types/formidable": "^3.4.5",
76-
"@types/koa": "^2.15.0",
76+
"@types/koa": "^3.0.0",
7777
"@types/koa__router": "^12.0.4",
78-
"@types/lodash": "^4.17.17",
78+
"@types/lodash": "^4.17.20",
7979
"@types/next-pwa": "^5.6.9",
80-
"@types/node": "^22.15.32",
81-
"@types/react": "^19.1.8",
82-
"eslint": "^9.29.0",
83-
"eslint-config-next": "^15.3.3",
84-
"eslint-config-prettier": "^10.1.5",
80+
"@types/node": "^22.17.0",
81+
"@types/react": "^19.1.9",
82+
"eslint": "^9.32.0",
83+
"eslint-config-next": "^15.4.5",
84+
"eslint-config-prettier": "^10.1.8",
8585
"eslint-plugin-react": "^7.37.5",
8686
"eslint-plugin-simple-import-sort": "^12.1.1",
87-
"globals": "^16.2.0",
87+
"globals": "^16.3.0",
8888
"husky": "^9.1.7",
89-
"jiti": "^2.4.2",
90-
"lint-staged": "^16.1.2",
91-
"prettier": "^3.5.3",
89+
"jiti": "^2.5.1",
90+
"lint-staged": "^16.1.4",
91+
"prettier": "^3.6.2",
9292
"prettier-plugin-css-order": "^2.1.2",
93-
"typescript": "~5.8.3",
94-
"typescript-eslint": "^8.34.1"
93+
"typescript": "~5.9.2",
94+
"typescript-eslint": "^8.39.0"
9595
},
9696
"resolutions": {
9797
"next": "$next"
@@ -122,7 +122,7 @@
122122
"dev": "next dev",
123123
"build": "next build",
124124
"start": "next start",
125-
"lint": "next lint --fix && tsc --noEmit",
125+
"lint": "next lint --fix && git add . && tsc --noEmit",
126126
"test": "lint-staged && npm run lint",
127127
"pack-image": "docker build -t idea2app/lark-next-bootstrap-ts:latest .",
128128
"container": "docker rm -f lark-next-bootstrap-ts && docker run --name lark-next-bootstrap-ts -p 3000:3000 -d idea2app/lark-next-bootstrap-ts:latest"

0 commit comments

Comments
 (0)