diff --git a/package-lock.json b/package-lock.json index a38a5e0..f4acea3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -32,13 +32,13 @@ "tail": "^1.2.3", "tar": "^7.5.22", "through2": "^2.0.3", - "time-stamp": "^1.1.0", "tmp-file": "^2.0.1", "unzip-stream": "^0.3.4", "vinyl": "^2.1.0", "vinyl-fs": "^3.0.2" }, "devDependencies": { + "@types/async": "^3.2.26", "@types/cli-progress": "^3.11.6", "@types/fs-extra": "^11.0.4", "@types/gulp": "^4.0.18", @@ -628,6 +628,13 @@ "url": "https://github.com/sindresorhus/is?sponsor=1" } }, + "node_modules/@types/async": { + "version": "3.2.26", + "resolved": "https://registry.npmjs.org/@types/async/-/async-3.2.26.tgz", + "integrity": "sha512-KqX2Cp6N7C0KEpExkHkDalNgx9ohk8oxjDM9ygtFTJr5BsHaiKWYjVnUQusGnc8A1jOoJuzldeazVRZuFYxjfw==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/cli-progress": { "version": "3.11.6", "resolved": "https://registry.npmjs.org/@types/cli-progress/-/cli-progress-3.11.6.tgz", diff --git a/package.json b/package.json index 0897af6..4d907c0 100755 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "scripts": { "build": "tsdown", "dev": "tsdown --watch", - "typecheck": "tsc --noEmit", + "lint": "tsc --noEmit", "test": "node --test" }, "repository": { @@ -52,13 +52,13 @@ "tail": "^1.2.3", "tar": "^7.5.22", "through2": "^2.0.3", - "time-stamp": "^1.1.0", "tmp-file": "^2.0.1", "unzip-stream": "^0.3.4", "vinyl": "^2.1.0", "vinyl-fs": "^3.0.2" }, "devDependencies": { + "@types/async": "^3.2.26", "@types/cli-progress": "^3.11.6", "@types/fs-extra": "^11.0.4", "@types/gulp": "^4.0.18", diff --git a/src/common/log.ts b/src/common/log.ts index 5ef175b..4d63a6c 100644 --- a/src/common/log.ts +++ b/src/common/log.ts @@ -1,5 +1,4 @@ import colors from "ansi-colors"; -import timestamp from "time-stamp"; const Level = { VERBOSE: -1, @@ -11,6 +10,8 @@ const Level = { const level = process.argv.indexOf("--verbose") > -1 ? Level.VERBOSE : Level.INFO; +const formatTime = (date: Date): string => date.toTimeString().split(" ")[0]; + export class Log { static level = level; @@ -28,7 +29,7 @@ export class Log { static write(level: number, tag: string, pattern: string, ...args: any) { if (level >= this.level) { - const message = `[${colors.gray(timestamp("HH:mm:ss"))}] ${colors.green(tag)} ${this.colorize(pattern)}`; + const message = `[${colors.gray(formatTime(new Date()))}] ${colors.green(tag)} ${this.colorize(pattern)}`; console.log(message, ...args); } }