From 161e8a8f2f8abef485c03b21939178e66cca53a6 Mon Sep 17 00:00:00 2001 From: warjiang <1096409085@qq.com> Date: Mon, 2 Sep 2024 15:09:44 +0800 Subject: [PATCH 1/4] feat: add vite-plugin-dynamic-base dependency & config dynamic path Signed-off-by: warjiang <1096409085@qq.com> --- ui/apps/dashboard/index.html | 6 + ui/apps/dashboard/package.json | 1 + ui/apps/dashboard/vite.config.ts | 10 +- ui/pnpm-lock.yaml | 602 ++++++++++++------------------- 4 files changed, 251 insertions(+), 368 deletions(-) diff --git a/ui/apps/dashboard/index.html b/ui/apps/dashboard/index.html index e0d1c840..60a40ff1 100644 --- a/ui/apps/dashboard/index.html +++ b/ui/apps/dashboard/index.html @@ -5,6 +5,12 @@ Vite + React + TS +
diff --git a/ui/apps/dashboard/package.json b/ui/apps/dashboard/package.json index 89cca800..f5453c67 100644 --- a/ui/apps/dashboard/package.json +++ b/ui/apps/dashboard/package.json @@ -62,6 +62,7 @@ "tailwindcss": "^3.4.3", "typescript": "^5.2.2", "vite": "^5.2.0", + "vite-plugin-dynamic-base": "^1.1.0", "vite-plugin-svgr": "^4.2.0" } } diff --git a/ui/apps/dashboard/vite.config.ts b/ui/apps/dashboard/vite.config.ts index 9a34be54..cf1e88c6 100644 --- a/ui/apps/dashboard/vite.config.ts +++ b/ui/apps/dashboard/vite.config.ts @@ -2,13 +2,21 @@ import { defineConfig, loadEnv } from 'vite'; import react from '@vitejs/plugin-react'; import svgr from 'vite-plugin-svgr'; import path from 'path'; +import { dynamicBase } from 'vite-plugin-dynamic-base'; // https://vitejs.dev/config/ export default defineConfig(({ mode }) => { const env = loadEnv(mode, process.cwd(), ''); return { base: process.env.NODE_ENV === 'development' ? '' : '/static', - plugins: [react(), svgr()], + plugins: [ + react(), + svgr(), + dynamicBase({ + publicPath: 'window.__dynamic_base__', + transformIndexHtml: true, + }), + ], resolve: { alias: [{ find: '@', replacement: path.resolve(__dirname, 'src') }], }, diff --git a/ui/pnpm-lock.yaml b/ui/pnpm-lock.yaml index 5bba70ff..bbecf8fd 100644 --- a/ui/pnpm-lock.yaml +++ b/ui/pnpm-lock.yaml @@ -31,7 +31,7 @@ importers: version: 15.2.7 tsup: specifier: ^8.1.0 - version: 8.1.0(postcss@8.4.38)(typescript@5.4.5) + version: 8.1.0(@swc/core@1.7.22)(postcss@8.4.38)(typescript@5.4.5) tsx: specifier: ^4.15.6 version: 4.15.6 @@ -58,7 +58,7 @@ importers: version: 5.17.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1) axios: specifier: ^1.6.8 - version: 1.6.8(debug@4.3.5) + version: 1.6.8 clsx: specifier: ^2.1.0 version: 2.1.1 @@ -150,131 +150,13 @@ importers: vite: specifier: ^5.2.0 version: 5.2.11(@types/node@20.12.11)(less@4.2.0) + vite-plugin-dynamic-base: + specifier: ^1.1.0 + version: 1.1.0(vite@5.2.11(@types/node@20.12.11)(less@4.2.0)) vite-plugin-svgr: specifier: ^4.2.0 version: 4.2.0(rollup@4.17.2)(typescript@5.4.5)(vite@5.2.11(@types/node@20.12.11)(less@4.2.0)) - apps/demos: - dependencies: - '@karmada/terminal': - specifier: workspace:* - version: link:../../packages/terminal - '@monaco-editor/react': - specifier: ^4.6.0 - version: 4.6.0(monaco-editor@0.48.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@tanstack/react-query': - specifier: ^5.29.2 - version: 5.36.0(react@18.3.1) - '@uidotdev/usehooks': - specifier: ^2.4.1 - version: 2.4.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - ahooks: - specifier: ^3.8.0 - version: 3.8.0(react@18.3.1) - antd: - specifier: ^5.17.3 - version: 5.17.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - axios: - specifier: ^1.6.8 - version: 1.6.8(debug@4.3.5) - clsx: - specifier: ^2.1.0 - version: 2.1.1 - debug: - specifier: ^4.3.5 - version: 4.3.5 - i18next: - specifier: ^23.11.1 - version: 23.11.4 - lodash: - specifier: ^4.17.21 - version: 4.17.21 - lucide-react: - specifier: ^0.368.0 - version: 0.368.0(react@18.3.1) - monaco-editor: - specifier: ^0.48.0 - version: 0.48.0 - monaco-yaml: - specifier: ^5.1.0 - version: 5.1.0(monaco-editor@0.48.0) - react: - specifier: ^18.2.0 - version: 18.3.1 - react-dom: - specifier: ^18.2.0 - version: 18.3.1(react@18.3.1) - react-helmet-async: - specifier: ^2.0.4 - version: 2.0.5(react@18.3.1) - react-i18next: - specifier: ^14.1.0 - version: 14.1.1(i18next@23.11.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - react-router-dom: - specifier: ^6.22.3 - version: 6.23.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - tailwind-merge: - specifier: ^2.2.2 - version: 2.3.0 - yaml: - specifier: ^2.4.2 - version: 2.4.2 - devDependencies: - '@karmada/eslint-config-ts-react': - specifier: workspace:* - version: link:../../packages/eslint-config-ts-react - '@types/debug': - specifier: ^4.1.12 - version: 4.1.12 - '@types/lodash': - specifier: ^4.17.0 - version: 4.17.1 - '@types/react': - specifier: ^18.2.66 - version: 18.3.3 - '@types/react-dom': - specifier: ^18.2.22 - version: 18.3.0 - '@typescript-eslint/eslint-plugin': - specifier: ^7.2.0 - version: 7.14.1(@typescript-eslint/parser@7.14.1(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5) - '@typescript-eslint/parser': - specifier: ^7.2.0 - version: 7.14.1(eslint@8.57.0)(typescript@5.4.5) - '@vitejs/plugin-react': - specifier: ^4.2.1 - version: 4.3.1(vite@5.3.1(@types/node@20.12.11)(less@4.2.0)) - autoprefixer: - specifier: ^10.4.19 - version: 10.4.19(postcss@8.4.38) - eslint: - specifier: ^8.57.0 - version: 8.57.0 - eslint-plugin-react-hooks: - specifier: ^4.6.0 - version: 4.6.2(eslint@8.57.0) - eslint-plugin-react-refresh: - specifier: ^0.4.6 - version: 0.4.7(eslint@8.57.0) - less: - specifier: ^4.2.0 - version: 4.2.0 - postcss: - specifier: ^8.4.38 - version: 8.4.38 - tailwindcss: - specifier: ^3.4.3 - version: 3.4.3 - typescript: - specifier: ^5.2.2 - version: 5.4.5 - vite: - specifier: ^5.2.0 - version: 5.3.1(@types/node@20.12.11)(less@4.2.0) - vite-plugin-svgr: - specifier: ^4.2.0 - version: 4.2.0(rollup@4.17.2)(typescript@5.4.5)(vite@5.3.1(@types/node@20.12.11)(less@4.2.0)) - packages/eslint-config-ts: dependencies: '@typescript-eslint/eslint-plugin': @@ -949,6 +831,7 @@ packages: '@humanwhocodes/config-array@0.11.14': resolution: {integrity: sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==} engines: {node: '>=10.10.0'} + deprecated: Use @eslint/config-array instead '@humanwhocodes/module-importer@1.0.1': resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} @@ -956,6 +839,7 @@ packages: '@humanwhocodes/object-schema@2.0.3': resolution: {integrity: sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==} + deprecated: Use @eslint/object-schema instead '@isaacs/cliui@8.0.2': resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==} @@ -1231,6 +1115,85 @@ packages: peerDependencies: '@svgr/core': '*' + '@swc/core-darwin-arm64@1.7.22': + resolution: {integrity: sha512-B2Bh2W+C7ALdGwDxRWAJ+UtNExfozvwyayGiNkbR3wmDKXXeQfhGM5MK+QYUWKu7UQ6ATq69OyZrxofDobKUug==} + engines: {node: '>=10'} + cpu: [arm64] + os: [darwin] + + '@swc/core-darwin-x64@1.7.22': + resolution: {integrity: sha512-s34UQntnQ6tL9hS9aX3xG7OfGhpmy05FEEndbHaooGO8O+L5k8uWxhE5KhYCOC0N803sGdZg6YZmKtYrWN/YxA==} + engines: {node: '>=10'} + cpu: [x64] + os: [darwin] + + '@swc/core-linux-arm-gnueabihf@1.7.22': + resolution: {integrity: sha512-SE69+oos1jLOXx5YdMH//Qc5zQc2xYukajB+0BWmkcFd/S/cCanGWYtdSzYausm8af2Fw1hPJMNIfndJLnBDFw==} + engines: {node: '>=10'} + cpu: [arm] + os: [linux] + + '@swc/core-linux-arm64-gnu@1.7.22': + resolution: {integrity: sha512-59FzDW/ojgiTj4dlnv3Z3ESuVlzhSAq9X12CNYh4/WTCNA8BoJqOnWMRQKspWtoNlnVviFLMvpek0pGXHndEBA==} + engines: {node: '>=10'} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@swc/core-linux-arm64-musl@1.7.22': + resolution: {integrity: sha512-cMQMI8YRO/XR3OrYuiUlWksNsJOZSkA6gSLNyH6eHTw+FOAzv05oJ4SFYe6s1WesrOqRwhpez6y5H6OIP/EKzg==} + engines: {node: '>=10'} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@swc/core-linux-x64-gnu@1.7.22': + resolution: {integrity: sha512-639kA7MXrWqWYfwuSJ+XTg21VYb/5o99R1zJrndoEjEX6m7Wza/sXssQKU5jbbkPoSEKVKNP3n/gazLWiUKgiQ==} + engines: {node: '>=10'} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@swc/core-linux-x64-musl@1.7.22': + resolution: {integrity: sha512-f3zfGgY8EJQUOk3ve25ZTkNkhB/kHo9QlN2r+0exaE1g9W7X8IS6J8pWzF3hJrV2P9dBi6ofMOt+opVA89JKHA==} + engines: {node: '>=10'} + cpu: [x64] + os: [linux] + libc: [musl] + + '@swc/core-win32-arm64-msvc@1.7.22': + resolution: {integrity: sha512-p/Fav5U+LtTJD/tbbS0dKK8SVVAhXo5Jdm1TDeBPJ4BEIVguYBZEXgD3CW9wY4K34g1hscpiz2Q2rktfhFj1+A==} + engines: {node: '>=10'} + cpu: [arm64] + os: [win32] + + '@swc/core-win32-ia32-msvc@1.7.22': + resolution: {integrity: sha512-HbmfasaCNTqeCTvDjleYj+jJZQ6MlraiVOdhW55KtbA9mAVQdPBq6DDAvR7VOero3wUNYUM/e36otFKgEJI5Rg==} + engines: {node: '>=10'} + cpu: [ia32] + os: [win32] + + '@swc/core-win32-x64-msvc@1.7.22': + resolution: {integrity: sha512-lppIveE+hpe7WXny/9cUT+T6sBM/ND0E+dviKWJ5jFBISj2KWomlSJGUjYEsRGJVPnTEc8uOlKK7etmXBhQx9A==} + engines: {node: '>=10'} + cpu: [x64] + os: [win32] + + '@swc/core@1.7.22': + resolution: {integrity: sha512-Asn79WKqyjEuO2VEeSnVjn2YiRMToRhFJwOsQeqftBvwWMn1FGUuzVcXtkQFBk37si8Gh2Vkk/+p0u4K5NxDig==} + engines: {node: '>=10'} + peerDependencies: + '@swc/helpers': '*' + peerDependenciesMeta: + '@swc/helpers': + optional: true + + '@swc/counter@0.1.3': + resolution: {integrity: sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ==} + + '@swc/types@0.1.12': + resolution: {integrity: sha512-wBJA+SdtkbFhHjTMYH+dEH1y4VpfGdAc2Kw/LK09i9bXd/K6j6PkDcFCEzb6iVfZMkPRrl/q0e3toqTAJdkIVA==} + '@tanstack/query-core@5.36.0': resolution: {integrity: sha512-B5BD3pg/mztDR36i77hGcyySKKeYrbM5mnogOROTBi1SUml5ByRK7PGUUl16vvubvQC+mSnqziFG/VIy/DE3FQ==} @@ -1310,17 +1273,6 @@ packages: typescript: optional: true - '@typescript-eslint/eslint-plugin@7.14.1': - resolution: {integrity: sha512-aAJd6bIf2vvQRjUG3ZkNXkmBpN+J7Wd0mfQiiVCJMu9Z5GcZZdcc0j8XwN/BM97Fl7e3SkTXODSk4VehUv7CGw==} - engines: {node: ^18.18.0 || >=20.0.0} - peerDependencies: - '@typescript-eslint/parser': ^7.0.0 - eslint: ^8.56.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - '@typescript-eslint/eslint-plugin@7.8.0': resolution: {integrity: sha512-gFTT+ezJmkwutUPmB0skOj3GZJtlEGnlssems4AjkVweUPGj7jRwwqg0Hhg7++kPGJqKtTYx+R05Ftww372aIg==} engines: {node: ^18.18.0 || >=20.0.0} @@ -1342,16 +1294,6 @@ packages: typescript: optional: true - '@typescript-eslint/parser@7.14.1': - resolution: {integrity: sha512-8lKUOebNLcR0D7RvlcloOacTOWzOqemWEWkKSVpMZVF/XVcwjPR+3MD08QzbW9TCGJ+DwIc6zUSGZ9vd8cO1IA==} - engines: {node: ^18.18.0 || >=20.0.0} - peerDependencies: - eslint: ^8.56.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - '@typescript-eslint/parser@7.8.0': resolution: {integrity: sha512-KgKQly1pv0l4ltcftP59uQZCi4HUYswCLbTqVZEJu7uLX8CTLyswqMLqLN+2QFz4jCptqWVV4SB7vdxcH2+0kQ==} engines: {node: ^18.18.0 || >=20.0.0} @@ -1366,10 +1308,6 @@ packages: resolution: {integrity: sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - '@typescript-eslint/scope-manager@7.14.1': - resolution: {integrity: sha512-gPrFSsoYcsffYXTOZ+hT7fyJr95rdVe4kGVX1ps/dJ+DfmlnjFN/GcMxXcVkeHDKqsq6uAcVaQaIi3cFffmAbA==} - engines: {node: ^18.18.0 || >=20.0.0} - '@typescript-eslint/scope-manager@7.8.0': resolution: {integrity: sha512-viEmZ1LmwsGcnr85gIq+FCYI7nO90DVbE37/ll51hjv9aG+YZMb4WDE2fyWpUR4O/UrhGRpYXK/XajcGTk2B8g==} engines: {node: ^18.18.0 || >=20.0.0} @@ -1384,16 +1322,6 @@ packages: typescript: optional: true - '@typescript-eslint/type-utils@7.14.1': - resolution: {integrity: sha512-/MzmgNd3nnbDbOi3LfasXWWe292+iuo+umJ0bCCMCPc1jLO/z2BQmWUUUXvXLbrQey/JgzdF/OV+I5bzEGwJkQ==} - engines: {node: ^18.18.0 || >=20.0.0} - peerDependencies: - eslint: ^8.56.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - '@typescript-eslint/type-utils@7.8.0': resolution: {integrity: sha512-H70R3AefQDQpz9mGv13Uhi121FNMh+WEaRqcXTX09YEDky21km4dV1ZXJIp8QjXc4ZaVkXVdohvWDzbnbHDS+A==} engines: {node: ^18.18.0 || >=20.0.0} @@ -1408,10 +1336,6 @@ packages: resolution: {integrity: sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - '@typescript-eslint/types@7.14.1': - resolution: {integrity: sha512-mL7zNEOQybo5R3AavY+Am7KLv8BorIv7HCYS5rKoNZKQD9tsfGUpO4KdAn3sSUvTiS4PQkr2+K0KJbxj8H9NDg==} - engines: {node: ^18.18.0 || >=20.0.0} - '@typescript-eslint/types@7.8.0': resolution: {integrity: sha512-wf0peJ+ZGlcH+2ZS23aJbOv+ztjeeP8uQ9GgwMJGVLx/Nj9CJt17GWgWWoSmoRVKAX2X+7fzEnAjxdvK2gqCLw==} engines: {node: ^18.18.0 || >=20.0.0} @@ -1425,15 +1349,6 @@ packages: typescript: optional: true - '@typescript-eslint/typescript-estree@7.14.1': - resolution: {integrity: sha512-k5d0VuxViE2ulIO6FbxxSZaxqDVUyMbXcidC8rHvii0I56XZPv8cq+EhMns+d/EVIL41sMXqRbK3D10Oza1bbA==} - engines: {node: ^18.18.0 || >=20.0.0} - peerDependencies: - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - '@typescript-eslint/typescript-estree@7.8.0': resolution: {integrity: sha512-5pfUCOwK5yjPaJQNy44prjCwtr981dO8Qo9J9PwYXZ0MosgAbfEMB008dJ5sNo3+/BN6ytBPuSvXUg9SAqB0dg==} engines: {node: ^18.18.0 || >=20.0.0} @@ -1449,12 +1364,6 @@ packages: peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - '@typescript-eslint/utils@7.14.1': - resolution: {integrity: sha512-CMmVVELns3nak3cpJhZosDkm63n+DwBlDX8g0k4QUa9BMnF+lH2lr3d130M1Zt1xxmB3LLk3NV7KQCq86ZBBhQ==} - engines: {node: ^18.18.0 || >=20.0.0} - peerDependencies: - eslint: ^8.56.0 - '@typescript-eslint/utils@7.8.0': resolution: {integrity: sha512-L0yFqOCflVqXxiZyXrDr80lnahQfSOfc9ELAAZ75sqicqp2i36kEZZGuUymHNFoYOqxRT05up760b4iGsl02nQ==} engines: {node: ^18.18.0 || >=20.0.0} @@ -1465,10 +1374,6 @@ packages: resolution: {integrity: sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - '@typescript-eslint/visitor-keys@7.14.1': - resolution: {integrity: sha512-Crb+F75U1JAEtBeQGxSKwI60hZmmzaqA3z9sYsVm8X7W5cwLEm5bRe0/uXS6+MR/y8CVpKSR/ontIAIEPFcEkA==} - engines: {node: ^18.18.0 || >=20.0.0} - '@typescript-eslint/visitor-keys@7.8.0': resolution: {integrity: sha512-q4/gibTNBQNA0lGyYQCmWRS5D15n8rXh4QjK3KV+MBPlTYHpfBUT3D3PaPR/HeNiI9W6R7FvlkcGhNyAoP+caA==} engines: {node: ^18.18.0 || >=20.0.0} @@ -1489,12 +1394,6 @@ packages: peerDependencies: vite: ^4.2.0 || ^5.0.0 - '@vitejs/plugin-react@4.3.1': - resolution: {integrity: sha512-m/V2syj5CuVnaxcUJOQRel/Wr31FFXRFlnOoq1TVtkCxsY5veGMTEmpWHndrhB2U8ScHtCQB1e+4hWYExQc6Lg==} - engines: {node: ^14.18.0 || >=16.0.0} - peerDependencies: - vite: ^4.2.0 || ^5.0.0 - '@xterm/addon-canvas@0.7.0': resolution: {integrity: sha512-LF5LYcfvefJuJ7QotNRdRSPc9YASAVDeoT5uyXS/nZshZXjYplGXRECBGiznwvhNL2I8bq1Lf5MzRwstsYQ2Iw==} peerDependencies: @@ -1549,12 +1448,6 @@ packages: engines: {node: '>=0.4.0'} hasBin: true - ahooks@3.8.0: - resolution: {integrity: sha512-M01m+mxLRNNeJ/PCT3Fom26UyreTj6oMqJBetUrJnK4VNI5j6eMA543Xxo53OBXn6XibA2FXKcCCgrT6YCTtKQ==} - engines: {node: '>=8.0.0'} - peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - ajv@6.12.6: resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==} @@ -1674,6 +1567,9 @@ packages: resolution: {integrity: sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==} engines: {node: '>=8'} + boolbase@1.0.0: + resolution: {integrity: sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==} + brace-expansion@1.1.11: resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} @@ -1820,6 +1716,13 @@ packages: resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} engines: {node: '>= 8'} + css-select@4.3.0: + resolution: {integrity: sha512-wPpOYtnsVontu2mODhA19JrqWxNsfdatRKd64kmpRbQgh1KtItko5sTnEpPdpSaJszTOhEMlF/RPz28qj4HqhQ==} + + css-what@6.1.0: + resolution: {integrity: sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==} + engines: {node: '>= 6'} + cssesc@3.0.0: resolution: {integrity: sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==} engines: {node: '>=4'} @@ -1897,6 +1800,19 @@ packages: resolution: {integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==} engines: {node: '>=6.0.0'} + dom-serializer@1.4.1: + resolution: {integrity: sha512-VHwB3KfrcOOkelEG2ZOfxqLZdfkil8PtJi4P8N2MMXucZq2yLp75ClViUlOVwyoHEDjYU433Aq+5zWP61+RGag==} + + domelementtype@2.3.0: + resolution: {integrity: sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==} + + domhandler@4.3.1: + resolution: {integrity: sha512-GrwoxYN+uWlzO8uhUXRl0P+kHE4GtVPfYzVLcUxPL7KNdHKj66vvlhiweIHqYYXWlw+T8iLMp42Lm67ghw4WMQ==} + engines: {node: '>= 4'} + + domutils@2.8.0: + resolution: {integrity: sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A==} + dot-case@3.0.4: resolution: {integrity: sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==} @@ -1919,6 +1835,9 @@ packages: resolution: {integrity: sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==} engines: {node: '>=8.6'} + entities@2.2.0: + resolution: {integrity: sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==} + entities@4.5.0: resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==} engines: {node: '>=0.12'} @@ -2318,6 +2237,10 @@ packages: resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} engines: {node: '>= 0.4'} + he@1.2.0: + resolution: {integrity: sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==} + hasBin: true + html-parse-stringify@3.0.1: resolution: {integrity: sha512-KknJ50kTInJ7qIScF3jeaFRpMpE8/lfiTdzf/twXyPBLAGrLRTmkz3AdTnKeh40X8k9L2fdYwEp/42WGXIRGcg==} @@ -2370,6 +2293,7 @@ packages: inflight@1.0.6: resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} + deprecated: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. inherits@2.0.4: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} @@ -2378,9 +2302,6 @@ packages: resolution: {integrity: sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==} engines: {node: '>= 0.4'} - intersection-observer@0.12.2: - resolution: {integrity: sha512-7m1vEcPCxXYI8HqnL8CKI6siDyD+eIWSwgB3DZA+ZTogxk9I4CDnj4wilt9x/+/QbHI4YG5YZNmC6458/e9Ktg==} - invariant@2.2.4: resolution: {integrity: sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==} @@ -2546,9 +2467,6 @@ packages: js-base64@3.7.7: resolution: {integrity: sha512-7rCnleh0z2CkXhH67J8K1Ytz0b2Y+yxTPL+/KOJoa20hfnVQ/3/T6W/KflYI4bRHRagNeXeU2bkNGI3v1oS/lw==} - js-cookie@2.2.1: - resolution: {integrity: sha512-HvdH2LzI/EAZcUwA8+0nKNtWHqS+ZmijLA30RwZA0bo7ToCckjK5MkGhjED9KoRcXO6BaGI3I9UIzSA1FKFPOQ==} - js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} @@ -2786,6 +2704,9 @@ packages: no-case@3.0.4: resolution: {integrity: sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==} + node-html-parser@5.4.2: + resolution: {integrity: sha512-RaBPP3+51hPne/OolXxcz89iYvQvKOydaqoePpOgXcrOKZhjVIzmpKZz+Hd/RBO2/zN2q6CNJhQzucVz+u3Jyw==} + node-releases@2.0.14: resolution: {integrity: sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==} @@ -2805,6 +2726,9 @@ packages: resolution: {integrity: sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + nth-check@2.1.1: + resolution: {integrity: sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==} + object-assign@4.1.1: resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} engines: {node: '>=0.10.0'} @@ -3399,6 +3323,7 @@ packages: rimraf@3.0.2: resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} + deprecated: Rimraf versions prior to v4 are no longer supported hasBin: true rollup@4.17.2: @@ -3429,10 +3354,6 @@ packages: scheduler@0.23.2: resolution: {integrity: sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==} - screenfull@5.2.0: - resolution: {integrity: sha512-9BakfsO2aUQN2K9Fdbj87RJIEZ82Q9IGim7FqM5OsebfoFC6ZHXgDq/KvniuLTPdeM8wY2o6Dj3WQ7KeQCj3cA==} - engines: {node: '>=0.10.0'} - scroll-into-view-if-needed@3.1.0: resolution: {integrity: sha512-49oNpRjWRvnU8NyGVmUaYG4jtTkNonFZI86MmGRDqBphEK2EXT9gdEUoQPZhuBM8yWHxCWbobltqYO5M4XrUvQ==} @@ -3801,6 +3722,11 @@ packages: util-deprecate@1.0.2: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} + vite-plugin-dynamic-base@1.1.0: + resolution: {integrity: sha512-/hIOTuzedlPRiUTCIY1cJx7UDDUF0brxWIifE7xG1czCJy0Aw6k3QPbHVjPCs30YuU+WAgrX4ACOySLIp2NHkw==} + peerDependencies: + vite: '>= 2.9.5' + vite-plugin-svgr@4.2.0: resolution: {integrity: sha512-SC7+FfVtNQk7So0XMjrrtLAbEC8qjFPifyD7+fs/E6aaNdVde6umlVVh0QuwDLdOMu7vp5RiGFsB70nj5yo0XA==} peerDependencies: @@ -3834,34 +3760,6 @@ packages: terser: optional: true - vite@5.3.1: - resolution: {integrity: sha512-XBmSKRLXLxiaPYamLv3/hnP/KXDai1NDexN0FpkTaZXTfycHvkRHoenpgl/fvuK/kPbB6xAgoyiryAhQNxYmAQ==} - engines: {node: ^18.0.0 || >=20.0.0} - hasBin: true - peerDependencies: - '@types/node': ^18.0.0 || >=20.0.0 - less: '*' - lightningcss: ^1.21.0 - sass: '*' - stylus: '*' - sugarss: '*' - terser: ^5.4.0 - peerDependenciesMeta: - '@types/node': - optional: true - less: - optional: true - lightningcss: - optional: true - sass: - optional: true - stylus: - optional: true - sugarss: - optional: true - terser: - optional: true - void-elements@3.1.0: resolution: {integrity: sha512-Dhxzh5HZuiHQhbvTW9AMetFfBHDMYpo23Uo9btPXgdYP+3T5S+p+jgNy7spra+veYhBP2dCSgxR/i2Y02h5/6w==} engines: {node: '>=0.10.0'} @@ -4774,6 +4672,58 @@ snapshots: transitivePeerDependencies: - supports-color + '@swc/core-darwin-arm64@1.7.22': + optional: true + + '@swc/core-darwin-x64@1.7.22': + optional: true + + '@swc/core-linux-arm-gnueabihf@1.7.22': + optional: true + + '@swc/core-linux-arm64-gnu@1.7.22': + optional: true + + '@swc/core-linux-arm64-musl@1.7.22': + optional: true + + '@swc/core-linux-x64-gnu@1.7.22': + optional: true + + '@swc/core-linux-x64-musl@1.7.22': + optional: true + + '@swc/core-win32-arm64-msvc@1.7.22': + optional: true + + '@swc/core-win32-ia32-msvc@1.7.22': + optional: true + + '@swc/core-win32-x64-msvc@1.7.22': + optional: true + + '@swc/core@1.7.22': + dependencies: + '@swc/counter': 0.1.3 + '@swc/types': 0.1.12 + optionalDependencies: + '@swc/core-darwin-arm64': 1.7.22 + '@swc/core-darwin-x64': 1.7.22 + '@swc/core-linux-arm-gnueabihf': 1.7.22 + '@swc/core-linux-arm64-gnu': 1.7.22 + '@swc/core-linux-arm64-musl': 1.7.22 + '@swc/core-linux-x64-gnu': 1.7.22 + '@swc/core-linux-x64-musl': 1.7.22 + '@swc/core-win32-arm64-msvc': 1.7.22 + '@swc/core-win32-ia32-msvc': 1.7.22 + '@swc/core-win32-x64-msvc': 1.7.22 + + '@swc/counter@0.1.3': {} + + '@swc/types@0.1.12': + dependencies: + '@swc/counter': 0.1.3 + '@tanstack/query-core@5.36.0': {} '@tanstack/react-query@5.36.0(react@18.3.1)': @@ -4870,24 +4820,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/eslint-plugin@7.14.1(@typescript-eslint/parser@7.14.1(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5)': - dependencies: - '@eslint-community/regexpp': 4.10.0 - '@typescript-eslint/parser': 7.14.1(eslint@8.57.0)(typescript@5.4.5) - '@typescript-eslint/scope-manager': 7.14.1 - '@typescript-eslint/type-utils': 7.14.1(eslint@8.57.0)(typescript@5.4.5) - '@typescript-eslint/utils': 7.14.1(eslint@8.57.0)(typescript@5.4.5) - '@typescript-eslint/visitor-keys': 7.14.1 - eslint: 8.57.0 - graphemer: 1.4.0 - ignore: 5.3.1 - natural-compare: 1.4.0 - ts-api-utils: 1.3.0(typescript@5.4.5) - optionalDependencies: - typescript: 5.4.5 - transitivePeerDependencies: - - supports-color - '@typescript-eslint/eslint-plugin@7.8.0(@typescript-eslint/parser@7.8.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5)': dependencies: '@eslint-community/regexpp': 4.10.0 @@ -4920,19 +4852,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@7.14.1(eslint@8.57.0)(typescript@5.4.5)': - dependencies: - '@typescript-eslint/scope-manager': 7.14.1 - '@typescript-eslint/types': 7.14.1 - '@typescript-eslint/typescript-estree': 7.14.1(typescript@5.4.5) - '@typescript-eslint/visitor-keys': 7.14.1 - debug: 4.3.5 - eslint: 8.57.0 - optionalDependencies: - typescript: 5.4.5 - transitivePeerDependencies: - - supports-color - '@typescript-eslint/parser@7.8.0(eslint@8.57.0)(typescript@5.4.5)': dependencies: '@typescript-eslint/scope-manager': 7.8.0 @@ -4951,11 +4870,6 @@ snapshots: '@typescript-eslint/types': 5.62.0 '@typescript-eslint/visitor-keys': 5.62.0 - '@typescript-eslint/scope-manager@7.14.1': - dependencies: - '@typescript-eslint/types': 7.14.1 - '@typescript-eslint/visitor-keys': 7.14.1 - '@typescript-eslint/scope-manager@7.8.0': dependencies: '@typescript-eslint/types': 7.8.0 @@ -4973,18 +4887,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/type-utils@7.14.1(eslint@8.57.0)(typescript@5.4.5)': - dependencies: - '@typescript-eslint/typescript-estree': 7.14.1(typescript@5.4.5) - '@typescript-eslint/utils': 7.14.1(eslint@8.57.0)(typescript@5.4.5) - debug: 4.3.5 - eslint: 8.57.0 - ts-api-utils: 1.3.0(typescript@5.4.5) - optionalDependencies: - typescript: 5.4.5 - transitivePeerDependencies: - - supports-color - '@typescript-eslint/type-utils@7.8.0(eslint@8.57.0)(typescript@5.4.5)': dependencies: '@typescript-eslint/typescript-estree': 7.8.0(typescript@5.4.5) @@ -4999,8 +4901,6 @@ snapshots: '@typescript-eslint/types@5.62.0': {} - '@typescript-eslint/types@7.14.1': {} - '@typescript-eslint/types@7.8.0': {} '@typescript-eslint/typescript-estree@5.62.0(typescript@5.4.5)': @@ -5017,21 +4917,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/typescript-estree@7.14.1(typescript@5.4.5)': - dependencies: - '@typescript-eslint/types': 7.14.1 - '@typescript-eslint/visitor-keys': 7.14.1 - debug: 4.3.5 - globby: 11.1.0 - is-glob: 4.0.3 - minimatch: 9.0.4 - semver: 7.6.2 - ts-api-utils: 1.3.0(typescript@5.4.5) - optionalDependencies: - typescript: 5.4.5 - transitivePeerDependencies: - - supports-color - '@typescript-eslint/typescript-estree@7.8.0(typescript@5.4.5)': dependencies: '@typescript-eslint/types': 7.8.0 @@ -5062,17 +4947,6 @@ snapshots: - supports-color - typescript - '@typescript-eslint/utils@7.14.1(eslint@8.57.0)(typescript@5.4.5)': - dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) - '@typescript-eslint/scope-manager': 7.14.1 - '@typescript-eslint/types': 7.14.1 - '@typescript-eslint/typescript-estree': 7.14.1(typescript@5.4.5) - eslint: 8.57.0 - transitivePeerDependencies: - - supports-color - - typescript - '@typescript-eslint/utils@7.8.0(eslint@8.57.0)(typescript@5.4.5)': dependencies: '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) @@ -5092,11 +4966,6 @@ snapshots: '@typescript-eslint/types': 5.62.0 eslint-visitor-keys: 3.4.3 - '@typescript-eslint/visitor-keys@7.14.1': - dependencies: - '@typescript-eslint/types': 7.14.1 - eslint-visitor-keys: 3.4.3 - '@typescript-eslint/visitor-keys@7.8.0': dependencies: '@typescript-eslint/types': 7.8.0 @@ -5120,17 +4989,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@vitejs/plugin-react@4.3.1(vite@5.3.1(@types/node@20.12.11)(less@4.2.0))': - dependencies: - '@babel/core': 7.24.5 - '@babel/plugin-transform-react-jsx-self': 7.24.5(@babel/core@7.24.5) - '@babel/plugin-transform-react-jsx-source': 7.24.1(@babel/core@7.24.5) - '@types/babel__core': 7.20.5 - react-refresh: 0.14.2 - vite: 5.3.1(@types/node@20.12.11)(less@4.2.0) - transitivePeerDependencies: - - supports-color - '@xterm/addon-canvas@0.7.0(@xterm/xterm@5.5.0)': dependencies: '@xterm/xterm': 5.5.0 @@ -5174,19 +5032,6 @@ snapshots: acorn@8.11.3: {} - ahooks@3.8.0(react@18.3.1): - dependencies: - '@babel/runtime': 7.24.5 - dayjs: 1.11.11 - intersection-observer: 0.12.2 - js-cookie: 2.2.1 - lodash: 4.17.21 - react: 18.3.1 - react-fast-compare: 3.2.2 - resize-observer-polyfill: 1.5.1 - screenfull: 5.2.0 - tslib: 2.6.2 - ajv@6.12.6: dependencies: fast-deep-equal: 3.1.3 @@ -5367,9 +5212,9 @@ snapshots: dependencies: possible-typed-array-names: 1.0.0 - axios@1.6.8(debug@4.3.5): + axios@1.6.8: dependencies: - follow-redirects: 1.15.6(debug@4.3.5) + follow-redirects: 1.15.6 form-data: 4.0.0 proxy-from-env: 1.1.0 transitivePeerDependencies: @@ -5383,6 +5228,8 @@ snapshots: binary-extensions@2.3.0: {} + boolbase@1.0.0: {} + brace-expansion@1.1.11: dependencies: balanced-match: 1.0.2 @@ -5527,6 +5374,16 @@ snapshots: shebang-command: 2.0.0 which: 2.0.2 + css-select@4.3.0: + dependencies: + boolbase: 1.0.0 + css-what: 6.1.0 + domhandler: 4.3.1 + domutils: 2.8.0 + nth-check: 2.1.1 + + css-what@6.1.0: {} + cssesc@3.0.0: {} csstype@3.1.3: {} @@ -5593,6 +5450,24 @@ snapshots: dependencies: esutils: 2.0.3 + dom-serializer@1.4.1: + dependencies: + domelementtype: 2.3.0 + domhandler: 4.3.1 + entities: 2.2.0 + + domelementtype@2.3.0: {} + + domhandler@4.3.1: + dependencies: + domelementtype: 2.3.0 + + domutils@2.8.0: + dependencies: + dom-serializer: 1.4.1 + domelementtype: 2.3.0 + domhandler: 4.3.1 + dot-case@3.0.4: dependencies: no-case: 3.0.4 @@ -5613,6 +5488,8 @@ snapshots: ansi-colors: 4.1.3 strip-ansi: 6.0.1 + entities@2.2.0: {} + entities@4.5.0: {} errno@0.1.8: @@ -6002,9 +5879,7 @@ snapshots: flatted@3.3.1: {} - follow-redirects@1.15.6(debug@4.3.5): - optionalDependencies: - debug: 4.3.5 + follow-redirects@1.15.6: {} font-finder@1.1.0: dependencies: @@ -6165,6 +6040,8 @@ snapshots: dependencies: function-bind: 1.1.2 + he@1.2.0: {} + html-parse-stringify@3.0.1: dependencies: void-elements: 3.1.0 @@ -6217,8 +6094,6 @@ snapshots: hasown: 2.0.2 side-channel: 1.0.6 - intersection-observer@0.12.2: {} - invariant@2.2.4: dependencies: loose-envify: 1.4.0 @@ -6365,8 +6240,6 @@ snapshots: js-base64@3.7.7: {} - js-cookie@2.2.1: {} - js-tokens@4.0.0: {} js-yaml@3.14.1: @@ -6620,6 +6493,11 @@ snapshots: lower-case: 2.0.2 tslib: 2.6.2 + node-html-parser@5.4.2: + dependencies: + css-select: 4.3.0 + he: 1.2.0 + node-releases@2.0.14: {} normalize-path@3.0.0: {} @@ -6634,6 +6512,10 @@ snapshots: dependencies: path-key: 4.0.0 + nth-check@2.1.1: + dependencies: + boolbase: 1.0.0 + object-assign@4.1.1: {} object-hash@3.0.0: {} @@ -7338,8 +7220,6 @@ snapshots: dependencies: loose-envify: 1.4.0 - screenfull@5.2.0: {} - scroll-into-view-if-needed@3.1.0: dependencies: compute-scroll-into-view: 3.1.0 @@ -7610,7 +7490,7 @@ snapshots: tslib@2.6.2: {} - tsup@8.1.0(postcss@8.4.38)(typescript@5.4.5): + tsup@8.1.0(@swc/core@1.7.22)(postcss@8.4.38)(typescript@5.4.5): dependencies: bundle-require: 4.2.1(esbuild@0.21.5) cac: 6.7.14 @@ -7627,6 +7507,7 @@ snapshots: sucrase: 3.35.0 tree-kill: 1.2.2 optionalDependencies: + '@swc/core': 1.7.22 postcss: 8.4.38 typescript: 5.4.5 transitivePeerDependencies: @@ -7744,23 +7625,20 @@ snapshots: util-deprecate@1.0.2: {} - vite-plugin-svgr@4.2.0(rollup@4.17.2)(typescript@5.4.5)(vite@5.2.11(@types/node@20.12.11)(less@4.2.0)): + vite-plugin-dynamic-base@1.1.0(vite@5.2.11(@types/node@20.12.11)(less@4.2.0)): dependencies: - '@rollup/pluginutils': 5.1.0(rollup@4.17.2) - '@svgr/core': 8.1.0(typescript@5.4.5) - '@svgr/plugin-jsx': 8.1.0(@svgr/core@8.1.0(typescript@5.4.5)) + '@swc/core': 1.7.22 + node-html-parser: 5.4.2 vite: 5.2.11(@types/node@20.12.11)(less@4.2.0) transitivePeerDependencies: - - rollup - - supports-color - - typescript + - '@swc/helpers' - vite-plugin-svgr@4.2.0(rollup@4.17.2)(typescript@5.4.5)(vite@5.3.1(@types/node@20.12.11)(less@4.2.0)): + vite-plugin-svgr@4.2.0(rollup@4.17.2)(typescript@5.4.5)(vite@5.2.11(@types/node@20.12.11)(less@4.2.0)): dependencies: '@rollup/pluginutils': 5.1.0(rollup@4.17.2) '@svgr/core': 8.1.0(typescript@5.4.5) '@svgr/plugin-jsx': 8.1.0(@svgr/core@8.1.0(typescript@5.4.5)) - vite: 5.3.1(@types/node@20.12.11)(less@4.2.0) + vite: 5.2.11(@types/node@20.12.11)(less@4.2.0) transitivePeerDependencies: - rollup - supports-color @@ -7776,16 +7654,6 @@ snapshots: fsevents: 2.3.3 less: 4.2.0 - vite@5.3.1(@types/node@20.12.11)(less@4.2.0): - dependencies: - esbuild: 0.21.5 - postcss: 8.4.38 - rollup: 4.17.2 - optionalDependencies: - '@types/node': 20.12.11 - fsevents: 2.3.3 - less: 4.2.0 - void-elements@3.1.0: {} vscode-jsonrpc@8.2.0: {} From e14222a95164456753842d4348644fd451eb2622 Mon Sep 17 00:00:00 2001 From: warjiang <1096409085@qq.com> Date: Mon, 2 Sep 2024 15:13:41 +0800 Subject: [PATCH 2/4] feat: use pathPrefix in react-router and axios Signed-off-by: warjiang <1096409085@qq.com> --- ui/apps/dashboard/src/routes/index.tsx | 5 ++++- ui/apps/dashboard/src/services/base.ts | 14 +++++++++++--- ui/apps/dashboard/src/vite-env.d.ts | 3 +++ 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/ui/apps/dashboard/src/routes/index.tsx b/ui/apps/dashboard/src/routes/index.tsx index 4af7a015..664bd529 100644 --- a/ui/apps/dashboard/src/routes/index.tsx +++ b/ui/apps/dashboard/src/routes/index.tsx @@ -1,8 +1,11 @@ import { createBrowserRouter, RouterProvider } from 'react-router-dom'; import { routes } from './route.tsx'; +import { routerBase } from '@/services/base'; -const router = createBrowserRouter(routes); +const router = createBrowserRouter(routes, { + basename: routerBase, +}); export default function Router() { return ; } diff --git a/ui/apps/dashboard/src/services/base.ts b/ui/apps/dashboard/src/services/base.ts index afc31ba2..d63b2b7e 100644 --- a/ui/apps/dashboard/src/services/base.ts +++ b/ui/apps/dashboard/src/services/base.ts @@ -1,6 +1,16 @@ import axios from 'axios'; +import _ from 'lodash'; + +let pathPrefix = window.__path_prefix__ || ''; +if (!pathPrefix.startsWith('/')) { + pathPrefix = '/' + pathPrefix; +} +if (!pathPrefix.endsWith('/')) { + pathPrefix = pathPrefix + '/'; +} +export const routerBase = pathPrefix; +const baseURL: string = _.join([pathPrefix, 'api/v1'], ''); -const baseURL: string = '/api/v1'; export const karmadaClient = axios.create({ baseURL, }); @@ -76,5 +86,3 @@ export const extractPropagationPolicy = (r: { objectMeta: ObjectMeta }) => { } return r?.objectMeta?.annotations?.[propagationpolicyKey]; }; - - diff --git a/ui/apps/dashboard/src/vite-env.d.ts b/ui/apps/dashboard/src/vite-env.d.ts index 11f02fe2..8a05bc7e 100644 --- a/ui/apps/dashboard/src/vite-env.d.ts +++ b/ui/apps/dashboard/src/vite-env.d.ts @@ -1 +1,4 @@ /// +interface Window { + __path_prefix__: string; +} From e462c782d85b2d2cfd5b2a19d9d075729c353883 Mon Sep 17 00:00:00 2001 From: warjiang <1096409085@qq.com> Date: Mon, 2 Sep 2024 20:57:59 +0800 Subject: [PATCH 3/4] feat: adapt to scene of pathPrefix Signed-off-by: warjiang <1096409085@qq.com> --- cmd/web/app/options/options.go | 2 ++ cmd/web/app/web.go | 16 +++++++++++----- go.mod | 2 +- pkg/config/config.go | 21 +++++++++++++++++++++ pkg/config/model.go | 1 + 5 files changed, 36 insertions(+), 6 deletions(-) diff --git a/cmd/web/app/options/options.go b/cmd/web/app/options/options.go index 7cb4aed1..a46a7964 100644 --- a/cmd/web/app/options/options.go +++ b/cmd/web/app/options/options.go @@ -15,6 +15,7 @@ type Options struct { I18nDir string EnableApiProxy bool ApiProxyEndpoint string + DashboardConfigPath string } func NewOptions() *Options { @@ -34,4 +35,5 @@ func (o *Options) AddFlags(fs *pflag.FlagSet) { fs.StringVar(&o.I18nDir, "i18n-dir", "./i18n", "directory to serve i18n files") fs.BoolVar(&o.EnableApiProxy, "enable-api-proxy", true, "whether enable proxy to karmada-dashboard-api, if set true, all requests with /api prefix will be proxyed to karmada-dashboard-api.karmada-system.svc.cluster.local") fs.StringVar(&o.ApiProxyEndpoint, "api-proxy-endpoint", "http://karmada-dashboard-api.karmada-system.svc.cluster.local:8000", "karmada-dashboard-api endpoint") + fs.StringVar(&o.DashboardConfigPath, "dashboard-config-path", "./config/dashboard-config.yaml", "path to dashboard config file") } diff --git a/cmd/web/app/web.go b/cmd/web/app/web.go index c282546b..c0ff3715 100644 --- a/cmd/web/app/web.go +++ b/cmd/web/app/web.go @@ -6,6 +6,7 @@ import ( "github.com/gin-gonic/gin" "github.com/karmada-io/dashboard/cmd/api/app/router" "github.com/karmada-io/dashboard/cmd/web/app/options" + "github.com/karmada-io/dashboard/pkg/config" "github.com/karmada-io/dashboard/pkg/environment" "github.com/karmada-io/karmada/pkg/sharedcli/klogflag" "github.com/spf13/cobra" @@ -17,9 +18,10 @@ import ( "net/url" "os" "path" + "strings" ) -// NewApiCommand creates a *cobra.Command object with default parameters +// NewWebCommand creates a *cobra.Command object with default parameters func NewWebCommand(ctx context.Context) *cobra.Command { opts := options.NewOptions() cmd := &cobra.Command{ @@ -60,7 +62,7 @@ func NewWebCommand(ctx context.Context) *cobra.Command { func run(ctx context.Context, opts *options.Options) error { klog.InfoS("Starting Karmada Dashboard API", "version", environment.Version) - + config.InitDashboardConfigFromMountFile(opts.DashboardConfigPath) serve(opts) select { case <-ctx.Done(): @@ -72,12 +74,15 @@ func run(ctx context.Context, opts *options.Options) error { func serve(opts *options.Options) { insecureAddress := fmt.Sprintf("%s:%d", opts.InsecureBindAddress, opts.InsecurePort) klog.V(1).InfoS("Listening and serving on", "address", insecureAddress) + pathPrefix := config.GetDashboardConfig().PathPrefix + klog.V(1).Infof("PathPrefix is:%s", pathPrefix) go func() { r := router.Router() - r.StaticFS("/static", http.Dir(opts.StaticDir)) + g := r.Group(pathPrefix) + g.StaticFS("/static", http.Dir(opts.StaticDir)) if opts.EnableApiProxy { // https://karmada-apiserver.karmada-system.svc.cluster.local:5443 - r.Any("/api/*path", func(c *gin.Context) { + g.Any("/api/*path", func(c *gin.Context) { remote, _ := url.Parse(opts.ApiProxyEndpoint) proxy := httputil.NewSingleHostReverseProxy(remote) proxy.Director = func(req *http.Request) { @@ -85,6 +90,7 @@ func serve(opts *options.Options) { req.Host = remote.Host req.URL.Scheme = remote.Scheme req.URL.Host = remote.Host + req.URL.Path = strings.TrimPrefix(req.URL.Path, pathPrefix) } proxy.ServeHTTP(c.Writer, c.Request) }) @@ -92,7 +98,7 @@ func serve(opts *options.Options) { // TODO: // currently we only mock the return i18n json, this feature will be implemented by ospp2024 // https://summer-ospp.ac.cn/org/prodetail/245c40338?lang=zh&list=pro - r.GET("/i18n/*path", func(c *gin.Context) { + g.GET("/i18n/*path", func(c *gin.Context) { c.JSON(http.StatusOK, gin.H{}) }) r.NoRoute(func(c *gin.Context) { diff --git a/go.mod b/go.mod index 5a36311e..8f6ef96b 100644 --- a/go.mod +++ b/go.mod @@ -11,6 +11,7 @@ require ( github.com/samber/lo v1.39.0 github.com/spf13/cobra v1.8.0 github.com/spf13/pflag v1.0.5 + gopkg.in/yaml.v3 v3.0.1 k8s.io/api v0.28.5 k8s.io/apimachinery v0.28.5 k8s.io/client-go v0.28.5 @@ -103,7 +104,6 @@ require ( google.golang.org/protobuf v1.31.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect k8s.io/apiextensions-apiserver v0.28.5 // indirect k8s.io/apiserver v0.28.5 // indirect k8s.io/cli-runtime v0.28.5 // indirect diff --git a/pkg/config/config.go b/pkg/config/config.go index 556343f4..2c0c6d9d 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -86,6 +86,7 @@ func GetDashboardConfig() DashboardConfig { DockerRegistries: dashboardConfig.DockerRegistries, ChartRegistries: dashboardConfig.ChartRegistries, MenuConfigs: dashboardConfig.MenuConfigs, + PathPrefix: dashboardConfig.PathPrefix, } } @@ -110,3 +111,23 @@ func UpdateDashboardConfig(k8sClient kubernetes.Interface, newDashboardConfig Da } return nil } + +func InitDashboardConfigFromMountFile(mountPath string) error { + _, err := os.Stat(mountPath) + if os.IsNotExist(err) { + return fmt.Errorf("%s not exist", mountPath) + } + content, err := os.ReadFile(mountPath) + if err != nil { + return err + } + + var tmpConfig DashboardConfig + if err = yaml.Unmarshal(content, &tmpConfig); err != nil { + klog.Errorf("Failed to unmarshal from content %v", err) + return err + } else { + dashboardConfig = tmpConfig + return nil + } +} diff --git a/pkg/config/model.go b/pkg/config/model.go index 8f8faf52..91e53dbf 100644 --- a/pkg/config/model.go +++ b/pkg/config/model.go @@ -27,4 +27,5 @@ type DashboardConfig struct { DockerRegistries []DockerRegistry `yaml:"docker_registries" json:"docker_registries"` ChartRegistries []ChartRegistry `yaml:"chart_registries" json:"chart_registries"` MenuConfigs []MenuConfig `yaml:"menu_configs" json:"menu_configs"` + PathPrefix string `yaml:"path_prefix" json:"path_prefix"` } From 3059699bcf214d67300e19e8b8538e51d2263f7b Mon Sep 17 00:00:00 2001 From: warjiang <1096409085@qq.com> Date: Mon, 2 Sep 2024 21:33:07 +0800 Subject: [PATCH 4/4] feat: use pathPrefix placeholder Signed-off-by: warjiang <1096409085@qq.com> --- cmd/web/app/web.go | 1 + ui/apps/dashboard/index.html | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/web/app/web.go b/cmd/web/app/web.go index c0ff3715..da83f874 100644 --- a/cmd/web/app/web.go +++ b/cmd/web/app/web.go @@ -109,6 +109,7 @@ func serve(opts *options.Options) { buff, readAllErr := io.ReadAll(f) if readAllErr == nil { indexHtml = string(buff) + indexHtml = strings.ReplaceAll(indexHtml, "{{PathPrefix}}", pathPrefix) } } c.Header("Content-Type", "text/html; charset=utf-8") diff --git a/ui/apps/dashboard/index.html b/ui/apps/dashboard/index.html index 60a40ff1..ea569b7d 100644 --- a/ui/apps/dashboard/index.html +++ b/ui/apps/dashboard/index.html @@ -8,7 +8,7 @@