From d9b58df6bafed7d6be9548f5d32def2221c3de60 Mon Sep 17 00:00:00 2001 From: Red Huang Date: Mon, 23 Dec 2024 19:12:50 +0800 Subject: [PATCH 1/2] fix(fancy): fallback when`Intl` is unavailable (#326) --- src/reporters/fancy.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/reporters/fancy.ts b/src/reporters/fancy.ts index 433b1317..4ab5d43b 100644 --- a/src/reporters/fancy.ts +++ b/src/reporters/fancy.ts @@ -39,7 +39,8 @@ const TYPE_ICONS: { [k in LogType]?: string } = { function stringWidth(str: string) { // https://github.com/unjs/consola/issues/204 - if (!Intl.Segmenter) { + const hasICU = typeof Intl === "object"; + if (!hasICU || !Intl.Segmenter) { return stripAnsi(str).length; } return _stringWidth(str); From 4429f8fce6fd0d2307d6514fdedd8627531bca60 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Mon, 23 Dec 2024 12:13:26 +0100 Subject: [PATCH 2/2] chore(release): v3.3.1 --- CHANGELOG.md | 12 ++++++++++++ package.json | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ec79795..c2c53b4c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,18 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## v3.3.1 + +[compare changes](https://github.com/unjs/consola/compare/v3.3.0...v3.3.1) + +### 🩹 Fixes + +- **fancy:** Fallback when`Intl` is unavailable ([#326](https://github.com/unjs/consola/pull/326)) + +### ❤️ Contributors + +- Red Huang + ## v3.3.0 [compare changes](https://github.com/unjs/consola/compare/v3.2.3...v3.3.0) diff --git a/package.json b/package.json index 4cbf6b11..678e60f4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "consola", - "version": "3.3.0", + "version": "3.3.1", "description": "Elegant Console Wrapper", "keywords": [ "console",