diff --git a/docs/developer/getting-started/monorepo-packages.asciidoc b/docs/developer/getting-started/monorepo-packages.asciidoc index 31a153cdb3490..44651035fe4a1 100644 --- a/docs/developer/getting-started/monorepo-packages.asciidoc +++ b/docs/developer/getting-started/monorepo-packages.asciidoc @@ -70,6 +70,7 @@ yarn kbn watch-bazel - @kbn/babel-preset - @kbn/config-schema - @kbn/dev-utils +- @kbn/eslint-import-resolver-kibana - @kbn/expect - @kbn/logging - @kbn/std diff --git a/package.json b/package.json index 6be19669d25e1..a0fd8e3c31404 100644 --- a/package.json +++ b/package.json @@ -444,7 +444,7 @@ "@kbn/docs-utils": "link:packages/kbn-docs-utils", "@kbn/es": "link:packages/kbn-es", "@kbn/es-archiver": "link:packages/kbn-es-archiver", - "@kbn/eslint-import-resolver-kibana": "link:packages/kbn-eslint-import-resolver-kibana", + "@kbn/eslint-import-resolver-kibana": "link:bazel-bin/packages/kbn-eslint-import-resolver-kibana/npm_module", "@kbn/eslint-plugin-eslint": "link:packages/kbn-eslint-plugin-eslint", "@kbn/expect": "link:bazel-bin/packages/kbn-expect/npm_module", "@kbn/optimizer": "link:packages/kbn-optimizer", diff --git a/packages/BUILD.bazel b/packages/BUILD.bazel index 2aec108f97047..92521137cb149 100644 --- a/packages/BUILD.bazel +++ b/packages/BUILD.bazel @@ -12,6 +12,7 @@ filegroup( "//packages/kbn-babel-preset:build", "//packages/kbn-config-schema:build", "//packages/kbn-dev-utils:build", + "//packages/kbn-eslint-import-resolver-kibana:build", "//packages/kbn-expect:build", "//packages/kbn-logging:build", "//packages/kbn-std:build", diff --git a/packages/kbn-eslint-import-resolver-kibana/BUILD.bazel b/packages/kbn-eslint-import-resolver-kibana/BUILD.bazel new file mode 100644 index 0000000000000..a4d96f76053e1 --- /dev/null +++ b/packages/kbn-eslint-import-resolver-kibana/BUILD.bazel @@ -0,0 +1,54 @@ +load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm") + +PKG_BASE_NAME = "kbn-eslint-import-resolver-kibana" +PKG_REQUIRE_NAME = "@kbn/eslint-import-resolver-kibana" + +SOURCE_FILES = glob([ + "lib/**/*.js", + "import_resolver_kibana.js", +]) + +SRCS = SOURCE_FILES + +filegroup( + name = "srcs", + srcs = SRCS, +) + +NPM_MODULE_EXTRA_FILES = [ + "package.json", + "README.md", +] + +DEPS = [ + "@npm//debug", + "@npm//eslint-import-resolver-node", + "@npm//eslint-import-resolver-webpack", + "@npm//eslint-plugin-import", + "@npm//lru-cache", +] + +js_library( + name = PKG_BASE_NAME, + srcs = NPM_MODULE_EXTRA_FILES + [ + ":srcs", + ], + deps = DEPS, + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + +pkg_npm( + name = "npm_module", + deps = [ + ":%s" % PKG_BASE_NAME, + ] +) + +filegroup( + name = "build", + srcs = [ + ":npm_module", + ], + visibility = ["//visibility:public"], +) diff --git a/yarn.lock b/yarn.lock index 65442bf8f5efe..20d05373c54ea 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2639,7 +2639,7 @@ version "0.0.0" uid "" -"@kbn/eslint-import-resolver-kibana@link:packages/kbn-eslint-import-resolver-kibana": +"@kbn/eslint-import-resolver-kibana@link:bazel-bin/packages/kbn-eslint-import-resolver-kibana/npm_module": version "0.0.0" uid ""