Skip to content

Commit

Permalink
build(deps)!: update dependencies
Browse files Browse the repository at this point in the history
Update peer dependencies and dependencies with breaking changes.

BREAKING CHANGE: bump tinymce to v6
BREAKING CHANGE: major bump of i18next and related deps (external dependency)
BREAKING CHANGE: bump react-redux to v8 (external dependency)
refs: SHELL-55 (#209)
  • Loading branch information
beawar authored Mar 31, 2023
1 parent f6aac11 commit a7554b5
Show file tree
Hide file tree
Showing 27 changed files with 991 additions and 2,215 deletions.
2,788 changes: 768 additions & 2,020 deletions package-lock.json

Large diffs are not rendered by default.

60 changes: 29 additions & 31 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,84 +37,82 @@
"author": "Zextras Dev Team <https://www.zextras.com/carbonio/>",
"license": "AGPL-3.0-only",
"devDependencies": {
"@babel/core": "^7.20.12",
"@babel/core": "^7.21.3",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-transform-runtime": "^7.19.6",
"@babel/plugin-transform-runtime": "^7.21.0",
"@babel/preset-env": "^7.20.2",
"@babel/preset-react": "^7.18.6",
"@babel/preset-typescript": "^7.18.6",
"@commitlint/cli": "^17.4.2",
"@commitlint/config-conventional": "^17.4.2",
"@babel/preset-typescript": "^7.21.0",
"@commitlint/cli": "^17.4.3",
"@commitlint/config-conventional": "^17.4.3",
"@svgr/webpack": "^6.5.1",
"@types/lodash": "^4.14.191",
"@types/react": "^17.0.53",
"@types/react-dom": "^17.0.18",
"@types/react-dom": "^17.0.19",
"@types/react-router-dom": "^5.3.3",
"@types/react-widgets": "^4.4.7",
"@types/react-widgets-moment": "^4.0.1",
"@types/redux-logger": "^3.0.9",
"@types/styled-components": "^5.1.26",
"@types/ua-parser-js": "^0.7.36",
"@types/webpack-env": "^1.18.0",
"@zextras/carbonio-ui-configs": "^0.1.11",
"@zextras/carbonio-ui-sdk": "^1.5.0",
"autoprefixer": "^10.4.13",
"@zextras/carbonio-ui-sdk": "^1.5.1",
"autoprefixer": "^10.4.14",
"babel-loader": "^9.1.2",
"babel-plugin-i18next-extract": "^0.9.0",
"babel-plugin-styled-components": "^2.0.7",
"copy-webpack-plugin": "^11.0.0",
"core-js": "^3.27.2",
"core-js": "^3.29.1",
"css-loader": "^6.7.3",
"eslint-plugin-notice": "^0.9.10",
"html-webpack-plugin": "^5.5.0",
"husky": "^8.0.3",
"is-ci": "^3.0.1",
"mini-css-extract-plugin": "^2.7.2",
"mini-css-extract-plugin": "^2.7.5",
"moment": "^2.29.4",
"node-fetch": "^2.6.9",
"postcss-loader": "^7.0.2",
"styled-components": "^5.3.6",
"webpack": "^5.75.0",
"postcss-loader": "^7.1.0",
"styled-components": "^5.3.9",
"webpack": "^5.76.2",
"webpack-cli": "^5.0.1",
"webpack-dev-server": "^4.11.1",
"webpack-dev-server": "^4.13.1",
"webpack-merge": "^5.8.0"
},
"dependencies": {
"@fontsource/roboto": "^4.5.7",
"@reduxjs/toolkit": "~1.7.2",
"@sentry/browser": "^7.37.0",
"@tinymce/tinymce-react": "^3.14.0",
"@reduxjs/toolkit": "^1.9.2",
"@sentry/browser": "^7.43.0",
"@tinymce/tinymce-react": "^4.3.0",
"@zextras/carbonio-design-system": "^1.2.0",
"@zextras/carbonio-ui-preview": "^1.1.0",
"darkreader": "^4.9.58",
"history": "^5.3.0",
"i18next": "^21.10.0",
"i18next-http-backend": "^1.4.5",
"i18next": "^22.4.12",
"i18next-http-backend": "^2.2.0",
"immer": "^9.0.19",
"lodash": "^4.17.21",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-i18next": "^11.18.6",
"react-redux": "^7.2.9",
"react-i18next": "^12.1.5",
"react-redux": "^8.0.5",
"react-router-dom": "^5.3.4",
"react-widgets": "^4.6.1",
"react-widgets-moment": "^4.0.30",
"remark-gfm": "3.0.1",
"tinymce": "^5.10.7",
"ua-parser-js": "^1.0.33",
"zustand": "^3.7.2"
"tinymce": "^6.4.0",
"ua-parser-js": "^1.0.34",
"zustand": "^4.3.6"
},
"peerDependencies": {
"@reduxjs/toolkit": "~1.7.2",
"@zextras/carbonio-design-system": "^1.0.0",
"@zextras/carbonio-ui-preview": "^1.0.0",
"@reduxjs/toolkit": "^1.9.2",
"@zextras/carbonio-design-system": "^1",
"@zextras/carbonio-ui-preview": "^1",
"core-js": "^3.27.2",
"lodash": "^4.17.21",
"moment": "^2.29.4",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-i18next": "^11.18.6",
"react-redux": "^7.2.9",
"react-i18next": "^12.1.5",
"react-redux": "^8.0.5",
"react-router-dom": "^5.3.4",
"styled-components": "^5.3.6"
},
Expand Down
4 changes: 2 additions & 2 deletions src/boot/app/default-views.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
/* eslint-disable no-param-reassign */

import produce from 'immer';
import { TFunction } from 'react-i18next';
import { AppState, PrimaryBarView, SettingsView } from '../../../types';
import type { TFunction } from 'i18next';
import type { AppState, PrimaryBarView, SettingsView } from '../../../types';
import { SEARCH_APP_ID, SETTINGS_APP_ID, SHELL_APP_ID } from '../../constants';
import Feedback from '../../reporting/feedback';
import { SearchAppView } from '../../search/search-app-view';
Expand Down
3 changes: 2 additions & 1 deletion src/boot/bootstrapper-router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import {
SnackbarManagerContext
} from '@zextras/carbonio-design-system';
import React, { FC, useContext, useEffect } from 'react';
import { TFunction, useTranslation } from 'react-i18next';
import type { TFunction } from 'i18next';
import { useTranslation } from 'react-i18next';
import { BrowserRouter, Route, Switch, useHistory, useParams } from 'react-router-dom';
import { useBridge } from '../store/context-bridge';
import AppLoaderMounter from './app/app-loader-mounter';
Expand Down
3 changes: 3 additions & 0 deletions src/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,6 @@ export const SCALING_LIMIT = {

export const LOGIN_V3_CONFIG_PATH = '/zx/login/v3/config';
export const DARK_READER_PROP_KEY = 'zappDarkreaderMode';
export const SENTRY_SHELL_DSN = 'https://[email protected]/6';
export const SENTRY_FEEDBACK_DNS =
'https://[email protected]/8';
22 changes: 22 additions & 0 deletions src/i18next.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* SPDX-FileCopyrightText: 2023 Zextras <https://www.zextras.com>
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
// import the original type declarations
import * as i18next from 'i18next';
// import all namespaces (for the default language, only)
import en from '../translations/en.json';

declare module 'i18next' {
// Extend CustomTypeOptions
interface CustomTypeOptions {
// custom resources type
resources: {
[defaultNs: i18next.TypeOptions['defaultNS']]: typeof en;
};
returnNull: false;
jsonFormat: 'v3';
allowObjectInHTMLChildren: true;
}
}
2 changes: 1 addition & 1 deletion src/reporting/feedback.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import React, {
useReducer,
useState
} from 'react';
import { TFunction } from 'react-i18next';
import type { TFunction } from 'i18next';
import styled, { DefaultTheme } from 'styled-components';
import { useUserAccount } from '../store/account';
import { useAppList } from '../store/app';
Expand Down
12 changes: 6 additions & 6 deletions src/reporting/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* SPDX-License-Identifier: AGPL-3.0-only
*/

import create, { StoreApi, UseBoundStore } from 'zustand';
import { create } from 'zustand';
import {
BrowserClient,
defaultIntegrations,
Expand All @@ -14,21 +14,21 @@ import {
} from '@sentry/browser';
import { reduce } from 'lodash';
import type { CarbonioModule } from '../../types';
import { SHELL_APP_ID } from '../constants';
import { SENTRY_FEEDBACK_DNS, SENTRY_SHELL_DSN, SHELL_APP_ID } from '../constants';

type ReporterState = {
clients: Record<string, Hub>;
setClients: (apps: Array<CarbonioModule>) => void;
};

export const useReporter = create<ReporterState>((set) => ({
export const useReporter = create<ReporterState>()((set) => ({
clients: {
[SHELL_APP_ID]: new Hub(
new BrowserClient({
transport: makeFetchTransport,
stackParser: defaultStackParser,
integrations: defaultIntegrations,
dsn: 'https://[email protected]/6',
dsn: SENTRY_SHELL_DSN,
release: '0',
maxValueLength: 500
})
Expand All @@ -38,7 +38,7 @@ export const useReporter = create<ReporterState>((set) => ({
transport: makeFetchTransport,
stackParser: defaultStackParser,
integrations: defaultIntegrations,
dsn: 'https://[email protected]/8',
dsn: SENTRY_FEEDBACK_DNS,
release: '0',
maxValueLength: 500
})
Expand Down Expand Up @@ -68,4 +68,4 @@ export const useReporter = create<ReporterState>((set) => ({
)
}));
}
})) as UseBoundStore<ReporterState, StoreApi<ReporterState>>;
}));
7 changes: 4 additions & 3 deletions src/search/search-store.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
*/

import { isFunction } from 'lodash';
import create from 'zustand';
import { QueryChip, SearchState } from '../../types';
import { create } from 'zustand';
import type { QueryChip, SearchState } from '../../types';

export const useSearchStore = create<SearchState>((set, get) => ({
// extra currying as suggested in https://github.com/pmndrs/zustand/blob/main/docs/guides/typescript.md#basic-usage
export const useSearchStore = create<SearchState>()((set, get) => ({
query: [],
searchDisabled: false,
tooltip: undefined,
Expand Down
13 changes: 9 additions & 4 deletions src/settings/accounts-settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import React, { useCallback, useMemo, useState, useEffect, ReactElement } from 'react';
import { Container, useSnackbar } from '@zextras/carbonio-design-system';
import { TFunction } from 'react-i18next';
import type { TFunction } from 'i18next';
import {
map,
includes,
Expand All @@ -19,14 +19,19 @@ import {
uniq,
isArray
} from 'lodash';
import { useUserSettings } from '../store/account/hooks';
import { useUserSettings } from '../store/account';
import { editSettings } from '../network/edit-settings';
import { SHELL_APP_ID } from '../constants';
import { Mods, IdentityProps, CreateIdentityProps, Account, AccountSettings } from '../../types';
import type {
Mods,
IdentityProps,
CreateIdentityProps,
Account,
AccountSettings
} from '../../types';
import AccountsList from './components/account-settings/accounts-list';
import PrimaryAccountSettings from './components/account-settings/primary-account-settings';
import SettingsSentMessages from './components/account-settings/settings-sent-messages';
import PasswordRecoverySettings from './components/account-settings/password-recovery-settings';
import Delegates, { DelegateType } from './components/account-settings/delegates';
import PersonaSettings from './components/account-settings/persona-settings';
import PersonaUseSection from './components/account-settings/persona-use-section';
Expand Down
4 changes: 2 additions & 2 deletions src/settings/components/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
*/

import moment from 'moment';
import { TFunction } from 'react-i18next';
import { AccountSettings } from '../../../types';
import type { TFunction } from 'i18next';
import type { AccountSettings } from '../../../types';
import { BASE_FONT_SIZE, SCALING_LIMIT, SCALING_OPTIONS } from '../../constants';

export const ItemsSendAutoReplies = (t: TFunction): any => [
Expand Down
4 changes: 2 additions & 2 deletions src/settings/general-settings-sub-sections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
import { TFunction } from 'react-i18next';
import { SettingsSubSection } from '../../types';
import type { TFunction } from 'i18next';
import type { SettingsSubSection } from '../../types';

export const appearanceSubSection = (t: TFunction): SettingsSubSection => ({
label: t('settings.general.appearance', 'Appearance'),
Expand Down
7 changes: 4 additions & 3 deletions src/store/account/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
* SPDX-License-Identifier: AGPL-3.0-only
*/

import create from 'zustand';
import { AccountState } from '../../../types';
import { create } from 'zustand';
import type { AccountState } from '../../../types';

export const useAccountStore = create<AccountState>(() => ({
// extra currying as suggested in https://github.com/pmndrs/zustand/blob/main/docs/guides/typescript.md#basic-usage
export const useAccountStore = create<AccountState>()(() => ({
authenticated: false,
account: undefined,
version: '',
Expand Down
8 changes: 5 additions & 3 deletions src/store/app/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

import produce from 'immer';
import { filter, find, findIndex, merge, omit, reduce, sortBy, unionBy, unionWith } from 'lodash';
import create from 'zustand';
import {
import { create } from 'zustand';
import type {
AppRouteDescriptor,
AppState,
AppView,
Expand All @@ -29,7 +29,9 @@ const filterById = <T extends { id: string }>(items: Array<T>, id: string): Arra
filter(items, (item) => item.id !== id);

const STANDALONE_RESPONSE = 'standalone';
export const useAppStore = create<AppState>((set, get) => ({

// extra currying as suggested in https://github.com/pmndrs/zustand/blob/main/docs/guides/typescript.md#basic-usage
export const useAppStore = create<AppState>()((set, get) => ({
standalone: false,
apps: {},
appContexts: {},
Expand Down
13 changes: 7 additions & 6 deletions src/store/boards/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,20 @@

import produce from 'immer';
import { forEach, trimStart, uniqueId } from 'lodash';
import create from 'zustand';
import { BoardState, Board } from '../../../types';
import { create } from 'zustand';
import type { BoardState, Board } from '../../../types';
import { getApp } from '../app';

export const useBoardStore = create<BoardState>(() => ({
// extra currying as suggested in https://github.com/pmndrs/zustand/blob/main/docs/guides/typescript.md#basic-usage
export const useBoardStore = create<BoardState>()(() => ({
boards: {},
expanded: false,
minimized: false
}));

export const addBoard =
(app: string) =>
<T = any>(
<T = unknown>(
board: Omit<Board<T>, 'app' | 'icon' | 'id'> & { id?: string; icon?: string },
expanded?: BoardState['expanded']
): Board => {
Expand Down Expand Up @@ -100,7 +101,7 @@ export const setCurrentBoard = (id: string): void => {
current: id
});
};
export const updateBoard = <T = any>(id: string, board: Partial<Board<T>>): void => {
export const updateBoard = <T = unknown>(id: string, board: Partial<Board<T>>): void => {
useBoardStore.setState(
produce((s: BoardState) => {
if (s.boards[id])
Expand All @@ -112,7 +113,7 @@ export const updateBoard = <T = any>(id: string, board: Partial<Board<T>>): void
})
);
};
export const updateBoardContext = <T = any>(id: string, context: T): void => {
export const updateBoardContext = <T = unknown>(id: string, context: T): void => {
useBoardStore.setState(
produce((s: BoardState) => {
if (s.boards[id])
Expand Down
8 changes: 4 additions & 4 deletions src/store/context-bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
* SPDX-License-Identifier: AGPL-3.0-only
*/

/* eslint-disable @typescript-eslint/ban-types */
import create from 'zustand';
import { create } from 'zustand';
import { reduce } from 'lodash';
import { useEffect } from 'react';
import { ContextBridgeState } from '../../types';
import type { ContextBridgeState } from '../../types';

export const useContextBridge = create<ContextBridgeState>((set) => ({
// extra currying as suggested in https://github.com/pmndrs/zustand/blob/main/docs/guides/typescript.md#basic-usage
export const useContextBridge = create<ContextBridgeState>()((set) => ({
packageDependentFunctions: {},
functions: {},
add: ({ packageDependentFunctions, functions }): void => {
Expand Down
Loading

0 comments on commit a7554b5

Please sign in to comment.