Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: [feat/sql-languages][taier-ui] improve sql-parser for editor #1133

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 44 additions & 15 deletions taier-ui/.umirc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,25 +29,54 @@ export default defineConfig({
},
],
chainWebpack(memo, { env }) {
memo.output.globalObject('this').set('globalObject', 'this');
memo.entry('sparksql.worker').add('monaco-sql-languages/out/esm/sparksql/sparksql.worker.js');
memo.entry('sql.worker').add('monaco-sql-languages/out/esm/sql/sql.worker.js');
memo.entry('hivesql.worker').add('monaco-sql-languages/out/esm/hivesql/hivesql.worker.js');
memo.entry('mysql.worker').add('monaco-sql-languages/out/esm/mysql/mysql.worker.js');
memo.entry('flinksql.worker').add('monaco-sql-languages/out/esm/flinksql/flinksql.worker.js');
memo.plugin('monaco-editor').use(MonacoWebpackPlugin, [
{
languages: ['json', 'python', 'shell'],
languages: ['json', 'python', 'shell', 'sql'],
customLanguages: [
{
label: 'mysql',
entry: 'monaco-sql-languages/out/esm/mysql/mysql.contribution',
worker: {
id: 'monaco-sql-languages/out/esm/mysql/mySQLWorker',
entry: 'monaco-sql-languages/out/esm/mysql/mysql.worker',
},
},
{
label: 'flinksql',
entry: 'monaco-sql-languages/out/esm/flinksql/flinksql.contribution',
worker: {
id: 'monaco-sql-languages/out/esm/flinksql/flinkSQLWorker',
entry: 'monaco-sql-languages/out/esm/flinksql/flinksql.worker',
},
},
{
label: 'sparksql',
entry: 'monaco-sql-languages/out/esm/sparksql/sparksql.contribution',
worker: {
id: 'monaco-sql-languages/out/esm/sparksql/sparkSQLWorker',
entry: 'monaco-sql-languages/out/esm/sparksql/sparksql.worker',
},
},
{
label: 'hivesql',
entry: 'monaco-sql-languages/out/esm/hivesql/hivesql.contribution',
worker: {
id: 'monaco-sql-languages/out/esm/hivesql/hiveSQLWorker',
entry: 'monaco-sql-languages/out/esm/hivesql/hivesql.worker',
},
},
{
label: 'pgsql',
entry: 'monaco-sql-languages/out/esm/pgsql/pgsql.contribution',
worker: {
id: 'monaco-sql-languages/out/esm/pgsql/PgSQLWorker',
entry: 'monaco-sql-languages/out/esm/pgsql/pgsql.worker',
},
},
],
},
]);

const isDev = env === 'development';
if (!isDev) {
// ignore *.worker.js hash
memo.output.set('filename', (pathData: any) => {
return pathData.chunk.name.endsWith('.worker') ? '[name].js' : `[name].[contenthash:8].js`;
});
}
return memo;
},
esbuild: {},
Expand All @@ -58,7 +87,7 @@ export default defineConfig({
tailwindcss: {},
proxy: {
'/taier': {
target: 'http://localhost:8090',
target: 'http://localhost:8090',
changeOrigin: true,
secure: false,
},
Expand Down
6 changes: 3 additions & 3 deletions taier-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"lodash": "^4.17.21",
"md5": "^2.3.0",
"moment": "^2.29.1",
"monaco-sql-languages": "^0.9.4",
"monaco-sql-languages": "0.12.0-beta.5",
"mxgraph": "4.0.6",
"object-assign": "^4.1.1",
"react": "~18.2.0",
Expand Down Expand Up @@ -93,7 +93,7 @@
"jest-canvas-mock": "^2.4.0",
"ko-lint-config": "^2.2.16",
"lint-staged": "^10.0.7",
"monaco-editor-webpack-plugin": "^6.0.0",
"monaco-editor-webpack-plugin": "^7.0.0",
"mustache": "^4.2.0",
"progress": "^2.0.3",
"request-promise": "^4.2.6",
Expand All @@ -106,6 +106,6 @@
"yorkie": "^2.0.0"
},
"resolutions": {
"dt-sql-parser": "4.0.0-beta.3.2"
"antlr4-c3": "3.0.x"
}
}
60 changes: 32 additions & 28 deletions taier-ui/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading