Skip to content

Commit e968b8d

Browse files
committed
[migrate] upgrade to Next.js 16
[fix] Status Check & Button Style of Prototype Generator component
1 parent 71a3e3c commit e968b8d

File tree

7 files changed

+141
-127
lines changed

7 files changed

+141
-127
lines changed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
## Technology stack
1111

1212
- Language: [TypeScript v5][2] + [MDX v3][10]
13-
- Component engine: [Next.js v15][3]
13+
- Component engine: [Next.js v16][3]
1414
- Component suite: [Bootstrap v5][4]
1515
- PWA framework: [Workbox v6][5]
1616
- State management: [MobX v6][11]
@@ -20,7 +20,6 @@
2020
## Best practice
2121

2222
1. Install GitHub apps in your organization or account:
23-
2423
1. [Probot settings][15]: set up Issue labels & Pull Request rules
2524
2. [PR badge][16]: set up Online [VS Code][17] editor entries in Pull Request description
2625

components/Project/PrototypeGenerator.tsx

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,12 @@ export class PrototypeGenerator extends ObservedComponent<PrototypeGeneratorProp
3434
}
3535

3636
async pollStatusCheck() {
37-
const { props, version } = this,
38-
rootElement = this.root.current;
37+
const rootElement = this.root.current;
3938

40-
while (version?.status === 'pending' || version?.status === 'processing') {
39+
while (this.version?.status === 'pending' || this.version?.status === 'processing') {
4140
if (!rootElement?.isConnected) break;
4241

43-
if (inViewport(rootElement))
44-
this.version = await this.versionStore.getOne(props.prototype!.id);
42+
if (inViewport(rootElement)) this.version = await this.versionStore.getOne(this.version.id);
4543

4644
await sleep(3);
4745
}
@@ -91,34 +89,28 @@ export class PrototypeGenerator extends ObservedComponent<PrototypeGeneratorProp
9189
return (
9290
<Box sx={{ display: 'flex', gap: 1, flexWrap: 'wrap' }}>
9391
{previewLink && (
94-
<Link
92+
<Button
9593
href={previewLink}
9694
target="_blank"
9795
rel="noopener noreferrer"
98-
sx={{
99-
textDecoration: 'none',
100-
fontSize: '0.875rem',
101-
fontWeight: 500,
102-
color: 'primary.main',
103-
}}
96+
variant="contained"
97+
color="success"
98+
size="small"
10499
>
105100
{t('view_preview')}
106-
</Link>
101+
</Button>
107102
)}
108103
{gitLogsLink && (
109-
<Link
104+
<Button
110105
href={gitLogsLink}
111106
target="_blank"
112107
rel="noopener noreferrer"
113-
sx={{
114-
textDecoration: 'none',
115-
fontSize: '0.875rem',
116-
fontWeight: 500,
117-
color: 'text.secondary',
118-
}}
108+
variant="contained"
109+
color="warning"
110+
size="small"
119111
>
120112
{t('view_ai_log')}
121-
</Link>
113+
</Button>
122114
)}
123115
</Box>
124116
);

eslint.config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ export default tsEslint.config(
4747
warnOnUnsupportedTypeScriptVersion: false,
4848
},
4949
},
50-
// @ts-expect-error https://github.com/vercel/next.js/issues/81695
5150
rules: {
5251
// spellchecker
5352
'@cspell/spellchecker': [

next-env.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/// <reference types="next" />
22
/// <reference types="next/image-types/global" />
3-
/// <reference path="./.next/types/routes.d.ts" />
3+
import './.next/dev/types/routes.d.ts';
44

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

package.json

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"mobx-react": "^9.2.1",
3535
"mobx-react-helper": "^0.5.1",
3636
"mobx-restful": "^2.1.4",
37-
"next": "^15.5.6",
37+
"next": "^16.0.0",
3838
"next-pwa": "~5.6.0",
3939
"next-ssr-middleware": "^1.0.3",
4040
"react": "^19.2.0",
@@ -50,7 +50,7 @@
5050
"@eslint/compat": "^1.4.0",
5151
"@eslint/js": "^9.38.0",
5252
"@idea2app/data-server": "^1.0.0-rc.3",
53-
"@next/eslint-plugin-next": "^15.5.6",
53+
"@next/eslint-plugin-next": "^16.0.0",
5454
"@stylistic/eslint-plugin": "^5.5.0",
5555
"@tailwindcss/postcss": "^4.1.15",
5656
"@tailwindcss/typography": "^0.5.19",
@@ -62,7 +62,7 @@
6262
"@types/node": "^22.18.12",
6363
"@types/react": "^19.2.2",
6464
"eslint": "^9.38.0",
65-
"eslint-config-next": "^15.5.6",
65+
"eslint-config-next": "^16.0.0",
6666
"eslint-config-prettier": "^10.1.8",
6767
"eslint-plugin-react": "^7.37.5",
6868
"eslint-plugin-simple-import-sort": "^12.1.1",
@@ -109,12 +109,10 @@
109109
"e": "pnpx @dotenvx/dotenvx run -f .env.personal.local -- pnpm",
110110
"prepare": "husky || true",
111111
"install": "xgit download https://github.com/idea2app/key-vault main idea2app.github.io || true",
112-
"dev": "next dev",
113-
"build": "next build",
114-
"export": "next build && next export",
112+
"dev": "next dev --webpack",
113+
"build": "next build --webpack",
115114
"start": "next start",
116-
"lint": "next lint --fix && git add . && tsc --noEmit",
117-
"test": "lint-staged && npm run lint",
115+
"test": "lint-staged && tsc --noEmit",
118116
"pack-image": "docker build -t idea2app/web-server .",
119117
"container": "docker rm -f web-server && docker run --name web-server -p 3000:3000 -d idea2app/web-server"
120118
}

0 commit comments

Comments
 (0)