Skip to content

Commit df84c4e

Browse files
authored
chore: support nodejs version 22 (#545)
1 parent 6ecfbfc commit df84c4e

File tree

6 files changed

+44
-96
lines changed

6 files changed

+44
-96
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
run: nci
2727

2828
- name: Lint
29-
run: nr lint:fix
29+
run: nr lint
3030

3131
typecheck:
3232
runs-on: ubuntu-latest

README.en.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77

88
> [!IMPORTANT]
99
> **This project is forked from [Chanzhaoyu/chatgpt-web](https://github.com/Chanzhaoyu/chatgpt-web)**
10-
>
10+
>
1111
> As the original project author does not agree to introduce a dependency on the database, this Hard Fork was created for independent development [discussion for details](https://github.com/Chanzhaoyu/chatgpt-web/pull/589#issuecomment-1469207694)
12-
>
12+
>
1313
> Thank you again, the great [Chanzhaoyu](https://github.com/Chanzhaoyu), for your contributions to the open-source project 🙏
1414
1515
Some unique features have been added:
@@ -140,7 +140,7 @@ For all parameter variables, check [here](#docker-parameter-example) or see:
140140

141141
### Node
142142

143-
`node` requires version `^16 || ^18` (`node >= 14` requires installation of [fetch polyfill](https://github.com/developit/unfetch#usage-as-a-polyfill)), and multiple local `node` versions can be managed using [nvm](https://github.com/nvm-sh/nvm).
143+
`node` requires version `^16 || ^18 || ^20 || ^22`, and multiple local `node` versions can be managed using [nvm](https://github.com/nvm-sh/nvm).
144144

145145
```shell
146146
node -v
@@ -356,7 +356,7 @@ A: There is a length limit for the content returned by the API each time. You ca
356356

357357
## Auth Proxy Mode
358358

359-
> [!WARNING]
359+
> [!WARNING]
360360
> This feature is only provided for Operations Engineer with relevant experience to deploy during the integration of the enterprise's internal account management system. Improper configuration may lead to security risks.
361361

362362
Set env `AUTH_PROXY_ENABLED=true` can enable auth proxy mode.

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77

88
> [!IMPORTANT]
99
> **此项目 Fork 自 [Chanzhaoyu/chatgpt-web](https://github.com/Chanzhaoyu/chatgpt-web)**
10-
>
10+
>
1111
> 由于原项目作者不愿意引入对数据库的依赖 故制作该永久分叉独立开发 [详见讨论](https://github.com/Chanzhaoyu/chatgpt-web/pull/589#issuecomment-1469207694)
12-
>
12+
>
1313
> 再次感谢 [Chanzhaoyu](https://github.com/Chanzhaoyu) 大佬对开源的贡献 🙏
1414
1515
新增了部分特色功能:
@@ -137,7 +137,7 @@
137137

138138
### Node
139139

140-
`node` 需要 `^16 || ^18 || ^19` 版本(`node >= 14` 需要安装 [fetch polyfill](https://github.com/developit/unfetch#usage-as-a-polyfill),使用 [nvm](https://github.com/nvm-sh/nvm) 可管理本地多个 `node` 版本
140+
`node` 需要 `^16 || ^18 || ^20 || ^22` 版本,使用 [nvm](https://github.com/nvm-sh/nvm) 可管理本地多个 `node` 版本
141141

142142
```shell
143143
node -v
@@ -353,7 +353,7 @@ pnpm build
353353

354354
## Auth Proxy Mode
355355

356-
> [!WARNING]
356+
> [!WARNING]
357357
> 该功能仅适用于有相关经验的运维人员在集成企业内部账号管理系统时部署 配置不当可能会导致安全风险
358358
359359
设置环境变量 `AUTH_PROXY_ENABLED=true` 即可开启 auth proxy 模式

service/package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"mongodb"
1414
],
1515
"engines": {
16-
"node": "^16 || ^18 || ^20 || ^21"
16+
"node": "^16 || ^18 || ^20 || ^22"
1717
},
1818
"scripts": {
1919
"start": "tsx ./src/index.ts",
@@ -37,10 +37,9 @@
3737
"file-type": "^19.0.0",
3838
"gpt-token": "^0.0.5",
3939
"https-proxy-agent": "^5.0.1",
40-
"isomorphic-fetch": "^3.0.0",
4140
"jsonwebtoken": "^9.0.0",
4241
"jwt-decode": "^3.1.2",
43-
"mongodb": "^5.9.2",
42+
"mongodb": "^6.6.2",
4443
"multer": "1.4.5-lts.1",
4544
"node-fetch": "^3.3.0",
4645
"nodemailer": "^6.9.13",
@@ -52,7 +51,6 @@
5251
"devDependencies": {
5352
"@antfu/eslint-config": "^0.43.1",
5453
"@types/express": "^4.17.21",
55-
"@types/isomorphic-fetch": "^0.0.39",
5654
"@types/jsonwebtoken": "^9.0.5",
5755
"@types/multer": "^1.4.11",
5856
"@types/node": "^18.14.6",

service/pnpm-lock.yaml

Lines changed: 33 additions & 82 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

service/src/chatgpt/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import * as dotenv from 'dotenv'
2-
import 'isomorphic-fetch'
32
import type { ChatGPTAPIOptions, ChatMessage, SendMessageOptions } from 'chatgpt'
43
import { ChatGPTAPI, ChatGPTUnofficialProxyAPI } from 'chatgpt'
54
import { SocksProxyAgent } from 'socks-proxy-agent'

0 commit comments

Comments
 (0)