@theholocron/vitest-config 7.0.0 → 7.1.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.
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
//#region bundles/library.d.ts
|
|
2
|
+
type Thresholds = Record<string, number | Record<string, number | undefined> | undefined>;
|
|
2
3
|
/**
|
|
3
4
|
* Vitest bundle for published Node.js libraries.
|
|
4
5
|
* Includes coverage with an 80% threshold on all metrics.
|
|
@@ -9,16 +10,18 @@
|
|
|
9
10
|
* library({ thresholds: { "src/generated.ts": { lines: 0, functions: 0, branches: 0, statements: 0 } } })
|
|
10
11
|
* ```
|
|
11
12
|
*
|
|
12
|
-
* @param {{ thresholds?:
|
|
13
|
-
* @returns {import('vitest/config').UserProjectConfig}
|
|
13
|
+
* @param {{ thresholds?: Thresholds, [key: string]: unknown }} [options]
|
|
14
14
|
*/
|
|
15
|
-
declare function library({ thresholds: thresholdOverrides, ...rest }?: {
|
|
15
|
+
declare function library({ thresholds: thresholdOverrides, ...rest }?: {
|
|
16
|
+
thresholds?: Thresholds;
|
|
17
|
+
[key: string]: unknown;
|
|
18
|
+
}): {
|
|
16
19
|
test: {
|
|
17
20
|
coverage: {
|
|
18
21
|
provider: string;
|
|
19
22
|
include: string[];
|
|
20
23
|
exclude: string[];
|
|
21
|
-
thresholds:
|
|
24
|
+
thresholds: Thresholds;
|
|
22
25
|
};
|
|
23
26
|
environment: string;
|
|
24
27
|
include: string[];
|
|
@@ -30,6 +33,6 @@ declare function library({ thresholds: thresholdOverrides, ...rest }?: {}): {
|
|
|
30
33
|
};
|
|
31
34
|
};
|
|
32
35
|
/** Ready-to-use config for packages that need no customisation. */
|
|
33
|
-
declare const _default: import("vite").UserConfig
|
|
36
|
+
declare const _default: import("vite").UserConfig;
|
|
34
37
|
//#endregion
|
|
35
38
|
export { _default as default, library };
|
package/dist/bundles/library.js
CHANGED
|
@@ -11,8 +11,7 @@ import { defineConfig } from "vitest/config";
|
|
|
11
11
|
* library({ thresholds: { "src/generated.ts": { lines: 0, functions: 0, branches: 0, statements: 0 } } })
|
|
12
12
|
* ```
|
|
13
13
|
*
|
|
14
|
-
* @param {{ thresholds?:
|
|
15
|
-
* @returns {import('vitest/config').UserProjectConfig}
|
|
14
|
+
* @param {{ thresholds?: Thresholds, [key: string]: unknown }} [options]
|
|
16
15
|
*/
|
|
17
16
|
function library({ thresholds: thresholdOverrides, ...rest } = {}) {
|
|
18
17
|
const base = node(rest);
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
* Vitest preset for Storybook component testing via @storybook/addon-vitest.
|
|
4
4
|
* Runs stories as browser tests using Playwright.
|
|
5
5
|
*
|
|
6
|
-
* @param {string} [
|
|
6
|
+
* @param {string} [configDir='.storybook'] Path to the .storybook config directory
|
|
7
7
|
* @param {import('vitest/config').UserProjectConfig['test']} [options]
|
|
8
8
|
* @returns {import('vitest/config').UserProjectConfig}
|
|
9
9
|
*/
|
|
10
|
-
declare function storybook(
|
|
10
|
+
declare function storybook(configDir?: string, options?: {}): Promise<{
|
|
11
11
|
plugins: Promise<import("vite").Plugin<any>[]>[];
|
|
12
12
|
test: {
|
|
13
13
|
name: string;
|
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
* Vitest preset for Storybook component testing via @storybook/addon-vitest.
|
|
4
4
|
* Runs stories as browser tests using Playwright.
|
|
5
5
|
*
|
|
6
|
-
* @param {string} [
|
|
6
|
+
* @param {string} [configDir='.storybook'] Path to the .storybook config directory
|
|
7
7
|
* @param {import('vitest/config').UserProjectConfig['test']} [options]
|
|
8
8
|
* @returns {import('vitest/config').UserProjectConfig}
|
|
9
9
|
*/
|
|
10
|
-
async function storybook(
|
|
10
|
+
async function storybook(configDir = ".storybook", options = {}) {
|
|
11
11
|
const { storybookTest } = await import("@storybook/addon-vitest/vitest-plugin");
|
|
12
12
|
return {
|
|
13
|
-
plugins: [storybookTest({
|
|
13
|
+
plugins: [storybookTest({ configDir })],
|
|
14
14
|
test: {
|
|
15
15
|
name: "storybook",
|
|
16
16
|
browser: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theholocron/vitest-config",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.1.1",
|
|
4
4
|
"description": "Vitest configuration presets for libraries, React apps, and Storybook within the Galaxy.",
|
|
5
5
|
"homepage": "https://github.com/theholocron/configs/tree/main/packages/vitest-config#readme",
|
|
6
6
|
"bugs": "https://github.com/theholocron/configs/issues",
|
|
@@ -10,11 +10,20 @@
|
|
|
10
10
|
},
|
|
11
11
|
"license": "GPL-3.0",
|
|
12
12
|
"author": "Newton Koumantzelis",
|
|
13
|
+
"keywords": [
|
|
14
|
+
"vitest",
|
|
15
|
+
"testing",
|
|
16
|
+
"coverage",
|
|
17
|
+
"typescript",
|
|
18
|
+
"config",
|
|
19
|
+
"theholocron"
|
|
20
|
+
],
|
|
13
21
|
"type": "module",
|
|
14
22
|
"devDependencies": {
|
|
15
23
|
"tsdown": "^0.22.8",
|
|
16
24
|
"typescript": "^5.9.3",
|
|
17
|
-
"
|
|
25
|
+
"vitest": "^4.0.0",
|
|
26
|
+
"@theholocron/tsconfig": "7.1.1"
|
|
18
27
|
},
|
|
19
28
|
"exports": {
|
|
20
29
|
".": {
|
|
@@ -85,12 +94,17 @@
|
|
|
85
94
|
"optional": true
|
|
86
95
|
}
|
|
87
96
|
},
|
|
97
|
+
"engines": {
|
|
98
|
+
"node": ">=22.0.0"
|
|
99
|
+
},
|
|
88
100
|
"publishConfig": {
|
|
89
101
|
"access": "public"
|
|
90
102
|
},
|
|
91
103
|
"releases": "https://github.com/theholocron/configs/releases",
|
|
92
104
|
"wiki": "https://github.com/theholocron/configs/wiki",
|
|
93
105
|
"scripts": {
|
|
94
|
-
"build": "tsdown"
|
|
106
|
+
"build": "tsdown",
|
|
107
|
+
"typecheck": "tsc --noEmit",
|
|
108
|
+
"test": "vitest run"
|
|
95
109
|
}
|
|
96
110
|
}
|