summary refs log tree commit diff
path: root/util
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-03-06 17:18:35 +1100
committerGitHub <noreply@github.com>2022-03-06 09:18:35 +0300
commit68f6fe58d5266af4a38e86ed2f817df3638f2323 (patch)
tree86563efad824bdae646b091456daa9e83bee84fb /util
parentdocument which field is which (diff)
downloadserver-68f6fe58d5266af4a38e86ed2f817df3638f2323.tar.xz
Tsnode support (#580)
* ts-node support. debugging is slightly wonky as vscode will not allow breakpoints in modules that aren't bundle, yet.

* apparently ts-node compilerOptions.path wasn't needed? on windows I could've sworn it was.

* Cleaned up tsconfig.json a bit ( moved tsnode config to own file ).
Fixed breakpoints for all modules under tsnode

* Removed Microsoft Corp advert
* Remove one more Microsoft Corp. ad

Signed-off-by: Erkin Alp Güney <erkinalp9035@gmail.com>

* Added `tsnode` npm script

* Added `typescript-cached-transpile` package to help improve performance

Co-authored-by: Erkin Alp Güney <erkinalp9035@gmail.com>
Diffstat (limited to 'util')
-rw-r--r--util/src/util/TraverseDirectory.ts5
1 files changed, 4 insertions, 1 deletions
diff --git a/util/src/util/TraverseDirectory.ts b/util/src/util/TraverseDirectory.ts

index 275b7dcc..3d0d6279 100644 --- a/util/src/util/TraverseDirectory.ts +++ b/util/src/util/TraverseDirectory.ts
@@ -1,6 +1,9 @@ import { Server, traverseDirectory } from "lambert-server"; -const DEFAULT_FILTER = /^([^\.].*)(?<!\.d)\.(js)$/; +//if we're using ts-node, use ts files instead of js +const extension = Symbol.for("ts-node.register.instance") in process ? "ts" : "js" + +const DEFAULT_FILTER = new RegExp("^([^\.].*)(?<!\.d)\.(" + extension + ")$"); export function registerRoutes(server: Server, root: string) { return traverseDirectory(