Skip to content
This repository has been archived by the owner on Aug 2, 2023. It is now read-only.

Commit

Permalink
Update to remove npm audit vulnerabilities (#1190)
Browse files Browse the repository at this point in the history
* Update to remove npm audit vulnerabilities

* fix build

* harden versions

* review feedback

* Adding python the the PATH for node install

* debugging PATH variable - not to merge

* Docker file updates to install g++ make and python (required for node modules access)

* shebang update

* upgrade additional packages

* update ag-grid-community
  • Loading branch information
mechaffin committed Dec 5, 2018
1 parent ada2a0e commit 9fcc201
Show file tree
Hide file tree
Showing 149 changed files with 15,621 additions and 8,233 deletions.
1 change: 0 additions & 1 deletion README.md
Expand Up @@ -44,7 +44,6 @@ Build, run and test locally
* `npm start`: Launches the project in browser - watches for code changes and refreshes the page.
* `npm run build`: Creates a production ready build.
* `npm test`: Runs test in watch mode, press `q` to quit
* `npm flow`: Runs Flow type checker. Learn more about Flow [here](https://flow.org/).

Project Structure
===========================
Expand Down
23,372 changes: 15,375 additions & 7,997 deletions package-lock.json

Large diffs are not rendered by default.

75 changes: 37 additions & 38 deletions package.json
Expand Up @@ -3,50 +3,49 @@
"license": "MIT",
"private": true,
"dependencies": {
"adal-angular": "1.0.15",
"ag-grid": "17.1.1",
"ag-grid-react": "17.1.0",
"adal-angular": "1.0.17",
"ag-grid-community": "19.1.4",
"ag-grid-react": "19.1.2",
"dot-object": "1.7.0",
"i18next": "10.3.0",
"i18next-browser-languagedetector": "2.1.0",
"i18next": "12.1.0",
"i18next-browser-languagedetector": "2.2.4",
"i18next-xhr-backend": "1.5.1",
"immutability-helper": "2.5.1",
"moment": "2.22.1",
"normalizr": "3.2.4",
"query-string": "5.1.0",
"react": "16.0.0",
"react-dom": "16.0.0",
"immutability-helper": "2.8.1",
"moment": "2.22.2",
"node-sass": "4.11.0",
"normalizr": "3.3.0",
"prop-types": "15.6.2",
"query-string": "6.2.0",
"react": "16.6.3",
"react-dom": "16.6.3",
"react-dom-factories": "1.0.2",
"react-i18next": "7.3.1",
"react-redux": "5.0.6",
"react-router-dom": "4.2.2",
"react-scripts": "1.0.17",
"react-select": "1.0.0-rc.10",
"react-svg": "2.1.22",
"redux": "3.7.2",
"redux-devtools-extension": "2.13.5",
"redux-observable": "0.17.0",
"reselect": "3.0.1",
"rxjs": "5.5.2",
"tsiclient": "1.1.19"
"react-i18next": "8.3.8",
"react-redux": "5.1.1",
"react-router-dom": "4.3.1",
"react-scripts": "2.1.1",
"react-select": "1.3.0",
"react-svg": "2.2.18",
"redux": "4.0.1",
"redux-devtools-extension": "2.13.7",
"redux-observable": "0.19.0",
"reselect": "4.0.0",
"rxjs": "5.5.12",
"tsiclient": "1.2.20"
},
"devDependencies": {
"enzyme": "3.2.0",
"enzyme-adapter-react-16": "1.1.0",
"flow-bin": "0.48.0",
"mocha-steps": "1.1.0",
"node-fetch": "1.7.1",
"node-sass-chokidar": "0.0.3",
"npm-run-all": "4.0.2",
"rxjs-marbles": "2.3.1"
"enzyme": "3.7.0",
"enzyme-adapter-react-16": "1.7.0"
},
"scripts": {
"build-css": "node-sass-chokidar --include-path ./src --include-path ./node_modules src/ -o src/",
"watch-css": "npm run build-css && node-sass-chokidar --include-path ./src --include-path ./node_modules src/ -o src/ --watch --recursive",
"start-js": "react-scripts start",
"start": "npm-run-all -p watch-css start-js",
"build": "npm run build-css && react-scripts build",
"test": "react-scripts test --env=jsdom",
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
}
},
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
]
}
3 changes: 2 additions & 1 deletion scripts/build
@@ -1,4 +1,5 @@
#!/usr/bin/env bash -e
#!/usr/bin/env bash
set -e

