diff --git a/bundle/package-lock.json b/bundle/package-lock.json
index 944570ed..0092e0d5 100644
--- a/bundle/package-lock.json
+++ b/bundle/package-lock.json
@@ -17,7 +17,8 @@
"async-exit-hook": "^2.0.1",
"express": "^4.17.1",
"missing-native-js-functions": "^1.2.15",
- "node-os-utils": "^1.3.5"
+ "node-os-utils": "^1.3.5",
+ "tsconfig-paths": "^3.11.0"
},
"devDependencies": {
"@types/amqplib": "^0.8.1",
@@ -73,6 +74,7 @@
"node-fetch": "^2.6.1",
"patch-package": "^6.4.7",
"supertest": "^6.1.6",
+ "tsconfig-paths": "^3.11.0",
"typeorm": "^0.2.37"
},
"devDependencies": {
@@ -158,6 +160,7 @@
"missing-native-js-functions": "^1.2.15",
"mongoose-autopopulate": "^0.12.3",
"node-fetch": "^2.6.1",
+ "typeorm": "^0.2.37",
"uuid": "^8.3.2",
"ws": "^7.4.2"
},
@@ -194,6 +197,7 @@
"pg": "^8.7.1",
"reflect-metadata": "^0.1.13",
"sqlite3": "^5.0.2",
+ "tsconfig-paths": "^3.11.0",
"typeorm": "^0.2.37",
"typescript": "^4.4.2",
"typescript-json-schema": "^0.50.1"
@@ -326,6 +330,11 @@
"i18next": ">=17.0.11"
}
},
+ "node_modules/@types/json5": {
+ "version": "0.0.29",
+ "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz",
+ "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4="
+ },
"node_modules/@types/jsonwebtoken": {
"version": "8.5.4",
"resolved": "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-8.5.4.tgz",
@@ -795,6 +804,17 @@
"url": "https://github.com/sponsors/ljharb"
}
},
+ "node_modules/json5": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz",
+ "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==",
+ "dependencies": {
+ "minimist": "^1.2.0"
+ },
+ "bin": {
+ "json5": "lib/cli.js"
+ }
+ },
"node_modules/media-typer": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
@@ -846,6 +866,11 @@
"node": ">= 0.6"
}
},
+ "node_modules/minimist": {
+ "version": "1.2.5",
+ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
+ "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw=="
+ },
"node_modules/missing-native-js-functions": {
"version": "1.2.15",
"resolved": "https://registry.npmjs.org/missing-native-js-functions/-/missing-native-js-functions-1.2.15.tgz",
@@ -1025,6 +1050,14 @@
"node": ">= 0.6"
}
},
+ "node_modules/strip-bom": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz",
+ "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=",
+ "engines": {
+ "node": ">=4"
+ }
+ },
"node_modules/toidentifier": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz",
@@ -1033,6 +1066,17 @@
"node": ">=0.6"
}
},
+ "node_modules/tsconfig-paths": {
+ "version": "3.11.0",
+ "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.11.0.tgz",
+ "integrity": "sha512-7ecdYDnIdmv639mmDwslG6KQg1Z9STTz1j7Gcz0xa+nshh/gKDAHcPxRbWOsA3SPp0tXP2leTcY9Kw+NAkfZzA==",
+ "dependencies": {
+ "@types/json5": "^0.0.29",
+ "json5": "^1.0.1",
+ "minimist": "^1.2.0",
+ "strip-bom": "^3.0.0"
+ }
+ },
"node_modules/type-is": {
"version": "1.6.18",
"resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz",
@@ -1145,6 +1189,7 @@
"supertest": "^6.1.6",
"ts-node": "^9.1.1",
"ts-node-dev": "^1.1.6",
+ "tsconfig-paths": "^3.11.0",
"typeorm": "^0.2.37",
"typescript": "^4.4.2",
"typescript-json-schema": "^0.50.1"
@@ -1211,6 +1256,7 @@
"mongoose-autopopulate": "^0.12.3",
"node-fetch": "^2.6.1",
"ts-node-dev": "^1.1.6",
+ "typeorm": "^0.2.37",
"typescript": "^4.2.3",
"uuid": "^8.3.2",
"ws": "^7.4.2"
@@ -1238,6 +1284,7 @@
"pg": "^8.7.1",
"reflect-metadata": "^0.1.13",
"sqlite3": "^5.0.2",
+ "tsconfig-paths": "^3.11.0",
"typeorm": "^0.2.37",
"typescript": "^4.4.2",
"typescript-json-schema": "^0.50.1"
@@ -1334,6 +1381,11 @@
"i18next": ">=17.0.11"
}
},
+ "@types/json5": {
+ "version": "0.0.29",
+ "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz",
+ "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4="
+ },
"@types/jsonwebtoken": {
"version": "8.5.4",
"resolved": "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-8.5.4.tgz",
@@ -1731,6 +1783,14 @@
"has": "^1.0.3"
}
},
+ "json5": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz",
+ "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==",
+ "requires": {
+ "minimist": "^1.2.0"
+ }
+ },
"media-typer": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
@@ -1764,6 +1824,11 @@
"mime-db": "1.49.0"
}
},
+ "minimist": {
+ "version": "1.2.5",
+ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
+ "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw=="
+ },
"missing-native-js-functions": {
"version": "1.2.15",
"resolved": "https://registry.npmjs.org/missing-native-js-functions/-/missing-native-js-functions-1.2.15.tgz",
@@ -1912,11 +1977,27 @@
"resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz",
"integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow="
},
+ "strip-bom": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz",
+ "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM="
+ },
"toidentifier": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz",
"integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw=="
},
+ "tsconfig-paths": {
+ "version": "3.11.0",
+ "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.11.0.tgz",
+ "integrity": "sha512-7ecdYDnIdmv639mmDwslG6KQg1Z9STTz1j7Gcz0xa+nshh/gKDAHcPxRbWOsA3SPp0tXP2leTcY9Kw+NAkfZzA==",
+ "requires": {
+ "@types/json5": "^0.0.29",
+ "json5": "^1.0.1",
+ "minimist": "^1.2.0",
+ "strip-bom": "^3.0.0"
+ }
+ },
"type-is": {
"version": "1.6.18",
"resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz",
diff --git a/bundle/package.json b/bundle/package.json
index a326a131..996ab30b 100644
--- a/bundle/package.json
+++ b/bundle/package.json
@@ -11,7 +11,7 @@
"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",
+ "start": "npm run build && node -r ./tsconfig-paths-bootstrap.js dist/start.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
@@ -52,6 +52,7 @@
"async-exit-hook": "^2.0.1",
"express": "^4.17.1",
"missing-native-js-functions": "^1.2.15",
- "node-os-utils": "^1.3.5"
+ "node-os-utils": "^1.3.5",
+ "tsconfig-paths": "^3.11.0"
}
}
diff --git a/bundle/tsconfig-paths-bootstrap.js b/bundle/tsconfig-paths-bootstrap.js
new file mode 100644
index 00000000..efe4b3bc
--- /dev/null
+++ b/bundle/tsconfig-paths-bootstrap.js
@@ -0,0 +1,14 @@
+const tsConfigPaths = require("tsconfig-paths");
+const path = require("path");
+
+const cleanup = tsConfigPaths.register({
+ baseUrl: path.join(__dirname, "node_modules", "@fosscord"),
+ paths: {
+ "@fosscord/api": ["api/dist/index.js"],
+ "@fosscord/api/*": ["api/dist/*"],
+ "@fosscord/gateway": ["gateway/dist/index.js"],
+ "@fosscord/gateway/*": ["gateway/dist/*"],
+ "@fosscord/cdn": ["cdn/dist/index.js"],
+ "@fosscord/cdn/*": ["cdn/dist/*"],
+ },
+});
|