From 2be248edfd423b2746664b1512316f1ab518d613 Mon Sep 17 00:00:00 2001 From: arvinxx Date: Sun, 13 Aug 2023 23:20:08 +0800 Subject: [PATCH] =?UTF-8?q?:sparkles:=20feat:=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 --- .huskyrc | 6 ------ .npmrc | 10 ++++++++++ jest.config.ts | 15 --------------- package.json | 11 +++++------ vitest.config.ts | 8 ++++++++ 5 files changed, 23 insertions(+), 27 deletions(-) delete mode 100644 .huskyrc delete mode 100644 jest.config.ts create mode 100644 vitest.config.ts diff --git a/.huskyrc b/.huskyrc deleted file mode 100644 index 7b4a4bf..0000000 --- a/.huskyrc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "hooks": { - "commit-msg": "commitlint -e $HUSKY_GIT_PARAMS", - "precommit": "lint-staged" - } -} 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/jest.config.ts b/jest.config.ts deleted file mode 100644 index 5d3e1be..0000000 --- a/jest.config.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Config, createConfig } from '@umijs/test'; - -const base = createConfig({ - target: 'node', -}); - -const config: Config.InitialOptions = { - ...base, - collectCoverageFrom: ['api/**/*.{ts,js,tsx,jsx}'], - /* if needed other snapshotSerializers should go here */ - // if you require some es-module npm package, please uncomment below line and insert your package name - // transformIgnorePatterns: ['node_modules/(?!.*(lodash-es|your-es-pkg-name)/)'] -}; - -export default config; diff --git a/package.json b/package.json index 5088a73..5661cf9 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "vercel-serverless-api-template", "version": "1.0.1", "private": true, - "description": "基于 Vercel 的免费 Serverless api 模板", + "description": "Vercel Serverless API 模板", "repository": "https://github.com/arvinxx/vercel-serverless-api-template.git", "scripts": { "ci": "npm run lint && npm run type-check", @@ -43,15 +43,14 @@ "dotenv": "^8", "eslint": "^8", "husky": "^8", - "jest": "^29", "lint-staged": "^13", "prettier": "^2", "prettier-plugin-organize-imports": "^3", "prettier-plugin-packagejson": "^2", - "semantic-release": "^19", + "semantic-release": "^21", "semantic-release-config-gitmoji": "^1", - "stylelint": "^14", - "typescript": "^4", - "vercel": "^28" + "typescript": "^5", + "vercel": "^31.2.3", + "vitest": "latest" } } 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, + }, +});