Skip to content

Commit f629ba0

Browse files
xqvvuc121914yu
authored andcommitted
wip(next): upgrade next16 with next-rspack to build (#6501)
* wip(next): upgrade next16 with next-rspack to build * wip: fix tsconfig path alias, bump various deps * fix: test action pnpm version, immer dep * fix: only use Rspack for develop environment
1 parent 30bfae0 commit f629ba0

File tree

33 files changed

+1549
-1212
lines changed

33 files changed

+1549
-1212
lines changed

.github/workflows/fastgpt-test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
repository: ${{ github.event.pull_request.head.repo.full_name }}
2121
- uses: pnpm/action-setup@v4
2222
with:
23-
version: 10
23+
version: 9
2424
- name: 'Install Deps'
2525
run: pnpm install
2626
- name: 'Test'

package.json

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,16 @@
2323
"@typescript-eslint/eslint-plugin": "^6.21.0",
2424
"@typescript-eslint/parser": "^6.21.0",
2525
"@vitest/coverage-v8": "^3.0.9",
26-
"eslint": "^8.57.0",
27-
"eslint-config-next": "^15.5.12",
26+
"eslint": "catalog:",
27+
"eslint-config-next": "catalog:",
2828
"husky": "^8.0.3",
29-
"i18next": "23.16.8",
30-
"js-yaml": "^4.1.1",
29+
"i18next": "catalog:",
30+
"js-yaml": "catalog:",
3131
"lint-staged": "^13.3.0",
3232
"mongodb-memory-server": "^10.1.4",
33-
"next-i18next": "15.4.2",
33+
"next-i18next": "catalog:",
3434
"prettier": "3.2.4",
35-
"react-i18next": "14.1.2",
35+
"react-i18next": "catalog:",
3636
"typescript": "^5.1.3",
3737
"vitest": "^3.0.9",
3838
"zhlint": "^0.7.4"
@@ -51,23 +51,8 @@
5151
"git add ."
5252
]
5353
},
54-
"pnpm": {
55-
"overrides": {
56-
"react": "18.3.1",
57-
"react-dom": "18.3.1",
58-
"@types/react": "18.3.1"
59-
}
60-
},
61-
"resolutions": {
62-
"mdast-util-gfm-autolink-literal": "2.0.0"
63-
},
6454
"engines": {
65-
"node": ">=20"
66-
},
67-
"devEngines": {
68-
"packageManager": {
69-
"name": "pnpm",
70-
"version": "9.15.9"
71-
}
55+
"node": "20.x",
56+
"pnpm": "9.x"
7257
}
7358
}

