feat(cli): make default typescript configurable

This commit is contained in:
Ruben Fiszel
2024-01-27 20:29:31 +01:00
parent 414ebee0f1
commit 59bbff662e
8 changed files with 69 additions and 58 deletions

View File

@@ -14,7 +14,8 @@ export type ScriptLanguage =
| "graphql";
export function inferContentTypeFromFilePath(
contentPath: string
contentPath: string,
defaultTs: "bun" | "deno" | undefined
): ScriptLanguage {
if (contentPath.endsWith(".py")) {
return "python3";
@@ -22,8 +23,10 @@ export function inferContentTypeFromFilePath(
return "nativets";
} else if (contentPath.endsWith("bun.ts")) {
return "bun";
} else if (contentPath.endsWith(".ts")) {
} else if (contentPath.endsWith("deno.ts")) {
return "deno";
} else if (contentPath.endsWith(".ts")) {
return defaultTs ?? "deno";
} else if (contentPath.endsWith(".go")) {
return "go";
} else if (contentPath.endsWith(".my.sql")) {