summary refs log tree commit diff
path: root/bundle
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-08-13 20:53:29 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-08-13 20:53:29 +0200
commitb6fbcf1c4f6e75120518b9e3b947447cdb698654 (patch)
tree9205fb0054ba240bd012254ad9f0616ca3e5c8a9 /bundle
parent:bug: fix types + packages (diff)
downloadserver-b6fbcf1c4f6e75120518b9e3b947447cdb698654.tar.xz
:bug: fix dependencies and build for bundle
Diffstat (limited to 'bundle')
-rw-r--r--bundle/package-lock.json86
-rw-r--r--bundle/package.json17
-rw-r--r--bundle/src/Server.ts8
3 files changed, 45 insertions, 66 deletions
diff --git a/bundle/package-lock.json b/bundle/package-lock.json
index 5b389440..218c1a55 100644
--- a/bundle/package-lock.json
+++ b/bundle/package-lock.json
@@ -7,24 +7,21 @@
 		"": {
 			"name": "@fosscord/server",
 			"version": "1.0.0",
-			"hasInstallScript": true,
 			"license": "AGPLV3",
 			"dependencies": {
 				"@fosscord/api": "file:../api",
 				"@fosscord/cdn": "file:../cdn",
 				"@fosscord/gateway": "file:../gateway",
 				"@fosscord/util": "file:../util",
-				"async-exit-hook": "^2.0.1",
-				"express": "^4.17.1",
-				"link": "^0.1.5",
-				"mongodb-memory-server-global-4.4": "^7.3.6",
-				"node-os-utils": "^1.3.5"
-			},
-			"devDependencies": {
 				"@types/async-exit-hook": "^2.0.0",
 				"@types/express": "^4.17.13",
 				"@types/node": "^16.6.1",
 				"@types/node-os-utils": "^1.2.0",
+				"async-exit-hook": "^2.0.1",
+				"express": "^4.17.1",
+				"link": "^0.1.5",
+				"mongodb-memory-server-global-4.4": "^7.3.6",
+				"node-os-utils": "^1.3.5",
 				"typescript": "^4.3.5"
 			}
 		},
@@ -73,7 +70,7 @@
 				"@types/i18next-node-fs-backend": "^2.1.0",
 				"@types/jsonwebtoken": "^8.5.0",
 				"@types/multer": "^1.4.5",
-				"@types/node": "^14.14.22",
+				"@types/node": "^14.17.9",
 				"@types/node-fetch": "^2.5.7",
 				"@zerollup/ts-transform-paths": "^1.7.18",
 				"0x": "^4.10.2",
