diff --git a/docs/developer/getting-started/monorepo-packages.asciidoc b/docs/developer/getting-started/monorepo-packages.asciidoc index fafbca550ae5d..31a153cdb3490 100644 --- a/docs/developer/getting-started/monorepo-packages.asciidoc +++ b/docs/developer/getting-started/monorepo-packages.asciidoc @@ -62,6 +62,7 @@ yarn kbn watch-bazel === List of Already Migrated Packages to Bazel - @elastic/datemath +- @elastic/eslint-config-kibana - @elastic/safer-lodash-set - @kbn/apm-config-loader - @kbn/apm-utils diff --git a/package.json b/package.json index 51b715c2824cc..53e2d46ef8b3d 100644 --- a/package.json +++ b/package.json @@ -428,7 +428,7 @@ "@cypress/webpack-preprocessor": "^5.6.0", "@elastic/apm-rum": "^5.6.1", "@elastic/apm-rum-react": "^1.2.5", - "@elastic/eslint-config-kibana": "link:packages/elastic-eslint-config-kibana", + "@elastic/eslint-config-kibana": "link:bazel-bin/packages/elastic-eslint-config-kibana/npm_module", "@elastic/eslint-plugin-eui": "0.0.2", "@elastic/github-checks-reporter": "0.0.20b3", "@elastic/makelogs": "^6.0.0", diff --git a/packages/BUILD.bazel b/packages/BUILD.bazel index d5c9560179c61..2aec108f97047 100644 --- a/packages/BUILD.bazel +++ b/packages/BUILD.bazel @@ -4,6 +4,7 @@ filegroup( name = "build", srcs = [ "//packages/elastic-datemath:build", + "//packages/elastic-eslint-config-kibana:build", "//packages/elastic-safer-lodash-set:build", "//packages/kbn-apm-config-loader:build", "//packages/kbn-apm-utils:build", diff --git a/packages/elastic-eslint-config-kibana/BUILD.bazel b/packages/elastic-eslint-config-kibana/BUILD.bazel new file mode 100644 index 0000000000000..1745d919acdaa --- /dev/null +++ b/packages/elastic-eslint-config-kibana/BUILD.bazel @@ -0,0 +1,56 @@ +load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm") + +PKG_BASE_NAME = "elastic-eslint-config-kibana" +PKG_REQUIRE_NAME = "@elastic/eslint-config-kibana" + +SOURCE_FILES = glob([ + ".eslintrc.js", + "javascript.js", + "jest.js", + "react.js", + "restricted_globals.js", + "typescript.js", +]) + +SRCS = SOURCE_FILES + +filegroup( + name = "srcs", + srcs = SRCS, +) + +NPM_MODULE_EXTRA_FILES = [ + "package.json", + "README.md", +] + +DEPS = [ + "//packages/kbn-dev-utils", + "@npm//eslint-config-prettier", + "@npm//semver", +] + +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 77e33d36af4e3..6a7854d021dc5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1428,7 +1428,7 @@ semver "7.3.2" topojson-client "^3.1.0" -"@elastic/eslint-config-kibana@link:packages/elastic-eslint-config-kibana": +"@elastic/eslint-config-kibana@link:bazel-bin/packages/elastic-eslint-config-kibana/npm_module": version "0.0.0" uid ""