Compare commits

..
Author SHA1 Message Date
Nikita Veselov bfca126342 vendor 2026-11-26 13:53:28 +03:00
Nikita Veselov c9bc217393 MSP-9065 fix audit vulnerabilities and verify browser compatibility 2026-11-24 14:41:46 +03:00
10 changed files with 1068 additions and 4762 deletions

No files matched your search

+1 -2
View File
@@ -26,8 +26,7 @@
}, },
"ecmaVersion": "latest", "ecmaVersion": "latest",
"sourceType": "module", "sourceType": "module",
"project": "./tsconfig.json", "project": "./tsconfig.json"
"tsconfigRootDir": "./"
}, },
"plugins": [ "plugins": [
"react", "react",
+5
View File
@@ -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 ## 1.0.15
- Обновлено - Обновлено
- Библиотека isp-admin-ui-kit (1.14.0) - Библиотека isp-admin-ui-kit (1.14.0)
+2
View File
@@ -7,6 +7,7 @@ FROM base as deps
RUN --mount=type=bind,source=package.json,target=package.json \ RUN --mount=type=bind,source=package.json,target=package.json \
--mount=type=bind,source=package-lock.json,target=package-lock.json \ --mount=type=bind,source=package-lock.json,target=package-lock.json \
--mount=type=bind,source=vendor,target=vendor \
--mount=type=cache,target=/root/.npm \ --mount=type=cache,target=/root/.npm \
npm ci --omit=dev npm ci --omit=dev
@@ -14,6 +15,7 @@ FROM deps as build
RUN --mount=type=bind,source=package.json,target=package.json \ RUN --mount=type=bind,source=package.json,target=package.json \
--mount=type=bind,source=package-lock.json,target=package-lock.json \ --mount=type=bind,source=package-lock.json,target=package-lock.json \
--mount=type=bind,source=vendor,target=vendor \
--mount=type=cache,target=/root/.npm \ --mount=type=cache,target=/root/.npm \
npm ci npm ci
+26
View File
@@ -29,3 +29,29 @@ export default {
- Optionally add `plugin:@typescript-eslint/stylistic-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 - 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 относятся к инструментам
разработки. Вендорная версия `isp-admin-ui-kit` поддерживает Router 7.
React остаётся в ветке 18. Вместо всех Node-полифилов подключаются только Buffer/process и браузерные реализации path/http/url,
необходимые парсерам JSON Schema/OpenAPI и ReDoc. Криптографические полифилы удалены.
### Вендорный пакет isp-admin-ui-kit
`npm ci` устанавливает UI-kit из `vendor/isp-admin-ui-kit-1.16.0.tgz`. Архив
собран из коммита `abbe2f3` репозитория `isp-admin-ui-kit`.
Для обновления запустите `npm run build:prod` в репозитории UI-kit и упакуйте
сборку командой `npm pack --pack-destination /путь/к/isp-admin-ui/vendor`.
В `isp-admin-ui` установите новый архив через `npm install ./vendor/<имя-архива>.tgz`
и сохраните его вместе с обновлёнными `package.json` и `package-lock.json`.
+989 -4738
View File
File diff suppressed because it is too large. Load diff
+21 -13
View File
@@ -11,24 +11,30 @@
"fix:prettier": "prettier --write \"src/**/*.{ts,tsx, js}\"", "fix:prettier": "prettier --write \"src/**/*.{ts,tsx, js}\"",
"lint:fix": "eslint --fix .", "lint:fix": "eslint --fix .",
"analyze": "source-map-explorer 'build/static/js/*.js'", "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": { "dependencies": {
"@monaco-editor/react": "^4.6.0", "@monaco-editor/react": "^4.6.0",
"@reduxjs/toolkit": "^2.2.3", "@reduxjs/toolkit": "^2.2.3",
"axios": "^1.7.7", "axios": "^1.20.0",
"buffer": "^6.0.3",
"dayjs": "^1.11.10", "dayjs": "^1.11.10",
"isp-admin-ui-kit": "^1.14.2", "isp-admin-ui-kit": "file:vendor/isp-admin-ui-kit-1.16.0.tgz",
"isp-ui-kit": "^2.3.3", "isp-ui-kit": "^2.3.4",
"monaco-editor": "^0.55.1", "monaco-editor": "^0.55.1",
"path-browserify": "^1.0.1",
"process": "^0.11.10",
"react": "^18.2.0", "react": "^18.2.0",
"react-dom": "^18.2.0", "react-dom": "^18.2.0",
"react-hook-form": "^7.51.2", "react-hook-form": "^7.51.2",
"react-redux": "^9.1.0", "react-redux": "^9.1.0",
"react-resizable": "^3.0.5", "react-resizable": "^3.0.5",
"react-router-dom": "^6.22.3", "react-router-dom": "^7.18.6",
"simplebar": "^6.2.5", "simplebar": "^6.2.5",
"simplebar-react": "^3.2.4" "simplebar-react": "^3.2.4",
"stream-http": "^3.2.0",
"url": "^0.11.4"
}, },
"devDependencies": { "devDependencies": {
"@trivago/prettier-plugin-sort-imports": "^4.3.0", "@trivago/prettier-plugin-sort-imports": "^4.3.0",
@@ -38,12 +44,9 @@
"@types/react": "^18.2.74", "@types/react": "^18.2.74",
"@types/react-dom": "^18.2.24", "@types/react-dom": "^18.2.24",
"@types/react-resizable": "^3.0.7", "@types/react-resizable": "^3.0.7",
"@types/react-router-dom": "^5.3.3", "@typescript-eslint/eslint-plugin": "^8.74.0",
"@typescript-eslint/eslint-plugin": "^7.5.0", "@typescript-eslint/parser": "^8.74.0",
"@typescript-eslint/parser": "^7.5.0",
"@vitejs/plugin-legacy": "^5.3.2",
"@vitejs/plugin-react": "^4.2.1", "@vitejs/plugin-react": "^4.2.1",
"@vitejs/plugin-react-swc": "^3.6.0",
"antd": "6.4.3", "antd": "6.4.3",
"eslint": "^8.57.0", "eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0", "eslint-config-prettier": "^9.1.0",
@@ -58,9 +61,8 @@
"sass": "1.74.1", "sass": "1.74.1",
"terser": "^5.30.3", "terser": "^5.30.3",
"typescript": "^5.4.3", "typescript": "^5.4.3",
"vite": "^5.4.10", "vite": "^6.4.6",
"vite-bundle-visualizer": "^1.2.1", "vite-bundle-visualizer": "^1.2.1",
"vite-plugin-node-polyfills": "^0.21.0",
"vite-plugin-style-import": "^2.0.0", "vite-plugin-style-import": "^2.0.0",
"vite-plugin-svgr": "^4.2.0", "vite-plugin-svgr": "^4.2.0",
"vite-tsconfig-paths": "^4.3.2" "vite-tsconfig-paths": "^4.3.2"
@@ -76,5 +78,11 @@
"pre-commit": "eslint --fix .", "pre-commit": "eslint --fix .",
"pre-push": "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"
} }
} }
+11
View File
@@ -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
View File
@@ -1,6 +1,8 @@
import './browser-polyfills'
import { loader } from '@monaco-editor/react' import { loader } from '@monaco-editor/react'
import { setupListeners } from '@reduxjs/toolkit/query' import { setupListeners } from '@reduxjs/toolkit/query'
import dayjs from 'dayjs' import { locale } from 'dayjs'
import 'dayjs/locale/ru' import 'dayjs/locale/ru'
import { AdminBase, baseSetupStore } from 'isp-admin-ui-kit' import { AdminBase, baseSetupStore } from 'isp-admin-ui-kit'
import * as monaco from 'monaco-editor' import * as monaco from 'monaco-editor'
@@ -38,7 +40,7 @@ loader.config({ monaco })
loader.init().then() loader.init().then()
dayjs.locale('ru') locale('ru')
const store = baseSetupStore() const store = baseSetupStore()
setupListeners(store.dispatch) setupListeners(store.dispatch)
const root = createRoot(document.getElementById('root') as HTMLElement) const root = createRoot(document.getElementById('root') as HTMLElement)
Binary file not shown.
+9 -7
View File
@@ -1,6 +1,5 @@
import react from '@vitejs/plugin-react' import react from '@vitejs/plugin-react'
import { defineConfig, loadEnv } from 'vite' import { defineConfig, loadEnv } from 'vite'
import { nodePolyfills } from 'vite-plugin-node-polyfills'
import svgr from 'vite-plugin-svgr' import svgr from 'vite-plugin-svgr'
import tsconfigPaths from 'vite-tsconfig-paths' import tsconfigPaths from 'vite-tsconfig-paths'
@@ -12,6 +11,14 @@ export default defineConfig(({ mode }) => {
return { return {
base: env.PUBLIC_PATH || '/', base: env.PUBLIC_PATH || '/',
optimizeDeps: { exclude: [] }, optimizeDeps: { exclude: [] },
resolve: {
alias: {
path: 'path-browserify',
http: 'stream-http',
url: 'url/',
process: 'process/browser'
}
},
define: { define: {
__APP_ENV__: env.APP_ENV, __APP_ENV__: env.APP_ENV,
APP_VERSION: JSON.stringify(process.env.npm_package_version) APP_VERSION: JSON.stringify(process.env.npm_package_version)
@@ -38,11 +45,6 @@ export default defineConfig(({ mode }) => {
'/api': env.PROXY_URL '/api': env.PROXY_URL
} }
}, },
plugins: [ plugins: [react(), svgr(), tsconfigPaths()]
react(),
svgr(),
tsconfigPaths(),
nodePolyfills({ globals: { process: true } })
]
} }
}) })