@pplancq/react-template 2.0.0 → 2.1.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/CHANGELOG.md CHANGED
@@ -1,3 +1,37 @@
1
+ ## @pplancq/react-template [2.1.0](https://github.com/pplancq/dev-tools/compare/@pplancq/react-template@2.0.1...@pplancq/react-template@2.1.0) (2024-11-18)
2
+
3
+ ### Features
4
+
5
+ * **react-template:** remove babel config ([c2990a0](https://github.com/pplancq/dev-tools/commit/c2990a08061bed421d85d48d8381f5fd9096d4e5))
6
+ * **react-template:** replace @vitejs/plugin-react by @vitejs/plugin-react-swc ([e613869](https://github.com/pplancq/dev-tools/commit/e613869e5233833d6fe0cd4a9ab67a24ab575db2))
7
+
8
+ ### Bug Fixes
9
+
10
+ * **react-template:** fix warning fron react-router-dom ([6e71da3](https://github.com/pplancq/dev-tools/commit/6e71da3ac8393d2e6975bb84a388499f63947265))
11
+ * **deps:** update dependency react-hook-form to ^7.53.2 ([ea74c8c](https://github.com/pplancq/dev-tools/commit/ea74c8cd15493d60213c4ca6b9979e88c793f11f))
12
+ * **deps:** update react-query mono repo to ^5.60.2 ([d95ce29](https://github.com/pplancq/dev-tools/commit/d95ce290ca9a9730bdeb0ff330897449bf2a0f79))
13
+
14
+
15
+ ### Dependencies
16
+
17
+ * **@pplancq/eslint-config:** upgraded to 4.0.2
18
+ * **@pplancq/postcss-config:** upgraded to 2.1.4
19
+ * **@pplancq/webpack-config:** upgraded to 1.7.0
20
+
21
+ ## @pplancq/react-template [2.0.1](https://github.com/pplancq/dev-tools/compare/@pplancq/react-template@2.0.0...@pplancq/react-template@2.0.1) (2024-11-11)
22
+
23
+ ### Bug Fixes
24
+
25
+ * **deps:** update dependency react-router-dom to ^6.28.0 ([5b0ed65](https://github.com/pplancq/dev-tools/commit/5b0ed656f6fbe1fbcbcee4a33636841ebc16e646))
26
+ * **deps:** update react-query mono repo to ^5.59.20 ([f147aba](https://github.com/pplancq/dev-tools/commit/f147aba053a9921888639870ac5d47933a4054d6))
27
+
28
+
29
+ ### Dependencies
30
+
31
+ * **@pplancq/eslint-config:** upgraded to 4.0.1
32
+ * **@pplancq/postcss-config:** upgraded to 2.1.3
33
+ * **@pplancq/webpack-config:** upgraded to 1.6.1
34
+
1
35
  ## @pplancq/react-template [2.0.0](https://github.com/pplancq/dev-tools/compare/@pplancq/react-template@1.9.1...@pplancq/react-template@2.0.0) (2024-11-08)
2
36
 
3
37
  ### ⚠ BREAKING CHANGES
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pplancq/react-template",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "license": "MIT",
5
5
  "description": "react template",
6
6
  "author": "pplancq <paul.plancq@outlook.fr>",
@@ -37,17 +37,16 @@
37
37
  ],
38
38
  "dependencies": {
39
39
  "@hookform/resolvers": "^3.9.1",
40
- "@tanstack/react-query": "^5.59.15",
41
- "@tanstack/react-query-devtools": "^5.59.15",
40
+ "@tanstack/react-query": "^5.60.2",
41
+ "@tanstack/react-query-devtools": "^5.60.2",
42
42
  "react": "^18.3.1",
43
43
  "react-dom": "^18.3.1",
44
- "react-hook-form": "^7.53.1",
45
- "react-router-dom": "^6.27.0",
44
+ "react-hook-form": "^7.53.2",
45
+ "react-router-dom": "^6.28.0",
46
46
  "yup": "^1.4.0"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@commitlint/cli": "^19.5.0",
50
- "@pplancq/babel-config": "*",
51
50
  "@pplancq/commitlint-config": "*",
52
51
  "@pplancq/eslint-config": "*",
53
52
  "@pplancq/postcss-config": "*",
@@ -59,26 +58,26 @@
59
58
  "@testing-library/user-event": "^14.5.2",
60
59
  "@types/react": "^18.3.12",
61
60
  "@types/react-dom": "^18.3.1",
62
- "@vitejs/plugin-react": "^4.3.3",
63
- "@vitest/coverage-v8": "^2.1.4",
64
- "concurrently": "^9.0.1",
61
+ "@vitejs/plugin-react-swc": "^3.7.1",
62
+ "@vitest/coverage-v8": "^2.1.5",
63
+ "concurrently": "^9.1.0",
65
64
  "eslint": "^9.14.0",
66
65
  "eslint-plugin-prettier": "^5.2.1",
67
66
  "husky": "^9.1.6",
68
67
  "jsdom": "^25.0.1",
69
68
  "lint-staged": "^15.2.10",
70
- "msw": "^2.5.1",
69
+ "msw": "^2.6.4",
71
70
  "prettier": "^3.3.3",
72
71
  "stylelint": "^16.10.0",
73
72
  "stylelint-prettier": "^5.0.2",
74
73
  "tsc-files": "^1.1.4",
75
74
  "typescript": "^5.6.3",
76
- "vite-plugin-svgr": "^4.2.0",
77
- "vite-tsconfig-paths": "^5.0.1",
78
- "vitest": "^2.1.4",
75
+ "vite-plugin-svgr": "^4.3.0",
76
+ "vite-tsconfig-paths": "^5.1.2",
77
+ "vitest": "^2.1.5",
79
78
  "vitest-axe": "^1.0.0-pre.3",
80
79
  "vitest-sonar-reporter": "^2.0.0",
81
- "webpack": "^5.95.0",
80
+ "webpack": "^5.96.1",
82
81
  "webpack-cli": "^5.1.4",
83
82
  "webpack-dev-server": "^5.1.0"
84
83
  },
@@ -86,7 +85,7 @@
86
85
  "node": ">=20.12.2"
87
86
  },
88
87
  "volta": {
89
- "node": "20.18.0",
88
+ "node": "22.11.0",
90
89
  "npm": "10.9.0"
91
90
  },
92
91
  "browserslist": {
@@ -8,8 +8,8 @@
8
8
  * - Please do NOT serve this file on production.
9
9
  */
10
10
 
11
- const PACKAGE_VERSION = '2.5.2'
12
- const INTEGRITY_CHECKSUM = '07a8241b182f8a246a7cd39894799a9e'
11
+ const PACKAGE_VERSION = '2.6.5'
12
+ const INTEGRITY_CHECKSUM = 'ca7800994cc8bfb5eb961e037c877074'
13
13
  const IS_MOCKED_RESPONSE = Symbol('isMockedResponse')
14
14
  const activeClientIds = new Set()
15
15
 
@@ -192,12 +192,14 @@ async function getResponse(event, client, requestId) {
192
192
  const requestClone = request.clone()
193
193
 
194
194
  function passthrough() {
195
- const headers = Object.fromEntries(requestClone.headers.entries())
196
-
197
- // Remove internal MSW request header so the passthrough request
198
- // complies with any potential CORS preflight checks on the server.
199
- // Some servers forbid unknown request headers.
200
- delete headers['x-msw-intention']
195
+ // Cast the request headers to a new Headers instance
196
+ // so the headers can be manipulated with.
197
+ const headers = new Headers(requestClone.headers)
198
+
199
+ // Remove the "accept" header value that marked this request as passthrough.
200
+ // This prevents request alteration and also keeps it compliant with the
201
+ // user-defined CORS policies.
202
+ headers.delete('accept', 'msw/passthrough')
201
203
 
202
204
  return fetch(requestClone, { headers })
203
205
  }
@@ -30,11 +30,8 @@ const getPackageManager = () => {
30
30
  const packageManager = getPackageManager();
31
31
 
32
32
  console.info('\nremove webpack ...');
33
- runCommand(
34
- `${packageManager} remove @pplancq/webpack-config @pplancq/babel-config webpack webpack-cli webpack-dev-server`,
35
- );
33
+ runCommand(`${packageManager} remove @pplancq/webpack-config webpack webpack-cli webpack-dev-server`);
36
34
  rmSync(resolve(__dirname, '../webpack.config.js'));
37
- rmSync(resolve(__dirname, '../babelrc.js'));
38
35
  console.info('\ninstall vite package ...');
39
36
  runCommand(
40
37
  `${packageManager} ${packageManager === YARN ? 'add --dev' : 'install --save-dev'} vite vite-plugin-eslint2 vite-plugin-stylelint sass`,
@@ -42,7 +39,7 @@ runCommand(
42
39
 
43
40
  writeFileSync(
44
41
  resolve(__dirname, '../vite.config.mts'),
45
- `import react from '@vitejs/plugin-react'
42
+ `import react from '@vitejs/plugin-react-swc'
46
43
  import { resolve } from 'path'
47
44
  import { defineConfig, loadEnv } from 'vite'
48
45
  import eslintPlugin from 'vite-plugin-eslint2'
@@ -5,7 +5,7 @@ import { Footer } from '../Footer';
5
5
  describe('Footer Component', () => {
6
6
  it('should render the Footer component correctly', () => {
7
7
  const { container } = render(
8
- <Router>
8
+ <Router future={{ v7_startTransition: true, v7_relativeSplatPath: true }}>
9
9
  <Footer />
10
10
  </Router>,
11
11
  );
@@ -5,7 +5,7 @@ import { Header } from '../Header';
5
5
  describe('Header Component', () => {
6
6
  it('should render the Header component correctly', () => {
7
7
  const { container } = render(
8
- <Router>
8
+ <Router future={{ v7_startTransition: true, v7_relativeSplatPath: true }}>
9
9
  <Header />
10
10
  </Router>,
11
11
  );
@@ -5,7 +5,7 @@ import { Demo } from '../Demo';
5
5
  describe('Demo Component', () => {
6
6
  it('should render the Demo component correctly', () => {
7
7
  const { container } = render(
8
- <Router>
8
+ <Router future={{ v7_startTransition: true, v7_relativeSplatPath: true }}>
9
9
  <Demo />
10
10
  </Router>,
11
11
  );
@@ -6,5 +6,13 @@ interface CreateRouterProps {
6
6
  }
7
7
 
8
8
  export const createRouter = ({ basename }: CreateRouterProps = {}) => {
9
- return createBrowserRouter(routeObject, { basename });
9
+ return createBrowserRouter(routeObject, {
10
+ basename,
11
+ future: {
12
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
13
+ // @ts-expect-error
14
+ v7_startTransition: true,
15
+ v7_relativeSplatPath: true,
16
+ },
17
+ });
10
18
  };
package/vitest.config.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable import/no-extraneous-dependencies */
2
- import react from '@vitejs/plugin-react';
2
+ import react from '@vitejs/plugin-react-swc';
3
3
  import { resolve } from 'path';
4
4
  import { loadEnv } from 'vite';
5
5
  import svgr from 'vite-plugin-svgr';
package/.babelrc.js DELETED
@@ -1 +0,0 @@
1
- module.exports = { extends: '@pplancq/babel-config' };