summary refs log tree commit diff
path: root/cdn
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
commit578cc8b4b616518eae2e4cd9ccabf1bdb4f29980 (patch)
tree34a8e61bdaaa1dbf4add51c4fc5869a60b11596a /cdn
parent:sparkles: generate test responses (diff)
downloadserver-578cc8b4b616518eae2e4cd9ccabf1bdb4f29980.tar.xz
:art: use typescript plugin that converts to relative paths
Diffstat (limited to 'cdn')
-rw-r--r--cdn/package-lock.json179
-rw-r--r--cdn/package.json6
-rw-r--r--cdn/scripts/tsconfig-paths-bootstrap.js10
-rw-r--r--cdn/tsconfig.json3
4 files changed, 184 insertions, 14 deletions
diff --git a/cdn/package-lock.json b/cdn/package-lock.json
index 7a4edd89..8a70844c 100644
--- a/cdn/package-lock.json
+++ b/cdn/package-lock.json
@@ -44,10 +44,12 @@
 				"@types/multer": "^1.4.7",
 				"@types/node": "^14.17.0",
 				"@types/node-fetch": "^2.5.7",
-				"@types/uuid": "^8.3.0"
+				"@types/uuid": "^8.3.0",
+				"ts-patch": "^1.4.4"
 			}
 		},
 		"../util": {
+			"name": "@fosscord/util",
 			"version": "1.0.0",
 			"hasInstallScript": true,
 			"license": "GPLV3",
@@ -2685,6 +2687,32 @@
 				"url": "https://github.com/sponsors/isaacs"
 			}
 		},
+		"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/global-prefix/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/globals": {
 			"version": "11.12.0",
 			"resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz",
@@ -2941,6 +2969,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",
@@ -3812,6 +3855,15 @@
 			"resolved": "https://registry.npmjs.org/kareem/-/kareem-2.3.2.tgz",
 			"integrity": "sha512-STHz9P7X2L4Kwn72fA4rGyqyXdmrMSdxqHx9IXon/FXluXieaFA6KJ2upcHAHxQPQ0LeM/OjLrhFxifHewOALQ=="
 		},
+		"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/kleur": {
 			"version": "3.0.3",
 			"resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz",
@@ -4703,6 +4755,18 @@
 				"node": ">= 6"
 			}
 		},
+		"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/regexp-clone": {
 			"version": "1.0.0",
 			"resolved": "https://registry.npmjs.org/regexp-clone/-/regexp-clone-1.0.0.tgz",
@@ -4884,6 +4948,23 @@
 				"node": ">=8"
 			}
 		},
+		"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/side-channel": {
 			"version": "1.0.4",
 			"resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz",
@@ -5307,6 +5388,27 @@
 				"node": ">=8"
 			}
 		},
+		"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/tslib": {
 			"version": "2.3.1",
 			"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz",
@@ -7681,6 +7783,28 @@
 				"path-is-absolute": "^1.0.0"
 			}
 		},
+		"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"
+			},
+			"dependencies": {
+				"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"
+					}
+				}
+			}
+		},
 		"globals": {
 			"version": "11.12.0",
 			"resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz",
@@ -7853,6 +7977,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",
@@ -8515,6 +8651,12 @@
 			"resolved": "https://registry.npmjs.org/kareem/-/kareem-2.3.2.tgz",
 			"integrity": "sha512-STHz9P7X2L4Kwn72fA4rGyqyXdmrMSdxqHx9IXon/FXluXieaFA6KJ2upcHAHxQPQ0LeM/OjLrhFxifHewOALQ=="
 		},
+		"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
+		},
 		"kleur": {
 			"version": "3.0.3",
 			"resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz",
@@ -9146,6 +9288,15 @@
 				}
 			}
 		},
+		"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"
+			}
+		},
 		"regexp-clone": {
 			"version": "1.0.0",
 			"resolved": "https://registry.npmjs.org/regexp-clone/-/regexp-clone-1.0.0.tgz",
@@ -9284,6 +9435,17 @@
 			"resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz",
 			"integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A=="
 		},
+		"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"
+			}
+		},
 		"side-channel": {
 			"version": "1.0.4",
 			"resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz",
@@ -9596,6 +9758,21 @@
 				"punycode": "^2.1.1"
 			}
 		},
+		"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"
+			}
+		},
 		"tslib": {
 			"version": "2.3.1",
 			"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz",
diff --git a/cdn/package.json b/cdn/package.json
index 7c59381b..71211d67 100644
--- a/cdn/package.json
+++ b/cdn/package.json
@@ -5,9 +5,10 @@
 	"main": "dist/index.js",
 	"types": "dist/index.d.ts",
 	"scripts": {
+		"prepare": "ts-patch install -s",
 		"test": "npm run build && jest --coverage ./tests",
 		"build": "npx tsc -b .",
-		"start": "npm run build && node -r ./scripts/tsconfig-paths-bootstrap.js dist/start.js"
+		"start": "npm run build && node dist/start.js"
 	},
 	"repository": {
 		"type": "git",
@@ -34,7 +35,8 @@
 		"@types/multer": "^1.4.7",
 		"@types/node": "^14.17.0",
 		"@types/node-fetch": "^2.5.7",
-		"@types/uuid": "^8.3.0"
+		"@types/uuid": "^8.3.0",
+		"ts-patch": "^1.4.4"
 	},
 	"dependencies": {
 		"@fosscord/util": "file:../util",
diff --git a/cdn/scripts/tsconfig-paths-bootstrap.js b/cdn/scripts/tsconfig-paths-bootstrap.js
deleted file mode 100644
index 50602b02..00000000
--- a/cdn/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/cdn": ["dist/index.js"],
-		"@fosscord/cdn/*": ["dist/*"],
-	},
-});
diff --git a/cdn/tsconfig.json b/cdn/tsconfig.json
index 2daac1ad..f893869f 100644
--- a/cdn/tsconfig.json
+++ b/cdn/tsconfig.json
@@ -70,6 +70,7 @@
 		"paths": {
 			"@fosscord/cdn/": ["src/index.ts"],
 			"@fosscord/cdn/*": ["src/*"]
-		}
+		},
+		"plugins": [{ "transform": "@zerollup/ts-transform-paths" }]
 	}
 }