MSP-9065 fix audit vulnerabilities and verify browser compatibility
This commit is contained in:
1 parent
f2e498a1e6
commit
b6b192abd0
8 files changed
+582
-4326
No files matched your search
@@ -26,8 +26,7 @@
|
||||
},
|
||||
"ecmaVersion": "latest",
|
||||
"sourceType": "module",
|
||||
"project": "./tsconfig.json",
|
||||
"tsconfigRootDir": "./"
|
||||
"project": "./tsconfig.json"
|
||||
},
|
||||
"plugins": [
|
||||
"react",
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
## Не выпущено
|
||||
- Исправлено
|
||||
- [MSP-9065](https://jira.elocont.ru/browse/MSP-9065): устранены уязвимости зависимостей по результатам аудита, обновлены Vite и React Router, закреплены исправленные версии вложенных пакетов.
|
||||
- MSP-9065: сохранена работа Monaco, Mermaid, ReDoc и JSON Schema с минимальными браузерными полифилами; добавлена проверка совместимости зависимостей.
|
||||
|
||||
## 1.0.15
|
||||
- Обновлено
|
||||
- Библиотека isp-admin-ui-kit (1.14.0)
|
||||
|
||||
@@ -28,4 +28,22 @@ export default {
|
||||
- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked`
|
||||
- Optionally add `plugin:@typescript-eslint/stylistic-type-checked`
|
||||
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list
|
||||
1
|
||||
1
|
||||
|
||||
### Проверка совместимости зависимостей
|
||||
|
||||
После обновления зависимостей выполните `npm ci`, `npm run lint`, `npm run build`
|
||||
и `npm run test:dependencies`. Последняя команда собирает отдельную проверочную
|
||||
страницу. Запустите `npm run preview -- --outDir build/dependency-smoke --port 4174`
|
||||
и откройте `http://localhost:4174/tests/dependency-smoke.html`.
|
||||
Успешный результат — `Dependency checks passed`. Проверяются DOMPurify, Mermaid
|
||||
(включая формулы), KaTeX, JSON Schema/RJSF, ReDoc, Router и JSON worker Monaco.
|
||||
Страница проверки не входит в основную production-сборку.
|
||||
|
||||
В `overrides` закреплены исправленные DOMPurify и KaTeX без обновления Monaco и
|
||||
Mermaid на новые основные версии. Overrides minimatch/glob относятся к инструментам
|
||||
разработки. Override `react-router-dom` позволяет использовать исправленную ветку 7
|
||||
с опубликованным `isp-admin-ui-kit@1.14.2`, чей peer-диапазон ещё требует ветку 6.
|
||||
После перехода на выпуск UI-kit с поддержкой Router 7 этот override можно удалить.
|
||||
React остаётся в ветке 18. Вместо всех Node-полифилов подключаются только Buffer/process и браузерные реализации path/http/url,
|
||||
необходимые парсерам JSON Schema/OpenAPI и ReDoc. Криптографические полифилы удалены.
|
||||
Generated
+513
-4303
File diff suppressed because it is too large.
Load diff
+20
-11
@@ -11,12 +11,13 @@
|
||||
"fix:prettier": "prettier --write \"src/**/*.{ts,tsx, js}\"",
|
||||
"lint:fix": "eslint --fix .",
|
||||
"analyze": "source-map-explorer 'build/static/js/*.js'",
|
||||
"prepare": "husky || true"
|
||||
"prepare": "husky || true",
|
||||
"test:dependencies": "vite build --config tests/dependency-smoke.config.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@monaco-editor/react": "^4.6.0",
|
||||
"@reduxjs/toolkit": "^2.2.3",
|
||||
"axios": "^1.7.7",
|
||||
"axios": "^1.20.0",
|
||||
"dayjs": "^1.11.10",
|
||||
"isp-admin-ui-kit": "^1.14.2",
|
||||
"isp-ui-kit": "^2.3.3",
|
||||
@@ -26,9 +27,14 @@
|
||||
"react-hook-form": "^7.51.2",
|
||||
"react-redux": "^9.1.0",
|
||||
"react-resizable": "^3.0.5",
|
||||
"react-router-dom": "^6.22.3",
|
||||
"react-router-dom": "^7.18.6",
|
||||
"simplebar": "^6.2.5",
|
||||
"simplebar-react": "^3.2.4"
|
||||
"simplebar-react": "^3.2.4",
|
||||
"buffer": "^6.0.3",
|
||||
"path-browserify": "^1.0.1",
|
||||
"stream-http": "^3.2.0",
|
||||
"url": "^0.11.4",
|
||||
"process": "^0.11.10"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
|
||||
@@ -38,12 +44,9 @@
|
||||
"@types/react": "^18.2.74",
|
||||
"@types/react-dom": "^18.2.24",
|
||||
"@types/react-resizable": "^3.0.7",
|
||||
"@types/react-router-dom": "^5.3.3",
|
||||
"@typescript-eslint/eslint-plugin": "^7.5.0",
|
||||
"@typescript-eslint/parser": "^7.5.0",
|
||||
"@vitejs/plugin-legacy": "^5.3.2",
|
||||
"@typescript-eslint/eslint-plugin": "^8.74.0",
|
||||
"@typescript-eslint/parser": "^8.74.0",
|
||||
"@vitejs/plugin-react": "^4.2.1",
|
||||
"@vitejs/plugin-react-swc": "^3.6.0",
|
||||
"antd": "6.4.3",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint-config-prettier": "^9.1.0",
|
||||
@@ -58,9 +61,8 @@
|
||||
"sass": "1.74.1",
|
||||
"terser": "^5.30.3",
|
||||
"typescript": "^5.4.3",
|
||||
"vite": "^5.4.10",
|
||||
"vite": "^6.4.6",
|
||||
"vite-bundle-visualizer": "^1.2.1",
|
||||
"vite-plugin-node-polyfills": "^0.21.0",
|
||||
"vite-plugin-style-import": "^2.0.0",
|
||||
"vite-plugin-svgr": "^4.2.0",
|
||||
"vite-tsconfig-paths": "^4.3.2"
|
||||
@@ -76,5 +78,12 @@
|
||||
"pre-commit": "eslint --fix .",
|
||||
"pre-push": "eslint --fix ."
|
||||
}
|
||||
},
|
||||
"overrides": {
|
||||
"dompurify": "~3.4.18",
|
||||
"katex": "~0.18.2",
|
||||
"minimatch@>=7 <11": "^11.0.1",
|
||||
"glob@>=9 <14.0.2": "^14.0.2",
|
||||
"react-router-dom": "$react-router-dom"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
import { Buffer } from 'buffer'
|
||||
import process from 'process'
|
||||
|
||||
// OpenAPI/JSON Schema browser builds still use these Node globals.
|
||||
// Load only the required shims, without Node's crypto modules.
|
||||
if (typeof globalThis.Buffer === 'undefined') {
|
||||
Object.assign(globalThis, { Buffer })
|
||||
}
|
||||
if (typeof globalThis.process === 'undefined') {
|
||||
Object.assign(globalThis, { process })
|
||||
}
|
||||
+4
-2
@@ -1,6 +1,8 @@
|
||||
import './browser-polyfills'
|
||||
|
||||
import { loader } from '@monaco-editor/react'
|
||||
import { setupListeners } from '@reduxjs/toolkit/query'
|
||||
import dayjs from 'dayjs'
|
||||
import { locale } from 'dayjs'
|
||||
import 'dayjs/locale/ru'
|
||||
import { AdminBase, baseSetupStore } from 'isp-admin-ui-kit'
|
||||
import * as monaco from 'monaco-editor'
|
||||
@@ -38,7 +40,7 @@ loader.config({ monaco })
|
||||
|
||||
loader.init().then()
|
||||
|
||||
dayjs.locale('ru')
|
||||
locale('ru')
|
||||
const store = baseSetupStore()
|
||||
setupListeners(store.dispatch)
|
||||
const root = createRoot(document.getElementById('root') as HTMLElement)
|
||||
|
||||
+9
-7
@@ -1,6 +1,5 @@
|
||||
import react from '@vitejs/plugin-react'
|
||||
import { defineConfig, loadEnv } from 'vite'
|
||||
import { nodePolyfills } from 'vite-plugin-node-polyfills'
|
||||
import svgr from 'vite-plugin-svgr'
|
||||
|
||||
import tsconfigPaths from 'vite-tsconfig-paths'
|
||||
@@ -12,6 +11,14 @@ export default defineConfig(({ mode }) => {
|
||||
return {
|
||||
base: env.PUBLIC_PATH || '/',
|
||||
optimizeDeps: { exclude: [] },
|
||||
resolve: {
|
||||
alias: {
|
||||
path: 'path-browserify',
|
||||
http: 'stream-http',
|
||||
url: 'url/',
|
||||
process: 'process/browser'
|
||||
}
|
||||
},
|
||||
define: {
|
||||
__APP_ENV__: env.APP_ENV,
|
||||
APP_VERSION: JSON.stringify(process.env.npm_package_version)
|
||||
@@ -38,11 +45,6 @@ export default defineConfig(({ mode }) => {
|
||||
'/api': env.PROXY_URL
|
||||
}
|
||||
},
|
||||
plugins: [
|
||||
react(),
|
||||
svgr(),
|
||||
tsconfigPaths(),
|
||||
nodePolyfills({ globals: { process: true } })
|
||||
]
|
||||
plugins: [react(), svgr(), tsconfigPaths()]
|
||||
}
|
||||
})
|
||||
Reference in new issue
Block a user