зеркало из https://github.com/microsoft/rnx-kit.git
feat: introduce common console logger (#317)
* feat: introduce common console logger * update README
This commit is contained in:
Родитель
a557826de3
Коммит
c630c871d6
|
@ -27,6 +27,7 @@ libraries.
|
|||
| [@rnx-kit/bundle-diff](https://github.com/microsoft/rnx-kit/tree/main/packages/bundle-diff) | Simple tool for diffing the content of two bundles |
|
||||
| [@rnx-kit/cli](https://github.com/microsoft/rnx-kit/tree/main/packages/cli) | Command-line interface for rnx-kit |
|
||||
| [@rnx-kit/config](https://github.com/microsoft/rnx-kit/tree/main/packages/config) | Package for defining and querying information about rnx kits |
|
||||
| [@rnx-kit/console](https://github.com/microsoft/rnx-kit/tree/main/packages/console) | Simple console logger |
|
||||
| [@rnx-kit/dep-check](https://github.com/microsoft/rnx-kit/tree/main/packages/dep-check) | Dependency checker for React Native apps |
|
||||
| [@rnx-kit/metro-config](https://github.com/microsoft/rnx-kit/tree/main/packages/metro-config) | Metro config for monorepos |
|
||||
| [@rnx-kit/metro-plugin-cyclic-dependencies-detector](https://github.com/microsoft/rnx-kit/tree/main/packages/metro-plugin-cyclic-dependencies-detector) | Cyclic dependencies detector for Metro |
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"type": "minor",
|
||||
"comment": "Introduce a common console logger",
|
||||
"packageName": "@rnx-kit/console",
|
||||
"email": "4123478+tido64@users.noreply.github.com",
|
||||
"dependentChangeType": "patch"
|
||||
}
|
|
@ -0,0 +1,2 @@
|
|||
const { configureJust } = require("rnx-kit-scripts");
|
||||
configureJust();
|
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
"name": "@rnx-kit/console",
|
||||
"version": "1.0.0-alpha",
|
||||
"description": "Simple console logger",
|
||||
"homepage": "https://github.com/microsoft/rnx-kit/tree/main/packages/console#readme",
|
||||
"license": "MIT",
|
||||
"files": [
|
||||
"lib/*"
|
||||
],
|
||||
"main": "lib/index.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/microsoft/rnx-kit",
|
||||
"directory": "packages/console"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "rnx-kit-scripts build",
|
||||
"format": "prettier --write src/*.ts test/*.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"chalk": "^4.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^12.0.0",
|
||||
"rnx-kit-scripts": "*"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": "@rnx-kit/eslint-config"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
import chalk from "chalk";
|
||||
|
||||
type Log = typeof console.log;
|
||||
|
||||
export const error: Log = (...args) =>
|
||||
console.error(chalk.red.bold("error"), ...args);
|
||||
|
||||
export const info: Log = (...args) =>
|
||||
console.log(chalk.cyan.bold("info"), ...args);
|
||||
|
||||
export const warn: Log = (...args) =>
|
||||
console.warn(chalk.yellow.bold("warn"), ...args);
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"extends": "rnx-kit-scripts/tsconfig-shared.json",
|
||||
"include": ["src"]
|
||||
}
|
Загрузка…
Ссылка в новой задаче