fix(cli): make bun the default language in absence of wmill defaultTs

This commit is contained in:
Ruben Fiszel
2024-05-20 23:09:38 +02:00
parent 27c1f112f8
commit afb3e53599
5 changed files with 7 additions and 7 deletions
+2 -2
View File
@@ -36,13 +36,13 @@ export async function readConfigFile(): Promise<SyncOptions> {
) 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 {};
}
+1 -1
View File
@@ -70,7 +70,7 @@ let command: any = new Command()
"wmill.yaml",
yamlStringify({
defaultTs: "bun",
includes: [],
includes: ["**"],
excludes: [],
codebases: [],
})
+1 -1
View File
@@ -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,
+2 -2
View File
@@ -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";
+1 -1
View File
@@ -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")) {