Skip to content

Commit 89da576

Browse files
committed
[migrate] upgrade to MobX-Strapi 0.8, MobX-GitHub 0.6 & other latest Upstream packages
1 parent 8771159 commit 89da576

File tree

8 files changed

+810
-850
lines changed

8 files changed

+810
-850
lines changed

components/Organization/Card.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ export class OrganizationCard extends ObservedComponent<OrganizationCardProps, t
5353
}
5454

5555
render() {
56-
const { t } = this.observedContext,
57-
{ name, entityType, services, description, internetContact, onSwitch, ...props } = this.props;
56+
const { name, entityType, services, description, internetContact, onSwitch, ...props } =
57+
this.props;
5858
const { wechatPublic } = internetContact || {};
5959

6060
return (

models/System.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import { observable } from 'mobx';
22
import { BiSearchModelClass } from 'mobx-lark';
3-
import { BaseModel, DataObject, ListModel, toggle } from 'mobx-restful';
3+
import { BaseModel, ListModel, toggle } from 'mobx-restful';
44
import { Base, SearchableFilter } from 'mobx-strapi';
55
import { Constructor } from 'web-utility';
66

77
import { ownClient } from './Base';
88
import { OrganizationModel } from './Organization';
99

10-
export type SearchModel<T extends DataObject = any> = ListModel<T, SearchableFilter<T>>;
10+
export type SearchModel<T extends Base = any> = ListModel<T, SearchableFilter<T>>;
1111

1212
export type SearchPageMeta = Pick<
1313
InstanceType<BiSearchModelClass>,

package.json

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -17,72 +17,72 @@
1717
"@koa/router": "^14.0.0",
1818
"@mdx-js/loader": "^3.1.1",
1919
"@mdx-js/react": "^3.1.1",
20-
"@next/mdx": "^15.5.3",
21-
"core-js": "^3.45.1",
20+
"@next/mdx": "^15.5.4",
21+
"core-js": "^3.46.0",
2222
"echarts-jsx": "^0.5.4",
2323
"file-type": "^21.0.0",
2424
"idea-react": "^2.0.0-rc.13",
2525
"koa": "^3.0.1",
2626
"koajax": "^3.1.2",
2727
"license-filter": "^0.2.5",
28-
"marked": "^16.3.0",
28+
"marked": "^16.4.0",
2929
"mime": "^4.1.0",
30-
"mobx": "^6.13.7",
31-
"mobx-github": "^0.5.1",
30+
"mobx": "^6.15.0",
31+
"mobx-github": "^0.6.0",
3232
"mobx-i18n": "^0.7.2",
3333
"mobx-lark": "^2.4.2",
34-
"mobx-react": "^9.2.0",
34+
"mobx-react": "^9.2.1",
3535
"mobx-react-helper": "^0.5.1",
36-
"mobx-restful": "^2.1.1",
36+
"mobx-restful": "^2.1.3",
3737
"mobx-restful-table": "^2.5.4",
38-
"mobx-strapi": "^0.7.4",
39-
"next": "^15.5.3",
38+
"mobx-strapi": "^0.8.1",
39+
"next": "^15.5.4",
4040
"next-pwa": "^5.6.0",
4141
"next-ssr-middleware": "^1.0.3",
4242
"open-react-map": "^0.9.1",
43-
"react": "^19.1.1",
43+
"react": "^19.2.0",
4444
"react-bootstrap": "^2.10.10",
45-
"react-dom": "^19.1.1",
45+
"react-dom": "^19.2.0",
4646
"react-typed-component": "^1.0.6",
4747
"remark-frontmatter": "^5.0.0",
4848
"remark-mdx-frontmatter": "^5.2.0",
4949
"undici": "^7.16.0",
50-
"web-utility": "^4.6.1",
50+
"web-utility": "^4.6.2",
5151
"yaml": "^2.8.1"
5252
},
5353
"devDependencies": {
5454
"@babel/plugin-proposal-decorators": "^7.28.0",
5555
"@babel/plugin-transform-typescript": "^7.28.0",
5656
"@babel/preset-react": "^7.27.1",
5757
"@cspell/eslint-plugin": "^9.2.1",
58-
"@eslint/js": "^9.35.0",
59-
"@next/eslint-plugin-next": "^15.5.3",
58+
"@eslint/js": "^9.37.0",
59+
"@next/eslint-plugin-next": "^15.5.4",
6060
"@open-source-bazaar/china-ngo-database": "^0.6.0",
6161
"@softonus/prettier-plugin-duplicate-remover": "^1.1.2",
62-
"@stylistic/eslint-plugin": "^5.3.1",
62+
"@stylistic/eslint-plugin": "^5.4.0",
6363
"@types/eslint-config-prettier": "^6.11.3",
6464
"@types/koa": "^3.0.0",
6565
"@types/next-pwa": "^5.6.9",
66-
"@types/node": "^22.18.5",
67-
"@types/react": "^19.1.13",
68-
"@types/react-dom": "^19.1.9",
69-
"eslint": "^9.35.0",
70-
"eslint-config-next": "^15.5.3",
66+
"@types/node": "^22.18.10",
67+
"@types/react": "^19.2.2",
68+
"@types/react-dom": "^19.2.1",
69+
"eslint": "^9.37.0",
70+
"eslint-config-next": "^15.5.4",
7171
"eslint-config-prettier": "^10.1.8",
7272
"eslint-plugin-react": "^7.37.5",
7373
"eslint-plugin-simple-import-sort": "^12.1.1",
7474
"globals": "^16.4.0",
7575
"husky": "^9.1.7",
76-
"jiti": "^2.5.1",
77-
"less": "^4.4.1",
76+
"jiti": "^2.6.1",
77+
"less": "^4.4.2",
7878
"less-loader": "^12.3.0",
79-
"lint-staged": "^16.1.6",
79+
"lint-staged": "^16.2.4",
8080
"next-with-less": "^3.0.1",
8181
"prettier": "^3.6.2",
8282
"prettier-plugin-css-order": "^2.1.2",
83-
"sass": "^1.92.1",
84-
"typescript": "~5.9.2",
85-
"typescript-eslint": "^8.44.0"
83+
"sass": "^1.93.2",
84+
"typescript": "~5.9.3",
85+
"typescript-eslint": "^8.46.0"
8686
},
8787
"resolutions": {
8888
"mobx-react-helper": "$mobx-react-helper",

pages/NGO/[year]/index.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
import { observer } from 'mobx-react';
2+
import dynamic from 'next/dynamic';
23
import { cache, compose, errorLogger } from 'next-ssr-middleware';
34
import { FC, useContext } from 'react';
45
import { Button, Container } from 'react-bootstrap';
56

67
import { PageHead } from '../../../components/Layout/PageHead';
78
import { CityStatisticMap } from '../../../components/Map/CityStatisticMap';
89
import { SearchBar } from '../../../components/Navigator/SearchBar';
9-
import OrganizationCharts from '../../../components/Organization/Charts';
1010
import { OrganizationModel, OrganizationStatistic } from '../../../models/Organization';
1111
import { I18nContext } from '../../../models/Translation';
1212

13+
const OrganizationCharts = dynamic(() => import('../../../components/Organization/Charts'), {
14+
ssr: false,
15+
});
16+
1317
interface OrganizationPageProps {
1418
year: string;
1519
statistic: OrganizationStatistic;

pages/recipe/[...slug].tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ export const getStaticPaths: GetStaticPaths<RecipePageParams> = async () => {
2020
const nodes = await recipeContentStore.getAll();
2121

2222
const paths = nodes
23-
.filter(({ type, name }) => type === 'file' && !name.startsWith('.'))
23+
.filter(
24+
({ type, name, path }) =>
25+
type === 'file' && !name.startsWith('.') && !path.startsWith('index.'),
26+
)
2427
.map(({ path }) => ({ params: { slug: path.split('/') } }));
2528

2629
return { paths, fallback: 'blocking' };

pages/recipe/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ import { recipeContentStore, XContent } from '../../models/Wiki';
1111
import { filterMarkdownFiles } from '../api/core';
1212

1313
export const getStaticProps: GetStaticProps<{ nodes: XContent[] }> = async () => {
14-
const nodes = filterMarkdownFiles(await recipeContentStore.getAll());
14+
const nodes = filterMarkdownFiles(await recipeContentStore.getAll()).filter(
15+
({ path }) => !path.startsWith('index.'),
16+
);
1517

1618
return {
1719
props: JSON.parse(JSON.stringify({ nodes })),

pages/search/[model]/index.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { observer } from 'mobx-react';
2-
import { DataObject } from 'mobx-restful';
3-
import { SearchableFilter } from 'mobx-strapi';
2+
import { Base, SearchableFilter } from 'mobx-strapi';
43
import { cache, compose, errorLogger, RouteProps, router } from 'next-ssr-middleware';
54
import { FC, useContext } from 'react';
65
import { Container, Nav } from 'react-bootstrap';
@@ -26,7 +25,7 @@ export const getServerSideProps = compose<{ model: string }, SearchModelPageProp
2625

2726
const store = new Model();
2827

29-
await store.getList({ keywords } as SearchableFilter<DataObject>, +page, 9);
28+
await store.getList({ keywords } as SearchableFilter<Base>, +page, 9);
3029

3130
const { pageIndex, currentPage, pageCount } = store;
3231

0 commit comments

Comments
 (0)