@pplancq/react-template 2.10.0 → 2.10.2
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/.env.mock +1 -1
- package/.prettierignore +8 -0
- package/.stylelintignore +4 -0
- package/CHANGELOG.md +41 -0
- package/_README.md +2 -2
- package/bin/template-install.js +8 -8
- package/commitlint.config.mjs +1 -1
- package/eslint.config.mjs +12 -9
- package/lint-staged.config.mjs +5 -5
- package/mise.toml +2 -2
- package/mocks/handlers/userHandlers.ts +1 -3
- package/mrc.playwright.config.ts +14 -14
- package/package.json +20 -22
- package/playwright.config.ts +21 -21
- package/prettier.config.mjs +1 -1
- package/rsbuild.config.ts +23 -23
- package/scripts/lint.js +4 -4
- package/scripts/playwright.js +19 -19
- package/scripts/removeDemo.cjs +115 -89
- package/scripts/test.js +6 -6
- package/src/app/App.tsx +5 -7
- package/src/app/assets/css/reset.css +3 -3
- package/src/app/providers/Providers/Providers.tsx +5 -7
- package/src/app/providers/QueryClientProvider/QueryClientProvider.tsx +6 -8
- package/src/demo/application/use-cases/GetArchitecturePrinciplesUseCase.ts +1 -3
- package/src/demo/application/use-cases/GetDemoUsersUseCase.ts +1 -3
- package/src/demo/infrastructure/repositories/StaticArchitecturePrincipleRepository.ts +1 -3
- package/src/demo/ui/components/DemoFooter/DemoFooter.tsx +8 -10
- package/src/demo/ui/components/DemoHeader/DemoHeader.module.css +2 -2
- package/src/demo/ui/components/DemoHeader/DemoHeader.tsx +15 -17
- package/src/demo/ui/components/DemoNavigation/DemoNavigation.module.css +2 -2
- package/src/demo/ui/components/Input/Input.module.scss +2 -2
- package/src/demo/ui/components/Logo/Logo.tsx +3 -3
- package/src/demo/ui/forms/ProfileForm/ProfileForm.module.scss +1 -1
- package/src/demo/ui/layouts/DemoLayout/DemoLayout.tsx +5 -7
- package/src/demo/ui/layouts/MainTemplate/MainTemplate.module.css +3 -3
- package/src/demo/ui/layouts/MainTemplate/MainTemplate.tsx +10 -12
- package/src/demo/ui/pages/DemoHome/DemoHome.module.scss +23 -23
- package/src/demo/ui/pages/DemoHome/DemoHome.tsx +96 -98
- package/src/demo/ui/pages/DependencyInjectionDemo/DependencyInjectionDemo.module.scss +5 -5
- package/src/demo/ui/pages/ReactHookFormDemo/ReactHookFormDemo.module.scss +4 -4
- package/src/demo/ui/pages/ReactQueryDemo/ReactQueryDemo.module.scss +5 -5
- package/stylelint.config.mjs +1 -1
- package/vitest.config.mts +22 -22
- package/vitest.setup.ts +5 -5
- package/playwright-report/html/index.html +0 -90
- package/playwright-report/sonar-results.xml +0 -20
- package/test-results/.last-run.json +0 -4
|
@@ -4,52 +4,52 @@
|
|
|
4
4
|
|
|
5
5
|
.container {
|
|
6
6
|
display: flex;
|
|
7
|
-
padding-top: 32px;
|
|
8
7
|
flex-direction: column;
|
|
9
8
|
align-items: center;
|
|
10
9
|
justify-content: center;
|
|
10
|
+
padding-top: 32px;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
.bigTitleStyle {
|
|
14
14
|
font-family: sans-serif;
|
|
15
15
|
font-size: 40px;
|
|
16
16
|
font-weight: 400;
|
|
17
|
-
|
|
17
|
+
color: #00008f;
|
|
18
18
|
text-align: center;
|
|
19
19
|
text-transform: uppercase;
|
|
20
|
-
|
|
20
|
+
letter-spacing: 1px;
|
|
21
21
|
|
|
22
22
|
span {
|
|
23
23
|
display: grid;
|
|
24
|
-
margin-top: 5px;
|
|
25
|
-
grid-template-columns: 1fr max-content 1fr;
|
|
26
24
|
grid-template-rows: 27px 0;
|
|
27
|
-
|
|
25
|
+
grid-template-columns: 1fr max-content 1fr;
|
|
28
26
|
gap: 20px;
|
|
27
|
+
align-items: center;
|
|
28
|
+
margin-top: 5px;
|
|
29
29
|
font-family: Raleway, sans-serif;
|
|
30
30
|
font-size: 15px;
|
|
31
31
|
font-weight: 500;
|
|
32
|
-
|
|
32
|
+
color: #444;
|
|
33
33
|
text-transform: uppercase;
|
|
34
34
|
word-spacing: 1px;
|
|
35
|
-
|
|
35
|
+
letter-spacing: 2px;
|
|
36
36
|
|
|
37
37
|
&::before {
|
|
38
38
|
display: block;
|
|
39
39
|
height: 5px;
|
|
40
|
+
content: "";
|
|
41
|
+
background-color: #f8f8f8;
|
|
40
42
|
border-top: 1px solid #ccc;
|
|
41
43
|
border-bottom: 1px solid #ccc;
|
|
42
|
-
background-color: #f8f8f8;
|
|
43
|
-
content: "";
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
&::after {
|
|
47
47
|
display: block;
|
|
48
48
|
height: 5px;
|
|
49
|
+
content: " ";
|
|
50
|
+
background-color: #f8f8f8;
|
|
49
51
|
border-top: 1px solid #ccc;
|
|
50
52
|
border-bottom: 1px solid #ccc;
|
|
51
|
-
background-color: #f8f8f8;
|
|
52
|
-
content: " ";
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
}
|
|
@@ -69,12 +69,12 @@
|
|
|
69
69
|
|
|
70
70
|
.titleStyle {
|
|
71
71
|
position: relative;
|
|
72
|
-
margin-left: 8px;
|
|
73
72
|
padding-bottom: 10px;
|
|
73
|
+
margin-left: 8px;
|
|
74
74
|
font-size: 20px;
|
|
75
75
|
font-weight: 500;
|
|
76
|
-
letter-spacing: 0;
|
|
77
76
|
line-height: 1.5em;
|
|
77
|
+
letter-spacing: 0;
|
|
78
78
|
|
|
79
79
|
&::before {
|
|
80
80
|
position: absolute;
|
|
@@ -82,8 +82,8 @@
|
|
|
82
82
|
left: 0;
|
|
83
83
|
width: 55px;
|
|
84
84
|
height: 5px;
|
|
85
|
-
background-color: #111;
|
|
86
85
|
content: "";
|
|
86
|
+
background-color: #111;
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
&::after {
|
|
@@ -93,8 +93,8 @@
|
|
|
93
93
|
width: 95%;
|
|
94
94
|
max-width: 255px;
|
|
95
95
|
height: 1px;
|
|
96
|
-
background-color: #333;
|
|
97
96
|
content: "";
|
|
97
|
+
background-color: #333;
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
100
|
|
|
@@ -118,10 +118,10 @@
|
|
|
118
118
|
}
|
|
119
119
|
|
|
120
120
|
.a {
|
|
121
|
+
color: #00008f;
|
|
122
|
+
text-transform: uppercase;
|
|
121
123
|
letter-spacing: 4px;
|
|
122
124
|
text-decoration: none;
|
|
123
|
-
text-transform: uppercase;
|
|
124
|
-
color: #00008f;
|
|
125
125
|
}
|
|
126
126
|
|
|
127
127
|
.a:hover {
|
|
@@ -132,8 +132,8 @@ table,
|
|
|
132
132
|
th,
|
|
133
133
|
td {
|
|
134
134
|
padding: 6px;
|
|
135
|
-
border: 1px solid black;
|
|
136
135
|
font-family: sans-serif;
|
|
136
|
+
border: 1px solid black;
|
|
137
137
|
}
|
|
138
138
|
|
|
139
139
|
.tableWrapper {
|
|
@@ -151,11 +151,11 @@ table {
|
|
|
151
151
|
}
|
|
152
152
|
|
|
153
153
|
.infoSection {
|
|
154
|
+
padding: 16px;
|
|
154
155
|
margin: 16px;
|
|
155
156
|
margin-bottom: 20px;
|
|
156
|
-
padding: 16px;
|
|
157
|
-
border-radius: 8px;
|
|
158
157
|
background-color: #f5f5f5;
|
|
158
|
+
border-radius: 8px;
|
|
159
159
|
box-shadow: 0 4px 8px rgb(0 0 0 / 10%);
|
|
160
160
|
|
|
161
161
|
&:hover {
|
|
@@ -164,8 +164,8 @@ table {
|
|
|
164
164
|
}
|
|
165
165
|
|
|
166
166
|
ul {
|
|
167
|
-
margin: 0;
|
|
168
167
|
padding: 0;
|
|
168
|
+
margin: 0;
|
|
169
169
|
list-style-type: none;
|
|
170
170
|
}
|
|
171
171
|
|
|
@@ -176,8 +176,8 @@ li {
|
|
|
176
176
|
|
|
177
177
|
code {
|
|
178
178
|
padding: 2px 5px;
|
|
179
|
-
border-radius: 4px;
|
|
180
179
|
font-family: "Courier New", monospace;
|
|
181
180
|
font-size: 14px;
|
|
182
181
|
background-color: #f8f9fa;
|
|
182
|
+
border-radius: 4px;
|
|
183
183
|
}
|
|
@@ -3,115 +3,113 @@ import { NavLink } from "@Demo/ui/components/NavLink/NavLink";
|
|
|
3
3
|
import { demoAppRoutes } from "@Demo/ui/routing/demoAppRoutes";
|
|
4
4
|
import classes from "./DemoHome.module.scss";
|
|
5
5
|
|
|
6
|
-
export const DemoHome = () =>
|
|
7
|
-
|
|
8
|
-
<div className={classes.
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
</div>
|
|
6
|
+
export const DemoHome = () => (
|
|
7
|
+
<div className={classes.container}>
|
|
8
|
+
<div className={classes.bigTitleStyle}>
|
|
9
|
+
Welcome to Your React Starter Kit <span>Clean Architecture</span>
|
|
10
|
+
</div>
|
|
12
11
|
|
|
13
|
-
|
|
12
|
+
<div className={classes.foo}>Vertical slices, shared kernel, and explicit composition.</div>
|
|
14
13
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
</div>
|
|
14
|
+
<div className={classes.paragraphContainer}>
|
|
15
|
+
<h1 className={classes.titleStyle}>Overview</h1>
|
|
16
|
+
<div className={classes.infoSection}>
|
|
17
|
+
<span className={classes.centredText}>
|
|
18
|
+
<p className={classes.paragraphStyle}>
|
|
19
|
+
This template now starts from a <span className={classes.highlight}>Clean Architecture</span> inspired
|
|
20
|
+
structure with a dedicated <span className={classes.boldText}>app</span> bootstrap layer, a{" "}
|
|
21
|
+
<span className={classes.boldText}>shared</span> common layer, and a{" "}
|
|
22
|
+
<span className={classes.boldText}>demo</span> bounded context.
|
|
23
|
+
</p>
|
|
24
|
+
<p className={classes.paragraphStyle}>
|
|
25
|
+
The goal is to help you start from explicit architecture choices while still keeping a runnable example
|
|
26
|
+
project that demonstrates routing, form handling, data fetching, and dependency injection.
|
|
27
|
+
</p>
|
|
28
|
+
</span>
|
|
31
29
|
</div>
|
|
32
|
-
|
|
30
|
+
</div>
|
|
31
|
+
<img src={image} alt="Template architecture overview" className={classes.imagePlace} />
|
|
33
32
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
</div>
|
|
33
|
+
<div className={classes.paragraphContainer}>
|
|
34
|
+
<h1 className={classes.titleStyle}>Folder Structure</h1>
|
|
35
|
+
<div className={classes.infoSection}>
|
|
36
|
+
<div className={classes.tableWrapper}>
|
|
37
|
+
<table>
|
|
38
|
+
<thead>
|
|
39
|
+
<tr>
|
|
40
|
+
<th>Folder</th>
|
|
41
|
+
<th>Description</th>
|
|
42
|
+
</tr>
|
|
43
|
+
</thead>
|
|
44
|
+
<tbody>
|
|
45
|
+
<tr>
|
|
46
|
+
<td>
|
|
47
|
+
<span className={classes.boldText}>app</span>
|
|
48
|
+
</td>
|
|
49
|
+
<td>Application bootstrap, routing, providers, config, and global assets.</td>
|
|
50
|
+
</tr>
|
|
51
|
+
<tr>
|
|
52
|
+
<td>
|
|
53
|
+
<span className={classes.boldText}>shared</span>
|
|
54
|
+
</td>
|
|
55
|
+
<td>Reusable common code with no demo-specific responsibility.</td>
|
|
56
|
+
</tr>
|
|
57
|
+
<tr>
|
|
58
|
+
<td>
|
|
59
|
+
<span className={classes.boldText}>demo</span>
|
|
60
|
+
</td>
|
|
61
|
+
<td>Example bounded context split into ui, application, domain, and infrastructure.</td>
|
|
62
|
+
</tr>
|
|
63
|
+
</tbody>
|
|
64
|
+
</table>
|
|
67
65
|
</div>
|
|
68
66
|
</div>
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
</
|
|
67
|
+
</div>
|
|
68
|
+
<div className={classes.paragraphContainer}>
|
|
69
|
+
<h1 className={classes.titleStyle}>Pedagogical Demos</h1>
|
|
70
|
+
<div className={classes.infoSection}>
|
|
71
|
+
<p className={classes.paragraphStyle}>
|
|
72
|
+
Each page below demonstrates a different aspect of the template. The React Query example resolves its use case
|
|
73
|
+
through Inversify, the React Hook Form example stays focused on UI composition, and the dependency injection
|
|
74
|
+
example makes the layer boundaries explicit.
|
|
75
|
+
</p>
|
|
76
|
+
</div>
|
|
78
77
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
</div>
|
|
78
|
+
<div className={classes.infoSection}>
|
|
79
|
+
<p className={classes.paragraphStyle}>
|
|
80
|
+
<span className={classes.boldText}>React Query demo: </span>
|
|
81
|
+
fetches remote users through a repository and a use case.
|
|
82
|
+
</p>
|
|
83
|
+
<div className={classes.demoStyle}>
|
|
84
|
+
<NavLink to={demoAppRoutes.reactQuery} className={classes.a}>
|
|
85
|
+
Run demo
|
|
86
|
+
</NavLink>
|
|
89
87
|
</div>
|
|
88
|
+
</div>
|
|
90
89
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
</div>
|
|
90
|
+
<div className={classes.infoSection}>
|
|
91
|
+
<p className={classes.paragraphStyle}>
|
|
92
|
+
<span className={classes.boldText}>React Hook Form demo: </span>
|
|
93
|
+
shows a form-first UI example inside the new bounded context.
|
|
94
|
+
</p>
|
|
95
|
+
<div className={classes.demoStyle}>
|
|
96
|
+
<NavLink to={demoAppRoutes.reactHookForm} className={classes.a}>
|
|
97
|
+
Run demo
|
|
98
|
+
</NavLink>
|
|
101
99
|
</div>
|
|
100
|
+
</div>
|
|
102
101
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
</div>
|
|
102
|
+
<div className={classes.infoSection}>
|
|
103
|
+
<p className={classes.paragraphStyle}>
|
|
104
|
+
<span className={classes.boldText}>Dependency injection demo: </span>
|
|
105
|
+
explains how app, shared, and demo collaborate through explicit abstractions.
|
|
106
|
+
</p>
|
|
107
|
+
<div className={classes.demoStyle}>
|
|
108
|
+
<NavLink to={demoAppRoutes.dependencyInjection} className={classes.a}>
|
|
109
|
+
Run demo
|
|
110
|
+
</NavLink>
|
|
113
111
|
</div>
|
|
114
112
|
</div>
|
|
115
113
|
</div>
|
|
116
|
-
|
|
117
|
-
|
|
114
|
+
</div>
|
|
115
|
+
);
|
|
@@ -3,17 +3,17 @@
|
|
|
3
3
|
}
|
|
4
4
|
|
|
5
5
|
.fieldsetStyle {
|
|
6
|
-
margin-top: 24px;
|
|
7
6
|
padding: 16px;
|
|
7
|
+
margin-top: 24px;
|
|
8
8
|
border: 1px solid black;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
.title {
|
|
12
12
|
padding-top: 16px;
|
|
13
13
|
font-size: 20px;
|
|
14
|
-
letter-spacing: 4px;
|
|
15
|
-
text-align: center;
|
|
16
14
|
color: #00008f;
|
|
15
|
+
text-align: center;
|
|
16
|
+
letter-spacing: 4px;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
.tableWrapper {
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
padding-top: 16px;
|
|
25
25
|
padding-bottom: 16px;
|
|
26
26
|
font-size: 20px;
|
|
27
|
-
letter-spacing: 4px;
|
|
28
|
-
text-align: center;
|
|
29
27
|
color: #00008f;
|
|
28
|
+
text-align: center;
|
|
29
|
+
letter-spacing: 4px;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
.lineStyle {
|
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
.title {
|
|
10
10
|
padding-top: 16px;
|
|
11
11
|
font-size: 20px;
|
|
12
|
-
letter-spacing: 4px;
|
|
13
|
-
text-align: center;
|
|
14
12
|
color: #00008f;
|
|
13
|
+
text-align: center;
|
|
14
|
+
letter-spacing: 4px;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
.lineStyle {
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
|
|
25
25
|
.profileSectionStyle {
|
|
26
26
|
display: flex;
|
|
27
|
-
padding-top: 16px;
|
|
28
|
-
padding-bottom: 16px;
|
|
29
27
|
flex-flow: row wrap;
|
|
30
28
|
align-items: center;
|
|
31
29
|
justify-content: space-around;
|
|
30
|
+
padding-top: 16px;
|
|
31
|
+
padding-bottom: 16px;
|
|
32
32
|
}
|
|
@@ -3,17 +3,17 @@
|
|
|
3
3
|
}
|
|
4
4
|
|
|
5
5
|
.fieldsetStyle {
|
|
6
|
-
margin-top: 24px;
|
|
7
6
|
padding: 16px;
|
|
7
|
+
margin-top: 24px;
|
|
8
8
|
border: 1px solid black;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
.title {
|
|
12
12
|
padding-top: 16px;
|
|
13
13
|
font-size: 20px;
|
|
14
|
-
letter-spacing: 4px;
|
|
15
|
-
text-align: center;
|
|
16
14
|
color: #00008f;
|
|
15
|
+
text-align: center;
|
|
16
|
+
letter-spacing: 4px;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
.tableWrapper {
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
padding-top: 16px;
|
|
25
25
|
padding-bottom: 16px;
|
|
26
26
|
font-size: 20px;
|
|
27
|
-
letter-spacing: 4px;
|
|
28
|
-
text-align: center;
|
|
29
27
|
color: #00008f;
|
|
28
|
+
text-align: center;
|
|
29
|
+
letter-spacing: 4px;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
.lineStyle {
|
package/stylelint.config.mjs
CHANGED
package/vitest.config.mts
CHANGED
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
import react from
|
|
2
|
-
import { loadEnv } from
|
|
3
|
-
import svgr from
|
|
1
|
+
import react from "@vitejs/plugin-react";
|
|
2
|
+
import { loadEnv } from "vite";
|
|
3
|
+
import svgr from "vite-plugin-svgr";
|
|
4
4
|
// eslint-disable-next-line import/no-unresolved
|
|
5
|
-
import { defineConfig } from
|
|
5
|
+
import { defineConfig } from "vitest/config";
|
|
6
6
|
|
|
7
7
|
export default defineConfig(({ mode }) => {
|
|
8
|
-
const env = loadEnv(mode, process.cwd(),
|
|
8
|
+
const env = loadEnv(mode, process.cwd(), "");
|
|
9
9
|
|
|
10
10
|
return {
|
|
11
11
|
plugins: [react(), svgr()],
|
|
12
|
-
envPrefix: env.ENV_PREFIX ??
|
|
12
|
+
envPrefix: env.ENV_PREFIX ?? "FRONT_",
|
|
13
13
|
resolve: {
|
|
14
14
|
tsconfigPaths: true,
|
|
15
15
|
},
|
|
16
16
|
test: {
|
|
17
17
|
globals: true,
|
|
18
|
-
environment:
|
|
19
|
-
setupFiles:
|
|
18
|
+
environment: "jsdom",
|
|
19
|
+
setupFiles: "vitest.setup.ts",
|
|
20
20
|
clearMocks: true,
|
|
21
21
|
css: {
|
|
22
22
|
modules: {
|
|
23
|
-
classNameStrategy:
|
|
23
|
+
classNameStrategy: "non-scoped",
|
|
24
24
|
},
|
|
25
25
|
},
|
|
26
|
-
reporters: [
|
|
26
|
+
reporters: ["default", "junit", "vitest-sonar-reporter"],
|
|
27
27
|
outputFile: {
|
|
28
|
-
|
|
29
|
-
junit:
|
|
28
|
+
"vitest-sonar-reporter": "sonar-report.xml",
|
|
29
|
+
junit: "junit-report.xml",
|
|
30
30
|
},
|
|
31
|
-
include: [
|
|
31
|
+
include: ["tests/unit/**/*.(spec|test|steps).[jt]s?(x)"],
|
|
32
32
|
maxWorkers: env.CI ? 2 : undefined,
|
|
33
33
|
coverage: {
|
|
34
|
-
enabled: env.CI ===
|
|
35
|
-
reporter: [
|
|
36
|
-
provider:
|
|
34
|
+
enabled: env.CI === "true",
|
|
35
|
+
reporter: ["lcovonly", "html", "text", "text-summary"],
|
|
36
|
+
provider: "v8",
|
|
37
37
|
lines: 80,
|
|
38
38
|
functions: 75,
|
|
39
39
|
branches: 80,
|
|
40
40
|
statements: 80,
|
|
41
|
-
include: [
|
|
41
|
+
include: ["src/**/*.[jt]s?(x)"],
|
|
42
42
|
exclude: [
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
43
|
+
"src/**/*.d.[jt]s?(x)",
|
|
44
|
+
"src/utils/tests/**/*.[jt]s?(x)",
|
|
45
|
+
"src/**/*.types.[jt]s?(x)",
|
|
46
|
+
"src/**/index.[jt]s?(x)",
|
|
47
|
+
"src/**/*.stories.[jt]s?(x)",
|
|
48
48
|
],
|
|
49
49
|
},
|
|
50
50
|
},
|
package/vitest.setup.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/* eslint-disable import/no-extraneous-dependencies */
|
|
2
|
-
import
|
|
3
|
-
import { server } from
|
|
4
|
-
import { cleanup } from
|
|
5
|
-
import * as matchers from
|
|
2
|
+
import "@testing-library/jest-dom/vitest";
|
|
3
|
+
import { server } from "@Mocks/server";
|
|
4
|
+
import { cleanup } from "@testing-library/react";
|
|
5
|
+
import * as matchers from "vitest-axe/matchers";
|
|
6
6
|
|
|
7
7
|
expect.extend(matchers);
|
|
8
8
|
|
|
9
9
|
beforeAll(() => {
|
|
10
|
-
server.listen({ onUnhandledRequest:
|
|
10
|
+
server.listen({ onUnhandledRequest: "error" });
|
|
11
11
|
});
|
|
12
12
|
|
|
13
13
|
afterAll(() => {
|