Skip to content

Commit 7403be5

Browse files
committed
[migrate] upgrade to MobX-React-helper 0.4, MobX-RESTful-table 2.5 & other latest Upstream packages
[fix] some Docker configuration bugs
1 parent 1f7d0ce commit 7403be5

File tree

12 files changed

+1375
-1716
lines changed

12 files changed

+1375
-1716
lines changed

.github/workflows/deploy-production.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
tags:
99
- v*
1010
env:
11-
ARTIFACT_PATH: /tmp/artifact.tar
11+
ARTIFACT_PATH: artifact.tar
1212
BOX_NAME: ${{ github.event.repository.name }}
1313
BOX_URL: ${{ github.repository }}
1414

@@ -39,6 +39,9 @@ jobs:
3939
platforms: linux/amd64
4040
tags: ${{ env.BOX_URL }}:latest
4141
outputs: type=docker,dest=${{ env.ARTIFACT_PATH }}
42+
# use GitHub actions cache
43+
cache-from: type=gha
44+
cache-to: type=gha,mode=max
4245

4346
- name: Pick Docker Compose
4447
run: |
@@ -52,18 +55,18 @@ jobs:
5255
target: /tmp/${{ env.BOX_NAME }}
5356
host: ${{ secrets.HOST }}
5457
username: ${{ secrets.USER }}
55-
password: ${{ secrets.SSH_KEY }}
58+
key: ${{ secrets.SSH_KEY }}
5659
strip_components: 1
5760

5861
- name: Run Image
59-
uses: garygrossgarten/github-action-ssh@release
62+
uses: appleboy/ssh-action@v1
6063
with:
6164
host: ${{ secrets.HOST }}
6265
username: ${{ secrets.USER }}
63-
password: ${{ secrets.SSH_KEY }}
64-
command: |
65-
mkdir -p ~/${{ env.BOX_NAME }}
66+
key: ${{ secrets.SSH_KEY }}
67+
script: |
6668
cd /tmp/${{ env.BOX_NAME }}
69+
mkdir -p ~/${{ env.BOX_NAME }}
6770
mv docker-compose.yml start.sh ~/${{ env.BOX_NAME }}
6871
cd ~/${{ env.BOX_NAME }}
6972
chmod +x start.sh

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ENV LD_PRELOAD="/usr/lib/x86_64-linux-gnu/libjemalloc.so.2"
88
ENV MALLOC_CONF=dirty_decay_ms:1000,narenas:2,background_thread:true
99
ENV PNPM_HOME="/pnpm"
1010
ENV PATH="$PNPM_HOME:$PATH"
11-
RUN corepack enable
11+
RUN npm i pnpm@latest -g
1212
COPY . /app
1313
WORKDIR /app
1414

