Skip to content

Commit

Permalink
Merge pull request #107 from samuel-gomez/feature/update-deps-20240208
Browse files Browse the repository at this point in the history
Feature/update deps 20240208
  • Loading branch information
samuel-gomez authored Feb 21, 2024
2 parents 1198fb9 + d28621f commit 23eaad8
Show file tree
Hide file tree
Showing 141 changed files with 1,058 additions and 974 deletions.
3 changes: 0 additions & 3 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx --no -- commitlint --edit "$1" ||
(
echo '🤢 ❌ Le nom du commit ne respecte pas les conventions';
Expand Down
3 changes: 0 additions & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

echo '🏗️👷 Styling your project before committing'

# Check and Fix Prettier standards / ESLint Standards
Expand Down
4 changes: 0 additions & 4 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"


# If everything passes... Now we can commit
echo '🏗️👷 Testing and building your project before pushing.'

Expand Down
637 changes: 287 additions & 350 deletions package-lock.json

Large diffs are not rendered by default.

56 changes: 28 additions & 28 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "react-starter-vitejs",
"description": "This repository is a starter project that use React Toolkit Axa and Vite.",
"version": "0.5.5",
"version": "1.0.0",
"private": true,
"type": "module",
"scripts": {
Expand All @@ -18,51 +18,51 @@
"prettier:fix": "prettier --write src",
"check": "npm run prettier && npm run lint",
"fix": "npm run prettier:fix && npm run lint:fix",
"prepare": "husky install",
"prepare": "husky",
"cz": "cz",
"clean": "cd ./scripts && npm i && npm start && cd .. && npx rimraf ./scripts",
"copy": "cd ./scripts && npm i && npm run copy"
},
"dependencies": {
"@axa-fr/react-oidc": "7.12.12",
"@axa-fr/react-oidc": "7.15.4",
"@axa-fr/react-toolkit-all": "2.2.0",
"@axa-fr/react-toolkit-core": "2.2.0",
"@tanstack/react-query": "5.17.15",
"@tanstack/react-query-devtools": "5.17.15",
"@tanstack/react-query": "5.18.1",
"@tanstack/react-query-devtools": "5.18.1",
"@uiw/react-textarea-code-editor": "3.0.2",
"axe-core": "4.8.3",
"axe-core": "4.8.4",
"cross-fetch": "4.0.0",
"downloadjs": "1.4.7",
"github-markdown-css": "5.5.0",
"github-markdown-css": "5.5.1",
"lodash": "4.17.21",
"prism-react-renderer": "2.3.1",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-draggable": "4.4.6",
"react-hook-form": "7.49.3",
"react-live": "4.1.5",
"react-hook-form": "7.50.1",
"react-live": "4.1.6",
"react-markdown": "9.0.1",
"react-router-dom": "6.21.2",
"react-router-dom": "6.22.0",
"rehype-slug": "6.0.0",
"remark-gfm": "4.0.0"
},
"devDependencies": {
"@commitlint/cli": "18.4.4",
"@commitlint/config-conventional": "18.4.4",
"@testing-library/jest-dom": "6.2.0",
"@testing-library/react": "14.1.2",
"@commitlint/cli": "18.6.0",
"@commitlint/config-conventional": "18.6.0",
"@testing-library/jest-dom": "6.4.2",
"@testing-library/react": "14.2.1",
"@testing-library/react-hooks": "8.0.1",
"@testing-library/user-event": "14.5.2",
"@types/downloadjs": "1.4.6",
"@types/jest-axe": "3.5.9",
"@types/lodash": "4.14.202",
"@types/node": "20.11.5",
"@types/react": "18.2.48",
"@types/react-dom": "18.2.18",
"@typescript-eslint/eslint-plugin": "6.19.0",
"@typescript-eslint/parser": "6.19.0",
"@types/node": "20.11.16",
"@types/react": "18.2.55",
"@types/react-dom": "18.2.19",
"@typescript-eslint/eslint-plugin": "6.21.0",
"@typescript-eslint/parser": "6.21.0",
"@vitejs/plugin-react": "4.2.1",
"@vitest/coverage-v8": "1.2.0",
"@vitest/coverage-v8": "1.2.2",
"cz-conventional-changelog": "3.3.0",
"eslint": "8.56.0",
"eslint-config-airbnb": "19.0.4",
Expand All @@ -73,20 +73,20 @@
"eslint-plugin-prettier": "5.1.3",
"eslint-plugin-react": "7.33.2",
"eslint-plugin-react-hooks": "4.6.0",
"husky": "8.0.3",
"husky": "9.0.10",
"jest-axe": "8.0.0",
"jest-cucumber": "3.0.1",
"jsdom": "23.2.0",
"lint-staged": "15.2.0",
"msw": "2.1.2",
"prettier": "3.2.4",
"jsdom": "24.0.0",
"lint-staged": "15.2.2",
"msw": "2.1.7",
"prettier": "3.2.5",
"rollup-plugin-visualizer": "5.12.0",
"sass": "1.69.7",
"sass": "1.70.0",
"serve": "14.2.1",
"typescript": "5.3.3",
"vite": "5.0.11",
"vite": "5.1.0",
"vite-tsconfig-paths": "4.3.1",
"vitest": "1.2.0",
"vitest": "1.2.2",
"vitest-sonar-reporter": "1.0.0",
"whatwg-fetch": "3.6.20"
},
Expand Down
48 changes: 24 additions & 24 deletions scripts/files/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,38 +18,38 @@
"prettier:fix": "prettier --write src",
"check": "npm run prettier && npm run lint",
"fix": "npm run prettier:fix && npm run lint:fix",
"prepare": "husky install",
"prepare": "husky",
"cz": "cz"
},
"dependencies": {
"@axa-fr/react-oidc": "7.12.12",
"@axa-fr/react-oidc": "7.15.4",
"@axa-fr/react-toolkit-all": "2.2.0",
"@axa-fr/react-toolkit-core": "2.2.0",
"@tanstack/react-query": "5.17.15",
"@tanstack/react-query-devtools": "5.17.15",
"@tanstack/react-query": "5.18.1",
"@tanstack/react-query-devtools": "5.18.1",
"cross-fetch": "4.0.0",
"lodash": "4.17.21",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-hook-form": "7.49.3",
"react-router-dom": "6.21.2"
"react-hook-form": "7.50.1",
"react-router-dom": "6.22.0"
},
"devDependencies": {
"@commitlint/cli": "18.4.4",
"@commitlint/config-conventional": "18.4.4",
"@testing-library/jest-dom": "6.2.0",
"@testing-library/react": "14.1.2",
"@commitlint/cli": "18.6.0",
"@commitlint/config-conventional": "18.6.0",
"@testing-library/jest-dom": "6.4.2",
"@testing-library/react": "14.2.1",
"@testing-library/react-hooks": "8.0.1",
"@testing-library/user-event": "14.5.2",
"@types/jest-axe": "3.5.9",
"@types/lodash": "4.14.202",
"@types/node": "20.11.5",
"@types/react": "18.2.48",
"@types/react-dom": "18.2.18",
"@typescript-eslint/eslint-plugin": "6.19.0",
"@typescript-eslint/parser": "6.19.0",
"@types/node": "20.11.16",
"@types/react": "18.2.55",
"@types/react-dom": "18.2.19",
"@typescript-eslint/eslint-plugin": "6.21.0",
"@typescript-eslint/parser": "6.21.0",
"@vitejs/plugin-react": "4.2.1",
"@vitest/coverage-v8": "1.2.0",
"@vitest/coverage-v8": "1.2.2",
"cz-conventional-changelog": "3.3.0",
"eslint": "8.56.0",
"eslint-config-airbnb": "19.0.4",
Expand All @@ -60,20 +60,20 @@
"eslint-plugin-prettier": "5.1.3",
"eslint-plugin-react": "7.33.2",
"eslint-plugin-react-hooks": "4.6.0",
"husky": "8.0.3",
"husky": "9.0.10",
"jest-axe": "8.0.0",
"jest-cucumber": "3.0.1",
"jsdom": "23.2.0",
"lint-staged": "15.2.0",
"msw": "2.1.2",
"prettier": "3.2.4",
"jsdom": "24.0.0",
"lint-staged": "15.2.2",
"msw": "2.1.7",
"prettier": "3.2.5",
"rollup-plugin-visualizer": "5.12.0",
"sass": "1.69.7",
"sass": "1.70.0",
"serve": "14.2.1",
"typescript": "5.3.3",
"vite": "5.0.11",
"vite": "5.1.0",
"vite-tsconfig-paths": "4.3.1",
"vitest": "1.2.0",
"vitest": "1.2.2",
"vitest-sonar-reporter": "1.0.0",
"whatwg-fetch": "3.6.20"
},
Expand Down
6 changes: 3 additions & 3 deletions scripts/files/src/App/Routes/__tests__/Routes.test.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { PropsWithChildren } from 'react';
import { render, screen, waitFor, act } from 'shared/testsUtils/customRender';
import { type PropsWithChildren } from 'react';
import { act, render, screen, waitFor } from 'shared/testsUtils/customRender';

import { PROFILS } from 'shared/constants';
import { TITLE as TITLE_HOME } from 'pages/Home';
import { TITLE as TITLE_NOTFOUND } from 'pages/NotFound';
import { TITLE as TITLE_UNAUTHORIZE } from 'pages/Unauthorize';
import { PROFILS } from 'shared/constants';
import Routes, { ROUTE_URLS } from '..';
import { RouteSecure } from '../RouteSecure';

Expand Down
8 changes: 4 additions & 4 deletions scripts/files/src/Layout/Header/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { ReactNode } from 'react';
import type { Tanomaly } from 'shared/types';
import { Header, Name, User, Infos } from '@axa-fr/react-toolkit-all';
import { Header, Infos, Name, User } from '@axa-fr/react-toolkit-all';
import logo from '@axa-fr/react-toolkit-core/dist/assets/logo-axa.svg';
import Skeleton from 'shared/components/Skeleton';
import type { ReactNode } from 'react';
import Resilience from 'shared/components/Resilience';
import Skeleton from 'shared/components/Skeleton';
import type { Tanomaly } from 'shared/types.d';
import './Header.scss';

type THeaderInfo = {
Expand Down
2 changes: 1 addition & 1 deletion scripts/files/src/pages/Home/Home.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Layout, { TLayoutPage } from 'Layout';
import Layout, { type TLayoutPage } from 'Layout';
import { TITLE, TITLE_BAR } from './constants';

export type THome = TLayoutPage;
Expand Down
2 changes: 1 addition & 1 deletion src/App/Authentication/Authentication.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { OidcProvider } from '@axa-fr/react-oidc';
import { EnvironmentContext } from 'App/EnvironmentProvider';
import { ReactNode, useContext } from 'react';
import { useContext, type ReactNode } from 'react';

const Authentication = ({ children, OidcProviderCmpt = OidcProvider }: { children: ReactNode; OidcProviderCmpt?: typeof OidcProvider }) => {
const { environment } = useContext(EnvironmentContext);
Expand Down
2 changes: 1 addition & 1 deletion src/App/Authentication/__tests__/Authentication.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { render, screen } from '@testing-library/react';
import EnvironmentProvider from 'App/EnvironmentProvider';
import { ReactNode } from 'react';
import { type ReactNode } from 'react';
import Authentication from '../Authentication';

const setOidc = (isEnabled = true) => ({
Expand Down
4 changes: 2 additions & 2 deletions src/App/EnvironmentProvider/Environment.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { OidcConfiguration } from '@axa-fr/react-oidc';
import { useState, useEffect, createContext, Dispatch, SetStateAction } from 'react';
import { type OidcConfiguration } from '@axa-fr/react-oidc';
import { createContext, useEffect, useState, type Dispatch, type SetStateAction } from 'react';

export type TEnvironment = {
apiUrl: Record<string, string>;
Expand Down
6 changes: 3 additions & 3 deletions src/App/FetchProvider/FetchProvider.helpers.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { API_URL, STATUS_API, STATUS_HTTP_MESSAGES } from 'shared/constants';
import { useOidcAccessToken } from '@axa-fr/react-oidc';
import { type QueryKey } from '@tanstack/react-query';
import fetch from 'cross-fetch';
import { QueryKey } from '@tanstack/react-query';
import { API_URL, STATUS_API, STATUS_HTTP_MESSAGES } from 'shared/constants';
import { isEmptyOrNull, mergeObj } from 'shared/helpers';
import { useOidcAccessToken } from '@axa-fr/react-oidc';
import { useOidcAccessTokenMock } from './constants';

type TsetResponseError = {
Expand Down
2 changes: 1 addition & 1 deletion src/App/FetchProvider/FetchProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createContext, ReactNode, useMemo, useContext } from 'react';
import type { QueryKey } from '@tanstack/react-query';
import { EnvironmentContext } from 'App/EnvironmentProvider';
import { createContext, useContext, useMemo, type ReactNode } from 'react';
import { mergeObj } from 'shared/helpers';
import { getAccessToken, setFetchCustom } from './FetchProvider.helpers';

Expand Down
2 changes: 1 addition & 1 deletion src/App/NotificationProvider/NotificationProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createContext, ReactNode, useMemo } from 'react';
import { createContext, useMemo, type ReactNode } from 'react';
import { emptyFunction } from 'shared/helpers';
import Notifications from './Notifications';
import useNotifications, { type TaddNotification } from './Notifications.hook';
Expand Down
6 changes: 3 additions & 3 deletions src/App/QueryProvider/QueryProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { ReactNode, useContext } from 'react';
import { DefaultOptions, QueryClient, QueryClientProvider, QueryKey } from '@tanstack/react-query';
import { QueryClient, QueryClientProvider, type DefaultOptions, type QueryKey } from '@tanstack/react-query';
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
import { FetchContext } from 'App/FetchProvider';
import type { FetchContextType, TFetchCustom } from 'App/FetchProvider';
import { FetchContext } from 'App/FetchProvider';
import { useContext, type ReactNode } from 'react';
import { CACHE_TIME, REFETCH_ON_WINDOWS_FOCUS, RETRY_REQUEST } from './constants';

export const defaultQueryWithAuth = async (queryKey: QueryKey, fetchCustom: TFetchCustom) => fetchCustom(queryKey);
Expand Down
4 changes: 2 additions & 2 deletions src/App/QueryProvider/__tests__/QueryProvider.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { QueryKey } from '@tanstack/react-query';
import { showReactQueryDevtools, setQueryClient, setQuery, defaultQueryWithAuth } from '../QueryProvider';
import { type QueryKey } from '@tanstack/react-query';
import { defaultQueryWithAuth, setQuery, setQueryClient, showReactQueryDevtools } from '../QueryProvider';

describe('defaultQueryWithAuth', () => {
it('Should call fetchCustom with querykey when defaultQueryWithAuthFn have been called with fetchcustom and querykey', async () => {
Expand Down
2 changes: 1 addition & 1 deletion src/App/Routes/__tests__/Routes.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PropsWithChildren } from 'react';
import { type PropsWithChildren } from 'react';
import { act, render, screen, waitFor } from 'shared/testsUtils/customRender';

import { TITLE as TITLE_ACCORDION } from 'pages/Demos/Accordion';
Expand Down
2 changes: 1 addition & 1 deletion src/App/UserProvider/UserProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createContext, ReactNode, useContext, useMemo } from 'react';
import { EnvironmentContext } from 'App/EnvironmentProvider';
import { createContext, useContext, useMemo, type ReactNode } from 'react';
import { extractDataFromOAuthToken, getUserInfos } from './UserProvider.helpers';

export type TUserContext = ReturnType<typeof extractDataFromOAuthToken> & {
Expand Down
2 changes: 1 addition & 1 deletion src/App/__tests__/App.container.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { render, screen } from '@testing-library/react';
import { TEnvironmentState } from 'App/EnvironmentProvider';
import { type TEnvironmentState } from 'App/EnvironmentProvider';
import { createContext } from 'react';
import { act } from 'react-dom/test-utils';
import AppWithEnvironment, { AppContainer } from '../App.container';
Expand Down
2 changes: 1 addition & 1 deletion src/Layout/Header/Header.container.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ComponentProps, useContext } from 'react';
import { UserContext } from 'App/UserProvider';
import { useContext, type ComponentProps } from 'react';
import Header from './Header';
import { SUBTITLE, TITLE } from './constants';

Expand Down
8 changes: 4 additions & 4 deletions src/Layout/Header/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { ReactNode } from 'react';
import type { Tanomaly } from 'shared/types';
import { Header, Name, User, Infos } from '@axa-fr/react-toolkit-all';
import { Header, Infos, Name, User } from '@axa-fr/react-toolkit-all';
import logo from 'assets/slash-logo.svg';
import Skeleton from 'shared/components/Skeleton';
import type { ReactNode } from 'react';
import Resilience from 'shared/components/Resilience';
import Skeleton from 'shared/components/Skeleton';
import type { Tanomaly } from 'shared/types.d';
import './Header.scss';

type THeaderInfo = {
Expand Down
8 changes: 4 additions & 4 deletions src/Layout/Menu/Menu.container.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { useState, useCallback, Dispatch, SetStateAction, useMemo } from 'react';
import { useLocation } from 'react-router-dom';
import { Action, ToggleButton } from '@axa-fr/react-toolkit-all';
import { Menu, TMenu } from './Menu';
import MENU_ITEMS, { CLASS_BODY_MENU_OPEN } from './constants';
import { useCallback, useMemo, useState, type Dispatch, type SetStateAction } from 'react';
import { useLocation } from 'react-router-dom';
import { Menu, type TMenu } from './Menu';
import type { TMenuItemBase } from './MenuItem';
import MENU_ITEMS, { CLASS_BODY_MENU_OPEN } from './constants';

const isNotNull = (item: unknown) => item !== null;

Expand Down
4 changes: 2 additions & 2 deletions src/Layout/Menu/Menu.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { ComponentPropsWithoutRef } from 'react';
import { NavBar } from '@axa-fr/react-toolkit-all';
import { type ComponentPropsWithoutRef } from 'react';
import { emptyFunction } from 'shared/helpers';
import { createMenu, TMenuItemBase } from './MenuItem';
import './Menu.scss';
import { createMenu, type TMenuItemBase } from './MenuItem';

export type TMenu = Omit<ComponentPropsWithoutRef<typeof NavBar>, 'children' | 'onClick'> & {
menuItems?: TMenuItemBase[];
Expand Down
4 changes: 2 additions & 2 deletions src/Layout/Menu/MenuItem/MenuItem.container.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* eslint-disable @typescript-eslint/no-use-before-define */
import isEmpty from 'lodash/isEmpty';
import { AriaAttributes } from 'react';
import { type AriaAttributes } from 'react';
import Authorize from 'shared/components/Authorize';
import { MenuItem } from './MenuItem';
import type { TMenuItemEnhanced, TMenuItemBase } from './MenuItem.d';
import type { TMenuItemBase, TMenuItemEnhanced } from './MenuItem.d';

export const createMenu = (menuItems: TMenuItemBase[], onClick?: (event: React.MouseEvent<HTMLElement>) => void, basePath?: string) =>
menuItems.map(menuItem => (
Expand Down
Loading

0 comments on commit 23eaad8

Please sign in to comment.