@ctx-core/logger
Advanced tools
Comparing version 9.0.2 to 9.0.3
# @ctx-core/logger | ||
## 9.0.3 | ||
### Patch Changes | ||
- support cjs & esm: + "exports" | ||
## 9.0.2 | ||
@@ -4,0 +10,0 @@ |
@@ -1,21 +0,32 @@ | ||
import chalk from 'chalk'; | ||
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.chalk_error = exports.chalk_warn = exports.chalk_info = exports.chalk_log = exports.chalk_debug = void 0; | ||
const chalk_1 = __importDefault(require("chalk")); | ||
const use_chalk = !!(typeof window === 'undefined' && typeof require === 'function'); | ||
export function chalk_debug(...arg_a) { | ||
function chalk_debug(...arg_a) { | ||
return (console.debug || console.info).apply(console, debug_chalk_a_(...arg_a)); | ||
} | ||
export function chalk_log(...arg_a) { | ||
exports.chalk_debug = chalk_debug; | ||
function chalk_log(...arg_a) { | ||
return console.log.apply(console, log_chalk_a_(...arg_a)); | ||
} | ||
export function chalk_info(...arg_a) { | ||
exports.chalk_log = chalk_log; | ||
function chalk_info(...arg_a) { | ||
return console.info.apply(console, info_chalk_a_(...arg_a)); | ||
} | ||
export function chalk_warn(...arg_a) { | ||
exports.chalk_info = chalk_info; | ||
function chalk_warn(...arg_a) { | ||
return console.warn.apply(console, warn_chalk_a_(...arg_a)); | ||
} | ||
export function chalk_error(...arg_a) { | ||
exports.chalk_warn = chalk_warn; | ||
function chalk_error(...arg_a) { | ||
return console.error.apply(console, error_chalk_a_(...arg_a)); | ||
} | ||
exports.chalk_error = chalk_error; | ||
function debug_chalk_a_(...arg_a) { | ||
return (use_chalk | ||
? [chalk.white(...arg_a)] | ||
? [chalk_1.default.white(...arg_a)] | ||
: arg_a); | ||
@@ -25,3 +36,3 @@ } | ||
return (use_chalk | ||
? [chalk.grey(...arg_a)] | ||
? [chalk_1.default.grey(...arg_a)] | ||
: arg_a); | ||
@@ -31,3 +42,3 @@ } | ||
return (use_chalk | ||
? [chalk.green(...arg_a)] | ||
? [chalk_1.default.green(...arg_a)] | ||
: arg_a); | ||
@@ -37,3 +48,3 @@ } | ||
return (use_chalk | ||
? [chalk.red(...arg_a)] | ||
? [chalk_1.default.red(...arg_a)] | ||
: arg_a); | ||
@@ -43,5 +54,5 @@ } | ||
return (use_chalk | ||
? [chalk.red.bold(...arg_a)] | ||
? [chalk_1.default.red.bold(...arg_a)] | ||
: arg_a); | ||
} | ||
//# sourceMappingURL=../src/dist/chalk.js.map |
@@ -1,2 +0,5 @@ | ||
export function console_(fn, log_ctx) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports._console = exports.console_ = void 0; | ||
function console_(fn, log_ctx) { | ||
return (...arg_a) => { | ||
@@ -10,3 +13,4 @@ let key; | ||
} | ||
export { console_ as _console, }; | ||
exports.console_ = console_; | ||
exports._console = console_; | ||
//# sourceMappingURL=../src/dist/console_.js.map |
@@ -1,6 +0,10 @@ | ||
import { chalk_debug } from './chalk.js'; | ||
import { logger_timestamp_ } from './logger_timestamp_.js'; | ||
export function debug(...arg_a) { | ||
return chalk_debug(logger_timestamp_(), ...arg_a); | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.debug = void 0; | ||
const chalk_js_1 = require("./chalk.js"); | ||
const logger_timestamp__js_1 = require("./logger_timestamp_.js"); | ||
function debug(...arg_a) { | ||
return chalk_js_1.chalk_debug(logger_timestamp__js_1.logger_timestamp_(), ...arg_a); | ||
} | ||
exports.debug = debug; | ||
//# sourceMappingURL=../src/dist/debug.js.map |
@@ -1,7 +0,11 @@ | ||
import { chalk_error } from './chalk.js'; | ||
import { logger_timestamp_ } from './logger_timestamp_.js'; | ||
export function error(...arg_a) { | ||
return chalk_error(logger_timestamp_(), ...arg_a); | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.error__log = exports.error = void 0; | ||
const chalk_js_1 = require("./chalk.js"); | ||
const logger_timestamp__js_1 = require("./logger_timestamp_.js"); | ||
function error(...arg_a) { | ||
return chalk_js_1.chalk_error(logger_timestamp__js_1.logger_timestamp_(), ...arg_a); | ||
} | ||
export { error as error__log }; | ||
exports.error = error; | ||
exports.error__log = error; | ||
//# sourceMappingURL=../src/dist/error.js.map |
@@ -1,10 +0,22 @@ | ||
export * from './console_.js'; | ||
export * from './log_.js'; | ||
export * from './logger_timestamp_.js'; | ||
export * from './chalk.js'; | ||
export * from './debug.js'; | ||
export * from './error.js'; | ||
export * from './info.js'; | ||
export * from './log.js'; | ||
export * from './warn.js'; | ||
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__exportStar(require("./console_.js"), exports); | ||
__exportStar(require("./log_.js"), exports); | ||
__exportStar(require("./logger_timestamp_.js"), exports); | ||
__exportStar(require("./chalk.js"), exports); | ||
__exportStar(require("./debug.js"), exports); | ||
__exportStar(require("./error.js"), exports); | ||
__exportStar(require("./info.js"), exports); | ||
__exportStar(require("./log.js"), exports); | ||
__exportStar(require("./warn.js"), exports); | ||
//# sourceMappingURL=../src/dist/index.js.map |
@@ -1,6 +0,10 @@ | ||
import { chalk_info } from './chalk.js'; | ||
import { logger_timestamp_ } from './logger_timestamp_.js'; | ||
export function info(...arg_a) { | ||
return chalk_info(logger_timestamp_(), ...arg_a); | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.info = void 0; | ||
const chalk_js_1 = require("./chalk.js"); | ||
const logger_timestamp__js_1 = require("./logger_timestamp_.js"); | ||
function info(...arg_a) { | ||
return chalk_js_1.chalk_info(logger_timestamp__js_1.logger_timestamp_(), ...arg_a); | ||
} | ||
exports.info = info; | ||
//# sourceMappingURL=../src/dist/info.js.map |
@@ -1,9 +0,13 @@ | ||
import { log } from './log.js'; | ||
export function log_(message, fn) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports._log = exports.log_ = void 0; | ||
const log_js_1 = require("./log.js"); | ||
function log_(message, fn) { | ||
return (...arg_a) => { | ||
log(message); | ||
log_js_1.log(message); | ||
return fn(...arg_a); | ||
}; | ||
} | ||
export { log_ as _log, }; | ||
exports.log_ = log_; | ||
exports._log = log_; | ||
//# sourceMappingURL=../src/dist/log_.js.map |
@@ -1,6 +0,10 @@ | ||
import { chalk_log } from './chalk.js'; | ||
import { logger_timestamp_ } from './logger_timestamp_.js'; | ||
export function log(...arg_a) { | ||
return chalk_log(logger_timestamp_(), ...arg_a); | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.log = void 0; | ||
const chalk_js_1 = require("./chalk.js"); | ||
const logger_timestamp__js_1 = require("./logger_timestamp_.js"); | ||
function log(...arg_a) { | ||
return chalk_js_1.chalk_log(logger_timestamp__js_1.logger_timestamp_(), ...arg_a); | ||
} | ||
exports.log = log; | ||
//# sourceMappingURL=../src/dist/log.js.map |
@@ -1,5 +0,9 @@ | ||
export function logger_timestamp_() { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports._logger_timestamp = exports.logger_timestamp_ = void 0; | ||
function logger_timestamp_() { | ||
return (new Date()).toISOString(); | ||
} | ||
export { logger_timestamp_ as _logger_timestamp, }; | ||
exports.logger_timestamp_ = logger_timestamp_; | ||
exports._logger_timestamp = logger_timestamp_; | ||
//# sourceMappingURL=../src/dist/logger_timestamp_.js.map |
@@ -1,6 +0,10 @@ | ||
import { chalk_warn } from './chalk.js'; | ||
import { logger_timestamp_ } from './logger_timestamp_.js'; | ||
export function warn(...arg_a) { | ||
return chalk_warn(logger_timestamp_(), ...arg_a); | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.warn = void 0; | ||
const chalk_js_1 = require("./chalk.js"); | ||
const logger_timestamp__js_1 = require("./logger_timestamp_.js"); | ||
function warn(...arg_a) { | ||
return chalk_js_1.chalk_warn(logger_timestamp__js_1.logger_timestamp_(), ...arg_a); | ||
} | ||
exports.warn = warn; | ||
//# sourceMappingURL=../src/dist/warn.js.map |
{ | ||
"name": "@ctx-core/logger", | ||
"version": "9.0.2", | ||
"version": "9.0.3", | ||
"description": "ctx-core logger", | ||
@@ -19,6 +19,9 @@ "keywords": [ | ||
"author": "Brian Takita", | ||
"type": "module", | ||
"main": "./dist/index.js", | ||
"module": "./dist/index.js", | ||
"types": "./dist/index.d.ts", | ||
"exports": { | ||
"require": "./dist/index.js", | ||
"import": "./dist/index.mjs" | ||
}, | ||
"dependencies": { | ||
@@ -35,7 +38,8 @@ "chalk": "^4.1.1" | ||
"scripts": { | ||
"build": "npm run clean && npm run compile", | ||
"build": "npm run clean && npm run copy-mjs && npm run compile", | ||
"clean": "rm -f tsconfig.tsbuildinfo && rm -f src/**/*.js && rm -f src/**/*.d.ts && rm -f src/**/*.map", | ||
"compile": "./node_modules/.bin/tsc -b .", | ||
"copy-mjs": "cd dist && echo \"export * from './index.js'\" > index.mjs", | ||
"exec": "$@" | ||
} | ||
} |
@@ -10,3 +10,3 @@ { | ||
"noErrorTruncation": true, | ||
"module": "esnext", | ||
"module": "commonjs", | ||
"moduleResolution": "node", | ||
@@ -13,0 +13,0 @@ "esModuleInterop": true, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19784
47
337
No