Skip to content

Commit

Permalink
fix: 🔒 update packages and removed critical vulnerabilities
Browse files Browse the repository at this point in the history
  • Loading branch information
vinu-deriv committed Jul 8, 2024
1 parent 4b95ee0 commit 51fcc81
Show file tree
Hide file tree
Showing 8 changed files with 766 additions and 1,287 deletions.
6 changes: 3 additions & 3 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"presets": ["@babel/preset-env", "@babel/preset-react"],
"plugins": [
"transform-decorators-legacy",
"transform-class-properties",
"babel-plugin-syntax-dynamic-import",
["@babel/plugin-proposal-decorators", { "legacy": true }],
"@babel/plugin-transform-class-properties",
"@babel/plugin-syntax-dynamic-import",
[
"module-resolver",
{
Expand Down
6 changes: 3 additions & 3 deletions build/webpack/config_common.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ const commonConfig = (grunt) => ({
options: {
presets: ['@babel/preset-env', '@babel/preset-react'],
plugins: [
'transform-decorators-legacy',
'transform-class-properties',
'babel-plugin-syntax-dynamic-import',
['@babel/plugin-proposal-decorators', { 'legacy': true }],
'@babel/plugin-transform-class-properties',
'@babel/plugin-syntax-dynamic-import',
],
},
},
Expand Down
1,997 changes: 734 additions & 1,263 deletions package-lock.json

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@
"@babel/core": "7.24.0",
"@babel/eslint-parser": "7.23.10",
"@babel/parser": "7.1.2",
"@babel/preset-env": "^7.24.0",
"@babel/plugin-proposal-decorators": "^7.24.7",
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/plugin-transform-class-properties": "^7.24.7",
"@babel/plugin-transform-modules-commonjs": "^7.24.7",
"@babel/plugin-transform-react-jsx": "^7.24.7",
"@babel/preset-env": "^7.24.7",
"@babel/preset-react": "7.23.3",
"@babel/register": "7.23.7",
"@svgr/webpack": "^8.1.0",
Expand All @@ -32,13 +37,7 @@
"babel-loader": "9.1.3",
"babel-plugin-module-resolver": "5.0.0",
"babel-plugin-react-svg": "2.1.0",
"babel-plugin-syntax-dynamic-import": "6.18.0",
"babel-plugin-transform-class-properties": "6.24.1",
"babel-plugin-transform-decorators-legacy": "1.3.5",
"babel-plugin-transform-es2015-modules-commonjs": "6.26.2",
"babel-plugin-transform-react-jsx": "6.24.1",
"babel-plugin-transform-remove-strict-mode": "0.0.2",
"binary-live-api": "29.0.0",
"chai": "4.1.2",
"cli-color": "1.2.0",
"cli-spinner": "0.2.7",
Expand Down Expand Up @@ -86,7 +85,7 @@
"node-gettext": "3.0.0",
"postcss-scss": "4.0.9",
"react-render-html": "0.6.0",
"sass": "^1.62.1",
"sass": "^1.77.6",
"sitemap": "1.13.0",
"stylelint": "15.11.0",
"stylelint-formatter-pretty": "1.0.3",
Expand All @@ -97,13 +96,14 @@
"webpack": "5.81.0",
"webpack-bundle-analyzer": "4.3.0",
"webpack-merge": "4.1.4",
"ws": "8.16.0"
"ws": "8.18.0"
},
"dependencies": {
"@babel/polyfill": "7.12.1",
"@binary-com/binary-document-uploader": "^2.4.4",
"@binary-com/binary-style": "^0.2.26",
"@binary-com/webtrader-charts": "^0.6.1",
"@deriv/deriv-api": "^1.0.15",
"@livechat/customer-sdk": "4.0.2",
"canvas-toBlob": "1.0.0",
"classnames": "2.2.5",
Expand Down
4 changes: 2 additions & 2 deletions scripts/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
/* eslint-disable no-console */
require('@babel/register')({
plugins: [
'babel-plugin-transform-es2015-modules-commonjs',
'babel-plugin-transform-react-jsx',
'@babel/plugin-transform-modules-commonjs',
'@babel/plugin-transform-react-jsx',
],
extensions: ['.jsx'],
cache : true,
Expand Down
7 changes: 4 additions & 3 deletions src/javascript/_common/__tests__/tests_common.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
const { LiveApi } = require('binary-live-api');
const DerivAPIBasic = require('@deriv/deriv-api/dist/DerivAPIBasic');
const expect = require('chai').expect;
const jsdom = require('jsdom');
const websocket = require('ws');
const Client = require('../../app/base/client');
const Language = require('../language');
const Url = require('../url');
// ignore svgs in tests. @TODO once svg inliner or jsdom upgrades, check again to see if we can remove this
Expand All @@ -17,5 +16,7 @@ module.exports = {
expect,
setURL,
getApiToken: () => 'hhh9bfrbq0G3dRf',
api : new LiveApi({ websocket, appId: 1 }),
api: new DerivAPIBasic({
connection: new websocket('wss://ws.binaryws.com/websockets/v3?app_id=1&l=en&brand=binary'),
}),
};
4 changes: 3 additions & 1 deletion src/javascript/_common/base/__tests__/client_base.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,9 @@ describe('ClientBase', () => {
describe('.canTransferFunds()', () => {
before(function (done) {
this.timeout(5000);
api.getWebsiteStatus().then((response) => {
api.send({
website_status: 1,
}).then((response) => {
setCurrencies(response.website_status);
done();
});
Expand Down
11 changes: 8 additions & 3 deletions src/javascript/app/pages/user/account/__tests__/portfolio.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,14 @@ describe('Portfolio', () => {
this.timeout(10000);
// this is a read token, even if other people take it, won't be able to do any harm
api.authorize(getApiToken()).then(() => {
api.subscribeToBalance().then((response) => {
balance = response;
done();
api
.send({
balance: 1,
subscribe: 1,
})
.then((response) => {
balance = response;
done();
});
});
});
Expand Down

0 comments on commit 51fcc81

Please sign in to comment.