@pplancq/react-template 1.5.0 → 1.5.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 CHANGED
@@ -1,3 +1,9 @@
1
+ ## @pplancq/react-template [1.5.1](https://github.com/pplancq/dev-tools/compare/@pplancq/react-template@1.5.0...@pplancq/react-template@1.5.1) (2024-06-04)
2
+
3
+ ### Bug Fixes
4
+
5
+ * **react-template:** fix typo in fetch contanst ([05ca8ce](https://github.com/pplancq/dev-tools/commit/05ca8ce81440d9ced56ecbd6307ff43ca85df848))
6
+
1
7
  ## @pplancq/react-template [1.5.0](https://github.com/pplancq/dev-tools/compare/@pplancq/react-template@1.4.0...@pplancq/react-template@1.5.0) (2024-05-06)
2
8
 
3
9
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pplancq/react-template",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "license": "MIT",
5
5
  "description": "react template",
6
6
  "author": "pplancq <paul.plancq@outlook.fr>",
@@ -33,13 +33,13 @@
33
33
  "template"
34
34
  ],
35
35
  "dependencies": {
36
- "@hookform/resolvers": "^3.3.2",
37
- "@tanstack/react-query": "^5.32.1",
38
- "@tanstack/react-query-devtools": "^5.35.1",
36
+ "@hookform/resolvers": "^3.4.2",
37
+ "@tanstack/react-query": "^5.40.0",
38
+ "@tanstack/react-query-devtools": "^5.40.0",
39
39
  "react": "^18.2.0",
40
40
  "react-dom": "^18.3.1",
41
- "react-hook-form": "^7.51.4",
42
- "react-router-dom": "^6.23.0",
41
+ "react-hook-form": "^7.51.5",
42
+ "react-router-dom": "^6.23.1",
43
43
  "yup": "^1.4.0"
44
44
  },
45
45
  "devDependencies": {
@@ -52,20 +52,20 @@
52
52
  "@pplancq/stylelint-config": "*",
53
53
  "@pplancq/webpack-config": "*",
54
54
  "@testing-library/jest-dom": "^6.4.5",
55
- "@testing-library/react": "^15.0.6",
55
+ "@testing-library/react": "^15.0.7",
56
56
  "@testing-library/user-event": "^14.5.1",
57
- "@types/react": "^18.3.1",
57
+ "@types/react": "^18.3.3",
58
58
  "@types/react-dom": "^18.3.0",
59
- "@vitejs/plugin-react": "^4.2.1",
59
+ "@vitejs/plugin-react": "^4.3.0",
60
60
  "@vitest/coverage-v8": "^1.6.0",
61
61
  "concurrently": "^8.2.2",
62
62
  "eslint": "^8.57.0",
63
63
  "eslint-plugin-prettier": "^5.1.3",
64
64
  "husky": "^9.0.11",
65
- "jsdom": "^24.0.0",
66
- "lint-staged": "^15.2.0",
67
- "prettier": "^3.2.5",
68
- "stylelint": "^16.5.0",
65
+ "jsdom": "^24.1.0",
66
+ "lint-staged": "^15.2.5",
67
+ "prettier": "^3.3.0",
68
+ "stylelint": "^16.6.1",
69
69
  "stylelint-prettier": "^5.0.0",
70
70
  "tsc-files": "^1.1.4",
71
71
  "typescript": "^5.4.5",
@@ -10,7 +10,7 @@ export enum HEADERS {
10
10
  contentType = 'content-type',
11
11
  }
12
12
 
13
- export enum MINE_TYPES {
13
+ export enum MIME_TYPES {
14
14
  json = 'application/json',
15
15
  text = 'plain/text',
16
16
  }
@@ -1,9 +1,9 @@
1
1
  import type { Json } from '@Front/types/api';
2
- import { HEADERS, METHODS, MINE_TYPES } from './constant';
2
+ import { HEADERS, METHODS, MIME_TYPES } from './constant';
3
3
 
4
4
  export type FetchApiError = Error & {
5
5
  code?: number;
6
- contentType?: MINE_TYPES;
6
+ contentType?: MIME_TYPES;
7
7
  };
8
8
 
9
9
  type FetchApiProps = {
@@ -22,7 +22,7 @@ export const fetchApi = async <T extends Json | string>({
22
22
  const mergeHeaders = new Headers(headers);
23
23
 
24
24
  if (data) {
25
- mergeHeaders.append(HEADERS.contentType, MINE_TYPES.json);
25
+ mergeHeaders.append(HEADERS.contentType, MIME_TYPES.json);
26
26
  }
27
27
 
28
28
  const response = await fetch(path, {
@@ -36,7 +36,7 @@ export const fetchApi = async <T extends Json | string>({
36
36
  if (!response.ok) {
37
37
  const error: FetchApiError = new Error(content);
38
38
  error.code = response.status;
39
- error.contentType = (response.headers.get(HEADERS.contentType) as MINE_TYPES) ?? MINE_TYPES.text;
39
+ error.contentType = (response.headers.get(HEADERS.contentType) as MIME_TYPES) ?? MIME_TYPES.text;
40
40
 
41
41
  throw error;
42
42
  }