Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/actions/npm_install_from_cache/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ runs:
using: composite
steps:
- name: Install npm packages
run: npm ci
# Using --legacy-peer-deps to bypass npm peer dependency checks
# This is needed due to some dependency conflicts after Node.js 20.x upgrade
# TODO: Consider auditing and resolving these conflicts to remove this flag in the future
run: npm ci --legacy-peer-deps
shell: bash
- name: Bootstrap
run: npm run bootstrap:ci
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/setup_node/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: 'Set up Node.js'
runs:
using: composite
steps:
- name: Use Node.js 18.x
- name: Use Node.js 20.x
uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8
with:
node-version: 18.x
node-version: 20.x
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This repository contains the various platforms of the Deriv application.

![Prerequisite](https://img.shields.io/badge/node-18.x-blue.svg) ![Prerequisite](https://img.shields.io/badge/npm-9.x-blue.svg)
![Prerequisite](https://img.shields.io/badge/node-20.x-blue.svg) ![Prerequisite](https://img.shields.io/badge/npm-10.x-blue.svg)
[![lerna](https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg)](https://lerna.js.org/)
![Sonar Tech Debt](https://img.shields.io/sonar/tech_debt/binary-com_deriv-app?server=https%3A%2F%2Fsonarcloud.io)
![Sonar Violations (short format)](https://img.shields.io/sonar/violations/binary-com_deriv-app?server=https%3A%2F%2Fsonarcloud.io)
Expand Down
5,153 changes: 1,331 additions & 3,822 deletions package-lock.json

Large diffs are not rendered by default.

38 changes: 30 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,27 @@
"packages/*"
],
"engines": {
"node": "18.x"
"node": "20.x"
},
"overrides": {
"eslint": "^8.57.1",
"react-dom": "^17.0.2",
"nth-check": "2.0.1",
"sha.js": "^2.4.12"
"sha.js": "^2.4.12",
"@babel/runtime": "^7.26.10",
"@babel/helpers": "^7.26.10",
"@octokit/plugin-paginate-rest": "^11.4.1",
"@octokit/request": "^9.2.1",
"@octokit/request-error": "^6.1.7",
"@octokit/endpoint": "^10.1.3",
"axios": "^1.8.2",
"braces": "^3.0.3",
"webpack-dev-middleware": "^5.3.4",
"webpack-dev-server": "^5.2.1",
"brace-expansion": "^2.0.2",
"http-proxy-middleware": "^2.0.8",
"esbuild": "^0.25.0",
"tmp": "^0.2.4",
"on-headers": "^1.1.0"
},
"devDependencies": {
"@babel/core": "^7.25.2",
Expand Down Expand Up @@ -48,6 +62,12 @@
"@types/react-router-dom": "^5.1.6",
"@types/react-virtualized": "^9.21.21",
"dotenv-webpack": "^8.0.1",
"eslint": "^8.57.1",
"eslint-import-resolver-typescript": "^4.4.4",
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-jest": "^29.0.1",
"eslint-plugin-jest-dom": "^5.5.0",
"eslint-plugin-testing-library": "^7.6.6",
"husky": "^7.0.0",
"jest": "^29.7.0",
"jest-chain": "^1.1.6",
Expand All @@ -56,7 +76,7 @@
"lerna": "^8.1.8",
"lint-staged": "^11.2.6",
"nx": "19.8.4",
"postcss": "^8.4.24",
"postcss": "^8.4.31",
"prettier": "^3.0.0",
"storybook": "^8.3.5",
"stylelint": "^13.13.1",
Expand All @@ -76,9 +96,9 @@
"test:eslint-all": "nx run-many --target=test:eslint",
"test:eslint-one": "f () { nx test @deriv/$1 --target=test:eslint ;}; f",
"test:eslint-since": "f () { nx affected --target=eslint ;}; f",
"bootstrap:ci": "npm ci --strict-peer-deps --verbose",
"bootstrap": "npm ci --strict-peer-deps --verbose",
"bootstrap:dev": "npm install --strict-peer-deps --verbose",
"bootstrap:ci": "npm ci --legacy-peer-deps --verbose",
"bootstrap": "npm ci --legacy-peer-deps --verbose",
"bootstrap:dev": "npm install --legacy-peer-deps --verbose",
"build:publish": "npm run build:publish --workspace=@deriv/* --",
"build:local": "f () { nx run-many --target=build --projects=@deriv/bot-web-ui,@deriv/trader --parallel=2 ;}; f",
"build:travis": "nx run-many --projects=@deriv/shared,@deriv/components,@deriv/translations,@deriv/cashier,@deriv/account,@deriv/cfd,@deriv/reports --target=build:travis",
Expand Down Expand Up @@ -114,8 +134,10 @@
"babel-jest": "^29.7.0",
"dotenv": "^8.2.0",
"form-data": "^4.0.4",
"mobx-react": "^9.2.0",
"nth-check": "2.0.1",
"pbkdf2": "^3.1.3",
"qrcode": "^1.5.4",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-svg-core": "3.0.3",
Expand All @@ -125,4 +147,4 @@
"optionalDependencies": {
"fsevents": "^2.3.2"
}
}
}
2 changes: 1 addition & 1 deletion packages/account/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"url": "https://github.com/deriv-com/deriv-app/issues"
},
"engines": {
"node": "18.x"
"node": "20.x"
},
"scripts": {
"analyze:stats": "f () { NODE_OPTIONS='-r ts-node/register' webpack --progress --config \"./build/webpack.config.js\" --env base=$1 --profile --json=stats.json;}; f",
Expand Down
2 changes: 1 addition & 1 deletion packages/appstore/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "dist/appstore/js/index.js",
"private": true,
"engines": {
"node": "18.x"
"node": "20.x"
},
"scripts": {
"analyze:stats": "NODE_OPTIONS='-r ts-node/register' webpack --progress --profile --json=stats.json",
Expand Down
2 changes: 1 addition & 1 deletion packages/bot-web-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
]
},
"engines": {
"node": "18.x"
"node": "20.x"
},
"scripts": {
"analyze:stats": "f () { npm run build:skeleton && NODE_OPTIONS='-r ts-node/register' webpack --progress --env base=$1 --profile --json=stats.json;}; f",
Expand Down
2 changes: 1 addition & 1 deletion packages/cashier/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"test": "__tests__"
},
"engines": {
"node": "18.x"
"node": "20.x"
},
"files": [
"lib"
Expand Down
2 changes: 1 addition & 1 deletion packages/cfd/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"deploy:production": "echo \"No deploy:production specified\""
},
"engines": {
"node": "18.x"
"node": "20.x"
},
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "src/index.ts",
"private": true,
"engines": {
"node": "18.x"
"node": "20.x"
},
"scripts": {
"start": "rimraf lib && npm run test && npm run serve",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"url": "https://github.com/deriv-com/deriv-app/issues"
},
"engines": {
"node": "18.x"
"node": "20.x"
},
"homepage": "https://github.com/deriv-com/deriv-app",
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/indicators/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"url": "git+https://github.com/deriv-com/deriv-app.git"
},
"engines": {
"node": "18.x"
"node": "20.x"
},
"scripts": {
"start": "echo \"No start specified\"",
Expand Down
2 changes: 1 addition & 1 deletion packages/publisher/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"access": "public"
},
"engines": {
"node": "18.x"
"node": "20.x"
},
"scripts": {
"start": "echo \"No start specified\"",
Expand Down
2 changes: 1 addition & 1 deletion packages/reports/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"deploy:production": "echo \"No deploy:production specified\""
},
"engines": {
"node": "18.x"
"node": "20.x"
},
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"url": "git+https://github.com/deriv-com/deriv-app.git"
},
"engines": {
"node": "18.x"
"node": "20.x"
},
"scripts": {
"start": "echo \"No start specified\"",
Expand Down
2 changes: 1 addition & 1 deletion packages/trader/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"deploy:production": "echo \"No deploy:production specified\""
},
"engines": {
"node": "18.x"
"node": "20.x"
},
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/translations/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"url": "git+https://github.com/deriv-com/deriv-app.git"
},
"engines": {
"node": "18.x"
"node": "20.x"
},
"scripts": {
"build": "echo \"No build specified\"",
Expand Down
2 changes: 1 addition & 1 deletion packages/wallets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "1.0.0",
"main": "dist/wallets/js/index.js",
"engines": {
"node": "18.x"
"node": "20.x"
},
"scripts": {
"analyze:stats": "NODE_OPTIONS='-r ts-node/register' webpack --progress --config \"./webpack.config.js\" --profile --json=stats.json",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ describe('AccountsList', () => {
wrapper,
});
expect(screen.getByText('CFDs')).toBeInTheDocument();
expect(screen.getAllByText('Options')[0]).toBeInTheDocument();

screen.getAllByText('Options')[0].click();
const optionsTab = screen.getByRole('tab', { name: 'Options' });
expect(optionsTab).toBeInTheDocument();
optionsTab.click();
rerender(<AccountsList accountsActiveTabIndex={1} onTabClickHandler={jest.fn()} />);
expect(screen.getAllByText('Options')[0]).toBeInTheDocument();
expect(screen.getByRole('tab', { name: 'Options' })).toBeInTheDocument();
expect(screen.getByText('Deriv Trader')).toBeInTheDocument();
expect(screen.getByText('Deriv Bot')).toBeInTheDocument();
expect(screen.getByText('SmartTrader')).toBeInTheDocument();
Expand Down Expand Up @@ -124,7 +124,8 @@ describe('AccountsList', () => {
wrapper,
});

screen.getAllByText('Options')[0].click();
const optionsTab = screen.getByRole('tab', { name: 'Options' });
optionsTab.click();
expect(onTabClickHandler).toHaveBeenCalledWith(1);
});

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React from 'react';
import { APIProvider } from '@deriv/api-v2';
import { render, screen, within } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import WalletsAuthProvider from '../../../../AuthProvider';
import { ModalProvider } from '../../../ModalProvider';
import ModalStepWrapper from '../ModalStepWrapper';
import { APIProvider } from '@deriv/api-v2';
import WalletsAuthProvider from '../../../../AuthProvider';

