diff --git a/src/index.browser.ts b/src/index.browser.ts index 75149846..6e0b953e 100644 --- a/src/index.browser.ts +++ b/src/index.browser.ts @@ -1,4 +1,4 @@ -import BrowserReporter from "./reporters/browser"; +import { BrowserReporter } from "./reporters/browser"; import { createConsola as _createConsola } from "./consola"; import type { ConsolaOptions } from "./types"; diff --git a/src/index.ts b/src/index.ts index adfc0a1b..9a1bd826 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,7 +1,8 @@ import { isDebug, isTest, isCI } from "std-env"; import { LogLevels, LogLevel } from "./constants"; import type { ConsolaOptions } from "./types"; -import { BasicReporter, FancyReporter } from "./reporters"; +import { BasicReporter } from "./reporters/basic"; +import { FancyReporter } from "./reporters/fancy"; import { ConsolaInstance, createConsola as _createConsola } from "./consola"; export * from "./index.shared"; diff --git a/src/reporters/basic.ts b/src/reporters/basic.ts index cef753a5..515eeb47 100644 --- a/src/reporters/basic.ts +++ b/src/reporters/basic.ts @@ -10,7 +10,7 @@ import { writeStream } from "../utils/stream"; const bracket = (x: string) => (x ? `[${x}]` : ""); -export default class BasicReporter implements ConsolaReporter { +export class BasicReporter implements ConsolaReporter { formatStack(stack: string, opts: FormatOptions) { return " " + parseStack(stack).join("\n "); } diff --git a/src/reporters/browser.ts b/src/reporters/browser.ts index eccb9d10..362aad87 100644 --- a/src/reporters/browser.ts +++ b/src/reporters/browser.ts @@ -1,6 +1,6 @@ import { LogObject } from "../types"; -export default class BrowserReporter { +export class BrowserReporter { options: any; defaultColor: string; levelColorMap: Record; diff --git a/src/reporters/fancy.ts b/src/reporters/fancy.ts index 74e1e71d..c8eb64e9 100644 --- a/src/reporters/fancy.ts +++ b/src/reporters/fancy.ts @@ -4,7 +4,7 @@ import * as colors from "colorette"; import { parseStack } from "../utils/error"; import { FormatOptions, LogObject } from "../types"; import { LogLevel, LogType } from "../constants"; -import BasicReporter from "./basic"; +import { BasicReporter } from "./basic"; export const TYPE_COLOR_MAP: { [k in LogType]?: string } = { info: "cyan", @@ -35,7 +35,7 @@ const TYPE_ICONS: { [k in LogType]?: string } = { log: "", }; -export default class FancyReporter extends BasicReporter { +export class FancyReporter extends BasicReporter { formatStack(stack: string) { return ( "\n" + diff --git a/src/reporters/index.ts b/src/reporters/index.ts deleted file mode 100644 index 1687c398..00000000 --- a/src/reporters/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { default as BasicReporter } from "./basic"; -export { default as BrowserReporter } from "./browser"; -export { default as FancyReporter } from "./fancy";