From 7e4189c8e60b5478dcfe238b9ea4f304e5d23b29 Mon Sep 17 00:00:00 2001 From: Amio Jin Date: Wed, 5 Feb 2025 10:28:13 +0800 Subject: [PATCH] feat: migrate /jsdelivr (#694) --- libs/badge-list.ts | 1 - libs/badge-list2.ts | 2 ++ next-env.d.ts | 2 +- next.config.js | 1 + {api-legacy => pages/api}/jsdelivr.ts | 6 +++--- 5 files changed, 7 insertions(+), 5 deletions(-) rename {api-legacy => pages/api}/jsdelivr.ts (89%) diff --git a/libs/badge-list.ts b/libs/badge-list.ts index 1b2de51..8749e75 100644 --- a/libs/badge-list.ts +++ b/libs/badge-list.ts @@ -37,7 +37,6 @@ export const liveBadgeList = [ 'deepscan', 'uptime-robot', 'badgesize', - 'jsdelivr', // social 'devrant', 'reddit', diff --git a/libs/badge-list2.ts b/libs/badge-list2.ts index 84b1cb1..857eb6f 100644 --- a/libs/badge-list2.ts +++ b/libs/badge-list2.ts @@ -8,6 +8,7 @@ import npm from '../pages/api/npm' import pub from '../pages/api/pub' import crates from '../pages/api/crates' import docker from '../pages/api/docker' +import jsdelivr from '../pages/api/jsdelivr' import bundlephobia from '../pages/api/bundlephobia' import packagephobia from '../pages/api/packagephobia' import codeclimate from '../pages/api/codeclimate' @@ -45,6 +46,7 @@ export default { hackage: hackage.meta, pypi: pypi.meta, winget: winget.meta, + jsdelivr: jsdelivr.meta, bundlephobia: bundlephobia.meta, packagephobia: packagephobia.meta, codeclimate: codeclimate.meta, diff --git a/next-env.d.ts b/next-env.d.ts index 4f11a03..a4a7b3f 100644 --- a/next-env.d.ts +++ b/next-env.d.ts @@ -2,4 +2,4 @@ /// // NOTE: This file should not be edited -// see https://nextjs.org/docs/basic-features/typescript for more information. +// see https://nextjs.org/docs/pages/building-your-application/configuring/typescript for more information. diff --git a/next.config.js b/next.config.js index 8e4b7b2..e36f441 100644 --- a/next.config.js +++ b/next.config.js @@ -51,6 +51,7 @@ const nextConfig = { '/coveralls', '/travis', '/circleci', + '/jsdelivr', '/xo', // social network '/discord', diff --git a/api-legacy/jsdelivr.ts b/pages/api/jsdelivr.ts similarity index 89% rename from api-legacy/jsdelivr.ts rename to pages/api/jsdelivr.ts index 537266c..7b89c95 100644 --- a/api-legacy/jsdelivr.ts +++ b/pages/api/jsdelivr.ts @@ -1,7 +1,7 @@ import millify from 'millify' -import got from '../libs/got' -import { versionColor } from '../libs/utils' -import { createBadgenHandler, PathArgs } from '../libs/create-badgen-handler' +import got from '../../libs/got' +import { versionColor } from '../../libs/utils' +import { createBadgenHandler, PathArgs } from '../../libs/create-badgen-handler' export default createBadgenHandler({ title: 'jsDelivr',