From e1909e6078aad22727c6ca713ca7770755ef2e16 Mon Sep 17 00:00:00 2001 From: arvinxx Date: Sun, 30 Jul 2023 00:22:33 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20chore:=20=E5=8D=87=E7=BA=A7?= =?UTF-8?q?=E5=9F=BA=E7=A1=80=E8=AE=BE=E6=96=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .npmrc | 10 ++++++++++ api/parse.ts | 2 +- package.json | 2 +- vitest.config.ts | 8 ++++++++ 4 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 vitest.config.ts diff --git a/.npmrc b/.npmrc index 62d8402..d9ed3d3 100644 --- a/.npmrc +++ b/.npmrc @@ -1 +1,11 @@ lockfile=false +resolution-mode=highest +public-hoist-pattern[]=*@umijs/lint* +public-hoist-pattern[]=*changelog* +public-hoist-pattern[]=*commitlint* +public-hoist-pattern[]=*eslint* +public-hoist-pattern[]=*postcss* +public-hoist-pattern[]=*prettier* +public-hoist-pattern[]=*remark* +public-hoist-pattern[]=*semantic-release* +public-hoist-pattern[]=*stylelint* diff --git a/api/parse.ts b/api/parse.ts index 45fa4cd..be4dbec 100644 --- a/api/parse.ts +++ b/api/parse.ts @@ -1,6 +1,6 @@ import { Readability } from '@mozilla/readability'; -import { JSDOM } from 'jsdom'; import type { VercelRequest, VercelResponse } from '@vercel/node'; +import { JSDOM } from 'jsdom'; import { NodeHtmlMarkdown } from 'node-html-markdown'; export default async function handler(req: VercelRequest, res: VercelResponse) { diff --git a/package.json b/package.json index a544c5d..95f5c74 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "lobehub-html-parser", "version": "1.0.1", "private": true, - "description": "基于 Vercel 的免费 Serverless api 模板", + "description": "HTML 转 markdown 服务", "repository": "https://github.com/arvinxx/vercel-serverless-api-template.git", "scripts": { "ci": "npm run lint && npm run type-check", diff --git a/vitest.config.ts b/vitest.config.ts new file mode 100644 index 0000000..c4588ab --- /dev/null +++ b/vitest.config.ts @@ -0,0 +1,8 @@ +import { defineConfig } from 'vitest/config'; + +export default defineConfig({ + test: { + environment: 'jsdom', + globals: true, + }, +});