From 38164f40556372417ec54212aafa4e1c271acfc8 Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Tue, 7 Dec 2021 20:12:18 +0000 Subject: [PATCH] chore(NA): splits types from code on @kbn/dev-utils (#120531) Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- package.json | 1 + packages/BUILD.bazel | 1 + .../elastic-eslint-config-kibana/react.js | 2 +- .../typescript.js | 2 +- packages/kbn-cli-dev-mode/BUILD.bazel | 2 +- .../kbn-cli-dev-mode/src/cli_dev_mode.test.ts | 8 ++---- packages/kbn-cli-dev-mode/src/cli_dev_mode.ts | 3 +- .../src/get_server_watch_paths.test.ts | 3 +- .../src/get_server_watch_paths.ts | 2 +- packages/kbn-crypto/BUILD.bazel | 2 +- packages/kbn-dev-utils/BUILD.bazel | 28 +++++++++++++++---- packages/kbn-dev-utils/package.json | 1 - packages/kbn-dev-utils/src/index.ts | 1 - packages/kbn-docs-utils/BUILD.bazel | 2 +- .../src/api_docs/build_api_docs_cli.ts | 5 ++-- .../src/api_docs/find_plugins.ts | 3 +- packages/kbn-es-archiver/BUILD.bazel | 2 +- packages/kbn-es-archiver/src/actions/load.ts | 3 +- .../src/actions/rebuild_all.ts | 4 +-- packages/kbn-es-archiver/src/actions/save.ts | 4 +-- .../kbn-es-archiver/src/actions/unload.ts | 4 +-- packages/kbn-es-archiver/src/es_archiver.ts | 3 +- .../docs/generate_doc_records_stream.test.ts | 5 ++-- .../lib/docs/index_doc_records_stream.test.ts | 9 ++---- .../helpers/exports.js | 2 +- packages/kbn-optimizer/BUILD.bazel | 6 +++- ..._babel_runtime_helpers_in_entry_bundles.ts | 3 +- .../src/node/node_auto_tranpilation.ts | 2 +- .../src/optimizer/get_changes.test.ts | 3 +- .../src/optimizer/get_changes.ts | 2 +- packages/kbn-plugin-generator/BUILD.bazel | 2 +- packages/kbn-plugin-helpers/BUILD.bazel | 2 +- packages/kbn-storybook/BUILD.bazel | 4 ++- packages/kbn-storybook/src/lib/constants.ts | 2 +- packages/kbn-telemetry-tools/BUILD.bazel | 3 +- packages/kbn-test/BUILD.bazel | 11 +++++++- packages/kbn-test/src/es/es_test_config.ts | 2 +- .../lib/mocha/validate_ci_group_tags.js | 2 +- .../lib/suite_tracker.test.ts | 2 +- .../lib/babel_register_for_test_plugins.js | 2 +- .../kbn-test/src/functional_tests/tasks.ts | 3 +- .../kbn_client/kbn_client_import_export.ts | 3 +- .../integration_tests/invalid_config.test.ts | 2 +- .../capabilities_service.test.ts | 2 +- src/core/server/core_context.mock.ts | 2 +- .../elasticsearch_service.test.ts | 2 +- .../http/cookie_session_storage.test.ts | 2 +- src/core/server/http/http_service.test.ts | 2 +- src/core/server/http/test_utils.ts | 2 +- .../discovery/plugins_discovery.test.ts | 2 +- .../integration_tests/plugins_service.test.ts | 2 +- src/core/server/plugins/plugin.test.ts | 2 +- .../server/plugins/plugin_context.test.ts | 2 +- .../server/plugins/plugins_config.test.ts | 2 +- .../server/plugins/plugins_service.test.ts | 3 +- .../server/plugins/plugins_system.test.ts | 2 +- .../server/preboot/preboot_service.test.ts | 2 +- src/core/server/root/index.test.ts | 2 +- .../7.7.2_xpack_100k.test.ts | 2 +- .../migration_from_older_v1.test.ts | 2 +- .../migration_from_same_v1.test.ts | 2 +- .../saved_objects_service.test.ts | 2 +- src/core/server/server.test.ts | 2 +- .../integration_tests/index.test.ts | 2 +- src/core/test_helpers/kbn_server.ts | 3 +- .../integration_tests/version_info.test.ts | 2 +- .../docker_generator/bundle_dockerfiles.ts | 3 +- .../tasks/os_packages/docker_generator/run.ts | 3 +- src/dev/chromium_version.ts | 3 +- .../__tests__/enumerate_patterns.test.js | 3 +- .../ingest_coverage/team_assignment/index.js | 3 +- src/dev/ensure_all_tests_in_ci_group.ts | 3 +- src/dev/eslint/run_eslint_with_types.ts | 3 +- src/dev/plugin_discovery/find_plugins.ts | 8 ++---- src/dev/run_build_docs_cli.ts | 3 +- .../run_find_plugins_with_circular_deps.ts | 3 +- src/dev/run_precommit_hook.js | 3 +- src/dev/typescript/build_ts_refs.ts | 3 +- src/dev/typescript/build_ts_refs_cli.ts | 3 +- .../ref_output_cache/ref_output_cache.ts | 3 +- src/dev/typescript/root_refs_config.ts | 3 +- .../server/deprecations/deprecations.test.ts | 2 +- .../apps/metricbeat/_metricbeat_dashboard.ts | 2 +- yarn.lock | 4 +++ 84 files changed, 160 insertions(+), 104 deletions(-) diff --git a/package.json b/package.json index b9ff69c5a190c..bdfa8dc46a29f 100644 --- a/package.json +++ b/package.json @@ -567,6 +567,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__dev-utils": "link:bazel-bin/packages/kbn-dev-utils/npm_module_types", "@types/kbn__docs-utils": "link:bazel-bin/packages/kbn-docs-utils/npm_module_types", "@types/kbn__i18n": "link:bazel-bin/packages/kbn-i18n/npm_module_types", "@types/kbn__i18n-react": "link:bazel-bin/packages/kbn-i18n-react/npm_module_types", diff --git a/packages/BUILD.bazel b/packages/BUILD.bazel index aa90c3c122171..02e8bcf8ea144 100644 --- a/packages/BUILD.bazel +++ b/packages/BUILD.bazel @@ -86,6 +86,7 @@ filegroup( "//packages/kbn-config:build_types", "//packages/kbn-config-schema:build_types", "//packages/kbn-crypto:build_types", + "//packages/kbn-dev-utils:build_types", "//packages/kbn-docs-utils:build_types", "//packages/kbn-i18n:build_types", "//packages/kbn-i18n-react:build_types", diff --git a/packages/elastic-eslint-config-kibana/react.js b/packages/elastic-eslint-config-kibana/react.js index 29000bdb15684..0b1cce15de9ad 100644 --- a/packages/elastic-eslint-config-kibana/react.js +++ b/packages/elastic-eslint-config-kibana/react.js @@ -1,5 +1,5 @@ const semver = require('semver'); -const { kibanaPackageJson: PKG } = require('@kbn/dev-utils'); +const { kibanaPackageJson: PKG } = require('@kbn/utils'); module.exports = { plugins: [ diff --git a/packages/elastic-eslint-config-kibana/typescript.js b/packages/elastic-eslint-config-kibana/typescript.js index 1a0ef81ae2f1e..3ada725cb1805 100644 --- a/packages/elastic-eslint-config-kibana/typescript.js +++ b/packages/elastic-eslint-config-kibana/typescript.js @@ -4,7 +4,7 @@ // as this package was moved from typescript-eslint-parser to @typescript-eslint/parser const semver = require('semver'); -const { kibanaPackageJson: PKG } = require('@kbn/dev-utils'); +const { kibanaPackageJson: PKG } = require('@kbn/utils'); const eslintConfigPrettierTypescriptEslintRules = require('eslint-config-prettier/@typescript-eslint').rules; diff --git a/packages/kbn-cli-dev-mode/BUILD.bazel b/packages/kbn-cli-dev-mode/BUILD.bazel index dfb441dffc6ef..cdc40e85c972a 100644 --- a/packages/kbn-cli-dev-mode/BUILD.bazel +++ b/packages/kbn-cli-dev-mode/BUILD.bazel @@ -50,7 +50,7 @@ RUNTIME_DEPS = [ TYPES_DEPS = [ "//packages/kbn-config:npm_module_types", "//packages/kbn-config-schema:npm_module_types", - "//packages/kbn-dev-utils", + "//packages/kbn-dev-utils:npm_module_types", "//packages/kbn-logging", "//packages/kbn-optimizer", "//packages/kbn-server-http-tools", diff --git a/packages/kbn-cli-dev-mode/src/cli_dev_mode.test.ts b/packages/kbn-cli-dev-mode/src/cli_dev_mode.test.ts index e5e009e51e69e..0066644d0825a 100644 --- a/packages/kbn-cli-dev-mode/src/cli_dev_mode.test.ts +++ b/packages/kbn-cli-dev-mode/src/cli_dev_mode.test.ts @@ -8,11 +8,9 @@ import Path from 'path'; import * as Rx from 'rxjs'; -import { - REPO_ROOT, - createAbsolutePathSerializer, - createAnyInstanceSerializer, -} from '@kbn/dev-utils'; +import { createAbsolutePathSerializer, createAnyInstanceSerializer } from '@kbn/dev-utils'; + +import { REPO_ROOT } from '@kbn/utils'; import { TestLog } from './log'; import { CliDevMode, SomeCliArgs } from './cli_dev_mode'; diff --git a/packages/kbn-cli-dev-mode/src/cli_dev_mode.ts b/packages/kbn-cli-dev-mode/src/cli_dev_mode.ts index 2396b316aa3a2..9cf688b675e67 100644 --- a/packages/kbn-cli-dev-mode/src/cli_dev_mode.ts +++ b/packages/kbn-cli-dev-mode/src/cli_dev_mode.ts @@ -22,7 +22,8 @@ import { takeUntil, } from 'rxjs/operators'; import { CliArgs } from '@kbn/config'; -import { REPO_ROOT, CiStatsReporter } from '@kbn/dev-utils'; +import { CiStatsReporter } from '@kbn/dev-utils'; +import { REPO_ROOT } from '@kbn/utils'; import { Log, CliLog } from './log'; import { Optimizer } from './optimizer'; diff --git a/packages/kbn-cli-dev-mode/src/get_server_watch_paths.test.ts b/packages/kbn-cli-dev-mode/src/get_server_watch_paths.test.ts index 06ded8d8bf526..25bc59bf78458 100644 --- a/packages/kbn-cli-dev-mode/src/get_server_watch_paths.test.ts +++ b/packages/kbn-cli-dev-mode/src/get_server_watch_paths.test.ts @@ -8,7 +8,8 @@ import Path from 'path'; -import { REPO_ROOT, createAbsolutePathSerializer } from '@kbn/dev-utils'; +import { createAbsolutePathSerializer } from '@kbn/dev-utils'; +import { REPO_ROOT } from '@kbn/utils'; import { getServerWatchPaths } from './get_server_watch_paths'; diff --git a/packages/kbn-cli-dev-mode/src/get_server_watch_paths.ts b/packages/kbn-cli-dev-mode/src/get_server_watch_paths.ts index f075dc806b6ec..acfc9aeecdc80 100644 --- a/packages/kbn-cli-dev-mode/src/get_server_watch_paths.ts +++ b/packages/kbn-cli-dev-mode/src/get_server_watch_paths.ts @@ -9,7 +9,7 @@ import Path from 'path'; import Fs from 'fs'; -import { REPO_ROOT } from '@kbn/dev-utils'; +import { REPO_ROOT } from '@kbn/utils'; interface Options { pluginPaths: string[]; diff --git a/packages/kbn-crypto/BUILD.bazel b/packages/kbn-crypto/BUILD.bazel index 81ee6d770103c..f71c8b866fd5d 100644 --- a/packages/kbn-crypto/BUILD.bazel +++ b/packages/kbn-crypto/BUILD.bazel @@ -34,7 +34,7 @@ RUNTIME_DEPS = [ ] TYPES_DEPS = [ - "//packages/kbn-dev-utils", + "//packages/kbn-dev-utils:npm_module_types", "@npm//@types/flot", "@npm//@types/jest", "@npm//@types/node", diff --git a/packages/kbn-dev-utils/BUILD.bazel b/packages/kbn-dev-utils/BUILD.bazel index 4fd99e0144cb6..89df1870a3cec 100644 --- a/packages/kbn-dev-utils/BUILD.bazel +++ b/packages/kbn-dev-utils/BUILD.bazel @@ -1,9 +1,10 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config", "ts_project") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm") -load("//src/dev/bazel:index.bzl", "jsts_transpiler") +load("@npm//@bazel/typescript:index.bzl", "ts_config") +load("@build_bazel_rules_nodejs//:index.bzl", "js_library") +load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") PKG_BASE_NAME = "kbn-dev-utils" PKG_REQUIRE_NAME = "@kbn/dev-utils" +TYPES_PKG_REQUIRE_NAME = "@types/kbn__dev-utils" SOURCE_FILES = glob( [ @@ -43,7 +44,6 @@ NPM_MODULE_EXTRA_FILES = [ ] RUNTIME_DEPS = [ - "//packages/kbn-std", "//packages/kbn-utils", "@npm//@babel/core", "@npm//axios", @@ -66,7 +66,6 @@ RUNTIME_DEPS = [ ] TYPES_DEPS = [ - "//packages/kbn-std", "//packages/kbn-utils", "@npm//@babel/parser", "@npm//@babel/types", @@ -124,7 +123,7 @@ ts_project( js_library( name = PKG_BASE_NAME, srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], + deps = RUNTIME_DEPS + [":target_node"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) @@ -143,3 +142,20 @@ filegroup( ], visibility = ["//visibility:public"], ) + +pkg_npm_types( + name = "npm_module_types", + srcs = SRCS, + deps = [":tsc_types"], + package_name = TYPES_PKG_REQUIRE_NAME, + tsconfig = ":tsconfig", + visibility = ["//visibility:public"], +) + +filegroup( + name = "build_types", + srcs = [ + ":npm_module_types", + ], + visibility = ["//visibility:public"], +) diff --git a/packages/kbn-dev-utils/package.json b/packages/kbn-dev-utils/package.json index 9d6e6dde86fac..ab4f489e7d345 100644 --- a/packages/kbn-dev-utils/package.json +++ b/packages/kbn-dev-utils/package.json @@ -4,7 +4,6 @@ "private": true, "license": "SSPL-1.0 OR Elastic License 2.0", "main": "./target_node/index.js", - "types": "./target_types/index.d.ts", "kibana": { "devOnly": true } diff --git a/packages/kbn-dev-utils/src/index.ts b/packages/kbn-dev-utils/src/index.ts index 381e99ac677f5..9b207ad9e9966 100644 --- a/packages/kbn-dev-utils/src/index.ts +++ b/packages/kbn-dev-utils/src/index.ts @@ -6,7 +6,6 @@ * Side Public License, v 1. */ -export * from '@kbn/utils'; export { withProcRunner, ProcRunner } from './proc_runner'; export * from './tooling_log'; export * from './serializers'; diff --git a/packages/kbn-docs-utils/BUILD.bazel b/packages/kbn-docs-utils/BUILD.bazel index 37e5bb06377cc..edfd3ee96c181 100644 --- a/packages/kbn-docs-utils/BUILD.bazel +++ b/packages/kbn-docs-utils/BUILD.bazel @@ -38,7 +38,7 @@ RUNTIME_DEPS = [ TYPES_DEPS = [ "//packages/kbn-config:npm_module_types", - "//packages/kbn-dev-utils", + "//packages/kbn-dev-utils:npm_module_types", "//packages/kbn-utils", "@npm//ts-morph", "@npm//@types/dedent", diff --git a/packages/kbn-docs-utils/src/api_docs/build_api_docs_cli.ts b/packages/kbn-docs-utils/src/api_docs/build_api_docs_cli.ts index 2e4ce08540714..3c9137b260a3e 100644 --- a/packages/kbn-docs-utils/src/api_docs/build_api_docs_cli.ts +++ b/packages/kbn-docs-utils/src/api_docs/build_api_docs_cli.ts @@ -9,7 +9,8 @@ import Fs from 'fs'; import Path from 'path'; -import { REPO_ROOT, run, CiStatsReporter, createFlagError } from '@kbn/dev-utils'; +import { run, CiStatsReporter, createFlagError } from '@kbn/dev-utils'; +import { REPO_ROOT } from '@kbn/utils'; import { Project } from 'ts-morph'; import { writePluginDocs } from './mdx/write_plugin_mdx_docs'; @@ -241,7 +242,7 @@ export function runBuildApiDocsCli() { boolean: ['references'], help: ` --plugin Optionally, run for only a specific plugin - --stats Optionally print API stats. Must be one or more of: any, comments or exports. + --stats Optionally print API stats. Must be one or more of: any, comments or exports. --references Collect references for API items `, }, diff --git a/packages/kbn-docs-utils/src/api_docs/find_plugins.ts b/packages/kbn-docs-utils/src/api_docs/find_plugins.ts index 78cba3f3a9476..774452a6f1f9f 100644 --- a/packages/kbn-docs-utils/src/api_docs/find_plugins.ts +++ b/packages/kbn-docs-utils/src/api_docs/find_plugins.ts @@ -12,7 +12,8 @@ import globby from 'globby'; import loadJsonFile from 'load-json-file'; import { getPluginSearchPaths } from '@kbn/config'; -import { simpleKibanaPlatformPluginDiscovery, REPO_ROOT } from '@kbn/dev-utils'; +import { simpleKibanaPlatformPluginDiscovery } from '@kbn/dev-utils'; +import { REPO_ROOT } from '@kbn/utils'; import { ApiScope, PluginOrPackage } from './types'; export function findPlugins(): PluginOrPackage[] { diff --git a/packages/kbn-es-archiver/BUILD.bazel b/packages/kbn-es-archiver/BUILD.bazel index 2dc311ed74406..f50a5b98f6811 100644 --- a/packages/kbn-es-archiver/BUILD.bazel +++ b/packages/kbn-es-archiver/BUILD.bazel @@ -43,7 +43,7 @@ RUNTIME_DEPS = [ ] TYPES_DEPS = [ - "//packages/kbn-dev-utils", + "//packages/kbn-dev-utils:npm_module_types", "//packages/kbn-test", "//packages/kbn-utils", "@npm//@elastic/elasticsearch", diff --git a/packages/kbn-es-archiver/src/actions/load.ts b/packages/kbn-es-archiver/src/actions/load.ts index 0a7235c566b52..c5bea5e29a687 100644 --- a/packages/kbn-es-archiver/src/actions/load.ts +++ b/packages/kbn-es-archiver/src/actions/load.ts @@ -9,7 +9,8 @@ import { resolve, relative } from 'path'; import { createReadStream } from 'fs'; import { Readable } from 'stream'; -import { ToolingLog, REPO_ROOT } from '@kbn/dev-utils'; +import { ToolingLog } from '@kbn/dev-utils'; +import { REPO_ROOT } from '@kbn/utils'; import { KbnClient } from '@kbn/test'; import type { Client } from '@elastic/elasticsearch'; import { createPromiseFromStreams, concatStreamProviders } from '@kbn/utils'; diff --git a/packages/kbn-es-archiver/src/actions/rebuild_all.ts b/packages/kbn-es-archiver/src/actions/rebuild_all.ts index 360fdb438f2db..27fcae0c7cec5 100644 --- a/packages/kbn-es-archiver/src/actions/rebuild_all.ts +++ b/packages/kbn-es-archiver/src/actions/rebuild_all.ts @@ -10,8 +10,8 @@ import { resolve, relative } from 'path'; import { Stats, createReadStream, createWriteStream } from 'fs'; import { stat, rename } from 'fs/promises'; import { Readable, Writable } from 'stream'; -import { ToolingLog, REPO_ROOT } from '@kbn/dev-utils'; -import { createPromiseFromStreams } from '@kbn/utils'; +import { ToolingLog } from '@kbn/dev-utils'; +import { createPromiseFromStreams, REPO_ROOT } from '@kbn/utils'; import { prioritizeMappings, readDirectory, diff --git a/packages/kbn-es-archiver/src/actions/save.ts b/packages/kbn-es-archiver/src/actions/save.ts index 9cb5be05ac060..e5e3f06b8436d 100644 --- a/packages/kbn-es-archiver/src/actions/save.ts +++ b/packages/kbn-es-archiver/src/actions/save.ts @@ -10,8 +10,8 @@ import { resolve, relative } from 'path'; import { createWriteStream, mkdirSync } from 'fs'; import { Readable, Writable } from 'stream'; import type { Client } from '@elastic/elasticsearch'; -import { ToolingLog, REPO_ROOT } from '@kbn/dev-utils'; -import { createListStream, createPromiseFromStreams } from '@kbn/utils'; +import { ToolingLog } from '@kbn/dev-utils'; +import { createListStream, createPromiseFromStreams, REPO_ROOT } from '@kbn/utils'; import { createStats, diff --git a/packages/kbn-es-archiver/src/actions/unload.ts b/packages/kbn-es-archiver/src/actions/unload.ts index 1c5f4cd5d7d03..22830b7289174 100644 --- a/packages/kbn-es-archiver/src/actions/unload.ts +++ b/packages/kbn-es-archiver/src/actions/unload.ts @@ -10,9 +10,9 @@ import { resolve, relative } from 'path'; import { createReadStream } from 'fs'; import { Readable, Writable } from 'stream'; import type { Client } from '@elastic/elasticsearch'; -import { ToolingLog, REPO_ROOT } from '@kbn/dev-utils'; +import { ToolingLog } from '@kbn/dev-utils'; import { KbnClient } from '@kbn/test'; -import { createPromiseFromStreams } from '@kbn/utils'; +import { createPromiseFromStreams, REPO_ROOT } from '@kbn/utils'; import { isGzip, diff --git a/packages/kbn-es-archiver/src/es_archiver.ts b/packages/kbn-es-archiver/src/es_archiver.ts index 354197a98fa46..e13e20f25a703 100644 --- a/packages/kbn-es-archiver/src/es_archiver.ts +++ b/packages/kbn-es-archiver/src/es_archiver.ts @@ -10,7 +10,8 @@ import Fs from 'fs'; import Path from 'path'; import type { Client } from '@elastic/elasticsearch'; -import { ToolingLog, REPO_ROOT } from '@kbn/dev-utils'; +import { ToolingLog } from '@kbn/dev-utils'; +import { REPO_ROOT } from '@kbn/utils'; import { KbnClient } from '@kbn/test'; import { diff --git a/packages/kbn-es-archiver/src/lib/docs/generate_doc_records_stream.test.ts b/packages/kbn-es-archiver/src/lib/docs/generate_doc_records_stream.test.ts index ae21649690a99..2590074a25411 100644 --- a/packages/kbn-es-archiver/src/lib/docs/generate_doc_records_stream.test.ts +++ b/packages/kbn-es-archiver/src/lib/docs/generate_doc_records_stream.test.ts @@ -6,13 +6,14 @@ * Side Public License, v 1. */ +import { ToolingLog } from '@kbn/dev-utils'; + import { createListStream, createPromiseFromStreams, createConcatStream, createMapStream, - ToolingLog, -} from '@kbn/dev-utils'; +} from '@kbn/utils'; import { createGenerateDocRecordsStream } from './generate_doc_records_stream'; import { Progress } from '../progress'; diff --git a/packages/kbn-es-archiver/src/lib/docs/index_doc_records_stream.test.ts b/packages/kbn-es-archiver/src/lib/docs/index_doc_records_stream.test.ts index bcf28a4976a1c..9c0ff4a8f91ec 100644 --- a/packages/kbn-es-archiver/src/lib/docs/index_doc_records_stream.test.ts +++ b/packages/kbn-es-archiver/src/lib/docs/index_doc_records_stream.test.ts @@ -6,12 +6,9 @@ * Side Public License, v 1. */ -import { - createListStream, - createPromiseFromStreams, - ToolingLog, - createRecursiveSerializer, -} from '@kbn/dev-utils'; +import { ToolingLog, createRecursiveSerializer } from '@kbn/dev-utils'; + +import { createListStream, createPromiseFromStreams } from '@kbn/utils'; import { Progress } from '../progress'; import { createIndexDocRecordsStream } from './index_doc_records_stream'; diff --git a/packages/kbn-eslint-plugin-eslint/helpers/exports.js b/packages/kbn-eslint-plugin-eslint/helpers/exports.js index b7af8e83d7661..971364633356c 100644 --- a/packages/kbn-eslint-plugin-eslint/helpers/exports.js +++ b/packages/kbn-eslint-plugin-eslint/helpers/exports.js @@ -9,7 +9,7 @@ const Fs = require('fs'); const Path = require('path'); const ts = require('typescript'); -const { REPO_ROOT } = require('@kbn/dev-utils'); +const { REPO_ROOT } = require('@kbn/utils'); const { ExportSet } = require('./export_set'); /** @typedef {import("@typescript-eslint/types").TSESTree.ExportAllDeclaration} ExportAllDeclaration */ diff --git a/packages/kbn-optimizer/BUILD.bazel b/packages/kbn-optimizer/BUILD.bazel index a389086c9ee3c..3bd41249e2d51 100644 --- a/packages/kbn-optimizer/BUILD.bazel +++ b/packages/kbn-optimizer/BUILD.bazel @@ -38,10 +38,12 @@ RUNTIME_DEPS = [ "//packages/kbn-ui-shared-deps-npm", "//packages/kbn-ui-shared-deps-src", "//packages/kbn-utils", + "@npm//@babel/core", "@npm//chalk", "@npm//clean-webpack-plugin", "@npm//compression-webpack-plugin", "@npm//cpy", + "@npm//dedent", "@npm//del", "@npm//execa", "@npm//jest-diff", @@ -64,7 +66,7 @@ RUNTIME_DEPS = [ TYPES_DEPS = [ "//packages/kbn-config:npm_module_types", "//packages/kbn-config-schema:npm_module_types", - "//packages/kbn-dev-utils", + "//packages/kbn-dev-utils:npm_module_types", "//packages/kbn-std", "//packages/kbn-ui-shared-deps-npm", "//packages/kbn-ui-shared-deps-src", @@ -79,7 +81,9 @@ TYPES_DEPS = [ "@npm//pirates", "@npm//rxjs", "@npm//zlib", + "@npm//@types/babel__core", "@npm//@types/compression-webpack-plugin", + "@npm//@types/dedent", "@npm//@types/jest", "@npm//@types/json-stable-stringify", "@npm//@types/js-yaml", diff --git a/packages/kbn-optimizer/src/babel_runtime_helpers/find_babel_runtime_helpers_in_entry_bundles.ts b/packages/kbn-optimizer/src/babel_runtime_helpers/find_babel_runtime_helpers_in_entry_bundles.ts index f00905f3f4920..c07a9764af76f 100644 --- a/packages/kbn-optimizer/src/babel_runtime_helpers/find_babel_runtime_helpers_in_entry_bundles.ts +++ b/packages/kbn-optimizer/src/babel_runtime_helpers/find_babel_runtime_helpers_in_entry_bundles.ts @@ -8,7 +8,8 @@ import Path from 'path'; -import { run, REPO_ROOT } from '@kbn/dev-utils'; +import { run } from '@kbn/dev-utils'; +import { REPO_ROOT } from '@kbn/utils'; import { OptimizerConfig } from '../optimizer'; import { parseStats, inAnyEntryChunk } from './parse_stats'; diff --git a/packages/kbn-optimizer/src/node/node_auto_tranpilation.ts b/packages/kbn-optimizer/src/node/node_auto_tranpilation.ts index 6f5dabf410ffa..2710ba8a54210 100644 --- a/packages/kbn-optimizer/src/node/node_auto_tranpilation.ts +++ b/packages/kbn-optimizer/src/node/node_auto_tranpilation.ts @@ -39,7 +39,7 @@ import Crypto from 'crypto'; import * as babel from '@babel/core'; import { addHook } from 'pirates'; -import { REPO_ROOT, UPSTREAM_BRANCH } from '@kbn/dev-utils'; +import { REPO_ROOT, UPSTREAM_BRANCH } from '@kbn/utils'; import sourceMapSupport from 'source-map-support'; import { Cache } from './cache'; diff --git a/packages/kbn-optimizer/src/optimizer/get_changes.test.ts b/packages/kbn-optimizer/src/optimizer/get_changes.test.ts index d3cc5cceefddf..d1754248dba17 100644 --- a/packages/kbn-optimizer/src/optimizer/get_changes.test.ts +++ b/packages/kbn-optimizer/src/optimizer/get_changes.test.ts @@ -9,7 +9,8 @@ jest.mock('execa'); import { getChanges } from './get_changes'; -import { REPO_ROOT, createAbsolutePathSerializer } from '@kbn/dev-utils'; +import { createAbsolutePathSerializer } from '@kbn/dev-utils'; +import { REPO_ROOT } from '@kbn/utils'; const execa: jest.Mock = jest.requireMock('execa'); diff --git a/packages/kbn-optimizer/src/optimizer/get_changes.ts b/packages/kbn-optimizer/src/optimizer/get_changes.ts index c5f8abe99c322..b59f938eb8c37 100644 --- a/packages/kbn-optimizer/src/optimizer/get_changes.ts +++ b/packages/kbn-optimizer/src/optimizer/get_changes.ts @@ -10,7 +10,7 @@ import Path from 'path'; import execa from 'execa'; -import { REPO_ROOT } from '@kbn/dev-utils'; +import { REPO_ROOT } from '@kbn/utils'; export type Changes = Map; diff --git a/packages/kbn-plugin-generator/BUILD.bazel b/packages/kbn-plugin-generator/BUILD.bazel index c935d1763dae8..488f09bdd5d52 100644 --- a/packages/kbn-plugin-generator/BUILD.bazel +++ b/packages/kbn-plugin-generator/BUILD.bazel @@ -51,7 +51,7 @@ RUNTIME_DEPS = [ TYPES_DEPS = [ "//packages/kbn-utils", - "//packages/kbn-dev-utils", + "//packages/kbn-dev-utils:npm_module_types", "@npm//del", "@npm//execa", "@npm//globby", diff --git a/packages/kbn-plugin-helpers/BUILD.bazel b/packages/kbn-plugin-helpers/BUILD.bazel index d7744aecac26e..47f205f1530b7 100644 --- a/packages/kbn-plugin-helpers/BUILD.bazel +++ b/packages/kbn-plugin-helpers/BUILD.bazel @@ -42,7 +42,7 @@ RUNTIME_DEPS = [ ] TYPES_DEPS = [ - "//packages/kbn-dev-utils", + "//packages/kbn-dev-utils:npm_module_types", "//packages/kbn-optimizer", "//packages/kbn-utils", "@npm//del", diff --git a/packages/kbn-storybook/BUILD.bazel b/packages/kbn-storybook/BUILD.bazel index f2a7bf25fb407..5dbe22b56c63f 100644 --- a/packages/kbn-storybook/BUILD.bazel +++ b/packages/kbn-storybook/BUILD.bazel @@ -32,6 +32,7 @@ RUNTIME_DEPS = [ "//packages/kbn-dev-utils", "//packages/kbn-ui-shared-deps-npm", "//packages/kbn-ui-shared-deps-src", + "//packages/kbn-utils", "@npm//@storybook/addons", "@npm//@storybook/api", "@npm//@storybook/components", @@ -47,9 +48,10 @@ RUNTIME_DEPS = [ ] TYPES_DEPS = [ - "//packages/kbn-dev-utils", + "//packages/kbn-dev-utils:npm_module_types", "//packages/kbn-ui-shared-deps-npm", "//packages/kbn-ui-shared-deps-src", + "//packages/kbn-utils", "@npm//@storybook/addons", "@npm//@storybook/api", "@npm//@storybook/components", diff --git a/packages/kbn-storybook/src/lib/constants.ts b/packages/kbn-storybook/src/lib/constants.ts index 722f789fde786..69b05c94ea1b0 100644 --- a/packages/kbn-storybook/src/lib/constants.ts +++ b/packages/kbn-storybook/src/lib/constants.ts @@ -7,7 +7,7 @@ */ import { resolve } from 'path'; -import { REPO_ROOT as KIBANA_ROOT } from '@kbn/dev-utils'; +import { REPO_ROOT as KIBANA_ROOT } from '@kbn/utils'; export const REPO_ROOT = KIBANA_ROOT; export const ASSET_DIR = resolve(KIBANA_ROOT, 'built_assets/storybook'); diff --git a/packages/kbn-telemetry-tools/BUILD.bazel b/packages/kbn-telemetry-tools/BUILD.bazel index 1183de2586424..d2ea3a704f154 100644 --- a/packages/kbn-telemetry-tools/BUILD.bazel +++ b/packages/kbn-telemetry-tools/BUILD.bazel @@ -38,8 +38,9 @@ RUNTIME_DEPS = [ ] TYPES_DEPS = [ - "//packages/kbn-dev-utils", + "//packages/kbn-dev-utils:npm_module_types", "//packages/kbn-utility-types", + "@npm//tslib", "@npm//@types/glob", "@npm//@types/jest", "@npm//@types/listr", diff --git a/packages/kbn-test/BUILD.bazel b/packages/kbn-test/BUILD.bazel index 1d1d95d639861..eae0fe2cdf5dc 100644 --- a/packages/kbn-test/BUILD.bazel +++ b/packages/kbn-test/BUILD.bazel @@ -44,11 +44,13 @@ RUNTIME_DEPS = [ "@npm//axios", "@npm//@babel/traverse", "@npm//chance", + "@npm//dedent", "@npm//del", "@npm//enzyme", "@npm//execa", "@npm//exit-hook", "@npm//form-data", + "@npm//getopts", "@npm//globby", "@npm//he", "@npm//history", @@ -59,6 +61,7 @@ RUNTIME_DEPS = [ "@npm//@jest/reporters", "@npm//joi", "@npm//mustache", + "@npm//normalize-path", "@npm//parse-link-header", "@npm//prettier", "@npm//react-dom", @@ -72,13 +75,17 @@ RUNTIME_DEPS = [ ] TYPES_DEPS = [ - "//packages/kbn-dev-utils", + "//packages/kbn-dev-utils:npm_module_types", "//packages/kbn-i18n-react:npm_module_types", + "//packages/kbn-std", "//packages/kbn-utils", "@npm//@elastic/elasticsearch", + "@npm//axios", "@npm//elastic-apm-node", "@npm//del", + "@npm//exit-hook", "@npm//form-data", + "@npm//getopts", "@npm//jest", "@npm//jest-cli", "@npm//jest-snapshot", @@ -86,6 +93,7 @@ TYPES_DEPS = [ "@npm//rxjs", "@npm//xmlbuilder", "@npm//@types/chance", + "@npm//@types/dedent", "@npm//@types/enzyme", "@npm//@types/he", "@npm//@types/history", @@ -93,6 +101,7 @@ TYPES_DEPS = [ "@npm//@types/joi", "@npm//@types/lodash", "@npm//@types/mustache", + "@npm//@types/normalize-path", "@npm//@types/node", "@npm//@types/parse-link-header", "@npm//@types/prettier", diff --git a/packages/kbn-test/src/es/es_test_config.ts b/packages/kbn-test/src/es/es_test_config.ts index db5d705710a75..70000c8068e9f 100644 --- a/packages/kbn-test/src/es/es_test_config.ts +++ b/packages/kbn-test/src/es/es_test_config.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { kibanaPackageJson as pkg } from '@kbn/dev-utils'; +import { kibanaPackageJson as pkg } from '@kbn/utils'; import Url from 'url'; import { adminTestUser } from '../kbn'; diff --git a/packages/kbn-test/src/functional_test_runner/lib/mocha/validate_ci_group_tags.js b/packages/kbn-test/src/functional_test_runner/lib/mocha/validate_ci_group_tags.js index 3446c5be5d4a7..4f798839d7231 100644 --- a/packages/kbn-test/src/functional_test_runner/lib/mocha/validate_ci_group_tags.js +++ b/packages/kbn-test/src/functional_test_runner/lib/mocha/validate_ci_group_tags.js @@ -8,7 +8,7 @@ import Path from 'path'; -import { REPO_ROOT } from '@kbn/dev-utils'; +import { REPO_ROOT } from '@kbn/utils'; /** * Traverse the suites configured and ensure that each suite has no more than one ciGroup assigned diff --git a/packages/kbn-test/src/functional_test_runner/lib/suite_tracker.test.ts b/packages/kbn-test/src/functional_test_runner/lib/suite_tracker.test.ts index e87f316a100a7..53ce4c74c1388 100644 --- a/packages/kbn-test/src/functional_test_runner/lib/suite_tracker.test.ts +++ b/packages/kbn-test/src/functional_test_runner/lib/suite_tracker.test.ts @@ -14,7 +14,7 @@ jest.mock('@kbn/utils', () => { return { REPO_ROOT: '/dev/null/root' }; }); -import { REPO_ROOT } from '@kbn/dev-utils'; +import { REPO_ROOT } from '@kbn/utils'; import { Lifecycle } from './lifecycle'; import { SuiteTracker } from './suite_tracker'; import { Suite } from '../fake_mocha_types'; diff --git a/packages/kbn-test/src/functional_tests/lib/babel_register_for_test_plugins.js b/packages/kbn-test/src/functional_tests/lib/babel_register_for_test_plugins.js index 03947f7e267ba..63d2b56350ba1 100644 --- a/packages/kbn-test/src/functional_tests/lib/babel_register_for_test_plugins.js +++ b/packages/kbn-test/src/functional_tests/lib/babel_register_for_test_plugins.js @@ -9,7 +9,7 @@ const Fs = require('fs'); const Path = require('path'); -const { REPO_ROOT: REPO_ROOT_FOLLOWING_SYMLINKS } = require('@kbn/dev-utils'); +const { REPO_ROOT: REPO_ROOT_FOLLOWING_SYMLINKS } = require('@kbn/utils'); const BASE_REPO_ROOT = Path.resolve( Fs.realpathSync(Path.resolve(REPO_ROOT_FOLLOWING_SYMLINKS, 'package.json')), '..' diff --git a/packages/kbn-test/src/functional_tests/tasks.ts b/packages/kbn-test/src/functional_tests/tasks.ts index 6dde114d3a98e..6a6c7edb98c79 100644 --- a/packages/kbn-test/src/functional_tests/tasks.ts +++ b/packages/kbn-test/src/functional_tests/tasks.ts @@ -9,7 +9,8 @@ import { relative } from 'path'; import * as Rx from 'rxjs'; import { startWith, switchMap, take } from 'rxjs/operators'; -import { withProcRunner, ToolingLog, REPO_ROOT, getTimeReporter } from '@kbn/dev-utils'; +import { withProcRunner, ToolingLog, getTimeReporter } from '@kbn/dev-utils'; +import { REPO_ROOT } from '@kbn/utils'; import dedent from 'dedent'; import { diff --git a/packages/kbn-test/src/kbn_client/kbn_client_import_export.ts b/packages/kbn-test/src/kbn_client/kbn_client_import_export.ts index 4adae7d1cd031..6da34228bbe7f 100644 --- a/packages/kbn-test/src/kbn_client/kbn_client_import_export.ts +++ b/packages/kbn-test/src/kbn_client/kbn_client_import_export.ts @@ -12,7 +12,8 @@ import { existsSync } from 'fs'; import Path from 'path'; import FormData from 'form-data'; -import { ToolingLog, isAxiosResponseError, createFailError, REPO_ROOT } from '@kbn/dev-utils'; +import { ToolingLog, isAxiosResponseError, createFailError } from '@kbn/dev-utils'; +import { REPO_ROOT } from '@kbn/utils'; import { KbnClientRequester, uriencode, ReqOptions } from './kbn_client_requester'; import { KbnClientSavedObjects } from './kbn_client_saved_objects'; diff --git a/src/cli/serve/integration_tests/invalid_config.test.ts b/src/cli/serve/integration_tests/invalid_config.test.ts index 2de902582a548..ca051f37a816e 100644 --- a/src/cli/serve/integration_tests/invalid_config.test.ts +++ b/src/cli/serve/integration_tests/invalid_config.test.ts @@ -8,7 +8,7 @@ import { spawnSync } from 'child_process'; -import { REPO_ROOT } from '@kbn/dev-utils'; +import { REPO_ROOT } from '@kbn/utils'; const INVALID_CONFIG_PATH = require.resolve('./__fixtures__/invalid_config.yml'); diff --git a/src/core/server/capabilities/integration_tests/capabilities_service.test.ts b/src/core/server/capabilities/integration_tests/capabilities_service.test.ts index 2e80fbb9d20c0..c1f6ffb5add77 100644 --- a/src/core/server/capabilities/integration_tests/capabilities_service.test.ts +++ b/src/core/server/capabilities/integration_tests/capabilities_service.test.ts @@ -7,7 +7,7 @@ */ import supertest from 'supertest'; -import { REPO_ROOT } from '@kbn/dev-utils'; +import { REPO_ROOT } from '@kbn/utils'; import { HttpService, InternalHttpServicePreboot, InternalHttpServiceSetup } from '../../http'; import { contextServiceMock } from '../../context/context_service.mock'; import { executionContextServiceMock } from '../../execution_context/execution_context_service.mock'; diff --git a/src/core/server/core_context.mock.ts b/src/core/server/core_context.mock.ts index ddb87d31383c8..4d7b4e1ba5548 100644 --- a/src/core/server/core_context.mock.ts +++ b/src/core/server/core_context.mock.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { REPO_ROOT } from '@kbn/dev-utils'; +import { REPO_ROOT } from '@kbn/utils'; import type { DeeplyMockedKeys } from '@kbn/utility-types/jest'; import { CoreContext } from './core_context'; import { Env, IConfigService } from './config'; diff --git a/src/core/server/elasticsearch/elasticsearch_service.test.ts b/src/core/server/elasticsearch/elasticsearch_service.test.ts index 3b75d19b80a10..ce5672ad30519 100644 --- a/src/core/server/elasticsearch/elasticsearch_service.test.ts +++ b/src/core/server/elasticsearch/elasticsearch_service.test.ts @@ -21,7 +21,7 @@ import { MockClusterClient, isScriptingEnabledMock } from './elasticsearch_servi import type { NodesVersionCompatibility } from './version_check/ensure_es_version'; import { BehaviorSubject } from 'rxjs'; import { first } from 'rxjs/operators'; -import { REPO_ROOT } from '@kbn/dev-utils'; +import { REPO_ROOT } from '@kbn/utils'; import { Env } from '../config'; import { configServiceMock, getEnvOptions } from '../config/mocks'; import { CoreContext } from '../core_context'; diff --git a/src/core/server/http/cookie_session_storage.test.ts b/src/core/server/http/cookie_session_storage.test.ts index ad05d37c81e99..8e2cd58733faf 100644 --- a/src/core/server/http/cookie_session_storage.test.ts +++ b/src/core/server/http/cookie_session_storage.test.ts @@ -8,7 +8,7 @@ import { parse as parseCookie } from 'tough-cookie'; import supertest from 'supertest'; -import { REPO_ROOT } from '@kbn/dev-utils'; +import { REPO_ROOT } from '@kbn/utils'; import { ByteSizeValue } from '@kbn/config-schema'; import { BehaviorSubject } from 'rxjs'; diff --git a/src/core/server/http/http_service.test.ts b/src/core/server/http/http_service.test.ts index 4955d19668580..3a387cdfd5e35 100644 --- a/src/core/server/http/http_service.test.ts +++ b/src/core/server/http/http_service.test.ts @@ -10,7 +10,7 @@ import { mockHttpServer } from './http_service.test.mocks'; import { noop } from 'lodash'; import { BehaviorSubject } from 'rxjs'; -import { REPO_ROOT } from '@kbn/dev-utils'; +import { REPO_ROOT } from '@kbn/utils'; import { getEnvOptions } from '../config/mocks'; import { HttpService } from '.'; import { HttpConfigType, config } from './http_config'; diff --git a/src/core/server/http/test_utils.ts b/src/core/server/http/test_utils.ts index 4e1a88e967f8f..8a8c545b365b3 100644 --- a/src/core/server/http/test_utils.ts +++ b/src/core/server/http/test_utils.ts @@ -8,7 +8,7 @@ import { BehaviorSubject } from 'rxjs'; import moment from 'moment'; -import { REPO_ROOT } from '@kbn/dev-utils'; +import { REPO_ROOT } from '@kbn/utils'; import { ByteSizeValue } from '@kbn/config-schema'; import { Env } from '../config'; import { HttpService } from './http_service'; diff --git a/src/core/server/plugins/discovery/plugins_discovery.test.ts b/src/core/server/plugins/discovery/plugins_discovery.test.ts index 958e051d0476d..a6ffdff4422be 100644 --- a/src/core/server/plugins/discovery/plugins_discovery.test.ts +++ b/src/core/server/plugins/discovery/plugins_discovery.test.ts @@ -7,7 +7,7 @@ */ // must be before mocks imports to avoid conflicting with `REPO_ROOT` accessor. -import { REPO_ROOT } from '@kbn/dev-utils'; +import { REPO_ROOT } from '@kbn/utils'; import { mockPackage, scanPluginSearchPathsMock } from './plugins_discovery.test.mocks'; import mockFs from 'mock-fs'; import { loggingSystemMock } from '../../logging/logging_system.mock'; diff --git a/src/core/server/plugins/integration_tests/plugins_service.test.ts b/src/core/server/plugins/integration_tests/plugins_service.test.ts index 4170d9422f277..ebbb3fa473b6d 100644 --- a/src/core/server/plugins/integration_tests/plugins_service.test.ts +++ b/src/core/server/plugins/integration_tests/plugins_service.test.ts @@ -7,7 +7,7 @@ */ // must be before mocks imports to avoid conflicting with `REPO_ROOT` accessor. -import { REPO_ROOT } from '@kbn/dev-utils'; +import { REPO_ROOT } from '@kbn/utils'; import { mockPackage, mockDiscover } from './plugins_service.test.mocks'; import { join } from 'path'; diff --git a/src/core/server/plugins/plugin.test.ts b/src/core/server/plugins/plugin.test.ts index 513e893992005..92cbda2a69cfe 100644 --- a/src/core/server/plugins/plugin.test.ts +++ b/src/core/server/plugins/plugin.test.ts @@ -8,7 +8,7 @@ import { join } from 'path'; import { BehaviorSubject } from 'rxjs'; -import { REPO_ROOT } from '@kbn/dev-utils'; +import { REPO_ROOT } from '@kbn/utils'; import { schema } from '@kbn/config-schema'; import { Env } from '../config'; diff --git a/src/core/server/plugins/plugin_context.test.ts b/src/core/server/plugins/plugin_context.test.ts index 867d4d978314b..7bcf392ed510b 100644 --- a/src/core/server/plugins/plugin_context.test.ts +++ b/src/core/server/plugins/plugin_context.test.ts @@ -8,7 +8,7 @@ import { duration } from 'moment'; import { first } from 'rxjs/operators'; -import { REPO_ROOT } from '@kbn/dev-utils'; +import { REPO_ROOT } from '@kbn/utils'; import { fromRoot } from '@kbn/utils'; import { createPluginInitializerContext, diff --git a/src/core/server/plugins/plugins_config.test.ts b/src/core/server/plugins/plugins_config.test.ts index d65b057fb65c0..b9225054e63ef 100644 --- a/src/core/server/plugins/plugins_config.test.ts +++ b/src/core/server/plugins/plugins_config.test.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { REPO_ROOT } from '@kbn/dev-utils'; +import { REPO_ROOT } from '@kbn/utils'; import { getEnvOptions } from '../config/mocks'; import { PluginsConfig, PluginsConfigType } from './plugins_config'; import { Env } from '../config'; diff --git a/src/core/server/plugins/plugins_service.test.ts b/src/core/server/plugins/plugins_service.test.ts index 0c077d732c67b..5a05817d2111f 100644 --- a/src/core/server/plugins/plugins_service.test.ts +++ b/src/core/server/plugins/plugins_service.test.ts @@ -11,7 +11,8 @@ import { mockDiscover, mockPackage } from './plugins_service.test.mocks'; import { resolve, join } from 'path'; import { BehaviorSubject, from } from 'rxjs'; import { schema } from '@kbn/config-schema'; -import { createAbsolutePathSerializer, REPO_ROOT } from '@kbn/dev-utils'; +import { createAbsolutePathSerializer } from '@kbn/dev-utils'; +import { REPO_ROOT } from '@kbn/utils'; import { ConfigPath, ConfigService, Env } from '../config'; import { rawConfigServiceMock, getEnvOptions } from '../config/mocks'; diff --git a/src/core/server/plugins/plugins_system.test.ts b/src/core/server/plugins/plugins_system.test.ts index 4cd8e4c551bea..3d8a47005b362 100644 --- a/src/core/server/plugins/plugins_system.test.ts +++ b/src/core/server/plugins/plugins_system.test.ts @@ -14,7 +14,7 @@ import { import { BehaviorSubject } from 'rxjs'; -import { REPO_ROOT } from '@kbn/dev-utils'; +import { REPO_ROOT } from '@kbn/utils'; import { Env } from '../config'; import { configServiceMock, getEnvOptions } from '../config/mocks'; import { CoreContext } from '../core_context'; diff --git a/src/core/server/preboot/preboot_service.test.ts b/src/core/server/preboot/preboot_service.test.ts index dd4b1cb7d1df0..77242f0c5765f 100644 --- a/src/core/server/preboot/preboot_service.test.ts +++ b/src/core/server/preboot/preboot_service.test.ts @@ -7,7 +7,7 @@ */ import { nextTick } from '@kbn/test/jest'; -import { REPO_ROOT } from '@kbn/dev-utils'; +import { REPO_ROOT } from '@kbn/utils'; import { LoggerFactory } from '@kbn/logging'; import { Env } from '@kbn/config'; import { getEnvOptions } from '../config/mocks'; diff --git a/src/core/server/root/index.test.ts b/src/core/server/root/index.test.ts index 7eba051a128f0..6ea3e05b9c2c2 100644 --- a/src/core/server/root/index.test.ts +++ b/src/core/server/root/index.test.ts @@ -10,7 +10,7 @@ import { rawConfigService, configService, logger, mockServer } from './index.tes import { BehaviorSubject } from 'rxjs'; import { filter, first } from 'rxjs/operators'; -import { REPO_ROOT } from '@kbn/dev-utils'; +import { REPO_ROOT } from '@kbn/utils'; import { getEnvOptions } from '../config/mocks'; import { Root } from '.'; import { Env } from '../config'; diff --git a/src/core/server/saved_objects/migrations/integration_tests/7.7.2_xpack_100k.test.ts b/src/core/server/saved_objects/migrations/integration_tests/7.7.2_xpack_100k.test.ts index c22c6154c2605..139cd298d28ed 100644 --- a/src/core/server/saved_objects/migrations/integration_tests/7.7.2_xpack_100k.test.ts +++ b/src/core/server/saved_objects/migrations/integration_tests/7.7.2_xpack_100k.test.ts @@ -8,7 +8,7 @@ import path from 'path'; import { unlink } from 'fs/promises'; -import { REPO_ROOT } from '@kbn/dev-utils'; +import { REPO_ROOT } from '@kbn/utils'; import { Env } from '@kbn/config'; import { getEnvOptions } from '../../../config/mocks'; import * as kbnTestServer from '../../../../test_helpers/kbn_server'; diff --git a/src/core/server/saved_objects/migrations/integration_tests/migration_from_older_v1.test.ts b/src/core/server/saved_objects/migrations/integration_tests/migration_from_older_v1.test.ts index 0ed9262017263..c341463b78910 100644 --- a/src/core/server/saved_objects/migrations/integration_tests/migration_from_older_v1.test.ts +++ b/src/core/server/saved_objects/migrations/integration_tests/migration_from_older_v1.test.ts @@ -10,7 +10,7 @@ import Path from 'path'; import Fs from 'fs'; import Util from 'util'; import Semver from 'semver'; -import { REPO_ROOT } from '@kbn/dev-utils'; +import { REPO_ROOT } from '@kbn/utils'; import { Env } from '@kbn/config'; import { getEnvOptions } from '../../../config/mocks'; import * as kbnTestServer from '../../../../test_helpers/kbn_server'; diff --git a/src/core/server/saved_objects/migrations/integration_tests/migration_from_same_v1.test.ts b/src/core/server/saved_objects/migrations/integration_tests/migration_from_same_v1.test.ts index 15d985daccba6..34d1317755c14 100644 --- a/src/core/server/saved_objects/migrations/integration_tests/migration_from_same_v1.test.ts +++ b/src/core/server/saved_objects/migrations/integration_tests/migration_from_same_v1.test.ts @@ -10,7 +10,7 @@ import Path from 'path'; import Fs from 'fs'; import Util from 'util'; import Semver from 'semver'; -import { REPO_ROOT } from '@kbn/dev-utils'; +import { REPO_ROOT } from '@kbn/utils'; import { Env } from '@kbn/config'; import { getEnvOptions } from '../../../config/mocks'; import * as kbnTestServer from '../../../../test_helpers/kbn_server'; diff --git a/src/core/server/saved_objects/saved_objects_service.test.ts b/src/core/server/saved_objects/saved_objects_service.test.ts index a4f6c019c9624..a8bda95af46f9 100644 --- a/src/core/server/saved_objects/saved_objects_service.test.ts +++ b/src/core/server/saved_objects/saved_objects_service.test.ts @@ -19,7 +19,7 @@ import { import { BehaviorSubject } from 'rxjs'; import { RawPackageInfo } from '@kbn/config'; import { ByteSizeValue } from '@kbn/config-schema'; -import { REPO_ROOT } from '@kbn/dev-utils'; +import { REPO_ROOT } from '@kbn/utils'; import { SavedObjectsService } from './saved_objects_service'; import { mockCoreContext } from '../core_context.mock'; diff --git a/src/core/server/server.test.ts b/src/core/server/server.test.ts index 112693aae0279..48547883d5f67 100644 --- a/src/core/server/server.test.ts +++ b/src/core/server/server.test.ts @@ -26,7 +26,7 @@ import { } from './server.test.mocks'; import { BehaviorSubject } from 'rxjs'; -import { REPO_ROOT } from '@kbn/dev-utils'; +import { REPO_ROOT } from '@kbn/utils'; import { rawConfigServiceMock, getEnvOptions } from './config/mocks'; import { Env } from './config'; import { Server } from './server'; diff --git a/src/core/server/ui_settings/integration_tests/index.test.ts b/src/core/server/ui_settings/integration_tests/index.test.ts index ef635e90dac70..3f85beb2acec6 100644 --- a/src/core/server/ui_settings/integration_tests/index.test.ts +++ b/src/core/server/ui_settings/integration_tests/index.test.ts @@ -7,7 +7,7 @@ */ import { Env } from '@kbn/config'; -import { REPO_ROOT } from '@kbn/dev-utils'; +import { REPO_ROOT } from '@kbn/utils'; import { getEnvOptions } from '../../config/mocks'; import { startServers, stopServers } from './lib'; import { docExistsSuite } from './doc_exists'; diff --git a/src/core/test_helpers/kbn_server.ts b/src/core/test_helpers/kbn_server.ts index 58720be637e2f..c326c7a35df63 100644 --- a/src/core/test_helpers/kbn_server.ts +++ b/src/core/test_helpers/kbn_server.ts @@ -6,7 +6,8 @@ * Side Public License, v 1. */ -import { ToolingLog, REPO_ROOT } from '@kbn/dev-utils'; +import { ToolingLog } from '@kbn/dev-utils'; +import { REPO_ROOT } from '@kbn/utils'; import { createTestEsCluster, CreateTestEsClusterOptions, diff --git a/src/dev/build/lib/integration_tests/version_info.test.ts b/src/dev/build/lib/integration_tests/version_info.test.ts index e7a3a04c04734..9385de6e00a4f 100644 --- a/src/dev/build/lib/integration_tests/version_info.test.ts +++ b/src/dev/build/lib/integration_tests/version_info.test.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { kibanaPackageJson as pkg } from '@kbn/dev-utils'; +import { kibanaPackageJson as pkg } from '@kbn/utils'; import { getVersionInfo } from '../version_info'; diff --git a/src/dev/build/tasks/os_packages/docker_generator/bundle_dockerfiles.ts b/src/dev/build/tasks/os_packages/docker_generator/bundle_dockerfiles.ts index 02b469820f900..cc1ffb5f3e301 100644 --- a/src/dev/build/tasks/os_packages/docker_generator/bundle_dockerfiles.ts +++ b/src/dev/build/tasks/os_packages/docker_generator/bundle_dockerfiles.ts @@ -10,7 +10,8 @@ import { resolve } from 'path'; import { readFileSync } from 'fs'; import { copyFile } from 'fs/promises'; -import { ToolingLog, REPO_ROOT } from '@kbn/dev-utils'; +import { ToolingLog } from '@kbn/dev-utils'; +import { REPO_ROOT } from '@kbn/utils'; import Mustache from 'mustache'; import { compressTar, copyAll, mkdirp, write, Config } from '../../../lib'; diff --git a/src/dev/build/tasks/os_packages/docker_generator/run.ts b/src/dev/build/tasks/os_packages/docker_generator/run.ts index 6a192baed3fa3..085b4393caa66 100644 --- a/src/dev/build/tasks/os_packages/docker_generator/run.ts +++ b/src/dev/build/tasks/os_packages/docker_generator/run.ts @@ -10,7 +10,8 @@ import { access, link, unlink, chmod } from 'fs'; import { resolve, basename } from 'path'; import { promisify } from 'util'; -import { ToolingLog, kibanaPackageJson } from '@kbn/dev-utils'; +import { ToolingLog } from '@kbn/dev-utils'; +import { kibanaPackageJson } from '@kbn/utils'; import { write, copyAll, mkdirp, exec, Config, Build } from '../../../lib'; import * as dockerTemplates from './templates'; diff --git a/src/dev/chromium_version.ts b/src/dev/chromium_version.ts index 410fcc72fbc0f..1f55330a92bb6 100644 --- a/src/dev/chromium_version.ts +++ b/src/dev/chromium_version.ts @@ -6,7 +6,8 @@ * Side Public License, v 1. */ -import { run, REPO_ROOT, ToolingLog } from '@kbn/dev-utils'; +import { run, ToolingLog } from '@kbn/dev-utils'; +import { REPO_ROOT } from '@kbn/utils'; import chalk from 'chalk'; import cheerio from 'cheerio'; import fs from 'fs'; diff --git a/src/dev/code_coverage/ingest_coverage/__tests__/enumerate_patterns.test.js b/src/dev/code_coverage/ingest_coverage/__tests__/enumerate_patterns.test.js index 57467d84f1f61..40d36ed46ea34 100644 --- a/src/dev/code_coverage/ingest_coverage/__tests__/enumerate_patterns.test.js +++ b/src/dev/code_coverage/ingest_coverage/__tests__/enumerate_patterns.test.js @@ -7,7 +7,8 @@ */ import { enumeratePatterns } from '../team_assignment/enumerate_patterns'; -import { ToolingLog, REPO_ROOT } from '@kbn/dev-utils'; +import { ToolingLog } from '@kbn/dev-utils'; +import { REPO_ROOT } from '@kbn/utils'; const log = new ToolingLog({ level: 'info', diff --git a/src/dev/code_coverage/ingest_coverage/team_assignment/index.js b/src/dev/code_coverage/ingest_coverage/team_assignment/index.js index 0e341a3aac1dc..a38c4ee50b40a 100644 --- a/src/dev/code_coverage/ingest_coverage/team_assignment/index.js +++ b/src/dev/code_coverage/ingest_coverage/team_assignment/index.js @@ -6,7 +6,8 @@ * Side Public License, v 1. */ -import { run, createFlagError, REPO_ROOT } from '@kbn/dev-utils'; +import { run, createFlagError } from '@kbn/dev-utils'; +import { REPO_ROOT } from '@kbn/utils'; import { parse } from './parse_owners'; import { flush } from './flush'; import { enumeratePatterns } from './enumerate_patterns'; diff --git a/src/dev/ensure_all_tests_in_ci_group.ts b/src/dev/ensure_all_tests_in_ci_group.ts index aeccefae05d2c..a2d9729d3352b 100644 --- a/src/dev/ensure_all_tests_in_ci_group.ts +++ b/src/dev/ensure_all_tests_in_ci_group.ts @@ -12,7 +12,8 @@ import Fs from 'fs/promises'; import execa from 'execa'; import { safeLoad } from 'js-yaml'; -import { run, REPO_ROOT } from '@kbn/dev-utils'; +import { run } from '@kbn/dev-utils'; +import { REPO_ROOT } from '@kbn/utils'; import { schema } from '@kbn/config-schema'; const RELATIVE_JOBS_YAML_PATH = '.ci/ci_groups.yml'; diff --git a/src/dev/eslint/run_eslint_with_types.ts b/src/dev/eslint/run_eslint_with_types.ts index 750011dea1031..0f2a10d07d681 100644 --- a/src/dev/eslint/run_eslint_with_types.ts +++ b/src/dev/eslint/run_eslint_with_types.ts @@ -14,7 +14,8 @@ import execa from 'execa'; import * as Rx from 'rxjs'; import { mergeMap, reduce } from 'rxjs/operators'; import { supportsColor } from 'chalk'; -import { REPO_ROOT, run, createFailError } from '@kbn/dev-utils'; +import { run, createFailError } from '@kbn/dev-utils'; +import { REPO_ROOT } from '@kbn/utils'; import { lastValueFrom } from '@kbn/std'; import { PROJECTS } from '../typescript/projects'; diff --git a/src/dev/plugin_discovery/find_plugins.ts b/src/dev/plugin_discovery/find_plugins.ts index f1725f34d1f8e..53a53bc08e15b 100644 --- a/src/dev/plugin_discovery/find_plugins.ts +++ b/src/dev/plugin_discovery/find_plugins.ts @@ -8,11 +8,9 @@ import Path from 'path'; import { getPluginSearchPaths } from '@kbn/config'; -import { - KibanaPlatformPlugin, - REPO_ROOT, - simpleKibanaPlatformPluginDiscovery, -} from '@kbn/dev-utils'; +import { KibanaPlatformPlugin, simpleKibanaPlatformPluginDiscovery } from '@kbn/dev-utils'; + +import { REPO_ROOT } from '@kbn/utils'; export interface SearchOptions { oss: boolean; diff --git a/src/dev/run_build_docs_cli.ts b/src/dev/run_build_docs_cli.ts index aad524b4437d3..8ee75912c1a7e 100644 --- a/src/dev/run_build_docs_cli.ts +++ b/src/dev/run_build_docs_cli.ts @@ -9,7 +9,8 @@ import Path from 'path'; import dedent from 'dedent'; -import { run, REPO_ROOT, createFailError } from '@kbn/dev-utils'; +import { run, createFailError } from '@kbn/dev-utils'; +import { REPO_ROOT } from '@kbn/utils'; const DEFAULT_DOC_REPO_PATH = Path.resolve(REPO_ROOT, '..', 'docs'); diff --git a/src/dev/run_find_plugins_with_circular_deps.ts b/src/dev/run_find_plugins_with_circular_deps.ts index f7974b464fcaf..f9ee7bd84c54f 100644 --- a/src/dev/run_find_plugins_with_circular_deps.ts +++ b/src/dev/run_find_plugins_with_circular_deps.ts @@ -10,7 +10,8 @@ import dedent from 'dedent'; import { parseDependencyTree, parseCircular, prettyCircular } from 'dpdm'; import { relative } from 'path'; import { getPluginSearchPaths } from '@kbn/config'; -import { REPO_ROOT, run } from '@kbn/dev-utils'; +import { run } from '@kbn/dev-utils'; +import { REPO_ROOT } from '@kbn/utils'; interface Options { debug?: boolean; diff --git a/src/dev/run_precommit_hook.js b/src/dev/run_precommit_hook.js index a7bd0a9f57f6e..dfa3a94426bb2 100644 --- a/src/dev/run_precommit_hook.js +++ b/src/dev/run_precommit_hook.js @@ -8,7 +8,8 @@ import SimpleGit from 'simple-git/promise'; -import { run, combineErrors, createFlagError, REPO_ROOT } from '@kbn/dev-utils'; +import { run, combineErrors, createFlagError } from '@kbn/dev-utils'; +import { REPO_ROOT } from '@kbn/utils'; import * as Eslint from './eslint'; import * as Stylelint from './stylelint'; import { getFilesForCommit, checkFileCasing } from './precommit_hook'; diff --git a/src/dev/typescript/build_ts_refs.ts b/src/dev/typescript/build_ts_refs.ts index aaa8c0d12fa4d..f3896cf676e27 100644 --- a/src/dev/typescript/build_ts_refs.ts +++ b/src/dev/typescript/build_ts_refs.ts @@ -8,7 +8,8 @@ import Path from 'path'; -import { ToolingLog, REPO_ROOT, ProcRunner } from '@kbn/dev-utils'; +import { ToolingLog, ProcRunner } from '@kbn/dev-utils'; +import { REPO_ROOT } from '@kbn/utils'; import { ROOT_REFS_CONFIG_PATH } from './root_refs_config'; import { Project } from './project'; diff --git a/src/dev/typescript/build_ts_refs_cli.ts b/src/dev/typescript/build_ts_refs_cli.ts index c68424c2a98f7..09866315fc8dd 100644 --- a/src/dev/typescript/build_ts_refs_cli.ts +++ b/src/dev/typescript/build_ts_refs_cli.ts @@ -8,7 +8,8 @@ import Path from 'path'; -import { run, REPO_ROOT, createFlagError } from '@kbn/dev-utils'; +import { run, createFlagError } from '@kbn/dev-utils'; +import { REPO_ROOT } from '@kbn/utils'; import del from 'del'; import { RefOutputCache } from './ref_output_cache'; diff --git a/src/dev/typescript/ref_output_cache/ref_output_cache.ts b/src/dev/typescript/ref_output_cache/ref_output_cache.ts index b7e641ceb33d5..32b08ec1ba0df 100644 --- a/src/dev/typescript/ref_output_cache/ref_output_cache.ts +++ b/src/dev/typescript/ref_output_cache/ref_output_cache.ts @@ -9,7 +9,8 @@ import Path from 'path'; import Fs from 'fs/promises'; -import { ToolingLog, kibanaPackageJson, extract } from '@kbn/dev-utils'; +import { ToolingLog, extract } from '@kbn/dev-utils'; +import { kibanaPackageJson } from '@kbn/utils'; import del from 'del'; import tempy from 'tempy'; diff --git a/src/dev/typescript/root_refs_config.ts b/src/dev/typescript/root_refs_config.ts index f4aa88f1ea6b2..e20b1ab46cd82 100644 --- a/src/dev/typescript/root_refs_config.ts +++ b/src/dev/typescript/root_refs_config.ts @@ -10,7 +10,8 @@ import Path from 'path'; import Fs from 'fs/promises'; import dedent from 'dedent'; -import { REPO_ROOT, ToolingLog } from '@kbn/dev-utils'; +import { ToolingLog } from '@kbn/dev-utils'; +import { REPO_ROOT } from '@kbn/utils'; import normalize from 'normalize-path'; import { PROJECTS } from './projects'; diff --git a/x-pack/plugins/apm/server/deprecations/deprecations.test.ts b/x-pack/plugins/apm/server/deprecations/deprecations.test.ts index 11deff82de572..6b00c5cdd9a2b 100644 --- a/x-pack/plugins/apm/server/deprecations/deprecations.test.ts +++ b/x-pack/plugins/apm/server/deprecations/deprecations.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { kibanaPackageJson } from '@kbn/dev-utils'; +import { kibanaPackageJson } from '@kbn/utils'; import { GetDeprecationsContext } from '../../../../../src/core/server'; import { CloudSetup } from '../../../cloud/server'; diff --git a/x-pack/test/stack_functional_integration/apps/metricbeat/_metricbeat_dashboard.ts b/x-pack/test/stack_functional_integration/apps/metricbeat/_metricbeat_dashboard.ts index d2e9adbfd2683..66da887b5067c 100644 --- a/x-pack/test/stack_functional_integration/apps/metricbeat/_metricbeat_dashboard.ts +++ b/x-pack/test/stack_functional_integration/apps/metricbeat/_metricbeat_dashboard.ts @@ -7,7 +7,7 @@ import expect from '@kbn/expect'; import { resolve } from 'path'; -import { REPO_ROOT } from '@kbn/dev-utils'; +import { REPO_ROOT } from '@kbn/utils'; import { FtrProviderContext } from '../../../functional/ftr_provider_context'; const INTEGRATION_TEST_ROOT = process.env.WORKSPACE || resolve(REPO_ROOT, '../integration-test'); diff --git a/yarn.lock b/yarn.lock index 4e805e2f77993..38ba7b2e0ac4f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5777,6 +5777,10 @@ version "0.0.0" uid "" +"@types/kbn__dev-utils@link:bazel-bin/packages/kbn-dev-utils/npm_module_types": + version "0.0.0" + uid "" + "@types/kbn__docs-utils@link:bazel-bin/packages/kbn-docs-utils/npm_module_types": version "0.0.0" uid ""