APP_HOME="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && cd .. && pwd )/"
source "$APP_HOME/scripts/.functions.sh"
Expand Down
4 changes: 3 additions & 1 deletion scripts/docker/Dockerfile
Expand Up @@ -3,7 +3,9 @@
FROM node:9.2.0-alpine as codebuilder
COPY ./ /app/
WORKDIR /app
RUN echo "Installing node packages ..." && npm install
RUN echo "Installing python2 (reqd for node pckgs)" && apk --update add python
RUN echo "Install GCC for make command" && apk add --no-cache --virtual build-base
RUN echo "Installing node packages ..." && npm --add-python-to-path='true' install
RUN echo "Building app..." && export CI=true && npm run build
RUN echo "Removing temp files..." && rm -rf node_modules src public package.json Dockerfile .dockerignore

Expand Down
4 changes: 2 additions & 2 deletions src/components/app.container.js
Expand Up @@ -2,7 +2,7 @@

import { withRouter } from 'react-router-dom';
import { connect } from 'react-redux';
import { translate } from 'react-i18next';
import { withNamespaces } from 'react-i18next';
import {
epics as appEpics,
getTheme,
Expand All @@ -20,4 +20,4 @@ const mapDispatchToProps = dispatch => ({
registerRouteEvent: pathname => dispatch(appEpics.actions.detectRouteChange(pathname))
});

export const AppContainer = withRouter(translate()(connect(mapStateToProps, mapDispatchToProps)(App)));
export const AppContainer = withRouter(withNamespaces()(connect(mapStateToProps, mapDispatchToProps)(App)));
4 changes: 2 additions & 2 deletions src/components/pages/dashboard/dashboard.container.js
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft. All rights reserved.

import { connect } from 'react-redux';
import { translate } from 'react-i18next';
import { withNamespaces } from 'react-i18next';
import {
redux as appRedux,
getActiveDeviceGroup,
Expand Down Expand Up @@ -55,4 +55,4 @@ const mapDispatchToProps = dispatch => ({
updateCurrentWindow: (currentWindow) => dispatch(appRedux.actions.updateCurrentWindow(currentWindow))
});

export const DashboardContainer = translate()(connect(mapStateToProps, mapDispatchToProps)(Dashboard));
export const DashboardContainer = withNamespaces()(connect(mapStateToProps, mapDispatchToProps)(Dashboard));
2 changes: 1 addition & 1 deletion src/components/pages/dashboard/dashboard.js
Expand Up @@ -32,7 +32,7 @@ import {
RefreshBar
} from 'components/shared';

import './dashboard.css';
import './dashboard.scss';

const initialState = {
// Telemetry data
Expand Down
2 changes: 1 addition & 1 deletion src/components/pages/dashboard/grid/cell.js
Expand Up @@ -4,7 +4,7 @@ import React from 'react';

import { joinClasses } from 'utilities';

import './grid.css';
import './grid.scss';

export const Cell = ({ className, children }) => (
<div className={joinClasses('grid-cell', className)}>
Expand Down
2 changes: 1 addition & 1 deletion src/components/pages/dashboard/grid/grid.js
Expand Up @@ -2,7 +2,7 @@

import React from 'react';

import './grid.css';
import './grid.scss';

export const Grid = ({ children }) => (
<div className="grid-container">
Expand Down
2 changes: 1 addition & 1 deletion src/components/pages/dashboard/panel/panel.js
Expand Up @@ -4,7 +4,7 @@ import React from 'react';

import { joinClasses } from 'utilities';

import './panel.css';
import './panel.scss';

export const Panel = ({ className, children }) => (
<div className={joinClasses('panel-container', className)}>
Expand Down
Expand Up @@ -9,7 +9,7 @@ import {
PanelContent,
} from 'components/pages/dashboard/panel';

import './examplePanel.css';
import './examplePanel.scss';

export class ExamplePanel extends Component {
constructor(props) {
Expand Down
Expand Up @@ -41,7 +41,7 @@ export class AlertsPanel extends Component {
columnDefs: translateColumnDefs(t, this.columnDefs),
rowData: alerts,
suppressFlyouts: true,
domLayout: 'autoHeight',
gridAutoHeight: true,
deltaRowDataMode: false,
t
};
Expand Down
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft. All rights reserved.

import { connect } from 'react-redux';
import { translate } from 'react-i18next';
import { withNamespaces } from 'react-i18next';
import { AnalyticsPanel } from './analyticsPanel';
import { getEntities as getRuleEntities } from 'store/reducers/rulesReducer';
import { getEntities as getDeviceEntities } from 'store/reducers/devicesReducer';
Expand All @@ -12,4 +12,4 @@ const mapStateToProps = state => ({
devices: getDeviceEntities(state)
});

export const AnalyticsPanelContainer = translate()(connect(mapStateToProps, null)(AnalyticsPanel));
export const AnalyticsPanelContainer = withNamespaces()(connect(mapStateToProps, null)(AnalyticsPanel));
Expand Up @@ -14,7 +14,7 @@ import {
PanelMsg
} from 'components/pages/dashboard/panel';

import './analyticsPanel.css';
import './analyticsPanel.scss';

const barChartId = 'analytics-bar-chart-container';
const pieChartId = 'analytics-pie-chart-container';
Expand Down
2 changes: 1 addition & 1 deletion src/components/pages/dashboard/panels/map/mapPanel.js
Expand Up @@ -16,7 +16,7 @@ import {
import { DeviceDetailsContainer } from 'components/pages/devices/flyouts/deviceDetails';
import { AzureMap } from './azureMap';

import './mapPanel.css';
import './mapPanel.scss';

const AzureMaps = window.atlas;
const nominalDeviceLayer = 'devices-nominal-layer';
Expand Down
Expand Up @@ -14,7 +14,7 @@ import {
PanelError
} from 'components/pages/dashboard/panel';

import './overviewPanel.css';
import './overviewPanel.scss';

export class OverviewPanel extends Component {
constructor(props) {
Expand Down
Expand Up @@ -7,7 +7,7 @@ import 'tsiclient';

import { joinClasses } from 'utilities';

import './telemetryChart.css';
import './telemetryChart.scss';

const maxDatums = 100; // Max telemetry messages for the telemetry graph

Expand Down
Expand Up @@ -16,7 +16,7 @@ import {

import { TelemetryChart } from './telemetryChart';

import './telemetryPanel.css';
import './telemetryPanel.scss';

export class TelemetryPanel extends Component {
render() {
Expand Down
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft. All rights reserved.

import { translate } from 'react-i18next';
import { withNamespaces } from 'react-i18next';
import { connect } from 'react-redux';
import { DeploymentDetails } from './deploymentDetails';
import {
Expand Down Expand Up @@ -43,4 +43,4 @@ const mapDispatchToProps = dispatch => ({
logEvent: diagnosticsModel => dispatch(appEpics.actions.logEvent(diagnosticsModel))
});

export const DeploymentDetailsContainer = translate()(connect(mapStateToProps, mapDispatchToProps)(DeploymentDetails));
export const DeploymentDetailsContainer = withNamespaces()(connect(mapStateToProps, mapDispatchToProps)(DeploymentDetails));
Expand Up @@ -28,7 +28,7 @@ import { getPackageTypeTranslation, getConfigTypeTranslation, svgs, renderUndefi
import { DeploymentDetailsGrid } from './deploymentDetailsGrid/deploymentDetailsGrid';
import Config from 'app.config';

import "./deploymentDetails.css";
import "./deploymentDetails.scss";

const closedModalState = {
openModalName: undefined
Expand Down
Expand Up @@ -49,5 +49,5 @@ export const defaultDeploymentDetailsGridProps = {
deltaRowDataMode: true,
enableSorting: true,
unSortIcon: true,
domLayout: 'autoHeight'
gridAutoHeight: true
};
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft. All rights reserved.

import { translate } from 'react-i18next';
import { withNamespaces } from 'react-i18next';
import { connect } from 'react-redux';
import { Deployments } from './deployments';
import {
Expand Down Expand Up @@ -30,4 +30,4 @@ const mapDispatchToProps = dispatch => ({
logEvent: diagnosticsModel => dispatch(appEpics.actions.logEvent(diagnosticsModel))
});

export const DeploymentsContainer = translate()(connect(mapStateToProps, mapDispatchToProps)(Deployments));
export const DeploymentsContainer = withNamespaces()(connect(mapStateToProps, mapDispatchToProps)(Deployments));
Expand Up @@ -20,7 +20,7 @@ import { DeploymentsGrid } from './deploymentsGrid';
import { DeploymentNewContainer } from './flyouts';
import { svgs } from 'utilities';

import './deployments.css';
import './deployments.scss';

const closedFlyoutState = { openFlyoutName: undefined };

Expand Down
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft. All rights reserved.

import { connect } from 'react-redux';
import { translate } from 'react-i18next';
import { withNamespaces } from 'react-i18next';
import { DeploymentNew } from './deploymentNew';
import {
getCreateDeploymentError,
Expand Down Expand Up @@ -61,4 +61,4 @@ const mapDispatchToProps = dispatch => ({
fetchConfigTypes: () => dispatch(packagesEpics.actions.fetchConfigTypes())
});

export const DeploymentNewContainer = translate()(connect(mapStateToProps, mapDispatchToProps)(DeploymentNew));
export const DeploymentNewContainer = withNamespaces()(connect(mapStateToProps, mapDispatchToProps)(DeploymentNew));
Expand Up @@ -43,7 +43,7 @@ import {
ThemedSvgContainer
} from 'components/shared';

import './deploymentNew.css';
import './deploymentNew.scss';

const isPositiveInteger = (str) => /^\+?(0|[1-9]\d*)$/.test(str) && str <= 2147483647;

Expand Down
4 changes: 2 additions & 2 deletions src/components/pages/devices/devices.container.js
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft. All rights reserved.

import { connect } from 'react-redux';
import { translate } from 'react-i18next';
import { withNamespaces } from 'react-i18next';
import { Devices } from './devices';
import {
epics as devicesEpics,
Expand Down Expand Up @@ -34,4 +34,4 @@ const mapDispatchToProps = dispatch => ({
logEvent: diagnosticsModel => dispatch(appEpics.actions.logEvent(diagnosticsModel))
});

export const DevicesContainer = translate()(connect(mapStateToProps, mapDispatchToProps)(Devices));
export const DevicesContainer = withNamespaces()(connect(mapStateToProps, mapDispatchToProps)(Devices));
2 changes: 1 addition & 1 deletion src/components/pages/devices/devices.js
Expand Up @@ -22,7 +22,7 @@ import { DeviceNewContainer } from './flyouts/deviceNew';
import { SIMManagementContainer } from './flyouts/SIMManagement';
import { svgs } from 'utilities';

import './devices.css';
import './devices.scss';

const closedFlyoutState = { openFlyoutName: undefined };

Expand Down
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft. All rights reserved.

import { translate } from 'react-i18next';
import { withNamespaces } from 'react-i18next';
import { SIMManagement } from './SIMManagement';

export const SIMManagementContainer = translate()(SIMManagement);
export const SIMManagementContainer = withNamespaces()(SIMManagement);
Expand Up @@ -17,7 +17,7 @@ import {

import Flyout from 'components/shared/flyout';

import './SIMManagement.css';
import './SIMManagement.scss';

const Section = Flyout.Section;

Expand Down
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft. All rights reserved.

import { connect } from 'react-redux';
import { translate } from 'react-i18next';
import { withNamespaces } from 'react-i18next';
import { DeviceDelete } from './deviceDelete';
import { redux as deviceRedux } from 'store/reducers/devicesReducer';

Expand All @@ -10,4 +10,4 @@ const mapDispatchToProps = dispatch => ({
deleteDevices: deviceIds => dispatch(deviceRedux.actions.deleteDevices(deviceIds))
});

export const DeviceDeleteContainer = translate()(connect(null, mapDispatchToProps)(DeviceDelete));
export const DeviceDeleteContainer = withNamespaces()(connect(null, mapDispatchToProps)(DeviceDelete));

0 comments on commit 9fcc201

Please sign in to comment.