@pplancq/react-template 1.9.0 → 2.0.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,6 +27,12 @@
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
+
30
36
  # Allows you to deactivate the sourcemap
31
37
  # Default is false
32
38
  #DISABLE_SOURCE_MAP=false
package/.lintstagedrc.js CHANGED
@@ -1,7 +1,7 @@
1
1
  module.exports = {
2
- '*.{js,jsx,ts,tsx}': 'eslint --fix',
2
+ '*.{js,jsx,mjs,ts,tsx}': 'eslint --fix',
3
3
  '*.{ts,tsx}': 'tsc-files --noEmit',
4
4
  '*.{scss,css}': 'stylelint --fix',
5
- '*.!(js|jsx|ts|tsx|scss|css)': 'prettier --write --ignore-unknown',
5
+ '*.!(js|jsx|mjs|ts|tsx|scss|css)': 'prettier --write --ignore-unknown',
6
6
  '(package|package-lock).json': 'npm run package:check',
7
7
  };
package/CHANGELOG.md CHANGED
@@ -1,3 +1,46 @@
1
+ ## @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
+
3
+ ### ⚠ BREAKING CHANGES
4
+
5
+ * **eslint-config:** this version support only eslint v9 with new flat configuration.\ Please refer to the Migration Guide for detailed instructions: [Migration Guide](./MIGRATION.md#migration-guide-pplancqeslint-config-v3-to-v4)
6
+
7
+ ### Features
8
+
9
+ * **react-template:** set eslint flat config for eslint webpack plugin ([d7ef000](https://github.com/pplancq/dev-tools/commit/d7ef00091c0f03d4f3a4dfc69d626f6e230ab55e))
10
+ * **eslint-config:** update eslint v8 to v9 ([5cf5721](https://github.com/pplancq/dev-tools/commit/5cf57215c74172fd0f611c8425522d927752026e))
11
+ * **react-template:** use eslint flat config ([a145c2a](https://github.com/pplancq/dev-tools/commit/a145c2a7690b8c6fb9f0f8e2765d1fb02c0fd6c0))
12
+
13
+ ### Bug Fixes
14
+
15
+ * **deps:** update dependency @hookform/resolvers to ^3.9.1 ([a881b6a](https://github.com/pplancq/dev-tools/commit/a881b6a07fe9835318939e44d89f76053027876d))
16
+ * **deps:** update dependency react-hook-form to ^7.53.1 ([98fe84f](https://github.com/pplancq/dev-tools/commit/98fe84f9742f9fa43050fe81c53b5675e6912a83))
17
+ * **deps:** update dependency react-router-dom to ^6.27.0 ([ecb8b37](https://github.com/pplancq/dev-tools/commit/ecb8b372d060bd17f64f2366608dc1aea4b57721))
18
+ * **deps:** update react-query mono repo to ^5.59.15 ([47bf3b4](https://github.com/pplancq/dev-tools/commit/47bf3b42b54e5018dff960ed6171b736c1738fe8))
19
+
20
+
21
+ ### Dependencies
22
+
23
+ * **@pplancq/babel-config:** upgraded to 1.1.2
24
+ * **@pplancq/eslint-config:** upgraded to 4.0.0
25
+ * **@pplancq/postcss-config:** upgraded to 2.1.2
26
+ * **@pplancq/webpack-config:** upgraded to 1.6.0
27
+
28
+ ## @pplancq/react-template [1.9.1](https://github.com/pplancq/dev-tools/compare/@pplancq/react-template@1.9.0...@pplancq/react-template@1.9.1) (2024-10-15)
29
+
30
+ ### Bug Fixes
31
+
32
+ * **deps:** update react-query packages to ^5.59.0 ([be48ebd](https://github.com/pplancq/dev-tools/commit/be48ebdedca0d289957930019fffd8420457b8e6))
33
+ * **deps:** update react-query packages to ^5.59.9 ([bdd0a11](https://github.com/pplancq/dev-tools/commit/bdd0a11857884e5f1e577f065c658e2bde00e3bf))
34
+
35
+
36
+ ### Dependencies
37
+
38
+ * **@pplancq/babel-config:** upgraded to 1.1.1
39
+ * **@pplancq/eslint-config:** upgraded to 3.0.1
40
+ * **@pplancq/postcss-config:** upgraded to 2.1.1
41
+ * **@pplancq/stylelint-config:** upgraded to 2.1.1
42
+ * **@pplancq/webpack-config:** upgraded to 1.5.1
43
+
1
44
  ## @pplancq/react-template [1.9.0](https://github.com/pplancq/dev-tools/compare/@pplancq/react-template@1.8.0...@pplancq/react-template@1.9.0) (2024-09-16)
2
45
 
3
46
  ### Features
@@ -0,0 +1,15 @@
1
+ import { defineConfig } from '@pplancq/eslint-config';
2
+
3
+ export default defineConfig({
4
+ enableReact: true,
5
+ enablePrettier: 'on',
6
+ enableVitest: true,
7
+ extendConfig: [
8
+ {
9
+ files: ['mocks/**/*'],
10
+ rules: {
11
+ 'import/no-extraneous-dependencies': 'off',
12
+ },
13
+ },
14
+ ],
15
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pplancq/react-template",
3
- "version": "1.9.0",
3
+ "version": "2.0.0",
4
4
  "license": "MIT",
5
5
  "description": "react template",
6
6
  "author": "pplancq <paul.plancq@outlook.fr>",
@@ -16,12 +16,12 @@
16
16
  "test": "vitest run",
17
17
  "test:watch": "vitest",
18
18
  "lint": "node scripts/lint.js",
19
- "lint:eslint": "eslint \"{mocks,public,src}/**/*.{js,jsx,ts,tsx}\"",
20
- "lint:eslint:fix": "eslint \"{mocks,public,src}/**/*.{js,jsx,ts,tsx}\" --fix",
19
+ "lint:eslint": "eslint \"{mocks,public,src}/**/*.{js,jsx,mjs,ts,tsx}\"",
20
+ "lint:eslint:fix": "eslint \"{mocks,public,src}/**/*.{js,jsx,mjs,ts,tsx}\" --fix",
21
21
  "lint:stylelint": "stylelint \"src/**/*.{scss,css}\"",
22
22
  "lint:stylelint:fix": "stylelint \"src/**/*.{scss,css}\" --fix",
23
- "lint:prettier": "prettier \"{mocks,public,src}/**/*.!(js|jsx|ts|tsx|scss|css)\" --check --ignore-unknown",
24
- "lint:prettier:fix": "prettier \"{mocks,public,src}/**/*.!(js|jsx|ts|tsx|scss|css)\" --write --ignore-unknown",
23
+ "lint:prettier": "prettier \"{mocks,public,src}/**/*.!(js|jsx|mjs|ts|tsx|scss|css)\" --check --ignore-unknown",
24
+ "lint:prettier:fix": "prettier \"{mocks,public,src}/**/*.!(js|jsx|mjs|ts|tsx|scss|css)\" --write --ignore-unknown",
25
25
  "lint:tsc": "tsc --noEmit",
26
26
  "package:check": "npm exec --yes package-lock-utd@1.1.3",
27
27
  "remove:demo": "node ./scripts/removeDemo.js",
@@ -36,13 +36,13 @@
36
36
  "template"
37
37
  ],
38
38
  "dependencies": {
39
- "@hookform/resolvers": "^3.9.0",
40
- "@tanstack/react-query": "^5.56.2",
41
- "@tanstack/react-query-devtools": "^5.56.2",
42
- "react": "^18.2.0",
39
+ "@hookform/resolvers": "^3.9.1",
40
+ "@tanstack/react-query": "^5.59.15",
41
+ "@tanstack/react-query-devtools": "^5.59.15",
42
+ "react": "^18.3.1",
43
43
  "react-dom": "^18.3.1",
44
- "react-hook-form": "^7.53.0",
45
- "react-router-dom": "^6.26.2",
44
+ "react-hook-form": "^7.53.1",
45
+ "react-router-dom": "^6.27.0",
46
46
  "yup": "^1.4.0"
47
47
  },
48
48
  "devDependencies": {
@@ -54,31 +54,31 @@
54
54
  "@pplancq/prettier-config": "*",
55
55
  "@pplancq/stylelint-config": "*",
56
56
  "@pplancq/webpack-config": "*",
57
- "@testing-library/jest-dom": "^6.5.0",
57
+ "@testing-library/jest-dom": "^6.6.3",
58
58
  "@testing-library/react": "^16.0.1",
59
- "@testing-library/user-event": "^14.5.1",
60
- "@types/react": "^18.3.6",
61
- "@types/react-dom": "^18.3.0",
62
- "@vitejs/plugin-react": "^4.3.1",
63
- "@vitest/coverage-v8": "^2.1.1",
59
+ "@testing-library/user-event": "^14.5.2",
60
+ "@types/react": "^18.3.12",
61
+ "@types/react-dom": "^18.3.1",
62
+ "@vitejs/plugin-react": "^4.3.3",
63
+ "@vitest/coverage-v8": "^2.1.4",
64
64
  "concurrently": "^9.0.1",
65
- "eslint": "^8.57.0",
65
+ "eslint": "^9.14.0",
66
66
  "eslint-plugin-prettier": "^5.2.1",
67
67
  "husky": "^9.1.6",
68
- "jsdom": "^25.0.0",
68
+ "jsdom": "^25.0.1",
69
69
  "lint-staged": "^15.2.10",
70
- "msw": "^2.4.7",
70
+ "msw": "^2.5.1",
71
71
  "prettier": "^3.3.3",
72
- "stylelint": "^16.9.0",
72
+ "stylelint": "^16.10.0",
73
73
  "stylelint-prettier": "^5.0.2",
74
74
  "tsc-files": "^1.1.4",
75
- "typescript": "^5.6.2",
75
+ "typescript": "^5.6.3",
76
76
  "vite-plugin-svgr": "^4.2.0",
77
77
  "vite-tsconfig-paths": "^5.0.1",
78
- "vitest": "^2.0.5",
78
+ "vitest": "^2.1.4",
79
79
  "vitest-axe": "^1.0.0-pre.3",
80
80
  "vitest-sonar-reporter": "^2.0.0",
81
- "webpack": "^5.94.0",
81
+ "webpack": "^5.95.0",
82
82
  "webpack-cli": "^5.1.4",
83
83
  "webpack-dev-server": "^5.1.0"
84
84
  },
@@ -86,8 +86,8 @@
86
86
  "node": ">=20.12.2"
87
87
  },
88
88
  "volta": {
89
- "node": "20.12.2",
90
- "npm": "10.5.2"
89
+ "node": "20.18.0",
90
+ "npm": "10.9.0"
91
91
  },
92
92
  "browserslist": {
93
93
  "production": [
@@ -8,8 +8,8 @@
8
8
  * - Please do NOT serve this file on production.
9
9
  */
10
10
 
11
- const PACKAGE_VERSION = '2.3.1'
12
- const INTEGRITY_CHECKSUM = '26357c79639bfa20d64c0efca2a87423'
11
+ const PACKAGE_VERSION = '2.5.2'
12
+ const INTEGRITY_CHECKSUM = '07a8241b182f8a246a7cd39894799a9e'
13
13
  const IS_MOCKED_RESPONSE = Symbol('isMockedResponse')
14
14
  const activeClientIds = new Set()
15
15
 
@@ -62,7 +62,12 @@ self.addEventListener('message', async function (event) {
62
62
 
63
63
  sendToClient(client, {
64
64
  type: 'MOCKING_ENABLED',
65
- payload: true,
65
+ payload: {
66
+ client: {
67
+ id: client.id,
68
+ frameType: client.frameType,
69
+ },
70
+ },
66
71
  })
67
72
  break
68
73
  }
@@ -155,6 +160,10 @@ async function handleRequest(event, requestId) {
155
160
  async function resolveMainClient(event) {
156
161
  const client = await self.clients.get(event.clientId)
157
162
 
163
+ if (activeClientIds.has(event.clientId)) {
164
+ return client
165
+ }
166
+
158
167
  if (client?.frameType === 'top-level') {
159
168
  return client
160
169
  }
package/.eslintrc.js DELETED
@@ -1,11 +0,0 @@
1
- module.exports = {
2
- extends: ['@pplancq/eslint-config/react', '@pplancq/eslint-config/vitest', '@pplancq/eslint-config/prettier'],
3
- overrides: [
4
- {
5
- files: ['mocks/**/*'],
6
- rules: {
7
- 'import/no-extraneous-dependencies': 'off',
8
- },
9
- },
10
- ],
11
- };