mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
chore(NA): splits types from code on @kbn/react-field (#121516)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
78d15cd7f0
commit
8496a8b1a3
23 changed files with 48 additions and 41 deletions
|
@ -580,6 +580,7 @@
|
|||
"@types/kbn__optimizer": "link:bazel-bin/packages/kbn-optimizer/npm_module_types",
|
||||
"@types/kbn__plugin-generator": "link:bazel-bin/packages/kbn-plugin-generator/npm_module_types",
|
||||
"@types/kbn__plugin-helpers": "link:bazel-bin/packages/kbn-plugin-helpers/npm_module_types",
|
||||
"@types/kbn__react-field": "link:bazel-bin/packages/kbn-react-field/npm_module_types",
|
||||
"@types/license-checker": "15.0.0",
|
||||
"@types/listr": "^0.14.0",
|
||||
"@types/loader-utils": "^1.1.3",
|
||||
|
|
|
@ -98,6 +98,7 @@ filegroup(
|
|||
"//packages/kbn-optimizer:build_types",
|
||||
"//packages/kbn-plugin-generator:build_types",
|
||||
"//packages/kbn-plugin-helpers:build_types",
|
||||
"//packages/kbn-react-field:build_types",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
load("@npm//@bazel/typescript:index.bzl", "ts_config", "ts_project")
|
||||
load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm")
|
||||
load("//src/dev/bazel:index.bzl", "jsts_transpiler")
|
||||
load("@npm//@bazel/typescript:index.bzl", "ts_config")
|
||||
load("@build_bazel_rules_nodejs//:index.bzl", "js_library")
|
||||
load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project")
|
||||
|
||||
PKG_BASE_NAME = "kbn-react-field"
|
||||
PKG_REQUIRE_NAME = "@kbn/react-field"
|
||||
TYPES_PKG_REQUIRE_NAME = "@types/kbn__react-field"
|
||||
|
||||
SOURCE_FILES = glob(
|
||||
[
|
||||
|
@ -29,26 +30,22 @@ filegroup(
|
|||
NPM_MODULE_EXTRA_FILES = [
|
||||
"package.json",
|
||||
"README.md",
|
||||
"field_button/package.json",
|
||||
"field_icon/package.json",
|
||||
]
|
||||
|
||||
RUNTIME_DEPS = [
|
||||
"@npm//@elastic/eui",
|
||||
"@npm//classnames",
|
||||
"@npm//prop-types",
|
||||
"@npm//react",
|
||||
"@npm//classnames",
|
||||
"@npm//@elastic/eui",
|
||||
"//packages/kbn-i18n",
|
||||
]
|
||||
|
||||
TYPES_DEPS = [
|
||||
"//packages/kbn-i18n",
|
||||
"@npm//tslib",
|
||||
"@npm//@elastic/eui",
|
||||
"@npm//@types/classnames",
|
||||
"@npm//@types/jest",
|
||||
"@npm//@types/prop-types",
|
||||
"@npm//@types/classnames",
|
||||
"@npm//@types/react",
|
||||
"@npm//@elastic/eui",
|
||||
]
|
||||
|
||||
jsts_transpiler(
|
||||
|
@ -98,7 +95,7 @@ ts_project(
|
|||
js_library(
|
||||
name = PKG_BASE_NAME,
|
||||
srcs = NPM_MODULE_EXTRA_FILES,
|
||||
deps = RUNTIME_DEPS + [":target_node", ":target_webpack", ":tsc_types"],
|
||||
deps = RUNTIME_DEPS + [":target_node", ":target_webpack"],
|
||||
package_name = PKG_REQUIRE_NAME,
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
@ -117,3 +114,20 @@ filegroup(
|
|||
],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
pkg_npm_types(
|
||||
name = "npm_module_types",
|
||||
srcs = SRCS,
|
||||
deps = [":tsc_types"],
|
||||
package_name = TYPES_PKG_REQUIRE_NAME,
|
||||
tsconfig = ":tsconfig",
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "build_types",
|
||||
srcs = [
|
||||
":npm_module_types",
|
||||
],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
{
|
||||
"main": "../target_node/field_button/index.js",
|
||||
"browser": "../target_webpack/field_button/index.js",
|
||||
"types": "../target_types/field_button/index.d.ts"
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
{
|
||||
"main": "../target_node/field_icon/index.js",
|
||||
"browser": "../target_webpack/field_icon/index.js",
|
||||
"types": "../target_types/field_icon/index.d.ts"
|
||||
}
|
|
@ -2,7 +2,6 @@
|
|||
"name": "@kbn/react-field",
|
||||
"main": "./target_node/index.js",
|
||||
"browser": "./target_webpack/index.js",
|
||||
"types": "./target_types/index.d.ts",
|
||||
"version": "1.0.0",
|
||||
"license": "SSPL-1.0 OR Elastic License 2.0",
|
||||
"private": true
|
||||
|
|
|
@ -24,8 +24,7 @@ import {
|
|||
import { i18n } from '@kbn/i18n';
|
||||
import { UiCounterMetricType } from '@kbn/analytics';
|
||||
import classNames from 'classnames';
|
||||
import { FieldIcon } from '@kbn/react-field/field_icon';
|
||||
import { FieldButton } from '@kbn/react-field/field_button';
|
||||
import { FieldButton, FieldIcon } from '@kbn/react-field';
|
||||
import { DiscoverFieldDetails } from './discover_field_details';
|
||||
import { FieldDetails } from './types';
|
||||
import { IndexPatternField, IndexPattern } from '../../../../../../data/public';
|
||||
|
|
|
@ -11,7 +11,7 @@ import './field_name.scss';
|
|||
import { EuiBadge, EuiFlexGroup, EuiFlexItem, EuiToolTip } from '@elastic/eui';
|
||||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { FieldIcon, FieldIconProps } from '@kbn/react-field/field_icon';
|
||||
import { FieldIcon, FieldIconProps } from '@kbn/react-field';
|
||||
import { getFieldTypeName } from './field_type_name';
|
||||
import { IndexPatternField } from '../../../../data/public';
|
||||
import { getFieldSubtypeMulti } from '../../../../data/common';
|
||||
|
|
|
@ -11,8 +11,7 @@ import { sortBy, uniq } from 'lodash';
|
|||
import React, { useState } from 'react';
|
||||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
import { EuiFlexGroup, EuiFlexItem, EuiPanel, EuiText } from '@elastic/eui';
|
||||
import { FieldIcon } from '@kbn/react-field/field_icon';
|
||||
import { FieldButton } from '@kbn/react-field/field_button';
|
||||
import { FieldButton, FieldIcon } from '@kbn/react-field';
|
||||
|
||||
import { FieldSearch } from './field_search';
|
||||
import { DataView, DataViewField } from '../../../../data_views/common';
|
||||
|
|
|
@ -21,7 +21,7 @@ import {
|
|||
EuiSpacer,
|
||||
EuiPopoverTitle,
|
||||
} from '@elastic/eui';
|
||||
import { FieldIcon } from '@kbn/react-field/field_icon';
|
||||
import { FieldIcon } from '@kbn/react-field';
|
||||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
|
||||
export interface Props {
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
import React, { FC } from 'react';
|
||||
import { EuiToolTip } from '@elastic/eui';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { FieldIcon } from '@kbn/react-field/field_icon';
|
||||
import { FieldIcon } from '@kbn/react-field';
|
||||
import { getJobTypeLabel } from '../../util/field_types_utils';
|
||||
import type { JobFieldType } from '../../../../../common';
|
||||
import './_index.scss';
|
||||
|
|
|
@ -25,7 +25,7 @@ import {
|
|||
EuiIconTip,
|
||||
} from '@elastic/eui';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { FieldIcon } from '@kbn/react-field/field_icon';
|
||||
import { FieldIcon } from '@kbn/react-field';
|
||||
import classNames from 'classnames';
|
||||
import { WorkspaceField } from '../../types';
|
||||
import { iconChoices } from '../../helpers/style_choices';
|
||||
|
|
|
@ -9,7 +9,7 @@ import React, { useState, useEffect, ReactNode } from 'react';
|
|||
import { EuiPopover, EuiSelectable, EuiBadge } from '@elastic/eui';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import classNames from 'classnames';
|
||||
import { FieldIcon } from '@kbn/react-field/field_icon';
|
||||
import { FieldIcon } from '@kbn/react-field';
|
||||
import { WorkspaceField } from '../../types';
|
||||
|
||||
export interface FieldPickerProps {
|
||||
|
|
|
@ -36,7 +36,7 @@ import {
|
|||
TooltipType,
|
||||
} from '@elastic/charts';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { FieldButton } from '@kbn/react-field/field_button';
|
||||
import { FieldButton } from '@kbn/react-field';
|
||||
import type { FieldFormatsStart } from 'src/plugins/field_formats/public';
|
||||
import { EuiHighlight } from '@elastic/eui';
|
||||
import { Filter, buildEsQuery } from '@kbn/es-query';
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { FieldIcon, FieldIconProps } from '@kbn/react-field/field_icon';
|
||||
import { FieldIcon, FieldIconProps } from '@kbn/react-field';
|
||||
import { DataType } from '../types';
|
||||
import { normalizeOperationDataType } from './pure_utils';
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ import {
|
|||
EuiSpacer,
|
||||
} from '@elastic/eui';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { FieldIcon } from '@kbn/react-field/field_icon';
|
||||
import { FieldIcon } from '@kbn/react-field';
|
||||
import _ from 'lodash';
|
||||
import { MVTFieldDescriptor } from '../../../../common/descriptor_types';
|
||||
import { MVT_FIELD_TYPE } from '../../../../common/constants';
|
||||
|
|
|
@ -16,7 +16,7 @@ import {
|
|||
EuiFlexItem,
|
||||
} from '@elastic/eui';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { FieldIcon } from '@kbn/react-field/field_icon';
|
||||
import { FieldIcon } from '@kbn/react-field';
|
||||
import { FIELD_ORIGIN, VECTOR_STYLES } from '../../../../../common/constants';
|
||||
import { StyleField } from '../style_fields_helper';
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ import {
|
|||
EuiFlexItem,
|
||||
EuiToolTip,
|
||||
} from '@elastic/eui';
|
||||
import { FieldIcon } from '@kbn/react-field/field_icon';
|
||||
import { FieldIcon } from '@kbn/react-field';
|
||||
import { IndexPatternField } from 'src/plugins/data/public';
|
||||
|
||||
function fieldsToOptions(
|
||||
|
|
|
@ -21,7 +21,7 @@ import {
|
|||
} from '@elastic/eui';
|
||||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { FieldIcon } from '@kbn/react-field/field_icon';
|
||||
import { FieldIcon } from '@kbn/react-field';
|
||||
|
||||
export type FieldProps = {
|
||||
label: string;
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
import React from 'react';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
import { FieldIcon } from '@kbn/react-field/field_icon';
|
||||
import { FieldIcon } from '@kbn/react-field';
|
||||
import {
|
||||
KibanaContextProvider,
|
||||
KibanaReactContextValue,
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
import React from 'react';
|
||||
import { EuiFlexGroup, EuiFlexItem, EuiBadge, EuiText, EuiToolTip } from '@elastic/eui';
|
||||
import { isEmpty } from 'lodash';
|
||||
import { FieldIcon } from '@kbn/react-field/field_icon';
|
||||
import { FieldIcon } from '@kbn/react-field';
|
||||
import * as i18n from '../translations';
|
||||
import type { DataViewField } from '../../../../../../../../src/plugins/data_views/common';
|
||||
import { getExampleText } from '../helpers';
|
||||
|
|
|
@ -14,7 +14,7 @@ import {
|
|||
EuiFlexGroup,
|
||||
EuiFlexItem,
|
||||
} from '@elastic/eui';
|
||||
import { FieldIcon } from '@kbn/react-field/field_icon';
|
||||
import { FieldIcon } from '@kbn/react-field';
|
||||
import { IFieldType } from 'src/plugins/data/public';
|
||||
|
||||
function fieldsToOptions(fields?: IFieldType[]): Array<EuiComboBoxOptionOption<IFieldType>> {
|
||||
|
|
|
@ -5884,6 +5884,10 @@
|
|||
version "0.0.0"
|
||||
uid ""
|
||||
|
||||
"@types/kbn__react-field@link:bazel-bin/packages/kbn-react-field/npm_module_types":
|
||||
version "0.0.0"
|
||||
uid ""
|
||||
|
||||
"@types/keyv@*":
|
||||
version "3.1.1"
|
||||
resolved "https://registry.yarnpkg.com/@types/keyv/-/keyv-3.1.1.tgz#e45a45324fca9dab716ab1230ee249c9fb52cfa7"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue