Skip to content

Commit d6a3776

Browse files
committedMar 28, 2023
perf: remove dayjs dependency
saves ~16KB bundle size
1 parent 271b4db commit d6a3776

File tree

5 files changed

+2
-19
lines changed

5 files changed

+2
-19
lines changed
 

Diff for: ‎package.json

-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
"@vitest/coverage-c8": "^0.29.8",
5151
"changelogen": "^0.5.2",
5252
"colorette": "^2.0.19",
53-
"dayjs": "^1.11.7",
5453
"eslint": "^8.36.0",
5554
"eslint-config-unjs": "^0.1.0",
5655
"figures": "^5.0.0",

Diff for: ‎pnpm-lock.yaml

-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: ‎src/reporters/basic.ts

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
import util from "node:util";
22
import { parseStack } from "../utils/error";
33
import { writeStream } from "../utils/stream";
4-
import { formatDate } from "../utils/date";
54

65
const DEFAULTS = {
7-
dateFormat: "HH:mm:ss",
86
formatOptions: {
97
date: true,
108
colors: false,
@@ -41,9 +39,7 @@ export default class BasicReporter {
4139
}
4240

4341
formatDate(date) {
44-
return this.options.formatOptions.date
45-
? formatDate(this.options.dateFormat, date)
46-
: "";
42+
return this.options.formatOptions.date ? date.toLocaleTimeString() : "";
4743
}
4844

4945
filterAndJoin(arr) {

Diff for: ‎src/reporters/fancy.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { TYPE_COLOR_MAP, LEVEL_COLOR_MAP } from "../utils/fancy";
66
import BasicReporter from "./basic";
77

88
const DEFAULTS = {
9-
secondaryColor: "grey",
9+
secondaryColor: "gray",
1010
formatOptions: {
1111
date: true,
1212
colors: true,

Diff for: ‎src/utils/date.ts

-5
This file was deleted.

0 commit comments

Comments
 (0)
Please sign in to comment.