const mockhideFn = jest.fn();
jest.mock('../../../ModalProvider', () => ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
renderComponent();

await waitFor(() => {
expect(screen.queryByRole('button')).toBeInTheDocument();
expect(screen.queryByTestId('dt_legacy_copy_icon')).toBeInTheDocument();
expect(screen.getByRole('button')).toBeInTheDocument();
expect(screen.getByTestId('dt_legacy_copy_icon')).toBeInTheDocument();

Check warning on line 42 in packages/wallets/src/components/Base/WalletClipboard/__tests__/WalletClipboard.spec.tsx

View workflow job for this annotation

GitHub Actions / Build And Test

Avoid using multiple assertions within `waitFor` callback
});
});
it('clears timeout on unmount', async () => {
Expand All @@ -58,7 +58,7 @@
await userEvent.hover(screen.getByRole('button'));

await waitFor(() => {
expect(screen.queryByText('Copy')).toBeInTheDocument();
expect(screen.getByText('Copy')).toBeInTheDocument();
});
});
});
Expand All @@ -77,7 +77,7 @@
await renderScenario();

await waitFor(() => {
expect(screen.queryByTestId('dt_legacy_won_icon')).toBeInTheDocument();
expect(screen.getByTestId('dt_legacy_won_icon')).toBeInTheDocument();
});
});
it('calls copy function with textCopy', async () => {
Expand All @@ -89,16 +89,16 @@
await renderScenario();

await waitFor(() => {
expect(screen.queryByText('Copied!')).toBeInTheDocument();
expect(screen.getByText('Copied!')).toBeInTheDocument();
});
});
it('resets the icon and message after 2 seconds', async () => {
jest.useFakeTimers({ legacyFakeTimers: true });
await renderScenario();

await waitFor(() => {
expect(screen.queryByText('Copied!')).toBeInTheDocument();
expect(screen.queryByTestId('dt_legacy_won_icon')).toBeInTheDocument();
expect(screen.getByText('Copied!')).toBeInTheDocument();
expect(screen.getByTestId('dt_legacy_won_icon')).toBeInTheDocument();

Check warning on line 101 in packages/wallets/src/components/Base/WalletClipboard/__tests__/WalletClipboard.spec.tsx

View workflow job for this annotation

GitHub Actions / Build And Test

Avoid using multiple assertions within `waitFor` callback
});

act(() => {
Expand All @@ -107,7 +107,7 @@

await waitFor(() => {
expect(screen.queryByText('Copied!')).not.toBeInTheDocument();
expect(screen.queryByTestId('dt_legacy_copy_icon')).toBeInTheDocument();
expect(screen.getByTestId('dt_legacy_copy_icon')).toBeInTheDocument();

Check warning on line 110 in packages/wallets/src/components/Base/WalletClipboard/__tests__/WalletClipboard.spec.tsx

View workflow job for this annotation

GitHub Actions / Build And Test

Avoid using multiple assertions within `waitFor` callback
});
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@ import React from 'react';
import { useHistory } from 'react-router-dom';
import { useActiveWalletAccount, useGrowthbookGetFeatureValue } from '@deriv/api-v2';
import {
ACCOUNTS_OS_POA_URL,
ACCOUNTS_OS_POI_STATUS_URL,
ACCOUNTS_OS_POI_URL,
ACCOUNTS_OS_POA_URL,
getSocketURL,
isNavigationFromTradersHubOS,
} from '@deriv/shared';
import { useTranslations } from '@deriv-com/translations';
import { getToken } from '@deriv/utils';
import { useTranslations } from '@deriv-com/translations';
import { LocalStorageUtils, URLUtils, WebSocketUtils } from '@deriv-com/utils';
import { TModifiedMT5Account, TWalletsMFAccountStatus } from '../../../../types';
import { getClientVerification } from '../../../../utils';
import { ClientVerificationStatusBadge } from '../../../ClientVerificationBadge';
import { DocumentTile } from './components';
import './DocumentsList.scss';
import { LocalStorageUtils, URLUtils, WebSocketUtils } from '@deriv-com/utils';

type TDocumentsListProps = {
account: TModifiedMT5Account | TWalletsMFAccountStatus;
Expand Down
Loading
Loading