@pplancq/react-template 2.5.0 → 2.6.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.
package/.env CHANGED
@@ -27,12 +27,6 @@
27
27
  # Default is false
28
28
  #DISABLE_ESLINT_PLUGIN=false
29
29
 
30
- # Specify the type of configuration to use with ESLint.
31
- # - 'eslintrc' is the classic configuration format available in most ESLint versions.
32
- # - 'flat' is the new format introduced in ESLint 8.21.0.
33
- # Default is 'eslintrc'
34
- ESLINT_CONFIG_TYPE='flat'
35
-
36
30
  # Allows you to deactivate the sourcemap
37
31
  # Default is false
38
32
  #DISABLE_SOURCE_MAP=false
package/.env.mock ADDED
@@ -0,0 +1 @@
1
+ FRONT_MOCK_ENABLE=true
package/CHANGELOG.md CHANGED
@@ -1,3 +1,21 @@
1
+ ## @pplancq/react-template [2.6.0](https://github.com/pplancq/dev-tools/compare/@pplancq/react-template@2.5.0...@pplancq/react-template@2.6.0) (2025-06-16)
2
+
3
+ ### Features
4
+
5
+ * **react-template:** migrate to rsbuild and update configuration ([16c9362](https://github.com/pplancq/dev-tools/commit/16c9362d5478a6efd50ff4ea3dedee733807becb))
6
+ * **create-react-app:** remove Vite support and update documentation ([6702c40](https://github.com/pplancq/dev-tools/commit/6702c407da239438e6767b06eaa96aac70645996))
7
+
8
+ ### Bug Fixes
9
+
10
+ * **deps:** update dependency @hookform/resolvers to ^5.1.1 ([7822d53](https://github.com/pplancq/dev-tools/commit/7822d53ab18348e0b66ae1f17ec800d0587b8cea))
11
+ * **deps:** update react-query mono repo to ^5.80.7 ([3fd7b8c](https://github.com/pplancq/dev-tools/commit/3fd7b8cb3a7f30aebec0c87ac5cc8dbad0610fc3))
12
+
13
+
14
+ ### Dependencies
15
+
16
+ * **@pplancq/eslint-config:** upgraded to 4.2.0
17
+ * **@pplancq/postcss-config:** upgraded to 2.1.13
18
+
1
19
  ## @pplancq/react-template [2.5.0](https://github.com/pplancq/dev-tools/compare/@pplancq/react-template@2.4.5...@pplancq/react-template@2.5.0) (2025-06-09)
2
20
 
3
21
  ### Features
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pplancq/react-template",
3
- "version": "2.5.0",
3
+ "version": "2.6.0",
4
4
  "license": "MIT",
5
5
  "description": "react template",
6
6
  "author": "pplancq <paul.plancq@outlook.fr>",
@@ -11,9 +11,10 @@
11
11
  },
12
12
  "type": "module",
13
13
  "scripts": {
14
- "start": "webpack serve",
15
- "start:mock": "webpack serve --env FRONT_MOCK_ENABLE=true",
16
- "build": "webpack --mode production",
14
+ "start": "rsbuild dev",
15
+ "start:mock": "rsbuild dev --env-mode mock",
16
+ "build": "rsbuild build",
17
+ "preview": "rsbuild preview",
17
18
  "test": "node scripts/test.js",
18
19
  "test:unit": "vitest run",
19
20
  "test:unit:watch": "vitest",
@@ -33,7 +34,6 @@
33
34
  "playwright:codegen": "playwright codegen",
34
35
  "package:check": "npm exec --yes package-lock-utd@1.1.3",
35
36
  "remove:demo": "node ./scripts/removeDemo.cjs",
36
- "migrate:vite": "node ./scripts/migrateToVite.cjs",
37
37
  "_prepare": "husky",
38
38
  "_postinstall": "msw init"
39
39
  },
@@ -45,9 +45,9 @@
45
45
  "template"
46
46
  ],
47
47
  "dependencies": {
48
- "@hookform/resolvers": "^5.0.1",
49
- "@tanstack/react-query": "^5.80.6",
50
- "@tanstack/react-query-devtools": "^5.80.6",
48
+ "@hookform/resolvers": "^5.1.1",
49
+ "@tanstack/react-query": "^5.80.7",
50
+ "@tanstack/react-query-devtools": "^5.80.7",
51
51
  "react": "^19.1.0",
52
52
  "react-dom": "^19.1.0",
53
53
  "react-hook-form": "^7.57.0",
@@ -57,20 +57,23 @@
57
57
  "devDependencies": {
58
58
  "@bdellegrazie/playwright-sonar-reporter": "^0.4.0",
59
59
  "@commitlint/cli": "^19.8.1",
60
- "@playwright/test": "^1.52.0",
60
+ "@playwright/test": "^1.53.0",
61
61
  "@pplancq/commitlint-config": "*",
62
62
  "@pplancq/eslint-config": "*",
63
63
  "@pplancq/postcss-config": "*",
64
64
  "@pplancq/prettier-config": "*",
65
65
  "@pplancq/stylelint-config": "*",
66
- "@pplancq/webpack-config": "*",
66
+ "@rsbuild/core": "^1.3.22",
67
+ "@rsbuild/plugin-eslint": "^1.1.1",
68
+ "@rsbuild/plugin-react": "^1.3.2",
69
+ "@rsbuild/plugin-sass": "^1.3.2",
67
70
  "@testing-library/jest-dom": "^6.6.3",
68
71
  "@testing-library/react": "^16.3.0",
69
72
  "@testing-library/user-event": "^14.6.1",
70
- "@types/react": "^19.1.6",
73
+ "@types/react": "^19.1.8",
71
74
  "@types/react-dom": "^19.1.6",
72
- "@vitejs/plugin-react-swc": "^3.10.1",
73
- "@vitest/coverage-v8": "^3.2.2",
75
+ "@vitejs/plugin-react-swc": "^3.10.2",
76
+ "@vitest/coverage-v8": "^3.2.3",
74
77
  "concurrently": "^9.1.2",
75
78
  "eslint": "^9.28.0",
76
79
  "eslint-plugin-prettier": "^5.4.1",
@@ -78,28 +81,26 @@
78
81
  "jsdom": "^26.1.0",
79
82
  "lint-staged": "^16.1.0",
80
83
  "monocart-coverage-reports": "^2.12.6",
81
- "msw": "^2.9.0",
84
+ "msw": "^2.10.2",
82
85
  "nodemon": "^3.1.10",
83
86
  "prettier": "^3.5.3",
84
87
  "stylelint": "^16.20.0",
85
88
  "stylelint-prettier": "^5.0.3",
89
+ "stylelint-webpack-plugin": "^5.0.1",
86
90
  "tsc-files": "^1.1.4",
87
91
  "typescript": "^5.8.3",
88
92
  "vite-plugin-svgr": "^4.3.0",
89
93
  "vite-tsconfig-paths": "^5.1.4",
90
- "vitest": "^3.2.2",
94
+ "vitest": "^3.2.3",
91
95
  "vitest-axe": "^1.0.0-pre.5",
92
- "vitest-sonar-reporter": "^2.0.1",
93
- "webpack": "^5.99.9",
94
- "webpack-cli": "^6.0.1",
95
- "webpack-dev-server": "^5.2.2"
96
+ "vitest-sonar-reporter": "^2.0.1"
96
97
  },
97
98
  "engines": {
98
99
  "node": ">=20.12.2"
99
100
  },
100
101
  "volta": {
101
102
  "node": "22.16.0",
102
- "npm": "11.4.1"
103
+ "npm": "11.4.2"
103
104
  },
104
105
  "browserslist": {
105
106
  "production": [
@@ -0,0 +1,80 @@
1
+ import { defineConfig, loadEnv } from '@rsbuild/core';
2
+ import { pluginEslint } from '@rsbuild/plugin-eslint';
3
+ import { pluginReact } from '@rsbuild/plugin-react';
4
+ import { pluginSass } from '@rsbuild/plugin-sass';
5
+ import StylelintPlugin from 'stylelint-webpack-plugin';
6
+ import packageJson from './package.json';
7
+
8
+ const resolveModule = (module: string) => {
9
+ try {
10
+ require.resolve(module);
11
+ return true;
12
+ } catch {
13
+ return false;
14
+ }
15
+ };
16
+
17
+ const { publicVars } = loadEnv({ prefixes: [process.env.ENV_PREFIX ?? 'FRONT_'] });
18
+
19
+ const publicUrl = process.env.PUBLIC_URL ?? (packageJson as { homepage?: string }).homepage ?? '/';
20
+ const publicPath = new URL(publicUrl.endsWith('/') ? publicUrl : `${publicUrl}/`, 'http://localhost').pathname;
21
+ const disableSourceMap = (process.env.DISABLE_SOURCE_MAP ?? 'false') === 'true' ? false : 'source-map';
22
+ const disableStyleLintPlugin =
23
+ (process.env.DISABLE_STYLELINT_PLUGIN ?? 'false') === 'true' || !resolveModule('stylelint');
24
+
25
+ export default defineConfig(({ env }) => {
26
+ const isProduction = env === 'production';
27
+
28
+ return {
29
+ plugins: [
30
+ pluginReact(),
31
+ pluginSass(),
32
+ !isProduction &&
33
+ pluginEslint({
34
+ enable: (process.env.DISABLE_ESLINT_PLUGIN ?? 'false') === 'true' || !resolveModule('eslint'),
35
+ }),
36
+ ].filter(Boolean),
37
+ source: {
38
+ entry: {
39
+ index: 'src/main.ts',
40
+ },
41
+ define: publicVars,
42
+ },
43
+ output: {
44
+ assetPrefix: publicPath,
45
+ sourceMap: {
46
+ js: isProduction ? disableSourceMap : 'cheap-module-source-map',
47
+ css: (process.env.DISABLE_SOURCE_MAP ?? 'false') !== 'true',
48
+ },
49
+ distPath: {
50
+ root: 'build',
51
+ },
52
+ copy: [
53
+ {
54
+ from: 'public',
55
+ to: '.',
56
+ },
57
+ ],
58
+ },
59
+ server: {
60
+ port: parseInt(process.env.PORT ?? '3000', 10),
61
+ open: (process.env.BROWSER ?? 'false') === 'true',
62
+ },
63
+ tools: {
64
+ rspack: {
65
+ plugins: [
66
+ !disableStyleLintPlugin &&
67
+ new StylelintPlugin({
68
+ extensions: ['css', 'scss', 'sass'],
69
+ stylelintPath: require.resolve('stylelint'),
70
+ failOnError: isProduction,
71
+ context: 'src',
72
+ }),
73
+ ].filter(Boolean),
74
+ },
75
+ },
76
+ html: {
77
+ template: './index.html',
78
+ },
79
+ };
80
+ });
@@ -3,7 +3,7 @@
3
3
  exports[`Footer Component > should render the Footer component correctly 1`] = `
4
4
  <div>
5
5
  <div
6
- class="_container_eb428f"
6
+ class="_container_acfd2c"
7
7
  >
8
8
  <hr />
9
9
  <a
@@ -12,7 +12,7 @@ exports[`Footer Component > should render the Footer component correctly 1`] = `
12
12
  >
13
13
  <img
14
14
  alt="logo"
15
- class="_logoStyle_a0661f"
15
+ class="_logoStyle_9e86a7"
16
16
  src="/src/assets/images/logo.png"
17
17
  style="width: 50px;"
18
18
  />
@@ -3,7 +3,7 @@
3
3
  exports[`Header Component > should render the Header component correctly 1`] = `
4
4
  <div>
5
5
  <div
6
- class="_container_63c2ea"
6
+ class="_container_a5b977"
7
7
  >
8
8
  <a
9
9
  data-discover="true"
@@ -11,19 +11,19 @@ exports[`Header Component > should render the Header component correctly 1`] = `
11
11
  >
12
12
  <img
13
13
  alt="logo"
14
- class="_logoStyle_a0661f"
14
+ class="_logoStyle_9e86a7"
15
15
  src="/src/assets/images/logo.png"
16
16
  style="width: 50px;"
17
17
  />
18
18
  </a>
19
19
  <nav>
20
20
  <ul
21
- class="_navList_75d6d6"
21
+ class="_navList_eee024"
22
22
  >
23
23
  <li>
24
24
  <a
25
25
  aria-current="page"
26
- class="_a_75d6d6 active"
26
+ class="_a_eee024 active"
27
27
  data-discover="true"
28
28
  href="/"
29
29
  >
@@ -3,10 +3,10 @@
3
3
  exports[`Demo Component > should render the Demo component correctly 1`] = `
4
4
  <div>
5
5
  <div
6
- class="_container_85a2c3"
6
+ class="_container_af1029"
7
7
  >
8
8
  <div
9
- class="_bigTitleStyle_85a2c3"
9
+ class="_bigTitleStyle_af1029"
10
10
  >
11
11
  Welcome to Your React Starter Kit
12
12
  <span>
@@ -14,43 +14,43 @@ exports[`Demo Component > should render the Demo component correctly 1`] = `
14
14
  </span>
15
15
  </div>
16
16
  <div
17
- class="_foo_85a2c3"
17
+ class="_foo_af1029"
18
18
  >
19
19
  FlexBlug
20
20
  </div>
21
21
  <div
22
- class="_paragraphContainer_85a2c3"
22
+ class="_paragraphContainer_af1029"
23
23
  >
24
24
  <h1
25
- class="_titleStyle_85a2c3"
25
+ class="_titleStyle_af1029"
26
26
  >
27
27
  Overview
28
28
  </h1>
29
29
  <div
30
- class="_infoSection_85a2c3"
30
+ class="_infoSection_af1029"
31
31
  >
32
32
  <span
33
- class="_centredText_85a2c3"
33
+ class="_centredText_af1029"
34
34
  >
35
35
  <p
36
- class="_paragraphStyle_85a2c3"
36
+ class="_paragraphStyle_af1029"
37
37
  >
38
38
  <span
39
- class="_highlight_85a2c3"
39
+ class="_highlight_af1029"
40
40
  >
41
41
  Congratulations
42
42
  </span>
43
43
  on starting your project with our
44
44
 
45
45
  <span
46
- class="_highlight_85a2c3"
46
+ class="_highlight_af1029"
47
47
  >
48
48
  React Starter Kit!
49
49
  </span>
50
50
  This kit is designed to jumpstart your development with a well-organized project structure and pre-configured tools.
51
51
  </p>
52
52
  <p
53
- class="_paragraphStyle_85a2c3"
53
+ class="_paragraphStyle_af1029"
54
54
  >
55
55
  Below, you'll find an overview of the key features, tools, and architecture used in this starter kit.
56
56
  </p>
@@ -59,61 +59,61 @@ exports[`Demo Component > should render the Demo component correctly 1`] = `
59
59
  </div>
60
60
  <img
61
61
  alt="template"
62
- class="_imagePlace_85a2c3"
62
+ class="_imagePlace_af1029"
63
63
  src="/src/assets/images/templatePlugins.png"
64
64
  />
65
65
  <div
66
- class="_paragraphContainer_85a2c3"
66
+ class="_paragraphContainer_af1029"
67
67
  >
68
68
  <h1
69
- class="_titleStyle_85a2c3"
69
+ class="_titleStyle_af1029"
70
70
  >
71
71
  Objective
72
72
  </h1>
73
73
  <div
74
- class="_infoSection_85a2c3"
74
+ class="_infoSection_af1029"
75
75
  >
76
76
  <p
77
- class="_paragraphStyle_85a2c3"
77
+ class="_paragraphStyle_af1029"
78
78
  >
79
79
  The goal of this
80
80
  <span
81
- class="_boldText_85a2c3"
81
+ class="_boldText_af1029"
82
82
  >
83
83
  starter kit
84
84
  </span>
85
85
  is to enable you to quickly start a new project with all the necessary tools.
86
86
  </p>
87
87
  <p
88
- class="_paragraphStyle_85a2c3"
88
+ class="_paragraphStyle_af1029"
89
89
  >
90
90
  Additionally, this
91
91
  <span
92
- class="_boldText_85a2c3"
92
+ class="_boldText_af1029"
93
93
  >
94
94
  starter kit
95
95
  </span>
96
96
  offers a robust set of options for structuring your
97
97
  <span
98
- class="_boldText_85a2c3"
98
+ class="_boldText_af1029"
99
99
  >
100
100
  React application
101
101
  </span>
102
102
  , providing flexibility to adapt to various project architectures.
103
103
  </p>
104
104
  <p
105
- class="_paragraphStyle_85a2c3"
105
+ class="_paragraphStyle_af1029"
106
106
  >
107
107
  It has been thoughtfully designed not only to expedite the initial setup but also to streamline the implementation of
108
108
  <span
109
- class="_highlight_85a2c3"
109
+ class="_highlight_af1029"
110
110
  >
111
111
  Micro-Frontends
112
112
  </span>
113
113
  , making it a versatile solution for projects of different scales. (for more details check the
114
114
 
115
115
  <span
116
- class="_highlight_85a2c3"
116
+ class="_highlight_af1029"
117
117
  >
118
118
  README.md
119
119
  </span>
@@ -122,21 +122,21 @@ exports[`Demo Component > should render the Demo component correctly 1`] = `
122
122
  </div>
123
123
  </div>
124
124
  <div
125
- class="_paragraphContainer_85a2c3"
125
+ class="_paragraphContainer_af1029"
126
126
  >
127
127
  <h1
128
- class="_titleStyle_85a2c3"
128
+ class="_titleStyle_af1029"
129
129
  >
130
130
  Features
131
131
  </h1>
132
132
  <div
133
- class="_infoSection_85a2c3"
133
+ class="_infoSection_af1029"
134
134
  >
135
135
  <p
136
- class="_paragraphStyle_85a2c3"
136
+ class="_paragraphStyle_af1029"
137
137
  >
138
138
  <span
139
- class="_boldText_85a2c3"
139
+ class="_boldText_af1029"
140
140
  >
141
141
  React:
142
142
  </span>
@@ -144,13 +144,13 @@ exports[`Demo Component > should render the Demo component correctly 1`] = `
144
144
  </p>
145
145
  </div>
146
146
  <div
147
- class="_infoSection_85a2c3"
147
+ class="_infoSection_af1029"
148
148
  >
149
149
  <p
150
- class="_paragraphStyle_85a2c3"
150
+ class="_paragraphStyle_af1029"
151
151
  >
152
152
  <span
153
- class="_boldText_85a2c3"
153
+ class="_boldText_af1029"
154
154
  >
155
155
  TypeScript:
156
156
  </span>
@@ -158,37 +158,37 @@ exports[`Demo Component > should render the Demo component correctly 1`] = `
158
158
  </p>
159
159
  </div>
160
160
  <div
161
- class="_infoSection_85a2c3"
161
+ class="_infoSection_af1029"
162
162
  >
163
163
  <p
164
- class="_paragraphStyle_85a2c3"
164
+ class="_paragraphStyle_af1029"
165
165
  >
166
166
  <span
167
- class="_boldText_85a2c3"
167
+ class="_boldText_af1029"
168
168
  >
169
169
  React Query:
170
170
  </span>
171
171
  A library for managing, caching, and updating server state in React applications. (for more details check the
172
172
 
173
173
  <span
174
- class="_highlight_85a2c3"
174
+ class="_highlight_af1029"
175
175
  >
176
176
  README.md
177
177
  </span>
178
178
  file under the
179
179
 
180
180
  <span
181
- class="_boldText_85a2c3"
181
+ class="_boldText_af1029"
182
182
  >
183
183
  hooks
184
184
  </span>
185
185
  folder)
186
186
  </p>
187
187
  <div
188
- class="_demoStyle_85a2c3"
188
+ class="_demoStyle_af1029"
189
189
  >
190
190
  <a
191
- class="_a_85a2c3"
191
+ class="_a_af1029"
192
192
  data-discover="true"
193
193
  href="/reactQueryDemo"
194
194
  >
@@ -197,36 +197,36 @@ exports[`Demo Component > should render the Demo component correctly 1`] = `
197
197
  </div>
198
198
  </div>
199
199
  <div
200
- class="_infoSection_85a2c3"
200
+ class="_infoSection_af1029"
201
201
  >
202
202
  <p
203
- class="_paragraphStyle_85a2c3"
203
+ class="_paragraphStyle_af1029"
204
204
  >
205
205
  <span
206
- class="_boldText_85a2c3"
206
+ class="_boldText_af1029"
207
207
  >
208
208
  React Hook Form:
209
209
  </span>
210
210
  A library for managing forms with React hooks. (for more details check the
211
211
  <span
212
- class="_highlight_85a2c3"
212
+ class="_highlight_af1029"
213
213
  >
214
214
  README.md
215
215
  </span>
216
216
  file under the
217
217
 
218
218
  <span
219
- class="_boldText_85a2c3"
219
+ class="_boldText_af1029"
220
220
  >
221
221
  forms
222
222
  </span>
223
223
  folder)
224
224
  </p>
225
225
  <div
226
- class="_demoStyle_85a2c3"
226
+ class="_demoStyle_af1029"
227
227
  >
228
228
  <a
229
- class="_a_85a2c3"
229
+ class="_a_af1029"
230
230
  data-discover="true"
231
231
  href="/reactHookFormDemo"
232
232
  >
@@ -235,26 +235,26 @@ exports[`Demo Component > should render the Demo component correctly 1`] = `
235
235
  </div>
236
236
  </div>
237
237
  <div
238
- class="_infoSection_85a2c3"
238
+ class="_infoSection_af1029"
239
239
  >
240
240
  <p
241
- class="_paragraphStyle_85a2c3"
241
+ class="_paragraphStyle_af1029"
242
242
  >
243
243
  <span
244
- class="_boldText_85a2c3"
244
+ class="_boldText_af1029"
245
245
  >
246
246
  React Router:
247
247
  </span>
248
248
  A declarative routing solution for React. (for more details check the
249
249
  <span
250
- class="_highlight_85a2c3"
250
+ class="_highlight_af1029"
251
251
  >
252
252
  README.md
253
253
  </span>
254
254
  file under the
255
255
 
256
256
  <span
257
- class="_boldText_85a2c3"
257
+ class="_boldText_af1029"
258
258
  >
259
259
  routing
260
260
  </span>
@@ -262,20 +262,20 @@ exports[`Demo Component > should render the Demo component correctly 1`] = `
262
262
  </p>
263
263
  </div>
264
264
  <div
265
- class="_infoSection_85a2c3"
265
+ class="_infoSection_af1029"
266
266
  >
267
267
  <p
268
- class="_paragraphStyle_85a2c3"
268
+ class="_paragraphStyle_af1029"
269
269
  >
270
270
  <span
271
- class="_boldText_85a2c3"
271
+ class="_boldText_af1029"
272
272
  >
273
273
  ...and more:
274
274
  </span>
275
275
  Explore the
276
276
 
277
277
  <span
278
- class="_highlight_85a2c3"
278
+ class="_highlight_af1029"
279
279
  >
280
280
  Package.json
281
281
  </span>
@@ -284,18 +284,18 @@ exports[`Demo Component > should render the Demo component correctly 1`] = `
284
284
  </div>
285
285
  </div>
286
286
  <div
287
- class="_paragraphContainer_85a2c3"
287
+ class="_paragraphContainer_af1029"
288
288
  >
289
289
  <h1
290
- class="_titleStyle_85a2c3"
290
+ class="_titleStyle_af1029"
291
291
  >
292
292
  Project Structure
293
293
  </h1>
294
294
  <div
295
- class="_infoSection_85a2c3"
295
+ class="_infoSection_af1029"
296
296
  >
297
297
  <div
298
- class="_tableWrapper_85a2c3"
298
+ class="_tableWrapper_af1029"
299
299
  >
300
300
  <table>
301
301
  <thead>
@@ -312,7 +312,7 @@ exports[`Demo Component > should render the Demo component correctly 1`] = `
312
312
  <tr>
313
313
  <td>
314
314
  <span
315
- class="_boldText_85a2c3"
315
+ class="_boldText_af1029"
316
316
  >
317
317
  api
318
318
  </span>
@@ -324,7 +324,7 @@ exports[`Demo Component > should render the Demo component correctly 1`] = `
324
324
  <tr>
325
325
  <td>
326
326
  <span
327
- class="_boldText_85a2c3"
327
+ class="_boldText_af1029"
328
328
  >
329
329
  assets
330
330
  </span>
@@ -336,7 +336,7 @@ exports[`Demo Component > should render the Demo component correctly 1`] = `
336
336
  <tr>
337
337
  <td>
338
338
  <span
339
- class="_boldText_85a2c3"
339
+ class="_boldText_af1029"
340
340
  >
341
341
  components
342
342
  </span>
@@ -348,7 +348,7 @@ exports[`Demo Component > should render the Demo component correctly 1`] = `
348
348
  <tr>
349
349
  <td>
350
350
  <span
351
- class="_boldText_85a2c3"
351
+ class="_boldText_af1029"
352
352
  >
353
353
  config
354
354
  </span>
@@ -360,7 +360,7 @@ exports[`Demo Component > should render the Demo component correctly 1`] = `
360
360
  <tr>
361
361
  <td>
362
362
  <span
363
- class="_boldText_85a2c3"
363
+ class="_boldText_af1029"
364
364
  >
365
365
  forms
366
366
  </span>
@@ -372,7 +372,7 @@ exports[`Demo Component > should render the Demo component correctly 1`] = `
372
372
  <tr>
373
373
  <td>
374
374
  <span
375
- class="_boldText_85a2c3"
375
+ class="_boldText_af1029"
376
376
  >
377
377
  hooks
378
378
  </span>
@@ -384,7 +384,7 @@ exports[`Demo Component > should render the Demo component correctly 1`] = `
384
384
  <tr>
385
385
  <td>
386
386
  <span
387
- class="_boldText_85a2c3"
387
+ class="_boldText_af1029"
388
388
  >
389
389
  pages
390
390
  </span>
@@ -396,7 +396,7 @@ exports[`Demo Component > should render the Demo component correctly 1`] = `
396
396
  <tr>
397
397
  <td>
398
398
  <span
399
- class="_boldText_85a2c3"
399
+ class="_boldText_af1029"
400
400
  >
401
401
  providers
402
402
  </span>
@@ -408,7 +408,7 @@ exports[`Demo Component > should render the Demo component correctly 1`] = `
408
408
  <tr>
409
409
  <td>
410
410
  <span
411
- class="_boldText_85a2c3"
411
+ class="_boldText_af1029"
412
412
  >
413
413
  routing
414
414
  </span>
@@ -420,7 +420,7 @@ exports[`Demo Component > should render the Demo component correctly 1`] = `
420
420
  <tr>
421
421
  <td>
422
422
  <span
423
- class="_boldText_85a2c3"
423
+ class="_boldText_af1029"
424
424
  >
425
425
  types
426
426
  </span>
@@ -432,7 +432,7 @@ exports[`Demo Component > should render the Demo component correctly 1`] = `
432
432
  <tr>
433
433
  <td>
434
434
  <span
435
- class="_boldText_85a2c3"
435
+ class="_boldText_af1029"
436
436
  >
437
437
  ui
438
438
  </span>
@@ -444,7 +444,7 @@ exports[`Demo Component > should render the Demo component correctly 1`] = `
444
444
  <tr>
445
445
  <td>
446
446
  <span
447
- class="_boldText_85a2c3"
447
+ class="_boldText_af1029"
448
448
  >
449
449
  utils
450
450
  </span>
@@ -459,15 +459,15 @@ exports[`Demo Component > should render the Demo component correctly 1`] = `
459
459
  </div>
460
460
  </div>
461
461
  <div
462
- class="_paragraphContainer_85a2c3"
462
+ class="_paragraphContainer_af1029"
463
463
  >
464
464
  <h1
465
- class="_titleStyle_85a2c3"
465
+ class="_titleStyle_af1029"
466
466
  >
467
467
  Additional Information
468
468
  </h1>
469
469
  <div
470
- class="_infoSection_85a2c3"
470
+ class="_infoSection_af1029"
471
471
  >
472
472
  <ul>
473
473
  <li>
@@ -500,31 +500,31 @@ exports[`Demo Component > should render the Demo component correctly 1`] = `
500
500
  </ul>
501
501
  </div>
502
502
  <div
503
- class="_infoSection_85a2c3"
503
+ class="_infoSection_af1029"
504
504
  >
505
505
  <span
506
- class="_centredText_85a2c3"
506
+ class="_centredText_af1029"
507
507
  >
508
508
  <p
509
- class="_paragraphStyle_85a2c3"
509
+ class="_paragraphStyle_af1029"
510
510
  >
511
511
  Our project is organized into various folders, each containing its own
512
512
 
513
513
  <span
514
- class="_highlight_85a2c3"
514
+ class="_highlight_af1029"
515
515
  >
516
516
  README.md
517
517
  </span>
518
518
  file with specific details, instructions, and additional information. This documentation will guide you through setting up the environment, understanding the project structure, and using the available components and features. For more details, check the
519
519
  <span
520
- class="_highlight_85a2c3"
520
+ class="_highlight_af1029"
521
521
  >
522
522
  README.md
523
523
  </span>
524
524
  file in
525
525
 
526
526
  <span
527
- class="_boldText_85a2c3"
527
+ class="_boldText_af1029"
528
528
  >
529
529
  each folder of the project
530
530
  </span>
@@ -533,18 +533,18 @@ exports[`Demo Component > should render the Demo component correctly 1`] = `
533
533
  </span>
534
534
  </div>
535
535
  <div
536
- class="_infoSection_85a2c3"
536
+ class="_infoSection_af1029"
537
537
  >
538
538
  <span
539
- class="_centredText_85a2c3"
539
+ class="_centredText_af1029"
540
540
  >
541
541
  <p
542
- class="_paragraphStyle_85a2c3"
542
+ class="_paragraphStyle_af1029"
543
543
  >
544
544
  Feel free to explore and modify the structure to suit your project's needs.
545
545
 
546
546
  <span
547
- class="_boldText_85a2c3"
547
+ class="_boldText_af1029"
548
548
  >
549
549
  Happy coding!
550
550
  </span>
package/tsconfig.json CHANGED
@@ -1,14 +1,10 @@
1
1
  {
2
2
  "compilerOptions": {
3
3
  "target": "ESNext",
4
- "lib": [
5
- "dom",
6
- "dom.iterable",
7
- "esnext"
8
- ],
4
+ "lib": ["dom", "dom.iterable", "esnext"],
9
5
  "types": [
10
6
  "./src/react-app-env.d.ts",
11
- "@pplancq/webpack-config",
7
+ "@rsbuild/core/types",
12
8
  "vitest/globals",
13
9
  "@testing-library/jest-dom/vitest",
14
10
  "vitest-axe/extend-expect"
@@ -29,11 +25,9 @@
29
25
  "baseUrl": ".",
30
26
  "paths": {
31
27
  "@Front/*": ["src/*"],
32
- "@Mocks/*": ["mocks/*"],
28
+ "@Mocks/*": ["mocks/*"]
33
29
  }
34
30
  },
35
- "include": [
36
- "src"
37
- ],
31
+ "include": ["src", "rsbuild.config.ts"],
38
32
  "exclude": ["node_modules"]
39
33
  }
@@ -1,143 +0,0 @@
1
- #!/usr/bin/env node
2
- const { execSync } = require('child_process');
3
- const { rmSync, writeFileSync, readFileSync } = require('fs');
4
- const { resolve } = require('path');
5
-
6
- const NPM = 'npm';
7
- const YARN = 'yarn';
8
- const PNPM = 'pnpm';
9
-
10
- const runCommand = (command, options = { stdio: 'inherit' }) => {
11
- try {
12
- execSync(command, options);
13
- } catch (e) {
14
- console.error(`Failed to execute ${command}`, e);
15
- process.exit(-1);
16
- }
17
- };
18
-
19
- const getPackageManager = () => {
20
- switch (true) {
21
- case process.env.npm_config_user_agent.includes(YARN):
22
- return YARN;
23
- case process.env.npm_config_user_agent.includes(PNPM):
24
- return PNPM;
25
- default:
26
- return NPM;
27
- }
28
- };
29
-
30
- const packageManager = getPackageManager();
31
-
32
- console.info('\nremove webpack ...');
33
- runCommand(`${packageManager} remove @pplancq/webpack-config webpack webpack-cli webpack-dev-server`);
34
- rmSync(resolve(__dirname, '../webpack.config.cjs'));
35
- console.info('\ninstall vite package ...');
36
- runCommand(
37
- `${packageManager} ${packageManager === YARN ? 'add --dev' : 'install --save-dev'} vite vite-plugin-eslint2 vite-plugin-stylelint sass`,
38
- );
39
-
40
- writeFileSync(
41
- resolve(__dirname, '../vite.config.mts'),
42
- `import react from '@vitejs/plugin-react-swc'
43
- import { defineConfig, loadEnv } from 'vite'
44
- import eslintPlugin from 'vite-plugin-eslint2'
45
- import stylelintPlugin from 'vite-plugin-stylelint'
46
- import svgr from 'vite-plugin-svgr'
47
- import viteTsconfigPaths from 'vite-tsconfig-paths'
48
- import packageJson from './package.json'
49
-
50
- const resolveModule = (module: string) => {
51
- try {
52
- require.resolve(module);
53
- return true;
54
- } catch {
55
- return false;
56
- }
57
- };
58
-
59
- export default defineConfig(({ mode }) => {
60
- const env = loadEnv(mode, process.cwd(), '')
61
-
62
- const disableStyleLintPlugin =
63
- (env.DISABLE_STYLELINT_PLUGIN ?? 'false') === 'true' || !resolveModule('stylelint');
64
- const disableEsLintPlugin =
65
- (env.DISABLE_ESLINT_PLUGIN ?? 'false') === 'true' || !resolveModule('eslint');
66
- const publicUrl = env.PUBLIC_URL ?? packageJson.homepage ?? '/';
67
- const publicPath = mode === 'development'
68
- ? '/'
69
- : new URL(publicUrl.endsWith('/') ? publicUrl : \`\${publicUrl}/\`, 'http://localhost').pathname;
70
-
71
- return {
72
- plugins: [
73
- react(),
74
- viteTsconfigPaths(),
75
- svgr(),
76
- !disableEsLintPlugin && eslintPlugin({
77
- emitErrorAsWarning: true,
78
- cache: false
79
- }),
80
- !disableStyleLintPlugin && stylelintPlugin({
81
- emitErrorAsWarning: true,
82
- cache: false
83
- })
84
- ].filter(Boolean),
85
- envPrefix: env.ENV_PREFIX ?? 'FRONT_',
86
- base: publicPath,
87
- server: {
88
- port: parseInt(env.PORT ?? '3000', 10),
89
- open: (env.BROWSER ?? 'false') === 'true'
90
- },
91
- build: {
92
- sourcemap: (env.DISABLE_SOURCE_MAP ?? 'false') !== 'true',
93
- outDir: 'build',
94
- },
95
- }
96
- })
97
- `,
98
- { encoding: 'utf-8' },
99
- );
100
-
101
- let tsconfig = readFileSync(resolve(__dirname, '../tsconfig.json'), { encoding: 'utf-8' });
102
- tsconfig = tsconfig.replace('@pplancq/webpack-config', 'vite/client');
103
- writeFileSync(resolve(__dirname, '../tsconfig.json'), tsconfig, { encoding: 'utf-8' });
104
-
105
- const packagesJson = JSON.parse(readFileSync(resolve(__dirname, '../package.json'), { encoding: 'utf-8' }));
106
- const { start, build, 'migrate:vite': a, 'start:mock': b, ...scripts } = packagesJson.scripts;
107
- packagesJson.scripts = {
108
- start: 'vite',
109
- build: 'vite build',
110
- preview: 'vite preview',
111
- 'start:mock': 'vite --mode mock',
112
- ...scripts,
113
- };
114
- writeFileSync(resolve(__dirname, '../package.json'), JSON.stringify(packagesJson, null, 2), { encoding: 'utf-8' });
115
-
116
- let indexHTML = readFileSync(resolve(__dirname, '../public/index.html'), { encoding: 'utf-8' });
117
- indexHTML = indexHTML.replace(' </body>', ' <script type="module" src="/src/main.ts"></script>\n </body>');
118
- writeFileSync(resolve(__dirname, '../index.html'), indexHTML, { encoding: 'utf-8' });
119
- rmSync(resolve(__dirname, '../public/index.html'));
120
-
121
- let envFile = readFileSync(resolve(__dirname, '../.env'), { encoding: 'utf-8' });
122
- envFile = envFile.replace(
123
- `
124
-
125
- # Specify the type of configuration to use with ESLint.
126
- # - 'eslintrc' is the classic configuration format available in most ESLint versions.
127
- # - 'flat' is the new format introduced in ESLint 8.21.0.
128
- # Default is 'eslintrc'
129
- ESLINT_CONFIG_TYPE='flat'`,
130
- '',
131
- );
132
- writeFileSync(resolve(__dirname, '../.env'), envFile, { encoding: 'utf-8' });
133
-
134
- writeFileSync(
135
- resolve(__dirname, '../.env.mock'),
136
- `FRONT_MOCK_ENABLE=true
137
- `,
138
- { encoding: 'utf-8' },
139
- );
140
-
141
- rmSync(resolve(__dirname, '../scripts/migrateToVite.cjs'));
142
-
143
- console.info('\nThe application has been migrate to vite');
@@ -1,22 +0,0 @@
1
- // const { ModuleFederationPlugin } = require('webpack').container;
2
-
3
- // const deps = require('./package.json').dependencies;
4
-
5
- module.exports = {
6
- extends: [require.resolve('@pplancq/webpack-config')],
7
- // plugins: [
8
- // new ModuleFederationPlugin({
9
- // name: 'reactTemplate',
10
- // filename: 'js/remoteEntry.js',
11
- // remotes: {},
12
- // exposes: {
13
- // './App': './src/bootstrap.tsx',
14
- // },
15
- // shared: {
16
- // react: { singleton: true, requiredVersion: deps.react },
17
- // 'react-dom': { singleton: true, requiredVersion: deps['react-dom'] },
18
- // 'react-router': { singleton: true, requiredVersion: deps['react-router'] },
19
- // },
20
- // }),
21
- // ],
22
- };
File without changes