@apitree.cz/vitest-config 0.1.0-next.05dd9cd
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.
- package/README.md +49 -0
- package/dist/base.d.ts +1 -0
- package/dist/base.js +12 -0
- package/dist/base.js.map +1 -0
- package/dist/constants.d.ts +5 -0
- package/dist/constants.js +6 -0
- package/dist/constants.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/react.d.ts +1 -0
- package/dist/react.js +15 -0
- package/dist/react.js.map +1 -0
- package/package.json +41 -0
package/README.md
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
<a href="https://github.com/ApiTreeCZ">
|
|
4
|
+
<img alt="ApiTree s.r.o." src="https://www.apitree.cz/static/images/logo-header.svg" width="120" />
|
|
5
|
+
</a>
|
|
6
|
+
|
|
7
|
+
# Vitest Config
|
|
8
|
+
|
|
9
|
+
### [Vitest](https://vitest.dev) configuration for ApiTree projects
|
|
10
|
+
|
|
11
|
+
</div>
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pnpm add --save-dev @apitree.cz/vitest-config vitest
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
Use one of the following configurations in your `vitest.config.ts`:
|
|
22
|
+
|
|
23
|
+
### Base
|
|
24
|
+
|
|
25
|
+
```typescript
|
|
26
|
+
export { config as default } from '@apitree.cz/vitest-config';
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### React
|
|
30
|
+
|
|
31
|
+
```typescript
|
|
32
|
+
export { config as default } from '@apitree.cz/vitest-config/react';
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Customization
|
|
36
|
+
|
|
37
|
+
You can customize the configuration with `mergeConfig` function:
|
|
38
|
+
|
|
39
|
+
```typescript
|
|
40
|
+
import { config } from '@apitree.cz/vitest-config';
|
|
41
|
+
import { mergeConfig } from 'vitest/config';
|
|
42
|
+
import type { UserConfig } from 'vitest/config';
|
|
43
|
+
|
|
44
|
+
export default mergeConfig<UserConfig, UserConfig>(config, {
|
|
45
|
+
// project specific configuration
|
|
46
|
+
});
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
> See [Options](https://vitest.dev/config/#options) documentation for config reference.
|
package/dist/base.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const base: import("vite").UserConfig;
|
package/dist/base.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { defineConfig } from 'vitest/config';
|
|
2
|
+
import { coverage } from './constants.js';
|
|
3
|
+
export const base = defineConfig({
|
|
4
|
+
test: {
|
|
5
|
+
environment: 'node',
|
|
6
|
+
coverage: {
|
|
7
|
+
...coverage,
|
|
8
|
+
include: ['src/**/*.ts'],
|
|
9
|
+
},
|
|
10
|
+
},
|
|
11
|
+
});
|
|
12
|
+
//# sourceMappingURL=base.js.map
|
package/dist/base.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.js","sourceRoot":"","sources":["../src/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,MAAM,CAAC,MAAM,IAAI,GAAG,YAAY,CAAC;IAC/B,IAAI,EAAE;QACJ,WAAW,EAAE,MAAM;QACnB,QAAQ,EAAE;YACR,GAAG,QAAQ;YACX,OAAO,EAAE,CAAC,aAAa,CAAC;SACzB;KACF;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,GAAG,EAAE,IAAI;IACT,QAAQ,EAAE,UAAU;IACpB,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;CACD,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './base.js';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC"}
|
package/dist/react.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const config: import("vite").UserConfig;
|
package/dist/react.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import viteReact from '@vitejs/plugin-react';
|
|
2
|
+
import { defineConfig } from 'vitest/config';
|
|
3
|
+
import { coverage } from './constants.js';
|
|
4
|
+
export const config = defineConfig({
|
|
5
|
+
plugins: [viteReact()],
|
|
6
|
+
test: {
|
|
7
|
+
environment: 'jsdom',
|
|
8
|
+
coverage: {
|
|
9
|
+
...coverage,
|
|
10
|
+
include: ['src/**/*.{ts,tsx}'],
|
|
11
|
+
},
|
|
12
|
+
setupFiles: ['tests/setup.ts'],
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
//# sourceMappingURL=react.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react.js","sourceRoot":"","sources":["../src/react.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,MAAM,CAAC,MAAM,MAAM,GAAG,YAAY,CAAC;IACjC,OAAO,EAAE,CAAC,SAAS,EAAE,CAAC;IACtB,IAAI,EAAE;QACJ,WAAW,EAAE,OAAO;QACpB,QAAQ,EAAE;YACR,GAAG,QAAQ;YACX,OAAO,EAAE,CAAC,mBAAmB,CAAC;SAC/B;QACD,UAAU,EAAE,CAAC,gBAAgB,CAAC;KAC/B;CACF,CAAC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@apitree.cz/vitest-config",
|
|
3
|
+
"version": "0.1.0-next.05dd9cd",
|
|
4
|
+
"description": "Vitest configuration for ApiTree projects.",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/ApiTreeCZ/toolbox",
|
|
8
|
+
"directory": "packages/vitest-config"
|
|
9
|
+
},
|
|
10
|
+
"sideEffects": false,
|
|
11
|
+
"type": "module",
|
|
12
|
+
"exports": {
|
|
13
|
+
".": "./dist/index.js",
|
|
14
|
+
"./react": "./dist/react.js"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist"
|
|
18
|
+
],
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"@vitejs/plugin-react": "^4.1.0",
|
|
21
|
+
"@vitest/coverage-istanbul": "^0.34.6",
|
|
22
|
+
"vite": "^4.5.0"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"vitest": "^0.34.6"
|
|
26
|
+
},
|
|
27
|
+
"peerDependencies": {
|
|
28
|
+
"vitest": "^0.34.6"
|
|
29
|
+
},
|
|
30
|
+
"scripts": {
|
|
31
|
+
"build": "tsc --build tsconfig.build.json",
|
|
32
|
+
"cleanup": "rimraf .eslintcache .turbo tsconfig.tsbuildinfo tsconfig.build.tsbuildinfo dist node_modules",
|
|
33
|
+
"fix": "run-p ts format:fix lint:fix",
|
|
34
|
+
"format": "prettier --check \"./**/*.{json,md}\"",
|
|
35
|
+
"format:fix": "pnpm run format --write",
|
|
36
|
+
"lint": "eslint --cache --ext cjs,js,ts .",
|
|
37
|
+
"lint:fix": "pnpm run lint --fix",
|
|
38
|
+
"qa": "run-p ts format lint",
|
|
39
|
+
"ts": "tsc --build tsconfig.json"
|
|
40
|
+
}
|
|
41
|
+
}
|