From 5397ecdf65ab28834a4950460ac098d7f87011cf Mon Sep 17 00:00:00 2001 From: nemo shen Date: Sun, 14 Jan 2024 17:52:48 +0800 Subject: [PATCH] chore: update vite config --- package.json | 2 ++ pnpm-lock.yaml | 70 +++++++++++++++++++++++++++++++++++++++++++++++--- vite.config.ts | 19 ++++++++++++++ 3 files changed, 88 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 025e145..ce10b18 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "preview": "vite preview", "test": "vitest", "test:cov": "vitest run --coverage", + "test:ui": "vitest --ui", "lint": "eslint .", "lint:fix": "eslint . --fix", "format": "prettier -w ." @@ -39,6 +40,7 @@ "@vitejs/plugin-vue": "^4.5.2", "@vitejs/plugin-vue-jsx": "^3.1.0", "@vitest/coverage-istanbul": "^1.2.0", + "@vitest/ui": "^1.2.0", "@vue/test-utils": "^2.4.3", "eslint": "^7.32.0", "eslint-config-airbnb-base": "^15.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2fea1dc..7802817 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -35,6 +35,9 @@ importers: '@vitest/coverage-istanbul': specifier: ^1.2.0 version: 1.2.0(vitest@1.2.0) + '@vitest/ui': + specifier: ^1.2.0 + version: 1.2.0(vitest@1.2.0) '@vue/test-utils': specifier: ^2.4.3 version: 2.4.3(vue@3.4.13) @@ -73,7 +76,7 @@ importers: version: 5.0.11(@types/node@20.11.0) vitest: specifier: ^1.2.0 - version: 1.2.0(@types/node@20.11.0)(happy-dom@12.10.3) + version: 1.2.0(@types/node@20.11.0)(@vitest/ui@1.2.0)(happy-dom@12.10.3) packages/core: {} @@ -998,6 +1001,13 @@ packages: dev: true optional: true + /@polka/url@1.0.0-next.24: + resolution: + { + integrity: sha512-2LuNTFBIO0m7kKIQvvPHN6UE63VjpmL9rnEEaOOaiSPbZK+zUOYIzBAWcED+3XYzhYsd/0mD57VdxAEqqV52CQ==, + } + dev: true + /@rollup/pluginutils@5.1.0: resolution: { @@ -1498,7 +1508,7 @@ packages: magicast: 0.3.2 picocolors: 1.0.0 test-exclude: 6.0.0 - vitest: 1.2.0(@types/node@20.11.0)(happy-dom@12.10.3) + vitest: 1.2.0(@types/node@20.11.0)(@vitest/ui@1.2.0)(happy-dom@12.10.3) transitivePeerDependencies: - supports-color dev: true @@ -1545,6 +1555,24 @@ packages: tinyspy: 2.2.0 dev: true + /@vitest/ui@1.2.0(vitest@1.2.0): + resolution: + { + integrity: sha512-AFU8FBiSioYacEd0b8+2R/4GJJhxseD6bNIiEVntb505u1B/mcNMTVRepZql7r3RQJZQ7uijY9QyLdhlbh4XvA==, + } + peerDependencies: + vitest: ^1.0.0 + dependencies: + '@vitest/utils': 1.2.0 + fast-glob: 3.3.2 + fflate: 0.8.1 + flatted: 3.2.9 + pathe: 1.1.1 + picocolors: 1.0.0 + sirv: 2.0.4 + vitest: 1.2.0(@types/node@20.11.0)(@vitest/ui@1.2.0)(happy-dom@12.10.3) + dev: true + /@vitest/utils@1.2.0: resolution: { @@ -3217,6 +3245,13 @@ packages: dependencies: reusify: 1.0.4 + /fflate@0.8.1: + resolution: + { + integrity: sha512-/exOvEuc+/iaUm105QIiOt4LpBdMTWsXxqR0HDF35vx3fmaKzw7354gTilCh5rkzEt8WYyG//ku3h3nRmd7CHQ==, + } + dev: true + /file-entry-cache@6.0.1: resolution: { @@ -4527,6 +4562,14 @@ packages: dev: false optional: true + /mrmime@2.0.0: + resolution: + { + integrity: sha512-eu38+hdgojoyq63s+yTpN4XMBdt5l8HhMhc4VKLO9KM5caLIBvUm4thi7fFaxyTmCKeNnXZ5pAlBwCUnhA09uw==, + } + engines: { node: '>=10' } + dev: true + /ms@2.1.2: resolution: { @@ -5273,6 +5316,18 @@ packages: requiresBuild: true dev: true + /sirv@2.0.4: + resolution: + { + integrity: sha512-94Bdh3cC2PKrbgSOUqTiGPWVZeSiXfKOVZNJniWoqrWrRkB1CJzBU3NEbiTsPcYy1lDsANA/THzS+9WBiy5nfQ==, + } + engines: { node: '>= 10' } + dependencies: + '@polka/url': 1.0.0-next.24 + mrmime: 2.0.0 + totalist: 3.0.1 + dev: true + /slash@3.0.0: resolution: { @@ -5622,6 +5677,14 @@ packages: dependencies: is-number: 7.0.0 + /totalist@3.0.1: + resolution: + { + integrity: sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ==, + } + engines: { node: '>=6' } + dev: true + /ts-api-utils@1.0.3(typescript@5.3.3): resolution: { @@ -5962,7 +6025,7 @@ packages: fsevents: 2.3.3 dev: true - /vitest@1.2.0(@types/node@20.11.0)(happy-dom@12.10.3): + /vitest@1.2.0(@types/node@20.11.0)(@vitest/ui@1.2.0)(happy-dom@12.10.3): resolution: { integrity: sha512-Ixs5m7BjqvLHXcibkzKRQUvD/XLw0E3rvqaCMlrm/0LMsA0309ZqYvTlPzkhh81VlEyVZXFlwWnkhb6/UMtcaQ==, @@ -5995,6 +6058,7 @@ packages: '@vitest/runner': 1.2.0 '@vitest/snapshot': 1.2.0 '@vitest/spy': 1.2.0 + '@vitest/ui': 1.2.0(vitest@1.2.0) '@vitest/utils': 1.2.0 acorn-walk: 8.3.1 cac: 6.7.14 diff --git a/vite.config.ts b/vite.config.ts index 227b4b5..ec0ea2d 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -10,6 +10,25 @@ export default defineConfig({ coverage: { provider: 'istanbul', reporter: ['text', 'json', 'html'], + exclude: [ + 'src', + 'coverage/**', + 'dist/**', + '**/[.]**', + 'packages/*/test?(s)/**', + '**/*.d.ts', + '**/virtual:*', + '**/__x00__*', + '**/\x00*', + 'cypress/**', + 'test?(s)/**', + 'test?(-*).?(c|m)[jt]s?(x)', + '**/*{.,-}{test,spec}.?(c|m)[jt]s?(x)', + '**/__tests__/**', + '**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*', + '**/vitest.{workspace,projects}.[jt]s?(on)', + '**/.{eslint,mocha,prettier}rc.{?(c|m)js,yml}', + ], }, }, resolve: {