vitest-config-silverwind 11.0.2 → 11.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +19 -3
  2. package/package.json +9 -9
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import { fileURLToPath } from "node:url";
3
3
  import { accessSync, constants } from "node:fs";
4
4
  import { readFile } from "node:fs/promises";
5
5
 
6
- //#region node_modules/.pnpm/vite-string-plugin@2.0.2_vite@8.0.2_@types+node@25.5.0_/node_modules/vite-string-plugin/dist/index.js
6
+ //#region node_modules/.pnpm/vite-string-plugin@2.0.2_vite@8.0.3_@emnapi+core@1.9.2_@emnapi+runtime@1.9.2_@types+node@25.5.0_/node_modules/vite-string-plugin/dist/index.js
7
7
  /** Vite plugin to import files as string */
8
8
  const stringPlugin = ({ match = /\.(svg|md|xml|txt)$/i } = {}) => ({
9
9
  name: "vite-string-plugin",
@@ -42,7 +42,16 @@ function dedupePlugins(libPlugins, userPlugins) {
42
42
  }
43
43
  const setupFileJs = "vitest.setup.js";
44
44
  const setupFileTs = "vitest.setup.ts";
45
- function base({ url, test: { setupFiles = [], ...otherTest } = {}, plugins = [], ...other }) {
45
+ /** Directories to exclude from both test discovery and coverage */
46
+ const dirExclude = ["**/{node_modules,dist,build,e2e,snapshots,fixtures,persistent}/**", "**/.{air,git,github,gitea,make,swc,ruff_cache,venv,vscode}/**"];
47
+ /** Files to exclude from coverage, always applied even when user adds custom excludes */
48
+ const coverageExclude = [
49
+ "**/*.test.*",
50
+ "**/*.stories.*",
51
+ "**/*.d.ts",
52
+ ...dirExclude
53
+ ];
54
+ function base({ url, test: { setupFiles = [], coverage: userCoverage, ...otherTest } = {}, plugins = [], ...other }) {
46
55
  let setupFile = "";
47
56
  for (const file of [setupFileJs, setupFileTs]) try {
48
57
  const path = fileURLToPath(new URL(file, import.meta.url));
@@ -52,7 +61,7 @@ function base({ url, test: { setupFiles = [], ...otherTest } = {}, plugins = [],
52
61
  return {
53
62
  test: {
54
63
  include: ["**/?(*.)test.?(c|m)[jt]s?(x)"],
55
- exclude: ["**/{node_modules,dist,build,e2e,snapshots,fixtures,persistent}/**", "**/.{air,git,github,gitea,make,swc,ruff_cache,venv,vscode}/**"],
64
+ exclude: dirExclude,
56
65
  setupFiles: uniq([setupFile, ...setupFiles].filter(Boolean)),
57
66
  testTimeout: 3e4,
58
67
  isolate: false,
@@ -64,6 +73,13 @@ function base({ url, test: { setupFiles = [], ...otherTest } = {}, plugins = [],
64
73
  globals: true,
65
74
  watch: false,
66
75
  sequence: { concurrent: true },
76
+ coverage: {
77
+ provider: "v8",
78
+ reporter: ["text"],
79
+ include: ["**/*.{js,ts,jsx,tsx}"],
80
+ ...userCoverage,
81
+ exclude: uniq([...coverageExclude, ...userCoverage?.exclude ?? []])
82
+ },
67
83
  snapshotFormat: { maxOutputLength: 50 * 1024 * 1024 },
68
84
  resolveSnapshotPath: (path, extension) => {
69
85
  if (url) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vitest-config-silverwind",
3
- "version": "11.0.2",
3
+ "version": "11.1.0",
4
4
  "description": "Shared vitest configuration",
5
5
  "author": "silverwind <me@silverwind.io>",
6
6
  "repository": "silverwind/vitest-config-silverwind",
@@ -31,19 +31,19 @@
31
31
  },
32
32
  "devDependencies": {
33
33
  "@types/node": "25.5.0",
34
- "@typescript/native-preview": "7.0.0-dev.20260324.1",
34
+ "@typescript/native-preview": "7.0.0-dev.20260401.1",
35
35
  "eslint": "10.1.0",
36
- "eslint-config-silverwind": "127.1.4",
36
+ "eslint-config-silverwind": "130.1.0",
37
37
  "js-yaml": "4.1.1",
38
- "tsdown": "0.21.4",
39
- "tsdown-config-silverwind": "2.0.2",
38
+ "tsdown": "0.21.7",
39
+ "tsdown-config-silverwind": "2.0.5",
40
40
  "typescript": "5.9.3",
41
- "typescript-config-silverwind": "16.1.0",
42
- "updates": "17.11.2",
41
+ "typescript-config-silverwind": "17.0.0",
42
+ "updates": "17.13.2",
43
43
  "updates-config-silverwind": "2.0.1",
44
- "versions": "14.2.4",
44
+ "versions": "14.2.6",
45
45
  "vite-plugin-dts": "4.5.4",
46
46
  "vite-string-plugin": "^2.0.2",
47
- "vitest": "4.1.1"
47
+ "vitest": "4.1.2"
48
48
  }
49
49
  }