[bazel] Integrate packages #92220
Labels
Feature:Build Packaging
impact:low
Addressing this issue will have a low level of impact on the quality/strength of our product.
loe:small
Small Level of Effort
Team:Operations
Team label for Operations Team
In this phase, we set out to provide the necessary infrastructure outlined previously to begin utilizing Bazel and begin doing so by migrating the current 38 packages.
A
BUILD.bazel
file will be added to the root of each package defining abuild
target. This filegroup target will be what we call during the bootstrap phase to build all packages migrated to Bazel. This target is temporary to maintain similar functionality during our transition. In the future, these procedural build steps will be removed in favor of dependency, tree-driven actions where work will only be done if it’s necessary for the given task like running the Kibana server or executing a unit test.The
@kbn/pm
package will be updated to allow for the existing legacy builds to run in parallel with the new packages build target, invoked by callingbazel build //packages:build
.The build targets will no longer reside within the package themselves and instead will be within the
bazel/bin
directory. To account for this, any defined dependency on this will need to be updated to reference the new directory (example:link:bazel/bin/packages/elastic-datemath
). While also in this transition period, the build will need to copy over the packages frombazel/bin
into the node_modules of the build target.Example package BUILD.bazel for packages/elastic-datemath:
If the package has unit tests, they will need to also be migrated to be invoked with
bazel test
as described in the Unit Testing section.Within Bazel, the packages will have new overall rules:
build
,jest
, and a js_library target with the same name of the folder where the package is living.bazel test //packages/package_name:jest
target_server
, for web target it will betarget_web
and for types, it will betarget_types
.The text was updated successfully, but these errors were encountered: