Compare commits
117
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0a48c2affe | ||
|
|
0ff37978f1 | ||
|
|
8b4a6ec20c | ||
|
|
11da05a5cd | ||
|
|
f30f80b634 | ||
|
|
7c63062b63 | ||
|
|
9382bb6441 | ||
|
|
b73023dce1 | ||
|
|
6dc63ee15d | ||
|
|
8f5c4b2dbe | ||
|
|
405002a267 | ||
|
|
fad16cd5b5 | ||
|
|
574034fc0b | ||
|
|
4370c80982 | ||
|
|
0d4769ab89 | ||
|
|
0ac5a254a9 | ||
|
|
1f6258ef0d | ||
|
|
bc27a99649 | ||
|
|
767471f12a | ||
|
|
62706e05c6 | ||
|
|
261eeb0009 | ||
|
|
ce0942d1e5 | ||
|
|
412322960f | ||
|
|
a1ed417f0a | ||
|
|
ca976a032d | ||
|
|
ec1454e9f8 | ||
|
|
02d76cd944 | ||
|
|
79584a8902 | ||
|
|
fd13d24645 | ||
|
|
04f13afd82 | ||
|
|
6f67eee5ee | ||
|
|
7dbbaff972 | ||
|
|
6f6d6fb14a | ||
|
|
d1f72bdd40 | ||
|
|
26de62cdeb | ||
|
|
96ed1658b3 | ||
|
|
856df328fe | ||
|
|
9b51e3379a | ||
|
|
239634454b | ||
|
|
20c8f58a77 | ||
|
|
b165afd655 | ||
|
|
60eddbd9fc | ||
|
|
3e205e5805 | ||
|
|
29f8bcb8e9 | ||
|
|
3462bbcf06 | ||
|
|
49b3e2c32e | ||
|
|
3d37d4acd0 | ||
|
|
028c5b859f | ||
|
|
f528ad46e1 | ||
|
|
369d94afd9 | ||
|
|
641ee55cf6 | ||
|
|
f01971d5c1 | ||
|
|
46e1ed6e3b | ||
|
|
809253ab6e | ||
|
|
4c78fb587d | ||
|
|
9f1caacc5d | ||
|
|
c89f47321a | ||
|
|
38646e56df | ||
|
|
9dfb0ca7a3 | ||
|
|
cbc1f0f6cc | ||
|
|
c55fa2e7d6 | ||
|
|
1cdf65ff08 | ||
|
|
4306ffcf3d | ||
|
|
d006bf7628 | ||
|
|
554f1470c8 | ||
|
|
490e6168ff | ||
|
|
709e14e501 | ||
|
|
fe295beb7f | ||
|
|
39cf7159e4 | ||
|
|
e87ed7cd68 | ||
|
|
e54ce881b7 | ||
|
|
180cdb750e | ||
|
|
e730b5ace3 | ||
|
|
0b6f6cb8fa | ||
|
|
eb8e1683fb | ||
|
|
e7b680aeb1 | ||
|
|
a7ec8b9489 | ||
|
|
23b9e1a1f0 | ||
|
|
dd7aee01ed | ||
|
|
bf773a58f0 | ||
|
|
ac08aef65c | ||
|
|
03fa976526 | ||
|
|
64852bca9f | ||
|
|
fbad913311 | ||
|
|
685a32ee30 | ||
|
|
75f491520b | ||
|
|
a1c96ab2e7 | ||
|
|
d9543c4a24 | ||
|
|
3ddbdbda6d | ||
|
|
ae26c073e1 | ||
|
|
1a1d2b594c | ||
|
|
3e52a14c0a | ||
|
|
63fa6bc2ab | ||
|
|
e51429a0bb | ||
|
|
10347e8e18 | ||
|
|
83a1cd2205 | ||
|
|
5f4a3c55cc | ||
|
|
9be06cd305 | ||
|
|
2ebeb14f0e | ||
|
|
0dbf4b0b07 | ||
|
|
096c2d401d | ||
|
|
2d08128cb7 | ||
|
|
a7906026d5 | ||
|
|
10b4a7223c | ||
|
|
1e3a0edb7d | ||
|
|
6b782f3538 | ||
|
|
19d3a12469 | ||
|
|
151be0e635 | ||
|
|
031a92db3f | ||
|
|
e8dfc2e552 | ||
|
|
36c13e159d | ||
|
|
a922f7e914 | ||
|
|
98ad434b36 | ||
|
|
739a9a3a4b | ||
|
|
2989c66a65 | ||
|
|
a6f4c85231 | ||
|
|
a31c44eb7b |
No files matched your search
@@ -0,0 +1,4 @@
|
||||
node_modules/
|
||||
tsconfig.json
|
||||
public/config.js
|
||||
vite.config.ts
|
||||
@@ -0,0 +1,104 @@
|
||||
{
|
||||
"env": {
|
||||
"browser": true,
|
||||
"es2021": true,
|
||||
"node": true
|
||||
},
|
||||
"extends": [
|
||||
"eslint:recommended",
|
||||
"plugin:react/recommended",
|
||||
"plugin:prettier/recommended",
|
||||
"plugin:import/errors",
|
||||
"plugin:import/warnings",
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"plugin:import/typescript"
|
||||
],
|
||||
"ignorePatterns": [
|
||||
"node_modules",
|
||||
"build",
|
||||
"generateVersionFile.cjs",
|
||||
"config.template.js"
|
||||
],
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"parserOptions": {
|
||||
"ecmaFeatures": {
|
||||
"jsx": true
|
||||
},
|
||||
"ecmaVersion": "latest",
|
||||
"sourceType": "module",
|
||||
"project": "./tsconfig.json"
|
||||
},
|
||||
"plugins": [
|
||||
"react",
|
||||
"import",
|
||||
"@typescript-eslint",
|
||||
"react-hooks",
|
||||
"prettier"
|
||||
],
|
||||
"rules": {
|
||||
"import/default": "off",
|
||||
"import/no-named-as-default": "off",
|
||||
"prettier/prettier": "off",
|
||||
"quotes": [
|
||||
"error",
|
||||
"single"
|
||||
],
|
||||
"react/jsx-filename-extension": [
|
||||
1,
|
||||
{
|
||||
"extensions": [
|
||||
".js",
|
||||
".jsx",
|
||||
".tsx"
|
||||
]
|
||||
}
|
||||
],
|
||||
"react/jsx-one-expression-per-line": "off",
|
||||
"react/prop-types": 0,
|
||||
"react/react-in-jsx-scope": "off",
|
||||
"semi": [
|
||||
"error",
|
||||
"never"
|
||||
],
|
||||
"@typescript-eslint/no-unused-vars": [
|
||||
"off"
|
||||
],
|
||||
"@typescript-eslint/no-explicit-any": [
|
||||
"off",
|
||||
null
|
||||
],
|
||||
"@typescript-eslint/no-non-null-assertion": [
|
||||
"off"
|
||||
],
|
||||
"import/no-unresolved": "error",
|
||||
"no-unused-vars": "off"
|
||||
},
|
||||
"settings": {
|
||||
"import/parsers": {
|
||||
"@typescript-eslint/parser": [
|
||||
".ts",
|
||||
".tsx"
|
||||
]
|
||||
},
|
||||
"react": {
|
||||
"version": "detect"
|
||||
},
|
||||
"import/resolver": {
|
||||
"typescript": {
|
||||
"alwaysTryTypes": true
|
||||
},
|
||||
"node": {
|
||||
"extensions": [
|
||||
".js",
|
||||
".jsx",
|
||||
".ts",
|
||||
".tsx"
|
||||
],
|
||||
"moduleDirectory": [
|
||||
"node_modules",
|
||||
"src/"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,8 +5,6 @@ WORKDIR /usr/src/app
|
||||
|
||||
FROM base as deps
|
||||
|
||||
COPY vendor/ ./vendor/
|
||||
|
||||
RUN --mount=type=bind,source=package.json,target=package.json \
|
||||
--mount=type=bind,source=package-lock.json,target=package-lock.json \
|
||||
--mount=type=cache,target=/root/.npm \
|
||||
|
||||
@@ -29,14 +29,19 @@ export default {
|
||||
- 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
|
||||
## Локальная альфа-сборка
|
||||
|
||||
Используйте Node.js 24 (`nvm use`), затем `npm ci` и `npm run build`.
|
||||
Приложение собирается Vite 8.4 (Rolldown/Oxc). Зависимости isp-ui-kit и isp-admin-ui-kit установлены из архивов в `vendor/`; сохраняйте их вместе с package-lock.json.
|
||||
Monaco 0.58 использует публичные пути workers в src/index.tsx.
|
||||
TypeScript 6, ESLint 9 и ReDoc 2 оставлены для совместимости текущих плагинов и собственного рендера документации.
|
||||
### Проверка совместимости зависимостей
|
||||
|
||||
CSS колонок и SimpleBar уже входит в isp-ui-kit: повторные импорты и прямые зависимости приложения удалены. Node-полифилы и дополнительные overrides приложению больше не нужны.
|
||||
Версии исходников и контрольные суммы обоих архивов: [vendor/README.md](vendor/README.md).
|
||||
После обновления зависимостей выполните `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-сборку.
|
||||
|
||||
После обновления UI-пакетов запустите `npx playwright install chromium`, затем `npm run test:smoke`. Проверка собирает production-бандл и открывает его в Chromium на 1440 и 375 px с локальными API-ответами: вход, JSON Schema, ReDoc/Mermaid и настоящий Monaco в редакторе конфигурации, включая JSON worker и ошибки типов по схеме.
|
||||
В `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. Криптографические полифилы удалены.
|
||||
@@ -1,31 +0,0 @@
|
||||
import js from '@eslint/js'
|
||||
import importPlugin from 'eslint-plugin-import'
|
||||
import react from 'eslint-plugin-react'
|
||||
import globals from 'globals'
|
||||
import tseslint from 'typescript-eslint'
|
||||
|
||||
export default [
|
||||
{ ignores: ['node_modules/**', 'dist/**', 'build/**', 'storybook-static/**', 'test-results/**', 'src/**/ReactJsonView/**', 'src/stories/**'] },
|
||||
js.configs.recommended,
|
||||
...tseslint.configs.recommended,
|
||||
react.configs.flat['jsx-runtime'],
|
||||
{
|
||||
files: ['src/**/*.{js,jsx,ts,tsx}'],
|
||||
plugins: { import: importPlugin },
|
||||
languageOptions: { globals: { ...globals.browser, ...globals.node } },
|
||||
settings: {
|
||||
react: { version: 'detect' },
|
||||
'import/resolver': { typescript: { project: './tsconfig.json' } }
|
||||
},
|
||||
rules: {
|
||||
'@typescript-eslint/no-explicit-any': 'off',
|
||||
'@typescript-eslint/ban-ts-comment': 'off',
|
||||
'@typescript-eslint/no-empty-object-type': 'off',
|
||||
'@typescript-eslint/no-unused-vars': 'off',
|
||||
'no-unused-vars': 'off',
|
||||
'import/no-unresolved': 'error',
|
||||
quotes: ['error', 'single'],
|
||||
semi: ['error', 'never']
|
||||
}
|
||||
}
|
||||
]
|
||||
Generated
+3798
-1377
File diff suppressed because it is too large.
Load diff
+64
-37
@@ -6,48 +6,72 @@
|
||||
"scripts": {
|
||||
"start": "vite",
|
||||
"build": "NODE_OPTIONS=--max-old-space-size=4096 vite build && node generateVersionFile.cjs",
|
||||
"lint": "eslint src --max-warnings 0",
|
||||
"lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
||||
"preview": "vite preview",
|
||||
"fix:prettier": "prettier --write \"src/**/*.{ts,tsx, js}\"",
|
||||
"lint:fix": "eslint --fix .",
|
||||
"analyze": "vite-bundle-visualizer",
|
||||
"analyze": "source-map-explorer 'build/static/js/*.js'",
|
||||
"prepare": "husky || true",
|
||||
"test:smoke": "npm run build && node tests/production-smoke.mjs"
|
||||
"test:dependencies": "vite build --config tests/dependency-smoke.config.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@monaco-editor/react": "^4.7.0",
|
||||
"@reduxjs/toolkit": "^2.16.0",
|
||||
"axios": "^1.21.1",
|
||||
"dayjs": "^1.11.23",
|
||||
"isp-admin-ui-kit": "file:vendor/isp-admin-ui-kit-3.0.0.tgz",
|
||||
"isp-ui-kit": "file:vendor/isp-ui-kit-3.0.1.tgz",
|
||||
"monaco-editor": "^0.58.0",
|
||||
"react": "^19.3.1",
|
||||
"react-dom": "^19.3.1",
|
||||
"react-hook-form": "^7.92.0",
|
||||
"react-redux": "^9.3.1",
|
||||
"react-router-dom": "^7.18.7"
|
||||
"@monaco-editor/react": "^4.6.0",
|
||||
"@reduxjs/toolkit": "^2.2.3",
|
||||
"axios": "^1.20.0",
|
||||
"buffer": "^6.0.3",
|
||||
"dayjs": "^1.11.10",
|
||||
"isp-admin-ui-kit": "^1.16.0",
|
||||
"isp-ui-kit": "^2.3.3",
|
||||
"monaco-editor": "^0.55.1",
|
||||
"path-browserify": "^1.0.1",
|
||||
"process": "^0.11.10",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"react-hook-form": "^7.51.2",
|
||||
"react-redux": "^9.1.0",
|
||||
"react-resizable": "^3.0.5",
|
||||
"react-router-dom": "^7.18.7",
|
||||
"simplebar": "^6.2.5",
|
||||
"simplebar-react": "^3.2.4",
|
||||
"stream-http": "^3.2.0",
|
||||
"url": "^0.11.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.39.5",
|
||||
"@playwright/test": "^1.65.1",
|
||||
"@trivago/prettier-plugin-sort-imports": "^6.0.3",
|
||||
"@types/node": "^26.6.11",
|
||||
"@types/react": "^19.3.3",
|
||||
"@types/react-dom": "^19.3.0",
|
||||
"@vitejs/plugin-react": "^6.3.0",
|
||||
"antd": "^6.7.2",
|
||||
"eslint": "^9.39.5",
|
||||
"eslint-import-resolver-typescript": "^4.4.5",
|
||||
"eslint-plugin-import": "^2.32.0",
|
||||
"eslint-plugin-react": "^7.37.5",
|
||||
"globals": "^17.14.0",
|
||||
"husky": "^9.1.7",
|
||||
"prettier": "^3.10.1",
|
||||
"typescript": "^6.0.3",
|
||||
"typescript-eslint": "^8.74.0",
|
||||
"vite": "^8.4.0",
|
||||
"vite-bundle-visualizer": "^1.2.1"
|
||||
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
|
||||
"@types/deep-equal": "^1.0.4",
|
||||
"@types/lodash.clonedeep": "^4.5.9",
|
||||
"@types/node": "^20.12.4",
|
||||
"@types/react": "^18.2.74",
|
||||
"@types/react-dom": "^18.2.24",
|
||||
"@types/react-resizable": "^3.0.7",
|
||||
"@typescript-eslint/eslint-plugin": "^8.74.0",
|
||||
"@typescript-eslint/parser": "^8.74.0",
|
||||
"@vitejs/plugin-react": "^4.2.1",
|
||||
"antd": "6.4.3",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint-config-prettier": "^9.1.0",
|
||||
"eslint-import-resolver-typescript": "^3.6.1",
|
||||
"eslint-plugin-import": "^2.29.1",
|
||||
"eslint-plugin-prettier": "^5.1.3",
|
||||
"eslint-plugin-react": "^7.34.1",
|
||||
"eslint-plugin-react-hooks": "^4.6.0",
|
||||
"eslint-plugin-react-refresh": "^0.4.6",
|
||||
"husky": "^9.0.11",
|
||||
"prettier": "^3.2.5",
|
||||
"sass": "1.74.1",
|
||||
"terser": "^5.30.3",
|
||||
"typescript": "^5.4.3",
|
||||
"vite": "^6.4.6",
|
||||
"vite-bundle-visualizer": "^1.2.1",
|
||||
"vite-plugin-style-import": "^2.0.0",
|
||||
"vite-plugin-svgr": "^4.2.0",
|
||||
"vite-tsconfig-paths": "^4.3.2"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": [
|
||||
"react-app",
|
||||
"react-app/jest"
|
||||
]
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
@@ -55,8 +79,11 @@
|
||||
"pre-push": "eslint --fix ."
|
||||
}
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22.19.0",
|
||||
"npm": ">=10"
|
||||
"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 })
|
||||
}
|
||||
+12
-7
@@ -1,17 +1,22 @@
|
||||
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'
|
||||
import editorWorker from 'monaco-editor/editor/editor.worker?worker'
|
||||
import cssWorker from 'monaco-editor/languages/features/css/css.worker?worker'
|
||||
import htmlWorker from 'monaco-editor/languages/features/html/html.worker?worker'
|
||||
import jsonWorker from 'monaco-editor/languages/features/json/json.worker?worker'
|
||||
import editorWorker from 'monaco-editor/esm/vs/editor/editor.worker?worker'
|
||||
import cssWorker from 'monaco-editor/esm/vs/language/css/css.worker?worker'
|
||||
import htmlWorker from 'monaco-editor/esm/vs/language/html/html.worker?worker'
|
||||
import jsonWorker from 'monaco-editor/esm/vs/language/json/json.worker?worker'
|
||||
import { createRoot } from 'react-dom/client'
|
||||
import { Provider } from 'react-redux'
|
||||
|
||||
import tsWorker from 'monaco-editor/languages/features/typescript/ts.worker?worker'
|
||||
import tsWorker from 'monaco-editor/esm/vs/language/typescript/ts.worker?worker'
|
||||
|
||||
import 'react-resizable/css/styles.css'
|
||||
import 'simplebar-react/dist/simplebar.min.css'
|
||||
|
||||
self.MonacoEnvironment = {
|
||||
getWorker(_, label) {
|
||||
@@ -35,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)
|
||||
|
||||
@@ -1,259 +0,0 @@
|
||||
import { chromium } from '@playwright/test'
|
||||
import { readFile, stat } from 'node:fs/promises'
|
||||
import { createServer } from 'node:http'
|
||||
import path from 'node:path'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
|
||||
const root = fileURLToPath(new URL('../build', import.meta.url))
|
||||
const types = {
|
||||
'.js': 'text/javascript',
|
||||
'.css': 'text/css',
|
||||
'.html': 'text/html',
|
||||
'.json': 'application/json',
|
||||
'.svg': 'image/svg+xml',
|
||||
'.png': 'image/png',
|
||||
'.woff': 'font/woff',
|
||||
'.woff2': 'font/woff2'
|
||||
}
|
||||
const server = createServer(async (req, res) => {
|
||||
try {
|
||||
if (new URL(req.url, 'http://localhost').pathname === '/config.js') {
|
||||
res.setHeader('Content-Type', 'text/javascript')
|
||||
res.end(
|
||||
'window.config = {ENABLE_PASSWORD_LOGIN: true, ENABLE_OAUTH_LOGIN: false, CLIENT_NAME: "isp-admin-ui", APP_TOKEN: "alpha-smoke"};'
|
||||
)
|
||||
return
|
||||
}
|
||||
let file = path.resolve(
|
||||
root,
|
||||
'.' + decodeURIComponent(new URL(req.url, 'http://localhost').pathname)
|
||||
)
|
||||
if (!file.startsWith(root + path.sep) && file !== root) {
|
||||
res.writeHead(403)
|
||||
res.end()
|
||||
return
|
||||
}
|
||||
try {
|
||||
if ((await stat(file)).isDirectory()) file = path.join(file, 'index.html')
|
||||
} catch {
|
||||
file = path.join(root, 'index.html')
|
||||
}
|
||||
res.setHeader(
|
||||
'Content-Type',
|
||||
types[path.extname(file)] || 'application/octet-stream'
|
||||
)
|
||||
res.end(await readFile(file))
|
||||
} catch (e) {
|
||||
res.writeHead(500)
|
||||
res.end(e.message)
|
||||
}
|
||||
})
|
||||
await new Promise((resolve) => server.listen(0, '127.0.0.1', resolve))
|
||||
const url = `http://127.0.0.1:${server.address().port}`
|
||||
const browser = await chromium.launch()
|
||||
const reports = []
|
||||
try {
|
||||
for (const width of [1440, 375]) {
|
||||
const page = await browser.newPage({
|
||||
viewport: { width, height: width < 768 ? 812 : 1000 }
|
||||
})
|
||||
const errors = []
|
||||
page.on('pageerror', (e) => errors.push(e.message))
|
||||
await page.route('**/api/**', (route) =>
|
||||
route.fulfill({
|
||||
status: 200,
|
||||
contentType: 'application/json',
|
||||
body: '{}'
|
||||
})
|
||||
)
|
||||
await page.goto(url, { waitUntil: 'networkidle' })
|
||||
await page
|
||||
.getByRole('heading', { name: 'Вход', exact: true })
|
||||
.waitFor({ timeout: 20000 })
|
||||
if (errors.length) throw new Error(JSON.stringify(errors))
|
||||
reports.push({
|
||||
width,
|
||||
url: page.url(),
|
||||
heading: 'Вход',
|
||||
uncaughtErrors: errors.length
|
||||
})
|
||||
await page.close()
|
||||
}
|
||||
|
||||
for (const width of [1440, 375]) {
|
||||
const page = await browser.newPage({
|
||||
viewport: { width, height: width < 768 ? 812 : 1000 }
|
||||
})
|
||||
const errors = []
|
||||
page.on('pageerror', (e) => errors.push(e.message))
|
||||
await page.addInitScript(() =>
|
||||
localStorage.setItem('USER_TOKEN', 'local-smoke-token')
|
||||
)
|
||||
const schema = {
|
||||
title: 'Проверочная схема',
|
||||
type: 'object',
|
||||
properties: { payload: { $ref: '#/definitions/Message' } },
|
||||
definitions: {
|
||||
Message: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
smokeField: { type: 'string', description: 'Reference resolved' }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
const module = {
|
||||
id: '1',
|
||||
name: 'smoke-service',
|
||||
active: true,
|
||||
configs: [],
|
||||
createdAt: '2026-01-01T00:00:00Z',
|
||||
lastConnectedAt: '2026-01-01T00:00:00Z',
|
||||
requiredModules: [],
|
||||
configSchema: schema,
|
||||
status: [
|
||||
{
|
||||
id: '1',
|
||||
version: '1.0.0',
|
||||
libVersion: '1.0.0',
|
||||
establishedAt: '2026-01-01T00:00:00Z',
|
||||
address: { ip: '127.0.0.1', port: '8080' },
|
||||
endpoints: [
|
||||
{
|
||||
path: 'smoke/swagger',
|
||||
httpMethod: 'GET',
|
||||
extra: {},
|
||||
inner: false,
|
||||
userAuthRequired: false
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
await page.route('**/api/**', (route) => {
|
||||
const pathname = new URL(route.request().url()).pathname
|
||||
let data = []
|
||||
if (pathname.endsWith('/get_profile'))
|
||||
data = {
|
||||
email: 'smoke@example.test',
|
||||
firstName: 'Тест',
|
||||
lastName: 'Обновлений',
|
||||
role: 'ADMIN',
|
||||
roles: [1],
|
||||
roleNames: ['Администратор'],
|
||||
permissions: [
|
||||
'profile_view',
|
||||
'module_view',
|
||||
'module_configuration_add',
|
||||
'module_configuration_edit'
|
||||
],
|
||||
idleTimeoutMs: 3600000
|
||||
}
|
||||
else if (pathname.endsWith('/get_design'))
|
||||
data = { name: 'Dependency smoke', primaryColor: '#1677ff' }
|
||||
else if (pathname.endsWith('/get_modules_info')) data = [module]
|
||||
else if (pathname.endsWith('/get_by_module_id')) data = { schema }
|
||||
else if (pathname.endsWith('/get_config_by_id'))
|
||||
data = {
|
||||
id: '7',
|
||||
moduleId: '1',
|
||||
name: 'Monaco regression',
|
||||
data: { payload: { smokeField: 'initial' } },
|
||||
active: false,
|
||||
commonConfigs: [],
|
||||
version: 1,
|
||||
valid: true,
|
||||
description: '',
|
||||
createdAt: '2026-01-01T00:00:00Z',
|
||||
updatedAt: '2026-01-01T00:00:00Z'
|
||||
}
|
||||
else if (pathname.endsWith('/smoke/swagger'))
|
||||
data = {
|
||||
openapi: '3.0.3',
|
||||
info: {
|
||||
title: 'Dependency smoke API',
|
||||
version: '1.0.0',
|
||||
description:
|
||||
'```mermaid\\nflowchart LR\\n Browser-->API\\n```'.replaceAll(
|
||||
'\\n',
|
||||
'\n'
|
||||
)
|
||||
},
|
||||
paths: {
|
||||
'/ping': {
|
||||
get: {
|
||||
summary: 'Ping',
|
||||
responses: { 200: { description: 'OK' } }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return route.fulfill({
|
||||
status: 200,
|
||||
contentType: 'application/json',
|
||||
body: JSON.stringify(data)
|
||||
})
|
||||
})
|
||||
await page.goto(url + '/modules/1/configurations', {
|
||||
waitUntil: 'networkidle'
|
||||
})
|
||||
await page
|
||||
.getByRole('button', { name: 'Текущая схема', exact: true })
|
||||
.click({ timeout: 30000 })
|
||||
const dialog = page.getByRole('dialog', { name: 'Текущая схема' })
|
||||
await dialog
|
||||
.getByText('smokeField', { exact: false })
|
||||
.first()
|
||||
.waitFor({ timeout: 20000 })
|
||||
if (await dialog.getByText('Не удалось отобразить схему').count())
|
||||
throw Error('Schema parser failed')
|
||||
reports.push({
|
||||
width,
|
||||
schema: 'internal $ref resolved in production bundle'
|
||||
})
|
||||
await page.goto(url + '/modules/1/swagger', { waitUntil: 'networkidle' })
|
||||
await page.locator('.swagger-page__mermaid svg').waitFor({ timeout: 30000 })
|
||||
if (errors.length) throw Error(JSON.stringify(errors))
|
||||
reports.push({
|
||||
width,
|
||||
redoc: 'rendered',
|
||||
mermaid: 'SVG rendered',
|
||||
uncaughtErrors: 0
|
||||
})
|
||||
const workers = []
|
||||
page.on('worker', (worker) => workers.push(worker.url()))
|
||||
await page.goto(url + '/1/configEditor/7', { waitUntil: 'networkidle' })
|
||||
await page
|
||||
.getByText('Редактор кода', { exact: true })
|
||||
.click({ timeout: 20000 })
|
||||
const editor = page.locator('.monaco-editor .view-lines').first()
|
||||
await editor.waitFor({ timeout: 20000 })
|
||||
await editor.click()
|
||||
await page.keyboard.press('ControlOrMeta+A')
|
||||
await page.keyboard.insertText('{"payload":{"smokeField":42}}')
|
||||
await page
|
||||
.locator('.monaco-editor .squiggly-error')
|
||||
.first()
|
||||
.waitFor({ timeout: 30000 })
|
||||
if (!workers.some((url) => url.includes('json.worker')))
|
||||
throw Error('JSON worker did not start')
|
||||
if (
|
||||
await page
|
||||
.getByText('Unexpected Application Error!', { exact: false })
|
||||
.count()
|
||||
)
|
||||
throw Error('Configuration editor crashed')
|
||||
if (errors.length) throw Error(JSON.stringify(errors))
|
||||
reports.push({
|
||||
width,
|
||||
configurationEditor: 'mounted',
|
||||
schemaValidation: 'type error highlighted by real JSON worker',
|
||||
uncaughtErrors: 0
|
||||
})
|
||||
await page.close()
|
||||
}
|
||||
console.log(JSON.stringify(reports, null, 2))
|
||||
} finally {
|
||||
await browser.close()
|
||||
await new Promise((resolve) => server.close(resolve))
|
||||
}
|
||||
+14
-13
@@ -19,20 +19,21 @@
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"@assets/*": ["./src/assets/*"],
|
||||
"@constants/*": ["./src/constants/*"],
|
||||
"@ui/*": ["./src/ui/*"],
|
||||
"@widgets/*": ["./src/widgets/*"],
|
||||
"@components/*": ["./src/components/*"],
|
||||
"@modules/*": ["./src/modules/*"],
|
||||
"@hooks/*": ["./src/hooks/*"],
|
||||
"@pages/*": ["./src/pages/*"],
|
||||
"@services/*": ["./src/services/*"],
|
||||
"@stores/*": ["./src/stores/*"],
|
||||
"@type/*": ["./src/type/*"],
|
||||
"@utils/*": ["./src/utils/*"],
|
||||
"@routes/*": ["./src/routes/*"]
|
||||
"@assets/*": ["src/assets/*"],
|
||||
"@constants/*": ["src/constants/*"],
|
||||
"@ui/*": ["src/ui/*"],
|
||||
"@widgets/*": ["src/widgets/*"],
|
||||
"@components/*": ["src/components/*"],
|
||||
"@modules/*": ["src/modules/*"],
|
||||
"@hooks/*": ["src/hooks/*"],
|
||||
"@pages/*": ["src/pages/*"],
|
||||
"@services/*": ["src/services/*"],
|
||||
"@stores/*": ["src/stores/*"],
|
||||
"@type/*": ["src/type/*"],
|
||||
"@utils/*": ["src/utils/*"],
|
||||
"@routes/*": ["src/routes/*"]
|
||||
},
|
||||
"allowSyntheticDefaultImports": true
|
||||
},
|
||||
|
||||
Vendored
-16
@@ -1,16 +0,0 @@
|
||||
# UI packages for redesign alpha
|
||||
|
||||
Both archives are installed from this directory. Their exact integrity values are also pinned in package-lock.json. No npm release was published.
|
||||
|
||||
| Archive | Source branch | Source commit | SHA-256 |
|
||||
| --- | --- | --- | --- |
|
||||
| isp-ui-kit-3.0.1.tgz | column-redesign | [3a8b1a1](https://gitlab.txix.ru/isp/isp-ui-kit/-/commit/3a8b1a1924d82747518c4c81e48cd16e62a1f6eb) | 2e2149801cba5198f4db0a0bb9fd07d362d4e87f659971b73320ffd643607ae3 |
|
||||
| isp-admin-ui-kit-3.0.0.tgz | redesign-form-saving | [053aa80](https://gitlab.txix.ru/isp/isp-admin-ui-kit/-/commit/053aa807f2fcc59b6a610c20c8679b8270d255c2) | 8ab17713ccd23fff25e94fb77f3c4faf8bd8032dd54d1d0e183cab270a026a6b |
|
||||
|
||||
Use Node.js 24 (nvm use), npm ci and npm run build. Docker copies vendor before installing dependencies.
|
||||
|
||||
To refresh: build isp-ui-kit with npm run build and pack it with npm pack --ignore-scripts; build isp-admin-ui-kit with npm run build:prod and pack it with npm pack --ignore-scripts. Copy both archives here and install them explicitly to update lockfile integrity values.
|
||||
|
||||
The admin kit declares the base kit as a peer dependency. Its development dependency is pinned to a Git commit; no vendor archive is stored in the admin-kit repository. The application installs both archives directly, without cloning Git repositories during installation.
|
||||
|
||||
The admin archive contains production CJS/ESM bundles and TypeScript declarations without source maps or test fixtures.
|
||||
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
+21
-6
@@ -1,5 +1,8 @@
|
||||
import react from '@vitejs/plugin-react'
|
||||
import { defineConfig, loadEnv } from 'vite'
|
||||
import svgr from 'vite-plugin-svgr'
|
||||
|
||||
import tsconfigPaths from 'vite-tsconfig-paths'
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig(({ mode }) => {
|
||||
@@ -7,19 +10,29 @@ export default defineConfig(({ mode }) => {
|
||||
|
||||
return {
|
||||
base: env.PUBLIC_PATH || '/',
|
||||
resolve: { tsconfigPaths: true },
|
||||
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)
|
||||
},
|
||||
build: {
|
||||
target: 'es2020',
|
||||
minify: 'oxc',
|
||||
minify: 'esbuild',
|
||||
sourcemap: mode !== 'production',
|
||||
outDir: 'build',
|
||||
chunkSizeWarningLimit: 1600,
|
||||
rolldownOptions: { output: { comments: { legal: false } } }
|
||||
commonjsOptions: { transformMixedEsModules: true },
|
||||
esbuild: {
|
||||
target: 'es2020',
|
||||
legalComments: 'none'
|
||||
}
|
||||
},
|
||||
server: {
|
||||
watch: {
|
||||
@@ -28,8 +41,10 @@ export default defineConfig(({ mode }) => {
|
||||
host: true,
|
||||
strictPort: true,
|
||||
port: 8000,
|
||||
proxy: env.PROXY_URL ? { '/api': env.PROXY_URL } : undefined
|
||||
proxy: {
|
||||
'/api': env.PROXY_URL
|
||||
}
|
||||
},
|
||||
plugins: [react()]
|
||||
plugins: [react(), svgr(), tsconfigPaths()]
|
||||
}
|
||||
})
|
||||
Reference in new issue
Block a user