From 85bbe3a0b83e1b7a413cc1185994c1d2801fc9e5 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Tue, 28 Mar 2023 19:49:39 +0200 Subject: [PATCH] chore: update readme --- CHANGELOG.md | 39 ++++++++++++++++++++------------------- README.md | 21 +++++++++------------ 2 files changed, 29 insertions(+), 31 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 79c33fe..241c4db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,40 +6,41 @@ All notable changes to this project will be documented in this file. See [standa [compare changes](https://github.com/unjs/consola/compare/v2.15.3...v3.0.0-1) +> ### 🚀 Enhancements - - Default `logLevel` to 1 in test environments ([#134](https://github.com/unjs/consola/pull/134)) - - Support literal for logLevels ([#133](https://github.com/unjs/consola/pull/133)) - - Expose `createConsola` and named exports ([ef6e5e5](https://github.com/unjs/consola/commit/ef6e5e5)) +- Default `logLevel` to 1 in test environments ([#134](https://github.com/unjs/consola/pull/134)) +- Support literal for logLevels ([#133](https://github.com/unjs/consola/pull/133)) +- Expose `createConsola` and named exports ([ef6e5e5](https://github.com/unjs/consola/commit/ef6e5e5)) ### 🔥 Performance - - Switch from chalk to colorette ([271b4db](https://github.com/unjs/consola/commit/271b4db)) - - Remove `dayjs` dependency ([d6a3776](https://github.com/unjs/consola/commit/d6a3776)) +- Switch from chalk to colorette ([271b4db](https://github.com/unjs/consola/commit/271b4db)) +- Remove `dayjs` dependency ([d6a3776](https://github.com/unjs/consola/commit/d6a3776)) ### 💅 Refactors - - ⚠️ Rewrite consola with typescript ([4479d2f](https://github.com/unjs/consola/commit/4479d2f)) - - Rename `global` to `globalThis` ([bd03098](https://github.com/unjs/consola/commit/bd03098)) - - **utils:** Rename `global` to `globalThis` ([8c3ef77](https://github.com/unjs/consola/commit/8c3ef77)) - - Strict typechecks ([63bbd56](https://github.com/unjs/consola/commit/63bbd56)) +- ⚠️ Rewrite consola with typescript ([4479d2f](https://github.com/unjs/consola/commit/4479d2f)) +- Rename `global` to `globalThis` ([bd03098](https://github.com/unjs/consola/commit/bd03098)) +- **utils:** Rename `global` to `globalThis` ([8c3ef77](https://github.com/unjs/consola/commit/8c3ef77)) +- Strict typechecks ([63bbd56](https://github.com/unjs/consola/commit/63bbd56)) ### 🏡 Chore - - Make example/index.js working ([#110](https://github.com/unjs/consola/pull/110)) - - Add LICENSE ([#121](https://github.com/unjs/consola/pull/121)) - - **npm:** Update repository to unjs orgnization ([#125](https://github.com/unjs/consola/pull/125)) - - Add prerelease script ([cfaba5e](https://github.com/unjs/consola/commit/cfaba5e)) - - Hide rollup warn ([5c3b7f1](https://github.com/unjs/consola/commit/5c3b7f1)) - - Ignore coverage ([da557ac](https://github.com/unjs/consola/commit/da557ac)) - - Update examples ([e07e3ab](https://github.com/unjs/consola/commit/e07e3ab)) +- Make example/index.js working ([#110](https://github.com/unjs/consola/pull/110)) +- Add LICENSE ([#121](https://github.com/unjs/consola/pull/121)) +- **npm:** Update repository to unjs orgnization ([#125](https://github.com/unjs/consola/pull/125)) +- Add prerelease script ([cfaba5e](https://github.com/unjs/consola/commit/cfaba5e)) +- Hide rollup warn ([5c3b7f1](https://github.com/unjs/consola/commit/5c3b7f1)) +- Ignore coverage ([da557ac](https://github.com/unjs/consola/commit/da557ac)) +- Update examples ([e07e3ab](https://github.com/unjs/consola/commit/e07e3ab)) -#### ⚠️ Breaking Changes +#### ⚠️ Breaking Changes - - ⚠️ Rewrite consola with typescript ([4479d2f](https://github.com/unjs/consola/commit/4479d2f)) +- ⚠️ Rewrite consola with typescript ([4479d2f](https://github.com/unjs/consola/commit/4479d2f)) -### ❤️ Contributors +### ❤️ Contributors - Pooya Parsa ([@pi0](http://github.com/pi0)) - Anthony Fu diff --git a/README.md b/README.md index 690cf9e..9d869be 100644 --- a/README.md +++ b/README.md @@ -26,25 +26,29 @@ Using npm: ```bash -npm i consola +npm i consola@3x ``` Using yarn: ```bash -yarn add consola +yarn add consola@3x ``` Using pnpm: ```bash -pnpm i consola +pnpm i consola@3x ``` ## Getting Started ```js -const consola = require("consola"); +// ESM +import { consola } from "consola"; + +// CommonJS +const { consola } = require("consola"); // See types section for all available types @@ -57,13 +61,6 @@ Will display in the terminal: ![Screenshot 2020-01-28 at 14 15 15](https://user-images.githubusercontent.com/904724/73267133-af6b2f00-41d8-11ea-9f16-4a8243d19c43.png) -**NOTE:** Alternatively, you can import consola from source. But don't forget to whitelist it for transpilation: - -```js -import consola from "consola/src/node"; -import consola from "consola/src/browser"; -``` - ## Methods #### `(logObject)` `(args...)` @@ -232,7 +229,7 @@ const logger = consola.create({ ## Integrations -### With jest +### With jest or vitest ```js describe("your-consola-mock-test", () => {