@@ -153,12 +150,9 @@
 		"../util": {
 			"name": "@fosscord/util",
 			"version": "1.3.55",
+			"hasInstallScript": true,
 			"license": "GPLV3",
 			"dependencies": {
-				"@types/jsonwebtoken": "^8.5.0",
-				"@types/mongoose-autopopulate": "^0.10.1",
-				"@types/mongoose-lean-virtuals": "^0.5.1",
-				"@types/node": "^14.14.25",
 				"ajv": "^8.5.0",
 				"amqplib": "^0.8.0",
 				"dot-prop": "^6.0.1",
@@ -167,11 +161,16 @@
 				"missing-native-js-functions": "^1.2.2",
 				"mongodb": "^3.6.9",
 				"mongoose": "^5.13.7",
-				"mongoose-autopopulate": "^0.12.3",
-				"typescript": "^4.1.3"
+				"mongoose-autopopulate": "^0.12.3"
 			},
 			"devDependencies": {
-				"@types/amqplib": "^0.8.1"
+				"@types/amqplib": "^0.8.1",
+				"@types/jsonwebtoken": "^8.5.0",
+				"@types/mongodb": "^3.6.9",
+				"@types/mongoose-autopopulate": "^0.10.1",
+				"@types/mongoose-lean-virtuals": "^0.5.1",
+				"@types/node": "^14.17.9",
+				"typescript": "^4.1.3"
 			}
 		},
 		"node_modules/@fosscord/api": {
@@ -193,14 +192,12 @@
 		"node_modules/@types/async-exit-hook": {
 			"version": "2.0.0",
 			"resolved": "https://registry.npmjs.org/@types/async-exit-hook/-/async-exit-hook-2.0.0.tgz",
-			"integrity": "sha512-RNjIyjnVZdcP5a1zeIPb5c0hq2nbJc/NOCLNKUAqeCw+J5z2zMcINISn9wybCWhczHnUu3VSUFy7ZCO6ir4ZRw==",
-			"dev": true
+			"integrity": "sha512-RNjIyjnVZdcP5a1zeIPb5c0hq2nbJc/NOCLNKUAqeCw+J5z2zMcINISn9wybCWhczHnUu3VSUFy7ZCO6ir4ZRw=="
 		},
 		"node_modules/@types/body-parser": {
 			"version": "1.19.1",
 			"resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.1.tgz",
 			"integrity": "sha512-a6bTJ21vFOGIkwM0kzh9Yr89ziVxq4vYH2fQ6N8AeipEzai/cFK6aGMArIkUeIdRIgpwQa+2bXiLuUJCpSf2Cg==",
-			"dev": true,
 			"dependencies": {
 				"@types/connect": "*",
 				"@types/node": "*"
@@ -210,7 +207,6 @@
 			"version": "3.4.35",
 			"resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz",
 			"integrity": "sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==",
-			"dev": true,
 			"dependencies": {
 				"@types/node": "*"
 			}
@@ -219,7 +215,6 @@
 			"version": "4.17.13",
 			"resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.13.tgz",
 			"integrity": "sha512-6bSZTPaTIACxn48l50SR+axgrqm6qXFIxrdAKaG6PaJk3+zuUr35hBlgT7vOmJcum+OEaIBLtHV/qloEAFITeA==",
-			"dev": true,
 			"dependencies": {
 				"@types/body-parser": "*",
 				"@types/express-serve-static-core": "^4.17.18",
@@ -231,7 +226,6 @@
 			"version": "4.17.24",
 			"resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.24.tgz",
 			"integrity": "sha512-3UJuW+Qxhzwjq3xhwXm2onQcFHn76frIYVbTu+kn24LFxI+dEhdfISDFovPB8VpEgW8oQCTpRuCe+0zJxB7NEA==",
-			"dev": true,
 			"dependencies": {
 				"@types/node": "*",
 				"@types/qs": "*",
@@ -241,38 +235,32 @@
 		"node_modules/@types/mime": {
 			"version": "1.3.2",
 			"resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.2.tgz",
-			"integrity": "sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw==",
-			"dev": true
+			"integrity": "sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw=="
 		},
 		"node_modules/@types/node": {
 			"version": "16.6.1",
 			"resolved": "https://registry.npmjs.org/@types/node/-/node-16.6.1.tgz",
-			"integrity": "sha512-Sr7BhXEAer9xyGuCN3Ek9eg9xPviCF2gfu9kTfuU2HkTVAMYSDeX40fvpmo72n5nansg3nsBjuQBrsS28r+NUw==",
-			"dev": true
+			"integrity": "sha512-Sr7BhXEAer9xyGuCN3Ek9eg9xPviCF2gfu9kTfuU2HkTVAMYSDeX40fvpmo72n5nansg3nsBjuQBrsS28r+NUw=="
 		},
 		"node_modules/@types/node-os-utils": {
 			"version": "1.2.0",
 			"resolved": "https://registry.npmjs.org/@types/node-os-utils/-/node-os-utils-1.2.0.tgz",
-			"integrity": "sha512-sstDo2s8gQR/Qh2Bd6yNQ5xJv+D4ttyB9ZVjB3mBm3VkGl2RoqjV7fiw9mIHLbshHSRm2m8uf0XrIRQNWB/z6A==",
-			"dev": true
+			"integrity": "sha512-sstDo2s8gQR/Qh2Bd6yNQ5xJv+D4ttyB9ZVjB3mBm3VkGl2RoqjV7fiw9mIHLbshHSRm2m8uf0XrIRQNWB/z6A=="
 		},
 		"node_modules/@types/qs": {
 			"version": "6.9.7",
 			"resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz",
-			"integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==",
-			"dev": true
+			"integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw=="
 		},
 		"node_modules/@types/range-parser": {
 			"version": "1.2.4",
 			"resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz",
-			"integrity": "sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==",
-			"dev": true
+			"integrity": "sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw=="
 		},
 		"node_modules/@types/serve-static": {
 			"version": "1.13.10",
 			"resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.13.10.tgz",
 			"integrity": "sha512-nCkHGI4w7ZgAdNkrEu0bv+4xNV/XDqW+DydknebMOQwkpDGx8G+HTlj7R7ABI8i8nKxVw0wtKPi1D+lPOkh4YQ==",
-			"dev": true,
 			"dependencies": {
 				"@types/mime": "^1",
 				"@types/node": "*"
@@ -1510,7 +1498,6 @@
 			"version": "4.3.5",
 			"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.3.5.tgz",
 			"integrity": "sha512-DqQgihaQ9cUrskJo9kIyW/+g0Vxsk8cDtZ52a3NGh0YNTfpUSArXSohyUGnvbPazEPLu398C0UxmKSOrPumUzA==",
-			"dev": true,
 			"bin": {
 				"tsc": "bin/tsc",
 				"tsserver": "bin/tsserver"
@@ -1589,7 +1576,7 @@
 				"@types/json-schema": "^7.0.7",
 				"@types/jsonwebtoken": "^8.5.0",
 				"@types/multer": "^1.4.5",
-				"@types/node": "^14.14.22",
+				"@types/node": "^14.17.9",
 				"@types/node-fetch": "^2.5.7",
 				"@zerollup/ts-transform-paths": "^1.7.18",
 				"0x": "^4.10.2",
@@ -1689,9 +1676,10 @@
 			"requires": {
 				"@types/amqplib": "^0.8.1",
 				"@types/jsonwebtoken": "^8.5.0",
+				"@types/mongodb": "^3.6.9",
 				"@types/mongoose-autopopulate": "^0.10.1",
 				"@types/mongoose-lean-virtuals": "^0.5.1",
-				"@types/node": "^14.14.25",
+				"@types/node": "^14.17.9",
 				"ajv": "^8.5.0",
 				"amqplib": "^0.8.0",
 				"dot-prop": "^6.0.1",
@@ -1707,14 +1695,12 @@
 		"@types/async-exit-hook": {
 			"version": "2.0.0",
 			"resolved": "https://registry.npmjs.org/@types/async-exit-hook/-/async-exit-hook-2.0.0.tgz",
-			"integrity": "sha512-RNjIyjnVZdcP5a1zeIPb5c0hq2nbJc/NOCLNKUAqeCw+J5z2zMcINISn9wybCWhczHnUu3VSUFy7ZCO6ir4ZRw==",
-			"dev": true
+			"integrity": "sha512-RNjIyjnVZdcP5a1zeIPb5c0hq2nbJc/NOCLNKUAqeCw+J5z2zMcINISn9wybCWhczHnUu3VSUFy7ZCO6ir4ZRw=="
 		},
 		"@types/body-parser": {
 			"version": "1.19.1",
 			"resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.1.tgz",
 			"integrity": "sha512-a6bTJ21vFOGIkwM0kzh9Yr89ziVxq4vYH2fQ6N8AeipEzai/cFK6aGMArIkUeIdRIgpwQa+2bXiLuUJCpSf2Cg==",
-			"dev": true,
 			"requires": {
 				"@types/connect": "*",
 				"@types/node": "*"
@@ -1724,7 +1710,6 @@
 			"version": "3.4.35",
 			"resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz",
 			"integrity": "sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==",
-			"dev": true,
 			"requires": {
 				"@types/node": "*"
 			}
@@ -1733,7 +1718,6 @@
 			"version": "4.17.13",
 			"resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.13.tgz",
 			"integrity": "sha512-6bSZTPaTIACxn48l50SR+axgrqm6qXFIxrdAKaG6PaJk3+zuUr35hBlgT7vOmJcum+OEaIBLtHV/qloEAFITeA==",
-			"dev": true,
 			"requires": {
 				"@types/body-parser": "*",
 				"@types/express-serve-static-core": "^4.17.18",
@@ -1745,7 +1729,6 @@
 			"version": "4.17.24",
 			"resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.24.tgz",
 			"integrity": "sha512-3UJuW+Qxhzwjq3xhwXm2onQcFHn76frIYVbTu+kn24LFxI+dEhdfISDFovPB8VpEgW8oQCTpRuCe+0zJxB7NEA==",
-			"dev": true,
 			"requires": {
 				"@types/node": "*",
 				"@types/qs": "*",
@@ -1755,38 +1738,32 @@
 		"@types/mime": {
 			"version": "1.3.2",
 			"resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.2.tgz",
-			"integrity": "sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw==",
-			"dev": true
+			"integrity": "sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw=="
 		},
 		"@types/node": {
 			"version": "16.6.1",
 			"resolved": "https://registry.npmjs.org/@types/node/-/node-16.6.1.tgz",
-			"integrity": "sha512-Sr7BhXEAer9xyGuCN3Ek9eg9xPviCF2gfu9kTfuU2HkTVAMYSDeX40fvpmo72n5nansg3nsBjuQBrsS28r+NUw==",
-			"dev": true
+			"integrity": "sha512-Sr7BhXEAer9xyGuCN3Ek9eg9xPviCF2gfu9kTfuU2HkTVAMYSDeX40fvpmo72n5nansg3nsBjuQBrsS28r+NUw=="
 		},
 		"@types/node-os-utils": {
 			"version": "1.2.0",
 			"resolved": "https://registry.npmjs.org/@types/node-os-utils/-/node-os-utils-1.2.0.tgz",
-			"integrity": "sha512-sstDo2s8gQR/Qh2Bd6yNQ5xJv+D4ttyB9ZVjB3mBm3VkGl2RoqjV7fiw9mIHLbshHSRm2m8uf0XrIRQNWB/z6A==",
-			"dev": true
+			"integrity": "sha512-sstDo2s8gQR/Qh2Bd6yNQ5xJv+D4ttyB9ZVjB3mBm3VkGl2RoqjV7fiw9mIHLbshHSRm2m8uf0XrIRQNWB/z6A=="
 		},
 		"@types/qs": {
 			"version": "6.9.7",
 			"resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz",
-			"integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==",
-			"dev": true
+			"integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw=="
 		},
 		"@types/range-parser": {
 			"version": "1.2.4",
 			"resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz",
-			"integrity": "sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==",
-			"dev": true
+			"integrity": "sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw=="
 		},
 		"@types/serve-static": {
 			"version": "1.13.10",
 			"resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.13.10.tgz",
 			"integrity": "sha512-nCkHGI4w7ZgAdNkrEu0bv+4xNV/XDqW+DydknebMOQwkpDGx8G+HTlj7R7ABI8i8nKxVw0wtKPi1D+lPOkh4YQ==",
-			"dev": true,
 			"requires": {
 				"@types/mime": "^1",
 				"@types/node": "*"
@@ -2693,8 +2670,7 @@
 		"typescript": {
 			"version": "4.3.5",
 			"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.3.5.tgz",
-			"integrity": "sha512-DqQgihaQ9cUrskJo9kIyW/+g0Vxsk8cDtZ52a3NGh0YNTfpUSArXSohyUGnvbPazEPLu398C0UxmKSOrPumUzA==",
-			"dev": true
+			"integrity": "sha512-DqQgihaQ9cUrskJo9kIyW/+g0Vxsk8cDtZ52a3NGh0YNTfpUSArXSohyUGnvbPazEPLu398C0UxmKSOrPumUzA=="
 		},
 		"unpipe": {
 			"version": "1.0.0",
diff --git a/bundle/package.json b/bundle/package.json
index a3478e03..56ef9591 100644
--- a/bundle/package.json
+++ b/bundle/package.json
@@ -4,9 +4,12 @@
 	"description": "",
 	"main": "src/start.js",
 	"scripts": {
-		"linkInstall": "npm run --prefix ../util/ link && npm run --prefix ../api/ link && npm run --prefix ../cdn/ link && npm run --prefix ../gateway/ link",
-		"postinstall": "npm run linkInstall && npm link @fosscord/util && npm link @fosscord/api && npm link @fosscord/gateway && npm link @fosscord/cdn",
-		"build": "tsc -b .",
+		"postinstall": "cd ../api/ && npm i && cd ../cdn/ && npm i && cd ../gateway/ && npm i && ",
+		"build": "npm run build:api && npm run build:cdn && npm run build:gateway && npm run build:bundle",
+		"build:bundle": "tsc -b .",
+		"build:api": "cd ../api/ && npm run build",
+		"build:cdn": "cd ../cdn/ && npm run build",
+		"build:gateway": "cd ../gateway/ && npm run build",
 		"start": "npm run build && node dist/start.js",
 		"test": "echo \"Error: no test specified\" && exit 1"
 	},
@@ -21,14 +24,12 @@
 		"url": "https://github.com/fosscord/fosscord-server/issues"
 	},
 	"homepage": "https://fosscord.com",
-	"devDependencies": {
+	"dependencies": {
 		"@types/async-exit-hook": "^2.0.0",
 		"@types/express": "^4.17.13",
-		"@types/node": "^16.6.1",
 		"@types/node-os-utils": "^1.2.0",
-		"typescript": "^4.3.5"
-	},
-	"dependencies": {
+		"typescript": "^4.3.5",
+		"@types/node": "^16.6.1",
 		"@fosscord/api": "file:../api",
 		"@fosscord/cdn": "file:../cdn",
 		"@fosscord/gateway": "file:../gateway",
diff --git a/bundle/src/Server.ts b/bundle/src/Server.ts
index 14abc128..19d9e168 100644
--- a/bundle/src/Server.ts
+++ b/bundle/src/Server.ts
@@ -22,12 +22,14 @@ const cdn = new CDNServer({ server, port, production, app });
 const gateway = new GatewayServer({ server, port, production });
 
 async function main() {
+	await Config.set({
+		cdn: { endpointClientKeepDefault: true, endpoint: `http://localhost:${port}` },
+		gateway: { endpointClientKeepDefault: true, endpoint: `ws://localhost:${port}` },
+	});
+
 	await api.start();
 	await cdn.start();
 	await gateway.start();
-
-	if (!Config.get().gateway.endpoint) await Config.set({ gateway: { endpoint: `ws://localhost:${port}` } });
-	if (!Config.get().cdn.endpoint) await Config.set({ cdn: { endpoint: `http://localhost:${port}` } });
 }
 
 main().catch(console.error);