From 308381c9bbe3dc8ef5c4c16ae13eec096cff551b Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Tue, 26 Mar 2024 18:18:30 +0100 Subject: [PATCH] refactor(badges): switch to `shields` by default --- README.md | 6 +++--- docs/2.generators/badges.md | 11 +++++------ src/generators/badges.ts | 2 +- test/fixture/OUTPUT.md | 7 +++---- 4 files changed, 12 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 17161a7..253d157 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,9 @@ -[![npm version](https://flat.badgen.net/npm/v/automd?color=yellow)](https://npmjs.com/package/automd) -[![npm downloads](https://flat.badgen.net/npm/dm/automd?color=yellow)](https://npmjs.com/package/automd) -[![license](https://flat.badgen.net/github/license/unjs/automd?color=yellow)](https://github.com/unjs/automd/blob/main/LICENSE) +[![npm version](https://img.shields.io/npm/v/automd?color=yellow)](https://npmjs.com/package/automd) +[![npm downloads](https://img.shields.io/npm/dm/automd?color=yellow)](https://npmjs.com/package/automd) +[![license](https://img.shields.io/github/license/unjs/automd?color=yellow)](https://github.com/unjs/automd/blob/main/LICENSE) diff --git a/docs/2.generators/badges.md b/docs/2.generators/badges.md index f23b887..dc79124 100644 --- a/docs/2.generators/badges.md +++ b/docs/2.generators/badges.md @@ -15,12 +15,11 @@ The `badges` generator generates badges for the latest npm version, npm download - [![npm version](https://flat.badgen.net/npm/v/defu?color=yellow)](https://npmjs.com/package/defu) - [![npm downloads](https://flat.badgen.net/npm/dm/defu?color=yellow)](https://npmjs.com/package/defu) - [![bundle size](https://flat.badgen.net/bundlephobia/minzip/defu?color=yellow)](https://bundlephobia.com/package/defu) - [![install size](https://flat.badgen.net/packagephobia/publish/defu?color=yellow)](https://packagephobia.com/result?p=defu) - [![codecov](https://flat.badgen.net/codecov/c/github/unjs/automd?color=yellow)](https://codecov.io/gh/unjs/automd) - [![license](https://flat.badgen.net/github/license/unjs/automd?color=yellow)](https://github.com/unjs/automd/blob/main/LICENSE) + [![npm version](https://img.shields.io/npm/v/defu?color=yellow)](https://npmjs.com/package/defu) + [![npm downloads](https://img.shields.io/npm/dm/defu?color=yellow)](https://npmjs.com/package/defu) + [![bundle size](https://img.shields.io/bundlephobia/minzip/defu?color=yellow)](https://bundlephobia.com/package/defu) + [![codecov](https://img.shields.io/codecov/c/gh/unjs/automd?color=yellow)](https://codecov.io/gh/unjs/automd) + [![license](https://img.shields.io/github/license/unjs/automd?color=yellow)](https://github.com/unjs/automd/blob/main/LICENSE) diff --git a/src/generators/badges.ts b/src/generators/badges.ts index a1b474e..6a78bad 100644 --- a/src/generators/badges.ts +++ b/src/generators/badges.ts @@ -75,7 +75,7 @@ export const badges = defineGenerator({ const fillStr = (str: string) => str.replace(/{(\w+)}/g, (_, key) => ctx[key] || ""); - const provider = badgeProviders[args.provider] || badgeProviders.badgen; + const provider = badgeProviders[args.provider] || badgeProviders.shields; const providerParams = Object.entries({ color: args.color, labelColor: args.labelColor, diff --git a/test/fixture/OUTPUT.md b/test/fixture/OUTPUT.md index 1c6d5ce..7b661d9 100644 --- a/test/fixture/OUTPUT.md +++ b/test/fixture/OUTPUT.md @@ -4,10 +4,9 @@ -[![npm version](https://flat.badgen.net/npm/v/automd)](https://npmjs.com/package/automd) -[![npm downloads](https://flat.badgen.net/npm/dm/automd)](https://npmjs.com/package/automd) -[![bundle size](https://flat.badgen.net/bundlephobia/minzip/automd)](https://bundlephobia.com/package/automd) -[![install size](https://flat.badgen.net/packagephobia/publish/automd)](https://packagephobia.com/result?p=automd) +[![npm version](https://img.shields.io/npm/v/automd)](https://npmjs.com/package/automd) +[![npm downloads](https://img.shields.io/npm/dm/automd)](https://npmjs.com/package/automd) +[![bundle size](https://img.shields.io/bundlephobia/minzip/automd)](https://bundlephobia.com/package/automd)