[ES|QL] Rename text-based-languages pugin to esql plugin (#187520)

## Summary

Renames `@kbn/text-based-languages` plugin to `@kbn/esql` plugin. This
has been discussed internally, the rationale is that now there will be
only one language: ES|QL; and we may use this plugin for ES|QL related
HTTP routes.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
Vadim Kibana 2024-07-09 16:16:32 +02:00 committed by GitHub
parent 1a6b1edf19
commit 7e4c8a83e1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
47 changed files with 70 additions and 75 deletions

2
.github/CODEOWNERS vendored
View file

@ -407,6 +407,7 @@ packages/kbn-eslint-plugin-imports @elastic/kibana-operations
packages/kbn-eslint-plugin-telemetry @elastic/obs-knowledge-team
examples/eso_model_version_example @elastic/kibana-security
x-pack/test/encrypted_saved_objects_api_integration/plugins/api_consumer_plugin @elastic/kibana-security
src/plugins/esql @elastic/kibana-esql
packages/kbn-esql-ast @elastic/kibana-esql
examples/esql_ast_inspector @elastic/kibana-esql
src/plugins/esql_datagrid @elastic/kibana-esql
@ -865,7 +866,6 @@ packages/kbn-test-jest-helpers @elastic/kibana-operations @elastic/appex-qa
packages/kbn-test-subj-selector @elastic/kibana-operations @elastic/appex-qa
x-pack/examples/testing_embedded_lens @elastic/kibana-visualizations
packages/kbn-text-based-editor @elastic/kibana-esql
src/plugins/text_based_languages @elastic/kibana-esql
x-pack/examples/third_party_lens_navigation_prompt @elastic/kibana-visualizations
x-pack/examples/third_party_vis_lens_example @elastic/kibana-visualizations
x-pack/plugins/threat_intelligence @elastic/security-threat-hunting-investigations

View file

@ -116,7 +116,7 @@
"serverlessPackages": "packages/serverless",
"coloring": "packages/kbn-coloring/src",
"languageDocumentationPopover": "packages/kbn-language-documentation-popover/src",
"textBasedLanguages": "src/plugins/text_based_languages",
"esql": "src/plugins/esql",
"esqlDataGrid": "src/plugins/esql_datagrid",
"statusPage": "src/legacy/core_plugins/status_page",
"telemetry": ["src/plugins/telemetry", "src/plugins/telemetry_management_section"],

View file

@ -102,6 +102,10 @@ This API doesn't support angular, for registering angular dev tools, bootstrap a
|Embeddables are React components that manage their own state, can be serialized and deserialized, and return an API that can be used to interact with them imperatively.
|{kib-repo}blob/{branch}/src/plugins/esql/README.md[esql]
|The editor accepts the following properties:
|{kib-repo}blob/{branch}/src/plugins/esql_datagrid/README.md[esqlDataGrid]
|Contains a Discover-like table specifically for ES|QL queries:
@ -328,10 +332,6 @@ generating deep links to other apps using locators, and creating short URLs.
|This plugin adds the Advanced Settings section for the Usage and Security Data collection (aka Telemetry).
|{kib-repo}blob/{branch}/src/plugins/text_based_languages/README.md[textBasedLanguages]
|The editor accepts the following properties:
|<<uiactions-plugin>>
|UI Actions plugins provides API to manage *triggers* and *actions*.

View file

@ -454,6 +454,7 @@
"@kbn/es-ui-shared-plugin": "link:src/plugins/es_ui_shared",
"@kbn/eso-model-version-example": "link:examples/eso_model_version_example",
"@kbn/eso-plugin": "link:x-pack/test/encrypted_saved_objects_api_integration/plugins/api_consumer_plugin",
"@kbn/esql": "link:src/plugins/esql",
"@kbn/esql-ast": "link:packages/kbn-esql-ast",
"@kbn/esql-ast-inspector-plugin": "link:examples/esql_ast_inspector",
"@kbn/esql-datagrid": "link:src/plugins/esql_datagrid",
@ -864,7 +865,6 @@
"@kbn/test-feature-usage-plugin": "link:x-pack/test/licensing_plugin/plugins/test_feature_usage",
"@kbn/testing-embedded-lens-plugin": "link:x-pack/examples/testing_embedded_lens",
"@kbn/text-based-editor": "link:packages/kbn-text-based-editor",
"@kbn/text-based-languages": "link:src/plugins/text_based_languages",
"@kbn/third-party-lens-navigation-prompt-plugin": "link:x-pack/examples/third_party_lens_navigation_prompt",
"@kbn/third-party-vis-lens-example-plugin": "link:x-pack/examples/third_party_vis_lens_example",
"@kbn/threat-intelligence-plugin": "link:x-pack/plugins/threat_intelligence",

View file

@ -42,6 +42,7 @@ pageLoadAssetSize:
embeddableEnhanced: 22107
enterpriseSearch: 66810
entityManager: 17175
esql: 37000
esqlDataGrid: 24582
esUiShared: 326654
eventAnnotation: 30000
@ -156,7 +157,6 @@ pageLoadAssetSize:
synthetics: 40958
telemetry: 51957
telemetryManagementSection: 38586
textBasedLanguages: 37000
threatIntelligence: 44299
timelines: 327300
transform: 41007

6
src/plugins/esql/.i18nrc.json Executable file
View file

@ -0,0 +1,6 @@
{
"prefix": "esql",
"paths": {
"esql": "."
}
}

View file

@ -1,4 +1,4 @@
# @kbn/text-based-languages
# @kbn/esql
## Component properties
The editor accepts the following properties:
@ -11,8 +11,8 @@ The editor accepts the following properties:
- isLoading: As the editor is not responsible for the data fetching request, the consumer could update this property when the data are being fetched. If this property is defined, the query history component will be rendered
```
To use it on your application, you need to add the textBasedLanguages to your requiredBundles and the @kbn/text-based-languages to your tsconfig.json and use the component like that:
import { TextBasedLangEditor } from '@kbn/text-based-languages/public';
To use it on your application, you need to add the textBasedLanguages to your requiredBundles and the @kbn/esql to your tsconfig.json and use the component like that:
import { TextBasedLangEditor } from '@kbn/esql/public';
<TextBasedLangEditor
query={query}

View file

@ -9,11 +9,9 @@
module.exports = {
preset: '@kbn/test',
rootDir: '../../..',
roots: ['<rootDir>/src/plugins/text_based_languages'],
coverageDirectory: '<rootDir>/target/kibana-coverage/jest/src/plugins/text_based_languages',
roots: ['<rootDir>/src/plugins/esql'],
coverageDirectory: '<rootDir>/target/kibana-coverage/jest/src/plugins/esql',
coverageReporters: ['text', 'html'],
collectCoverageFrom: [
'<rootDir>/src/plugins/text_based_languages/{common,public,server}/**/*.{js,ts,tsx}',
],
collectCoverageFrom: ['<rootDir>/src/plugins/esql/{common,public,server}/**/*.{js,ts,tsx}'],
setupFiles: ['jest-canvas-mock'],
};

View file

@ -1,9 +1,9 @@
{
"type": "plugin",
"id": "@kbn/text-based-languages",
"id": "@kbn/esql",
"owner": "@elastic/kibana-esql",
"plugin": {
"id": "textBasedLanguages",
"id": "esql",
"server": true,
"browser": true,
"optionalPlugins": [

View file

@ -1,5 +1,5 @@
{
"name": "@kbn/text-based-languages",
"name": "@kbn/esql",
"private": true,
"version": "1.0.0",
"license": "SSPL-1.0 OR Elastic License 2.0"

View file

@ -6,11 +6,11 @@
* Side Public License, v 1.
*/
import { TextBasedLanguagesPlugin } from './plugin';
import { EsqlPlugin } from './plugin';
export type { TextBasedLanguagesEditorProps } from '@kbn/text-based-editor';
export type { TextBasedLanguagesPluginStart } from './types';
export type { EsqlPluginStart } from './types';
export { TextBasedLangEditor } from './create_editor';
export function plugin() {
return new TextBasedLanguagesPlugin();
return new EsqlPlugin();
}

View file

@ -19,22 +19,22 @@ import {
} from './triggers';
import { setKibanaServices } from './kibana_services';
interface TextBasedLanguagesPluginStart {
interface EsqlPluginStart {
dataViews: DataViewsPublicPluginStart;
expressions: ExpressionsStart;
uiActions: UiActionsStart;
data: DataPublicPluginStart;
}
interface TextBasedLanguagesPluginSetup {
interface EsqlPluginSetup {
indexManagement: IndexManagementPluginSetup;
uiActions: UiActionsSetup;
}
export class TextBasedLanguagesPlugin implements Plugin<{}, void> {
export class EsqlPlugin implements Plugin<{}, void> {
private indexManagement?: IndexManagementPluginSetup;
public setup(_: CoreSetup, { indexManagement, uiActions }: TextBasedLanguagesPluginSetup) {
public setup(_: CoreSetup, { indexManagement, uiActions }: EsqlPluginSetup) {
this.indexManagement = indexManagement;
uiActions.registerTrigger(updateESQLQueryTrigger);
@ -44,7 +44,7 @@ export class TextBasedLanguagesPlugin implements Plugin<{}, void> {
public start(
core: CoreStart,
{ dataViews, expressions, data, uiActions }: TextBasedLanguagesPluginStart
{ dataViews, expressions, data, uiActions }: EsqlPluginStart
): void {
const appendESQLAction = new UpdateESQLQueryAction(data);
uiActions.addTriggerAction(UPDATE_ESQL_QUERY_TRIGGER, appendESQLAction);

View file

@ -25,7 +25,7 @@ export class UpdateESQLQueryAction implements Action<Context> {
constructor(protected readonly data: DataPublicPluginStart) {}
public getDisplayName(): string {
return i18n.translate('textBasedLanguages.updateESQLQueryLabel', {
return i18n.translate('esql.updateESQLQueryLabel', {
defaultMessage: 'Update the ES|QL query in the editor',
});
}

View file

@ -13,10 +13,10 @@ export const UPDATE_ESQL_QUERY_TRIGGER = 'UPDATE_ESQL_QUERY_TRIGGER';
export const updateESQLQueryTrigger: Trigger = {
id: UPDATE_ESQL_QUERY_TRIGGER,
title: i18n.translate('textBasedLanguages.triggers.updateEsqlQueryTrigger', {
title: i18n.translate('esql.triggers.updateEsqlQueryTrigger', {
defaultMessage: 'Update ES|QL query',
}),
description: i18n.translate('textBasedLanguages.triggers.updateEsqlQueryTriggerDescription', {
description: i18n.translate('esql.triggers.updateEsqlQueryTriggerDescription', {
defaultMessage: 'Update ES|QL query with a new one',
}),
};

View file

@ -7,6 +7,6 @@
*/
import { TextBasedLanguagesEditorProps } from '@kbn/text-based-editor';
export interface TextBasedLanguagesPluginStart {
export interface EsqlPluginStart {
Editor: React.ComponentType<TextBasedLanguagesEditorProps>;
}

View file

@ -7,6 +7,6 @@
*/
export const plugin = async () => {
const { TextBasedLanguagesServerPlugin } = await import('./plugin');
return new TextBasedLanguagesServerPlugin();
const { EsqlServerPlugin } = await import('./plugin');
return new EsqlServerPlugin();
};

View file

@ -9,7 +9,7 @@
import type { CoreSetup, CoreStart, Plugin } from '@kbn/core/server';
import { getUiSettings } from './ui_settings';
export class TextBasedLanguagesServerPlugin implements Plugin {
export class EsqlServerPlugin implements Plugin {
public setup(core: CoreSetup) {
core.uiSettings.register(getUiSettings());
return {};

View file

@ -14,17 +14,17 @@ import { ENABLE_ESQL } from '@kbn/esql-utils';
export const getUiSettings: () => Record<string, UiSettingsParams> = () => ({
[ENABLE_ESQL]: {
name: i18n.translate('textBasedLanguages.advancedSettings.enableESQLTitle', {
name: i18n.translate('esql.advancedSettings.enableESQLTitle', {
defaultMessage: 'Enable ES|QL',
}),
value: true,
description: i18n.translate('textBasedLanguages.advancedSettings.enableESQLDescription', {
description: i18n.translate('esql.advancedSettings.enableESQLDescription', {
defaultMessage:
'This setting enables ES|QL in Kibana. By switching it off you will hide the ES|QL user interface from various applications. However, users will be able to access existing ES|QL saved searches, visualizations, etc. If you have feedback on this experience please reach out to us on {link}',
values: {
link:
`<a href="https://ela.st/esql-feedback" target="_blank" rel="noopener">` +
i18n.translate('textBasedLanguages.advancedSettings.enableESQL.discussLinkText', {
i18n.translate('esql.advancedSettings.enableESQL.discussLinkText', {
defaultMessage: 'https://ela.st/esql-feedback',
}) +
'</a>',

View file

@ -1,6 +0,0 @@
{
"prefix": "textBasedLanguages",
"paths": {
"textBasedLanguages": "."
}
}

View file

@ -12,10 +12,7 @@ import { resolve } from 'path';
const mockConfig = {
resolve: {
alias: {
'@kbn/text-based-languages/public': resolve(
__dirname,
'../public/mocks/text_based_languages_editor.tsx'
),
'@kbn/esql/public': resolve(__dirname, '../public/mocks/text_based_languages_editor.tsx'),
},
},
};

View file

@ -27,7 +27,7 @@
"kibanaUtils",
"kibanaReact",
"data",
"textBasedLanguages"
"esql"
]
}
}

View file

@ -18,7 +18,7 @@ import {
isOfAggregateQueryType,
getLanguageDisplayName,
} from '@kbn/es-query';
import { TextBasedLangEditor } from '@kbn/text-based-languages/public';
import { TextBasedLangEditor } from '@kbn/esql/public';
import { EMPTY } from 'rxjs';
import { map } from 'rxjs';
import { throttle } from 'lodash';

View file

@ -37,7 +37,7 @@
"@kbn/react-field",
"@kbn/ui-theme",
"@kbn/saved-objects-management-plugin",
"@kbn/text-based-languages",
"@kbn/esql",
"@kbn/text-based-editor",
"@kbn/core-doc-links-browser",
"@kbn/core-lifecycle-browser",

View file

@ -808,6 +808,8 @@
"@kbn/eso-model-version-example/*": ["examples/eso_model_version_example/*"],
"@kbn/eso-plugin": ["x-pack/test/encrypted_saved_objects_api_integration/plugins/api_consumer_plugin"],
"@kbn/eso-plugin/*": ["x-pack/test/encrypted_saved_objects_api_integration/plugins/api_consumer_plugin/*"],
"@kbn/esql": ["src/plugins/esql"],
"@kbn/esql/*": ["src/plugins/esql/*"],
"@kbn/esql-ast": ["packages/kbn-esql-ast"],
"@kbn/esql-ast/*": ["packages/kbn-esql-ast/*"],
"@kbn/esql-ast-inspector-plugin": ["examples/esql_ast_inspector"],
@ -1724,8 +1726,6 @@
"@kbn/testing-embedded-lens-plugin/*": ["x-pack/examples/testing_embedded_lens/*"],
"@kbn/text-based-editor": ["packages/kbn-text-based-editor"],
"@kbn/text-based-editor/*": ["packages/kbn-text-based-editor/*"],
"@kbn/text-based-languages": ["src/plugins/text_based_languages"],
"@kbn/text-based-languages/*": ["src/plugins/text_based_languages/*"],
"@kbn/third-party-lens-navigation-prompt-plugin": ["x-pack/examples/third_party_lens_navigation_prompt"],
"@kbn/third-party-lens-navigation-prompt-plugin/*": ["x-pack/examples/third_party_lens_navigation_prompt/*"],
"@kbn/third-party-vis-lens-example-plugin": ["x-pack/examples/third_party_vis_lens_example"],

View file

@ -37,7 +37,7 @@
"fieldFormats",
"uiActions",
"lens",
"textBasedLanguages",
"esql",
"visualizations"
]
}

View file

@ -12,7 +12,7 @@ import React, { useCallback, useEffect, useMemo, useState } from 'react';
import { usePageUrlState } from '@kbn/ml-url-state';
import { FullTimeRangeSelector, DatePickerWrapper } from '@kbn/ml-date-picker';
import { TextBasedLangEditor } from '@kbn/text-based-languages/public';
import { TextBasedLangEditor } from '@kbn/esql/public';
import type { AggregateQuery } from '@kbn/es-query';
import {

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import React, { useRef, useState, useCallback } from 'react';
import { TextBasedLangEditor } from '@kbn/text-based-languages/public';
import { TextBasedLangEditor } from '@kbn/esql/public';
import { EuiFlexItem } from '@elastic/eui';
import type { AggregateQuery } from '@kbn/es-query';

View file

@ -68,7 +68,7 @@
"@kbn/security-plugin",
"@kbn/share-plugin",
"@kbn/test-jest-helpers",
"@kbn/text-based-languages",
"@kbn/esql",
"@kbn/ui-actions-plugin",
"@kbn/ui-theme",
"@kbn/unified-search-plugin",

View file

@ -56,7 +56,7 @@
"embeddable",
"fieldFormats",
"charts",
"textBasedLanguages",
"esql",
],
"extraPublicDirs": [
"common/constants"

View file

@ -26,7 +26,7 @@ import {
getLanguageDisplayName,
} from '@kbn/es-query';
import type { AggregateQuery, Query } from '@kbn/es-query';
import { TextBasedLangEditor } from '@kbn/text-based-languages/public';
import { TextBasedLangEditor } from '@kbn/esql/public';
import { DefaultInspectorAdapters } from '@kbn/expressions-plugin/common';
import { buildExpression } from '../../../editor_frame_service/editor_frame/expression_helpers';
import { MAX_NUM_OF_COLUMNS } from '../../../datasources/text_based/utils';

View file

@ -86,7 +86,7 @@
"@kbn/search-response-warnings",
"@kbn/logging",
"@kbn/core-plugins-server",
"@kbn/text-based-languages",
"@kbn/esql",
"@kbn/field-utils",
"@kbn/panel-loader",
"@kbn/shared-ux-button-toolbar",

View file

@ -49,7 +49,7 @@
"usageCollection",
"unifiedSearch",
"fieldFormats",
"textBasedLanguages",
"esql",
"savedObjects",
],
"extraPublicDirs": [

View file

@ -11,7 +11,7 @@ import { isEqual } from 'lodash';
import useMountedState from 'react-use/lib/useMountedState';
import type { AggregateQuery } from '@kbn/es-query';
import type { ESQLColumn } from '@kbn/es-types';
import { TextBasedLangEditor } from '@kbn/text-based-languages/public';
import { TextBasedLangEditor } from '@kbn/esql/public';
import { getESQLMeta, verifyGeometryColumn } from './esql_utils';
interface Props {

View file

@ -78,7 +78,7 @@
"@kbn/search-response-warnings",
"@kbn/calculate-width-from-char-count",
"@kbn/content-management-table-list-view-common",
"@kbn/text-based-languages",
"@kbn/esql",
"@kbn/es-types",
"@kbn/data-service",
"@kbn/code-editor",

View file

@ -22,7 +22,7 @@
],
"requiredBundles": [
"esUiShared",
"textBasedLanguages"
"esql"
],
"extraPublicDirs": ["common"]
}

View file

@ -17,7 +17,7 @@ import {
EuiSpacer,
} from '@elastic/eui';
import { getFields, RuleTypeParamsExpressionProps } from '@kbn/triggers-actions-ui-plugin/public';
import { TextBasedLangEditor } from '@kbn/text-based-languages/public';
import { TextBasedLangEditor } from '@kbn/esql/public';
import { fetchFieldsFromESQL } from '@kbn/text-based-editor';
import { getIndexPatternFromESQLQuery } from '@kbn/esql-utils';
import type { AggregateQuery } from '@kbn/es-query';

View file

@ -38,7 +38,7 @@
"@kbn/discover-plugin",
"@kbn/rule-data-utils",
"@kbn/alerts-as-data-utils",
"@kbn/text-based-languages",
"@kbn/esql",
"@kbn/text-based-editor",
"@kbn/expressions-plugin",
"@kbn/core-http-browser",

View file

@ -2525,8 +2525,8 @@
"unifiedDocViewer.sourceViewer.errorMessage": "Impossible de récupérer les données pour le moment. Actualisez l'onglet et réessayez.",
"unifiedDocViewer.sourceViewer.errorMessageTitle": "Une erreur s'est produite.",
"unifiedDocViewer.sourceViewer.refresh": "Actualiser",
"textBasedLanguages.advancedSettings.enableESQL.discussLinkText": "discuss.elastic.co/c/elastic-stack/kibana",
"textBasedLanguages.advancedSettings.enableESQLTitle": "Activer ES|QL",
"esql.advancedSettings.enableESQL.discussLinkText": "discuss.elastic.co/c/elastic-stack/kibana",
"esql.advancedSettings.enableESQLTitle": "Activer ES|QL",
"domDragDrop.announce.cancelled": "Mouvement annulé. {label} revenu à sa position initiale",
"domDragDrop.announce.cancelledItem": "Mouvement annulé. {label} revenu au groupe {groupLabel} à la position {position}",
"domDragDrop.announce.dropped.combineCompatible": "Combinaisons de {label} dans le {groupLabel} vers {dropLabel} dans le groupe {dropGroupLabel} à la position {dropPosition} dans le calque {dropLayerNumber}",

View file

@ -2522,8 +2522,8 @@
"unifiedDocViewer.sourceViewer.errorMessage": "現在データを取得できませんでした。タブを更新して、再試行してください。",
"unifiedDocViewer.sourceViewer.errorMessageTitle": "エラーが発生しました",
"unifiedDocViewer.sourceViewer.refresh": "更新",
"textBasedLanguages.advancedSettings.enableESQL.discussLinkText": "discuss.elastic.co/c/elastic-stack/kibana",
"textBasedLanguages.advancedSettings.enableESQLTitle": "ES|QLを有効化",
"esql.advancedSettings.enableESQL.discussLinkText": "discuss.elastic.co/c/elastic-stack/kibana",
"esql.advancedSettings.enableESQLTitle": "ES|QLを有効化",
"domDragDrop.announce.cancelled": "移動がキャンセルされました。{label}は初期位置に戻りました",
"domDragDrop.announce.cancelledItem": "移動がキャンセルされました。{label}は位置{position}の{groupLabel}グループに戻りました",
"domDragDrop.announce.dropped.combineCompatible": "レイヤー{dropLayerNumber}の位置{dropPosition}で、グループ{groupLabel}の{label}をグループ{dropGroupLabel}の{dropLabel}と結合しました",

View file

@ -2526,8 +2526,8 @@
"unifiedDocViewer.sourceViewer.errorMessage": "当前无法获取数据。请刷新选项卡以重试。",
"unifiedDocViewer.sourceViewer.errorMessageTitle": "发生错误",
"unifiedDocViewer.sourceViewer.refresh": "刷新",
"textBasedLanguages.advancedSettings.enableESQL.discussLinkText": "discuss.elastic.co/c/elastic-stack/kibana",
"textBasedLanguages.advancedSettings.enableESQLTitle": "启用 ES|QL",
"esql.advancedSettings.enableESQL.discussLinkText": "discuss.elastic.co/c/elastic-stack/kibana",
"esql.advancedSettings.enableESQLTitle": "启用 ES|QL",
"domDragDrop.announce.cancelled": "移动已取消。{label} 将返回至其初始位置",
"domDragDrop.announce.cancelledItem": "移动已取消。{label} 返回至 {groupLabel} 组中的位置 {position}",
"domDragDrop.announce.dropped.combineCompatible": "已将组 {groupLabel} 中的 {label} 组合到图层 {dropLayerNumber} 的组 {dropGroupLabel} 中的位置 {dropPosition} 上的 {dropLabel}",

View file

@ -4853,6 +4853,10 @@
version "0.0.0"
uid ""
"@kbn/esql@link:src/plugins/esql":
version "0.0.0"
uid ""
"@kbn/event-annotation-common@link:packages/kbn-event-annotation-common":
version "0.0.0"
uid ""
@ -6661,10 +6665,6 @@
version "0.0.0"
uid ""
"@kbn/text-based-languages@link:src/plugins/text_based_languages":
version "0.0.0"
uid ""
"@kbn/third-party-lens-navigation-prompt-plugin@link:x-pack/examples/third_party_lens_navigation_prompt":
version "0.0.0"
uid ""