@abelspithost/vitest-config 0.0.0 → 0.0.1

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 (3) hide show
  1. package/LICENSE +14 -14
  2. package/README.md +62 -59
  3. package/package.json +4 -4
package/LICENSE CHANGED
@@ -1,15 +1,15 @@
1
- ISC License
2
-
3
- Copyright (c) 2026 Abel Spithost
4
-
5
- Permission to use, copy, modify, and/or distribute this software for any
6
- purpose with or without fee is hereby granted, provided that the above
7
- copyright notice and this permission notice appear in all copies.
8
-
9
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
10
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
12
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
14
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
1
+ ISC License
2
+
3
+ Copyright (c) 2026 Abel Spithost
4
+
5
+ Permission to use, copy, modify, and/or distribute this software for any
6
+ purpose with or without fee is hereby granted, provided that the above
7
+ copyright notice and this permission notice appear in all copies.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
10
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
12
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
14
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15
15
  PERFORMANCE OF THIS SOFTWARE.
package/README.md CHANGED
@@ -1,59 +1,62 @@
1
-
2
- # @abelspithost/vitest-config
3
-
4
- This package provides a shared Vitest configuration for TypeScript projects.
5
- The `createVitestConfig` function returns a Node-oriented Vitest configuration
6
- with consistent test discovery, coverage thresholds, mock handling, and path
7
- aliases.
8
-
9
- ## Requirements
10
-
11
- - Node.js 24 or newer
12
- - Vitest 5.0.0 or newer
13
-
14
- ## Installation
15
-
16
- Install this package and Vitest as development dependencies:
17
-
18
- ```sh
19
- npm install --save-dev @abelspithost/vitest-config vitest
20
- ```
21
-
22
- ## Usage
23
-
24
- Create a `vitest.config.ts` file in your project:
25
-
26
- ```ts
27
- import { createVitestConfig } from '@abelspithost/vitest-config';
28
-
29
- export default createVitestConfig();
30
- ```
31
-
32
- The configuration resolves the `@` alias to your project's `src` directory.
33
- For example, `@/utils/format` resolves to `src/utils/format`.
34
-
35
- ## Defaults
36
-
37
- `createVitestConfig` applies these settings:
38
-
39
- | Setting | Value |
40
- | --- | --- |
41
- | Environment | `node` |
42
- | Test files | `**/*.spec.ts` |
43
- | Excluded test paths | `dist`, `node_modules` |
44
- | Globals | Enabled |
45
- | Pool | `threads` |
46
- | Mock clearing | Enabled |
47
- | Coverage reporters | `json-summary`, `json` |
48
- | Coverage on failure | Enabled |
49
- | Coverage exclusion | `**/constants/**` |
50
- | Branch threshold | 90% |
51
- | Function threshold | 95% |
52
- | Line threshold | 95% |
53
-
54
- Vitest 5 clears mocks by default. The preset sets `clearMocks: true` explicitly
55
- so the shared configuration states that policy for every consuming project.
56
-
57
- ## License
58
-
59
- This project uses the ISC license.
1
+
2
+ # @abelspithost/vitest-config
3
+
4
+ [![Quality gate status](https://sonarcloud.io/api/project_badges/measure?project=aspithost_vitest-config&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=aspithost_vitest-config)
5
+ ![NPM Version](https://img.shields.io/npm/v/@abelspithost/vitest-config)
6
+
7
+ This package provides a shared Vitest configuration for TypeScript projects.
8
+ The `createVitestConfig` function returns a Node-oriented Vitest configuration
9
+ with consistent test discovery, coverage thresholds, mock handling, and path
10
+ aliases.
11
+
12
+ ## Requirements
13
+
14
+ - Node.js 24 or newer
15
+ - Vitest 5.0.0 or newer
16
+
17
+ ## Installation
18
+
19
+ Install this package and Vitest as development dependencies:
20
+
21
+ ```sh
22
+ npm install --save-dev @abelspithost/vitest-config vitest
23
+ ```
24
+
25
+ ## Usage
26
+
27
+ Create a `vitest.config.ts` file in your project:
28
+
29
+ ```ts
30
+ import { createVitestConfig } from '@abelspithost/vitest-config';
31
+
32
+ export default createVitestConfig();
33
+ ```
34
+
35
+ The configuration resolves the `@` alias to your project's `src` directory.
36
+ For example, `@/utils/format` resolves to `src/utils/format`.
37
+
38
+ ## Defaults
39
+
40
+ `createVitestConfig` applies these settings:
41
+
42
+ | Setting | Value |
43
+ | --- | --- |
44
+ | Environment | `node` |
45
+ | Test files | `**/*.spec.ts` |
46
+ | Excluded test paths | `dist`, `node_modules` |
47
+ | Globals | Enabled |
48
+ | Pool | `threads` |
49
+ | Mock clearing | Enabled |
50
+ | Coverage reporters | `json-summary`, `json` |
51
+ | Coverage on failure | Enabled |
52
+ | Coverage exclusion | `**/constants/**` |
53
+ | Branch threshold | 90% |
54
+ | Function threshold | 95% |
55
+ | Line threshold | 95% |
56
+
57
+ Vitest 5 clears mocks by default. The preset sets `clearMocks: true` explicitly
58
+ so the shared configuration states that policy for every consuming project.
59
+
60
+ ## License
61
+
62
+ This project uses the ISC license.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abelspithost/vitest-config",
3
- "version": "0.0.0",
3
+ "version": "0.0.1",
4
4
  "description": "Shared Vitest configuration preset for TypeScript projects",
5
5
  "keywords": [
6
6
  "vitest",
@@ -40,19 +40,19 @@
40
40
  "lint": "eslint . && npm run publint",
41
41
  "publint": "npx -y publint",
42
42
  "typecheck": "tsc -p tsconfig.build.json --noEmit",
43
- "prepare": "husky"
43
+ "prepare": "husky || true"
44
44
  },
45
45
  "peerDependencies": {
46
46
  "vitest": ">=5.0.0"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@abelspithost/commitlint": "^0.1.7",
50
- "@abelspithost/eslint-config-ts": "^1.1.5",
50
+ "@abelspithost/eslint-config-ts": "^2.0.0",
51
51
  "@abelspithost/tsconfig-node": "^0.1.1",
52
52
  "@commitlint/cli": "^21.2.3",
53
53
  "@types/node": "^24.13.5",
54
54
  "commitlint": "^21.2.2",
55
- "eslint": "^10.10.0",
55
+ "eslint": "^10.11.0",
56
56
  "husky": "^9.1.7",
57
57
  "jiti": "^2.7.0",
58
58
  "rimraf": "^6.1.3",