@pplancq/react-template 1.1.2 → 1.3.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,41 @@
1
+ ## @pplancq/react-template [1.3.0](https://github.com/pplancq/dev-tools/compare/@pplancq/react-template@1.2.0...@pplancq/react-template@1.3.0) (2024-04-16)
2
+
3
+
4
+ ### Features
5
+
6
+ * **react-template:** add cleanup from @testing-library/react on vitest setup ([a981e0a](https://github.com/pplancq/dev-tools/commit/a981e0a253bda642e2a5a776400d7269a4cdd9cd))
7
+ * **react-template:** add vitest-axe for test a11y violation ([4786b4a](https://github.com/pplancq/dev-tools/commit/4786b4a7701e8601e3fee87cf26ffda6ffb4431f))
8
+
9
+
10
+
11
+ ### Dependencies
12
+
13
+ * **@pplancq/babel-config:** upgraded to 1.0.2
14
+ * **@pplancq/commitlint-config:** upgraded to 2.1.2
15
+ * **@pplancq/eslint-config:** upgraded to 2.1.1
16
+ * **@pplancq/postcss-config:** upgraded to 1.0.2
17
+ * **@pplancq/prettier-config:** upgraded to 1.0.2
18
+ * **@pplancq/stylelint-config:** upgraded to 2.0.2
19
+ * **@pplancq/webpack-config:** upgraded to 1.1.2
20
+
21
+ ## @pplancq/react-template [1.2.0](https://github.com/pplancq/dev-tools/compare/@pplancq/react-template@1.1.2...@pplancq/react-template@1.2.0) (2024-03-18)
22
+
23
+
24
+ ### Features
25
+
26
+ * **react-template:** add sass when migrate to vite ([790a621](https://github.com/pplancq/dev-tools/commit/790a6211df2f94a18631c5adf40edcbfc343ddd8))
27
+ * **react-template:** remove babel-config when use script migrate to vite ([de680b0](https://github.com/pplancq/dev-tools/commit/de680b039ab27c3174ba46d49681ca178e11f6d2))
28
+
29
+
30
+ ### Bug Fixes
31
+
32
+ * **react-package:** fix computability of script with npm on Windows ([c6b8d7d](https://github.com/pplancq/dev-tools/commit/c6b8d7db1f2029ae602186ec92b53b362c65dc1c))
33
+
34
+
35
+ ### Reverts
36
+
37
+ * **dev-tool:** add package-lock when execute npm postversion ([1e83fe7](https://github.com/pplancq/dev-tools/commit/1e83fe7ee8d2529ce3b85e1abb56968171ee01ff))
38
+
1
39
  ## @pplancq/react-template [1.1.2](https://github.com/pplancq/dev-tools/compare/@pplancq/react-template@1.1.1...@pplancq/react-template@1.1.2) (2024-03-14)
2
40
 
3
41
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pplancq/react-template",
3
- "version": "1.1.2",
3
+ "version": "1.3.0",
4
4
  "license": "MIT",
5
5
  "description": "react template",
6
6
  "author": "pplancq <paul.plancq@outlook.fr>",
@@ -21,9 +21,8 @@
21
21
  "stylelint:fix": "stylelint \"src**/*.{scss,css}\" --fix",
22
22
  "tsc": "tsc --noEmit",
23
23
  "package:check": "npm exec --yes package-lock-utd@1.1.3",
24
- "remove:demo": "./scripts/removeDemo.js",
25
- "migrate:vite": "./scripts/migrateToVite.js",
26
- "postversion": "git add ../../package-lock.json",
24
+ "remove:demo": "node ./scripts/removeDemo.js",
25
+ "migrate:vite": "node ./scripts/migrateToVite.js",
27
26
  "_prepare": "husky"
28
27
  },
29
28
  "bugs": {
@@ -35,16 +34,16 @@
35
34
  ],
36
35
  "dependencies": {
37
36
  "@hookform/resolvers": "^3.3.2",
38
- "@tanstack/react-query": "^5.25.0",
39
- "@tanstack/react-query-devtools": "^5.25.0",
37
+ "@tanstack/react-query": "^5.29.2",
38
+ "@tanstack/react-query-devtools": "^5.29.2",
40
39
  "react": "^18.2.0",
41
40
  "react-dom": "^18.2.0",
42
- "react-hook-form": "^7.51.0",
41
+ "react-hook-form": "^7.51.3",
43
42
  "react-router-dom": "^6.22.3",
44
43
  "yup": "^1.4.0"
45
44
  },
46
45
  "devDependencies": {
47
- "@commitlint/cli": "^19.0.3",
46
+ "@commitlint/cli": "^19.2.2",
48
47
  "@pplancq/babel-config": "*",
49
48
  "@pplancq/commitlint-config": "*",
50
49
  "@pplancq/eslint-config": "*",
@@ -53,12 +52,12 @@
53
52
  "@pplancq/stylelint-config": "*",
54
53
  "@pplancq/webpack-config": "*",
55
54
  "@testing-library/jest-dom": "^6.1.5",
56
- "@testing-library/react": "^14.1.2",
55
+ "@testing-library/react": "^15.0.2",
57
56
  "@testing-library/user-event": "^14.5.1",
58
- "@types/react": "^18.2.64",
59
- "@types/react-dom": "^18.2.21",
57
+ "@types/react": "^18.2.79",
58
+ "@types/react-dom": "^18.2.25",
60
59
  "@vitejs/plugin-react": "^4.2.1",
61
- "@vitest/coverage-v8": "^1.3.1",
60
+ "@vitest/coverage-v8": "^1.5.0",
62
61
  "concurrently": "^8.2.2",
63
62
  "eslint": "^8.57.0",
64
63
  "eslint-plugin-prettier": "^5.1.3",
@@ -66,21 +65,22 @@
66
65
  "jsdom": "^24.0.0",
67
66
  "lint-staged": "^15.2.0",
68
67
  "prettier": "^3.2.5",
69
- "stylelint": "^16.2.1",
68
+ "stylelint": "^16.3.1",
70
69
  "stylelint-prettier": "^5.0.0",
71
70
  "tsc-files": "^1.1.4",
72
- "typescript": "^5.4.2",
71
+ "typescript": "^5.4.5",
73
72
  "vite-plugin-svgr": "^4.2.0",
74
- "vite-tsconfig-paths": "^4.2.2",
73
+ "vite-tsconfig-paths": "^4.3.2",
75
74
  "vitest": "^1.0.4",
75
+ "vitest-axe": "^1.0.0-pre.3",
76
76
  "vitest-sonar-reporter": "^2.0.0",
77
- "webpack": "^5.90.3",
77
+ "webpack": "^5.91.0",
78
78
  "webpack-cli": "^5.1.4",
79
- "webpack-dev-server": "^4.15.1"
79
+ "webpack-dev-server": "^4.15.2"
80
80
  },
81
81
  "volta": {
82
- "node": "20.10.0",
83
- "npm": "10.2.5"
82
+ "node": "20.12.2",
83
+ "npm": "10.5.2"
84
84
  },
85
85
  "browserslist": {
86
86
  "production": [
@@ -30,11 +30,14 @@ const getPackageManager = () => {
30
30
  const packageManager = getPackageManager();
31
31
 
32
32
  console.info('\nremove webpack ...');
33
- runCommand(`${packageManager} remove @pplancq/webpack-config webpack webpack-cli webpack-dev-server`);
33
+ runCommand(
34
+ `${packageManager} remove @pplancq/webpack-config @pplancq/babel-config webpack webpack-cli webpack-dev-server`,
35
+ );
34
36
  rmSync(resolve(__dirname, '../webpack.config.js'));
37
+ rmSync(resolve(__dirname, '../babelrc.js'));
35
38
  console.info('\ninstall vite package ...');
36
39
  runCommand(
37
- `${packageManager} ${packageManager === YARN ? 'add --dev' : 'install --save-dev'} vite vite-plugin-eslint2 vite-plugin-stylelint`,
40
+ `${packageManager} ${packageManager === YARN ? 'add --dev' : 'install --save-dev'} vite vite-plugin-eslint2 vite-plugin-stylelint sass`,
38
41
  );
39
42
 
40
43
  writeFileSync(
@@ -0,0 +1,12 @@
1
+ import { render } from '@testing-library/react';
2
+ import { expect } from 'vitest';
3
+ import { axe } from 'vitest-axe';
4
+ import { Logo } from '../Logo';
5
+
6
+ describe('<Logo />', () => {
7
+ it('should', async () => {
8
+ const { container } = render(<Logo src="foo" alt="bar" />);
9
+
10
+ expect(await axe(container)).toHaveNoViolations();
11
+ });
12
+ });
package/tsconfig.json CHANGED
@@ -6,7 +6,13 @@
6
6
  "dom.iterable",
7
7
  "esnext"
8
8
  ],
9
- "types": ["./src/react-app-env.d.ts", "@pplancq/webpack-config", "vitest/globals", "@testing-library/jest-dom/vitest"],
9
+ "types": [
10
+ "./src/react-app-env.d.ts",
11
+ "@pplancq/webpack-config",
12
+ "vitest/globals",
13
+ "@testing-library/jest-dom/vitest",
14
+ "vitest-axe/extend-expect"
15
+ ],
10
16
  "allowJs": true,
11
17
  "skipLibCheck": true,
12
18
  "esModuleInterop": true,
package/vitest.setup.ts CHANGED
@@ -1 +1,10 @@
1
+ /* eslint-disable import/no-extraneous-dependencies */
1
2
  import '@testing-library/jest-dom/vitest';
3
+ import { cleanup } from '@testing-library/react';
4
+ import * as matchers from 'vitest-axe/matchers';
5
+
6
+ expect.extend(matchers);
7
+
8
+ afterEach(() => {
9
+ cleanup();
10
+ });