summary refs log tree commit diff
path: root/gateway
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-09-18 01:50:20 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-09-18 01:50:20 +0200
commit1e331b7c9d74cc4a0c532ebe8562986547d388ca (patch)
tree640fb5851f68f4338abc7366858e53ccf9d5222e /gateway
parent:sparkles: generate test responses (diff)
downloadserver-1e331b7c9d74cc4a0c532ebe8562986547d388ca.tar.xz
:art: use typescript plugin that converts to relative paths
Diffstat (limited to 'gateway')
-rw-r--r--gateway/package-lock.json187
-rw-r--r--gateway/package.json4
-rw-r--r--gateway/scripts/tsconfig-paths-bootstrap.js10
-rw-r--r--gateway/tsconfig.json3
4 files changed, 192 insertions, 12 deletions
diff --git a/gateway/package-lock.json b/gateway/package-lock.json
index 40db319d..df97d858 100644
--- a/gateway/package-lock.json
+++ b/gateway/package-lock.json
@@ -33,10 +33,12 @@
 				"@types/uuid": "^8.3.0",
 				"@types/ws": "^7.4.0",
 				"ts-node-dev": "^1.1.6",
+				"ts-patch": "^1.4.4",
 				"typescript": "^4.2.3"
 			}
 		},
 		"../util": {
+			"name": "@fosscord/util",
 			"version": "1.0.0",
 			"hasInstallScript": true,
 			"license": "GPLV3",
@@ -982,6 +984,20 @@
 				"node": ">= 6"
 			}
 		},
+		"node_modules/global-prefix": {
+			"version": "3.0.0",
+			"resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-3.0.0.tgz",
+			"integrity": "sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg==",
+			"dev": true,
+			"dependencies": {
+				"ini": "^1.3.5",
+				"kind-of": "^6.0.2",
+				"which": "^1.3.1"
+			},
+			"engines": {
+				"node": ">=6"
+			}
+		},
 		"node_modules/has": {
 			"version": "1.0.3",
 			"resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
@@ -1096,6 +1112,21 @@
 			"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
 			"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4="
 		},
+		"node_modules/ini": {
+			"version": "1.3.8",
+			"resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz",
+			"integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==",
+			"dev": true
+		},
+		"node_modules/interpret": {
+			"version": "1.4.0",
+			"resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz",
+			"integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==",
+			"dev": true,
+			"engines": {
+				"node": ">= 0.10"
+			}
+		},
 		"node_modules/ipaddr.js": {
 			"version": "1.9.1",
 			"resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
@@ -1171,6 +1202,12 @@
 			"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
 			"integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8="
 		},
+		"node_modules/isexe": {
+			"version": "2.0.0",
+			"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
+			"integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=",
+			"dev": true
+		},
 		"node_modules/js-yaml": {
 			"version": "4.1.0",
 			"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
@@ -1238,6 +1275,15 @@
 			"integrity": "sha512-STHz9P7X2L4Kwn72fA4rGyqyXdmrMSdxqHx9IXon/FXluXieaFA6KJ2upcHAHxQPQ0LeM/OjLrhFxifHewOALQ==",
 			"peer": true
 		},
+		"node_modules/kind-of": {
+			"version": "6.0.3",
+			"resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz",
+			"integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==",
+			"dev": true,
+			"engines": {
+				"node": ">=0.10.0"
+			}
+		},
 		"node_modules/lambert-server": {
 			"version": "1.2.10",
 			"resolved": "https://registry.npmjs.org/lambert-server/-/lambert-server-1.2.10.tgz",
@@ -1772,6 +1818,18 @@
 				"node": ">=8.10.0"
 			}
 		},
+		"node_modules/rechoir": {
+			"version": "0.6.2",
+			"resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz",
+			"integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=",
+			"dev": true,
+			"dependencies": {
+				"resolve": "^1.1.6"
+			},
+			"engines": {
+				"node": ">= 0.10"
+			}
+		},
 		"node_modules/reflect-metadata": {
 			"version": "0.1.13",
 			"resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.13.tgz",
@@ -1938,6 +1996,23 @@
 				"sha.js": "bin.js"
 			}
 		},
