From f2ea4055df0e32507fa05032f1f7da43dfc3631a Mon Sep 17 00:00:00 2001 From: Marvin Hagemeister Date: Thu, 13 Jul 2023 00:56:36 +0200 Subject: [PATCH] fix: init banner not colored in ansi256 terminals (#1456) This basically uses the same fix as #1377 and #1323 for the init script. Before: Screenshot 2023-07-12 at 22 18 29 After: Screenshot 2023-07-12 at 22 18 38 --- init.ts | 11 +++++++---- src/dev/deps.ts | 1 + src/server/deps.ts | 1 + src/server/mod.ts | 3 +-- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/init.ts b/init.ts index 420258a2..64db1ac5 100644 --- a/init.ts +++ b/init.ts @@ -1,4 +1,4 @@ -import { basename, join, parse, resolve } from "./src/dev/deps.ts"; +import { basename, colors, join, parse, resolve } from "./src/dev/deps.ts"; import { error } from "./src/dev/error.ts"; import { collect, ensureMinDenoVersion, generate } from "./src/dev/mod.ts"; import { @@ -42,11 +42,14 @@ const flags = parse(Deno.args, { default: { "force": null, "twind": null, "vscode": null }, }); +console.log(); console.log( - `\n%c 🍋 Fresh: the next-gen web framework. %c\n`, - "background-color: #86efac; color: black; font-weight: bold", - "", + colors.bgRgb8( + colors.black(colors.bold(" 🍋 Fresh: The next-gen web framework. ")), + 121, + ), ); +console.log(); let unresolvedDirectory = Deno.args[0]; if (flags._.length !== 1) { diff --git a/src/dev/deps.ts b/src/dev/deps.ts index 0cd60bba..39b7e0b2 100644 --- a/src/dev/deps.ts +++ b/src/dev/deps.ts @@ -11,6 +11,7 @@ export { SEP, toFileUrl, } from "https://deno.land/std@0.193.0/path/mod.ts"; +export * as colors from "https://deno.land/std@0.193.0/fmt/colors.ts"; export { walk, WalkError } from "https://deno.land/std@0.193.0/fs/walk.ts"; export { parse } from "https://deno.land/std@0.193.0/flags/mod.ts"; export { gte } from "https://deno.land/std@0.193.0/semver/mod.ts"; diff --git a/src/server/deps.ts b/src/server/deps.ts index 16c9ec2f..94eb5700 100644 --- a/src/server/deps.ts +++ b/src/server/deps.ts @@ -7,6 +7,7 @@ export { toFileUrl, } from "https://deno.land/std@0.193.0/path/mod.ts"; export { walk } from "https://deno.land/std@0.193.0/fs/walk.ts"; +export * as colors from "https://deno.land/std@0.193.0/fmt/colors.ts"; export { type Handler as ServeHandler, serve, diff --git a/src/server/mod.ts b/src/server/mod.ts index f7a43c10..108614c0 100644 --- a/src/server/mod.ts +++ b/src/server/mod.ts @@ -1,7 +1,6 @@ import { ServerContext } from "./context.ts"; -import * as colors from "https://deno.land/std@0.193.0/fmt/colors.ts"; export { Status } from "./deps.ts"; -import { serve } from "./deps.ts"; +import { colors, serve } from "./deps.ts"; import { AppModule, ErrorPageModule,