mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
# Backport This will backport the following commits from `main` to `8.6`: - [chore(NA): updates from lmdb-store to lmdb (#145891)](https://github.com/elastic/kibana/pull/145891) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Tiago Costa","email":"tiago.costa@elastic.co"},"sourceCommit":{"committedDate":"2022-11-28T23:48:15Z","message":"chore(NA): updates from lmdb-store to lmdb (#145891)\n\nThis PR upgrades from `lbmd-store` into `lmdb` which is the new package\r\nand fully compatible with node `v18`.\r\nSo far my tests shows the new implementation is compatible with our\r\nusages and I'm actually seeing a great performance boost when comparing\r\nwith main specially on subsequent calls of the same command.\r\n\r\nThis can be tested by running the following 2 times on main vs this\r\nbranch `time node scripts/kibana --config\r\nsrc/cli/serve/integration_tests/__fixtures__/invalid_config.yml\r\n--migrations.skip=true --verbose`\r\n\r\nI verify the following on my machine\r\n\r\n**main:**\r\n_1st run:_ 36s\r\n_2nd run:_ 34s\r\n\r\n**this branch:**\r\n_1st run:_ 35s\r\n_2nd run:_ 6s\r\n\r\nCo-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>","sha":"e65c6526107670689c520bc20c973626c12c636d","branchLabelMapping":{"^v8.7.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["chore","Team:Operations","release_note:skip","backport:all-open","v8.7.0"],"number":145891,"url":"https://github.com/elastic/kibana/pull/145891","mergeCommit":{"message":"chore(NA): updates from lmdb-store to lmdb (#145891)\n\nThis PR upgrades from `lbmd-store` into `lmdb` which is the new package\r\nand fully compatible with node `v18`.\r\nSo far my tests shows the new implementation is compatible with our\r\nusages and I'm actually seeing a great performance boost when comparing\r\nwith main specially on subsequent calls of the same command.\r\n\r\nThis can be tested by running the following 2 times on main vs this\r\nbranch `time node scripts/kibana --config\r\nsrc/cli/serve/integration_tests/__fixtures__/invalid_config.yml\r\n--migrations.skip=true --verbose`\r\n\r\nI verify the following on my machine\r\n\r\n**main:**\r\n_1st run:_ 36s\r\n_2nd run:_ 34s\r\n\r\n**this branch:**\r\n_1st run:_ 35s\r\n_2nd run:_ 6s\r\n\r\nCo-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>","sha":"e65c6526107670689c520bc20c973626c12c636d"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.7.0","labelRegex":"^v8.7.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/145891","number":145891,"mergeCommit":{"message":"chore(NA): updates from lmdb-store to lmdb (#145891)\n\nThis PR upgrades from `lbmd-store` into `lmdb` which is the new package\r\nand fully compatible with node `v18`.\r\nSo far my tests shows the new implementation is compatible with our\r\nusages and I'm actually seeing a great performance boost when comparing\r\nwith main specially on subsequent calls of the same command.\r\n\r\nThis can be tested by running the following 2 times on main vs this\r\nbranch `time node scripts/kibana --config\r\nsrc/cli/serve/integration_tests/__fixtures__/invalid_config.yml\r\n--migrations.skip=true --verbose`\r\n\r\nI verify the following on my machine\r\n\r\n**main:**\r\n_1st run:_ 36s\r\n_2nd run:_ 34s\r\n\r\n**this branch:**\r\n_1st run:_ 35s\r\n_2nd run:_ 6s\r\n\r\nCo-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>","sha":"e65c6526107670689c520bc20c973626c12c636d"}}]}] BACKPORT--> Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
167 lines
3.7 KiB
Text
167 lines
3.7 KiB
Text
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_DIRNAME = "kbn-optimizer"
|
|
PKG_REQUIRE_NAME = "@kbn/optimizer"
|
|
|
|
SOURCE_FILES = glob(
|
|
[
|
|
"**/*.ts",
|
|
],
|
|
exclude = [
|
|
"**/*.config.js",
|
|
"**/*.mock.*",
|
|
"**/*.test.*",
|
|
"**/*.stories.*",
|
|
"**/__fixtures__/**",
|
|
"**/__snapshots__/**",
|
|
"**/integration_tests/**",
|
|
"**/mocks/**",
|
|
"**/scripts/**",
|
|
"**/storybook/**",
|
|
"**/test_fixtures/**",
|
|
"**/test_helpers/**",
|
|
],
|
|
)
|
|
|
|
SRCS = SOURCE_FILES
|
|
|
|
filegroup(
|
|
name = "srcs",
|
|
srcs = SRCS,
|
|
)
|
|
|
|
NPM_MODULE_EXTRA_FILES = [
|
|
"limits.yml",
|
|
"package.json",
|
|
"postcss.config.js",
|
|
]
|
|
|
|
RUNTIME_DEPS = [
|
|
"//packages/kbn-config",
|
|
"//packages/kbn-config-schema",
|
|
"//packages/kbn-dev-utils",
|
|
"//packages/kbn-std",
|
|
"//packages/kbn-ui-shared-deps-npm",
|
|
"//packages/kbn-ui-shared-deps-src",
|
|
"//packages/kbn-utils",
|
|
"//packages/kbn-synthetic-package-map",
|
|
"@npm//@babel/core",
|
|
"@npm//chalk",
|
|
"@npm//clean-webpack-plugin",
|
|
"@npm//compression-webpack-plugin",
|
|
"@npm//cpy",
|
|
"@npm//dedent",
|
|
"@npm//del",
|
|
"@npm//execa",
|
|
"@npm//json-stable-stringify",
|
|
"@npm//js-yaml",
|
|
"@npm//lmdb",
|
|
"@npm//loader-utils",
|
|
"@npm//node-sass",
|
|
"@npm//normalize-path",
|
|
"@npm//pirates",
|
|
"@npm//rxjs",
|
|
"@npm//source-map-support",
|
|
"@npm//watchpack",
|
|
"@npm//webpack",
|
|
"@npm//webpack-merge",
|
|
"@npm//webpack-sources",
|
|
]
|
|
|
|
TYPES_DEPS = [
|
|
"//packages/kbn-config:npm_module_types",
|
|
"//packages/kbn-config-schema:npm_module_types",
|
|
"//packages/kbn-dev-utils:npm_module_types",
|
|
"//packages/kbn-optimizer-webpack-helpers:npm_module_types",
|
|
"//packages/kbn-std:npm_module_types",
|
|
"//packages/kbn-ui-shared-deps-npm:npm_module_types",
|
|
"//packages/kbn-ui-shared-deps-src:npm_module_types",
|
|
"//packages/kbn-utils:npm_module_types",
|
|
"//packages/kbn-tooling-log:npm_module_types",
|
|
"//packages/kbn-synthetic-package-map:npm_module_types",
|
|
"@npm//chalk",
|
|
"@npm//clean-webpack-plugin",
|
|
"@npm//cpy",
|
|
"@npm//del",
|
|
"@npm//execa",
|
|
"@npm//lmdb",
|
|
"@npm//pirates",
|
|
"@npm//rxjs",
|
|
"@npm//@types/babel__core",
|
|
"@npm//@types/compression-webpack-plugin",
|
|
"@npm//@types/dedent",
|
|
"@npm//@types/jest",
|
|
"@npm//@types/json-stable-stringify",
|
|
"@npm//@types/js-yaml",
|
|
"@npm//@types/loader-utils",
|
|
"@npm//@types/node",
|
|
"@npm//@types/normalize-path",
|
|
"@npm//@types/source-map-support",
|
|
"@npm//@types/watchpack",
|
|
"@npm//@types/webpack",
|
|
"@npm//@types/webpack-merge",
|
|
"@npm//@types/webpack-sources",
|
|
]
|
|
|
|
jsts_transpiler(
|
|
name = "target_node",
|
|
srcs = SRCS,
|
|
build_pkg_name = package_name(),
|
|
)
|
|
|
|
ts_config(
|
|
name = "tsconfig",
|
|
src = "tsconfig.json",
|
|
deps = [
|
|
"//:tsconfig.base.json",
|
|
"//:tsconfig.bazel.json",
|
|
],
|
|
)
|
|
|
|
ts_project(
|
|
name = "tsc_types",
|
|
args = ['--pretty'],
|
|
srcs = SRCS,
|
|
deps = TYPES_DEPS,
|
|
declaration = True,
|
|
emit_declaration_only = True,
|
|
out_dir = "target_types",
|
|
tsconfig = ":tsconfig",
|
|
)
|
|
|
|
js_library(
|
|
name = PKG_DIRNAME,
|
|
srcs = NPM_MODULE_EXTRA_FILES,
|
|
deps = RUNTIME_DEPS + [":target_node"],
|
|
package_name = PKG_REQUIRE_NAME,
|
|
visibility = ["//visibility:public"],
|
|
)
|
|
|
|
js_library(
|
|
name = "npm_module_types",
|
|
srcs = NPM_MODULE_EXTRA_FILES,
|
|
deps = RUNTIME_DEPS + [":target_node", ":tsc_types"],
|
|
package_name = PKG_REQUIRE_NAME,
|
|
visibility = ["//visibility:public"],
|
|
)
|
|
|
|
pkg_npm(
|
|
name = "npm_module",
|
|
deps = [":" + PKG_DIRNAME],
|
|
)
|
|
|
|
filegroup(
|
|
name = "build",
|
|
srcs = [
|
|
":npm_module",
|
|
],
|
|
visibility = ["//visibility:public"],
|
|
)
|
|
|
|
pkg_npm(
|
|
name = "build_types",
|
|
deps = [":npm_module_types"],
|
|
visibility = ["//visibility:public"],
|
|
)
|