Web console: bump dependencies including d3 and typescript (#17381)

* bump deps including d3

* better clean script
This commit is contained in:
Vadim Ogievetsky 2024-10-21 11:38:19 -07:00 committed by GitHub
parent 187e21afae
commit 6cf372a7f4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
27 changed files with 1210 additions and 931 deletions

View File

@ -5083,7 +5083,7 @@ license_category: binary
module: web-console
license_name: Apache License version 2.0
copyright: Palantir Technologies
version: 5.1.1
version: 5.1.2
---
@ -5092,7 +5092,7 @@ license_category: binary
module: web-console
license_name: Apache License version 2.0
copyright: Palantir Technologies
version: 5.10.5
version: 5.13.1
---
@ -5101,7 +5101,7 @@ license_category: binary
module: web-console
license_name: Apache License version 2.0
copyright: Palantir Technologies
version: 2.3.7
version: 2.3.11
---
@ -5110,7 +5110,7 @@ license_category: binary
module: web-console
license_name: Apache License version 2.0
copyright: Palantir Technologies
version: 5.3.7
version: 5.3.11
---
@ -5119,7 +5119,7 @@ license_category: binary
module: web-console
license_name: Apache License version 2.0
copyright: Palantir Technologies
version: 5.10.0
version: 5.13.0
---
@ -5128,7 +5128,7 @@ license_category: binary
module: web-console
license_name: Apache License version 2.0
copyright: Palantir Technologies
version: 5.2.1
version: 5.2.5
---
@ -5137,7 +5137,7 @@ license_category: binary
module: web-console
license_name: Apache License version 2.0
copyright: Imply Data
version: 0.22.22
version: 0.22.23
---
@ -5236,7 +5236,7 @@ license_category: binary
module: web-console
license_name: SIL Open Font License 1.1
copyright: Google Inc.
version: 5.0.28
version: 5.1.0
license_file_path: licenses/bin/@fontsource-open-sans.OFL
---
@ -5286,27 +5286,17 @@ license_category: binary
module: web-console
license_name: MIT License
copyright: Microsoft Corporation.
version: 18.2.42
version: 18.3.11
license_file_path: licenses/bin/@types-react.MIT
---
name: "@types/scheduler"
license_category: binary
module: web-console
license_name: MIT License
copyright: Microsoft Corporation.
version: 0.16.8
license_file_path: licenses/bin/@types-scheduler.MIT
---
name: "ace-builds"
license_category: binary
module: web-console
license_name: BSD-3-Clause License
copyright: Ajax.org B.V.
version: 1.4.14
version: 1.5.3
license_file_path: licenses/bin/ace-builds.BSD3
---
@ -5336,7 +5326,7 @@ license_category: binary
module: web-console
license_name: MIT License
copyright: Matt Zabriskie
version: 1.7.4
version: 1.7.7
license_file_path: licenses/bin/axios.MIT
---
@ -5475,7 +5465,7 @@ license_category: binary
module: web-console
license_name: MIT License
copyright: TJ Holowaychuk
version: 2.20.0
version: 7.2.0
license_file_path: licenses/bin/commander.MIT
---
@ -5505,21 +5495,11 @@ license_category: binary
module: web-console
license_name: MIT License
copyright: sudodoki
version: 3.2.0
version: 3.3.3
license_file_path: licenses/bin/copy-to-clipboard.MIT
---
name: "core-js"
license_category: binary
module: web-console
license_name: MIT License
copyright: Denis Pushkarev
version: 3.10.1
license_file_path: licenses/bin/core-js.MIT
---
name: "cosmiconfig"
license_category: binary
module: web-console
@ -5563,30 +5543,30 @@ license_file_path: licenses/bin/d3-array.BSD3
name: "d3-axis"
license_category: binary
module: web-console
license_name: BSD-3-Clause License
license_name: ISC License
copyright: Mike Bostock
version: 2.1.0
license_file_path: licenses/bin/d3-axis.BSD3
version: 3.0.0
license_file_path: licenses/bin/d3-axis.ISC
---
name: "d3-color"
license_category: binary
module: web-console
license_name: BSD-3-Clause License
license_name: ISC License
copyright: Mike Bostock
version: 2.0.0
license_file_path: licenses/bin/d3-color.BSD3
version: 3.1.0
license_file_path: licenses/bin/d3-color.ISC
---
name: "d3-dsv"
license_category: binary
module: web-console
license_name: BSD-3-Clause License
license_name: ISC License
copyright: Mike Bostock
version: 2.0.0
license_file_path: licenses/bin/d3-dsv.BSD3
version: 3.0.1
license_file_path: licenses/bin/d3-dsv.ISC
---
@ -5603,10 +5583,10 @@ license_file_path: licenses/bin/d3-format.BSD3
name: "d3-interpolate"
license_category: binary
module: web-console
license_name: BSD-3-Clause License
license_name: ISC License
copyright: Mike Bostock
version: 2.0.1
license_file_path: licenses/bin/d3-interpolate.BSD3
version: 3.0.1
license_file_path: licenses/bin/d3-interpolate.ISC
---
@ -5623,20 +5603,20 @@ license_file_path: licenses/bin/d3-scale-chromatic.ISC
name: "d3-scale"
license_category: binary
module: web-console
license_name: BSD-3-Clause License
license_name: ISC License
copyright: Mike Bostock
version: 3.3.0
license_file_path: licenses/bin/d3-scale.BSD3
version: 4.0.2
license_file_path: licenses/bin/d3-scale.ISC
---
name: "d3-selection"
license_category: binary
module: web-console
license_name: BSD-3-Clause License
license_name: ISC License
copyright: Mike Bostock
version: 2.0.0
license_file_path: licenses/bin/d3-selection.BSD3
version: 3.0.0
license_file_path: licenses/bin/d3-selection.ISC
---
@ -5734,7 +5714,7 @@ license_category: binary
module: web-console
license_name: Apache License version 2.0
copyright: Apache Software Foundation
version: 5.4.3
version: 5.5.1
---
@ -5893,7 +5873,7 @@ license_category: binary
module: web-console
license_name: MIT License
copyright: Alexander Shtuchkin
version: 0.4.24
version: 0.6.3
license_file_path: licenses/bin/iconv-lite.MIT
---
@ -6062,7 +6042,7 @@ license_category: binary
module: web-console
license_name: MIT License
copyright: Alex Reardon
version: 5.1.1
version: 5.2.1
license_file_path: licenses/bin/memoize-one.MIT
---
@ -6291,7 +6271,7 @@ license_category: binary
module: web-console
license_name: MIT License
copyright: Facebook, Inc. and its affiliates.
version: 18.2.0
version: 18.3.1
license_file_path: licenses/bin/react-dom.MIT
---
@ -6401,7 +6381,7 @@ license_category: binary
module: web-console
license_name: MIT License
copyright: Facebook, Inc. and its affiliates.
version: 18.2.0
version: 18.3.1
license_file_path: licenses/bin/react.MIT
---
@ -6481,7 +6461,7 @@ license_category: binary
module: web-console
license_name: MIT License
copyright: Facebook, Inc. and its affiliates.
version: 0.23.0
version: 0.23.2
license_file_path: licenses/bin/scheduler.MIT
---
@ -6611,7 +6591,7 @@ license_category: binary
module: web-console
license_name: MIT License
copyright: Facebook, Inc. and its affiliates.
version: 1.2.0
version: 1.2.2
license_file_path: licenses/bin/use-sync-external-store.MIT
---
@ -6621,7 +6601,7 @@ license_category: binary
module: web-console
license_name: MIT License
copyright: Robert Kieffer and other contributors
version: 7.0.2
version: 7.0.3
license_file_path: licenses/bin/uuid.MIT
---
@ -6661,7 +6641,7 @@ license_category: binary
module: web-console
license_name: BSD-3-Clause License
copyright: Baidu Inc.
version: 5.4.4
version: 5.6.0
license_file_path: licenses/bin/zrender.BSD3
---
@ -6671,6 +6651,6 @@ license_category: binary
module: web-console
license_name: MIT License
copyright: Paul Henschel
version: 4.3.2
version: 4.5.5
license_file_path: licenses/bin/zustand.MIT
# Web console modules end

View File

@ -10,7 +10,7 @@ coordinator-console/
pages/
/index.html
lib/sql-docs.js
lib/sql-docs.*
.tscache
tscommand-*.tmp.txt

View File

@ -16,12 +16,12 @@
* limitations under the License.
*/
const { createJsWithTsPreset } = require('ts-jest');
module.exports = {
preset: 'ts-jest',
globals: {
'ts-jest': {
tsconfig: './tsconfig.test.json',
},
},
testEnvironment: 'jsdom',
transformIgnorePatterns: ['/node_modules/(?!(d3-.+)/)'],
...createJsWithTsPreset({
tsconfig: './tsconfig.test.json',
}),
};

View File

@ -1,22 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export const SQL_KEYWORDS: string[];
export const SQL_EXPRESSION_PARTS: string[];
export const SQL_CONSTANTS: string[];
export const SQL_DYNAMICS: string[];

View File

@ -18,7 +18,7 @@
// Hand picked from https://druid.apache.org/docs/latest/querying/sql.html
exports.SQL_KEYWORDS = [
export const SQL_KEYWORDS = [
'EXPLAIN PLAN FOR',
'WITH',
'AS',
@ -75,7 +75,7 @@ exports.SQL_KEYWORDS = [
'UNPIVOT',
];
exports.SQL_EXPRESSION_PARTS = [
export const SQL_EXPRESSION_PARTS = [
'FILTER',
'END',
'ELSE',
@ -114,9 +114,9 @@ exports.SQL_EXPRESSION_PARTS = [
'CSV',
];
exports.SQL_CONSTANTS = ['NULL', 'FALSE', 'TRUE'];
export const SQL_CONSTANTS = ['NULL', 'FALSE', 'TRUE'];
exports.SQL_DYNAMICS = [
export const SQL_DYNAMICS = [
'CURRENT_TIMESTAMP',
'CURRENT_DATE',
'LOCALTIME',

View File

@ -1,20 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export const SQL_DATA_TYPES: Record<string, [runtime: string, description: string]>;
export const SQL_FUNCTIONS: Record<string, [args: string, description: string][]>;

File diff suppressed because it is too large Load Diff

View File

@ -8,31 +8,18 @@
"type": "git",
"url": "https://github.com/apache/druid"
},
"jest": {
"preset": "ts-jest",
"testEnvironment": "jsdom",
"moduleNameMapper": {
"\\.s?css$": "identity-obj-proxy"
},
"testMatch": [
"**/?(*.)+(spec).ts?(x)"
],
"setupFilesAfterEnv": [
"<rootDir>src/setup-tests.ts"
]
},
"prettier": "@awesome-code-style/prettier-config",
"scripts": {
"compile": "./script/build",
"pretest": "./script/build",
"jest": "jest --config jest.unit.config.js src",
"jest": "jest --config jest.config.js src",
"test-base": "npm run eslint && npm run sasslint && npm run prettify-check && npm run jest",
"test": "npm run test-base -- --silent 2>&1",
"test-ci": "npm run test-base -- --coverage",
"test-e2e": "jest --runInBand --config jest.e2e.config.js e2e-tests",
"codecov": "codecov --disable=gcov -p ..",
"coverage": "jest --coverage src",
"update-snapshots": "jest -u --config jest.unit.config.js",
"update-snapshots": "jest -u --config jest.config.js",
"autofix": "npm run eslint-fix && npm run sasslint-fix && npm run prettify",
"eslint": "eslint",
"eslint-fix": "npm run eslint -- --fix",
@ -63,72 +50,71 @@
"not ie 11"
],
"dependencies": {
"@blueprintjs/core": "^5.10.5",
"@blueprintjs/datetime": "^5.3.6",
"@blueprintjs/datetime2": "^2.3.7",
"@blueprintjs/icons": "^5.10.0",
"@blueprintjs/select": "^5.2.1",
"@druid-toolkit/query": "^0.22.22",
"@fontsource/open-sans": "^5.0.28",
"ace-builds": "~1.4.14",
"axios": "^1.7.4",
"@blueprintjs/core": "^5.13.1",
"@blueprintjs/datetime": "^5.3.11",
"@blueprintjs/datetime2": "^2.3.11",
"@blueprintjs/icons": "^5.13.0",
"@blueprintjs/select": "^5.2.5",
"@druid-toolkit/query": "^0.22.23",
"@fontsource/open-sans": "^5.0.30",
"ace-builds": "~1.5.3",
"axios": "^1.7.7",
"chronoshift": "^0.10.0",
"classnames": "^2.2.6",
"copy-to-clipboard": "^3.2.0",
"core-js": "^3.10.1",
"d3-array": "^2.12.1",
"d3-axis": "^2.1.0",
"d3-dsv": "^2.0.0",
"d3-scale": "^3.3.0",
"copy-to-clipboard": "^3.3.3",
"d3-array": "^3.2.4",
"d3-axis": "^3.0.0",
"d3-dsv": "^3.0.1",
"d3-scale": "^4.0.2",
"d3-scale-chromatic": "^3.1.0",
"d3-selection": "^2.0.0",
"d3-selection": "^3.0.0",
"date-fns": "^2.28.0",
"echarts": "^5.4.3",
"echarts": "^5.5.1",
"file-saver": "^2.0.5",
"hjson": "^3.2.2",
"json-bigint-native": "^1.2.0",
"lodash.debounce": "^4.0.8",
"lodash.escape": "^4.0.1",
"memoize-one": "^5.1.1",
"memoize-one": "^5.2.1",
"numeral": "^2.0.6",
"path-parse": "^1.0.7",
"react": "^18.2.0",
"react": "^18.3.1",
"react-ace": "^10.1.0",
"react-diff-viewer": "^3.1.1",
"react-dom": "^18.2.0",
"react-dom": "^18.3.1",
"react-router": "^5.3.4",
"react-router-dom": "^5.3.4",
"react-splitter-layout": "^4.0.0",
"react-table": "~6.11.5",
"regenerator-runtime": "^0.13.7",
"tslib": "^2.3.1",
"uuid": "^7.0.2",
"zustand": "^4.3.2"
"tslib": "^2.8.0",
"uuid": "^7.0.3",
"zustand": "^4.5.5"
},
"devDependencies": {
"@awesome-code-style/eslint-config": "^6.0.0",
"@awesome-code-style/prettier-config": "^4.0.0",
"@awesome-code-style/stylelint-config": "^6.0.0",
"@testing-library/react": "^14.0.0",
"@testing-library/dom": "^10.4.0",
"@testing-library/react": "^16.0.1",
"@types/classnames": "^2.2.9",
"@types/d3-array": "^2.12.3",
"@types/d3-axis": "^2.1.3",
"@types/d3-dsv": "^2.0.0",
"@types/d3-scale": "^3.3.2",
"@types/d3-array": "^3.2.1",
"@types/d3-axis": "^3.0.6",
"@types/d3-dsv": "^3.0.7",
"@types/d3-scale": "^4.0.8",
"@types/d3-scale-chromatic": "^3.0.3",
"@types/d3-selection": "^2.0.1",
"@types/enzyme": "^3.10.17",
"@types/d3-selection": "^3.0.11",
"@types/enzyme": "^3.10.18",
"@types/enzyme-adapter-react-16": "^1.0.9",
"@types/file-saver": "^2.0.7",
"@types/hjson": "^2.4.6",
"@types/jest": "^27.4.0",
"@types/lodash.debounce": "^4.0.6",
"@types/lodash.escape": "^4.0.6",
"@types/lodash.debounce": "^4.0.8",
"@types/lodash.escape": "^4.0.9",
"@types/memoize-one": "^4.1.1",
"@types/node": "^12.11.7",
"@types/numeral": "^0.0.26",
"@types/react": "^18.2.42",
"@types/react-dom": "^18.2.17",
"@types/node": "^18.19.56",
"@types/numeral": "^2.0.5",
"@types/react": "^18.3.11",
"@types/react-dom": "^18.3.1",
"@types/react-router-dom": "^5.3.3",
"@types/react-splitter-layout": "^3.0.5",
"@types/react-table": "6.8.5",
@ -159,10 +145,10 @@
"snarkdown": "^2.0.0",
"style-loader": "^2.0.0",
"stylelint": "^16.1.0",
"ts-jest": "^29.1.2",
"ts-loader": "^9.4.2",
"ts-node": "^10.9.1",
"typescript": "^4.9.5",
"ts-jest": "^29.2.5",
"ts-loader": "^9.5.1",
"ts-node": "^10.9.2",
"typescript": "~5.5.4",
"webpack": "^5.89.0",
"webpack-bundle-analyzer": "^4.10.1",
"webpack-cli": "^5.1.4",

View File

@ -19,10 +19,10 @@
set -e
echo "Adding SQL docs..."
./script/create-sql-docs.js
./script/create-sql-docs.mjs
# add BUNDLE_ANALYZER_PLUGIN='TRUE' here to enable webpack-bundle-analyzer as a plugin
echo "Webpacking everything..."
NODE_ENV=production ./node_modules/.bin/webpack -c webpack.config.js --mode=production
NODE_ENV=production ./node_modules/.bin/webpack -c webpack.config.mjs --mode=production
echo "Done! Have a good day."

View File

@ -16,14 +16,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# remove lib/sql-function-doc.* for back compat cleanup
rm -rf \
coverage \
lib/react-table.css \
lib/sql-docs.js \
lib/sql-function-doc.* \
lib/sql-docs.* \
node_modules \
coordinator-console \
pages \
public \
index.html

View File

@ -18,10 +18,10 @@
* limitations under the License.
*/
const fs = require('fs-extra');
const snarkdown = require('snarkdown');
import fs from 'fs-extra';
import snarkdown from 'snarkdown';
const writefile = 'lib/sql-docs.js';
const OUTPUT_FILE = 'lib/sql-docs.ts';
const MINIMUM_EXPECTED_NUMBER_OF_FUNCTIONS = 198;
const MINIMUM_EXPECTED_NUMBER_OF_DATA_TYPES = 15;
@ -140,14 +140,23 @@ const readDoc = async () => {
// This file is auto generated and should not be modified
// prettier-ignore
exports.SQL_DATA_TYPES = ${JSON.stringify(dataTypeDocs, null, 2)};
export const SQL_DATA_TYPES: Record<string, [runtime: string, description: string]> = ${JSON.stringify(
dataTypeDocs,
null,
2,
)};
// prettier-ignore
exports.SQL_FUNCTIONS = ${JSON.stringify(functionDocs, null, 2)};
export const SQL_FUNCTIONS: Record<string, [args: string, description: string][]> = ${JSON.stringify(
functionDocs,
null,
2,
)};
`;
// eslint-disable-next-line no-undef
console.log(`Found ${numDataTypes} data types and ${numFunction} functions`);
await fs.writeFile(writefile, content, 'utf-8');
await fs.writeFile(OUTPUT_FILE, content, 'utf-8');
};
readDoc();

View File

@ -24,8 +24,13 @@
import type { Ace } from 'ace-builds';
import ace from 'ace-builds/src-noconflict/ace';
import * as druidKeywords from '../../lib/keywords';
import * as druidFunctions from '../../lib/sql-docs';
import {
SQL_CONSTANTS,
SQL_DYNAMICS,
SQL_EXPRESSION_PARTS,
SQL_KEYWORDS,
} from '../../lib/keywords';
import { SQL_DATA_TYPES, SQL_FUNCTIONS } from '../../lib/sql-docs';
import type { ItemDescription } from './make-doc-html';
import { makeDocHtml } from './make-doc-html';
@ -41,20 +46,16 @@ ace.define(
const SqlHighlightRules = function (this: any) {
// Stuff like: 'with|select|from|where|and|or|group|by|order|limit|having|as|case|'
const keywords = druidKeywords.SQL_KEYWORDS.concat(druidKeywords.SQL_EXPRESSION_PARTS)
.join('|')
.replace(/\s/g, '|');
const keywords = SQL_KEYWORDS.concat(SQL_EXPRESSION_PARTS).join('|').replace(/\s/g, '|');
// Stuff like: 'true|false'
const builtinConstants = druidKeywords.SQL_CONSTANTS.join('|');
const builtinConstants = SQL_CONSTANTS.join('|');
// Stuff like: 'avg|count|first|last|max|min'
const builtinFunctions = druidKeywords.SQL_DYNAMICS.concat(
Object.keys(druidFunctions.SQL_FUNCTIONS),
).join('|');
const builtinFunctions = SQL_DYNAMICS.concat(Object.keys(SQL_FUNCTIONS)).join('|');
// Stuff like: 'int|numeric|decimal|date|varchar|char|bigint|float|double|bit|binary|text|set|timestamp'
const dataTypes = Object.keys(druidFunctions.SQL_DATA_TYPES).join('|');
const dataTypes = Object.keys(SQL_DATA_TYPES).join('|');
const keywordMapper = this.createKeywordMapper(
{
@ -136,16 +137,16 @@ ace.define(
const SqlHighlightRules = acequire('./dsql_highlight_rules').SqlHighlightRules;
const completions = ([] as Ace.Completion[]).concat(
druidKeywords.SQL_KEYWORDS.map(v => ({ name: v, value: v, score: 0, meta: 'keyword' })),
druidKeywords.SQL_EXPRESSION_PARTS.map(v => ({
SQL_KEYWORDS.map(v => ({ name: v, value: v, score: 0, meta: 'keyword' })),
SQL_EXPRESSION_PARTS.map(v => ({
name: v,
value: v,
score: 0,
meta: 'keyword',
})),
druidKeywords.SQL_CONSTANTS.map(v => ({ name: v, value: v, score: 0, meta: 'constant' })),
druidKeywords.SQL_DYNAMICS.map(v => ({ name: v, value: v, score: 0, meta: 'dynamic' })),
Object.entries(druidFunctions.SQL_DATA_TYPES).map(([name, [runtime, description]]) => {
SQL_CONSTANTS.map(v => ({ name: v, value: v, score: 0, meta: 'constant' })),
SQL_DYNAMICS.map(v => ({ name: v, value: v, score: 0, meta: 'dynamic' })),
Object.entries(SQL_DATA_TYPES).map(([name, [runtime, description]]) => {
const item: ItemDescription = {
name,
description,
@ -160,7 +161,7 @@ ace.define(
docText: description,
};
}),
Object.entries(druidFunctions.SQL_FUNCTIONS).flatMap(([name, versions]) => {
Object.entries(SQL_FUNCTIONS).flatMap(([name, versions]) => {
return versions.map(([args, description]) => {
const item = { name, description, syntax: `${name}(${args})` };
return {

View File

@ -11,7 +11,6 @@ exports[`MenuBoolean matches snapshot false 1`] = `
tabindex="0"
>
<a
aria-expanded="false"
aria-haspopup="menu"
class="bp5-menu-item menu-tristate"
label="false"
@ -65,7 +64,6 @@ exports[`MenuBoolean matches snapshot no undefined 1`] = `
tabindex="0"
>
<a
aria-expanded="false"
aria-haspopup="menu"
class="bp5-menu-item menu-tristate"
label="false"
@ -119,7 +117,6 @@ exports[`MenuBoolean matches snapshot undefined 1`] = `
tabindex="0"
>
<a
aria-expanded="false"
aria-haspopup="menu"
class="bp5-menu-item menu-tristate"
label="Auto (true)"

View File

@ -59,9 +59,13 @@ exports[`SegmentTimeline matches snapshot 1`] = `
>
<div
class="bp5-segmented-control bp5-fill"
role="radiogroup"
>
<button
aria-checked="true"
class="bp5-button"
role="radio"
tabindex="0"
type="button"
>
<span
@ -71,7 +75,10 @@ exports[`SegmentTimeline matches snapshot 1`] = `
</span>
</button>
<button
aria-checked="false"
class="bp5-button bp5-minimal"
role="radio"
tabindex="-1"
type="button"
>
<span

View File

@ -63,7 +63,6 @@ exports[`SuggestionMenu matches snapshot 1`] = `
tabindex="0"
>
<a
aria-expanded="false"
aria-haspopup="menu"
class="bp5-menu-item"
role="none"

View File

@ -16,7 +16,6 @@
* limitations under the License.
*/
import 'core-js/stable';
import 'regenerator-runtime/runtime';
import './bootstrap/ace';

View File

@ -16,7 +16,6 @@
* limitations under the License.
*/
import 'core-js/stable';
import './bootstrap/ace';
import { Icons } from '@blueprintjs/icons';

View File

@ -668,7 +668,7 @@ function makeJoinCompareTableQueryAndHints(
: q
.applyIf(orderByCompareDuration, q =>
q.changeOrderByExpression(
decodedOrderBy!.orderedMeasure!.expression.toOrderByExpression('DESC'),
decodedOrderBy.orderedMeasure!.expression.toOrderByExpression('DESC'),
),
)
.changeLimitValue(safeSubQueryLimit),
@ -701,7 +701,7 @@ function makeJoinCompareTableQueryAndHints(
q =>
q
.changeOrderByExpression(
effectiveOrderBy.changeExpression(C(decodedOrderBy!.orderedMeasure!.name)),
effectiveOrderBy.changeExpression(C(decodedOrderBy.orderedMeasure!.name)),
)
.changeLimitValue(maxRows),
q =>
@ -716,7 +716,7 @@ function makeJoinCompareTableQueryAndHints(
)
: q
.changeOrderByExpression(
C(decodedOrderBy!.orderedThing.name).toOrderByExpression('DESC'),
C(decodedOrderBy.orderedThing.name).toOrderByExpression('DESC'),
)
.changeLimitValue(safeSubQueryLimit),
),

View File

@ -12,7 +12,6 @@ exports[`ComplexMenuItems matches snapshot when menu is opened for column not in
tabindex="0"
>
<a
aria-expanded="false"
aria-haspopup="menu"
class="bp5-menu-item"
role="none"

View File

@ -12,7 +12,6 @@ exports[`NumberMenuItems matches snapshot when menu is opened for column inside
tabindex="0"
>
<a
aria-expanded="false"
aria-haspopup="menu"
class="bp5-menu-item"
role="none"
@ -79,7 +78,6 @@ exports[`NumberMenuItems matches snapshot when menu is opened for column inside
tabindex="0"
>
<a
aria-expanded="false"
aria-haspopup="menu"
class="bp5-menu-item"
role="none"
@ -184,7 +182,6 @@ exports[`NumberMenuItems matches snapshot when menu is opened for column inside
tabindex="0"
>
<a
aria-expanded="false"
aria-haspopup="menu"
class="bp5-menu-item"
role="none"
@ -256,7 +253,6 @@ exports[`NumberMenuItems matches snapshot when menu is opened for column not ins
tabindex="0"
>
<a
aria-expanded="false"
aria-haspopup="menu"
class="bp5-menu-item"
role="none"
@ -323,7 +319,6 @@ exports[`NumberMenuItems matches snapshot when menu is opened for column not ins
tabindex="0"
>
<a
aria-expanded="false"
aria-haspopup="menu"
class="bp5-menu-item"
role="none"
@ -390,7 +385,6 @@ exports[`NumberMenuItems matches snapshot when menu is opened for column not ins
tabindex="0"
>
<a
aria-expanded="false"
aria-haspopup="menu"
class="bp5-menu-item"
role="none"

View File

@ -12,7 +12,6 @@ exports[`StringMenuItems matches snapshot when menu is opened for column inside
tabindex="0"
>
<a
aria-expanded="false"
aria-haspopup="menu"
class="bp5-menu-item"
role="none"
@ -79,7 +78,6 @@ exports[`StringMenuItems matches snapshot when menu is opened for column inside
tabindex="0"
>
<a
aria-expanded="false"
aria-haspopup="menu"
class="bp5-menu-item"
role="none"
@ -184,7 +182,6 @@ exports[`StringMenuItems matches snapshot when menu is opened for column inside
tabindex="0"
>
<a
aria-expanded="false"
aria-haspopup="menu"
class="bp5-menu-item"
role="none"
@ -256,7 +253,6 @@ exports[`StringMenuItems matches snapshot when menu is opened for column not ins
tabindex="0"
>
<a
aria-expanded="false"
aria-haspopup="menu"
class="bp5-menu-item"
role="none"
@ -323,7 +319,6 @@ exports[`StringMenuItems matches snapshot when menu is opened for column not ins
tabindex="0"
>
<a
aria-expanded="false"
aria-haspopup="menu"
class="bp5-menu-item"
role="none"
@ -390,7 +385,6 @@ exports[`StringMenuItems matches snapshot when menu is opened for column not ins
tabindex="0"
>
<a
aria-expanded="false"
aria-haspopup="menu"
class="bp5-menu-item"
role="none"

View File

@ -12,7 +12,6 @@ exports[`TimeMenuItems matches snapshot when menu is opened for column inside gr
tabindex="0"
>
<a
aria-expanded="false"
aria-haspopup="menu"
class="bp5-menu-item"
role="none"
@ -79,7 +78,6 @@ exports[`TimeMenuItems matches snapshot when menu is opened for column inside gr
tabindex="0"
>
<a
aria-expanded="false"
aria-haspopup="menu"
class="bp5-menu-item"
role="none"
@ -184,7 +182,6 @@ exports[`TimeMenuItems matches snapshot when menu is opened for column inside gr
tabindex="0"
>
<a
aria-expanded="false"
aria-haspopup="menu"
class="bp5-menu-item"
role="none"
@ -256,7 +253,6 @@ exports[`TimeMenuItems matches snapshot when menu is opened for column not insid
tabindex="0"
>
<a
aria-expanded="false"
aria-haspopup="menu"
class="bp5-menu-item"
role="none"
@ -323,7 +319,6 @@ exports[`TimeMenuItems matches snapshot when menu is opened for column not insid
tabindex="0"
>
<a
aria-expanded="false"
aria-haspopup="menu"
class="bp5-menu-item"
role="none"
@ -390,7 +385,6 @@ exports[`TimeMenuItems matches snapshot when menu is opened for column not insid
tabindex="0"
>
<a
aria-expanded="false"
aria-haspopup="menu"
class="bp5-menu-item"
role="none"

View File

@ -355,6 +355,7 @@ export class FlexibleQueryInput extends React.PureComponent<
),
'sub-query-highlight',
'text',
false,
);
this.highlightFoundQuery = { row, marker };
}}

View File

@ -16,6 +16,7 @@
* limitations under the License.
*/
import { HotkeysProvider } from '@blueprintjs/core';
import { render } from '@testing-library/react';
import { DEFAULT_SERVER_QUERY_CONTEXT, DRUID_ENGINES, WorkbenchQuery } from '../../../druid-models';
@ -25,6 +26,7 @@ import { RunPanel } from './run-panel';
describe('RunPanel', () => {
it('matches snapshot on native (auto) query', () => {
const runPanel = (
<HotkeysProvider>
<RunPanel
query={WorkbenchQuery.blank().changeQueryString(`SELECT * FROM wikipedia`)}
onQueryChange={() => {}}
@ -34,6 +36,7 @@ describe('RunPanel', () => {
clusterCapacity={9}
defaultQueryContext={DEFAULT_SERVER_QUERY_CONTEXT}
/>
</HotkeysProvider>
);
const { container } = render(runPanel);
expect(container.firstChild).toMatchSnapshot();
@ -41,6 +44,7 @@ describe('RunPanel', () => {
it('matches snapshot on msq (auto) query', () => {
const runPanel = (
<HotkeysProvider>
<RunPanel
query={WorkbenchQuery.blank()
.changeQueryString(`SELECT * FROM wikipedia`)
@ -52,6 +56,7 @@ describe('RunPanel', () => {
clusterCapacity={9}
defaultQueryContext={DEFAULT_SERVER_QUERY_CONTEXT}
/>
</HotkeysProvider>
);
const { container } = render(runPanel);
expect(container.firstChild).toMatchSnapshot();

View File

@ -1,6 +1,7 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"allowJs": true,
"module": "commonjs"
}
}

View File

@ -16,13 +16,15 @@
* limitations under the License.
*/
const process = require('process');
const path = require('path');
const { SassString } = require('sass');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
const webpack = require('webpack');
import fs from 'fs';
import { fileURLToPath } from 'node:url';
import { dirname, resolve } from 'path';
import process from 'process';
import sass from 'sass';
import webpack from 'webpack';
import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer';
const { version } = require('./package.json');
const version = JSON.parse(fs.readFileSync('./package.json', 'utf-8')).version;
const supportedLocales = ['en-US'];
@ -30,7 +32,13 @@ function friendlyErrorFormatter(e) {
return `${e.severity}: ${e.content} [TS${e.code}]\n at (${e.file}:${e.line}:${e.character})`;
}
module.exports = env => {
// Get the file path of the current module
const __filename = fileURLToPath(import.meta.url);
// Get the directory name of the current module
const __dirname = dirname(__filename);
export default env => {
let druidUrl = (env || {}).druid_host || process.env.druid_host || 'localhost';
if (!druidUrl.startsWith('http')) {
druidUrl = (druidUrl.endsWith(':9088') ? 'https://' : 'http://') + druidUrl;
@ -45,6 +53,8 @@ module.exports = env => {
};
const mode = process.env.NODE_ENV === 'production' ? 'production' : 'development';
// eslint-disable-next-line no-undef
console.log(`Webpack running in ${mode} mode.`);
const plugins = [
@ -69,7 +79,7 @@ module.exports = env => {
'web-console': './src/entry.tsx',
},
output: {
path: path.resolve(__dirname, './public'),
path: resolve(__dirname, './public'),
filename: `[name]-${version}.js`,
chunkFilename: `[name]-${version}.js`,
publicPath: 'public/',
@ -154,7 +164,7 @@ module.exports = env => {
// via CSS are themselves being used by the web console, so we can safely omit the icons.
//
// TODO: Re-evaluate after upgrading to Blueprint v6
'svg-icon($_icon, $_path)': () => new SassString('transparent'),
'svg-icon($_icon, $_path)': () => new sass.SassString('transparent'),
},
},
},