diff --git a/.eslintrc.js b/.eslintrc.js index 2a4fbe7db3723..b12dc63066370 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -304,8 +304,8 @@ module.exports = { */ { files: [ - 'packages/elastic-datemath/**/*.{js,mjs,ts,tsx}', 'packages/elastic-eslint-config-kibana/**/*.{js,mjs,ts,tsx}', + 'packages/kbn-datemath/**/*.{js,mjs,ts,tsx}', ], rules: { '@kbn/eslint/require-license-header': [ diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 50341621557fa..9c1599a60dd0c 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -55,7 +55,7 @@ /examples/field_formats_example/ @elastic/kibana-app-services /examples/partial_results_example/ @elastic/kibana-app-services /examples/search_examples/ @elastic/kibana-app-services -/packages/elastic-datemath/ @elastic/kibana-app-services +/packages/kbn-datemath/ @elastic/kibana-app-services /packages/kbn-interpreter/ @elastic/kibana-app-services /packages/kbn-react-field/ @elastic/kibana-app-services /packages/kbn-es-query/ @elastic/kibana-app-services diff --git a/WORKSPACE.bazel b/WORKSPACE.bazel index 4a2e6ddf76b17..ff9014214d4c0 100644 --- a/WORKSPACE.bazel +++ b/WORKSPACE.bazel @@ -10,15 +10,16 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # Fetch Node.js rules http_archive( name = "build_bazel_rules_nodejs", - sha256 = "8a7c981217239085f78acc9898a1f7ba99af887c1996ceb3b4504655383a2c3c", - urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/4.0.0/rules_nodejs-4.0.0.tar.gz"], + sha256 = "523da2d6b50bc00eaf14b00ed28b1a366b3ab456e14131e9812558b26599125c", + urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/5.3.1/rules_nodejs-5.3.1.tar.gz"], ) -# Now that we have the rules let's import from them to complete the work -load("@build_bazel_rules_nodejs//:index.bzl", "check_rules_nodejs_version", "node_repositories", "yarn_install") +# Build Node.js rules dependencies +load("@build_bazel_rules_nodejs//:repositories.bzl", "build_bazel_rules_nodejs_dependencies") +build_bazel_rules_nodejs_dependencies() -# Assure we have at least a given rules_nodejs version -check_rules_nodejs_version(minimum_version_string = "4.0.0") +# Now that we have the rules let's import from them to complete the work +load("@build_bazel_rules_nodejs//:index.bzl", "node_repositories", "yarn_install") # Setup the Node.js toolchain for the architectures we want to support # @@ -38,14 +39,13 @@ node_repositories( node_urls = [ "https://nodejs.org/dist/v{version}/{filename}", ], - yarn_repositories = { + yarn_releases = { "1.21.1": ("yarn-v1.21.1.tar.gz", "yarn-v1.21.1", "d1d9f4a0f16f5ed484e814afeb98f39b82d4728c6c8beaafb5abc99c02db6674"), }, yarn_version = "1.21.1", yarn_urls = [ "https://github.com/yarnpkg/yarn/releases/download/v{version}/{filename}", ], - package_json = ["//:package.json"], ) # Run yarn_install rule to take care of dependencies diff --git a/docs/developer/getting-started/monorepo-packages.asciidoc b/docs/developer/getting-started/monorepo-packages.asciidoc index e8e792f13c0dd..0216d26023a78 100644 --- a/docs/developer/getting-started/monorepo-packages.asciidoc +++ b/docs/developer/getting-started/monorepo-packages.asciidoc @@ -51,7 +51,6 @@ yarn kbn watch [discrete] === List of Already Migrated Packages to Bazel -- @elastic/datemath - @elastic/eslint-config-kibana - @elastic/safer-lodash-set - @kbn/ace @@ -64,6 +63,7 @@ yarn kbn watch - @kbn/config - @kbn/config-schema - @kbn/crypto +- @kbn/datemath - @kbn/dev-utils - @kbn/docs-utils - @kbn/es diff --git a/package.json b/package.json index 2f159c19ba009..76948decf33a7 100644 --- a/package.json +++ b/package.json @@ -106,7 +106,7 @@ "@elastic/apm-rum-react": "^1.3.4", "@elastic/apm-synthtrace": "link:bazel-bin/packages/elastic-apm-synthtrace", "@elastic/charts": "45.1.1", - "@elastic/datemath": "link:bazel-bin/packages/elastic-datemath", + "@elastic/datemath": "5.0.3", "@elastic/elasticsearch": "npm:@elastic/elasticsearch-canary@8.2.0-canary.2", "@elastic/ems-client": "8.2.0", "@elastic/eui": "53.0.1", @@ -140,6 +140,7 @@ "@kbn/config": "link:bazel-bin/packages/kbn-config", "@kbn/config-schema": "link:bazel-bin/packages/kbn-config-schema", "@kbn/crypto": "link:bazel-bin/packages/kbn-crypto", + "@kbn/datemath": "link:bazel-bin/packages/kbn-datemath", "@kbn/doc-links": "link:bazel-bin/packages/kbn-doc-links", "@kbn/es-query": "link:bazel-bin/packages/kbn-es-query", "@kbn/eslint-plugin-imports": "link:bazel-bin/packages/kbn-eslint-plugin-imports", @@ -455,7 +456,7 @@ "@babel/traverse": "^7.17.3", "@babel/types": "^7.17.0", "@bazel/ibazel": "^0.16.2", - "@bazel/typescript": "4.0.0", + "@bazel/typescript": "5.3.1", "@cypress/code-coverage": "^3.9.12", "@cypress/snapshot": "^2.1.7", "@cypress/webpack-preprocessor": "^5.6.0", @@ -545,7 +546,6 @@ "@types/delete-empty": "^2.0.0", "@types/ejs": "^3.0.6", "@types/elastic__apm-synthtrace": "link:bazel-bin/packages/elastic-apm-synthtrace/npm_module_types", - "@types/elastic__datemath": "link:bazel-bin/packages/elastic-datemath/npm_module_types", "@types/enzyme": "^3.10.8", "@types/eslint": "^7.28.0", "@types/express": "^4.17.13", @@ -595,6 +595,7 @@ "@types/kbn__config": "link:bazel-bin/packages/kbn-config/npm_module_types", "@types/kbn__config-schema": "link:bazel-bin/packages/kbn-config-schema/npm_module_types", "@types/kbn__crypto": "link:bazel-bin/packages/kbn-crypto/npm_module_types", + "@types/kbn__datemath": "link:bazel-bin/packages/kbn-datemath/npm_module_types", "@types/kbn__dev-utils": "link:bazel-bin/packages/kbn-dev-utils/npm_module_types", "@types/kbn__doc-links": "link:bazel-bin/packages/kbn-doc-links/npm_module_types", "@types/kbn__docs-utils": "link:bazel-bin/packages/kbn-docs-utils/npm_module_types", diff --git a/packages/BUILD.bazel b/packages/BUILD.bazel index ad239f6a180cd..61104d1afcac0 100644 --- a/packages/BUILD.bazel +++ b/packages/BUILD.bazel @@ -11,7 +11,6 @@ filegroup( srcs = [ "//packages/elastic-analytics:build", "//packages/elastic-apm-synthtrace:build", - "//packages/elastic-datemath:build", "//packages/elastic-eslint-config-kibana:build", "//packages/elastic-safer-lodash-set:build", "//packages/kbn-ace:build", @@ -30,6 +29,7 @@ filegroup( "//packages/kbn-config-schema:build", "//packages/kbn-config:build", "//packages/kbn-crypto:build", + "//packages/kbn-datemath:build", "//packages/kbn-dev-utils:build", "//packages/kbn-doc-links:build", "//packages/kbn-docs-utils:build", @@ -102,7 +102,6 @@ filegroup( srcs = [ "//packages/elastic-analytics:build_types", "//packages/elastic-apm-synthtrace:build_types", - "//packages/elastic-datemath:build_types", "//packages/elastic-safer-lodash-set:build_types", "//packages/kbn-ace:build_types", "//packages/kbn-alerts:build_types", @@ -116,6 +115,7 @@ filegroup( "//packages/kbn-config-schema:build_types", "//packages/kbn-config:build_types", "//packages/kbn-crypto:build_types", + "//packages/kbn-datemath:build_types", "//packages/kbn-dev-utils:build_types", "//packages/kbn-doc-links:build_types", "//packages/kbn-docs-utils:build_types", diff --git a/packages/elastic-apm-synthtrace/BUILD.bazel b/packages/elastic-apm-synthtrace/BUILD.bazel index 646b94891f7c2..334d2a0b9e7be 100644 --- a/packages/elastic-apm-synthtrace/BUILD.bazel +++ b/packages/elastic-apm-synthtrace/BUILD.bazel @@ -25,7 +25,7 @@ NPM_MODULE_EXTRA_FILES = [ ] RUNTIME_DEPS = [ - "//packages/elastic-datemath", + "//packages/kbn-datemath", "@npm//@elastic/elasticsearch", "@npm//lodash", "@npm//moment", @@ -36,7 +36,7 @@ RUNTIME_DEPS = [ ] TYPES_DEPS = [ - "//packages/elastic-datemath:npm_module_types", + "//packages/kbn-datemath:npm_module_types", "@npm//@elastic/elasticsearch", "@npm//@types/jest", "@npm//@types/lodash", diff --git a/packages/elastic-apm-synthtrace/src/scripts/run.ts b/packages/elastic-apm-synthtrace/src/scripts/run.ts index 36b3974c12161..ac351eb99ee65 100644 --- a/packages/elastic-apm-synthtrace/src/scripts/run.ts +++ b/packages/elastic-apm-synthtrace/src/scripts/run.ts @@ -5,7 +5,7 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -import datemath from '@elastic/datemath'; +import datemath from '@kbn/datemath'; import yargs from 'yargs/yargs'; import { Argv } from 'yargs'; import { intervalToMs } from './utils/interval_to_ms'; diff --git a/packages/elastic-datemath/.npmignore b/packages/kbn-datemath/.npmignore similarity index 100% rename from packages/elastic-datemath/.npmignore rename to packages/kbn-datemath/.npmignore diff --git a/packages/elastic-datemath/BUILD.bazel b/packages/kbn-datemath/BUILD.bazel similarity index 95% rename from packages/elastic-datemath/BUILD.bazel rename to packages/kbn-datemath/BUILD.bazel index 1ee7f8582cb7e..74fbe712eca0e 100644 --- a/packages/elastic-datemath/BUILD.bazel +++ b/packages/kbn-datemath/BUILD.bazel @@ -2,8 +2,8 @@ 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", "ts_project", "pkg_npm", "pkg_npm_types") -PKG_BASE_NAME = "elastic-datemath" -PKG_REQUIRE_NAME = "@elastic/datemath" +PKG_BASE_NAME = "kbn-datemath" +PKG_REQUIRE_NAME = "@kbn/datemath" SOURCE_FILES = glob([ "src/index.ts", diff --git a/packages/elastic-datemath/README.md b/packages/kbn-datemath/README.md similarity index 61% rename from packages/elastic-datemath/README.md rename to packages/kbn-datemath/README.md index a8dcd9f6721cb..3f824c8297d28 100644 --- a/packages/elastic-datemath/README.md +++ b/packages/kbn-datemath/README.md @@ -1,5 +1,5 @@ # datemath -Datemath string parser used in Kibana. This is published to NPM for use in a limited number of locations outside of Kibana, but is not regularly updated and may get seriously out of date. +Datemath string parser used in Kibana. This is published to NPM under (@elastic/datemath) for use in a limited number of locations outside of Kibana, but is not regularly updated and may get seriously out of date. If you file an issue in elastic/kibana we can probably update it for you if needed, though you probably shouldn't depend on this package for anything important. diff --git a/packages/elastic-datemath/jest.config.js b/packages/kbn-datemath/jest.config.js similarity index 94% rename from packages/elastic-datemath/jest.config.js rename to packages/kbn-datemath/jest.config.js index 6a0bd891f1c58..9f3d7546a6fc4 100644 --- a/packages/elastic-datemath/jest.config.js +++ b/packages/kbn-datemath/jest.config.js @@ -20,6 +20,6 @@ module.exports = { preset: '@kbn/test', rootDir: '../..', - roots: ['/packages/elastic-datemath'], + roots: ['/packages/kbn-datemath'], testEnvironment: 'jsdom', }; diff --git a/packages/elastic-datemath/package.json b/packages/kbn-datemath/package.json similarity index 77% rename from packages/elastic-datemath/package.json rename to packages/kbn-datemath/package.json index af958e3730c3d..0bd726afb721e 100644 --- a/packages/elastic-datemath/package.json +++ b/packages/kbn-datemath/package.json @@ -1,6 +1,6 @@ { - "name": "@elastic/datemath", - "version": "5.0.3", + "name": "@kbn/datemath", + "version": "5.0.4", "description": "elasticsearch datemath parser, used in kibana", "license": "Apache-2.0", "main": "./target_node/index.js", diff --git a/packages/elastic-datemath/src/index.test.js b/packages/kbn-datemath/src/index.test.js similarity index 100% rename from packages/elastic-datemath/src/index.test.js rename to packages/kbn-datemath/src/index.test.js diff --git a/packages/elastic-datemath/src/index.ts b/packages/kbn-datemath/src/index.ts similarity index 100% rename from packages/elastic-datemath/src/index.ts rename to packages/kbn-datemath/src/index.ts diff --git a/packages/elastic-datemath/tsconfig.json b/packages/kbn-datemath/tsconfig.json similarity index 100% rename from packages/elastic-datemath/tsconfig.json rename to packages/kbn-datemath/tsconfig.json diff --git a/packages/kbn-docs-utils/src/api_docs/utils.test.ts b/packages/kbn-docs-utils/src/api_docs/utils.test.ts index 488a115554e80..0cfa0331fd202 100644 --- a/packages/kbn-docs-utils/src/api_docs/utils.test.ts +++ b/packages/kbn-docs-utils/src/api_docs/utils.test.ts @@ -21,7 +21,7 @@ const log = new ToolingLog({ }); it('getFileName', () => { - expect(getFileName('@elastic/datemath')).toBe('elastic_datemath'); + expect(getFileName('@kbn/datemath')).toBe('kbn_datemath'); }); it('test getPluginForPath', () => { diff --git a/packages/kbn-eslint-plugin-imports/src/integration_tests/resolve_kibana_import.test.ts b/packages/kbn-eslint-plugin-imports/src/integration_tests/resolve_kibana_import.test.ts index 5610f5b667b75..21b1ea7b30409 100644 --- a/packages/kbn-eslint-plugin-imports/src/integration_tests/resolve_kibana_import.test.ts +++ b/packages/kbn-eslint-plugin-imports/src/integration_tests/resolve_kibana_import.test.ts @@ -63,15 +63,6 @@ describe('standard import formats', () => { }); it('resolves @elastic/ imports', () => { - expect(resolveKibanaImport('@elastic/datemath', pkg('kbn-dev-utils/src'))) - .toMatchInlineSnapshot(` - Object { - "absolute": /node_modules/@elastic/datemath/target_node/index.js, - "nodeModule": "@elastic/datemath", - "type": "file", - } - `); - expect(resolveKibanaImport('@elastic/eui', pkg('kbn-dev-utils/src'))).toMatchInlineSnapshot(` Object { "absolute": /node_modules/@elastic/eui/lib/index.js, diff --git a/packages/kbn-pm/dist/index.js b/packages/kbn-pm/dist/index.js index a17990291d4d7..0d731fd936507 100644 --- a/packages/kbn-pm/dist/index.js +++ b/packages/kbn-pm/dist/index.js @@ -8949,7 +8949,7 @@ const BootstrapCommand = { await time('force install dependencies', async () => { await Object(_utils_bazel__WEBPACK_IMPORTED_MODULE_9__["removeYarnIntegrityFileIfExists"])(Object(path__WEBPACK_IMPORTED_MODULE_0__["resolve"])(kibanaProjectPath, 'node_modules')); await Object(_utils_bazel__WEBPACK_IMPORTED_MODULE_9__["runBazel"])(['clean']); - await Object(_utils_bazel__WEBPACK_IMPORTED_MODULE_9__["runBazel"])(['run', '@nodejs//:yarn'], runOffline, { + await Object(_utils_bazel__WEBPACK_IMPORTED_MODULE_9__["runBazel"])(['run', '@yarn//:yarn'], runOffline, { env: { SASS_BINARY_SITE: 'https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/node-sass', RE2_DOWNLOAD_MIRROR: 'https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/node-re2' diff --git a/packages/kbn-pm/src/commands/bootstrap.ts b/packages/kbn-pm/src/commands/bootstrap.ts index 51577df6c3b87..691265935b94f 100644 --- a/packages/kbn-pm/src/commands/bootstrap.ts +++ b/packages/kbn-pm/src/commands/bootstrap.ts @@ -72,7 +72,7 @@ export const BootstrapCommand: ICommand = { await time('force install dependencies', async () => { await removeYarnIntegrityFileIfExists(resolve(kibanaProjectPath, 'node_modules')); await runBazel(['clean']); - await runBazel(['run', '@nodejs//:yarn'], runOffline, { + await runBazel(['run', '@yarn//:yarn'], runOffline, { env: { SASS_BINARY_SITE: 'https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/node-sass', diff --git a/packages/kbn-securitysolution-autocomplete/BUILD.bazel b/packages/kbn-securitysolution-autocomplete/BUILD.bazel index 16aa28e79b45b..d8de5ce23ea97 100644 --- a/packages/kbn-securitysolution-autocomplete/BUILD.bazel +++ b/packages/kbn-securitysolution-autocomplete/BUILD.bazel @@ -30,7 +30,7 @@ NPM_MODULE_EXTRA_FILES = [ ] RUNTIME_DEPS = [ - "//packages/elastic-datemath", + "//packages/kbn-datemath", "//packages/kbn-es-query", "//packages/kbn-i18n", "//packages/kbn-securitysolution-io-ts-list-types", @@ -46,7 +46,7 @@ RUNTIME_DEPS = [ ] TYPES_DEPS = [ - "//packages/elastic-datemath:npm_module_types", + "//packages/kbn-datemath:npm_module_types", "//packages/kbn-es-query:npm_module_types", "//packages/kbn-i18n:npm_module_types", "//packages/kbn-securitysolution-io-ts-list-types:npm_module_types", diff --git a/packages/kbn-securitysolution-autocomplete/src/param_is_valid/index.ts b/packages/kbn-securitysolution-autocomplete/src/param_is_valid/index.ts index 016d4f9308e2b..4d9aa734a1841 100644 --- a/packages/kbn-securitysolution-autocomplete/src/param_is_valid/index.ts +++ b/packages/kbn-securitysolution-autocomplete/src/param_is_valid/index.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import dateMath from '@elastic/datemath'; +import dateMath from '@kbn/datemath'; import { DataViewFieldBase } from '@kbn/es-query'; import { checkEmptyValue } from '../check_empty_value'; diff --git a/packages/kbn-securitysolution-io-ts-utils/BUILD.bazel b/packages/kbn-securitysolution-io-ts-utils/BUILD.bazel index 0229acdb474e4..ce8c3efe8f782 100644 --- a/packages/kbn-securitysolution-io-ts-utils/BUILD.bazel +++ b/packages/kbn-securitysolution-io-ts-utils/BUILD.bazel @@ -28,7 +28,7 @@ NPM_MODULE_EXTRA_FILES = [ ] RUNTIME_DEPS = [ - "//packages/elastic-datemath", + "//packages/kbn-datemath", "@npm//fp-ts", "@npm//io-ts", "@npm//lodash", @@ -37,7 +37,7 @@ RUNTIME_DEPS = [ ] TYPES_DEPS = [ - "//packages/elastic-datemath:npm_module_types", + "//packages/kbn-datemath:npm_module_types", "@npm//fp-ts", "@npm//io-ts", "@npm//moment", diff --git a/packages/kbn-securitysolution-io-ts-utils/src/parse_schedule_dates/index.ts b/packages/kbn-securitysolution-io-ts-utils/src/parse_schedule_dates/index.ts index d6a99b5fbf880..9d7ef7a74302f 100644 --- a/packages/kbn-securitysolution-io-ts-utils/src/parse_schedule_dates/index.ts +++ b/packages/kbn-securitysolution-io-ts-utils/src/parse_schedule_dates/index.ts @@ -7,7 +7,7 @@ */ import moment from 'moment'; -import dateMath from '@elastic/datemath'; +import dateMath from '@kbn/datemath'; export const parseScheduleDates = (time: string): moment.Moment | null => { const isValidDateString = !isNaN(Date.parse(time)); diff --git a/packages/kbn-type-summarizer/BUILD.bazel b/packages/kbn-type-summarizer/BUILD.bazel index ec0df11bc3762..4399e62f11a77 100644 --- a/packages/kbn-type-summarizer/BUILD.bazel +++ b/packages/kbn-type-summarizer/BUILD.bazel @@ -1,8 +1,7 @@ load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") +load("@rules_nodejs//nodejs:directory_file_path.bzl", "directory_file_path") +load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "nodejs_binary") load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -load("@build_bazel_rules_nodejs//internal/node:node.bzl", "nodejs_binary") -load("@build_bazel_rules_nodejs//:index.bzl", "directory_file_path") PKG_BASE_NAME = "kbn-type-summarizer" PKG_REQUIRE_NAME = "@kbn/type-summarizer" diff --git a/packages/kbn-ui-shared-deps-npm/BUILD.bazel b/packages/kbn-ui-shared-deps-npm/BUILD.bazel index 17bbb09bd36e3..ec27891f2592e 100644 --- a/packages/kbn-ui-shared-deps-npm/BUILD.bazel +++ b/packages/kbn-ui-shared-deps-npm/BUILD.bazel @@ -28,7 +28,6 @@ NPM_MODULE_EXTRA_FILES = [ ] RUNTIME_DEPS = [ - "//packages/elastic-datemath", "@npm//@babel/runtime", "@npm//@elastic/charts", "@npm//@elastic/eui", diff --git a/packages/kbn-ui-shared-deps-src/BUILD.bazel b/packages/kbn-ui-shared-deps-src/BUILD.bazel index 295f6fa0594ed..72b02f0f0b160 100644 --- a/packages/kbn-ui-shared-deps-src/BUILD.bazel +++ b/packages/kbn-ui-shared-deps-src/BUILD.bazel @@ -28,10 +28,10 @@ NPM_MODULE_EXTRA_FILES = [ ] RUNTIME_DEPS = [ - "//packages/elastic-datemath", "//packages/elastic-safer-lodash-set", "//packages/kbn-analytics", "//packages/kbn-babel-preset", + "//packages/kbn-datemath", "//packages/kbn-flot-charts", "//packages/kbn-i18n", "//packages/kbn-i18n-react", @@ -42,9 +42,9 @@ RUNTIME_DEPS = [ ] TYPES_DEPS = [ - "//packages/elastic-datemath:npm_module_types", "//packages/elastic-safer-lodash-set:npm_module_types", "//packages/kbn-analytics:npm_module_types", + "//packages/kbn-datemath:npm_module_types", "//packages/kbn-i18n:npm_module_types", "//packages/kbn-i18n-react:npm_module_types", "//packages/kbn-monaco:npm_module_types", diff --git a/packages/kbn-ui-shared-deps-src/src/definitions.js b/packages/kbn-ui-shared-deps-src/src/definitions.js index ce859ca4b977f..ea2bb15c29524 100644 --- a/packages/kbn-ui-shared-deps-src/src/definitions.js +++ b/packages/kbn-ui-shared-deps-src/src/definitions.js @@ -56,6 +56,7 @@ const externals = { numeral: '__kbnSharedDeps__.ElasticNumeral', '@elastic/numeral': '__kbnSharedDeps__.ElasticNumeral', '@elastic/charts': '__kbnSharedDeps__.ElasticCharts', + '@kbn/datemath': '__kbnSharedDeps__.KbnDatemath', '@elastic/eui': '__kbnSharedDeps__.ElasticEui', '@elastic/eui/lib/services': '__kbnSharedDeps__.ElasticEuiLibServices', '@elastic/eui/lib/services/format': '__kbnSharedDeps__.ElasticEuiLibServicesFormat', diff --git a/packages/kbn-ui-shared-deps-src/src/entry.js b/packages/kbn-ui-shared-deps-src/src/entry.js index a52dcc1440efb..d88de271519bd 100644 --- a/packages/kbn-ui-shared-deps-src/src/entry.js +++ b/packages/kbn-ui-shared-deps-src/src/entry.js @@ -41,7 +41,7 @@ export const ElasticEui = require('@elastic/eui'); export const ElasticEuiLibServices = require('@elastic/eui/lib/services'); export const ElasticEuiLibServicesFormat = require('@elastic/eui/lib/services/format'); export const ElasticEuiChartsTheme = require('@elastic/eui/dist/eui_charts_theme'); -export const ElasticDatemath = require('@elastic/datemath'); +export const KbnDatemath = require('@kbn/datemath'); export const ReactBeautifulDnD = require('react-beautiful-dnd'); export const Lodash = require('lodash'); diff --git a/src/dev/bazel/pkg_npm_types.bzl b/src/dev/bazel/pkg_npm_types.bzl index e5caba5149053..f90d60252af2d 100644 --- a/src/dev/bazel/pkg_npm_types.bzl +++ b/src/dev/bazel/pkg_npm_types.bzl @@ -142,7 +142,7 @@ pkg_npm_types = rule( "_packager": attr.label( doc = "Target that executes the npm types package assembler binary", executable = True, - cfg = "host", + cfg = "exec", default = Label("//packages/kbn-type-summarizer:bazel-cli"), ), }, diff --git a/src/plugins/controls/public/services/kibana/options_list.ts b/src/plugins/controls/public/services/kibana/options_list.ts index eb805ec4dbe02..a731b0acca62b 100644 --- a/src/plugins/controls/public/services/kibana/options_list.ts +++ b/src/plugins/controls/public/services/kibana/options_list.ts @@ -7,7 +7,7 @@ */ import { memoize } from 'lodash'; -import dateMath from '@elastic/datemath'; +import dateMath from '@kbn/datemath'; import { buildEsQuery } from '@kbn/es-query'; import { TimeRange } from '../../../../data/public'; diff --git a/src/plugins/data/common/query/timefilter/get_time.ts b/src/plugins/data/common/query/timefilter/get_time.ts index fd21b2251ea3a..287b0f3de21e7 100644 --- a/src/plugins/data/common/query/timefilter/get_time.ts +++ b/src/plugins/data/common/query/timefilter/get_time.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import dateMath from '@elastic/datemath'; +import dateMath from '@kbn/datemath'; import { omitBy } from 'lodash'; import { buildRangeFilter } from '@kbn/es-query'; import type { Moment } from 'moment'; diff --git a/src/plugins/data/common/search/aggs/buckets/lib/time_buckets/calc_es_interval.ts b/src/plugins/data/common/search/aggs/buckets/lib/time_buckets/calc_es_interval.ts index 4b3ec90bb2cc2..9b2ed50fb2459 100644 --- a/src/plugins/data/common/search/aggs/buckets/lib/time_buckets/calc_es_interval.ts +++ b/src/plugins/data/common/search/aggs/buckets/lib/time_buckets/calc_es_interval.ts @@ -7,7 +7,7 @@ */ import moment from 'moment'; -import dateMath, { Unit } from '@elastic/datemath'; +import dateMath, { Unit } from '@kbn/datemath'; import { parseEsInterval } from '../../../utils'; diff --git a/src/plugins/data/common/search/aggs/buckets/lib/time_buckets/time_buckets.ts b/src/plugins/data/common/search/aggs/buckets/lib/time_buckets/time_buckets.ts index 12c6d39ad905a..f8a89a8e33e46 100644 --- a/src/plugins/data/common/search/aggs/buckets/lib/time_buckets/time_buckets.ts +++ b/src/plugins/data/common/search/aggs/buckets/lib/time_buckets/time_buckets.ts @@ -9,7 +9,7 @@ import { Assign } from 'utility-types'; import { isString, isObject as isObjectLodash, isPlainObject, sortBy } from 'lodash'; import moment, { Moment } from 'moment'; -import { Unit } from '@elastic/datemath'; +import { Unit } from '@kbn/datemath'; import { parseInterval, splitStringInterval } from '../../../utils'; import { TimeRangeBounds } from '../../../../../query'; import { calcAutoIntervalLessThan, calcAutoIntervalNear } from './calc_auto_interval'; diff --git a/src/plugins/data/common/search/aggs/utils/date_interval_utils/invalid_es_calendar_interval_error.ts b/src/plugins/data/common/search/aggs/utils/date_interval_utils/invalid_es_calendar_interval_error.ts index 3ed68d876c664..ea259fbf6239d 100644 --- a/src/plugins/data/common/search/aggs/utils/date_interval_utils/invalid_es_calendar_interval_error.ts +++ b/src/plugins/data/common/search/aggs/utils/date_interval_utils/invalid_es_calendar_interval_error.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { Unit } from '@elastic/datemath'; +import { Unit } from '@kbn/datemath'; import { i18n } from '@kbn/i18n'; export class InvalidEsCalendarIntervalError extends Error { diff --git a/src/plugins/data/common/search/aggs/utils/date_interval_utils/least_common_interval.ts b/src/plugins/data/common/search/aggs/utils/date_interval_utils/least_common_interval.ts index ff895a976ac64..0e5fc49fb1d29 100644 --- a/src/plugins/data/common/search/aggs/utils/date_interval_utils/least_common_interval.ts +++ b/src/plugins/data/common/search/aggs/utils/date_interval_utils/least_common_interval.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import dateMath from '@elastic/datemath'; +import dateMath from '@kbn/datemath'; import { leastCommonMultiple } from './least_common_multiple'; import { parseEsInterval } from './parse_es_interval'; diff --git a/src/plugins/data/common/search/aggs/utils/date_interval_utils/parse_es_interval.ts b/src/plugins/data/common/search/aggs/utils/date_interval_utils/parse_es_interval.ts index b723c3f45c5a6..237a509277336 100644 --- a/src/plugins/data/common/search/aggs/utils/date_interval_utils/parse_es_interval.ts +++ b/src/plugins/data/common/search/aggs/utils/date_interval_utils/parse_es_interval.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import dateMath, { Unit } from '@elastic/datemath'; +import dateMath, { Unit } from '@kbn/datemath'; import { InvalidEsCalendarIntervalError } from './invalid_es_calendar_interval_error'; import { InvalidEsIntervalFormatError } from './invalid_es_interval_format_error'; diff --git a/src/plugins/data/common/search/aggs/utils/date_interval_utils/parse_interval.ts b/src/plugins/data/common/search/aggs/utils/date_interval_utils/parse_interval.ts index e6ce43526306d..113abfb056f70 100644 --- a/src/plugins/data/common/search/aggs/utils/date_interval_utils/parse_interval.ts +++ b/src/plugins/data/common/search/aggs/utils/date_interval_utils/parse_interval.ts @@ -8,7 +8,7 @@ import { find } from 'lodash'; import moment from 'moment'; -import dateMath, { Unit } from '@elastic/datemath'; +import dateMath, { Unit } from '@kbn/datemath'; // Assume interval is in the form (value)(unit), such as "1h" const INTERVAL_STRING_RE = new RegExp('^([0-9\\.]*)\\s*(' + dateMath.units.join('|') + ')$'); diff --git a/src/plugins/data/common/search/aggs/utils/date_interval_utils/to_absolute_dates.ts b/src/plugins/data/common/search/aggs/utils/date_interval_utils/to_absolute_dates.ts index 03b6bcf83c642..d147caf92711f 100644 --- a/src/plugins/data/common/search/aggs/utils/date_interval_utils/to_absolute_dates.ts +++ b/src/plugins/data/common/search/aggs/utils/date_interval_utils/to_absolute_dates.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import dateMath from '@elastic/datemath'; +import dateMath from '@kbn/datemath'; import { TimeRange } from '../../../../../common'; export function toAbsoluteDates(range: TimeRange) { diff --git a/src/plugins/data/public/autocomplete/providers/value_suggestion_provider.ts b/src/plugins/data/public/autocomplete/providers/value_suggestion_provider.ts index f88fd3b9a0157..0caf2d4ced530 100644 --- a/src/plugins/data/public/autocomplete/providers/value_suggestion_provider.ts +++ b/src/plugins/data/public/autocomplete/providers/value_suggestion_provider.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import dateMath from '@elastic/datemath'; +import dateMath from '@kbn/datemath'; import { buildQueryFromFilters } from '@kbn/es-query'; import { memoize } from 'lodash'; import { CoreSetup } from 'src/core/public'; diff --git a/src/plugins/data/public/query/timefilter/lib/validate_timerange.ts b/src/plugins/data/public/query/timefilter/lib/validate_timerange.ts index 12271f8388ca5..e9eb97d004c91 100644 --- a/src/plugins/data/public/query/timefilter/lib/validate_timerange.ts +++ b/src/plugins/data/public/query/timefilter/lib/validate_timerange.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import dateMath from '@elastic/datemath'; +import dateMath from '@kbn/datemath'; import { TimeRange } from '../../../../common'; export function validateTimeRange(time?: TimeRange): boolean { diff --git a/src/plugins/discover/public/application/main/components/chart/histogram.tsx b/src/plugins/discover/public/application/main/components/chart/histogram.tsx index 22eff35be2325..2a71207e82835 100644 --- a/src/plugins/discover/public/application/main/components/chart/histogram.tsx +++ b/src/plugins/discover/public/application/main/components/chart/histogram.tsx @@ -18,7 +18,7 @@ import { EuiText, } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; -import dateMath from '@elastic/datemath'; +import dateMath from '@kbn/datemath'; import { Axis, BrushEndListener, diff --git a/src/plugins/discover/public/application/main/components/chart/point_series.test.ts b/src/plugins/discover/public/application/main/components/chart/point_series.test.ts index 37fa894f7f671..3497bc54b4a35 100644 --- a/src/plugins/discover/public/application/main/components/chart/point_series.test.ts +++ b/src/plugins/discover/public/application/main/components/chart/point_series.test.ts @@ -8,7 +8,7 @@ import { buildPointSeriesData } from './point_series'; import moment from 'moment'; -import { Unit } from '@elastic/datemath'; +import { Unit } from '@kbn/datemath'; describe('buildPointSeriesData', () => { test('with valid data', () => { diff --git a/src/plugins/discover/public/application/main/components/chart/point_series.ts b/src/plugins/discover/public/application/main/components/chart/point_series.ts index b8cdf75d5fd36..88b5c444f4beb 100644 --- a/src/plugins/discover/public/application/main/components/chart/point_series.ts +++ b/src/plugins/discover/public/application/main/components/chart/point_series.ts @@ -8,7 +8,7 @@ import { uniq } from 'lodash'; import { Duration, Moment } from 'moment'; -import { Unit } from '@elastic/datemath'; +import { Unit } from '@kbn/datemath'; import { SerializedFieldFormat } from '../../../../../../field_formats/common'; export interface Column { diff --git a/src/plugins/discover/public/application/main/utils/get_dimensions.ts b/src/plugins/discover/public/application/main/utils/get_dimensions.ts index 1c8bc70bb17e2..c9a2a198d1f7e 100644 --- a/src/plugins/discover/public/application/main/utils/get_dimensions.ts +++ b/src/plugins/discover/public/application/main/utils/get_dimensions.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ import moment from 'moment'; -import dateMath from '@elastic/datemath'; +import dateMath from '@kbn/datemath'; import { DataPublicPluginStart, search, IAggConfigs } from '../../../../../data/public'; import { Dimensions, HistogramParamsBounds } from '../components/chart/point_series'; diff --git a/src/plugins/discover/public/application/main/utils/validate_time_range.ts b/src/plugins/discover/public/application/main/utils/validate_time_range.ts index e506fe6fdb898..7744a10f3e8ca 100644 --- a/src/plugins/discover/public/application/main/utils/validate_time_range.ts +++ b/src/plugins/discover/public/application/main/utils/validate_time_range.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import dateMath from '@elastic/datemath'; +import dateMath from '@kbn/datemath'; import { i18n } from '@kbn/i18n'; import { ToastsStart } from 'kibana/public'; diff --git a/src/plugins/unified_search/public/filter_bar/filter_editor/lib/filter_editor_utils.ts b/src/plugins/unified_search/public/filter_bar/filter_editor/lib/filter_editor_utils.ts index 3b8fb867c361b..eb67d630f2393 100644 --- a/src/plugins/unified_search/public/filter_bar/filter_editor/lib/filter_editor_utils.ts +++ b/src/plugins/unified_search/public/filter_bar/filter_editor/lib/filter_editor_utils.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import dateMath from '@elastic/datemath'; +import dateMath from '@kbn/datemath'; import { Filter, FieldFilter } from '@kbn/es-query'; import { ES_FIELD_TYPES } from '@kbn/field-types'; import isSemverValid from 'semver/functions/valid'; diff --git a/src/plugins/unified_search/public/query_string_input/query_bar_top_row.tsx b/src/plugins/unified_search/public/query_string_input/query_bar_top_row.tsx index ddba035b91fdd..1589c9c86f1df 100644 --- a/src/plugins/unified_search/public/query_string_input/query_bar_top_row.tsx +++ b/src/plugins/unified_search/public/query_string_input/query_bar_top_row.tsx @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import dateMath from '@elastic/datemath'; +import dateMath from '@kbn/datemath'; import classNames from 'classnames'; import React, { useCallback, useMemo, useRef, useState } from 'react'; import deepEqual from 'fast-deep-equal'; diff --git a/src/plugins/vis_default_editor/public/components/controls/date_ranges.tsx b/src/plugins/vis_default_editor/public/components/controls/date_ranges.tsx index 22907ff16e24d..f060cfb311023 100644 --- a/src/plugins/vis_default_editor/public/components/controls/date_ranges.tsx +++ b/src/plugins/vis_default_editor/public/components/controls/date_ranges.tsx @@ -21,7 +21,7 @@ import { EuiText, EuiFormRow, } from '@elastic/eui'; -import dateMath from '@elastic/datemath'; +import dateMath from '@kbn/datemath'; import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { isEqual, omit } from 'lodash'; diff --git a/src/plugins/vis_types/timeseries/common/interval_regexp.ts b/src/plugins/vis_types/timeseries/common/interval_regexp.ts index 7e190ab6e8d2f..80aea32f0feb3 100644 --- a/src/plugins/vis_types/timeseries/common/interval_regexp.ts +++ b/src/plugins/vis_types/timeseries/common/interval_regexp.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import dateMath from '@elastic/datemath'; +import dateMath from '@kbn/datemath'; export const GTE_INTERVAL_RE = new RegExp(`^>=([\\d\\.]+\\s*(${dateMath.units.join('|')}))$`); export const INTERVAL_STRING_RE = new RegExp(`^([\\d\\.]+)\\s*(${dateMath.units.join('|')})$`); diff --git a/src/plugins/vis_types/timeseries/server/lib/search_strategies/capabilities/default_search_capabilities.ts b/src/plugins/vis_types/timeseries/server/lib/search_strategies/capabilities/default_search_capabilities.ts index c841f08895b7a..b630427781179 100644 --- a/src/plugins/vis_types/timeseries/server/lib/search_strategies/capabilities/default_search_capabilities.ts +++ b/src/plugins/vis_types/timeseries/server/lib/search_strategies/capabilities/default_search_capabilities.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { Unit } from '@elastic/datemath'; +import { Unit } from '@kbn/datemath'; import { convertIntervalToUnit, parseInterval, diff --git a/src/plugins/vis_types/timeseries/server/lib/search_strategies/capabilities/rollup_search_capabilities.test.ts b/src/plugins/vis_types/timeseries/server/lib/search_strategies/capabilities/rollup_search_capabilities.test.ts index e1cc1f1f26eb2..9e48b306445b2 100644 --- a/src/plugins/vis_types/timeseries/server/lib/search_strategies/capabilities/rollup_search_capabilities.test.ts +++ b/src/plugins/vis_types/timeseries/server/lib/search_strategies/capabilities/rollup_search_capabilities.test.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { Unit } from '@elastic/datemath'; +import { Unit } from '@kbn/datemath'; import type { Panel } from '../../../../common/types'; import { RollupSearchCapabilities } from './rollup_search_capabilities'; diff --git a/src/plugins/vis_types/timeseries/server/lib/search_strategies/lib/interval_helper.ts b/src/plugins/vis_types/timeseries/server/lib/search_strategies/lib/interval_helper.ts index 1468d5ddee5bf..34d0824df7fca 100644 --- a/src/plugins/vis_types/timeseries/server/lib/search_strategies/lib/interval_helper.ts +++ b/src/plugins/vis_types/timeseries/server/lib/search_strategies/lib/interval_helper.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import dateMath from '@elastic/datemath'; +import dateMath from '@kbn/datemath'; export type Unit = 'ms' | 's' | 'm' | 'h' | 'd' | 'w' | 'M' | 'y'; diff --git a/src/plugins/vis_types/timeseries/server/lib/vis_data/helpers/get_bucket_size.ts b/src/plugins/vis_types/timeseries/server/lib/vis_data/helpers/get_bucket_size.ts index e02b403c8ba13..58c96eca99b61 100644 --- a/src/plugins/vis_types/timeseries/server/lib/vis_data/helpers/get_bucket_size.ts +++ b/src/plugins/vis_types/timeseries/server/lib/vis_data/helpers/get_bucket_size.ts @@ -5,7 +5,7 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -import type { Unit } from '@elastic/datemath'; +import type { Unit } from '@kbn/datemath'; import { getUnitValue, diff --git a/src/plugins/vis_types/timeseries/server/lib/vis_data/helpers/parse_interval.js b/src/plugins/vis_types/timeseries/server/lib/vis_data/helpers/parse_interval.js index a2dd549fd828f..9e9b866c7b98e 100644 --- a/src/plugins/vis_types/timeseries/server/lib/vis_data/helpers/parse_interval.js +++ b/src/plugins/vis_types/timeseries/server/lib/vis_data/helpers/parse_interval.js @@ -8,7 +8,7 @@ import _ from 'lodash'; import moment from 'moment'; -import dateMath from '@elastic/datemath'; +import dateMath from '@kbn/datemath'; // Assume interval is in the form (value)(unit), such as "1h" const INTERVAL_STRING_RE = new RegExp('^([0-9\\.]*)\\s*(' + dateMath.units.join('|') + ')$'); diff --git a/src/plugins/vis_types/timeseries/server/lib/vis_data/helpers/unit_to_seconds.test.ts b/src/plugins/vis_types/timeseries/server/lib/vis_data/helpers/unit_to_seconds.test.ts index 64999154c10fb..356df6cd86f5e 100644 --- a/src/plugins/vis_types/timeseries/server/lib/vis_data/helpers/unit_to_seconds.test.ts +++ b/src/plugins/vis_types/timeseries/server/lib/vis_data/helpers/unit_to_seconds.test.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { Unit } from '@elastic/datemath'; +import { Unit } from '@kbn/datemath'; import { getUnitValue, diff --git a/src/plugins/vis_types/timeseries/server/lib/vis_data/helpers/unit_to_seconds.ts b/src/plugins/vis_types/timeseries/server/lib/vis_data/helpers/unit_to_seconds.ts index b3a29287208d6..3252736669bce 100644 --- a/src/plugins/vis_types/timeseries/server/lib/vis_data/helpers/unit_to_seconds.ts +++ b/src/plugins/vis_types/timeseries/server/lib/vis_data/helpers/unit_to_seconds.ts @@ -7,7 +7,7 @@ */ import { sortBy, isNumber } from 'lodash'; -import { Unit } from '@elastic/datemath'; +import { Unit } from '@kbn/datemath'; /** @ts-ignore */ import { INTERVAL_STRING_RE } from '../../../../common/interval_regexp'; diff --git a/src/plugins/vis_types/vega/public/vega_view/vega_base_view.js b/src/plugins/vis_types/vega/public/vega_view/vega_base_view.js index de2e0f57a111b..e518894c5511a 100644 --- a/src/plugins/vis_types/vega/public/vega_view/vega_base_view.js +++ b/src/plugins/vis_types/vega/public/vega_view/vega_base_view.js @@ -8,7 +8,7 @@ import $ from 'jquery'; import moment from 'moment'; -import dateMath from '@elastic/datemath'; +import dateMath from '@kbn/datemath'; import { scheme, loader, logger, Warn, version as vegaVersion, expressionFunction } from 'vega'; import { expressionInterpreter } from 'vega-interpreter'; import { version as vegaLiteVersion } from 'vega-lite'; diff --git a/src/plugins/vis_types/vislib/public/vislib/visualizations/time_marker.js b/src/plugins/vis_types/vislib/public/vislib/visualizations/time_marker.js index a0a4fce8d7af4..83055f4a4c5a0 100644 --- a/src/plugins/vis_types/vislib/public/vislib/visualizations/time_marker.js +++ b/src/plugins/vis_types/vislib/public/vislib/visualizations/time_marker.js @@ -7,7 +7,7 @@ */ import d3 from 'd3'; -import dateMath from '@elastic/datemath'; +import dateMath from '@kbn/datemath'; export class TimeMarker { constructor(times, xScale, height) { diff --git a/x-pack/plugins/apm/public/components/app/service_groups/service_group_save/save_modal.tsx b/x-pack/plugins/apm/public/components/app/service_groups/service_group_save/save_modal.tsx index 9ea40fdd38a36..291cde98fd58f 100644 --- a/x-pack/plugins/apm/public/components/app/service_groups/service_group_save/save_modal.tsx +++ b/x-pack/plugins/apm/public/components/app/service_groups/service_group_save/save_modal.tsx @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import datemath from '@elastic/datemath'; +import datemath from '@kbn/datemath'; import { EuiModal } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { useHistory } from 'react-router-dom'; diff --git a/x-pack/plugins/apm/public/context/url_params_context/helpers.test.ts b/x-pack/plugins/apm/public/context/url_params_context/helpers.test.ts index 9ab0948fd75aa..9ed05a1ef186e 100644 --- a/x-pack/plugins/apm/public/context/url_params_context/helpers.test.ts +++ b/x-pack/plugins/apm/public/context/url_params_context/helpers.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import datemath from '@elastic/datemath'; +import datemath from '@kbn/datemath'; import moment from 'moment-timezone'; import * as helpers from './helpers'; diff --git a/x-pack/plugins/apm/public/context/url_params_context/helpers.ts b/x-pack/plugins/apm/public/context/url_params_context/helpers.ts index 6856c0e7d2506..1fb70e929ad5a 100644 --- a/x-pack/plugins/apm/public/context/url_params_context/helpers.ts +++ b/x-pack/plugins/apm/public/context/url_params_context/helpers.ts @@ -5,7 +5,7 @@ * 2.0. */ -import datemath from '@elastic/datemath'; +import datemath from '@kbn/datemath'; import { pickBy } from 'lodash'; import { UrlParams } from './types'; diff --git a/x-pack/plugins/apm/server/routes/alerts/register_anomaly_alert_type.ts b/x-pack/plugins/apm/server/routes/alerts/register_anomaly_alert_type.ts index 5affecb3541cc..f84fe4d3169fb 100644 --- a/x-pack/plugins/apm/server/routes/alerts/register_anomaly_alert_type.ts +++ b/x-pack/plugins/apm/server/routes/alerts/register_anomaly_alert_type.ts @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import datemath from '@elastic/datemath'; +import datemath from '@kbn/datemath'; import { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { schema } from '@kbn/config-schema'; import { diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/timefilter.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/timefilter.ts index b61e03319b916..751dbf5126750 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/common/timefilter.ts +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/timefilter.ts @@ -5,7 +5,7 @@ * 2.0. */ -import dateMath from '@elastic/datemath'; +import dateMath from '@kbn/datemath'; import { ExpressionValueFilter, ExpressionFunctionDefinition } from '../../../types'; import { getFunctionHelp, getFunctionErrors } from '../../../i18n'; diff --git a/x-pack/plugins/canvas/common/lib/build_embeddable_filters.ts b/x-pack/plugins/canvas/common/lib/build_embeddable_filters.ts index c98d2f080452a..9209eec105b23 100644 --- a/x-pack/plugins/canvas/common/lib/build_embeddable_filters.ts +++ b/x-pack/plugins/canvas/common/lib/build_embeddable_filters.ts @@ -6,7 +6,7 @@ */ import { buildQueryFilter, Filter } from '@kbn/es-query'; -import dateMath from '@elastic/datemath'; +import dateMath from '@kbn/datemath'; import { maxBy, minBy } from 'lodash'; import { ExpressionValueFilter } from '../../types'; // @ts-expect-error untyped local diff --git a/x-pack/plugins/canvas/public/components/workpad_filters/filter_views/time_filter.ts b/x-pack/plugins/canvas/public/components/workpad_filters/filter_views/time_filter.ts index 1dc02f61d05f7..afdd1d89d3690 100644 --- a/x-pack/plugins/canvas/public/components/workpad_filters/filter_views/time_filter.ts +++ b/x-pack/plugins/canvas/public/components/workpad_filters/filter_views/time_filter.ts @@ -5,7 +5,7 @@ * 2.0. */ -import dateMath from '@elastic/datemath'; +import dateMath from '@kbn/datemath'; import { i18n } from '@kbn/i18n'; import { FilterType, FilterViewSpec, SimpleFilterViewField } from '../../../../types'; import { formatByKey } from '../utils'; diff --git a/x-pack/plugins/data_visualizer/common/services/time_buckets.js b/x-pack/plugins/data_visualizer/common/services/time_buckets.js index 49de535ee6c26..92b60cbf6ca10 100644 --- a/x-pack/plugins/data_visualizer/common/services/time_buckets.js +++ b/x-pack/plugins/data_visualizer/common/services/time_buckets.js @@ -9,7 +9,7 @@ import { FIELD_FORMAT_IDS } from '../../../../../src/plugins/field_formats/commo import { UI_SETTINGS } from '../../../../../src/plugins/data/common'; import { ary, assign, isPlainObject, isString, sortBy } from 'lodash'; import moment from 'moment'; -import dateMath from '@elastic/datemath'; +import dateMath from '@kbn/datemath'; import { parseInterval } from '../utils/parse_interval'; const { duration: d } = moment; diff --git a/x-pack/plugins/data_visualizer/common/utils/parse_interval.ts b/x-pack/plugins/data_visualizer/common/utils/parse_interval.ts index 6ca280dc12ebd..73a20974cde4f 100644 --- a/x-pack/plugins/data_visualizer/common/utils/parse_interval.ts +++ b/x-pack/plugins/data_visualizer/common/utils/parse_interval.ts @@ -6,7 +6,7 @@ */ import { duration, Duration, unitOfTime } from 'moment'; -import dateMath from '@elastic/datemath'; +import dateMath from '@kbn/datemath'; type SupportedUnits = unitOfTime.Base; diff --git a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/full_time_range_selector/full_time_range_selector_service.ts b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/full_time_range_selector/full_time_range_selector_service.ts index 5f20f02b96c7e..3cc3fa329359d 100644 --- a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/full_time_range_selector/full_time_range_selector_service.ts +++ b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/full_time_range_selector/full_time_range_selector_service.ts @@ -7,7 +7,7 @@ import moment from 'moment'; import { TimefilterContract } from 'src/plugins/data/public'; -import dateMath from '@elastic/datemath'; +import dateMath from '@kbn/datemath'; import { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/types'; import { i18n } from '@kbn/i18n'; import type { ToastsStart } from 'kibana/public'; diff --git a/x-pack/plugins/infra/public/components/infrastructure_node_metrics_tables/shared/components/metrics_node_details_link.tsx b/x-pack/plugins/infra/public/components/infrastructure_node_metrics_tables/shared/components/metrics_node_details_link.tsx index b51e1bc8b7707..cb83afbc10e3f 100644 --- a/x-pack/plugins/infra/public/components/infrastructure_node_metrics_tables/shared/components/metrics_node_details_link.tsx +++ b/x-pack/plugins/infra/public/components/infrastructure_node_metrics_tables/shared/components/metrics_node_details_link.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { parse } from '@elastic/datemath'; +import { parse } from '@kbn/datemath'; import { EuiLink } from '@elastic/eui'; import React from 'react'; import { useLinkProps } from '../../../../../../observability/public'; diff --git a/x-pack/plugins/infra/public/components/infrastructure_node_metrics_tables/shared/hooks/use_infrastructure_node_metrics.ts b/x-pack/plugins/infra/public/components/infrastructure_node_metrics_tables/shared/hooks/use_infrastructure_node_metrics.ts index 47e4fd86f04e2..f3daa1b429aca 100644 --- a/x-pack/plugins/infra/public/components/infrastructure_node_metrics_tables/shared/hooks/use_infrastructure_node_metrics.ts +++ b/x-pack/plugins/infra/public/components/infrastructure_node_metrics_tables/shared/hooks/use_infrastructure_node_metrics.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { parse } from '@elastic/datemath'; +import { parse } from '@kbn/datemath'; import type { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { useEffect, useMemo, useState } from 'react'; import { useKibana } from '../../../../../../../../src/plugins/kibana_react/public'; diff --git a/x-pack/plugins/infra/public/components/logging/log_text_stream/loading_item_view.tsx b/x-pack/plugins/infra/public/components/logging/log_text_stream/loading_item_view.tsx index 316249ec0fe3c..f6e3ff27f2467 100644 --- a/x-pack/plugins/infra/public/components/logging/log_text_stream/loading_item_view.tsx +++ b/x-pack/plugins/infra/public/components/logging/log_text_stream/loading_item_view.tsx @@ -15,7 +15,7 @@ import { } from '@elastic/eui'; import { FormattedMessage, FormattedTime, FormattedRelative } from '@kbn/i18n-react'; import * as React from 'react'; -import { Unit } from '@elastic/datemath'; +import { Unit } from '@kbn/datemath'; import { euiStyled } from '../../../../../../../src/plugins/kibana_react/common'; import { LogTextSeparator } from './log_text_separator'; diff --git a/x-pack/plugins/infra/public/pages/logs/log_entry_categories/page_results_content.tsx b/x-pack/plugins/infra/public/pages/logs/log_entry_categories/page_results_content.tsx index bba95b0fffb05..34faac3aefa0c 100644 --- a/x-pack/plugins/infra/public/pages/logs/log_entry_categories/page_results_content.tsx +++ b/x-pack/plugins/infra/public/pages/logs/log_entry_categories/page_results_content.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import datemath from '@elastic/datemath'; +import datemath from '@kbn/datemath'; import { EuiFlexGroup, EuiFlexItem, EuiPage, EuiSuperDatePicker } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import moment from 'moment'; diff --git a/x-pack/plugins/infra/public/pages/logs/log_entry_rate/use_log_entry_rate_results_url_state.tsx b/x-pack/plugins/infra/public/pages/logs/log_entry_rate/use_log_entry_rate_results_url_state.tsx index a845e59ce6d32..73d0046ce9643 100644 --- a/x-pack/plugins/infra/public/pages/logs/log_entry_rate/use_log_entry_rate_results_url_state.tsx +++ b/x-pack/plugins/infra/public/pages/logs/log_entry_rate/use_log_entry_rate_results_url_state.tsx @@ -7,7 +7,7 @@ import { useCallback, useMemo, useState } from 'react'; import useInterval from 'react-use/lib/useInterval'; -import datemath from '@elastic/datemath'; +import datemath from '@kbn/datemath'; import moment from 'moment'; import * as rt from 'io-ts'; import { TimeRange as KibanaTimeRange } from '../../../../../../../src/plugins/data/public'; diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/hooks/use_waffle_time.ts b/x-pack/plugins/infra/public/pages/metrics/inventory_view/hooks/use_waffle_time.ts index ada9b0d468fdc..5bbc55dd0f48e 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/hooks/use_waffle_time.ts +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/hooks/use_waffle_time.ts @@ -9,7 +9,7 @@ import { useCallback, useState, useEffect } from 'react'; import * as rt from 'io-ts'; import { pipe } from 'fp-ts/lib/pipeable'; import { fold } from 'fp-ts/lib/Either'; -import DateMath from '@elastic/datemath'; +import DateMath from '@kbn/datemath'; import { constant, identity } from 'fp-ts/lib/function'; import createContainer from 'constate'; import { useUrlState } from '../../../../utils/use_url_state'; diff --git a/x-pack/plugins/infra/public/pages/metrics/metric_detail/components/node_details_page.tsx b/x-pack/plugins/infra/public/pages/metrics/metric_detail/components/node_details_page.tsx index 8da96586be979..cf766bdb104e5 100644 --- a/x-pack/plugins/infra/public/pages/metrics/metric_detail/components/node_details_page.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/metric_detail/components/node_details_page.tsx @@ -6,7 +6,7 @@ */ import React, { useCallback, useEffect, useState, useContext } from 'react'; -import dateMath from '@elastic/datemath'; +import dateMath from '@kbn/datemath'; import moment from 'moment'; import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; import { Source } from '../../../../containers/metrics_source'; diff --git a/x-pack/plugins/infra/public/pages/metrics/metric_detail/hooks/use_metrics_time.ts b/x-pack/plugins/infra/public/pages/metrics/metric_detail/hooks/use_metrics_time.ts index 80af26401c334..98e54daadcade 100644 --- a/x-pack/plugins/infra/public/pages/metrics/metric_detail/hooks/use_metrics_time.ts +++ b/x-pack/plugins/infra/public/pages/metrics/metric_detail/hooks/use_metrics_time.ts @@ -8,7 +8,7 @@ import createContainer from 'constate'; import { useState, useCallback, useEffect } from 'react'; import moment from 'moment'; -import dateMath from '@elastic/datemath'; +import dateMath from '@kbn/datemath'; import * as rt from 'io-ts'; import { pipe } from 'fp-ts/lib/pipeable'; import { fold } from 'fp-ts/lib/Either'; diff --git a/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/chart_context_menu.tsx b/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/chart_context_menu.tsx index 461d0defb000a..9a2b8366f920f 100644 --- a/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/chart_context_menu.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/chart_context_menu.tsx @@ -14,7 +14,7 @@ import { EuiContextMenuPanelDescriptor, EuiPopover, } from '@elastic/eui'; -import DateMath from '@elastic/datemath'; +import DateMath from '@kbn/datemath'; import { Capabilities } from 'src/core/public'; import { MetricsSourceConfigurationProperties } from '../../../../../common/metrics_sources'; import { AlertFlyout } from '../../../../alerting/metric_threshold/components/alert_flyout'; diff --git a/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/hooks/use_metrics_explorer_data.ts b/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/hooks/use_metrics_explorer_data.ts index 788760a0dfe1c..ab4bf11dadb35 100644 --- a/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/hooks/use_metrics_explorer_data.ts +++ b/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/hooks/use_metrics_explorer_data.ts @@ -5,7 +5,7 @@ * 2.0. */ -import DateMath from '@elastic/datemath'; +import DateMath from '@kbn/datemath'; import { useEffect, useState } from 'react'; import { DataViewBase } from '@kbn/es-query'; import { isEqual } from 'lodash'; diff --git a/x-pack/plugins/infra/public/utils/convert_interval_to_string.ts b/x-pack/plugins/infra/public/utils/convert_interval_to_string.ts index 075535993e09c..7435e4264a2b2 100644 --- a/x-pack/plugins/infra/public/utils/convert_interval_to_string.ts +++ b/x-pack/plugins/infra/public/utils/convert_interval_to_string.ts @@ -5,7 +5,7 @@ * 2.0. */ -import dateMath from '@elastic/datemath'; +import dateMath from '@kbn/datemath'; import moment from 'moment'; import { i18n } from '@kbn/i18n'; import * as rt from 'io-ts'; diff --git a/x-pack/plugins/infra/public/utils/datemath.ts b/x-pack/plugins/infra/public/utils/datemath.ts index fa67c86544fb0..2ed4f68b7a934 100644 --- a/x-pack/plugins/infra/public/utils/datemath.ts +++ b/x-pack/plugins/infra/public/utils/datemath.ts @@ -5,7 +5,7 @@ * 2.0. */ -import dateMath, { Unit } from '@elastic/datemath'; +import dateMath, { Unit } from '@kbn/datemath'; const JS_MAX_DATE = 8640000000000000; diff --git a/x-pack/plugins/infra/server/lib/alerting/metric_anomaly/preview_metric_anomaly_alert.ts b/x-pack/plugins/infra/server/lib/alerting/metric_anomaly/preview_metric_anomaly_alert.ts index b5033bb9a6043..e10558be54033 100644 --- a/x-pack/plugins/infra/server/lib/alerting/metric_anomaly/preview_metric_anomaly_alert.ts +++ b/x-pack/plugins/infra/server/lib/alerting/metric_anomaly/preview_metric_anomaly_alert.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { Unit } from '@elastic/datemath'; +import { Unit } from '@kbn/datemath'; import { countBy } from 'lodash'; import { MappedAnomalyHit } from '../../infra_ml'; import { MlSystem, MlAnomalyDetectors } from '../../../types'; diff --git a/x-pack/plugins/infra/server/lib/metrics/lib/calculate_bucket_size/interval_regex.ts b/x-pack/plugins/infra/server/lib/metrics/lib/calculate_bucket_size/interval_regex.ts index 20657880c497e..c53119cb14299 100644 --- a/x-pack/plugins/infra/server/lib/metrics/lib/calculate_bucket_size/interval_regex.ts +++ b/x-pack/plugins/infra/server/lib/metrics/lib/calculate_bucket_size/interval_regex.ts @@ -5,7 +5,7 @@ * 2.0. */ -import dateMath from '@elastic/datemath'; +import dateMath from '@kbn/datemath'; export const GTE_INTERVAL_RE = new RegExp(`^>=([\\d\\.]+\\s*(${dateMath.units.join('|')}))$`); export const INTERVAL_STRING_RE = new RegExp(`^([\\d\\.]+)\\s*(${dateMath.units.join('|')})$`); diff --git a/x-pack/plugins/infra/server/utils/round_timestamp.ts b/x-pack/plugins/infra/server/utils/round_timestamp.ts index e15fceec5120f..cd2234ed9eef7 100644 --- a/x-pack/plugins/infra/server/utils/round_timestamp.ts +++ b/x-pack/plugins/infra/server/utils/round_timestamp.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { Unit } from '@elastic/datemath'; +import { Unit } from '@kbn/datemath'; import moment from 'moment'; export const roundTimestamp = (timestamp: number, unit: Unit) => { diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/field_item.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/field_item.tsx index 7a391b1639a58..82b4a0aa33409 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/field_item.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/field_item.tsx @@ -8,7 +8,7 @@ import './field_item.scss'; import React, { useCallback, useState, useMemo } from 'react'; -import DateMath from '@elastic/datemath'; +import DateMath from '@kbn/datemath'; import { EuiButtonGroup, EuiButtonIcon, diff --git a/x-pack/plugins/lens/server/routes/field_stats.ts b/x-pack/plugins/lens/server/routes/field_stats.ts index 787e21b2dd9d9..2a719957cd851 100644 --- a/x-pack/plugins/lens/server/routes/field_stats.ts +++ b/x-pack/plugins/lens/server/routes/field_stats.ts @@ -6,7 +6,7 @@ */ import { errors } from '@elastic/elasticsearch'; import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; -import DateMath from '@elastic/datemath'; +import DateMath from '@kbn/datemath'; import { schema } from '@kbn/config-schema'; import { CoreSetup } from 'src/core/server'; import type { DataViewField } from 'src/plugins/data_views/common'; diff --git a/x-pack/plugins/ml/common/util/date_utils.ts b/x-pack/plugins/ml/common/util/date_utils.ts index d09c0bbe0ca39..c668eda03a7be 100644 --- a/x-pack/plugins/ml/common/util/date_utils.ts +++ b/x-pack/plugins/ml/common/util/date_utils.ts @@ -7,7 +7,7 @@ // utility functions for handling dates -import dateMath from '@elastic/datemath'; +import dateMath from '@kbn/datemath'; import { formatDate } from '@elastic/eui'; import { TimeRange } from '../../../../../src/plugins/data/common'; import { TIME_FORMAT } from '../constants/time_format'; diff --git a/x-pack/plugins/ml/common/util/parse_interval.ts b/x-pack/plugins/ml/common/util/parse_interval.ts index 6ca280dc12ebd..73a20974cde4f 100644 --- a/x-pack/plugins/ml/common/util/parse_interval.ts +++ b/x-pack/plugins/ml/common/util/parse_interval.ts @@ -6,7 +6,7 @@ */ import { duration, Duration, unitOfTime } from 'moment'; -import dateMath from '@elastic/datemath'; +import dateMath from '@kbn/datemath'; type SupportedUnits = unitOfTime.Base; diff --git a/x-pack/plugins/ml/public/application/components/full_time_range_selector/full_time_range_selector_service.ts b/x-pack/plugins/ml/public/application/components/full_time_range_selector/full_time_range_selector_service.ts index 7e14639f1b8b4..b4fecef196ef0 100644 --- a/x-pack/plugins/ml/public/application/components/full_time_range_selector/full_time_range_selector_service.ts +++ b/x-pack/plugins/ml/public/application/components/full_time_range_selector/full_time_range_selector_service.ts @@ -8,7 +8,7 @@ import moment from 'moment'; import { i18n } from '@kbn/i18n'; -import dateMath from '@elastic/datemath'; +import dateMath from '@kbn/datemath'; import type { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/types'; import { getTimefilter, getToastNotifications } from '../../util/dependency_cache'; import { ml, GetTimeFieldRangeResponse } from '../../services/ml_api_service'; diff --git a/x-pack/plugins/ml/public/application/util/chart_utils.test.js b/x-pack/plugins/ml/public/application/util/chart_utils.test.js index 0900bfacd354e..2c457b079542a 100644 --- a/x-pack/plugins/ml/public/application/util/chart_utils.test.js +++ b/x-pack/plugins/ml/public/application/util/chart_utils.test.js @@ -8,7 +8,7 @@ import seriesConfig from '../explorer/explorer_charts/__mocks__/mock_series_config_filebeat'; jest.mock('./dependency_cache', () => { - const dateMath = require('@elastic/datemath'); + const dateMath = require('@kbn/datemath'); let _time = undefined; const timefilter = { setTime: (time) => { diff --git a/x-pack/plugins/ml/public/application/util/time_buckets.js b/x-pack/plugins/ml/public/application/util/time_buckets.js index d9cfa7729d8d8..21a991ce0a190 100644 --- a/x-pack/plugins/ml/public/application/util/time_buckets.js +++ b/x-pack/plugins/ml/public/application/util/time_buckets.js @@ -7,7 +7,7 @@ import { isPlainObject, isString, ary, sortBy, assign } from 'lodash'; import moment from 'moment'; -import dateMath from '@elastic/datemath'; +import dateMath from '@kbn/datemath'; import { timeBucketsCalcAutoIntervalProvider } from './calc_auto_interval'; import { parseInterval } from '../../../common/util/parse_interval'; diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/components/date_range_picker.tsx b/x-pack/plugins/observability/public/components/shared/exploratory_view/components/date_range_picker.tsx index d4a060359b146..200c332d7aa1d 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/components/date_range_picker.tsx +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/components/date_range_picker.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { EuiDatePicker, EuiDatePickerRange } from '@elastic/eui'; import { Moment } from 'moment'; -import DateMath from '@elastic/datemath'; +import DateMath from '@kbn/datemath'; import { i18n } from '@kbn/i18n'; import { useSeriesStorage } from '../hooks/use_series_storage'; import { useUiSetting } from '../../../../../../../../src/plugins/kibana_react/public'; diff --git a/x-pack/plugins/observability/public/utils/date.ts b/x-pack/plugins/observability/public/utils/date.ts index b694bd61d39a9..5839adf92618b 100644 --- a/x-pack/plugins/observability/public/utils/date.ts +++ b/x-pack/plugins/observability/public/utils/date.ts @@ -5,7 +5,7 @@ * 2.0. */ -import datemath from '@elastic/datemath'; +import datemath from '@kbn/datemath'; export function getAbsoluteTime(range: string, opts: Parameters[1] = {}) { const parsed = datemath.parse(range, opts); diff --git a/x-pack/plugins/security_solution/public/common/components/super_date_picker/index.tsx b/x-pack/plugins/security_solution/public/common/components/super_date_picker/index.tsx index dc2ba963972a1..879a735b33004 100644 --- a/x-pack/plugins/security_solution/public/common/components/super_date_picker/index.tsx +++ b/x-pack/plugins/security_solution/public/common/components/super_date_picker/index.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import dateMath from '@elastic/datemath'; +import dateMath from '@kbn/datemath'; import { EuiSuperDatePicker, OnRefreshChangeProps, diff --git a/x-pack/plugins/security_solution/public/common/components/url_state/normalize_time_range.test.ts b/x-pack/plugins/security_solution/public/common/components/url_state/normalize_time_range.test.ts index a87b1206c0082..c5c18a10922a1 100644 --- a/x-pack/plugins/security_solution/public/common/components/url_state/normalize_time_range.test.ts +++ b/x-pack/plugins/security_solution/public/common/components/url_state/normalize_time_range.test.ts @@ -13,7 +13,7 @@ import { RelativeTimeRange, isRelativeTimeRange, } from '../../store/inputs/model'; -import DateMath from '@elastic/datemath'; +import DateMath from '@kbn/datemath'; import { getTimeRangeSettings } from '../../utils/default_date_settings'; const getTimeRangeSettingsMock = getTimeRangeSettings as jest.Mock; diff --git a/x-pack/plugins/security_solution/public/common/hooks/eql/helpers.ts b/x-pack/plugins/security_solution/public/common/hooks/eql/helpers.ts index 7594696336eda..63c1dd7f2d927 100644 --- a/x-pack/plugins/security_solution/public/common/hooks/eql/helpers.ts +++ b/x-pack/plugins/security_solution/public/common/hooks/eql/helpers.ts @@ -6,7 +6,7 @@ */ import moment from 'moment'; -import { Unit } from '@elastic/datemath'; +import { Unit } from '@kbn/datemath'; import { inputsModel } from '../../../common/store'; import type { EqlSearchStrategyResponse } from '../../../../../../../src/plugins/data/common'; diff --git a/x-pack/plugins/security_solution/public/common/hooks/eql/types.ts b/x-pack/plugins/security_solution/public/common/hooks/eql/types.ts index 4bf5aa73863df..06fb0e1c72b3e 100644 --- a/x-pack/plugins/security_solution/public/common/hooks/eql/types.ts +++ b/x-pack/plugins/security_solution/public/common/hooks/eql/types.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { Unit } from '@elastic/datemath'; +import { Unit } from '@kbn/datemath'; import { InspectResponse } from '../../../types'; import { ChartData } from '../../components/charts/common'; diff --git a/x-pack/plugins/security_solution/public/common/hooks/eql/use_eql_preview.test.ts b/x-pack/plugins/security_solution/public/common/hooks/eql/use_eql_preview.test.ts index 00edace90b7fd..36246cc602f11 100644 --- a/x-pack/plugins/security_solution/public/common/hooks/eql/use_eql_preview.test.ts +++ b/x-pack/plugins/security_solution/public/common/hooks/eql/use_eql_preview.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { Unit } from '@elastic/datemath'; +import { Unit } from '@kbn/datemath'; import { renderHook, act } from '@testing-library/react-hooks'; import { of, throwError } from 'rxjs'; import { delay } from 'rxjs/operators'; diff --git a/x-pack/plugins/security_solution/public/common/utils/default_date_settings.ts b/x-pack/plugins/security_solution/public/common/utils/default_date_settings.ts index ed747dbcf22bb..3743560698378 100644 --- a/x-pack/plugins/security_solution/public/common/utils/default_date_settings.ts +++ b/x-pack/plugins/security_solution/public/common/utils/default_date_settings.ts @@ -5,7 +5,7 @@ * 2.0. */ -import dateMath from '@elastic/datemath'; +import dateMath from '@kbn/datemath'; import moment from 'moment'; import { isBoolean, isNumber, isString } from 'lodash/fp'; diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_table/actions.tsx b/x-pack/plugins/security_solution/public/detections/components/alerts_table/actions.tsx index 95042ac776875..1c3c010c972f7 100644 --- a/x-pack/plugins/security_solution/public/detections/components/alerts_table/actions.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/alerts_table/actions.tsx @@ -10,7 +10,7 @@ import { getOr, isEmpty } from 'lodash/fp'; import moment from 'moment'; -import dateMath from '@elastic/datemath'; +import dateMath from '@kbn/datemath'; import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { FilterStateStore, Filter } from '@kbn/es-query'; diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/rule_preview/helpers.ts b/x-pack/plugins/security_solution/public/detections/components/rules/rule_preview/helpers.ts index b57af8ede2fef..f4e58c0d34c74 100644 --- a/x-pack/plugins/security_solution/public/detections/components/rules/rule_preview/helpers.ts +++ b/x-pack/plugins/security_solution/public/detections/components/rules/rule_preview/helpers.ts @@ -8,7 +8,7 @@ import { Position, ScaleType } from '@elastic/charts'; import { EuiSelectOption } from '@elastic/eui'; import { Type, Language, ThreatMapping } from '@kbn/securitysolution-io-ts-alerting-types'; -import { Unit } from '@elastic/datemath'; +import { Unit } from '@kbn/datemath'; import type { Filter } from '@kbn/es-query'; import * as i18n from './translations'; import { histogramDateTimeFormatter } from '../../../../common/components/utils'; diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/rule_preview/index.tsx b/x-pack/plugins/security_solution/public/detections/components/rules/rule_preview/index.tsx index 2dac0b68b0299..a870b837a7d33 100644 --- a/x-pack/plugins/security_solution/public/detections/components/rules/rule_preview/index.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/rules/rule_preview/index.tsx @@ -6,7 +6,7 @@ */ import React, { useState, useEffect, useMemo } from 'react'; -import { Unit } from '@elastic/datemath'; +import { Unit } from '@kbn/datemath'; import { ThreatMapping, Type } from '@kbn/securitysolution-io-ts-alerting-types'; import styled from 'styled-components'; import { diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/rule_preview/preview_histogram.tsx b/x-pack/plugins/security_solution/public/detections/components/rules/rule_preview/preview_histogram.tsx index 3b640592535b6..326811783fc4a 100644 --- a/x-pack/plugins/security_solution/public/detections/components/rules/rule_preview/preview_histogram.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/rules/rule_preview/preview_histogram.tsx @@ -7,7 +7,7 @@ import React, { useEffect, useMemo } from 'react'; import usePrevious from 'react-use/lib/usePrevious'; -import { Unit } from '@elastic/datemath'; +import { Unit } from '@kbn/datemath'; import { EuiFlexGroup, EuiFlexItem, EuiText, EuiSpacer, EuiLoadingChart } from '@elastic/eui'; import styled from 'styled-components'; import { Type } from '@kbn/securitysolution-io-ts-alerting-types'; diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/rule_preview/use_preview_route.tsx b/x-pack/plugins/security_solution/public/detections/components/rules/rule_preview/use_preview_route.tsx index d5278144cf70a..4e05327d74981 100644 --- a/x-pack/plugins/security_solution/public/detections/components/rules/rule_preview/use_preview_route.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/rules/rule_preview/use_preview_route.tsx @@ -6,7 +6,7 @@ */ import { useEffect, useState, useCallback } from 'react'; -import { Unit } from '@elastic/datemath'; +import { Unit } from '@kbn/datemath'; import { Type, ThreatMapping } from '@kbn/securitysolution-io-ts-alerting-types'; import { FieldValueQueryBar } from '../query_bar'; import { usePreviewRule } from '../../../containers/detection_engine/rules/use_preview_rule'; diff --git a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/api.ts b/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/api.ts index a75558b8a8a1a..7223e11eed76d 100644 --- a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/api.ts +++ b/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/api.ts @@ -6,7 +6,7 @@ */ import { camelCase } from 'lodash'; -import dateMath from '@elastic/datemath'; +import dateMath from '@kbn/datemath'; import { HttpStart } from 'src/core/public'; import { diff --git a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/use_preview_rule.ts b/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/use_preview_rule.ts index b610e96273ebd..3d813c8d10a68 100644 --- a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/use_preview_rule.ts +++ b/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/use_preview_rule.ts @@ -7,7 +7,7 @@ import { useEffect, useState } from 'react'; -import { Unit } from '@elastic/datemath'; +import { Unit } from '@kbn/datemath'; import { RULE_PREVIEW_FROM, RULE_PREVIEW_INTERVAL, diff --git a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/create/helpers.ts b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/create/helpers.ts index e18886166f470..49f8b386108b1 100644 --- a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/create/helpers.ts +++ b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/create/helpers.ts @@ -6,7 +6,7 @@ */ import { has, isEmpty } from 'lodash/fp'; -import { Unit } from '@elastic/datemath'; +import { Unit } from '@kbn/datemath'; import moment from 'moment'; import deepmerge from 'deepmerge'; diff --git a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/helpers.tsx b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/helpers.tsx index 39a6b12d63132..d91eed9301ae4 100644 --- a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/helpers.tsx +++ b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/helpers.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import dateMath from '@elastic/datemath'; +import dateMath from '@kbn/datemath'; import moment from 'moment'; import memoizeOne from 'memoize-one'; import { useLocation } from 'react-router-dom'; diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/utils.ts b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/utils.ts index 1bfb99c68ef66..96687895b99c6 100644 --- a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/utils.ts +++ b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/utils.ts @@ -5,7 +5,7 @@ * 2.0. */ -import dateMath from '@elastic/datemath'; +import dateMath from '@kbn/datemath'; import moment from 'moment'; import { HostInfo, HostMetadata } from '../../../../common/endpoint/types'; diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/components/activity_log_date_range_picker/index.tsx b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/components/activity_log_date_range_picker/index.tsx index a57fa8d8e4ce5..423f6188c1b8c 100644 --- a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/components/activity_log_date_range_picker/index.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/components/activity_log_date_range_picker/index.tsx @@ -8,7 +8,7 @@ import { useDispatch } from 'react-redux'; import React, { memo, useCallback } from 'react'; import styled from 'styled-components'; -import dateMath from '@elastic/datemath'; +import dateMath from '@kbn/datemath'; import { EuiFlexGroup, EuiFlexItem, diff --git a/x-pack/plugins/security_solution/public/transforms/utils/adjust_timerange.ts b/x-pack/plugins/security_solution/public/transforms/utils/adjust_timerange.ts index e9334379d7b0b..464ccd8692512 100644 --- a/x-pack/plugins/security_solution/public/transforms/utils/adjust_timerange.ts +++ b/x-pack/plugins/security_solution/public/transforms/utils/adjust_timerange.ts @@ -5,7 +5,7 @@ * 2.0. */ -import dateMath from '@elastic/datemath'; +import dateMath from '@kbn/datemath'; import moment, { Duration } from 'moment'; import type { TimerangeInput } from '../../../common/search_strategy'; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/executors/eql.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/executors/eql.test.ts index e7810e6fe0078..288fd7a688e3c 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/executors/eql.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/executors/eql.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import dateMath from '@elastic/datemath'; +import dateMath from '@kbn/datemath'; import { loggingSystemMock } from 'src/core/server/mocks'; import { alertsMock, RuleExecutorServicesMock } from '../../../../../../alerting/server/mocks'; import { eqlExecutor } from './eql'; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/executors/ml.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/executors/ml.test.ts index 417382b0bd05a..bc756bf9681e3 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/executors/ml.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/executors/ml.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import dateMath from '@elastic/datemath'; +import dateMath from '@kbn/datemath'; import { loggingSystemMock } from 'src/core/server/mocks'; import { alertsMock, RuleExecutorServicesMock } from '../../../../../../alerting/server/mocks'; import { mlExecutor } from './ml'; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/executors/threshold.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/executors/threshold.test.ts index 14c56aa3bc9be..01e61b6917cc4 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/executors/threshold.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/executors/threshold.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import dateMath from '@elastic/datemath'; +import dateMath from '@kbn/datemath'; import { loggingSystemMock } from 'src/core/server/mocks'; // eslint-disable-next-line @kbn/eslint/no-restricted-paths import { elasticsearchClientMock } from 'src/core/server/elasticsearch/client/mocks'; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/find_ml_signals.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/find_ml_signals.ts index 10f89b56229dc..7d2041d86e395 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/find_ml_signals.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/find_ml_signals.ts @@ -5,7 +5,7 @@ * 2.0. */ -import dateMath from '@elastic/datemath'; +import dateMath from '@kbn/datemath'; import type { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types'; import { KibanaRequest, SavedObjectsClientContract } from '../../../../../../../src/core/server'; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/utils.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/utils.ts index a0d73707466ce..738a9d9dd0c50 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/utils.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/utils.ts @@ -9,7 +9,7 @@ import { chunk, get, invert, isEmpty, partition } from 'lodash'; import moment from 'moment'; import uuidv5 from 'uuid/v5'; -import dateMath from '@elastic/datemath'; +import dateMath from '@kbn/datemath'; import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import type { TransportResult } from '@elastic/elasticsearch'; import { ALERT_UUID, ALERT_RULE_UUID, ALERT_RULE_PARAMETERS } from '@kbn/rule-data-utils'; diff --git a/x-pack/plugins/triggers_actions_ui/common/parse_interval.ts b/x-pack/plugins/triggers_actions_ui/common/parse_interval.ts index 21fd1b214c32f..39d425bbb9ddd 100644 --- a/x-pack/plugins/triggers_actions_ui/common/parse_interval.ts +++ b/x-pack/plugins/triggers_actions_ui/common/parse_interval.ts @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import dateMath from '@elastic/datemath'; +import dateMath from '@kbn/datemath'; import { i18n } from '@kbn/i18n'; export const INTERVAL_STRING_RE = new RegExp(`^([\\d\\.]+)\\s*(${dateMath.units.join('|')})$`); diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_error_log.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_error_log.tsx index 6eb6c732665e3..1c4dd438e180d 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_error_log.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_error_log.tsx @@ -7,7 +7,7 @@ import React, { useCallback, useEffect, useState, useMemo, useRef } from 'react'; import { i18n } from '@kbn/i18n'; -import datemath from '@elastic/datemath'; +import datemath from '@kbn/datemath'; import { EuiFlexItem, EuiFlexGroup, diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_event_log_list.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_event_log_list.tsx index 852ad9e7c8024..7cc198c1bf58e 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_event_log_list.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_event_log_list.tsx @@ -7,7 +7,7 @@ import React, { useCallback, useEffect, useState, useMemo, useRef } from 'react'; import { i18n } from '@kbn/i18n'; -import datemath from '@elastic/datemath'; +import datemath from '@kbn/datemath'; import { EuiDataGrid, EuiFlexItem, diff --git a/x-pack/plugins/ui_actions_enhanced/public/drilldowns/url_drilldown/handlebars.ts b/x-pack/plugins/ui_actions_enhanced/public/drilldowns/url_drilldown/handlebars.ts index 3f831bc5c9057..fc4ce4c3d9625 100644 --- a/x-pack/plugins/ui_actions_enhanced/public/drilldowns/url_drilldown/handlebars.ts +++ b/x-pack/plugins/ui_actions_enhanced/public/drilldowns/url_drilldown/handlebars.ts @@ -7,7 +7,7 @@ import { create as createHandlebars, HelperDelegate, HelperOptions } from 'handlebars'; import { encode, RisonValue } from 'rison-node'; -import dateMath from '@elastic/datemath'; +import dateMath from '@kbn/datemath'; import moment, { Moment } from 'moment'; import numeral from '@elastic/numeral'; import { url } from '../../../../../../src/plugins/kibana_utils/public'; diff --git a/x-pack/plugins/uptime/common/lib/get_histogram_interval.ts b/x-pack/plugins/uptime/common/lib/get_histogram_interval.ts index 58b04bb041580..8d44fb594c03a 100644 --- a/x-pack/plugins/uptime/common/lib/get_histogram_interval.ts +++ b/x-pack/plugins/uptime/common/lib/get_histogram_interval.ts @@ -5,7 +5,7 @@ * 2.0. */ -import DateMath from '@elastic/datemath'; +import DateMath from '@kbn/datemath'; import { QUERY } from '../constants'; export const parseRelativeDate = (dateStr: string, options = {}) => { diff --git a/x-pack/plugins/uptime/public/components/common/charts/duration_charts.test.tsx b/x-pack/plugins/uptime/public/components/common/charts/duration_charts.test.tsx index 7669ee29786f3..fee4143df11f9 100644 --- a/x-pack/plugins/uptime/public/components/common/charts/duration_charts.test.tsx +++ b/x-pack/plugins/uptime/public/components/common/charts/duration_charts.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import DateMath from '@elastic/datemath'; +import DateMath from '@kbn/datemath'; import { DurationChartComponent } from './duration_chart'; import { MonitorDurationResult } from '../../../../common/types'; import { render } from '../../../lib/helper/rtl_helpers'; diff --git a/x-pack/plugins/uptime/public/components/common/charts/ping_histogram.test.tsx b/x-pack/plugins/uptime/public/components/common/charts/ping_histogram.test.tsx index 602f1b2898a96..345d23ff22b45 100644 --- a/x-pack/plugins/uptime/public/components/common/charts/ping_histogram.test.tsx +++ b/x-pack/plugins/uptime/public/components/common/charts/ping_histogram.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import DateMath from '@elastic/datemath'; +import DateMath from '@kbn/datemath'; import { PingHistogramComponent, PingHistogramComponentProps } from './ping_histogram'; import { render } from '../../../lib/helper/rtl_helpers'; import { mockDataPlugin, mockMoment, mockMomentTimezone } from '../../../lib/helper/test_helpers'; diff --git a/x-pack/plugins/uptime/public/components/monitor/monitor_charts.test.tsx b/x-pack/plugins/uptime/public/components/monitor/monitor_charts.test.tsx index 3f107581c1eea..5e3007ed36a17 100644 --- a/x-pack/plugins/uptime/public/components/monitor/monitor_charts.test.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/monitor_charts.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import DateMath from '@elastic/datemath'; +import DateMath from '@kbn/datemath'; import { MonitorCharts } from './monitor_charts'; import { shallowWithRouter } from '../../lib'; diff --git a/x-pack/plugins/uptime/public/hooks/use_url_params.test.tsx b/x-pack/plugins/uptime/public/hooks/use_url_params.test.tsx index c62f254afccb3..619946d21a263 100644 --- a/x-pack/plugins/uptime/public/hooks/use_url_params.test.tsx +++ b/x-pack/plugins/uptime/public/hooks/use_url_params.test.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import DateMath from '@elastic/datemath'; +import DateMath from '@kbn/datemath'; import React, { useState, Fragment } from 'react'; import { useUrlParams, UptimeUrlParamsHook } from './use_url_params'; import { UptimeRefreshContext } from '../contexts'; diff --git a/x-pack/plugins/uptime/public/lib/helper/url_params/get_supported_url_params.test.ts b/x-pack/plugins/uptime/public/lib/helper/url_params/get_supported_url_params.test.ts index e0ee5574b48d0..4771d864e0bf8 100644 --- a/x-pack/plugins/uptime/public/lib/helper/url_params/get_supported_url_params.test.ts +++ b/x-pack/plugins/uptime/public/lib/helper/url_params/get_supported_url_params.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import DateMath from '@elastic/datemath'; +import DateMath from '@kbn/datemath'; import { getSupportedUrlParams } from './get_supported_url_params'; import { CLIENT_DEFAULTS } from '../../../../common/constants'; diff --git a/x-pack/plugins/uptime/public/lib/helper/url_params/parse_absolute_date.test.ts b/x-pack/plugins/uptime/public/lib/helper/url_params/parse_absolute_date.test.ts index 8f597bcd0912f..c9a5a3081b17a 100644 --- a/x-pack/plugins/uptime/public/lib/helper/url_params/parse_absolute_date.test.ts +++ b/x-pack/plugins/uptime/public/lib/helper/url_params/parse_absolute_date.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import DateMath from '@elastic/datemath'; +import DateMath from '@kbn/datemath'; import moment from 'moment'; import { parseAbsoluteDate } from './parse_absolute_date'; diff --git a/x-pack/plugins/uptime/public/lib/helper/url_params/parse_absolute_date.ts b/x-pack/plugins/uptime/public/lib/helper/url_params/parse_absolute_date.ts index 5a3627c048860..54b555471451c 100644 --- a/x-pack/plugins/uptime/public/lib/helper/url_params/parse_absolute_date.ts +++ b/x-pack/plugins/uptime/public/lib/helper/url_params/parse_absolute_date.ts @@ -5,7 +5,7 @@ * 2.0. */ -import DateMath from '@elastic/datemath'; +import DateMath from '@kbn/datemath'; export const parseAbsoluteDate = (date: string, defaultValue: number, options = {}): number => { const momentWrapper = DateMath.parse(date, options); diff --git a/x-pack/plugins/uptime/server/lib/alerts/status_check.ts b/x-pack/plugins/uptime/server/lib/alerts/status_check.ts index 6d9a0d23d9d32..007ad8672eb2f 100644 --- a/x-pack/plugins/uptime/server/lib/alerts/status_check.ts +++ b/x-pack/plugins/uptime/server/lib/alerts/status_check.ts @@ -6,7 +6,7 @@ */ import { min } from 'lodash'; -import datemath from '@elastic/datemath'; +import datemath from '@kbn/datemath'; import { schema } from '@kbn/config-schema'; import { i18n } from '@kbn/i18n'; import { JsonObject } from '@kbn/utility-types'; diff --git a/x-pack/plugins/ux/public/context/url_params_context/helpers.test.ts b/x-pack/plugins/ux/public/context/url_params_context/helpers.test.ts index 784b10b3f3ee1..b76b53551db08 100644 --- a/x-pack/plugins/ux/public/context/url_params_context/helpers.test.ts +++ b/x-pack/plugins/ux/public/context/url_params_context/helpers.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import datemath from '@elastic/datemath'; +import datemath from '@kbn/datemath'; import moment from 'moment-timezone'; import * as helpers from './helpers'; diff --git a/x-pack/plugins/ux/public/context/url_params_context/helpers.ts b/x-pack/plugins/ux/public/context/url_params_context/helpers.ts index ee6ac43c1aeab..728b89eb2bad7 100644 --- a/x-pack/plugins/ux/public/context/url_params_context/helpers.ts +++ b/x-pack/plugins/ux/public/context/url_params_context/helpers.ts @@ -5,7 +5,7 @@ * 2.0. */ -import datemath from '@elastic/datemath'; +import datemath from '@kbn/datemath'; import { compact, pickBy } from 'lodash'; import moment from 'moment'; import { UrlParams } from './types'; diff --git a/x-pack/plugins/watcher/public/application/sections/watch_edit/components/threshold_watch_edit/watch_visualization.tsx b/x-pack/plugins/watcher/public/application/sections/watch_edit/components/threshold_watch_edit/watch_visualization.tsx index fc6ad7ae4a7d8..23028075daa3b 100644 --- a/x-pack/plugins/watcher/public/application/sections/watch_edit/components/threshold_watch_edit/watch_visualization.tsx +++ b/x-pack/plugins/watcher/public/application/sections/watch_edit/components/threshold_watch_edit/watch_visualization.tsx @@ -16,7 +16,7 @@ import { ScaleType, Settings, } from '@elastic/charts'; -import dateMath from '@elastic/datemath'; +import dateMath from '@kbn/datemath'; import moment from 'moment-timezone'; import { IUiSettingsClient } from 'kibana/public'; import { EuiCallOut, EuiLoadingChart, EuiSpacer, EuiEmptyPrompt, EuiText } from '@elastic/eui'; diff --git a/x-pack/plugins/watcher/public/legacy/calc_es_interval.ts b/x-pack/plugins/watcher/public/legacy/calc_es_interval.ts index cae88b797ea4f..d60f8955bcbd6 100644 --- a/x-pack/plugins/watcher/public/legacy/calc_es_interval.ts +++ b/x-pack/plugins/watcher/public/legacy/calc_es_interval.ts @@ -5,7 +5,7 @@ * 2.0. */ -import dateMath from '@elastic/datemath'; +import dateMath from '@kbn/datemath'; import { parseEsInterval } from './parse_es_interval'; diff --git a/x-pack/plugins/watcher/public/legacy/parse_es_interval/invalid_es_calendar_interval_error.ts b/x-pack/plugins/watcher/public/legacy/parse_es_interval/invalid_es_calendar_interval_error.ts index 6ff68a1254808..6c9ca8b4a95fe 100644 --- a/x-pack/plugins/watcher/public/legacy/parse_es_interval/invalid_es_calendar_interval_error.ts +++ b/x-pack/plugins/watcher/public/legacy/parse_es_interval/invalid_es_calendar_interval_error.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { Unit } from '@elastic/datemath'; +import { Unit } from '@kbn/datemath'; import { i18n } from '@kbn/i18n'; export class InvalidEsCalendarIntervalError extends Error { diff --git a/x-pack/plugins/watcher/public/legacy/parse_es_interval/parse_es_interval.ts b/x-pack/plugins/watcher/public/legacy/parse_es_interval/parse_es_interval.ts index 968ae01587523..a0cf6af6dd331 100644 --- a/x-pack/plugins/watcher/public/legacy/parse_es_interval/parse_es_interval.ts +++ b/x-pack/plugins/watcher/public/legacy/parse_es_interval/parse_es_interval.ts @@ -5,7 +5,7 @@ * 2.0. */ -import dateMath, { Unit } from '@elastic/datemath'; +import dateMath, { Unit } from '@kbn/datemath'; import { InvalidEsCalendarIntervalError } from './invalid_es_calendar_interval_error'; import { InvalidEsIntervalFormatError } from './invalid_es_interval_format_error'; diff --git a/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/get_rule_execution_events.ts b/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/get_rule_execution_events.ts index 555c16e206ab8..b8287c4433ba4 100644 --- a/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/get_rule_execution_events.ts +++ b/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/get_rule_execution_events.ts @@ -5,7 +5,7 @@ * 2.0. */ -import dateMath from '@elastic/datemath'; +import dateMath from '@kbn/datemath'; import expect from '@kbn/expect'; import moment from 'moment'; import { set } from '@elastic/safer-lodash-set'; diff --git a/x-pack/test/functional/apps/rollup_job/hybrid_index_pattern.js b/x-pack/test/functional/apps/rollup_job/hybrid_index_pattern.js index 336a575454e72..04a6a848d3cbd 100644 --- a/x-pack/test/functional/apps/rollup_job/hybrid_index_pattern.js +++ b/x-pack/test/functional/apps/rollup_job/hybrid_index_pattern.js @@ -5,7 +5,7 @@ * 2.0. */ -import datemath from '@elastic/datemath'; +import datemath from '@kbn/datemath'; import expect from '@kbn/expect'; import mockRolledUpData, { mockIndices } from './hybrid_index_helper'; diff --git a/x-pack/test/functional/apps/rollup_job/rollup_jobs.js b/x-pack/test/functional/apps/rollup_job/rollup_jobs.js index 4f535ae3e3ef0..e88082e9f00a8 100644 --- a/x-pack/test/functional/apps/rollup_job/rollup_jobs.js +++ b/x-pack/test/functional/apps/rollup_job/rollup_jobs.js @@ -5,7 +5,7 @@ * 2.0. */ -import datemath from '@elastic/datemath'; +import datemath from '@kbn/datemath'; import expect from '@kbn/expect'; import { mockIndices } from './hybrid_index_helper'; diff --git a/yarn.lock b/yarn.lock index ea4324cd13607..bf1639a09b849 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1228,15 +1228,23 @@ resolved "https://registry.yarnpkg.com/@bazel/ibazel/-/ibazel-0.16.2.tgz#05dd7f06659759fda30f87b15534f1e42f1201bb" integrity sha512-KgqAWMH0emL6f3xH6nqyTryoBMqlJ627LBIe9PT1PRRQPz2FtHib3FIHJPukp1slzF3hJYZvdiVwgPnHbaSOOA== -"@bazel/typescript@4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@bazel/typescript/-/typescript-4.0.0.tgz#71a6f0f5e340c6b8516b21fbc0f0853e74055d0c" - integrity sha512-+Le9q+5IR9gEnSH8sXyxDB5dD6NJx2kbm6AL+cijYVat2MczpGV4sI1mu0mdLzYsEX5Tjt5iHkaNb7sFESjnYA== +"@bazel/typescript@5.3.1": + version "5.3.1" + resolved "https://registry.yarnpkg.com/@bazel/typescript/-/typescript-5.3.1.tgz#f996abebfa57a29a170a83d0c84780286f06cb72" + integrity sha512-fP0fGzLbsOVdbAn6mlrX1LBAT0TJ+S0VVOap9SSSXCb2PknnKEHZupUww/raVSczy+cqcd/Vfpllzm/AcdOmyw== dependencies: + "@bazel/worker" "5.3.1" protobufjs "6.8.8" semver "5.6.0" source-map-support "0.5.9" - tsutils "2.27.2" + tsutils "3.21.0" + +"@bazel/worker@5.3.1": + version "5.3.1" + resolved "https://registry.yarnpkg.com/@bazel/worker/-/worker-5.3.1.tgz#87d850fdfc22cde24f380961f66daa5cbfd4acf7" + integrity sha512-KB+Xs198NLhN01zhlOPr/VEmz/tzwGq/pI1gdnCTLDMTCspV6LnJaIeGgicXuKrzz0V1LhvlvsI5lqJt9yuGYw== + dependencies: + google-protobuf "^3.6.1" "@bcoe/v8-coverage@^0.2.3": version "0.2.3" @@ -1471,9 +1479,12 @@ utility-types "^3.10.0" uuid "^3.3.2" -"@elastic/datemath@link:bazel-bin/packages/elastic-datemath": - version "0.0.0" - uid "" +"@elastic/datemath@5.0.3": + version "5.0.3" + resolved "https://registry.yarnpkg.com/@elastic/datemath/-/datemath-5.0.3.tgz#7baccdab672b9a3ecb7fe8387580670936b58573" + integrity sha512-8Hbr1Uyjm5OcYBfEB60K7sCP6U3IXuWDaLaQmYv3UxgI4jqBWbakoemwWvsqPVUvnwEjuX6z7ghPZbefs8xiaA== + dependencies: + tslib "^1.9.3" "@elastic/ecs-helpers@^1.1.0": version "1.1.0" @@ -2980,6 +2991,10 @@ version "0.0.0" uid "" +"@kbn/datemath@link:bazel-bin/packages/kbn-datemath": + version "0.0.0" + uid "" + "@kbn/dev-utils@link:bazel-bin/packages/kbn-dev-utils": version "0.0.0" uid "" @@ -5557,10 +5572,6 @@ version "0.0.0" uid "" -"@types/elastic__datemath@link:bazel-bin/packages/elastic-datemath/npm_module_types": - version "0.0.0" - uid "" - "@types/enzyme@^3.10.8": version "3.10.8" resolved "https://registry.yarnpkg.com/@types/enzyme/-/enzyme-3.10.8.tgz#ad7ac9d3af3de6fd0673773123fafbc63db50d42" @@ -6007,6 +6018,10 @@ version "0.0.0" uid "" +"@types/kbn__datemath@link:bazel-bin/packages/kbn-datemath/npm_module_types": + version "0.0.0" + uid "" + "@types/kbn__dev-utils@link:bazel-bin/packages/kbn-dev-utils/npm_module_types": version "0.0.0" uid "" @@ -15447,6 +15462,11 @@ gonzales-pe@^4.3.0: dependencies: minimist "^1.2.5" +google-protobuf@^3.6.1: + version "3.19.4" + resolved "https://registry.yarnpkg.com/google-protobuf/-/google-protobuf-3.19.4.tgz#8d32c3e34be9250956f28c0fb90955d13f311888" + integrity sha512-OIPNCxsG2lkIvf+P5FNfJ/Km95CsXOBecS9ZcAU6m2Rq3svc0Apl9nB3GMDNKfQ9asNv4KjyAqGwPQFrVle3Yg== + got@11.8.2, got@^11.8.2: version "11.8.2" resolved "https://registry.yarnpkg.com/got/-/got-11.8.2.tgz#7abb3959ea28c31f3576f1576c1effce23f33599" @@ -28149,14 +28169,7 @@ tslib@~2.1.0: resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.1.0.tgz#da60860f1c2ecaa5703ab7d39bc05b6bf988b97a" integrity sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A== -tsutils@2.27.2: - version "2.27.2" - resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.27.2.tgz#60ba88a23d6f785ec4b89c6e8179cac9b431f1c7" - integrity sha512-qf6rmT84TFMuxAKez2pIfR8UCai49iQsfB7YWVjV1bKpy/d0PWT5rEOSM6La9PiHZ0k1RRZQiwVdVJfQ3BPHgg== - dependencies: - tslib "^1.8.1" - -tsutils@^3.21.0: +tsutils@3.21.0, tsutils@^3.21.0: version "3.21.0" resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.21.0.tgz#b48717d394cea6c1e096983eed58e9d61715b623" integrity sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==