Skip to content

Commit a06691b

Browse files
committed
Fix security vulnerabilities.
1 parent 75dacd6 commit a06691b

21 files changed

+15153
-27640
lines changed

.eslintrc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
},
2828
"rules": {
2929
"@typescript-eslint/ban-types": "off",
30+
"@typescript-eslint/no-explicit-any": "warn",
3031
"@typescript-eslint/no-unused-vars": ["error", { "vars": "all", "args": "after-used", "argsIgnorePattern": "^_", "ignoreRestSiblings": false }]
3132
}
3233
}

jest.config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const transformIgnorePatterns = ['node_modules/(?!(@openshift|lodash-es)/)'];
1+
const transformIgnorePatterns = ['node_modules/(?!(uuid)/)'];
22

33
/** @type {import('jest').Config} */
44
module.exports = {
@@ -15,5 +15,7 @@ module.exports = {
1515
'^.+\\.(js|jsx)$': 'babel-jest',
1616
},
1717
transformIgnorePatterns,
18+
// needs to fix the memory leak errors
19+
coverageProvider: 'v8',
1820
setupFilesAfterEnv: ['<rootDir>/config/jest.setup.js'],
1921
};

lerna.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
22
"npmClient": "npm",
3-
"version": "independent",
4-
"useWorkspaces": true
3+
"version": "independent"
54
}

package-lock.json

Lines changed: 15086 additions & 16192 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 33 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -8,39 +8,40 @@
88
"packages/**"
99
],
1010
"devDependencies": {
11-
"@babel/preset-env": "^7.15.8",
12-
"@babel/preset-react": "^7.14.5",
13-
"@babel/preset-typescript": "^7.15.0",
14-
"@testing-library/jest-dom": "^5.14.1",
15-
"@testing-library/react": "^12.1.2",
16-
"@types/jest": "^27.0.2",
17-
"@types/lodash": "^4.14.176",
18-
"@types/react": "^17.0.31",
19-
"@types/react-grid-layout": "^1.3.2",
20-
"@types/react-router-dom": "^5.3.1",
21-
"@typescript-eslint/eslint-plugin": "^5.1.0",
22-
"@typescript-eslint/parser": "^5.1.0",
23-
"babel-jest": "^27.5.1",
24-
"chokidar": "^3.5.2",
25-
"css-loader": "^6.7.3",
26-
"cypress": "^10.6.0",
27-
"eslint": "^8.0.1",
28-
"eslint-config-prettier": "^8.3.0",
29-
"eslint-plugin-cypress": "^2.12.1",
30-
"eslint-plugin-prettier": "^4.0.0",
31-
"fs-extra": "^10.0.0",
32-
"glob": "^7.2.0",
11+
"@babel/preset-env": "^7.23.2",
12+
"@babel/preset-react": "^7.22.15",
13+
"@babel/preset-typescript": "^7.23.2",
14+
"@testing-library/jest-dom": "^6.1.4",
15+
"@testing-library/react": "^14.0.0",
16+
"@types/jest": "^29.5.6",
17+
"@types/lodash": "^4.14.200",
18+
"@types/react": "^18.2.31",
19+
"@types/react-grid-layout": "^1.3.4",
20+
"@types/react-router-dom": "^5.3.3",
21+
"@typescript-eslint/eslint-plugin": "^6.8.0",
22+
"@typescript-eslint/parser": "^6.8.0",
23+
"babel-jest": "^29.7.0",
24+
"chokidar": "^3.5.3",
25+
"css-loader": "^6.8.1",
26+
"cypress": "^13.3.2",
27+
"eslint": "^8.52.0",
28+
"eslint-config-prettier": "^9.0.0",
29+
"eslint-plugin-cypress": "^2.15.1",
30+
"eslint-plugin-prettier": "^5.0.1",
31+
"fs-extra": "^11.1.1",
32+
"glob": "^10.3.10",
3333
"identity-obj-proxy": "^3.0.0",
34-
"jest": "~27.3.1",
35-
"lerna": "^6.4.1",
36-
"prettier": "^2.4.1",
34+
"jest": "~29.7.0",
35+
"jest-environment-jsdom": "^29.7.0",
36+
"lerna": "^7.4.1",
37+
"prettier": "^3.0.3",
3738
"process": "^0.11.10",
38-
"regenerator-runtime": "^0.13.11",
39-
"start-server-and-test": "^1.14.0",
40-
"style-loader": "^3.3.1",
41-
"ts-jest": "^27.0.7",
42-
"ts-loader": "^9.2.6",
43-
"typescript": "^4.4.4"
39+
"regenerator-runtime": "^0.14.0",
40+
"start-server-and-test": "^2.0.1",
41+
"style-loader": "^3.3.3",
42+
"ts-jest": "^29.1.1",
43+
"ts-loader": "^9.5.0",
44+
"typescript": "^5.2.2"
4445
},
4546
"scripts": {
4647
"start": "lerna run --parallel start:esm",
@@ -55,8 +56,6 @@
5556
"test:ci": "start-server-and-test start:test http-get://localhost:8123 cypress:run"
5657
},
5758
"dependencies": {
58-
"install": "^0.13.0",
59-
"npm": "^9.4.2",
60-
"react-grid-layout": "^1.3.4"
59+
"react-grid-layout": "^1.4.2"
6160
}
6261
}

