Skip to content

Commit 0ab578e

Browse files
committed
feat(badges): support bundlejs
1 parent 308381c commit 0ab578e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/generators/badges.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ const badgeTypes = {
1818
name: "bundle size",
1919
to: "https://bundlephobia.com/package/{name}",
2020
},
21+
bundlejs: {
22+
name: "bundle size",
23+
to: "https://bundlejs.com/?q={name}",
24+
},
2125
packagephobia: {
2226
name: "install size",
2327
to: "https://packagephobia.com/result?p={name}",
@@ -39,6 +43,7 @@ const badgeProviders = <Record<string, BadgeProvider>>{
3943
npmDownloads: "https://img.shields.io/npm/dm/{name}",
4044
bundlephobia: "https://img.shields.io/bundlephobia/minzip/{name}",
4145
packagephobia: false, // https://github.com/badges/shields/issues/1701
46+
bundlejs: "https://img.shields.io/bundlejs/size/{name}",
4247
codecov: "https://img.shields.io/codecov/c/gh/{github}",
4348
license: "https://img.shields.io/github/license/{github}",
4449
},
@@ -47,6 +52,7 @@ const badgeProviders = <Record<string, BadgeProvider>>{
4752
npmVersion: "https://flat.badgen.net/npm/v/{name}",
4853
npmDownloads: "https://flat.badgen.net/npm/dm/{name}",
4954
bundlephobia: "https://flat.badgen.net/bundlephobia/minzip/{name}",
55+
bundlejs: false, // https://github.com/badgen/badgen/issues/82
5056
packagephobia: "https://flat.badgen.net/packagephobia/publish/{name}",
5157
codecov: "https://flat.badgen.net/codecov/c/github/{github}",
5258
license: "https://flat.badgen.net/github/license/{github}",
@@ -55,6 +61,7 @@ const badgeProviders = <Record<string, BadgeProvider>>{
5561
npmVersion: "https://badgen.net/npm/v/{name}",
5662
npmDownloads: "https://badgen.net/npm/dm/{name}",
5763
bundlephobia: "https://badgen.net/bundlephobia/minzip/{name}",
64+
bundlejs: false, // https://github.com/badgen/badgen/issues/82
5865
packagephobia: "https://badgen.net/packagephobia/publish/{name}",
5966
codecov: "https://badgen.net/codecov/c/github/{github}",
6067
license: "https://badgen.net/github/license/{github}",
@@ -98,6 +105,10 @@ export const badges = defineGenerator({
98105
enabled: args.bundlephobia && ctx.name,
99106
...badgeTypes.bundlephobia,
100107
},
108+
bundlejs: {
109+
enabled: args.bundlejs && ctx.name,
110+
...badgeTypes.bundlejs,
111+
},
101112
packagephobia: {
102113
enabled: args.packagephobia && ctx.name,
103114
...badgeTypes.packagephobia,

0 commit comments

Comments
 (0)