have to stay commonjs for now

This commit is contained in:
Evert Prants 2023-08-02 19:57:23 +03:00
parent 0f31e22f88
commit 767b431022
Signed by: evert
GPG Key ID: 1688DA83D222D0B5
4 changed files with 10 additions and 18 deletions

14
package-lock.json generated
View File

@ -9,7 +9,6 @@
"version": "3.6.0", "version": "3.6.0",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"dateformat": "^5.0.3",
"fs-extra": "^11.1.1", "fs-extra": "^11.1.1",
"reflect-metadata": "^0.1.13", "reflect-metadata": "^0.1.13",
"semver": "^7.5.4", "semver": "^7.5.4",
@ -587,14 +586,6 @@
"node": ">= 8" "node": ">= 8"
} }
}, },
"node_modules/dateformat": {
"version": "5.0.3",
"resolved": "https://registry.npmjs.org/dateformat/-/dateformat-5.0.3.tgz",
"integrity": "sha512-Kvr6HmPXUMerlLcLF+Pwq3K7apHpYmGDVqrxcDasBg86UcKeTSNWbEzU8bwdXnxnR44FtMhJAxI4Bov6Y/KUfA==",
"engines": {
"node": ">=12.20"
}
},
"node_modules/debug": { "node_modules/debug": {
"version": "4.3.4", "version": "4.3.4",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
@ -2117,11 +2108,6 @@
"which": "^2.0.1" "which": "^2.0.1"
} }
}, },
"dateformat": {
"version": "5.0.3",
"resolved": "https://registry.npmjs.org/dateformat/-/dateformat-5.0.3.tgz",
"integrity": "sha512-Kvr6HmPXUMerlLcLF+Pwq3K7apHpYmGDVqrxcDasBg86UcKeTSNWbEzU8bwdXnxnR44FtMhJAxI4Bov6Y/KUfA=="
},
"debug": { "debug": {
"version": "4.3.4", "version": "4.3.4",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",

View File

@ -1,6 +1,6 @@
{ {
"name": "@squeebot/core", "name": "@squeebot/core",
"version": "3.6.0", "version": "3.6.0-1",
"description": "Squeebot v3 core for the execution environment", "description": "Squeebot v3 core for the execution environment",
"main": "lib/index.js", "main": "lib/index.js",
"types": "lib/index.d.ts", "types": "lib/index.d.ts",
@ -28,7 +28,6 @@
"typescript": "^5.1.6" "typescript": "^5.1.6"
}, },
"dependencies": { "dependencies": {
"dateformat": "^5.0.3",
"fs-extra": "^11.1.1", "fs-extra": "^11.1.1",
"reflect-metadata": "^0.1.13", "reflect-metadata": "^0.1.13",
"semver": "^7.5.4", "semver": "^7.5.4",

View File

@ -1,4 +1,3 @@
import dateFmt from 'dateformat';
import util from 'util'; import util from 'util';
type LogType = 'info' | 'debug' | 'warn' | 'error'; type LogType = 'info' | 'debug' | 'warn' | 'error';
@ -13,6 +12,12 @@ export class Logger {
public timestamp = 'dd/mm/yy HH:MM:ss' public timestamp = 'dd/mm/yy HH:MM:ss'
) {} ) {}
public dateFmt(date: Date) {
return date.toISOString()
.replace(/T/, ' ')
.replace(/\..+/, '');
}
/** /**
* Set node.js readline consideration * Set node.js readline consideration
* @param rl Readline instance * @param rl Readline instance
@ -38,7 +43,7 @@ export class Logger {
let cfunc = this.console[0]; let cfunc = this.console[0];
if (this.timestamp) { if (this.timestamp) {
message.push(`[${dateFmt(new Date(), this.timestamp)}]`); message.push(`[${this.dateFmt(new Date())}]`);
} }
switch (ltype) { switch (ltype) {

View File

@ -23,6 +23,8 @@
"downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
"moduleResolution": "Node",
/* Strict Type-Checking Options */ /* Strict Type-Checking Options */
"strict": true, /* Enable all strict type-checking options. */ "strict": true, /* Enable all strict type-checking options. */
// "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */