Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/#2123 upgrade dependencies client #2173

Merged
merged 39 commits into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
9033821
chore(client): :arrow_up: Upgrade patch dependencies
kaaloo Jul 10, 2024
975e950
chore(server): :arrow_up: Upgrade patch dependencies
kaaloo Jul 10, 2024
6ec6076
chore(client): :arrow_up: Update lexical
kaaloo Jul 10, 2024
166d08d
chore(client):
kaaloo Jul 10, 2024
2f86bf1
chore(client): :arrow_up: Upgrade several miscellaneous dependencies
kaaloo Jul 10, 2024
b101b03
chore(client): :arrow_up: Upgrade i18next related dependencies and fi…
kaaloo Jul 10, 2024
8d997cd
chore(client): :arrow_up: Upgrade styled components to 6.x. Migrate …
kaaloo Jul 10, 2024
c049c68
chore(client): :white_check_mark: Update snapshots due to new styledc…
kaaloo Jul 10, 2024
9aa3607
chore(client): :arrow_up: redux - Major upgrade
kaaloo Jul 10, 2024
093cb4f
chore(client): :arrow_up: Major typescript version upgrade and typing…
kaaloo Jul 10, 2024
a1400d5
chore(client):
kaaloo Jul 11, 2024
7828ed1
chore(client): :rotating_light: Fix linting issues related to useEffe…
kaaloo Jul 11, 2024
8e4ec31
build(client): :green_heart: Bring back typescript module declaration…
kaaloo Jul 11, 2024
ce651dc
chore: :arrow_up: upgrade client and server patch dependencies
kaaloo Jul 11, 2024
e2c13cf
chore: :arrow_up: Upgrade minor dependencies
kaaloo Jul 11, 2024
b9621bb
chore: :arrow_up: Upgrade testing library dependencies
kaaloo Jul 11, 2024
0144091
chore(client): :arrow_up: Upgrade few remaining non problematic depen…
kaaloo Jul 11, 2024
b18f30b
chore(client): :arrow_up: Major upgrade of next-sitemap package and c…
kaaloo Jul 11, 2024
b92df08
chore(client): :arrow_up: Add dependencies to move from react-test-re…
kaaloo Jul 15, 2024
aac8f07
refactor(client): :fire: Remove wrapWithProvidersAndRender in favor o…
kaaloo Jul 15, 2024
b39528a
chore(client): :arrow_up: Add @testing-library/user-event dependency
kaaloo Jul 15, 2024
535ccd5
refactor(client): :recycle: Use data-testid instead of data-test-id a…
kaaloo Jul 15, 2024
1a6e064
test(client): :white_check_mark: Update tests to use @testing-library
kaaloo Jul 15, 2024
e88fb36
test(client): :white_check_mark: Add mock IntersectionObserver
kaaloo Jul 16, 2024
bcae882
test(client): :white_check_mark: Use asFragment api to get generated …
kaaloo Jul 16, 2024
35c5814
test(client): :lipstick: Update snapshots
kaaloo Jul 16, 2024
b223be0
Merge branch 'dev' into feat/#2123-Upgrade-Dependencies-client
kaaloo Jul 16, 2024
97a7d70
Merge branch 'dev' into feat/#2123-Upgrade-Dependencies-client
kaaloo Jul 18, 2024
737f254
test(client): :white_check_mark: Fix publier.test
kaaloo Jul 18, 2024
7c36a5f
test(client): :white_check_mark: Fix home page test
kaaloo Jul 18, 2024
c48b5f7
test(client): :white_check_mark: Fix more tests
kaaloo Jul 18, 2024
2958442
test(client): :white_check_mark: Update remaining tests
kaaloo Jul 19, 2024
eb8a9ae
style(client): :lipstick: Fix :hover issue on some components
kaaloo Jul 19, 2024
673cb5b
test(client): :white_check_mark: Update snapshots
kaaloo Jul 19, 2024
3932b35
chore(client): :lipstick: Reintroduce and configure typescript-plugin…
kaaloo Jul 19, 2024
01e3dd4
chore(client): :wrench: Add settings for alias-tool extension which a…
kaaloo Jul 19, 2024
96b440a
style(client): :lipstick: Update remaning scss files to use ~scss ali…
kaaloo Jul 19, 2024
5d1ab31
chore(client): :heavy_plus_sign: Move sharp to dev dependency
kaaloo Jul 19, 2024
2dc541c
style(client): :lipstick: Cannot use tilde paths to import vendor scs…
kaaloo Jul 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 3 additions & 3 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp

// List of extensions which should be recommended for users of this workspace.
"recommendations": [
"vivaxy.vscode-conventional-commits",
"github.vscode-pull-request-github",
"lokalise.i18n-ally",
"esbenp.prettier-vscode"
"esbenp.prettier-vscode",
"dgeibi.alias-tool"
],
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
"unwantedRecommendations": []
}
}
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"alias-tool.mappings": {
"~scss": "${workspace}/client/src/scss",
},
"scss.lint.unknownAtRules": "ignore",
"eslint.workingDirectories": [
"./client",
Expand Down Expand Up @@ -54,4 +57,4 @@
"githubIssues.issueBranchTitle": "feat/#${issueNumber}-${sanitizedIssueTitle}",
"javascript.preferences.importModuleSpecifier": "relative",
"typescript.preferences.importModuleSpecifier": "relative"
}
}
31 changes: 2 additions & 29 deletions client/jest/lib/wrapWithProvidersAndRender.tsx
Original file line number Diff line number Diff line change
@@ -1,44 +1,17 @@
import { render } from "@testing-library/react";
import React from "react";
import renderer from "react-test-renderer";
import { Provider } from "react-redux";
import { BrowserRouter as Router } from "react-router-dom";
import configureStore from "redux-mock-store";
import { RootState } from "services/rootReducer";
import { initialMockStore } from "__fixtures__/reduxStore";
import { BrowserRouter as Router } from "react-router-dom";
import { render } from "@testing-library/react";

interface WrapWithProvidersAndRenderParams<Props> {
Component: React.FunctionComponent<any>;
compProps?: Props;
reduxState?: Partial<RootState>;
}

/**
* Provide all the ugly-to-set-up providers for your component to be ready to test
* @param Component
* @param compProps properties passed on to [getPropsWithNavigation()] to gen navigation props
* @param reduxState defaults to initialRootState
*/

export function wrapWithProvidersAndRender<T>({
Component,
compProps,
reduxState = initialMockStore,
}: WrapWithProvidersAndRenderParams<T>) {
const mockStore = configureStore([]);
const store = mockStore(reduxState);

const componentWithRedux = (
<Router>
<Provider store={store}>
<Component {...compProps} />
</Provider>
</Router>
);

return renderer.create(componentWithRedux);
}

/**
* Provide all the ugly-to-set-up providers for your component to be ready to test
* @param Component
Expand Down
25 changes: 25 additions & 0 deletions client/jest/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,28 @@ jest.mock("next-i18next", () => ({
return WrappedComponent;
},
}));

// Mock the IntersectionObserver, see https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API
export class IntersectionObserver {
root = null;
rootMargin = "";
thresholds = [];

disconnect() {
return null;
}

observe() {
return null;
}

takeRecords() {
return [];
}

unobserve() {
return null;
}
}
window.IntersectionObserver = IntersectionObserver;
global.IntersectionObserver = IntersectionObserver;
68 changes: 34 additions & 34 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,31 @@
"url": "[email protected]:entrepreneur-interet-general/karfur.git"
},
"dependencies": {
"@codegouvfr/react-dsfr": "^1.9.11",
"@hedgedoc/html-to-react": "^1.4.5",
"@lexical/react": "^0.11.0",
"@codegouvfr/react-dsfr": "^1.9.25",
"@hedgedoc/html-to-react": "^2.1.1",
"@lexical/react": "^0.16.1",
"@react-google-maps/api": "^2.17.0",
"@refugies-info/api-types": "*",
"algoliasearch": "^4.14.2",
"autosuggest-highlight": "^3.1.1",
"axios": "^0.26.0",
"axios": "^1.7.2",
"bootstrap": "^5.2.3",
"eva-icons": "^1.1.3",
"flag-icons": "^6.6.6",
"flag-icons": "^7.2.3",
"google-oauth-gsi": "^4.0.0",
"html2plaintext": "^2.1.4",
"i18next": "^22.0.6",
"i18next": "^23.11.5",
"js-cookie": "^3.0.1",
"jwt-decode": "^3.1.2",
"lexical": "^0.11.0",
"jwt-decode": "^4.0.0",
"lexical": "^0.16.1",
"lodash": "^4.17.21",
"moment": "^2.29.4",
"next": "^14.2.4",
"next-i18next": "^13.0.0",
"next": "^14.2.5",
"next-i18next": "^15.3.0",
"next-redux-wrapper": "^8.0.0",
"next-sitemap": "^3.1.32",
"next-sitemap": "^4.2.3",
"process": "^0.11.10",
"query-string": "^8.1.0",
"query-string": "^9.0.0",
"rc-time-picker": "^3.7.3",
"react": "^18.3.1",
"react-anchor-link-smooth-scroll": "^1.0.12",
Expand All @@ -48,33 +48,32 @@
"react-ga4": "^2.1.0",
"react-google-autocomplete": "^2.6.1",
"react-hook-form": "^7.43.1",
"react-i18next": "^12.0.0",
"react-intersection-observer": "^9.4.1",
"react-i18next": "^14.1.2",
"react-intersection-observer": "^9.12.0",
"react-loading-skeleton": "^3.1.0",
"react-notifications": "^1.7.3",
"react-redux": "^8.0.5",
"react-redux": "^9.1.2",
"react-router-dom": "^5.3.4",
"react-router-hash-link": "^2.4.3",
"react-sortablejs": "^6.1.4",
"react-to-print": "^2.12.1",
"react-use": "^17.4.0",
"reactstrap": "^9.2.2",
"redux": "^4.0.1",
"redux": "^5.0.1",
"redux-saga": "^1.1.3",
"remixicon": "^2.5.0",
"sharp": "^0.31.2",
"remixicon": "^4.3.0",
"sortablejs": "^1.15.0",
"styled-components": "^5.3.6",
"styled-components": "^6.1.11",
"sweetalert2": "^11.6.16",
"typesafe-actions": "^5.1.0",
"uuid": "^9.0.0"
"uuid": "^10.0.0"
},
"scripts": {
"predev": "only-include-used-icons",
"prebuild": "only-include-used-icons",
"dev": "next dev",
"start": "next start",
"build": "next build",
"build": "NEXT_SHARP_PATH=../node_modules/.bin/sharp next build",
"test": "npm run test:lint && npm run test:types && npm run test:unit",
"test-with-coverage": "jest --coverage && cat ./coverage/lcov.info | codacy-coverage",
"test:types": "tsc --noEmit",
Expand All @@ -95,10 +94,12 @@
"not op_mini all"
],
"devDependencies": {
"@next/eslint-plugin-next": "^13.0.5",
"@next/eslint-plugin-next": "^14.2.5",
"@redux-devtools/extension": "^3.2.1",
"@testing-library/jest-dom": "^5.16.2",
"@testing-library/react": "^13.4.0",
"@testing-library/dom": "^10.3.1",
"@testing-library/jest-dom": "^6.4.6",
"@testing-library/react": "^16.0.0",
"@testing-library/user-event": "^14.5.2",
"@types/autosuggest-highlight": "^3.2.0",
"@types/file-saver": "^2.0.1",
"@types/html-to-draftjs": "^1.4.0",
Expand All @@ -108,33 +109,32 @@
"@types/react": "^18.3.3",
"@types/react-autosuggest": "^10.1.5",
"@types/react-dom": "^18.3.0",
"@types/react-highlight-words": "^0.16.4",
"@types/react-highlight-words": "^0.20.0",
"@types/react-router-hash-link": "^2.4.5",
"@types/react-test-renderer": "^18.0.0",
"@types/recompose": "^0.30.7",
"@types/redux-mock-store": "^1.0.3",
"@types/sortablejs": "^1.13.0",
"@types/styled-components": "^5.1.1",
"@types/uuid": "^9.0.1",
"@types/uuid": "^10.0.0",
"@types/webrtc": "^0.0.43",
"@typescript-eslint/eslint-plugin": "^5.10.1",
"@typescript-eslint/parser": "^5.10.1",
"@typescript-eslint/eslint-plugin": "^7.16.0",
"@typescript-eslint/parser": "^7.16.0",
"csvtojson": "^2.0.10",
"eslint": "^8.28.0",
"eslint-config-next": "^14.2.4",
"eslint-config-next": "^14.2.5",
"jest": "^29.3.1",
"jest-environment-jsdom": "^29.3.1",
"jest-mock-axios": "^4.7.0-beta2",
"jest-styled-components": "^7.0.0",
"next-router-mock": "^0.8.0",
"next-router-mock": "^0.9.13",
"papaparse": "^5.3.0",
"postcss": "^8.4.5",
"react-test-renderer": "^18.2.0",
"redux-mock-store": "^1.5.4",
"redux-saga-test-plan": "^4.0.0-rc.3",
"sass": "^1.57.1",
"ts-jest": "29.0.3",
"typescript": "^4.9.3",
"sharp": "^0.33.4",
"ts-jest": "29.2.2",
"typescript": "^5.5.3",
"typescript-plugin-css-modules": "^5.1.0"
matthieu-fesselier marked this conversation as resolved.
Show resolved Hide resolved
},
"volta": {
Expand Down
Loading