[8.0] chore(NA): splits types from code on @kbn/i18n (#119256) (#119649)

* chore(NA): splits types from code on @kbn/i18n (#119256)

* chore(NA): auto creation of the package.json for the new types pkg rule

* chore(NA): first alpha api extractor working version

* chore(NA): support kbn-analytics

* chore(NA): correctly read tsconfig files and deps from ts_config rule

* chore(NA): layed out pkg_npm_types tree artifact custom rule

* chore(NA): missing todos

* chore(NA): node modules link mapping

* chore(NA): fully working pkg_npm_types rule

* chore(NA): fix changes on new packages using elastic datemath pkgs

* docs(NA): remove todo

* docs(NA): last todo text correction

* chore(NA): removed commented lines

* fix(NA): include missing package version

* chore(NA): include license keys

* chore(NA): change mock types package into private

* chore(NA): disable validator on ts_project rule

* chore(NA): use the wrapper for ts_project

* commit using @elastic.co

* chore(NA): commit using @elastic.co

* chore(NA): split types from code on @kbn/i18n

* chore(NA): update yarn.lock file

* chore(NA): split @kbn/i18n and @kbn/i18n-react

* chore(NA): missing import fix

* chore(NA): fix jest project configs

* chore(NA): change imports on kbn i18n

* chore(NA): change imports on kbn i18n

* chore(NA): correct loader imports

* chore(NA): missnig i18nLoader export key

* chore(NA): fix type exports

* chore(NA): export type only

* chore(NA): export type only

* fix(NA): type exports

* chore(NA): missing @Kbn/i18n/react imports

* chore(NA): missing skip path for kbn-i18n-react

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
# Conflicts:
#	package.json
#	packages/BUILD.bazel
#	packages/kbn-monaco/BUILD.bazel
#	src/core/public/core_app/status/components/server_status.tsx
#	src/core/public/core_app/status/components/status_table.tsx
#	src/core/public/core_app/status/components/version_header.tsx
#	src/core/public/core_app/status/status_app.tsx
#	src/plugins/console/public/application/components/storage_quota_error.tsx
#	src/plugins/dashboard/public/application/listing/dashboard_listing.tsx
#	src/plugins/data_view_field_editor/public/components/field_editor/form_fields/script_field.tsx
#	src/plugins/dev_tools/public/application.tsx
#	src/plugins/discover/public/application/apps/context/context_app_route.tsx
#	src/plugins/discover/public/application/apps/doc/single_doc_route.tsx
#	src/plugins/discover/public/application/apps/main/components/doc_table/components/table_row_details.tsx
#	src/plugins/discover/public/application/apps/main/components/layout/discover_documents.tsx
#	src/plugins/discover/public/application/components/table/table_columns.tsx
#	src/plugins/discover/public/application/components/table/table_row_btn_filter_remove.tsx
#	src/plugins/discover/public/application/components/table/table_row_btn_toggle_column.tsx
#	src/plugins/index_pattern_editor/public/open_editor.tsx
#	src/plugins/interactive_setup/public/plugin.tsx
#	src/plugins/kibana_overview/public/application.tsx
#	src/plugins/kibana_react/public/util/to_mount_point.tsx
#	src/plugins/presentation_util/public/components/field_picker/field_search.tsx
#	src/plugins/vis_types/timeseries/public/timeseries_vis_renderer.tsx
#	src/plugins/vis_types/xy/public/vis_renderer.tsx
#	src/plugins/visualizations/public/wizard/show_new_vis.tsx
#	x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_create_from_csv/error_display.tsx
#	x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_create_from_csv/instructions.tsx
#	x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_create_from_csv/main.tsx
#	x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_create_from_csv/pipelines_csv_uploader.tsx
#	x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_create_from_csv/pipelines_preview.tsx
#	x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_list/empty_list.tsx
#	x-pack/plugins/lens/public/editor_frame_service/editor_frame/suggestion_panel.tsx
#	x-pack/plugins/lens/public/indexpattern_datasource/utils.tsx
#	x-pack/plugins/lens/public/metric_visualization/visualization.tsx
#	x-pack/plugins/lens/public/pie_visualization/render_function.tsx
#	x-pack/plugins/maps/public/classes/sources/ems_tms_source/update_source_editor.js
#	x-pack/plugins/maps/public/classes/sources/es_search_source/util/scaling_documenation_popover.tsx
#	x-pack/plugins/security/public/authentication/access_agreement/access_agreement_page.tsx
#	x-pack/plugins/security/public/authentication/logged_out/logged_out_page.tsx
#	x-pack/plugins/security/public/authentication/login/login_page.tsx
#	x-pack/plugins/security/public/authentication/overwritten_session/overwritten_session_page.tsx
#	x-pack/plugins/security/public/management/users/users_management_app.tsx
#	x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/form/index.tsx
#	x-pack/plugins/spaces/public/space_selector/space_selector.tsx
#	yarn.lock

* chore(NA): missing @kbn/i18n/react imports
This commit is contained in:
Tiago Costa 2021-11-24 19:19:43 +00:00 committed by GitHub
parent d862acfdaa
commit beb041b24f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2054 changed files with 2330 additions and 2082 deletions

View file

@ -120,7 +120,7 @@ To localize strings in React, use either `FormattedMessage` or `i18n.translate`.
["source","js"]
-----------
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n/react';
import { FormattedMessage } from '@kbn/i18n-react';
export const Component = () => {
return (

View file

@ -8,7 +8,7 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { FormattedMessage } from '@kbn/i18n/react';
import { FormattedMessage } from '@kbn/i18n-react';
import { EuiEmptyPrompt } from '@elastic/eui';
import { InspectorViewProps, Adapters } from '../../../../src/plugins/inspector/public';
import { AstDebugView } from './ast_debug_view';

View file

@ -8,7 +8,7 @@
import React, { useEffect } from 'react';
import { BrowserRouter as Router } from 'react-router-dom';
import { FormattedMessage, I18nProvider } from '@kbn/i18n/react';
import { FormattedMessage, I18nProvider } from '@kbn/i18n-react';
import {
EuiPage,

View file

@ -9,7 +9,7 @@
import React from 'react';
import ReactDOM from 'react-dom';
import { Router, Route, Redirect } from 'react-router-dom';
import { I18nProvider } from '@kbn/i18n/react';
import { I18nProvider } from '@kbn/i18n-react';
import { AppMountParameters, CoreStart } from '../../../src/core/public';
import { AppPluginStartDependencies } from './types';
import { SearchExamplePage, ExampleLink } from './common/example_page';

View file

@ -8,7 +8,7 @@
import React, { useState, useEffect } from 'react';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n/react';
import { FormattedMessage } from '@kbn/i18n-react';
import {
EuiButtonEmpty,

View file

@ -132,6 +132,7 @@
"@kbn/es-query": "link:bazel-bin/packages/kbn-es-query",
"@kbn/field-types": "link:bazel-bin/packages/kbn-field-types",
"@kbn/i18n": "link:bazel-bin/packages/kbn-i18n",
"@kbn/i18n-react": "link:bazel-bin/packages/kbn-i18n-react",
"@kbn/interpreter": "link:bazel-bin/packages/kbn-interpreter",
"@kbn/io-ts-utils": "link:bazel-bin/packages/kbn-io-ts-utils",
"@kbn/logging": "link:bazel-bin/packages/kbn-logging",
@ -550,6 +551,8 @@
"@types/json-stable-stringify": "^1.0.32",
"@types/json5": "^0.0.30",
"@types/kbn__ace": "link:bazel-bin/packages/kbn-ace/npm_module_types",
"@types/kbn__i18n": "link:bazel-bin/packages/kbn-i18n/npm_module_types",
"@types/kbn__i18n-react": "link:bazel-bin/packages/kbn-i18n-react/npm_module_types",
"@types/license-checker": "15.0.0",
"@types/listr": "^0.14.0",
"@types/loader-utils": "^1.1.3",

View file

@ -27,6 +27,7 @@ filegroup(
"//packages/kbn-expect:build",
"//packages/kbn-field-types:build",
"//packages/kbn-i18n:build",
"//packages/kbn-i18n-react:build",
"//packages/kbn-interpreter:build",
"//packages/kbn-io-ts-utils:build",
"//packages/kbn-logging:build",
@ -76,6 +77,8 @@ filegroup(
"//packages/elastic-apm-synthtrace:build_types",
"//packages/elastic-datemath:build_types",
"//packages/kbn-ace:build_types",
"//packages/kbn-i18n:build_types",
"//packages/kbn-i18n-react:build_types",
],
)

View file

@ -79,8 +79,8 @@ module.exports = {
},
{
from: 'react-intl',
to: '@kbn/i18n/react',
disallowedMessage: `import from @kbn/i18n/react instead`
to: '@kbn/i18n-react',
disallowedMessage: `import from @kbn/i18n-react instead`
},
{
from: 'styled-components',

View file

@ -38,9 +38,10 @@ RUNTIME_DEPS = [
]
TYPES_DEPS = [
"//packages/kbn-i18n",
"//packages/kbn-i18n:npm_module_types",
"@npm//@elastic/eui",
"@npm//resize-observer-polyfill",
"@npm//tslib",
"@npm//@types/enzyme",
"@npm//@types/jest",
"@npm//@types/node",

View file

@ -49,7 +49,7 @@ TYPES_DEPS = [
"//packages/kbn-logging",
"//packages/kbn-std",
"//packages/kbn-utility-types",
"//packages/kbn-i18n",
"//packages/kbn-i18n:npm_module_types",
"@npm//load-json-file",
"@npm//rxjs",
"@npm//@types/jest",

View file

@ -38,13 +38,13 @@ RUNTIME_DEPS = [
"@npm//load-json-file",
"@npm//lodash",
"@npm//moment-timezone",
"@npm//tslib",
]
TYPES_DEPS = [
"//packages/kbn-utility-types",
"//packages/kbn-i18n",
"//packages/kbn-i18n:npm_module_types",
"@npm//@elastic/elasticsearch",
"@npm//tslib",
"@npm//@types/jest",
"@npm//@types/lodash",
"@npm//@types/moment-timezone",

View file

@ -0,0 +1,123 @@
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-i18n-react"
PKG_REQUIRE_NAME = "@kbn/i18n-react"
TYPES_PKG_REQUIRE_NAME = "@types/kbn__i18n-react"
SOURCE_FILES = glob(
[
"src/**/*.ts",
"src/**/*.tsx",
],
exclude = [
"**/*.test.*",
"**/__snapshots__/**",
],
)
SRCS = SOURCE_FILES
filegroup(
name = "srcs",
srcs = SRCS,
)
NPM_MODULE_EXTRA_FILES = [
"package.json",
"README.md"
]
RUNTIME_DEPS = [
"//packages/kbn-i18n",
"@npm//prop-types",
"@npm//react",
"@npm//react-intl"
]
TYPES_DEPS = [
"//packages/kbn-i18n:npm_module_types",
"@npm//tslib",
"@npm//@types/jest",
"@npm//@types/node",
"@npm//@types/prop-types",
"@npm//@types/react",
"@npm//@types/react-intl",
]
jsts_transpiler(
name = "target_node",
srcs = SRCS,
build_pkg_name = package_name(),
)
jsts_transpiler(
name = "target_web",
srcs = SRCS,
build_pkg_name = package_name(),
web = True,
)
ts_config(
name = "tsconfig",
src = "tsconfig.json",
deps = [
"//:tsconfig.base.json",
"//:tsconfig.bazel.json",
],
)
ts_project(
name = "tsc_types",
args = ['--pretty'],
srcs = SRCS,
deps = TYPES_DEPS,
declaration = True,
declaration_map = True,
emit_declaration_only = True,
out_dir = "target_types",
source_map = True,
root_dir = "src",
tsconfig = ":tsconfig",
)
js_library(
name = PKG_BASE_NAME,
srcs = NPM_MODULE_EXTRA_FILES,
deps = RUNTIME_DEPS + [":target_node", ":target_web"],
package_name = PKG_REQUIRE_NAME,
visibility = ["//visibility:public"],
)
pkg_npm(
name = "npm_module",
deps = [
":%s" % PKG_BASE_NAME,
]
)
filegroup(
name = "build",
srcs = [
":npm_module",
],
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"],
)

View file

@ -0,0 +1,3 @@
# I18n-React
Please check the [@kbn/I18n README](../kbn-i18n/README.md) for all the information

View file

@ -0,0 +1,14 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
module.exports = {
preset: '@kbn/test',
rootDir: '../..',
roots: ['<rootDir>/packages/kbn-i18n-react'],
testRunner: 'jasmine2',
};

View file

@ -0,0 +1,8 @@
{
"name": "@kbn/i18n-react",
"browser": "./target_web/browser.js",
"main": "./target_node/index.js",
"version": "1.0.0",
"license": "SSPL-1.0 OR Elastic License 2.0",
"private": true
}

View file

@ -12,7 +12,7 @@ import * as React from 'react';
// eslint-disable-next-line @kbn/eslint/module_migration
import { IntlProvider } from 'react-intl';
import * as i18n from '../core';
import { i18n } from '@kbn/i18n';
import { PseudoLocaleWrapper } from './pseudo_locale_wrapper';
/**

View file

@ -8,8 +8,7 @@
import * as PropTypes from 'prop-types';
import * as React from 'react';
import * as i18n from '../core';
import { isPseudoLocale, translateUsingPseudoLocale } from '../core/pseudo_locale';
import { i18n } from '@kbn/i18n';
/**
* To translate label that includes nested `FormattedMessage` instances React Intl
@ -26,11 +25,11 @@ function translateFormattedMessageUsingPseudoLocale(message: string) {
if (formattedMessageDelimiter !== null) {
return message
.split(formattedMessageDelimiter[0])
.map((part) => (part.startsWith('ELEMENT-') ? part : translateUsingPseudoLocale(part)))
.map((part) => (part.startsWith('ELEMENT-') ? part : i18n.translateUsingPseudoLocale(part)))
.join(formattedMessageDelimiter[0]);
}
return translateUsingPseudoLocale(message);
return i18n.translateUsingPseudoLocale(message);
}
/**
@ -51,7 +50,7 @@ export class PseudoLocaleWrapper extends React.PureComponent {
constructor(props: { children: React.ReactNode }, context: any) {
super(props, context);
if (isPseudoLocale(i18n.getLocale())) {
if (i18n.isPseudoLocale(i18n.getLocale())) {
const formatMessage = context.intl.formatMessage;
context.intl.formatMessage = (...args: any[]) =>
translateFormattedMessageUsingPseudoLocale(formatMessage(...args));

View file

@ -0,0 +1,19 @@
{
"extends": "../../tsconfig.bazel.json",
"compilerOptions": {
"declaration": true,
"declarationMap": true,
"emitDeclarationOnly": true,
"outDir": "./target_types",
"sourceMap": true,
"sourceRoot": "../../../../../packages/kbn-i18n-react/src",
"types": [
"jest",
"node"
]
},
"include": [
"src/**/*.ts",
"src/**/*.tsx",
],
}

View file

@ -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-i18n"
PKG_REQUIRE_NAME = "@kbn/i18n"
TYPES_PKG_REQUIRE_NAME = "@types/kbn__i18n"
SOURCE_FILES = glob(
[
@ -27,7 +28,6 @@ filegroup(
)
NPM_MODULE_EXTRA_FILES = [
"react/package.json",
"package.json",
"GUIDELINE.md",
"README.md"
@ -37,21 +37,14 @@ RUNTIME_DEPS = [
"@npm//intl-format-cache",
"@npm//intl-messageformat",
"@npm//intl-relativeformat",
"@npm//prop-types",
"@npm//react",
"@npm//react-intl"
]
TYPES_DEPS = [
"//packages/kbn-babel-preset",
"@npm//intl-messageformat",
"@npm//tslib",
"@npm//@types/intl-relativeformat",
"@npm//@types/jest",
"@npm//@types/node",
"@npm//@types/prop-types",
"@npm//@types/react",
"@npm//@types/react-intl",
]
jsts_transpiler(
@ -93,7 +86,7 @@ ts_project(
js_library(
name = PKG_BASE_NAME,
srcs = NPM_MODULE_EXTRA_FILES,
deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"],
deps = RUNTIME_DEPS + [":target_node", ":target_web"],
package_name = PKG_REQUIRE_NAME,
visibility = ["//visibility:public"],
)
@ -112,3 +105,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"],
)

View file

@ -201,7 +201,7 @@ uses I18n engine under the hood:
```js
import React from 'react';
import ReactDOM from 'react-dom';
import { I18nProvider } from '@kbn/i18n/react';
import { I18nProvider } from '@kbn/i18n-react';
ReactDOM.render(
<I18nProvider>
@ -216,7 +216,7 @@ ReactDOM.render(
After that we can use `FormattedMessage` components inside `RootComponent`:
```jsx
import React, { Component } from 'react';
import { FormattedMessage } from '@kbn/i18n/react';
import { FormattedMessage } from '@kbn/i18n-react';
class RootComponent extends Component {
constructor(props) {
@ -292,7 +292,7 @@ React component as a pure function:
```js
import React from 'react';
import { injectI18n, intlShape } from '@kbn/i18n/react';
import { injectI18n, intlShape } from '@kbn/i18n-react';
export const MyComponent = injectI18n({ intl }) => (
<input
@ -318,7 +318,7 @@ React component as a class:
```js
import React from 'react';
import { injectI18n, intlShape } from '@kbn/i18n/react';
import { injectI18n, intlShape } from '@kbn/i18n-react';
export const MyComponent = injectI18n(
class MyComponent extends React.Component {

View file

@ -2,7 +2,6 @@
"name": "@kbn/i18n",
"browser": "./target_web/browser.js",
"main": "./target_node/index.js",
"types": "./target_types/index.d.ts",
"version": "1.0.0",
"license": "SSPL-1.0 OR Elastic License 2.0",
"private": true

View file

@ -1,5 +0,0 @@
{
"browser": "../target_web/react",
"main": "../target_node/react",
"types": "../target_types/react/index.d.ts"
}

View file

@ -152,7 +152,7 @@ export function getRegisteredLocales() {
return Object.keys(translationsForLocale);
}
interface TranslateArguments {
export interface TranslateArguments {
values?: Record<string, string | number | boolean | Date | null | undefined>;
defaultMessage: string;
description?: string;

View file

@ -6,5 +6,7 @@
* Side Public License, v 1.
*/
export type { Formats } from './formats';
export { formats } from './formats';
export * from './i18n';
export * from './pseudo_locale';

View file

@ -6,8 +6,60 @@
* Side Public License, v 1.
*/
import * as i18nCore from './core';
import * as loader from './loader';
import {
formats,
addTranslation,
getTranslation,
setLocale,
getLocale,
setDefaultLocale,
getDefaultLocale,
setFormats,
getFormats,
getRegisteredLocales,
translate,
init,
load,
isPseudoLocale,
translateUsingPseudoLocale,
} from './core';
export const i18n = i18nCore;
export const i18nLoader = loader;
import {
registerTranslationFile,
registerTranslationFiles,
getTranslationsByLocale,
getAllTranslations,
getAllTranslationsFromPaths,
getRegisteredLocales as getRegisteredLocalesForLoader,
} from './loader';
const i18n = {
formats,
addTranslation,
getTranslation,
setLocale,
getLocale,
setDefaultLocale,
getDefaultLocale,
setFormats,
getFormats,
getRegisteredLocales,
translate,
init,
load,
isPseudoLocale,
translateUsingPseudoLocale,
};
const i18nLoader = {
registerTranslationFile,
registerTranslationFiles,
getTranslationsByLocale,
getAllTranslations,
getAllTranslationsFromPaths,
getRegisteredLocales: getRegisteredLocalesForLoader,
};
export type { Translation } from './translation';
export type { Formats, TranslateArguments } from './core';
export { i18n, i18nLoader };

View file

@ -39,9 +39,11 @@ RUNTIME_DEPS = [
]
TYPES_DEPS = [
"//packages/kbn-i18n",
"//packages/kbn-i18n:npm_module_types",
"@npm//antlr4ts",
"@npm//monaco-editor",
"@npm//rxjs",
"@npm//tslib",
"@npm//@types/jest",
"@npm//@types/node",
]

View file

@ -1,6 +1,6 @@
import React, { useState } from 'react';
import { i18n } from '@kbn/i18n';
import { FormattedMessage, I18nProvider } from '@kbn/i18n/react';
import { FormattedMessage, I18nProvider } from '@kbn/i18n-react';
import { BrowserRouter as Router } from 'react-router-dom';
import {

View file

@ -37,7 +37,7 @@ NPM_MODULE_EXTRA_FILES = [
RUNTIME_DEPS = [
"//packages/kbn-dev-utils",
"//packages/kbn-i18n",
"//packages/kbn-i18n-react",
"//packages/kbn-std",
"//packages/kbn-utils",
"@npm//@elastic/elasticsearch",
@ -73,7 +73,7 @@ RUNTIME_DEPS = [
TYPES_DEPS = [
"//packages/kbn-dev-utils",
"//packages/kbn-i18n",
"//packages/kbn-i18n-react:npm_module_types",
"//packages/kbn-utils",
"@npm//@elastic/elasticsearch",
"@npm//del",

View file

@ -13,7 +13,7 @@
* intl context around them.
*/
import { I18nProvider, InjectedIntl, intlShape, __IntlProvider } from '@kbn/i18n/react';
import { I18nProvider, InjectedIntl, intlShape, __IntlProvider } from '@kbn/i18n-react';
import { mount, ReactWrapper, render, shallow } from 'enzyme';
import React, { ReactElement, ValidationMap } from 'react';
import { act as reactAct } from 'react-dom/test-utils';

View file

@ -35,6 +35,7 @@ RUNTIME_DEPS = [
"//packages/kbn-analytics",
"//packages/kbn-babel-preset",
"//packages/kbn-i18n",
"//packages/kbn-i18n-react",
"//packages/kbn-monaco",
"//packages/kbn-std",
"//packages/kbn-ui-shared-deps-npm",
@ -45,7 +46,8 @@ TYPES_DEPS = [
"//packages/elastic-safer-lodash-set",
"//packages/kbn-analytics",
"//packages/kbn-babel-preset",
"//packages/kbn-i18n",
"//packages/kbn-i18n:npm_module_types",
"//packages/kbn-i18n-react:npm_module_types",
"//packages/kbn-monaco",
"//packages/kbn-std",
"//packages/kbn-ui-shared-deps-npm",

View file

@ -15,7 +15,7 @@ require('./flot_charts');
// stateful deps
export const KbnI18n = require('@kbn/i18n');
export const KbnI18nReact = require('@kbn/i18n/react');
export const KbnI18nReact = require('@kbn/i18n-react');
export const EmotionReact = require('@emotion/react');
export const Moment = require('moment');
export const MomentTimezone = require('moment-timezone/moment-timezone');

View file

@ -31,7 +31,7 @@ exports.externals = {
* stateful deps
*/
'@kbn/i18n': '__kbnSharedDeps__.KbnI18n',
'@kbn/i18n/react': '__kbnSharedDeps__.KbnI18nReact',
'@kbn/i18n-react': '__kbnSharedDeps__.KbnI18nReact',
'@emotion/react': '__kbnSharedDeps__.EmotionReact',
jquery: '__kbnSharedDeps__.Jquery',
moment: '__kbnSharedDeps__.Moment',

View file

@ -9,7 +9,7 @@
import React, { ReactElement } from 'react';
import { act } from 'react-dom/test-utils';
import { mount } from 'enzyme';
import { I18nProvider } from '@kbn/i18n/react';
import { I18nProvider } from '@kbn/i18n-react';
import { AppMountParameters } from '../types';
import { MockedMounterTuple, Mountable } from '../test_types';

View file

@ -8,7 +8,7 @@
import { EuiEmptyPrompt, EuiPage, EuiPageBody, EuiPageContent } from '@elastic/eui';
import React from 'react';
import { FormattedMessage } from '@kbn/i18n/react';
import { FormattedMessage } from '@kbn/i18n-react';
export const AppNotFound = () => (
<EuiPage style={{ minHeight: '100%' }} data-test-subj="appNotFoundPageContent">

View file

@ -7,7 +7,7 @@
*/
import React from 'react';
import { FormattedMessage } from '@kbn/i18n/react';
import { FormattedMessage } from '@kbn/i18n-react';
import { BehaviorSubject, combineLatest, merge, Observable, of, ReplaySubject } from 'rxjs';
import { flatMap, map, takeUntil } from 'rxjs/operators';
import { parse } from 'url';

View file

@ -9,7 +9,7 @@
import React, { Component, Fragment } from 'react';
import { combineLatest, Observable, Subscription } from 'rxjs';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n/react';
import { FormattedMessage } from '@kbn/i18n-react';
import {
EuiButtonEmpty,
EuiButtonEmptyProps,

View file

@ -10,7 +10,7 @@ import React, { ReactChild, useState, useLayoutEffect } from 'react';
import ReactDOM from 'react-dom';
import { History } from 'history';
import { i18n } from '@kbn/i18n';
import { I18nProvider } from '@kbn/i18n/react';
import { I18nProvider } from '@kbn/i18n-react';
import { EuiEmptyPrompt, EuiPage, EuiPageBody, EuiPageContent } from '@elastic/eui';
import { UrlOverflowUi } from './url_overflow_ui';

View file

@ -9,7 +9,7 @@
import React from 'react';
import { EuiButton, EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n/react';
import { FormattedMessage } from '@kbn/i18n-react';
import type { HttpStart, NotificationsStart } from '../..';
import type { DocLinksStart } from '../../doc_links';

View file

@ -10,7 +10,7 @@ import React from 'react';
import { History, Location } from 'history';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n/react';
import { FormattedMessage } from '@kbn/i18n-react';
import { mountReactNode } from '../../utils';
import { IToasts } from '../../notifications';

View file

@ -8,7 +8,7 @@
import React from 'react';
import { FormattedMessage } from '@kbn/i18n/react';
import { FormattedMessage } from '@kbn/i18n-react';
import { EuiText } from '@elastic/eui';
import { IBasePath } from '../../http';

View file

@ -8,7 +8,7 @@
import React, { FunctionComponent } from 'react';
import { EuiText, EuiFlexGroup, EuiFlexItem, EuiTitle, EuiBadge } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
import { FormattedMessage } from '@kbn/i18n-react';
import type { FormattedStatus } from '../lib';
interface ServerStateProps {

View file

@ -8,7 +8,7 @@
import React from 'react';
import ReactDOM from 'react-dom';
import { I18nProvider } from '@kbn/i18n/react';
import { I18nProvider } from '@kbn/i18n-react';
import type { AppMountParameters } from '../../application';
import type { HttpSetup } from '../../http';
import type { NotificationsSetup } from '../../notifications';

View file

@ -18,7 +18,7 @@ import {
EuiFlexGroup,
EuiFlexItem,
} from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
import { FormattedMessage } from '@kbn/i18n-react';
import { HttpSetup } from '../../http';
import { NotificationsSetup } from '../../notifications';
import { loadStatus, ProcessedServerResponse } from './lib';

View file

@ -20,7 +20,7 @@ import React from 'react';
import * as Rx from 'rxjs';
import { tap } from 'rxjs/operators';
import { FormattedMessage } from '@kbn/i18n/react';
import { FormattedMessage } from '@kbn/i18n-react';
import { FatalErrorInfo } from './get_error_info';

View file

@ -8,7 +8,7 @@
import React from 'react';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n/react';
import { FormattedMessage } from '@kbn/i18n-react';
import { EuiTokensObject } from '@elastic/eui';
interface EuiValues {

View file

@ -16,7 +16,7 @@ jest.mock('@elastic/eui', () => {
};
});
jest.mock('@kbn/i18n/react', () => {
jest.mock('@kbn/i18n-react', () => {
return {
I18nProvider: function MockI18nProvider() {
// no-op

View file

@ -8,7 +8,7 @@
import React from 'react';
import { EuiContext } from '@elastic/eui';
import { I18nProvider } from '@kbn/i18n/react';
import { I18nProvider } from '@kbn/i18n-react';
import { getEuiContextMapping } from './i18n_eui_mapping';

View file

@ -19,7 +19,7 @@ import {
EuiModalHeaderTitle,
} from '@elastic/eui';
import { EuiSpacer } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
import { FormattedMessage } from '@kbn/i18n-react';
import { OverlayStart } from 'kibana/public';
import { I18nStart } from '../../i18n';

View file

@ -11,7 +11,7 @@ import ReactDOM from 'react-dom';
import { filter } from 'rxjs/operators';
import { Subscription } from 'rxjs';
import { FormattedMessage } from '@kbn/i18n/react';
import { FormattedMessage } from '@kbn/i18n-react';
import { EuiCallOut, EuiButton, EuiLoadingSpinner } from '@elastic/eui';
import { I18nStart } from '../../i18n';

View file

@ -8,7 +8,7 @@
import React from 'react';
import ReactDOM from 'react-dom';
import { I18nProvider } from '@kbn/i18n/react';
import { I18nProvider } from '@kbn/i18n-react';
import { pairwise, startWith } from 'rxjs/operators';
import { InternalChromeStart } from '../chrome';

View file

@ -8,7 +8,7 @@
import React, { useEffect, useRef } from 'react';
import { render, unmountComponentAtNode } from 'react-dom';
import { I18nProvider } from '@kbn/i18n/react';
import { I18nProvider } from '@kbn/i18n-react';
import { MountPoint } from '../types';
const defaultWrapperClass = 'kbnMountWrapper';

View file

@ -36,6 +36,7 @@ export async function extractUntrackedMessagesTask({
'**/build/**',
'**/__fixtures__/**',
'**/packages/kbn-i18n/**',
'**/packages/kbn-i18n-react/**',
'**/packages/kbn-plugin-generator/template/**',
'**/target/**',
'**/test/**',

View file

@ -8,7 +8,7 @@
import React from 'react';
import { EuiText } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
import { FormattedMessage } from '@kbn/i18n-react';
export const PageTitle = () => {
return (

View file

@ -27,7 +27,7 @@
*/
import React, { Component } from 'react';
import { FormattedMessage } from '@kbn/i18n/react';
import { FormattedMessage } from '@kbn/i18n-react';
import { EuiScreenReaderOnly, EuiDelayRender } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { FieldSetting } from '../../types';

View file

@ -9,7 +9,7 @@
import React from 'react';
import { EuiCallOut } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
import { FormattedMessage } from '@kbn/i18n-react';
export const CallOuts = () => {
return (

View file

@ -7,7 +7,7 @@
*/
import React from 'react';
import { I18nProvider } from '@kbn/i18n/react';
import { I18nProvider } from '@kbn/i18n-react';
import { shallowWithI18nProvider, mountWithI18nProvider } from '@kbn/test/jest';
import { mount, ReactWrapper } from 'enzyme';
import { FieldSetting } from '../../types';

View file

@ -34,7 +34,7 @@ import {
EuiToolTip,
} from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n/react';
import { FormattedMessage } from '@kbn/i18n-react';
import { FieldSetting, FieldState } from '../../types';
import { isDefaultValue } from '../../lib';
import { UiSettingsType, DocLinksStart, ToastsStart } from '../../../../../../core/public';

View file

@ -22,7 +22,7 @@ import {
EuiButtonEmpty,
EuiTitle,
} from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
import { FormattedMessage } from '@kbn/i18n-react';
import { isEmpty } from 'lodash';
import { i18n } from '@kbn/i18n';
import { UiCounterMetricType } from '@kbn/analytics';

View file

@ -11,7 +11,7 @@ import ReactDOM from 'react-dom';
import { Router, Switch, Route, Redirect, RouteChildrenProps } from 'react-router-dom';
import { i18n } from '@kbn/i18n';
import { I18nProvider } from '@kbn/i18n/react';
import { I18nProvider } from '@kbn/i18n-react';
import { LocationDescriptor } from 'history';
import { url } from '../../../kibana_utils/public';

View file

@ -7,7 +7,7 @@
*/
import React, { useCallback, useState, useMemo } from 'react';
import { FormattedMessage } from '@kbn/i18n/react';
import { FormattedMessage } from '@kbn/i18n-react';
import { throttle } from 'lodash';
import { EuiIconTip, EuiResizeObserver } from '@elastic/eui';
import { Chart, Settings, Wordcloud, RenderChangeListener } from '@elastic/charts';

View file

@ -8,7 +8,7 @@
import React, { lazy } from 'react';
import { render, unmountComponentAtNode } from 'react-dom';
import { I18nProvider } from '@kbn/i18n/react';
import { I18nProvider } from '@kbn/i18n-react';
import { ClassNames } from '@emotion/react';
import { i18n } from '@kbn/i18n';
import { VisualizationContainer } from '../../../../visualizations/public';

View file

@ -17,7 +17,7 @@ import {
EuiScreenReaderOnly,
EuiFlexGroup,
} from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
import { FormattedMessage } from '@kbn/i18n-react';
import { lightenColor } from '../../services/palettes/lighten_color';
import './color_picker.scss';

View file

@ -18,7 +18,7 @@ import {
EuiLink,
} from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
import { FormattedMessage } from '@kbn/i18n-react';
import { i18n } from '@kbn/i18n';
interface Props {

View file

@ -7,7 +7,7 @@
*/
import React from 'react';
import { FormattedMessage } from '@kbn/i18n/react';
import { FormattedMessage } from '@kbn/i18n-react';
import {
EuiText,
EuiFlyout,

View file

@ -9,7 +9,7 @@
import _ from 'lodash';
import React, { Fragment, useState } from 'react';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n/react';
import { FormattedMessage } from '@kbn/i18n-react';
import {
EuiButton,

View file

@ -7,7 +7,7 @@
*/
import React, { FunctionComponent, useEffect } from 'react';
import { FormattedMessage } from '@kbn/i18n/react';
import { FormattedMessage } from '@kbn/i18n-react';
import { i18n } from '@kbn/i18n';
import { EuiCallOut, EuiText, EuiButton, EuiSpacer } from '@elastic/eui';

View file

@ -7,7 +7,7 @@
*/
import React from 'react';
import { FormattedMessage } from '@kbn/i18n/react';
import { FormattedMessage } from '@kbn/i18n-react';
// @ts-ignore
import {

View file

@ -10,7 +10,7 @@ import './editor.test.mock';
import React from 'react';
import { mount } from 'enzyme';
import { I18nProvider } from '@kbn/i18n/react';
import { I18nProvider } from '@kbn/i18n-react';
import { act } from 'react-dom/test-utils';
import * as sinon from 'sinon';

View file

@ -21,7 +21,7 @@ import {
useEuiTheme,
} from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n/react';
import { FormattedMessage } from '@kbn/i18n-react';
import { CustomIntegration } from '../../../common';
import { usePlatformService } from '../../services';

View file

@ -9,7 +9,7 @@
import React from 'react';
import { DecoratorFn } from '@storybook/react';
import { I18nProvider } from '@kbn/i18n/react';
import { I18nProvider } from '@kbn/i18n-react';
import { PluginServiceRegistry } from '../../presentation_util/public';

View file

@ -11,7 +11,7 @@ import React from 'react';
import { History } from 'history';
import { Provider } from 'react-redux';
import { first } from 'rxjs/operators';
import { I18nProvider } from '@kbn/i18n/react';
import { I18nProvider } from '@kbn/i18n-react';
import { parse, ParsedQuery } from 'query-string';
import { render, unmountComponentAtNode } from 'react-dom';
import { Switch, Route, RouteComponentProps, HashRouter, Redirect } from 'react-router-dom';

View file

@ -12,7 +12,7 @@ import { mount } from 'enzyme';
import { findTestSubject, nextTick } from '@kbn/test/jest';
import { DashboardContainer, DashboardContainerServices } from './dashboard_container';
import { getSampleDashboardInput, getSampleDashboardPanel } from '../test_helpers';
import { I18nProvider } from '@kbn/i18n/react';
import { I18nProvider } from '@kbn/i18n-react';
import { embeddablePluginMock } from 'src/plugins/embeddable/public/mocks';
import { KibanaContextProvider } from '../../services/kibana_react';

View file

@ -9,7 +9,7 @@
import _ from 'lodash';
import React from 'react';
import ReactDOM from 'react-dom';
import { I18nProvider } from '@kbn/i18n/react';
import { I18nProvider } from '@kbn/i18n-react';
import uuid from 'uuid';
import { CoreStart, IUiSettingsClient, KibanaExecutionContext } from 'src/core/public';
import { Start as InspectorStartContract } from 'src/plugins/inspector/public';

View file

@ -7,7 +7,7 @@
*/
import React from 'react';
import { I18nProvider } from '@kbn/i18n/react';
import { I18nProvider } from '@kbn/i18n-react';
import {
EuiIcon,
EuiSpacer,

View file

@ -12,7 +12,7 @@ import 'react-resizable/css/styles.css';
// @ts-ignore
import sizeMe from 'react-sizeme';
import { injectI18n } from '@kbn/i18n/react';
import { injectI18n } from '@kbn/i18n-react';
import classNames from 'classnames';
import _ from 'lodash';
import React from 'react';

View file

@ -10,7 +10,7 @@ import { findTestSubject } from '@elastic/eui/lib/test';
import React from 'react';
import { skip } from 'rxjs/operators';
import { mount } from 'enzyme';
import { I18nProvider } from '@kbn/i18n/react';
import { I18nProvider } from '@kbn/i18n-react';
import { nextTick } from '@kbn/test/jest';
import { DashboardViewport, DashboardViewportProps } from './dashboard_viewport';
import { DashboardContainer, DashboardContainerServices } from '../dashboard_container';

View file

@ -8,7 +8,7 @@
import React from 'react';
import { mount } from 'enzyme';
import { I18nProvider } from '@kbn/i18n/react';
import { I18nProvider } from '@kbn/i18n-react';
import { DashboardAppServices } from '../../types';
import { SimpleSavedObject } from '../../../../../core/public';

View file

@ -6,7 +6,7 @@
* Side Public License, v 1.
*/
import { FormattedMessage } from '@kbn/i18n/react';
import { FormattedMessage } from '@kbn/i18n-react';
import { EuiLink, EuiButton, EuiEmptyPrompt, EuiBasicTableColumn } from '@elastic/eui';
import React, { useCallback, useEffect, useMemo, useState } from 'react';
import { attemptLoadDashboardByTitle } from '../lib';

View file

@ -9,7 +9,7 @@
import { i18n } from '@kbn/i18n';
import React, { useEffect } from 'react';
import { EuiCallOut } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
import { FormattedMessage } from '@kbn/i18n-react';
import { RouteComponentProps } from 'react-router-dom';
import { useKibana, toMountPoint } from '../../services/kibana_react';

View file

@ -6,7 +6,7 @@
* Side Public License, v 1.
*/
import { I18nProvider } from '@kbn/i18n/react';
import { I18nProvider } from '@kbn/i18n-react';
import { findTestSubject } from '@elastic/eui/lib/test';
import { waitFor } from '@testing-library/react';
import { mount } from 'enzyme';

View file

@ -8,7 +8,7 @@
import React, { Fragment } from 'react';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n/react';
import { FormattedMessage } from '@kbn/i18n-react';
import {
EuiButton,

View file

@ -7,7 +7,7 @@
*/
import React, { Fragment } from 'react';
import { FormattedMessage } from '@kbn/i18n/react';
import { FormattedMessage } from '@kbn/i18n-react';
import { i18n } from '@kbn/i18n';
import { EuiFormRow, EuiTextArea, EuiSwitch } from '@elastic/eui';

View file

@ -9,7 +9,7 @@
import React from 'react';
import ReactDOM from 'react-dom';
import { i18n } from '@kbn/i18n';
import { I18nProvider } from '@kbn/i18n/react';
import { I18nProvider } from '@kbn/i18n-react';
import { DashboardCloneModal } from './clone_modal';
export function showCloneModal(

View file

@ -8,7 +8,7 @@
import React from 'react';
import ReactDOM from 'react-dom';
import { I18nProvider } from '@kbn/i18n/react';
import { I18nProvider } from '@kbn/i18n-react';
import { EuiWrappingPopover } from '@elastic/eui';
import { OptionsMenu } from './options';

View file

@ -8,7 +8,7 @@
import React from 'react';
import { $Keys } from 'utility-types';
import { FormattedMessage } from '@kbn/i18n/react';
import { FormattedMessage } from '@kbn/i18n-react';
import { KqlQuerySuggestionProvider } from './types';
import {
QuerySuggestion,

View file

@ -8,7 +8,7 @@
import React from 'react';
import { flatten } from 'lodash';
import { FormattedMessage } from '@kbn/i18n/react';
import { FormattedMessage } from '@kbn/i18n-react';
import { escapeKuery } from './lib/escape_kuery';
import { sortPrefixFirst } from './sort_prefix_first';
import {

View file

@ -7,7 +7,7 @@
*/
import React from 'react';
import { FormattedMessage } from '@kbn/i18n/react';
import { FormattedMessage } from '@kbn/i18n-react';
import { $Keys } from 'utility-types';
import { flatten } from 'lodash';

View file

@ -9,7 +9,7 @@
import React from 'react';
import { i18n } from '@kbn/i18n';
import { EuiButton, EuiSpacer, EuiText, EuiCodeBlock } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
import { FormattedMessage } from '@kbn/i18n-react';
import { ApplicationStart } from 'kibana/public';
import { IEsError, isEsError } from './types';
import { EsError } from './es_error';

View file

@ -9,7 +9,7 @@
import { EuiLink, EuiSpacer, EuiText } from '@elastic/eui';
import { CoreStart } from 'kibana/public';
import React from 'react';
import { FormattedMessage } from '@kbn/i18n/react';
import { FormattedMessage } from '@kbn/i18n-react';
export const SearchSessionIncompleteWarning = (docLinks: CoreStart['docLinks']) => (
<>

View file

@ -17,7 +17,7 @@ import {
EuiModalHeaderTitle,
EuiCheckbox,
} from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
import { FormattedMessage } from '@kbn/i18n-react';
import React, { Component } from 'react';
import { IIndexPattern } from '../..';
import { Filter } from '../../../common';

View file

@ -7,7 +7,7 @@
*/
import { EuiButtonEmpty, EuiFlexGroup, EuiFlexItem, EuiPopover } from '@elastic/eui';
import { FormattedMessage, InjectedIntl, injectI18n } from '@kbn/i18n/react';
import { FormattedMessage, InjectedIntl, injectI18n } from '@kbn/i18n-react';
import {
buildEmptyFilter,
Filter,

View file

@ -20,7 +20,7 @@ import {
EuiSwitchEvent,
} from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { FormattedMessage, InjectedIntl, injectI18n } from '@kbn/i18n/react';
import { FormattedMessage, InjectedIntl, injectI18n } from '@kbn/i18n-react';
import {
Filter,
FieldFilter,

View file

@ -7,7 +7,7 @@
*/
import { EuiFormRow } from '@elastic/eui';
import { InjectedIntl, injectI18n } from '@kbn/i18n/react';
import { InjectedIntl, injectI18n } from '@kbn/i18n-react';
import { uniq } from 'lodash';
import React from 'react';
import { GenericComboBox, GenericComboBoxProps } from './generic_combo_box';

View file

@ -7,7 +7,7 @@
*/
import { EuiFormRow } from '@elastic/eui';
import { InjectedIntl, injectI18n } from '@kbn/i18n/react';
import { InjectedIntl, injectI18n } from '@kbn/i18n-react';
import { uniq } from 'lodash';
import React from 'react';
import { GenericComboBox, GenericComboBoxProps } from './generic_combo_box';

View file

@ -8,7 +8,7 @@
import moment from 'moment';
import { EuiFormControlLayoutDelimited } from '@elastic/eui';
import { InjectedIntl, injectI18n } from '@kbn/i18n/react';
import { InjectedIntl, injectI18n } from '@kbn/i18n-react';
import { get } from 'lodash';
import React from 'react';
import { useKibana } from '../../../../../kibana_react/public';

View file

@ -7,7 +7,7 @@
*/
import { EuiFieldNumber, EuiFieldText, EuiSelect } from '@elastic/eui';
import { InjectedIntl, injectI18n } from '@kbn/i18n/react';
import { InjectedIntl, injectI18n } from '@kbn/i18n-react';
import { isEmpty } from 'lodash';
import React, { Component } from 'react';
import { validateParams } from './lib/filter_editor_utils';

Some files were not shown because too many files have changed in this diff Show more