Skip to content

Commit 57bb579

Browse files
committedApr 11, 2023
refactor: use individual named exports of reporters
·
v3.4.2v3.0.2
1 parent 5a4708d commit 57bb579

File tree

6 files changed

+7
-9
lines changed

6 files changed

+7
-9
lines changed
 

‎src/index.browser.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import BrowserReporter from "./reporters/browser";
1+
import { BrowserReporter } from "./reporters/browser";
22
import { createConsola as _createConsola } from "./consola";
33
import type { ConsolaOptions } from "./types";
44

‎src/index.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { isDebug, isTest, isCI } from "std-env";
22
import { LogLevels, LogLevel } from "./constants";
33
import type { ConsolaOptions } from "./types";
4-
import { BasicReporter, FancyReporter } from "./reporters";
4+
import { BasicReporter } from "./reporters/basic";
5+
import { FancyReporter } from "./reporters/fancy";
56
import { ConsolaInstance, createConsola as _createConsola } from "./consola";
67

78
export * from "./index.shared";

‎src/reporters/basic.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { writeStream } from "../utils/stream";
1010

1111
const bracket = (x: string) => (x ? `[${x}]` : "");
1212

13-
export default class BasicReporter implements ConsolaReporter {
13+
export class BasicReporter implements ConsolaReporter {
1414
formatStack(stack: string, opts: FormatOptions) {
1515
return " " + parseStack(stack).join("\n ");
1616
}

‎src/reporters/browser.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { LogObject } from "../types";
22

3-
export default class BrowserReporter {
3+
export class BrowserReporter {
44
options: any;
55
defaultColor: string;
66
levelColorMap: Record<number, string>;

‎src/reporters/fancy.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import * as colors from "colorette";
44
import { parseStack } from "../utils/error";
55
import { FormatOptions, LogObject } from "../types";
66
import { LogLevel, LogType } from "../constants";
7-
import BasicReporter from "./basic";
7+
import { BasicReporter } from "./basic";
88

99
export const TYPE_COLOR_MAP: { [k in LogType]?: string } = {
1010
info: "cyan",
@@ -35,7 +35,7 @@ const TYPE_ICONS: { [k in LogType]?: string } = {
3535
log: "",
3636
};
3737

38-
export default class FancyReporter extends BasicReporter {
38+
export class FancyReporter extends BasicReporter {
3939
formatStack(stack: string) {
4040
return (
4141
"\n" +

‎src/reporters/index.ts‎

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)
Please sign in to comment.