Skip to content

Commit

Permalink
RK-20379 - [DOB-490]-fix-vulnerabilities (#375)
Browse files Browse the repository at this point in the history
* add webpack5

* workable version

* fix express

* change version

* remove garbage

* clean garbage again

* clean up

* Update node image

* Added node types and skipLibCheck

---------

Co-authored-by: Ron Belkin <[email protected]>
  • Loading branch information
FridmasterDyna and ron-rookout authored Mar 31, 2024
1 parent 77cc19f commit 4039b82
Show file tree
Hide file tree
Showing 8 changed files with 8,607 additions and 13,263 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:16.17.1-alpine3.15 as build
FROM node:18.18.0-alpine as build

ENV env=development
WORKDIR /build
Expand All @@ -12,7 +12,7 @@ COPY . .

RUN yarn run build-headless

FROM node:16.17.1-alpine3.15 as release
FROM node:18.18.0-alpine as release

WORKDIR /app
COPY --from=build /build/dist /app/dist
Expand Down
17 changes: 9 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "explorook",
"version": "1.15.11",
"version": "1.15.12",
"description": "Rookout's site addon to support local files and folders",
"main": "dist/index.js",
"scripts": {
Expand Down Expand Up @@ -93,6 +93,7 @@
"@types/aws-lambda": "^8.10.17",
"@types/body-parser": "^1.17.0",
"@types/lodash": "^4.14.182",
"@types/node": "^20.12.2",
"@types/node-fetch": "^2.6.1",
"@types/semver": "^7.5.3",
"@types/url-assembler": "^2.1.2",
Expand All @@ -103,29 +104,29 @@
"electron-builder": "24.7.0",
"graphql-middleware": "6.1.28",
"node-fetch": "^2.6.7",
"ts-loader": "^6.0.4",
"ts-loader": "^9.5.1",
"tslint": "^5.10.0",
"typescript": "^3.5.3",
"webpack": "4.44.2",
"typescript": "^5.4.3",
"webpack": "^5.91.0",
"webpack-bugsnag-plugins": "^1.4.3",
"webpack-cli": "^3.3.6",
"webpack-cli": "^5.1.4",
"webpack-node-externals": "^1.7.2"
},
"dependencies": {
"@bugsnag/js": "6.5.2",
"@electron/notarize": "^2.1.0",
"@electron/remote": "2.0.9",
"@graphql-tools/schema": "^8.3.13",
"analytics-node": "^6.0.0",
"apollo-server-express": "^3.9.0",
"@segment/analytics-node": "^2.1.0",
"apollo-server-express": "3.13.0",
"args-parser": "^1.1.0",
"auto-launch": "^5.0.5",
"body-parser": "1.19.2",
"cors": "^2.8.5",
"electron-log": "4.4.7",
"electron-store": "8.0.1",
"electron-updater": "6.1.5",
"express": "4.17.3",
"express": "4.19.2",
"graphql": "^15.4.0",
"isomorphic-git": "^1.8.2",
"lodash": "^4.17.21",
Expand Down
15 changes: 8 additions & 7 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
enable as remoteEnable,
initialize as initElectronRemote
} from "@electron/remote/main";
import Analytics = require("analytics-node");
import Analytics from "@segment/analytics-node";
import {
app,
BrowserWindow,
Expand Down Expand Up @@ -168,7 +168,7 @@ function registerIpc() {
});
}

function track(eventName: string, props: any = null, callback: () => void = null) {
function track(eventName: string, props: any = null, callback: (() => void) | null = null): void {
if (!analytics) {
return;
}
Expand All @@ -179,11 +179,12 @@ function track(eventName: string, props: any = null, callback: () => void = null
}, callback);
}

function flushAnalytics(callback: () => void) {
async function flushAnalytics(callback: () => void) {
if (!analytics) {
return;
}
analytics.flush(callback);
await analytics.closeAndFlush();
callback();
}

function identifyAnalytics() {
Expand All @@ -195,14 +196,14 @@ function identifyAnalytics() {
}

function initAnalytics() {
analytics = new Analytics("isfxG3NQsq3qDoNPZPvhIVlmYVGDOLdH");
analytics = new Analytics({ writeKey: "isfxG3NQsq3qDoNPZPvhIVlmYVGDOLdH"});
identifyAnalytics();
track("startup");
}

async function quitApplication() {
track("quit-application");
flushAnalytics(() => app.quit());
await flushAnalytics(() => app.quit());
// This timeout is here in case the callback is not called or takes too long
setTimeout(() => app.quit(), 3000);
}
Expand Down Expand Up @@ -485,4 +486,4 @@ app.on("quit", async () => {
notify(error);
}
}
});
});
8 changes: 4 additions & 4 deletions src/webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"homepage": "./",
"dependencies": {
"@bugsnag/js": "6.5.2",
"@craco/craco": "^6.0.0",
"@craco/craco": "^7.1.0",
"@material-ui/core": "^4.0.0",
"isomorphic-git": "^1.8.2",
"react": "16.10.2",
Expand All @@ -14,7 +14,7 @@
},
"devDependencies": {
"cross-env": "^7.0.3",
"react-scripts": "^4.0.3"
"react-scripts": "^5.0.1"
},
"resolutions": {
"**/set-value": "^3.0.1",
Expand All @@ -25,8 +25,8 @@
"start": "cross-env NODE_OPTIONS=--openssl-legacy-provider craco start",
"build": "cross-env NODE_OPTIONS=--openssl-legacy-provider craco build",
"postbuild": "mkdir -p ../../dist/webapp && cp -r build/* ../../dist/webapp",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
"test": "craco test --env=jsdom",
"eject": "craco eject"
},
"browserslist": [
">0.2%",
Expand Down
Loading

0 comments on commit 4039b82

Please sign in to comment.