@pplancq/react-template 2.7.16 → 2.8.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.
- package/CHANGELOG.md +35 -0
- package/mise.toml +2 -2
- package/package.json +22 -16
- package/rsbuild.config.ts +10 -18
- package/scripts/lint.js +5 -4
- package/scripts/playwright.js +11 -3
- package/scripts/removeDemo.cjs +2 -2
- package/scripts/test.js +5 -4
- package/src/main.ts +5 -11
- package/tests/utils/playwright.globalSetup.ts +4 -2
- package/tests/utils/playwright.globalTeardown.ts +4 -2
- package/vitest.config.mts +2 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,38 @@
|
|
|
1
|
+
## @pplancq/react-template [2.8.1](https://github.com/pplancq/dev-tools/compare/@pplancq/react-template@2.8.0...@pplancq/react-template@2.8.1) (2026-01-29)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* **react-template:** simplify poolOptions to maxWorkers ([49a80ee](https://github.com/pplancq/dev-tools/commit/49a80ee245a5ba81d5263b39c488e76bd97de951))
|
|
6
|
+
* **deps:** update dependency @tanstack/react-query to ^5.90.19 ([9dcea18](https://github.com/pplancq/dev-tools/commit/9dcea18c38567c6f5a7bf9d5ab361fe623b12ea5))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Dependencies
|
|
10
|
+
|
|
11
|
+
* **@pplancq/commitlint-config:** upgraded to 3.0.0
|
|
12
|
+
* **@pplancq/eslint-config:** upgraded to 6.0.0
|
|
13
|
+
* **@pplancq/postcss-config:** upgraded to 3.0.1
|
|
14
|
+
* **@pplancq/prettier-config:** upgraded to 2.0.0
|
|
15
|
+
* **@pplancq/stylelint-config:** upgraded to 5.0.0
|
|
16
|
+
|
|
17
|
+
## @pplancq/react-template [2.8.0](https://github.com/pplancq/dev-tools/compare/@pplancq/react-template@2.7.16...@pplancq/react-template@2.8.0) (2026-01-20)
|
|
18
|
+
|
|
19
|
+
### Features
|
|
20
|
+
|
|
21
|
+
* **react-template:** add rsbuild-plugin-stylelint dependency and update config ([7794c90](https://github.com/pplancq/dev-tools/commit/7794c909a9787de571fd3297e87d79f2c7efb8be))
|
|
22
|
+
|
|
23
|
+
### Bug Fixes
|
|
24
|
+
|
|
25
|
+
* **react-template:** correct eslint plugin enable logic and add options ([ffbd2d3](https://github.com/pplancq/dev-tools/commit/ffbd2d3581a3cc68bdca44d35478d18986ac0c13))
|
|
26
|
+
* **deps:** update dependency @tanstack/react-query to ^5.90.18 ([96ec60d](https://github.com/pplancq/dev-tools/commit/96ec60d0519b0a97330781821f3990c0e824ea80))
|
|
27
|
+
* **deps:** update dependency react-hook-form to ^7.71.1 ([4da0585](https://github.com/pplancq/dev-tools/commit/4da05851ff912aeebbeb23eafd0b6b29d8b4dce1))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
### Dependencies
|
|
31
|
+
|
|
32
|
+
* **@pplancq/eslint-config:** upgraded to 5.0.22
|
|
33
|
+
* **@pplancq/postcss-config:** upgraded to 3.0.0
|
|
34
|
+
* **@pplancq/stylelint-config:** upgraded to 4.1.0
|
|
35
|
+
|
|
1
36
|
## @pplancq/react-template [2.7.16](https://github.com/pplancq/dev-tools/compare/@pplancq/react-template@2.7.15...@pplancq/react-template@2.7.16) (2026-01-12)
|
|
2
37
|
|
|
3
38
|
### Bug Fixes
|
package/mise.toml
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
[tools]
|
|
2
|
-
npm = "11.
|
|
3
|
-
node = "24.
|
|
2
|
+
npm = "11.8.0"
|
|
3
|
+
node = "24.13.0"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pplancq/react-template",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.8.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "react template",
|
|
6
6
|
"author": "pplancq <paul.plancq@outlook.fr>",
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
"bin": {
|
|
14
14
|
"template-install": "bin/template-install.js"
|
|
15
15
|
},
|
|
16
|
+
"packageManager": "npm@11.8.0",
|
|
16
17
|
"scripts": {
|
|
17
18
|
"start": "rsbuild dev",
|
|
18
19
|
"start:mock": "rsbuild dev --env-mode mock",
|
|
@@ -49,18 +50,18 @@
|
|
|
49
50
|
],
|
|
50
51
|
"dependencies": {
|
|
51
52
|
"@hookform/resolvers": "^5.2.2",
|
|
52
|
-
"@tanstack/react-query": "^5.90.
|
|
53
|
+
"@tanstack/react-query": "^5.90.19",
|
|
53
54
|
"@tanstack/react-query-devtools": "^5.91.2",
|
|
54
55
|
"react": "^19.2.3",
|
|
55
56
|
"react-dom": "^19.2.3",
|
|
56
|
-
"react-hook-form": "^7.
|
|
57
|
+
"react-hook-form": "^7.71.1",
|
|
57
58
|
"react-router": "^7.12.0",
|
|
58
59
|
"yup": "^1.7.1"
|
|
59
60
|
},
|
|
60
61
|
"devDependencies": {
|
|
61
62
|
"@bdellegrazie/playwright-sonar-reporter": "^0.4.0",
|
|
62
63
|
"@commitlint/cli": "^20.3.1",
|
|
63
|
-
"@msw/playwright": "^0.4.
|
|
64
|
+
"@msw/playwright": "^0.4.5",
|
|
64
65
|
"@playwright/test": "^1.57.0",
|
|
65
66
|
"@pplancq/commitlint-config": "*",
|
|
66
67
|
"@pplancq/eslint-config": "*",
|
|
@@ -68,37 +69,42 @@
|
|
|
68
69
|
"@pplancq/prettier-config": "*",
|
|
69
70
|
"@pplancq/stylelint-config": "*",
|
|
70
71
|
"@rsbuild/core": "^1.7.2",
|
|
71
|
-
"@rsbuild/plugin-eslint": "^1.2.
|
|
72
|
-
"@rsbuild/plugin-react": "^1.4.
|
|
73
|
-
"@rsbuild/plugin-sass": "^1.4.
|
|
72
|
+
"@rsbuild/plugin-eslint": "^1.2.1",
|
|
73
|
+
"@rsbuild/plugin-react": "^1.4.3",
|
|
74
|
+
"@rsbuild/plugin-sass": "^1.4.1",
|
|
74
75
|
"@testing-library/jest-dom": "^6.9.1",
|
|
75
|
-
"@testing-library/react": "^16.3.
|
|
76
|
+
"@testing-library/react": "^16.3.2",
|
|
76
77
|
"@testing-library/user-event": "^14.6.1",
|
|
77
|
-
"@types/react": "^19.2.
|
|
78
|
+
"@types/react": "^19.2.9",
|
|
78
79
|
"@types/react-dom": "^19.2.3",
|
|
79
80
|
"@vitejs/plugin-react-swc": "^4.2.2",
|
|
80
|
-
"@vitest/coverage-v8": "^4.0.
|
|
81
|
+
"@vitest/coverage-v8": "^4.0.18",
|
|
81
82
|
"concurrently": "^9.2.1",
|
|
82
83
|
"eslint": "^9.39.2",
|
|
83
|
-
"eslint-plugin-prettier": "^5.5.
|
|
84
|
+
"eslint-plugin-prettier": "^5.5.5",
|
|
84
85
|
"husky": "^9.1.7",
|
|
85
86
|
"jsdom": "^27.4.0",
|
|
86
87
|
"lint-staged": "^16.2.7",
|
|
87
88
|
"monocart-coverage-reports": "^2.12.9",
|
|
88
89
|
"msw": "^2.12.7",
|
|
89
90
|
"nodemon": "^3.1.11",
|
|
90
|
-
"prettier": "^3.
|
|
91
|
-
"stylelint": "^
|
|
91
|
+
"prettier": "^3.8.1",
|
|
92
|
+
"rsbuild-plugin-stylelint": "^1.0.1",
|
|
93
|
+
"stylelint": "^17.0.0",
|
|
92
94
|
"stylelint-prettier": "^5.0.3",
|
|
93
|
-
"stylelint-webpack-plugin": "^5.0.1",
|
|
94
95
|
"tsc-files": "^1.1.4",
|
|
95
96
|
"typescript": "^5.9.3",
|
|
96
97
|
"vite-plugin-svgr": "^4.5.0",
|
|
97
|
-
"vite-tsconfig-paths": "^6.0.
|
|
98
|
-
"vitest": "^4.0.
|
|
98
|
+
"vite-tsconfig-paths": "^6.0.4",
|
|
99
|
+
"vitest": "^4.0.18",
|
|
99
100
|
"vitest-axe": "^1.0.0-pre.5",
|
|
100
101
|
"vitest-sonar-reporter": "^3.0.0"
|
|
101
102
|
},
|
|
103
|
+
"overrides": {
|
|
104
|
+
"rsbuild-plugin-stylelint": {
|
|
105
|
+
"stylelint": "$stylelint"
|
|
106
|
+
}
|
|
107
|
+
},
|
|
102
108
|
"engines": {
|
|
103
109
|
"node": ">=20.12.2"
|
|
104
110
|
},
|
package/rsbuild.config.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { defineConfig, loadEnv } from '@rsbuild/core';
|
|
|
2
2
|
import { pluginEslint } from '@rsbuild/plugin-eslint';
|
|
3
3
|
import { pluginReact } from '@rsbuild/plugin-react';
|
|
4
4
|
import { pluginSass } from '@rsbuild/plugin-sass';
|
|
5
|
-
import
|
|
5
|
+
import { pluginStylelint } from 'rsbuild-plugin-stylelint';
|
|
6
6
|
import packageJson from './package.json';
|
|
7
7
|
|
|
8
8
|
const resolveModule = (module: string) => {
|
|
@@ -19,8 +19,6 @@ const { publicVars } = loadEnv({ prefixes: [process.env.ENV_PREFIX ?? 'FRONT_']
|
|
|
19
19
|
const publicUrl = process.env.PUBLIC_URL ?? (packageJson as { homepage?: string }).homepage ?? '/';
|
|
20
20
|
const publicPath = new URL(publicUrl.endsWith('/') ? publicUrl : `${publicUrl}/`, 'http://localhost').pathname;
|
|
21
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
22
|
|
|
25
23
|
export default defineConfig(({ env }) => {
|
|
26
24
|
const isProduction = env === 'production';
|
|
@@ -31,7 +29,14 @@ export default defineConfig(({ env }) => {
|
|
|
31
29
|
pluginSass(),
|
|
32
30
|
!isProduction &&
|
|
33
31
|
pluginEslint({
|
|
34
|
-
enable: (process.env.DISABLE_ESLINT_PLUGIN ?? 'false') === '
|
|
32
|
+
enable: (process.env.DISABLE_ESLINT_PLUGIN ?? 'false') === 'false' && resolveModule('eslint'),
|
|
33
|
+
eslintPluginOptions: {
|
|
34
|
+
configType: 'flat',
|
|
35
|
+
},
|
|
36
|
+
}),
|
|
37
|
+
!isProduction &&
|
|
38
|
+
pluginStylelint({
|
|
39
|
+
enable: (process.env.DISABLE_STYLELINT_PLUGIN ?? 'false') === 'false' && resolveModule('stylelint'),
|
|
35
40
|
}),
|
|
36
41
|
].filter(Boolean),
|
|
37
42
|
source: {
|
|
@@ -57,22 +62,9 @@ export default defineConfig(({ env }) => {
|
|
|
57
62
|
],
|
|
58
63
|
},
|
|
59
64
|
server: {
|
|
60
|
-
port: parseInt(process.env.PORT ?? '3000', 10),
|
|
65
|
+
port: Number.parseInt(process.env.PORT ?? '3000', 10),
|
|
61
66
|
open: (process.env.BROWSER ?? 'false') === 'true',
|
|
62
67
|
},
|
|
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
68
|
html: {
|
|
77
69
|
template: './index.html',
|
|
78
70
|
},
|
package/scripts/lint.js
CHANGED
package/scripts/playwright.js
CHANGED
|
@@ -14,7 +14,7 @@ const main = async () => {
|
|
|
14
14
|
|
|
15
15
|
let playwrightArgs = [...args];
|
|
16
16
|
|
|
17
|
-
if (args.
|
|
17
|
+
if (args.includes('--watch')) {
|
|
18
18
|
const filteredArgs = args.filter(a => a !== '--watch');
|
|
19
19
|
runCommand('npx', [
|
|
20
20
|
'nodemon',
|
|
@@ -28,7 +28,7 @@ const main = async () => {
|
|
|
28
28
|
return;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
if (playwrightArgs.
|
|
31
|
+
if (playwrightArgs.includes('--coverage')) {
|
|
32
32
|
process.env.ENABLED_COVERAGE = 'true';
|
|
33
33
|
playwrightArgs = playwrightArgs.filter(p => p !== '--coverage');
|
|
34
34
|
}
|
|
@@ -36,4 +36,12 @@ const main = async () => {
|
|
|
36
36
|
runCommand('npx', ['playwright', ...playwrightArgs]);
|
|
37
37
|
};
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
try {
|
|
40
|
+
await main();
|
|
41
|
+
} catch (e) {
|
|
42
|
+
const status =
|
|
43
|
+
e && typeof e === 'object' && 'status' in e && typeof e.status === 'number' && Number.isFinite(e.status)
|
|
44
|
+
? e.status
|
|
45
|
+
: 1;
|
|
46
|
+
process.exit(status);
|
|
47
|
+
}
|
package/scripts/removeDemo.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const { rmSync, readFileSync, writeFileSync, mkdirSync } = require('fs');
|
|
3
|
-
const { resolve } = require('path');
|
|
2
|
+
const { rmSync, readFileSync, writeFileSync, mkdirSync } = require('node:fs');
|
|
3
|
+
const { resolve } = require('node:path');
|
|
4
4
|
|
|
5
5
|
const resolveSrc = path => resolve(__dirname, `../src${path}`);
|
|
6
6
|
|
package/scripts/test.js
CHANGED
package/src/main.ts
CHANGED
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
(async () => {
|
|
2
2
|
if (import.meta.env.FRONT_MOCK_ENABLE === 'true') {
|
|
3
3
|
const { worker } = await import('@Mocks/browser');
|
|
4
|
-
|
|
5
|
-
return worker.start({
|
|
4
|
+
await worker.start({
|
|
6
5
|
onUnhandledRequest: 'warn',
|
|
7
6
|
});
|
|
8
7
|
}
|
|
9
8
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
enableMock().then(() => {
|
|
14
|
-
import('./bootstrap').then(({ default: AppReact }) => {
|
|
15
|
-
customElements.define('app-react', AppReact);
|
|
16
|
-
});
|
|
17
|
-
});
|
|
9
|
+
const { default: AppReact } = await import('./bootstrap');
|
|
10
|
+
customElements.define('app-react', AppReact);
|
|
11
|
+
})();
|
|
@@ -2,11 +2,13 @@ import type { FullConfig } from '@playwright/test';
|
|
|
2
2
|
import { CoverageReport } from 'monocart-coverage-reports';
|
|
3
3
|
import { coverageOptions } from '../../mrc.playwright.config';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
export default (config: FullConfig) => {
|
|
5
|
+
const globalSetup = (config: FullConfig) => {
|
|
7
6
|
if (config.webServer && coverageOptions.enabled) {
|
|
8
7
|
console.info('[playwright] Coverage enabled with monocart');
|
|
9
8
|
const mcr = new CoverageReport(coverageOptions);
|
|
10
9
|
mcr.cleanCache();
|
|
11
10
|
}
|
|
12
11
|
};
|
|
12
|
+
|
|
13
|
+
// eslint-disable-next-line import/no-default-export
|
|
14
|
+
export default globalSetup;
|
|
@@ -2,10 +2,12 @@ import type { FullConfig } from '@playwright/test';
|
|
|
2
2
|
import { CoverageReport } from 'monocart-coverage-reports';
|
|
3
3
|
import { coverageOptions } from '../../mrc.playwright.config';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
export default async (config: FullConfig) => {
|
|
5
|
+
const globalTeardown = async (config: FullConfig) => {
|
|
7
6
|
if (config.webServer && coverageOptions.enabled) {
|
|
8
7
|
const mcr = new CoverageReport(coverageOptions);
|
|
9
8
|
await mcr.generate();
|
|
10
9
|
}
|
|
11
10
|
};
|
|
11
|
+
|
|
12
|
+
// eslint-disable-next-line import/no-default-export
|
|
13
|
+
export default globalTeardown;
|
package/vitest.config.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import react from '@vitejs/plugin-react-swc';
|
|
2
|
-
import { resolve } from 'path';
|
|
2
|
+
import { resolve } from 'node:path';
|
|
3
3
|
import { loadEnv } from 'vite';
|
|
4
4
|
import svgr from 'vite-plugin-svgr';
|
|
5
5
|
import viteTsconfigPaths from 'vite-tsconfig-paths';
|
|
@@ -30,12 +30,7 @@ export default defineConfig(({ mode }) => {
|
|
|
30
30
|
junit: 'junit-report.xml',
|
|
31
31
|
},
|
|
32
32
|
include: ['src/**/*.(spec|test|steps).[jt]s?(x)'],
|
|
33
|
-
|
|
34
|
-
forks: {
|
|
35
|
-
minForks: env.CI ? 1 : undefined,
|
|
36
|
-
maxForks: env.CI ? 2 : undefined,
|
|
37
|
-
},
|
|
38
|
-
},
|
|
33
|
+
maxWorkers: env.CI ? 2 : undefined,
|
|
39
34
|
coverage: {
|
|
40
35
|
enabled: env.CI === 'true',
|
|
41
36
|
reporter: ['lcovonly', 'html', 'text', 'text-summary'],
|