packages/global/core/ai/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ export const modelTypeList = [
7272

7373
export enum ChatCompletionRequestMessageRoleEnum {
7474
'System' = 'system',
75+
'Developer' = 'developer',
7576
'User' = 'user',
7677
'Assistant' = 'assistant',
7778
'Function' = 'function',

packages/global/core/chat/adapt.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import { getNanoid } from '../../common/string/tools';
2323

2424
export const GPT2Chat = {
2525
[ChatCompletionRequestMessageRoleEnum.System]: ChatRoleEnum.System,
26+
[ChatCompletionRequestMessageRoleEnum.Developer]: ChatRoleEnum.System,
2627
[ChatCompletionRequestMessageRoleEnum.User]: ChatRoleEnum.Human,
2728
[ChatCompletionRequestMessageRoleEnum.Assistant]: ChatRoleEnum.AI,
2829
[ChatCompletionRequestMessageRoleEnum.Function]: ChatRoleEnum.AI,

packages/global/package.json

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,32 @@
11
{
22
"name": "@fastgpt/global",
33
"version": "1.0.0",
4+
"engines": {
5+
"node": "20.x",
6+
"pnpm": "9.x"
7+
},
48
"dependencies": {
59
"@fastgpt-sdk/plugin": "0.3.8",
610
"@apidevtools/swagger-parser": "^10.1.0",
711
"@bany/curl-to-json": "^1.2.8",
8-
"axios": "^1.13.5",
12+
"axios": "catalog:",
913
"cron-parser": "^4.9.0",
10-
"dayjs": "^1.11.7",
14+
"dayjs": "catalog:",
1115
"encoding": "^0.1.13",
12-
"js-yaml": "^4.1.1",
16+
"js-yaml": "catalog:",
1317
"jschardet": "3.1.1",
14-
"json5": "^2.2.3",
18+
"json5": "catalog:",
1519
"nanoid": "^5.1.3",
16-
"next": "15.5.12",
17-
"openai": "4.61.0",
20+
"next": "catalog:",
21+
"openai": "4.104.0",
1822
"openapi-types": "^12.1.3",
1923
"timezones-list": "^3.0.2",
20-
"lodash": "^4.17.23",
21-
"zod": "^4.1.12",
24+
"lodash": "catalog:",
25+
"zod": "catalog:",
2226
"zod-openapi": "^5.4.3"
2327
},
2428
"devDependencies": {
25-
"@types/lodash": "^4.14.191",
29+
"@types/lodash": "catalog:",
2630
"@types/js-yaml": "^4.0.9",
2731
"@types/node": "20.14.0"
2832
}

packages/global/tsconfig.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
{
22
"extends": "../../tsconfig.json",
3-
"compilerOptions": {
4-
"baseUrl": "."
5-
},
63
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"]
74
}

packages/service/core/ai/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export const parseLLMStreamResponse = () => {
9393
};
9494
finish_reason?: CompletionFinishReason;
9595
}[];
96-
usage?: CompletionUsage;
96+
usage?: CompletionUsage | null;
9797
};
9898
parseThinkTag?: boolean;
9999
retainDatasetCite?: boolean;

packages/service/package.json

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,17 @@
22
"name": "@fastgpt/service",
33
"version": "1.0.0",
44
"type": "module",
5+
"engines": {
6+
"node": "20.x",
7+
"pnpm": "9.x"
8+
},
59
"dependencies": {
6-
"@fastgpt-sdk/storage": "^0.6.15",
10+
"@fastgpt-sdk/storage": "catalog:",
711
"@fastgpt/global": "workspace:*",
812
"@logtape/logtape": "^2",
913
"@logtape/pretty": "^2",
1014
"@maxmind/geoip2-node": "^6.3.4",
11-
"@modelcontextprotocol/sdk": "^1.26.0",
15+
"@modelcontextprotocol/sdk": "catalog:",
1216
"@node-rs/jieba": "2.0.1",
1317
"@opentelemetry/api": "^1.9.0",
1418
"@opentelemetry/api-logs": "^0.203.0",
@@ -19,16 +23,15 @@
1923
"@opentelemetry/semantic-conventions": "^1.39.0",
2024
"@opentelemetry/winston-transport": "^0.14.0",
2125
"@t3-oss/env-core": "0.13.10",
22-
"@vercel/otel": "^1.13.0",
2326
"@xmldom/xmldom": "^0.8.10",
2427
"@zilliz/milvus2-sdk-node": "2.4.10",
25-
"axios": "^1.13.5",
28+
"axios": "catalog:",
2629
"bullmq": "^5.52.2",
2730
"chalk": "^5.3.0",
2831
"cheerio": "1.0.0-rc.12",
2932
"cookie": "^0.7.1",
30-
"date-fns": "2.30.0",
31-
"dayjs": "^1.11.7",
33+
"date-fns": "catalog:",
34+
"dayjs": "catalog:",
3235
"decompress": "^4.2.1",
3336
"domino-ext": "^2.1.4",
3437
"encoding": "^0.1.13",
@@ -40,18 +43,18 @@
4043
"ioredis": "^5.6.0",
4144
"joplin-turndown-plugin-gfm": "^1.0.12",
4245
"@apidevtools/json-schema-ref-parser": "^11.7.2",
43-
"json5": "^2.2.3",
46+
"json5": "catalog:",
4447
"jsonpath-plus": "^10.3.0",
4548
"jsonwebtoken": "^9.0.2",
46-
"lodash": "^4.17.23",
49+
"lodash": "catalog:",
4750
"mammoth": "^1.11.0",
4851
"mime": "^4.1.0",
49-
"minio": "^8.0.5",
52+
"minio": "catalog:",
5053
"mongoose": "^8.10.1",
5154
"multer": "2.1.0",
5255
"mysql2": "^3.11.3",
53-
"next": "15.5.12",
54-
"nextjs-cors": "^2.2.0",
56+
"next": "catalog:",
57+
"nextjs-cors": "2.2.1",
5558
"node-cron": "^3.0.3",
5659
"node-xlsx": "^0.24.0",
5760
"p-limit": "^7.2.0",
@@ -60,22 +63,22 @@
6063
"pg": "^8.10.0",
6164
"pino": "^9.7.0",
6265
"pino-opentelemetry-transport": "^1.0.1",
63-
"proxy-agent": "^6.5.0",
66+
"proxy-agent": "catalog:",
6467
"proxy-from-env": "^1.1.0",
6568
"request-ip": "^3.3.0",
6669
"tiktoken": "1.0.17",
6770
"tunnel": "^0.0.6",
6871
"turndown": "^7.1.2",
6972
"undici": "^7.18.2",
7073
"winston": "^3.17.0",
71-
"zod": "^4.1.12"
74+
"zod": "catalog:"
7275
},
7376
"devDependencies": {
7477
"@types/async-retry": "^1.4.9",
7578
"@types/cookie": "^0.5.2",
7679
"@types/decompress": "^4.2.7",
7780
"@types/jsonwebtoken": "^9.0.3",
78-
"@types/lodash": "^4.14.191",
81+
"@types/lodash": "catalog:",
7982
"@types/multer": "^1.4.10",
8083
"@types/node-cron": "^3.0.11",
8184
"@types/papaparse": "5.3.7",

packages/service/tsconfig.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"extends": "../../tsconfig.json",
33
"compilerOptions": {
4-
"baseUrl": ".",
54
"moduleResolution": "bundler"
65
},
76
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"]

packages/web/components/common/DateRangePicker/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Box, Card, Flex, useTheme, useOutsideClick, Button } from '@chakra-ui/r
44
import { addDays, format } from 'date-fns';
55
import { DayPicker } from 'react-day-picker';
66
import 'react-day-picker/dist/style.css';
7-
import zhCN from 'date-fns/locale/zh-CN';
7+
import { zhCN } from 'date-fns/locale/zh-CN';
88
import { useTranslation } from 'next-i18next';
99
import MyIcon from '../Icon';
1010

0 commit comments

Comments
 (0)