summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.ci/check_source_file_changes.ts2
-rw-r--r--colors/README.md31
-rw-r--r--examples/catj.ts2
-rw-r--r--examples/colors.ts2
-rw-r--r--fmt/colors.ts (renamed from colors/mod.ts)12
-rw-r--r--fmt/colors_test.ts (renamed from colors/test.ts)2
-rw-r--r--log/handlers.ts2
-rw-r--r--testing/asserts.ts2
-rw-r--r--testing/asserts_test.ts2
-rw-r--r--testing/mod.ts2
-rw-r--r--ws/README.md2
-rw-r--r--ws/example_client.ts2
12 files changed, 22 insertions, 41 deletions
diff --git a/.ci/check_source_file_changes.ts b/.ci/check_source_file_changes.ts
index e96a16b62..6aac5d645 100644
--- a/.ci/check_source_file_changes.ts
+++ b/.ci/check_source_file_changes.ts
@@ -1,6 +1,6 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
import { xrun } from "../prettier/util.ts";
-import { red, green } from "../colors/mod.ts";
+import { red, green } from "../fmt/colors.ts";
/**
* Checks whether any source file is changed since the given start time.
diff --git a/colors/README.md b/colors/README.md
deleted file mode 100644
index 7a02d9efb..000000000
--- a/colors/README.md
+++ /dev/null
@@ -1,31 +0,0 @@
-# colors
-
-Is a basic console color module intended for [Deno](https://deno.land/). It is
-inspired by [chalk](https://www.npmjs.com/package/chalk),
-[kleur](https://www.npmjs.com/package/kleur), and
-[colors](https://www.npmjs.com/package/colors) on npm.
-
-## Usage
-
-The main modules exports several functions which can color the output to the
-console:
-
-```ts
-import { bgBlue, red, bold } from "https://deno.land/std/colors/mod.ts";
-
-console.log(bgBlue(red(bold("Hello world!"))));
-```
-
-This module supports `NO_COLOR` environmental variable disabling any coloring if `NO_COLOR` is set.
-
-## TODO
-
-- Currently, it just assumes it is running in an environment that supports ANSI
- escape code terminal coloring. It should actually detect, specifically windows
- and adjust properly.
-
-- Test coverage is very basic at the moment.
-
----
-
-Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
diff --git a/examples/catj.ts b/examples/catj.ts
index 79a129780..cbe06d4b8 100644
--- a/examples/catj.ts
+++ b/examples/catj.ts
@@ -8,7 +8,7 @@
/* eslint-disable @typescript-eslint/no-use-before-define */
import { parse } from "../flags/mod.ts";
-import * as colors from "../colors/mod.ts";
+import * as colors from "../fmt/colors.ts";
const decoder = new TextDecoder();
diff --git a/examples/colors.ts b/examples/colors.ts
index 9468e8768..6f03355c6 100644
--- a/examples/colors.ts
+++ b/examples/colors.ts
@@ -1,4 +1,4 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
-import { bgBlue, red, bold, italic } from "../colors/mod.ts";
+import { bgBlue, red, bold, italic } from "../fmt/colors.ts";
console.log(bgBlue(italic(red(bold("Hello world!")))));
diff --git a/colors/mod.ts b/fmt/colors.ts
index d0b4bc320..52ba22487 100644
--- a/colors/mod.ts
+++ b/fmt/colors.ts
@@ -1,4 +1,16 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
+/**
+ * A module to print ANSI terminal colors. Inspired by chalk, kleur, and colors
+ * on npm.
+ *
+ * ```
+ * import { bgBlue, red, bold } from "https://deno.land/std/fmt/colors.ts";
+ * console.log(bgBlue(red(bold("Hello world!"))));
+ * ```
+ *
+ * This module supports `NO_COLOR` environmental variable disabling any coloring
+ * if `NO_COLOR` is set.
+ */
const { noColor } = Deno;
interface Code {
diff --git a/colors/test.ts b/fmt/colors_test.ts
index dec246fb0..949bc34e7 100644
--- a/colors/test.ts
+++ b/fmt/colors_test.ts
@@ -1,7 +1,7 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
import { test } from "../testing/mod.ts";
import { assertEquals } from "../testing/asserts.ts";
-import * as c from "./mod.ts";
+import * as c from "./colors.ts";
import "../examples/colors.ts";
test(function singleColor(): void {
diff --git a/log/handlers.ts b/log/handlers.ts
index 1f68e9794..5dfd0caa4 100644
--- a/log/handlers.ts
+++ b/log/handlers.ts
@@ -4,7 +4,7 @@ type File = Deno.File;
type Writer = Deno.Writer;
import { getLevelByName, LogLevel } from "./levels.ts";
import { LogRecord } from "./logger.ts";
-import { red, yellow, blue, bold } from "../colors/mod.ts";
+import { red, yellow, blue, bold } from "../fmt/colors.ts";
const DEFAULT_FORMATTER = "{levelName} {msg}";
type FormatterFunction = (logRecord: LogRecord) => string;
diff --git a/testing/asserts.ts b/testing/asserts.ts
index 56480c95b..adf77f3a7 100644
--- a/testing/asserts.ts
+++ b/testing/asserts.ts
@@ -1,5 +1,5 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
-import { red, green, white, gray, bold } from "../colors/mod.ts";
+import { red, green, white, gray, bold } from "../fmt/colors.ts";
import diff, { DiffType, DiffResult } from "./diff.ts";
import { format } from "./format.ts";
diff --git a/testing/asserts_test.ts b/testing/asserts_test.ts
index ba07b3a83..b480fe7c9 100644
--- a/testing/asserts_test.ts
+++ b/testing/asserts_test.ts
@@ -15,7 +15,7 @@ import {
unreachable
} from "./asserts.ts";
import { test } from "./mod.ts";
-import { red, green, white, gray, bold } from "../colors/mod.ts";
+import { red, green, white, gray, bold } from "../fmt/colors.ts";
test(function testingEqual(): void {
assert(equal("world", "world"));
diff --git a/testing/mod.ts b/testing/mod.ts
index b237a0d85..c68528fbd 100644
--- a/testing/mod.ts
+++ b/testing/mod.ts
@@ -9,7 +9,7 @@ import {
gray,
yellow,
italic
-} from "../colors/mod.ts";
+} from "../fmt/colors.ts";
export type TestFunction = () => void | Promise<void>;
export interface TestDefinition {
diff --git a/ws/README.md b/ws/README.md
index 3b44b6eea..fe5bae983 100644
--- a/ws/README.md
+++ b/ws/README.md
@@ -85,7 +85,7 @@ import {
import { encode } from "https://deno.land/std/strings/mod.ts";
import { BufReader } from "https://deno.land/std/io/bufio.ts";
import { TextProtoReader } from "https://deno.land/std/textproto/mod.ts";
-import { blue, green, red, yellow } from "https://deno.land/std/colors/mod.ts";
+import { blue, green, red, yellow } from "https://deno.land/std/fmt/colors.ts";
const endpoint = Deno.args[1] || "ws://127.0.0.1:8080";
async function main(): Promise<void> {
diff --git a/ws/example_client.ts b/ws/example_client.ts
index cdb482410..665c4cd8c 100644
--- a/ws/example_client.ts
+++ b/ws/example_client.ts
@@ -7,7 +7,7 @@ import {
import { encode } from "../strings/mod.ts";
import { BufReader } from "../io/bufio.ts";
import { TextProtoReader } from "../textproto/mod.ts";
-import { blue, green, red, yellow } from "../colors/mod.ts";
+import { blue, green, red, yellow } from "../fmt/colors.ts";
const endpoint = Deno.args[1] || "ws://127.0.0.1:8080";
/** simple websocket cli */