Skip to content

Commit 0eb27ea

Browse files
committed
data: update
1 parent c0b063c commit 0eb27ea

File tree

14 files changed

+5532
-3437
lines changed

14 files changed

+5532
-3437
lines changed

apps/web/babel.config.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
export default {
2+
presets: [
3+
'next/babel',
4+
'@babel/preset-typescript',
5+
"@babel/preset-env"
6+
],
7+
plugins: ["@babel/plugin-transform-block-scoping"]
8+
};

apps/web/next.config.mjs

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,25 @@ const nextConfig = {
22
typescript: {
33
ignoreBuildErrors: true
44
},
5+
experimental: {
6+
forceSwcTransforms: true,
7+
},
58
webpack: (config, { isServer, buildId }) => {
6-
config.module.rules.push({
7-
test: /\.ts$/,
8-
/*
9-
Using SWC cause the following error:
10-
```
11-
You may need an additional loader to handle the result of these loaders.
12-
| import dxdataJson from "./dxdata.json";
13-
|
14-
> export const dxdata = dxdataJson as DXData;
15-
|
16-
| export const dxdataUpdateTime = dxdata.updateTime;
17-
```
18-
*/
19-
use: 'esbuild-loader'
20-
});
9+
// 垃圾 nextjs build 不出来
10+
// 不想修了
11+
// 毁灭吧
12+
config.module.rules.push(
13+
{
14+
test: /\.tsx?$/,
15+
use: 'babel-loader'
16+
// use: 'esbuild-loader'
17+
},
18+
{
19+
test: /\.json$/,
20+
type: 'javascript/auto',
21+
use: 'json-loader'
22+
}
23+
);
2124
return config;
2225
}
2326
};

apps/web/package.json

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,27 +18,31 @@
1818
"@clansty/maibot-clients": "workspace:^",
1919
"@clansty/maibot-types": "workspace:^",
2020
"@clansty/maibot-utils": "workspace:^",
21-
"next": "^14.2.15",
21+
"next": "^15.0.3",
2222
"react": "^18.3.1",
2323
"react-dom": "^18.3.1"
2424
},
2525
"devDependencies": {
26-
"@cloudflare/workers-types": "^4.20240919.0",
26+
"@babel/plugin-transform-block-scoping": "^7.25.9",
27+
"@babel/preset-env": "^7.26.0",
28+
"@babel/preset-typescript": "^7.26.0",
29+
"@babel/runtime": "^7.26.0",
30+
"@cloudflare/workers-types": "^4.20241112.0",
2731
"@iconify-json/twemoji": "^1.2.0",
28-
"@opennextjs/cloudflare": "https://pkg.pr.new/@opennextjs/cloudflare@81",
29-
"@types/node": "^20.8.3",
30-
"@types/react": "^18.3.8",
31-
"@types/react-dom": "^18.3.0",
32-
"@unocss/postcss": "^0.63.4",
32+
"@opennextjs/cloudflare": "^0.2.1",
33+
"@types/node": "^22.9.1",
34+
"@types/react": "^18.3.12",
35+
"@types/react-dom": "^18.3.1",
36+
"@unocss/postcss": "^0.64.1",
37+
"babel-loader": "^9.2.1",
3338
"esbuild-loader": "^4.2.2",
3439
"json-loader": "^0.5.7",
35-
"postcss": "^8.4.47",
36-
"ts-loader": "^9.5.1",
37-
"tsx": "^4.17.0",
40+
"postcss": "^8.4.49",
41+
"tsx": "^4.19.2",
3842
"typescript": "^5.6.3",
39-
"unocss": "^0.63.4",
40-
"vercel": "^37.5.2",
41-
"webpack": "^5.94.0",
42-
"wrangler": "^3.78.6"
43+
"unocss": "^0.64.1",
44+
"vercel": "^39.1.0",
45+
"webpack": "^5.96.1",
46+
"wrangler": "^3.88.0"
4347
}
4448
}
Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import B50 from '@/app/b50/components/B50';
22
import getUserProfile from '@/utils/getUserProfile';
33

4-
export default async ({ params }: { params: { tguid: string, profile: string } }) => {
5-
const profile = await getUserProfile(params.tguid, params.profile);
6-
const userRating = await profile.getUserRating();
7-
const userData = await profile.getNameplate();
8-
const profileVer = await profile.getVersion();
4+
export default async (props: { params: Promise<{ tguid: string, profile: string }> }) => {
5+
const params = await props.params;
6+
const profile = await getUserProfile(params.tguid, params.profile);
7+
const userRating = await profile.getUserRating();
8+
const userData = await profile.getNameplate();
9+
const profileVer = await profile.getVersion();
910

10-
return <B50 rating={userRating} user={userData} ver={profileVer} />;
11-
}
11+
return <B50 rating={userRating} user={userData} ver={profileVer} />;
12+
};
Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import B50 from '@/app/b50/components/B50';
22
import getAquaDxUser from '@/utils/getAquaDxUser';
33

