Skip to content

Commit

Permalink
chore(deps): replace import_map.json with deps.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
gabeidx authored and Gabe committed Apr 6, 2022
1 parent 2e55eac commit 4af4fef
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 20 deletions.
5 changes: 2 additions & 3 deletions cli.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { parse } from "flags/mod.ts";

import { flags } from "./deps.ts";
import { default as logger } from "./log/mod.ts";
import { type Command } from "./console/mod.ts";

Expand Down Expand Up @@ -37,7 +36,7 @@ if (import.meta.main) {
]);

const command = Deno.args[0] ?? "";
const args = parse(Deno.args.slice(1));
const args = flags.parse(Deno.args.slice(1));

if (commands.has(command)) {
try {
Expand Down
1 change: 0 additions & 1 deletion deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
]
}
},
"importMap": "import_map.json",
"lint": {
"files": {
"exclude": [
Expand Down
3 changes: 3 additions & 0 deletions deps.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export * as colors from "https://deno.land/std@0.133.0/fmt/colors.ts";
export * as asserts from "https://deno.land/std@0.133.0/testing/asserts.ts";
export * as flags from "https://deno.land/std@0.133.0/flags/mod.ts";
7 changes: 0 additions & 7 deletions import_map.json

This file was deleted.

8 changes: 5 additions & 3 deletions lock.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"https://deno.land/std@0.130.0/_util/assert.ts": "e94f2eb37cebd7f199952e242c77654e43333c1ac4c5c700e929ea3aa5489f74",
"https://deno.land/std@0.130.0/flags/mod.ts": "430cf2d1c26e00286373b2647ebdca637f7558505e88e9c108a4742cd184c916",
"https://deno.land/std@0.130.0/fmt/colors.ts": "30455035d6d728394781c10755351742dd731e3db6771b1843f9b9e490104d37"
"https://deno.land/std@0.133.0/_util/assert.ts": "e94f2eb37cebd7f199952e242c77654e43333c1ac4c5c700e929ea3aa5489f74",
"https://deno.land/std@0.133.0/flags/mod.ts": "9bd361fd5487f5e06cae4e0b5237a83c2908202f4a76944ba1312029f6c11b95",
"https://deno.land/std@0.133.0/fmt/colors.ts": "30455035d6d728394781c10755351742dd731e3db6771b1843f9b9e490104d37",
"https://deno.land/std@0.133.0/testing/_diff.ts": "9d849cd6877694152e01775b2d93f9d6b7aef7e24bfe3bfafc4d7a1ac8e9f392",
"https://deno.land/std@0.133.0/testing/asserts.ts": "b0ef969032882b1f7eb1c7571e313214baa1485f7b61cf35807b2434e254365c"
}
4 changes: 3 additions & 1 deletion log/handlers/console.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { assertEquals, assertStringIncludes } from "testing/asserts.ts";
import { asserts } from "../../deps.ts";
import { LogLevel } from "../level.ts";
import { LogMessage } from "../message.ts";
import { ConsoleHandler } from "./console.ts";

const { assertEquals, assertStringIncludes } = asserts;

class TestWriter implements Deno.WriterSync {
public buffer: Uint8Array = new Uint8Array();

Expand Down
2 changes: 1 addition & 1 deletion log/handlers/console.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as colors from "fmt/colors.ts";
import { colors } from "../../deps.ts";
import { LogHandler } from "../handler.ts";
import { LogMessage } from "../message.ts";
import { getLevelValue, LogLevel } from "../level.ts";
Expand Down
4 changes: 3 additions & 1 deletion log/level.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { assertEquals } from "testing/asserts.ts";
import { asserts } from "../deps.ts";
import { getLevelValue, LogLevel } from "./level.ts";

const { assertEquals } = asserts;

Deno.test("log level emergency", () => {
assertEquals(LogLevel.EMERGENCY, "emergency");
assertEquals(getLevelValue(LogLevel.EMERGENCY), 0);
Expand Down
6 changes: 4 additions & 2 deletions log/logger.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { assertEquals, assertStrictEquals } from "testing/asserts.ts";
import { asserts } from "../deps.ts";
import { LogHandler } from "./handler.ts";
import { LogLevel } from "./level.ts";
import { LogMessage } from "./message.ts";
import { Logger } from "./logger.ts";

const { assertEquals } = asserts;

class TestHandler extends LogHandler {
public messages: LogMessage[] = [];
public formatted: string[] = [];
Expand Down Expand Up @@ -60,7 +62,7 @@ Deno.test("accepts multiple handlers", () => {

logger.debug(`a single message`);

assertStrictEquals(
assertEquals(
(logger.handlers[0] as TestHandler).messages[0],
(logger.handlers[1] as TestHandler).messages[0],
);
Expand Down
4 changes: 3 additions & 1 deletion log/message.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { assertEquals } from "testing/asserts.ts";
import { asserts } from "../deps.ts";
import { LogLevel } from "./level.ts";
import { LogMessage } from "./message.ts";

const { assertEquals } = asserts;

Deno.test("log message", () => {
const message = new LogMessage(LogLevel.DEBUG, "Hello World!");
assertEquals(message.level, LogLevel.DEBUG);
Expand Down

0 comments on commit 4af4fef

Please sign in to comment.