From eb026efb003adfa80e845e2b9691e07991098307 Mon Sep 17 00:00:00 2001 From: xiaokang Date: Fri, 12 Apr 2024 17:09:36 +0800 Subject: [PATCH] feat: import worker with url --- web/components/chat/OBEditor/ob-plugin.ts | 13 - web/components/chat/completion.tsx | 2 +- web/components/chat/db-editor.tsx | 2 +- .../chat/{OBEditor => }/monaco-editor.tsx | 9 +- web/components/chat/ob-editor/ob-plugin.ts | 31 ++ .../chat/{OBEditor => ob-editor}/service.ts | 3 +- .../chat/{OBEditor => ob-editor}/theme.ts | 0 web/next.config.js | 14 +- web/package-lock.json | 364 ++++++++++++++++-- web/package.json | 3 +- 10 files changed, 391 insertions(+), 50 deletions(-) delete mode 100644 web/components/chat/OBEditor/ob-plugin.ts rename web/components/chat/{OBEditor => }/monaco-editor.tsx (90%) create mode 100644 web/components/chat/ob-editor/ob-plugin.ts rename web/components/chat/{OBEditor => ob-editor}/service.ts (88%) rename web/components/chat/{OBEditor => ob-editor}/theme.ts (100%) diff --git a/web/components/chat/OBEditor/ob-plugin.ts b/web/components/chat/OBEditor/ob-plugin.ts deleted file mode 100644 index 56ec2ac13..000000000 --- a/web/components/chat/OBEditor/ob-plugin.ts +++ /dev/null @@ -1,13 +0,0 @@ - -import Plugin from '@oceanbase-odc/monaco-plugin-ob'; - -let plugin: Plugin; - -export function register(): Plugin { - if (plugin) { - return plugin; - } - plugin = new Plugin(); - plugin.setup(); - return plugin; -} diff --git a/web/components/chat/completion.tsx b/web/components/chat/completion.tsx index 7a0f7adff..ce72a3c8a 100644 --- a/web/components/chat/completion.tsx +++ b/web/components/chat/completion.tsx @@ -1,6 +1,6 @@ import { useState, useRef, useEffect, useMemo, useContext } from 'react'; import { useSearchParams } from 'next/navigation'; -import MonacoEditor from './OBEditor/monaco-editor'; +import MonacoEditor from './monaco-editor'; import ChatContent from './chat-content'; import ChatFeedback from './chat-feedback'; import { ChatContext } from '@/app/chat-context'; diff --git a/web/components/chat/db-editor.tsx b/web/components/chat/db-editor.tsx index 27823ff52..b790f6954 100644 --- a/web/components/chat/db-editor.tsx +++ b/web/components/chat/db-editor.tsx @@ -4,7 +4,7 @@ import { Button, Select, Table, Tooltip } from 'antd'; import { Input, Tree } from 'antd'; import Icon from '@ant-design/icons'; import type { DataNode } from 'antd/es/tree'; -import MonacoEditor, { ISession } from './OBEditor/monaco-editor'; +import MonacoEditor, { ISession } from './monaco-editor'; import { sendGetRequest, sendSpacePostRequest } from '@/utils/request'; import { useSearchParams } from 'next/navigation'; import { OnChange } from '@monaco-editor/react'; diff --git a/web/components/chat/OBEditor/monaco-editor.tsx b/web/components/chat/monaco-editor.tsx similarity index 90% rename from web/components/chat/OBEditor/monaco-editor.tsx rename to web/components/chat/monaco-editor.tsx index bfe90f90a..1263d2eb2 100644 --- a/web/components/chat/OBEditor/monaco-editor.tsx +++ b/web/components/chat/monaco-editor.tsx @@ -3,10 +3,11 @@ import Editor, { OnChange, loader } from '@monaco-editor/react'; import classNames from 'classnames'; import { useContext, useMemo } from 'react'; import { formatSql } from '@/utils'; -import { getModelService } from './service'; +import { getModelService } from './ob-editor/service'; import { useLatest } from 'ahooks'; import { ChatContext } from '@/app/chat-context'; -import { github, githubDark } from './theme'; +import { github, githubDark } from './ob-editor/theme'; +import { register } from './ob-editor/ob-plugin'; loader.config({ monaco }); @@ -47,9 +48,7 @@ export default function MonacoEditor({ className, value, language = 'mysql', onC const context = useContext(ChatContext); async function pluginRegister(editor: monaco.editor.IStandaloneCodeEditor) { - console.log('register plugin'); - const module = await import('./ob-plugin'); - const plugin = module.register(); + const plugin = await register() plugin.setModelOptions( editor.getModel()?.id || '', getModelService({ diff --git a/web/components/chat/ob-editor/ob-plugin.ts b/web/components/chat/ob-editor/ob-plugin.ts new file mode 100644 index 000000000..099b3f2a7 --- /dev/null +++ b/web/components/chat/ob-editor/ob-plugin.ts @@ -0,0 +1,31 @@ + +import type Plugin from '@oceanbase-odc/monaco-plugin-ob'; + +let plugin: Plugin; + +export async function register(): Promise { + window.obMonaco = { + getWorkerUrl: (type: string) => { + switch (type) { + case 'mysql': { + return location.origin + '/_next/static/ob-workers/mysql.js' + } + case 'obmysql': { + return location.origin + '/_next/static/ob-workers/obmysql.js' + } + case 'oboracle': { + return location.origin + '/_next/static/ob-workers/oracle.js' + } + } + return ""; + } + } + const module = await import('@oceanbase-odc/monaco-plugin-ob') + const Plugin = module.default; + if (plugin) { + return plugin; + } + plugin = new Plugin(); + plugin.setup(["mysql"]); + return plugin; +} diff --git a/web/components/chat/OBEditor/service.ts b/web/components/chat/ob-editor/service.ts similarity index 88% rename from web/components/chat/OBEditor/service.ts rename to web/components/chat/ob-editor/service.ts index 996c5193e..21f1b182b 100644 --- a/web/components/chat/OBEditor/service.ts +++ b/web/components/chat/ob-editor/service.ts @@ -1,5 +1,5 @@ import type { IModelOptions } from '@oceanbase-odc/monaco-plugin-ob/dist/type'; -import { ISession } from './monaco-editor'; +import { ISession } from '../monaco-editor'; export function getModelService( @@ -9,7 +9,6 @@ export function getModelService( return { delimiter, async getTableList(schemaName?: string) { - console.log('getTableList') return session?.()?.getTableList(schemaName) || [] }, async getTableColumns(tableName: string, dbName?: string) { diff --git a/web/components/chat/OBEditor/theme.ts b/web/components/chat/ob-editor/theme.ts similarity index 100% rename from web/components/chat/OBEditor/theme.ts rename to web/components/chat/ob-editor/theme.ts diff --git a/web/next.config.js b/web/next.config.js index 3afa547fb..045195e6d 100644 --- a/web/next.config.js +++ b/web/next.config.js @@ -1,5 +1,7 @@ /** @type {import('next').NextConfig} */ +const CopyPlugin = require('copy-webpack-plugin'); const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin'); +const path = require('path'); const nextConfig = { output: 'export', experimental: { @@ -13,11 +15,19 @@ const nextConfig = { }, trailingSlash: true, images: { unoptimized: true }, - webpack5: true, webpack: (config, { isServer }) => { config.resolve.fallback = { fs: false }; if (!isServer) { - + config.plugins.push( + new CopyPlugin({ + patterns: [ + { + from: path.join(__dirname, 'node_modules/@oceanbase-odc/monaco-plugin-ob/worker-dist/'), + to: 'static/ob-workers' + }, + ], + }) + ) // 添加 monaco-editor-webpack-plugin 插件 config.plugins.push( new MonacoWebpackPlugin({ diff --git a/web/package-lock.json b/web/package-lock.json index 35db160a4..ee9457239 100644 --- a/web/package-lock.json +++ b/web/package-lock.json @@ -18,7 +18,7 @@ "@monaco-editor/react": "^4.5.2", "@mui/icons-material": "^5.11.16", "@mui/joy": "5.0.0-beta.5", - "@oceanbase-odc/monaco-plugin-ob": "^0.2.2", + "@oceanbase-odc/monaco-plugin-ob": "^1.0.3", "ahooks": "^3.7.8", "antd": "^5.6.2", "axios": "^1.3.4", @@ -51,6 +51,7 @@ "@types/react-dom": "18.2.6", "@types/react-syntax-highlighter": "^15.5.7", "autoprefixer": "10.4.14", + "copy-webpack-plugin": "^12.0.2", "eslint": "8.43.0", "eslint-config-next": "13.4.7", "monaco-editor-webpack-plugin": "^7.1.0" @@ -2284,9 +2285,9 @@ } }, "node_modules/@oceanbase-odc/monaco-plugin-ob": { - "version": "0.2.2", - "resolved": "https://registry.npmmirror.com/@oceanbase-odc/monaco-plugin-ob/-/monaco-plugin-ob-0.2.2.tgz", - "integrity": "sha512-FjewRgoTQWfq4yPrxio3gHvEUomXM+Erybcc3m0aDYLwoa/sObwswy99zL1kjxQC8DCxFsFrRuKVFQgAS/jINQ==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@oceanbase-odc/monaco-plugin-ob/-/monaco-plugin-ob-1.0.3.tgz", + "integrity": "sha512-ZsawSfPmpqLthX8t0X2s02/Dkrf9ynbMtSLAXzeCey21+g7x7zqdPK28hWK0IZoJzVOucLqLeRqWlqTdMDqURA==", "dependencies": { "@oceanbase-odc/ob-parser-js": "^3", "antlr4": "~4.8.0", @@ -2565,6 +2566,18 @@ "integrity": "sha512-0xd7qez0AQ+MbHatZTlI1gu5vkG8r7MYRUJAHPAHJBmGLs16zpkrpAVLvjQKQOqaXPDUBwOiJzNc00znHSCVBw==", "dev": true }, + "node_modules/@sindresorhus/merge-streams": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/merge-streams/-/merge-streams-2.3.0.tgz", + "integrity": "sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==", + "dev": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/@swc/helpers": { "version": "0.5.1", "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.1.tgz", @@ -2859,8 +2872,7 @@ "version": "7.0.15", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", - "dev": true, - "peer": true + "dev": true }, "node_modules/@types/json5": { "version": "0.0.29", @@ -3355,6 +3367,45 @@ "url": "https://github.com/sponsors/epoberezkin" } }, + "node_modules/ajv-formats": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.1.tgz", + "integrity": "sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==", + "dev": true, + "dependencies": { + "ajv": "^8.0.0" + }, + "peerDependencies": { + "ajv": "^8.0.0" + }, + "peerDependenciesMeta": { + "ajv": { + "optional": true + } + } + }, + "node_modules/ajv-formats/node_modules/ajv": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", + "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ajv-formats/node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true + }, "node_modules/ajv-keywords": { "version": "3.5.2", "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", @@ -4180,6 +4231,127 @@ "toggle-selection": "^1.0.6" } }, + "node_modules/copy-webpack-plugin": { + "version": "12.0.2", + "resolved": "https://registry.npmjs.org/copy-webpack-plugin/-/copy-webpack-plugin-12.0.2.tgz", + "integrity": "sha512-SNwdBeHyII+rWvee/bTnAYyO8vfVdcSTud4EIb6jcZ8inLeWucJE0DnxXQBjlQ5zlteuuvooGQy3LIyGxhvlOA==", + "dev": true, + "dependencies": { + "fast-glob": "^3.3.2", + "glob-parent": "^6.0.1", + "globby": "^14.0.0", + "normalize-path": "^3.0.0", + "schema-utils": "^4.2.0", + "serialize-javascript": "^6.0.2" + }, + "engines": { + "node": ">= 18.12.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "webpack": "^5.1.0" + } + }, + "node_modules/copy-webpack-plugin/node_modules/ajv": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", + "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/copy-webpack-plugin/node_modules/ajv-keywords": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz", + "integrity": "sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.3" + }, + "peerDependencies": { + "ajv": "^8.8.2" + } + }, + "node_modules/copy-webpack-plugin/node_modules/globby": { + "version": "14.0.1", + "resolved": "https://registry.npmjs.org/globby/-/globby-14.0.1.tgz", + "integrity": "sha512-jOMLD2Z7MAhyG8aJpNOpmziMOP4rPLcc95oQPKXBazW82z+CEgPFBQvEpRUa1KeIMUJo4Wsm+q6uzO/Q/4BksQ==", + "dev": true, + "dependencies": { + "@sindresorhus/merge-streams": "^2.1.0", + "fast-glob": "^3.3.2", + "ignore": "^5.2.4", + "path-type": "^5.0.0", + "slash": "^5.1.0", + "unicorn-magic": "^0.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/copy-webpack-plugin/node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true + }, + "node_modules/copy-webpack-plugin/node_modules/path-type": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-5.0.0.tgz", + "integrity": "sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/copy-webpack-plugin/node_modules/schema-utils": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.2.0.tgz", + "integrity": "sha512-L0jRsrPpjdckP3oPug3/VxNKt2trR8TcabrM6FOAAlvC/9Phcmm+cuAgTlxBqdBR1WJx7Naj9WHw+aOmheSVbw==", + "dev": true, + "dependencies": { + "@types/json-schema": "^7.0.9", + "ajv": "^8.9.0", + "ajv-formats": "^2.1.1", + "ajv-keywords": "^5.1.0" + }, + "engines": { + "node": ">= 12.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, + "node_modules/copy-webpack-plugin/node_modules/slash": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-5.1.0.tgz", + "integrity": "sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==", + "dev": true, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/cosmiconfig": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.1.0.tgz", @@ -5373,9 +5545,9 @@ "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" }, "node_modules/fast-glob": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.1.tgz", - "integrity": "sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", @@ -8643,7 +8815,6 @@ "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", "dev": true, - "peer": true, "dependencies": { "safe-buffer": "^5.1.0" } @@ -9559,6 +9730,15 @@ "node": ">=0.10" } }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/resize-observer-polyfill": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/resize-observer-polyfill/-/resize-observer-polyfill-1.5.1.tgz", @@ -9785,8 +9965,7 @@ "type": "consulting", "url": "https://feross.org/support" } - ], - "peer": true + ] }, "node_modules/safe-regex-test": { "version": "1.0.0", @@ -9866,7 +10045,6 @@ "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", "dev": true, - "peer": true, "dependencies": { "randombytes": "^2.1.0" } @@ -10676,6 +10854,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/unicorn-magic": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.1.0.tgz", + "integrity": "sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==", + "dev": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/unified": { "version": "10.1.2", "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.2.tgz", @@ -13139,9 +13329,9 @@ } }, "@oceanbase-odc/monaco-plugin-ob": { - "version": "0.2.2", - "resolved": "https://registry.npmmirror.com/@oceanbase-odc/monaco-plugin-ob/-/monaco-plugin-ob-0.2.2.tgz", - "integrity": "sha512-FjewRgoTQWfq4yPrxio3gHvEUomXM+Erybcc3m0aDYLwoa/sObwswy99zL1kjxQC8DCxFsFrRuKVFQgAS/jINQ==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@oceanbase-odc/monaco-plugin-ob/-/monaco-plugin-ob-1.0.3.tgz", + "integrity": "sha512-ZsawSfPmpqLthX8t0X2s02/Dkrf9ynbMtSLAXzeCey21+g7x7zqdPK28hWK0IZoJzVOucLqLeRqWlqTdMDqURA==", "requires": { "@oceanbase-odc/ob-parser-js": "^3", "antlr4": "~4.8.0", @@ -13347,6 +13537,12 @@ "integrity": "sha512-0xd7qez0AQ+MbHatZTlI1gu5vkG8r7MYRUJAHPAHJBmGLs16zpkrpAVLvjQKQOqaXPDUBwOiJzNc00znHSCVBw==", "dev": true }, + "@sindresorhus/merge-streams": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/merge-streams/-/merge-streams-2.3.0.tgz", + "integrity": "sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==", + "dev": true + }, "@swc/helpers": { "version": "0.5.1", "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.1.tgz", @@ -13641,8 +13837,7 @@ "version": "7.0.15", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", - "dev": true, - "peer": true + "dev": true }, "@types/json5": { "version": "0.0.29", @@ -14062,6 +14257,35 @@ "uri-js": "^4.2.2" } }, + "ajv-formats": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.1.tgz", + "integrity": "sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==", + "dev": true, + "requires": { + "ajv": "^8.0.0" + }, + "dependencies": { + "ajv": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", + "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + } + }, + "json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true + } + } + }, "ajv-keywords": { "version": "3.5.2", "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", @@ -14679,6 +14903,87 @@ "toggle-selection": "^1.0.6" } }, + "copy-webpack-plugin": { + "version": "12.0.2", + "resolved": "https://registry.npmjs.org/copy-webpack-plugin/-/copy-webpack-plugin-12.0.2.tgz", + "integrity": "sha512-SNwdBeHyII+rWvee/bTnAYyO8vfVdcSTud4EIb6jcZ8inLeWucJE0DnxXQBjlQ5zlteuuvooGQy3LIyGxhvlOA==", + "dev": true, + "requires": { + "fast-glob": "^3.3.2", + "glob-parent": "^6.0.1", + "globby": "^14.0.0", + "normalize-path": "^3.0.0", + "schema-utils": "^4.2.0", + "serialize-javascript": "^6.0.2" + }, + "dependencies": { + "ajv": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", + "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + } + }, + "ajv-keywords": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz", + "integrity": "sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.3" + } + }, + "globby": { + "version": "14.0.1", + "resolved": "https://registry.npmjs.org/globby/-/globby-14.0.1.tgz", + "integrity": "sha512-jOMLD2Z7MAhyG8aJpNOpmziMOP4rPLcc95oQPKXBazW82z+CEgPFBQvEpRUa1KeIMUJo4Wsm+q6uzO/Q/4BksQ==", + "dev": true, + "requires": { + "@sindresorhus/merge-streams": "^2.1.0", + "fast-glob": "^3.3.2", + "ignore": "^5.2.4", + "path-type": "^5.0.0", + "slash": "^5.1.0", + "unicorn-magic": "^0.1.0" + } + }, + "json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true + }, + "path-type": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-5.0.0.tgz", + "integrity": "sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==", + "dev": true + }, + "schema-utils": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.2.0.tgz", + "integrity": "sha512-L0jRsrPpjdckP3oPug3/VxNKt2trR8TcabrM6FOAAlvC/9Phcmm+cuAgTlxBqdBR1WJx7Naj9WHw+aOmheSVbw==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.9", + "ajv": "^8.9.0", + "ajv-formats": "^2.1.1", + "ajv-keywords": "^5.1.0" + } + }, + "slash": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-5.1.0.tgz", + "integrity": "sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==", + "dev": true + } + } + }, "cosmiconfig": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.1.0.tgz", @@ -15593,9 +15898,9 @@ "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" }, "fast-glob": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.1.tgz", - "integrity": "sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", "requires": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", @@ -17876,7 +18181,6 @@ "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", "dev": true, - "peer": true, "requires": { "safe-buffer": "^5.1.0" } @@ -18517,6 +18821,12 @@ "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", "integrity": "sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w==" }, + "require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true + }, "resize-observer-polyfill": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/resize-observer-polyfill/-/resize-observer-polyfill-1.5.1.tgz", @@ -18662,8 +18972,7 @@ "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true, - "peer": true + "dev": true }, "safe-regex-test": { "version": "1.0.0", @@ -18724,7 +19033,6 @@ "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", "dev": true, - "peer": true, "requires": { "randombytes": "^2.1.0" } @@ -19322,6 +19630,12 @@ "which-boxed-primitive": "^1.0.2" } }, + "unicorn-magic": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.1.0.tgz", + "integrity": "sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==", + "dev": true + }, "unified": { "version": "10.1.2", "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.2.tgz", diff --git a/web/package.json b/web/package.json index 42923d11d..624aba531 100644 --- a/web/package.json +++ b/web/package.json @@ -21,7 +21,7 @@ "@monaco-editor/react": "^4.5.2", "@mui/icons-material": "^5.11.16", "@mui/joy": "5.0.0-beta.5", - "@oceanbase-odc/monaco-plugin-ob": "^0.2.2", + "@oceanbase-odc/monaco-plugin-ob": "^1.0.3", "ahooks": "^3.7.8", "antd": "^5.6.2", "axios": "^1.3.4", @@ -54,6 +54,7 @@ "@types/react-dom": "18.2.6", "@types/react-syntax-highlighter": "^15.5.7", "autoprefixer": "10.4.14", + "copy-webpack-plugin": "^12.0.2", "eslint": "8.43.0", "eslint-config-next": "13.4.7", "monaco-editor-webpack-plugin": "^7.1.0"