components/Layout/PageHead.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export const PageHead: FC<PageHeadProps> = ({
1414
children,
1515
}) => (
1616
<Head>
17-
<title>{`${title}${title ? ' - ' : ''}${Name}`}</title>
17+
<title>{`${title ? `${title} - ` : ''}${Name}`}</title>
1818

1919
{description && <meta name="description" content={description} />}
2020

docker-compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ services:
3030
image: willfarrell/autoheal:1.2.0
3131
volumes:
3232
- /var/run/docker.sock:/var/run/docker.sock
33+
networks:
34+
- idea2app
3335
restart: always
3436

3537
caddy:

package.json

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -18,80 +18,80 @@
1818
"@koa/router": "^13.1.0",
1919
"@mdx-js/loader": "^3.1.0",
2020
"@mdx-js/react": "^3.1.0",
21-
"@next/mdx": "^15.3.2",
22-
"@sentry/nextjs": "^9.16.0",
21+
"@next/mdx": "^15.3.3",
22+
"@sentry/nextjs": "^9.24.0",
2323
"copy-webpack-plugin": "^13.0.0",
2424
"core-js": "^3.42.0",
2525
"editorjs-html": "^4.0.5",
26-
"file-type": "^20.5.0",
26+
"file-type": "^21.0.0",
2727
"formidable": "^3.5.4",
28-
"idea-react": "^2.0.0-rc.10",
28+
"idea-react": "^2.0.0-rc.13",
2929
"jsonwebtoken": "^9.0.2",
3030
"koa": "^2.16.1",
3131
"koajax": "^3.1.2",
3232
"less": "^4.3.0",
3333
"less-loader": "^12.3.0",
3434
"lodash": "^4.17.21",
35-
"marked": "^15.0.11",
35+
"marked": "^15.0.12",
3636
"mime": "^4.0.7",
3737
"mobx": "^6.13.7",
38-
"mobx-github": "^0.3.5",
38+
"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.3.6",
42+
"mobx-react-helper": "^0.4.1",
4343
"mobx-restful": "^2.1.0",
44-
"mobx-restful-table": "^2.2.2",
45-
"next": "^15.3.2",
44+
"mobx-restful-table": "^2.5.2",
45+
"next": "^15.3.3",
4646
"next-pwa": "~5.6.0",
4747
"next-ssr-middleware": "^1.0.0",
4848
"next-with-less": "^3.0.1",
4949
"prismjs": "^1.30.0",
5050
"react": "^19.1.0",
51-
"react-bootstrap": "^2.10.9",
52-
"react-bootstrap-editor": "^2.0.7",
51+
"react-bootstrap": "^2.10.10",
52+
"react-bootstrap-editor": "^2.1.1",
5353
"react-dom": "^19.1.0",
5454
"react-editor-js": "^2.1.0",
5555
"remark-frontmatter": "^5.0.0",
5656
"remark-gfm": "^4.0.1",
5757
"remark-mdx-frontmatter": "^5.1.0",
58-
"undici": "^7.8.0",
58+
"undici": "^7.10.0",
5959
"web-utility": "^4.4.3",
60-
"webpack": "^5.99.8",
61-
"yaml": "^2.7.1"
60+
"webpack": "^5.99.9",
61+
"yaml": "^2.8.0"
6262
},
6363
"devDependencies": {
6464
"@babel/plugin-proposal-decorators": "^7.27.1",
6565
"@babel/plugin-transform-typescript": "^7.27.1",
6666
"@babel/preset-react": "^7.27.1",
67-
"@cspell/eslint-plugin": "^9.0.0",
67+
"@cspell/eslint-plugin": "^9.0.2",
6868
"@eslint/compat": "^1.2.9",
6969
"@eslint/eslintrc": "^3.3.1",
70-
"@eslint/js": "^9.26.0",
71-
"@next/eslint-plugin-next": "^15.3.2",
70+
"@eslint/js": "^9.28.0",
71+
"@next/eslint-plugin-next": "^15.3.3",
7272
"@softonus/prettier-plugin-duplicate-remover": "^1.1.2",
73-
"@stylistic/eslint-plugin": "^4.2.0",
73+
"@stylistic/eslint-plugin": "^4.4.0",
7474
"@types/eslint-config-prettier": "^6.11.3",
7575
"@types/formidable": "^3.4.5",
7676
"@types/koa": "^2.15.0",
7777
"@types/koa__router": "^12.0.4",
78-
"@types/lodash": "^4.17.16",
78+
"@types/lodash": "^4.17.17",
7979
"@types/next-pwa": "^5.6.9",
80-
"@types/node": "^22.15.15",
81-
"@types/react": "^19.1.3",
82-
"eslint": "^9.26.0",
83-
"eslint-config-next": "^15.3.2",
84-
"eslint-config-prettier": "^10.1.3",
80+
"@types/node": "^22.15.29",
81+
"@types/react": "^19.1.6",
82+
"eslint": "^9.28.0",
83+
"eslint-config-next": "^15.3.3",
84+
"eslint-config-prettier": "^10.1.5",
8585
"eslint-plugin-react": "^7.37.5",
8686
"eslint-plugin-simple-import-sort": "^12.1.1",
87-
"globals": "^16.1.0",
87+
"globals": "^16.2.0",
8888
"husky": "^9.1.7",
8989
"jiti": "^2.4.2",
90-
"lint-staged": "^15.5.2",
90+
"lint-staged": "^16.1.0",
9191
"prettier": "^3.5.3",
9292
"prettier-plugin-css-order": "^2.1.2",
9393
"typescript": "~5.8.3",
94-
"typescript-eslint": "^8.32.0"
94+
"typescript-eslint": "^8.33.1"
9595
},
9696
"resolutions": {
9797
"next": "$next"

pages/index.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,21 @@ import { framework, mainNav } from './api/home';
1010

1111
const HomePage = observer(() => {
1212
const i18n = useContext(I18nContext);
13+
const { t } = i18n;
1314

1415
return (
1516
<Container as="main" className={styles.main}>
16-
<PageHead />
17+
<PageHead title={t('home_page')} />
1718

1819
<h1 className={`m-0 text-center ${styles.title}`}>
19-
{i18n.t('welcome_to')}
20+
{t('welcome_to')}
2021
<a className="text-primary mx-2" href="https://nextjs.org">
2122
Next.js!
2223
</a>
2324
</h1>
2425

2526
<p className={`text-center fs-4 ${styles.description}`}>
26-
{i18n.t('get_started_by_editing')}
27+
{t('get_started_by_editing')}
2728
<code className={`mx-2 rounded-3 bg-light ${styles.code}`}>
2829
pages/index.tsx
2930
</code>
@@ -49,7 +50,7 @@ const HomePage = observer(() => {
4950
))}
5051
</Row>
5152

52-
<h2 className="my-4 text-center">{i18n.t('upstream_projects')}</h2>
53+
<h2 className="my-4 text-center">{t('upstream_projects')}</h2>
5354

5455
<Row className="g-4" xs={1} sm={2} md={3}>
5556
{framework.map(

pages/pagination.tsx

Lines changed: 16 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,21 @@
1-
import { text2color } from 'idea-react';
21
import { computed } from 'mobx';
32
import { GitRepository } from 'mobx-github';
43
import { observer } from 'mobx-react';
5-
import { ObservedComponent, observePropsState } from 'mobx-react-helper';
6-
import { Column, RestTable } from 'mobx-restful-table';
7-
import { Component } from 'react';
8-
import { Badge, Container } from 'react-bootstrap';
4+
import { ObservedComponent } from 'mobx-react-helper';
5+
import { BadgeBar, Column, RestTable } from 'mobx-restful-table';
6+
import { Container } from 'react-bootstrap';
97

108
import { PageHead } from '../components/Layout/PageHead';
119
import { repositoryStore } from '../models/Base';
1210
import { i18n, I18nContext } from '../models/Translation';
1311

14-
export default interface PaginationPage
15-
extends ObservedComponent<{}, typeof i18n> {}
16-
1712
@observer
18-
@observePropsState
19-
export default class PaginationPage extends Component {
13+
export default class PaginationPage extends ObservedComponent<{}, typeof i18n> {
2014
static contextType = I18nContext;
2115

2216
@computed
2317
get columns(): Column<GitRepository>[] {
24-
const { t } = this.observedContext!;
18+
const { t } = this.observedContext;
2519

2620
return [
2721
{
@@ -32,35 +26,31 @@ export default class PaginationPage extends Component {
3226
{full_name}
3327
</a>
3428
),
29+
required: true,
30+
minLength: 3,
31+
invalidMessage: 'Input 3 characters at least',
3532
},
3633
{ key: 'homepage', type: 'url', renderHead: t('home_page') },
3734
{ key: 'language', renderHead: t('programming_language') },
3835
{
3936
key: 'topics',
4037
renderHead: t('topic'),
4138
renderBody: ({ topics }) => (
42-
<>
43-
{topics?.map(topic => (
44-
<Badge
45-
key={topic}
46-
className="me-2"
47-
bg={text2color(topic, ['light'])}
48-
as="a"
49-
target="_blank"
50-
href={`https://github.com/topics/${topic}`}
51-
>
52-
{topic}
53-
</Badge>
54-
))}
55-
</>
39+
<BadgeBar
40+
list={(topics || []).map(text => ({
41+
text,
42+
link: `https://github.com/topics/${text}`,
43+
}))}
44+
/>
5645
),
5746
},
5847
{ key: 'stargazers_count', type: 'number', renderHead: t('star_count') },
48+
{ key: 'description', renderHead: t('description'), rows: 3 },
5949
];
6050
}
6151

6252
render() {
63-
const i18n = this.observedContext!;
53+
const i18n = this.observedContext;
6454

6555
return (
6656
<Container style={{ height: '91vh' }}>

0 commit comments

Comments
 (0)