4-
export default async ({ params }: { params: { username: string } }) => {
5-
const profile = await getAquaDxUser(params.username);
6-
const userRating = await profile.getUserRating();
7-
const userData = await profile.getNameplate();
8-
const profileVer = await profile.getVersion();
4+
export default async (props: { params: Promise<{ username: string }> }) => {
5+
const params = await props.params;
6+
const profile = await getAquaDxUser(params.username);
7+
const userRating = await profile.getUserRating();
8+
const userData = await profile.getNameplate();
9+
const profileVer = await profile.getVersion();
910

10-
return <B50 rating={userRating} user={userData} ver={profileVer} />;
11-
}
11+
return <B50 rating={userRating} user={userData} ver={profileVer} />;
12+
};

apps/web/src/app/levelProgress/[tguid]/[profile]/[level]/page.tsx

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,16 @@ import { LEVELS, Song } from '@clansty/maibot-types';
33
import { notFound } from 'next/navigation';
44
import getUserProfile from '@/utils/getUserProfile';
55

6-
export default async ({ params }: { params: { tguid: string, level: string, profile: string } }) => {
7-
const level = decodeURIComponent(params.level) as typeof LEVELS[number];
8-
if (!LEVELS.includes(level)) notFound();
6+
export default async (
7+
props: { params: Promise<{ tguid: string, level: string, profile: string }> }
8+
) => {
9+
const params = await props.params;
10+
const level = decodeURIComponent(params.level) as typeof LEVELS[number];
11+
if (!LEVELS.includes(level)) notFound();
912

10-
const profile = await getUserProfile(params.tguid, params.profile);
11-
const requiredSongList = Song.getByCondition(it => it.sheets.some(chart => chart.level === level));
12-
const userMusic = await profile.getUserMusic(requiredSongList);
13+
const profile = await getUserProfile(params.tguid, params.profile);
14+
const requiredSongList = Song.getByCondition(it => it.sheets.some(chart => chart.level === level));
15+
const userMusic = await profile.getUserMusic(requiredSongList);
1316

14-
return <LevelProgress userMusic={userMusic} level={level} region={profile.region} requiredSongList={requiredSongList} logo={await profile.getVersionLogo()} />;
15-
}
17+
return <LevelProgress userMusic={userMusic} level={level} region={profile.region} requiredSongList={requiredSongList} logo={await profile.getVersionLogo()} />;
18+
};

apps/web/src/app/levelProgress/aquadx/[username]/[level]/page.tsx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@ import { notFound } from 'next/navigation';
44
import getUserProfile from '@/utils/getUserProfile';
55
import getAquaDxUser from '@/utils/getAquaDxUser';
66

7-
export default async ({ params }: { params: { username: string, level: string } }) => {
8-
const profile = await getAquaDxUser(params.username);
9-
const level = decodeURIComponent(params.level) as typeof LEVELS[number];
10-
if (!LEVELS.includes(level)) notFound();
7+
export default async (props: { params: Promise<{ username: string, level: string }> }) => {
8+
const params = await props.params;
9+
const profile = await getAquaDxUser(params.username);
10+
const level = decodeURIComponent(params.level) as typeof LEVELS[number];
11+
if (!LEVELS.includes(level)) notFound();
1112

12-
const requiredSongList = Song.getByCondition(it => it.sheets.some(chart => chart.level === level));
13-
const userMusic = await profile.getUserMusic(requiredSongList);
13+
const requiredSongList = Song.getByCondition(it => it.sheets.some(chart => chart.level === level));
14+
const userMusic = await profile.getUserMusic(requiredSongList);
1415

15-
return <LevelProgress userMusic={userMusic} level={level} region={profile.region} requiredSongList={requiredSongList} logo={await profile.getVersionLogo()} />;
16-
}
16+
return <LevelProgress userMusic={userMusic} level={level} region={profile.region} requiredSongList={requiredSongList} logo={await profile.getVersionLogo()} />;
17+
};

apps/web/src/app/plateProgress/[tguid]/[profile]/[type]/page.tsx

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@ import { notFound } from 'next/navigation';
33
import PlateProgress from '@/app/plateProgress/components/PlateProgress';
44
import getUserProfile from '@/utils/getUserProfile';
55