+		"node_modules/shelljs": {
+			"version": "0.8.4",
+			"resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.4.tgz",
+			"integrity": "sha512-7gk3UZ9kOfPLIAbslLzyWeGiEqx9e3rxwZM0KE6EL8GlGwjym9Mrlx5/p33bWTu9YG6vcS4MBxYZDHYr5lr8BQ==",
+			"dev": true,
+			"dependencies": {
+				"glob": "^7.0.0",
+				"interpret": "^1.0.0",
+				"rechoir": "^0.6.2"
+			},
+			"bin": {
+				"shjs": "bin/shjs"
+			},
+			"engines": {
+				"node": ">=4"
+			}
+		},
 		"node_modules/sift": {
 			"version": "13.5.2",
 			"resolved": "https://registry.npmjs.org/sift/-/sift-13.5.2.tgz",
@@ -2153,6 +2228,27 @@
 				}
 			}
 		},
+		"node_modules/ts-patch": {
+			"version": "1.4.4",
+			"resolved": "https://registry.npmjs.org/ts-patch/-/ts-patch-1.4.4.tgz",
+			"integrity": "sha512-b0CxxrkrCGsD22gl5BtSFlXzyTFP2mbOVffxMOWRrwdSh37sM01wzxSY4wlbBiHHHAJICmaaDgESzJ8lKkVoZA==",
+			"dev": true,
+			"dependencies": {
+				"chalk": "^4.1.0",
+				"glob": "^7.1.7",
+				"global-prefix": "^3.0.0",
+				"minimist": "^1.2.5",
+				"resolve": "^1.20.0",
+				"shelljs": "^0.8.4",
+				"strip-ansi": "^6.0.0"
+			},
+			"bin": {
+				"ts-patch": "bin/cli.js"
+			},
+			"peerDependencies": {
+				"typescript": ">2.7.0"
+			}
+		},
 		"node_modules/tsconfig": {
 			"version": "7.0.0",
 			"resolved": "https://registry.npmjs.org/tsconfig/-/tsconfig-7.0.0.tgz",
@@ -2388,6 +2484,18 @@
 				"node": ">= 0.8"
 			}
 		},
+		"node_modules/which": {
+			"version": "1.3.1",
+			"resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
+			"integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
+			"dev": true,
+			"dependencies": {
+				"isexe": "^2.0.0"
+			},
+			"bin": {
+				"which": "bin/which"
+			}
+		},
 		"node_modules/wrap-ansi": {
 			"version": "7.0.0",
 			"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
@@ -3347,6 +3455,17 @@
 				"is-glob": "^4.0.1"
 			}
 		},
+		"global-prefix": {
+			"version": "3.0.0",
+			"resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-3.0.0.tgz",
+			"integrity": "sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg==",
+			"dev": true,
+			"requires": {
+				"ini": "^1.3.5",
+				"kind-of": "^6.0.2",
+				"which": "^1.3.1"
+			}
+		},
 		"has": {
 			"version": "1.0.3",
 			"resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
@@ -3425,6 +3544,18 @@
 			"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
 			"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4="
 		},
+		"ini": {
+			"version": "1.3.8",
+			"resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz",
+			"integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==",
+			"dev": true
+		},
+		"interpret": {
+			"version": "1.4.0",
+			"resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz",
+			"integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==",
+			"dev": true
+		},
 		"ipaddr.js": {
 			"version": "1.9.1",
 			"resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
@@ -3479,6 +3610,12 @@
 			"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
 			"integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8="
 		},
+		"isexe": {
+			"version": "2.0.0",
+			"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
+			"integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=",
+			"dev": true
+		},
 		"js-yaml": {
 			"version": "4.1.0",
 			"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
@@ -3541,6 +3678,12 @@
 			"integrity": "sha512-STHz9P7X2L4Kwn72fA4rGyqyXdmrMSdxqHx9IXon/FXluXieaFA6KJ2upcHAHxQPQ0LeM/OjLrhFxifHewOALQ==",
 			"peer": true
 		},
+		"kind-of": {
+			"version": "6.0.3",
+			"resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz",
+			"integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==",
+			"dev": true
+		},
 		"lambert-server": {
 			"version": "1.2.10",
 			"resolved": "https://registry.npmjs.org/lambert-server/-/lambert-server-1.2.10.tgz",
@@ -3957,6 +4100,15 @@
 				"picomatch": "^2.2.1"
 			}
 		},
+		"rechoir": {
+			"version": "0.6.2",
+			"resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz",
+			"integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=",
+			"dev": true,
+			"requires": {
+				"resolve": "^1.1.6"
+			}
+		},
 		"reflect-metadata": {
 			"version": "0.1.13",
 			"resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.13.tgz",
@@ -4084,6 +4236,17 @@
 				"safe-buffer": "^5.0.1"
 			}
 		},
