Skip to content

Commit

Permalink
fix(server): fixed dependencies not being found when packaged using pkg
Browse files Browse the repository at this point in the history
  • Loading branch information
ADRFranklin committed Jun 15, 2024
1 parent 81b3e52 commit c5f2312
Show file tree
Hide file tree
Showing 17 changed files with 41 additions and 66 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 2 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
7 changes: 4 additions & 3 deletions server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions server/src/app.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import cluster from 'cluster';
import 'multer';
import 'reflect-metadata';

import { createKoaServer } from '@/api';
Expand Down
95 changes: 33 additions & 62 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit c5f2312

Please sign in to comment.