6-
export default async ({ params }: { params: { tguid: string, type: string, profile: string } }) => {
7-
let type = decodeURIComponent(params.type) as typeof PLATE_TYPE[number] | '';
8-
let ver: typeof PLATE_VER[number] | typeof BA_VE;
9-
if (type as any === BA_VE) {
6+
export default async (
7+
props: { params: Promise<{ tguid: string, type: string, profile: string }> }
8+
) => {
9+
const params = await props.params;
10+
let type = decodeURIComponent(params.type) as typeof PLATE_TYPE[number] | '';
11+
let ver: typeof PLATE_VER[number] | typeof BA_VE;
12+
if (type as any === BA_VE) {
1013
ver = BA_VE;
1114
type = '';
1215
} else {
@@ -15,10 +18,10 @@ export default async ({ params }: { params: { tguid: string, type: string, profi
1518
if (!(PLATE_VER.includes(ver as any) && PLATE_TYPE.includes(type as any))) notFound();
1619
}
1720

18-
const profile = await getUserProfile(params.tguid, params.profile);
19-
const profileVer = await profile.getVersion();
20-
const requiredList = (await profile.plateSongs())[ver].map(it => Song.fromId(it, profileVer))
21-
const userMusic = await profile.getUserMusic(requiredList);
21+
const profile = await getUserProfile(params.tguid, params.profile);
22+
const profileVer = await profile.getVersion();
23+
const requiredList = (await profile.plateSongs())[ver].map(it => Song.fromId(it, profileVer))
24+
const userMusic = await profile.getUserMusic(requiredList);
2225

23-
return <PlateProgress userMusic={userMusic} type={type} ver={ver} requiredList={requiredList} logo={await profile.getVersionLogo()} />;
24-
}
26+
return <PlateProgress userMusic={userMusic} type={type} ver={ver} requiredList={requiredList} logo={await profile.getVersionLogo()} />;
27+
};

apps/web/src/app/plateProgress/aquadx/[username]/[type]/page.tsx

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ import PlateProgress from '@/app/plateProgress/components/PlateProgress';
44
import getUserProfile from '@/utils/getUserProfile';
55
import getAquaDxUser from '@/utils/getAquaDxUser';
66

7-
export default async ({ params }: { params: { username: string, type: string } }) => {
8-
const profile = await getAquaDxUser(params.username);
9-
let type = decodeURIComponent(params.type) as typeof PLATE_TYPE[number] | '';
10-
let ver: typeof PLATE_VER[number] | typeof BA_VE;
11-
if (type as any === BA_VE) {
7+
export default async (props: { params: Promise<{ username: string, type: string }> }) => {
8+
const params = await props.params;
9+
const profile = await getAquaDxUser(params.username);
10+
let type = decodeURIComponent(params.type) as typeof PLATE_TYPE[number] | '';
11+
let ver: typeof PLATE_VER[number] | typeof BA_VE;
12+
if (type as any === BA_VE) {
1213
ver = BA_VE;
1314
type = '';
1415
} else {
@@ -17,9 +18,9 @@ export default async ({ params }: { params: { username: string, type: string } }
1718
if (!(PLATE_VER.includes(ver as any) && PLATE_TYPE.includes(type as any))) notFound();
1819
}
1920

20-
const profileVer = await profile.getVersion();
21-
const requiredList = (await profile.plateSongs())[ver].map(it => Song.fromId(it, profileVer));
22-
const userMusic = await profile.getUserMusic(requiredList);
21+
const profileVer = await profile.getVersion();
22+
const requiredList = (await profile.plateSongs())[ver].map(it => Song.fromId(it, profileVer));
23+
const userMusic = await profile.getUserMusic(requiredList);
2324

24-
return <PlateProgress userMusic={userMusic} type={type} ver={ver} requiredList={requiredList} logo={await profile.getVersionLogo()} />;
25-
}
25+
return <PlateProgress userMusic={userMusic} type={type} ver={ver} requiredList={requiredList} logo={await profile.getVersionLogo()} />;
26+
};

apps/web/tsconfig.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@
88
"allowJs": true,
99
"skipLibCheck": true,
1010
"strict": false,
11-
"noEmit": true,
11+
"noEmit": false,
1212
"esModuleInterop": true,
1313
"module": "esnext",
1414
"moduleResolution": "bundler",
1515
"target": "ESNext",
1616
"resolveJsonModule": true,
1717
"isolatedModules": true,
18-
"jsx": "preserve",
18+
"jsx": "react",
19+
"allowSyntheticDefaultImports": true,
1920
"incremental": true,
2021
"plugins": [
2122
{

0 commit comments

Comments
 (0)