From afb3e535993cb2df9b8ed29e5d88fc04311e0faa Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Mon, 20 May 2024 23:09:38 +0200 Subject: [PATCH] fix(cli): make bun the default language in absence of wmill defaultTs --- cli/conf.ts | 4 ++-- cli/main.ts | 2 +- cli/pull.ts | 2 +- cli/script.ts | 4 ++-- cli/script_common.ts | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cli/conf.ts b/cli/conf.ts index 4b6f248be4..0388e084ba 100644 --- a/cli/conf.ts +++ b/cli/conf.ts @@ -36,13 +36,13 @@ export async function readConfigFile(): Promise { ) as SyncOptions; if (conf?.defaultTs == undefined) { log.warning( - "No defaultTs defined in your wmill.yaml, using deno as default typescript language. Use 'wmill init' to bootstrap it." + "No defaultTs defined in your wmill.yaml. Using 'bun' as default." ); } return typeof conf == "object" ? conf : ({} as SyncOptions); } catch (e) { log.warning( - "No wmill.yaml found, using deno as default typescript language. Use 'wmill init' to bootstrap it." + "No wmill.yaml found. Use 'wmill init' to bootstrap it. Using 'bun' as default typescript runtime." ); return {}; } diff --git a/cli/main.ts b/cli/main.ts index 5b33e97e3f..48bc837b1c 100644 --- a/cli/main.ts +++ b/cli/main.ts @@ -70,7 +70,7 @@ let command: any = new Command() "wmill.yaml", yamlStringify({ defaultTs: "bun", - includes: [], + includes: ["**"], excludes: [], codebases: [], }) diff --git a/cli/pull.ts b/cli/pull.ts index 5dcd361952..62d17401eb 100644 --- a/cli/pull.ts +++ b/cli/pull.ts @@ -41,7 +41,7 @@ export async function downloadZip( }&include_users=${includeUsers ?? false}&include_groups=${ includeGroups ?? false }&include_settings=${includeSettings ?? false}&default_ts=${ - defaultTs ?? "deno" + defaultTs ?? "bun" }`, { headers: requestHeaders, diff --git a/cli/script.ts b/cli/script.ts index e8b29f8a2d..5e2c3b7e40 100644 --- a/cli/script.ts +++ b/cli/script.ts @@ -392,13 +392,13 @@ export function filePathExtensionFromContentType( } else if (language === "nativets") { return ".fetch.ts"; } else if (language === "bun") { - if (defaultTs == undefined || defaultTs == "deno") { + if (defaultTs == "deno") { return ".bun.ts"; } else { return ".ts"; } } else if (language === "deno") { - if (defaultTs == "bun") { + if (defaultTs == undefined || defaultTs == "bun") { return ".deno.ts"; } else { return ".ts"; diff --git a/cli/script_common.ts b/cli/script_common.ts index ea22aac18a..c9cf3a9107 100644 --- a/cli/script_common.ts +++ b/cli/script_common.ts @@ -27,7 +27,7 @@ export function inferContentTypeFromFilePath( } else if (contentPath.endsWith("deno.ts")) { return "deno"; } else if (contentPath.endsWith(".ts")) { - return defaultTs ?? "deno"; + return defaultTs ?? "bun"; } else if (contentPath.endsWith(".go")) { return "go"; } else if (contentPath.endsWith(".my.sql")) {