diff --git a/.yarn/cache/@types-multer-npm-1.4.11-a023fdbf13-3d80b2acdf.zip b/.yarn/cache/@types-multer-npm-1.4.11-a023fdbf13-3d80b2acdf.zip new file mode 100644 index 000000000..90339eb08 Binary files /dev/null and b/.yarn/cache/@types-multer-npm-1.4.11-a023fdbf13-3d80b2acdf.zip differ diff --git a/.yarn/cache/axios-npm-0.27.2-dbe3a48aea-38cb754046.zip b/.yarn/cache/axios-npm-0.27.2-dbe3a48aea-38cb754046.zip new file mode 100644 index 000000000..601f76987 Binary files /dev/null and b/.yarn/cache/axios-npm-0.27.2-dbe3a48aea-38cb754046.zip differ diff --git a/.yarn/cache/axios-npm-1.7.2-c89264f6f7-e457e2b0ab.zip b/.yarn/cache/axios-npm-1.7.2-c89264f6f7-e457e2b0ab.zip deleted file mode 100644 index 5d20f72e9..000000000 Binary files a/.yarn/cache/axios-npm-1.7.2-c89264f6f7-e457e2b0ab.zip and /dev/null differ diff --git a/.yarn/cache/busboy-npm-0.2.14-adb3ecd9ee-9df9fca6d9.zip b/.yarn/cache/busboy-npm-0.2.14-adb3ecd9ee-9df9fca6d9.zip deleted file mode 100644 index 5e49f0a6c..000000000 Binary files a/.yarn/cache/busboy-npm-0.2.14-adb3ecd9ee-9df9fca6d9.zip and /dev/null differ diff --git a/.yarn/cache/busboy-npm-1.6.0-ebb5cbb04b-32801e2c01.zip b/.yarn/cache/busboy-npm-1.6.0-ebb5cbb04b-32801e2c01.zip new file mode 100644 index 000000000..ef174b22d Binary files /dev/null and b/.yarn/cache/busboy-npm-1.6.0-ebb5cbb04b-32801e2c01.zip differ diff --git a/.yarn/cache/dicer-npm-0.2.5-bd0237602f-a6f0ce9ac5.zip b/.yarn/cache/dicer-npm-0.2.5-bd0237602f-a6f0ce9ac5.zip deleted file mode 100644 index 998b8917a..000000000 Binary files a/.yarn/cache/dicer-npm-0.2.5-bd0237602f-a6f0ce9ac5.zip and /dev/null differ diff --git a/.yarn/cache/multer-npm-1.4.4-741799ce7d-b5550d250a.zip b/.yarn/cache/multer-npm-1.4.5-lts.1-2b83a2d180-d6dfa78a6e.zip similarity index 74% rename from .yarn/cache/multer-npm-1.4.4-741799ce7d-b5550d250a.zip rename to .yarn/cache/multer-npm-1.4.5-lts.1-2b83a2d180-d6dfa78a6e.zip index 0f7bcedb0..af87d2f74 100644 Binary files a/.yarn/cache/multer-npm-1.4.4-741799ce7d-b5550d250a.zip and b/.yarn/cache/multer-npm-1.4.5-lts.1-2b83a2d180-d6dfa78a6e.zip differ diff --git a/.yarn/cache/proxy-from-env-npm-1.1.0-c13d07f26b-ed7fcc2ba0.zip b/.yarn/cache/proxy-from-env-npm-1.1.0-c13d07f26b-ed7fcc2ba0.zip deleted file mode 100644 index a58e6bf3e..000000000 Binary files a/.yarn/cache/proxy-from-env-npm-1.1.0-c13d07f26b-ed7fcc2ba0.zip and /dev/null differ diff --git a/.yarn/cache/readable-stream-npm-1.1.14-41e61d1768-17dfeae3e9.zip b/.yarn/cache/readable-stream-npm-1.1.14-41e61d1768-17dfeae3e9.zip deleted file mode 100644 index 48cedcd14..000000000 Binary files a/.yarn/cache/readable-stream-npm-1.1.14-41e61d1768-17dfeae3e9.zip and /dev/null differ diff --git a/.yarn/cache/streamsearch-npm-0.1.2-813180eb1c-d2db57cbfb.zip b/.yarn/cache/streamsearch-npm-0.1.2-813180eb1c-d2db57cbfb.zip deleted file mode 100644 index 2cc9408b5..000000000 Binary files a/.yarn/cache/streamsearch-npm-0.1.2-813180eb1c-d2db57cbfb.zip and /dev/null differ diff --git a/.yarn/cache/streamsearch-npm-1.1.0-fc3ad6536d-1cce16cea8.zip b/.yarn/cache/streamsearch-npm-1.1.0-fc3ad6536d-1cce16cea8.zip new file mode 100644 index 000000000..68383b403 Binary files /dev/null and b/.yarn/cache/streamsearch-npm-1.1.0-fc3ad6536d-1cce16cea8.zip differ diff --git a/.yarn/cache/string_decoder-npm-0.10.31-851f3f7302-fe00f8e303.zip b/.yarn/cache/string_decoder-npm-0.10.31-851f3f7302-fe00f8e303.zip deleted file mode 100644 index 52b4bfdba..000000000 Binary files a/.yarn/cache/string_decoder-npm-0.10.31-851f3f7302-fe00f8e303.zip and /dev/null differ diff --git a/Taskfile.yml b/Taskfile.yml index c7a02ce65..c0fc99ced 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -17,9 +17,11 @@ tasks: build:prod: cmds: + - rm -rf ./dist - yarn workspaces focus --all - yarn workspace web run build:prod - yarn workspace server run build:prod + - yarn run pkg dev:binary: dir: ./dist/binaries diff --git a/package.json b/package.json index 50ce3d459..8bb08e4ab 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ ], "scripts": { "prepare": "is-ci || husky install", - "pkg": "npx pkg . --no-bytecode --public-packages \"*\" --public" + "pkg": "npx @yao-pkg/pkg . --no-bytecode --public-packages \"*\" --public" }, "devDependencies": { "@trivago/prettier-plugin-sort-imports": "^4.3.0", diff --git a/server/package.json b/server/package.json index f7a6193b6..bfe2fd7d6 100644 --- a/server/package.json +++ b/server/package.json @@ -8,7 +8,7 @@ "watch": "nodemon", "inspect": "nodemon --exec \"node --require tsconfig-paths/register --require ts-node/register --inspect ./src/app.ts\"", "build": "tsc && tsc-alias", - "build:prod": "yarn tsup ./src/app.ts --out-dir ../dist/server --minify --target=esnext --clean --shims", + "build:prod": "yarn tsup ./src/app.ts --out-dir ../dist/server --minify --target=esnext --clean", "test": "ts-mocha --paths src/**/*.test.ts", "depcheck": "depcheck", "lint": "eslint . --ext .ts", @@ -23,7 +23,7 @@ "@koa/cors": "^5.0.0", "@koa/multer": "^3.0.2", "@koa/router": "^12.0.1", - "axios": "^1.7.2", + "axios": "^0.27.2", "bcryptjs": "2.4.3", "bluebird": "^3.7.2", "bson": "^6.7.0", @@ -45,7 +45,7 @@ "lodash": "^4.17.21", "mjml": "^4.15.3", "mongoose": "^8.4.1", - "multer": "^1.4.4", + "multer": "1.4.5-lts.1", "nanoid": "3.3.7", "nodemailer": "^6.9.13", "oxide.ts": "^1.1.0", @@ -79,6 +79,7 @@ "@types/lodash": "^4.17.5", "@types/mjml": "^4.7.4", "@types/mocha": "^10.0.6", + "@types/multer": "^1.4.11", "@types/node": "^20.14.2", "@types/nodemailer": "^6.4.15", "@typescript-eslint/eslint-plugin": "^7.12.0", diff --git a/server/src/app.ts b/server/src/app.ts index 30cec2c5d..39e9feb73 100644 --- a/server/src/app.ts +++ b/server/src/app.ts @@ -1,4 +1,5 @@ import cluster from 'cluster'; +import 'multer'; import 'reflect-metadata'; import { createKoaServer } from '@/api'; diff --git a/yarn.lock b/yarn.lock index f522d139c..355b8dca9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4890,6 +4890,15 @@ __metadata: languageName: node linkType: hard +"@types/multer@npm:^1.4.11": + version: 1.4.11 + resolution: "@types/multer@npm:1.4.11" + dependencies: + "@types/express": "*" + checksum: 3d80b2acdfbc9f3e9027d4467e948925810b67e5622a3017f42f58a3598d34b25376890801e55d0c03973ccc34573abf5218af334e8292ec455832f4ade3e5f5 + languageName: node + linkType: hard + "@types/node-forge@npm:^1.3.0": version: 1.3.11 resolution: "@types/node-forge@npm:1.3.11" @@ -6253,14 +6262,13 @@ __metadata: languageName: node linkType: hard -"axios@npm:^1.7.2": - version: 1.7.2 - resolution: "axios@npm:1.7.2" +"axios@npm:^0.27.2": + version: 0.27.2 + resolution: "axios@npm:0.27.2" dependencies: - follow-redirects: ^1.15.6 + follow-redirects: ^1.14.9 form-data: ^4.0.0 - proxy-from-env: ^1.1.0 - checksum: e457e2b0ab748504621f6fa6609074ac08c824bf0881592209dfa15098ece7e88495300e02cd22ba50b3468fd712fe687e629dcb03d6a3f6a51989727405aedf + checksum: 38cb7540465fe8c4102850c4368053c21683af85c5fdf0ea619f9628abbcb59415d1e22ebc8a6390d2bbc9b58a9806c874f139767389c862ec9b772235f06854 languageName: node linkType: hard @@ -6691,13 +6699,12 @@ __metadata: languageName: node linkType: hard -"busboy@npm:^0.2.11": - version: 0.2.14 - resolution: "busboy@npm:0.2.14" +"busboy@npm:^1.0.0": + version: 1.6.0 + resolution: "busboy@npm:1.6.0" dependencies: - dicer: 0.2.5 - readable-stream: 1.1.x - checksum: 9df9fca6d96dab9edd03f568bde31f215794e6fabd73c75d2b39a4be2e8b73a45121d987dea5db881f3fb499737c261b372106fe72d08b8db92afaed8d751165 + streamsearch: ^1.1.0 + checksum: 32801e2c0164e12106bf236291a00795c3c4e4b709ae02132883fe8478ba2ae23743b11c5735a0aae8afe65ac4b6ca4568b91f0d9fed1fdbc32ede824a73746e languageName: node linkType: hard @@ -8194,16 +8201,6 @@ __metadata: languageName: node linkType: hard -"dicer@npm:0.2.5": - version: 0.2.5 - resolution: "dicer@npm:0.2.5" - dependencies: - readable-stream: 1.1.x - streamsearch: 0.1.2 - checksum: a6f0ce9ac5099c7ffeaec7398d711eea1dd803eb99036d0f05342e9ed46a4235a5ed0ea01ad5d6c785fdb0aae6d61d2722e6e64f9fabdfe39885f7f52eb635ee - languageName: node - linkType: hard - "didyoumean@npm:^1.2.2": version: 1.2.2 resolution: "didyoumean@npm:1.2.2" @@ -9907,7 +9904,7 @@ __metadata: languageName: node linkType: hard -"follow-redirects@npm:^1.0.0, follow-redirects@npm:^1.15.6": +"follow-redirects@npm:^1.0.0, follow-redirects@npm:^1.14.9": version: 1.15.6 resolution: "follow-redirects@npm:1.15.6" peerDependenciesMeta: @@ -10965,7 +10962,7 @@ __metadata: languageName: node linkType: hard -"inherits@npm:2, inherits@npm:2.0.4, inherits@npm:^2.0.1, inherits@npm:^2.0.3, inherits@npm:~2.0.1, inherits@npm:~2.0.3": +"inherits@npm:2, inherits@npm:2.0.4, inherits@npm:^2.0.1, inherits@npm:^2.0.3, inherits@npm:~2.0.3": version: 2.0.4 resolution: "inherits@npm:2.0.4" checksum: 4a48a733847879d6cf6691860a6b1e3f0f4754176e4d71494c41f3475553768b10f84b5ce1d40fbd0e34e6bfbb864ee35858ad4dd2cf31e02fc4a154b724d7f1 @@ -13943,19 +13940,18 @@ __metadata: languageName: node linkType: hard -"multer@npm:^1.4.4": - version: 1.4.4 - resolution: "multer@npm:1.4.4" +"multer@npm:1.4.5-lts.1": + version: 1.4.5-lts.1 + resolution: "multer@npm:1.4.5-lts.1" dependencies: append-field: ^1.0.0 - busboy: ^0.2.11 + busboy: ^1.0.0 concat-stream: ^1.5.2 mkdirp: ^0.5.4 object-assign: ^4.1.1 - on-finished: ^2.3.0 type-is: ^1.6.4 xtend: ^4.0.0 - checksum: b5550d250aeee9c4d630eaecd133af0899239f6b10cec4b448ddd0a808025b383520b8227198a8612f60c2cd2094bcb60de93d973084f889d4e40efe6dbd641e + checksum: d6dfa78a6ec592b74890412f8962da8a87a3dcfe20f612e039b735b8e0faa72c735516c447f7de694ee0d981eb0a1b892fb9e2402a0348dc6091d18c38d89ecc languageName: node linkType: hard @@ -16002,13 +15998,6 @@ __metadata: languageName: node linkType: hard -"proxy-from-env@npm:^1.1.0": - version: 1.1.0 - resolution: "proxy-from-env@npm:1.1.0" - checksum: ed7fcc2ba0a33404958e34d95d18638249a68c430e30fcb6c478497d72739ba64ce9810a24f53a7d921d0c065e5b78e3822759800698167256b04659366ca4d4 - languageName: node - linkType: hard - "psl@npm:^1.1.33": version: 1.9.0 resolution: "psl@npm:1.9.0" @@ -16443,18 +16432,6 @@ __metadata: languageName: node linkType: hard -"readable-stream@npm:1.1.x": - version: 1.1.14 - resolution: "readable-stream@npm:1.1.14" - dependencies: - core-util-is: ~1.0.0 - inherits: ~2.0.1 - isarray: 0.0.1 - string_decoder: ~0.10.x - checksum: 17dfeae3e909945a4a1abc5613ea92d03269ef54c49288599507fc98ff4615988a1c39a999dcf9aacba70233d9b7040bc11a5f2bfc947e262dedcc0a8b32b5a0 - languageName: node - linkType: hard - "readable-stream@npm:3, readable-stream@npm:^3.0.0, readable-stream@npm:^3.0.6, readable-stream@npm:^3.1.1, readable-stream@npm:^3.6.0": version: 3.6.2 resolution: "readable-stream@npm:3.6.2" @@ -17364,12 +17341,13 @@ __metadata: "@types/lodash": ^4.17.5 "@types/mjml": ^4.7.4 "@types/mocha": ^10.0.6 + "@types/multer": ^1.4.11 "@types/node": ^20.14.2 "@types/nodemailer": ^6.4.15 "@typescript-eslint/eslint-plugin": ^7.12.0 "@typescript-eslint/parser": ^7.12.0 "@vercel/ncc": ^0.38.1 - axios: ^1.7.2 + axios: ^0.27.2 bcryptjs: 2.4.3 bluebird: ^3.7.2 bson: ^6.7.0 @@ -17400,7 +17378,7 @@ __metadata: mjml: ^4.15.3 mocha: ^10.4.0 mongoose: ^8.4.1 - multer: ^1.4.4 + multer: 1.4.5-lts.1 nanoid: 3.3.7 nodemailer: ^6.9.13 nodemon: ^3.1.3 @@ -17841,10 +17819,10 @@ __metadata: languageName: node linkType: hard -"streamsearch@npm:0.1.2": - version: 0.1.2 - resolution: "streamsearch@npm:0.1.2" - checksum: d2db57cbfbf7947ab9c75a7b4c80a8ef8d24850cf0a1a24258bb6956c97317ce1eab7dbcbf9c5aba3e6198611af1053b02411057bbedb99bf9c64b8275248997 +"streamsearch@npm:^1.1.0": + version: 1.1.0 + resolution: "streamsearch@npm:1.1.0" + checksum: 1cce16cea8405d7a233d32ca5e00a00169cc0e19fbc02aa839959985f267335d435c07f96e5e0edd0eadc6d39c98d5435fb5bbbdefc62c41834eadc5622ad942 languageName: node linkType: hard @@ -17960,13 +17938,6 @@ __metadata: languageName: node linkType: hard -"string_decoder@npm:~0.10.x": - version: 0.10.31 - resolution: "string_decoder@npm:0.10.31" - checksum: fe00f8e303647e5db919948ccb5ce0da7dea209ab54702894dd0c664edd98e5d4df4b80d6fabf7b9e92b237359d21136c95bf068b2f7760b772ca974ba970202 - languageName: node - linkType: hard - "string_decoder@npm:~1.1.1": version: 1.1.1 resolution: "string_decoder@npm:1.1.1"