Skip to content

Commit

Permalink
Merge pull request #404 from BobDu/memory-optimize
Browse files Browse the repository at this point in the history
perf: memory usage optimize
  • Loading branch information
Kerwin1202 authored Jan 9, 2024
2 parents f4c3d0c + 87eb9ea commit 1d644e7
Show file tree
Hide file tree
Showing 11 changed files with 1,203 additions and 1,450 deletions.
14 changes: 14 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
module.exports = {
root: true,
extends: ['@antfu'],
rules: {
'antfu/top-level-function': 'off',
'@typescript-eslint/consistent-type-imports': 'off',
'@stylistic/ts/member-delimiter-style': 'off',
'@stylistic/ts/indent': 'off',
'@stylistic/js/no-tabs': 'off',
'vue/no-unused-refs': 'off',
'import/newline-after-import': 'off',
'unicorn/prefer-number-properties': 'off',
},
ignorePatterns: [
'vite.config.ts',
'tsconfig.json',
],
}
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ COPY --from=backend /app/src/utils/templates /app/build/templates

EXPOSE 3002

CMD ["sh", "-c", "./replace-title.sh && pnpm run prod"]
CMD ["sh", "-c", "./replace-title.sh && node --import tsx/esm ./build/index.js"]
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"vue-router": "^4.1.6"
},
"devDependencies": {
"@antfu/eslint-config": "^0.35.3",
"@antfu/eslint-config": "^0.43.1",
"@commitlint/cli": "^17.4.4",
"@commitlint/config-conventional": "^17.4.4",
"@iconify/vue": "^4.1.0",
Expand All @@ -55,7 +55,7 @@
"autoprefixer": "^10.4.13",
"axios": "^1.3.4",
"crypto-js": "^4.1.1",
"eslint": "^8.35.0",
"eslint": "^8.56.0",
"husky": "^8.0.3",
"less": "^4.1.3",
"lint-staged": "^13.1.2",
Expand Down
855 changes: 535 additions & 320 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

11 changes: 9 additions & 2 deletions service/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
{
"root": true,
"ignorePatterns": ["build"],
"extends": ["@antfu"]
"ignorePatterns": ["build", "tsconfig.json"],
"extends": ["@antfu"],
"rules": {
"antfu/top-level-function": "off",
"n/prefer-global/process": "off",
"no-restricted-globals": "off",
"unicorn/prefer-node-protocol": "off",
"unicorn/prefer-number-properties": "off"
}
}
1 change: 1 addition & 0 deletions service/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ coverage
*.sw?

build
public
25 changes: 13 additions & 12 deletions service/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "chatgpt-web-service",
"type": "module",
"version": "1.0.0",
"private": false,
"description": "ChatGPT Web Service",
Expand All @@ -14,10 +15,11 @@
"node": "^16 || ^18 || ^20 || ^21"
},
"scripts": {
"start": "esno ./src/index.ts",
"dev": "esno watch ./src/index.ts",
"prod": "esno ./build/index.js",
"build": "pnpm clean && tsup",
"start": "tsx ./src/index.ts",
"dev": "tsx watch ./src/index.ts",
"prod": "node --import tsx/esm ./build/index.js",
"prod-node18": "node --loader tsx/esm ./build/index.js",
"build": "pnpm clean && tsc",
"clean": "rimraf build",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
Expand All @@ -28,28 +30,27 @@
"chatgpt": "^5.2.4",
"dayjs": "^1.11.7",
"dotenv": "^16.0.3",
"esno": "^0.16.3",
"express": "^4.18.2",
"express-rate-limit": "^6.7.0",
"gpt-token": "^0.0.5",
"https-proxy-agent": "^5.0.1",
"isomorphic-fetch": "^3.0.0",
"jwt-decode": "^3.1.2",
"jsonwebtoken": "^9.0.0",
"mongodb": "^5.9.2",
"node-fetch": "^3.3.0",
"nodemailer": "^6.9.1",
"request-ip": "^3.3.0",
"socks-proxy-agent": "^7.0.0"
"socks-proxy-agent": "^7.0.0",
"speakeasy": "^2.0.0",
"tsx": "^4.7.0"
},
"devDependencies": {
"@antfu/eslint-config": "^0.35.3",
"@antfu/eslint-config": "^0.43.1",
"@types/express": "^4.17.17",
"@types/node": "^18.14.6",
"eslint": "^8.35.0",
"jsonwebtoken": "^9.0.0",
"eslint": "^8.56.0",
"rimraf": "^4.3.0",
"speakeasy": "^2.0.0",
"tsup": "^6.6.3",
"typescript": "^4.9.5"
"typescript": "^5.3.3"
}
}
Loading

0 comments on commit 1d644e7

Please sign in to comment.