packages/core/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ export const getModule = async <T = any, P = any>(scope: string, module: string,
190190
Module = await scalprum.pluginStore.getExposedModule(scope, module);
191191
} catch {
192192
throw new Error(
193-
`Module not initialized! Module "${module}" was not found in "${scope}" webpack scope. Make sure the remote container is loaded?`
193+
`Module not initialized! Module "${module}" was not found in "${scope}" webpack scope. Make sure the remote container is loaded?`,
194194
);
195195
}
196196
} else {

packages/core/src/warnDuplicatePkg.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export const warnDuplicatePkg = (packages: Packages) => {
2020
const instances = Object.keys(versions);
2121
if (instances.length > 1) {
2222
console.warn(
23-
`[SCALPRUM]: You have ${pkgName} package that is being loaded into browser multiple times. You might want to align your version with the chrome one.`
23+
`[SCALPRUM]: You have ${pkgName} package that is being loaded into browser multiple times. You might want to align your version with the chrome one.`,
2424
);
2525
console.warn(`[SCALPRUM]: All packages instances:`, versions);
2626
}

packages/react-core/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
},
2222
"devDependencies": {
2323
"@types/history": "^4.7.9",
24-
"@types/react": "^17.0.31",
24+
"@types/react": "^18.0.0",
2525
"@types/react-dom": "^17.0.10",
2626
"@types/react-router-dom": "^5.3.1"
2727
},
@@ -31,7 +31,7 @@
3131
"lodash": "^4.17.0"
3232
},
3333
"peerDependencies": {
34-
"react": ">=16.8.0 || >=17.0.0",
35-
"react-dom": ">=16.8.0 || >=17.0.0"
34+
"react": ">=16.8.0 || >=17.0.0 || ^18.0.0",
35+
"react-dom": ">=16.8.0 || >=17.0.0 || ^18.0.0"
3636
}
3737
}

packages/react-core/src/__snapshots__/scalprum-component.test.tsx.snap

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,6 @@ exports[`<ScalprumComponent /> should render fallback component 2`] = `
4343
`;
4444

4545
exports[`<ScalprumComponent /> should render test component 1`] = `
46-
<div>
47-
loading
48-
</div>
49-
`;
50-
51-
exports[`<ScalprumComponent /> should render test component 2`] = `
5246
<div>
5347
<span>
5448
Test

packages/react-core/src/async-loader.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { ExposedScalprumModule, getCachedModule, getScalprum, PrefetchFunction }
44
export async function loadComponent<P = {}>(
55
scope: string,
66
module: string,
7-
importName = 'default'
7+
importName = 'default',
88
): Promise<{ prefetch?: PrefetchFunction; component: React.ComponentType<P> }> {
99
{
1010
const { pluginStore } = getScalprum();

0 commit comments

Comments
 (0)