+		"shelljs": {
+			"version": "0.8.4",
+			"resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.4.tgz",
+			"integrity": "sha512-7gk3UZ9kOfPLIAbslLzyWeGiEqx9e3rxwZM0KE6EL8GlGwjym9Mrlx5/p33bWTu9YG6vcS4MBxYZDHYr5lr8BQ==",
+			"dev": true,
+			"requires": {
+				"glob": "^7.0.0",
+				"interpret": "^1.0.0",
+				"rechoir": "^0.6.2"
+			}
+		},
 		"sift": {
 			"version": "13.5.2",
 			"resolved": "https://registry.npmjs.org/sift/-/sift-13.5.2.tgz",
@@ -4238,6 +4401,21 @@
 				"tsconfig": "^7.0.0"
 			}
 		},
+		"ts-patch": {
+			"version": "1.4.4",
+			"resolved": "https://registry.npmjs.org/ts-patch/-/ts-patch-1.4.4.tgz",
+			"integrity": "sha512-b0CxxrkrCGsD22gl5BtSFlXzyTFP2mbOVffxMOWRrwdSh37sM01wzxSY4wlbBiHHHAJICmaaDgESzJ8lKkVoZA==",
+			"dev": true,
+			"requires": {
+				"chalk": "^4.1.0",
+				"glob": "^7.1.7",
+				"global-prefix": "^3.0.0",
+				"minimist": "^1.2.5",
+				"resolve": "^1.20.0",
+				"shelljs": "^0.8.4",
+				"strip-ansi": "^6.0.0"
+			}
+		},
 		"tsconfig": {
 			"version": "7.0.0",
 			"resolved": "https://registry.npmjs.org/tsconfig/-/tsconfig-7.0.0.tgz",
@@ -4361,6 +4539,15 @@
 			"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
 			"integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw="
 		},
+		"which": {
+			"version": "1.3.1",
+			"resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
+			"integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
+			"dev": true,
+			"requires": {
+				"isexe": "^2.0.0"
+			}
+		},
 		"wrap-ansi": {
 			"version": "7.0.0",
 			"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
diff --git a/gateway/package.json b/gateway/package.json
index 6b9e27d6..f5e66a9a 100644
--- a/gateway/package.json
+++ b/gateway/package.json
@@ -4,8 +4,9 @@
 	"description": "",
 	"main": "dist/index.js",
 	"scripts": {
+		"prepare": "ts-patch install -s",
 		"test": "echo \"Error: no test specified\" && exit 1",
-		"start": "npm run build && node -r ./scripts/tsconfig-paths-bootstrap.js dist/start.js",
+		"start": "npm run build && node dist/start.js",
 		"build": "npx tsc -b .",
 		"dev": "tsnd --respawn src/start.ts"
 	},
@@ -23,6 +24,7 @@
 		"@types/uuid": "^8.3.0",
 		"@types/ws": "^7.4.0",
 		"ts-node-dev": "^1.1.6",
+		"ts-patch": "^1.4.4",
 		"typescript": "^4.2.3"
 	},
 	"dependencies": {
diff --git a/gateway/scripts/tsconfig-paths-bootstrap.js b/gateway/scripts/tsconfig-paths-bootstrap.js
deleted file mode 100644
index 7308523b..00000000
--- a/gateway/scripts/tsconfig-paths-bootstrap.js
+++ /dev/null
@@ -1,10 +0,0 @@
-const tsConfigPaths = require("tsconfig-paths");
-const path = require("path");
-
-const cleanup = tsConfigPaths.register({
-	baseUrl: path.join(__dirname, ".."),
-	paths: {
-		"@fosscord/gateway": ["dist/index.js"],
-		"@fosscord/gateway/*": ["dist/*"],
-	},
-});
diff --git a/gateway/tsconfig.json b/gateway/tsconfig.json
index 2530aa41..c50bd77a 100644
--- a/gateway/tsconfig.json
+++ b/gateway/tsconfig.json
@@ -72,6 +72,7 @@
 		"paths": {
 			"@fosscord/gateway/*": ["src/*"],
 			"@fosscord/util/*": ["../util/src/*"]
-		}
+		},
+		"plugins": [{ "transform": "@zerollup/ts-transform-paths" }]
 	}
 }