Skip to content

Commit

Permalink
chore: support nodejs version 22 (#545)
Browse files Browse the repository at this point in the history
  • Loading branch information
BobDu authored May 21, 2024
1 parent 6ecfbfc commit df84c4e
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 96 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
run: nci

- name: Lint
run: nr lint:fix
run: nr lint

typecheck:
runs-on: ubuntu-latest
Expand Down
8 changes: 4 additions & 4 deletions README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

> [!IMPORTANT]
> **This project is forked from [Chanzhaoyu/chatgpt-web](https://github.com/Chanzhaoyu/chatgpt-web)**
>
>
> 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)
>
>
> Thank you again, the great [Chanzhaoyu](https://github.com/Chanzhaoyu), for your contributions to the open-source project 🙏
Some unique features have been added:
Expand Down Expand Up @@ -140,7 +140,7 @@ For all parameter variables, check [here](#docker-parameter-example) or see:

### Node

`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).
`node` requires version `^16 || ^18 || ^20 || ^22`, and multiple local `node` versions can be managed using [nvm](https://github.com/nvm-sh/nvm).

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

## Auth Proxy Mode

> [!WARNING]
> [!WARNING]
> 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.

Set env `AUTH_PROXY_ENABLED=true` can enable auth proxy mode.
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

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

### Node

`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` 版本
`node` 需要 `^16 || ^18 || ^20 || ^22` 版本,使用 [nvm](https://github.com/nvm-sh/nvm) 可管理本地多个 `node` 版本

```shell
node -v
Expand Down Expand Up @@ -353,7 +353,7 @@ pnpm build

## Auth Proxy Mode

> [!WARNING]
> [!WARNING]
> 该功能仅适用于有相关经验的运维人员在集成企业内部账号管理系统时部署 配置不当可能会导致安全风险
设置环境变量 `AUTH_PROXY_ENABLED=true` 即可开启 auth proxy 模式
Expand Down
6 changes: 2 additions & 4 deletions service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"mongodb"
],
"engines": {
"node": "^16 || ^18 || ^20 || ^21"
"node": "^16 || ^18 || ^20 || ^22"
},
"scripts": {
"start": "tsx ./src/index.ts",
Expand All @@ -37,10 +37,9 @@
"file-type": "^19.0.0",
"gpt-token": "^0.0.5",
"https-proxy-agent": "^5.0.1",
"isomorphic-fetch": "^3.0.0",
"jsonwebtoken": "^9.0.0",
"jwt-decode": "^3.1.2",
"mongodb": "^5.9.2",
"mongodb": "^6.6.2",
"multer": "1.4.5-lts.1",
"node-fetch": "^3.3.0",
"nodemailer": "^6.9.13",
Expand All @@ -52,7 +51,6 @@
"devDependencies": {
"@antfu/eslint-config": "^0.43.1",
"@types/express": "^4.17.21",
"@types/isomorphic-fetch": "^0.0.39",
"@types/jsonwebtoken": "^9.0.5",
"@types/multer": "^1.4.11",
"@types/node": "^18.14.6",
Expand Down
115 changes: 33 additions & 82 deletions service/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion service/src/chatgpt/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as dotenv from 'dotenv'
import 'isomorphic-fetch'
import type { ChatGPTAPIOptions, ChatMessage, SendMessageOptions } from 'chatgpt'
import { ChatGPTAPI, ChatGPTUnofficialProxyAPI } from 'chatgpt'
import { SocksProxyAgent } from 'socks-proxy-agent'
Expand Down

0 comments on commit df84c4e

Please sign in to comment.