Skip to content

Commit 8c165c8

Browse files
committed
[fix] some Path detail bugs
[optimize] upgrade to TS 5.9, Koa 3, Marked 16, MobX-React-helper 0.5, ESLint Stylistic 5, Sentry 10 & other latest Upstream packages
1 parent afa51fa commit 8c165c8

File tree

8 files changed

+2276
-2151
lines changed

8 files changed

+2276
-2151
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

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

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',

package.json

Lines changed: 34 additions & 34 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": "^13.1.1",
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.0.0",
2323
"copy-webpack-plugin": "^13.0.0",
24-
"core-js": "^3.43.0",
24+
"core-js": "^3.44.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.1",
3636
"mime": "^4.0.7",
3737
"mobx": "^6.13.7",
3838
"mobx-github": "^0.3.11",
3939
"mobx-i18n": "^0.7.1",
4040
"mobx-lark": "^2.2.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",
4747
"next-ssr-middleware": "^1.0.1",
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",
58+
"undici": "^7.13.0",
5959
"web-utility": "^4.4.3",
60-
"webpack": "^5.99.9",
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",
89+
"jiti": "^2.5.1",
9090
"lint-staged": "^16.1.2",
91-
"prettier": "^3.5.3",
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.38.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"

pages/_app.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ export default class CustomApp extends App<I18nProps> {
5555

5656
<MainNavigator />
5757

58-
{router.route.startsWith('/article/') ? (
59-
<MDXLayout title={router.route.split('/').at(-1)}>
58+
{router.asPath.startsWith('/article/') ? (
59+
<MDXLayout title={router.asPath.split('/').at(-1)}>
6060
<Component {...pageProps} />
6161
</MDXLayout>
6262
) : (

pages/_document.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export default class CustomDocument extends Document<CustomDocumentProps> {
3838
/>
3939
<link
4040
rel="stylesheet"
41-
href="https://unpkg.com/bootstrap-icons@1.11.3/font/bootstrap-icons.css"
41+
href="https://unpkg.com/bootstrap-icons@1.13.1/font/bootstrap-icons.css"
4242
/>
4343
</Head>
4444

pages/api/core.ts

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -86,19 +86,20 @@ export async function* pageListOf(
8686
name = name.replace(MDX_pattern, '');
8787
path = `${path}/${name}`.replace(new RegExp(`^${prefix}`), '');
8888

89-
if (node.isFile())
90-
if (isMDX) {
91-
const article: ArticleMeta = { name, path, subs: [] };
92-
try {
93-
const meta = await frontMatterOf(`${node.path}/${node.name}`);
94-
95-
if (meta) article.meta = meta;
96-
} catch (error) {
97-
console.error(error);
98-
}
99-
yield article;
100-
} else continue;
101-
89+
if (node.isFile() && isMDX) {
90+
const article: ArticleMeta = { name, path, subs: [] };
91+
try {
92+
const meta = await frontMatterOf(`${node.path}/${node.name}`);
93+
94+
if (meta) article.meta = meta;
95+
} catch (error) {
96+
console.error(
97+
`Error reading front matter for ${node.path}/${node.name}:`,
98+
error,
99+
);
100+
}
101+
yield article;
102+
}
102103
if (!node.isDirectory()) continue;
103104

104105
const subs = await Array.fromAsync(pageListOf(path, prefix));

0 commit comments

Comments
 (0)