chore(NA): @kbn/pm new commands to support development on Bazel packages (#96465)

* chore(NA): add warnings both to run and watch commands about Bazel built packages

* chore(NA): add new commands to build and watch bazel packages

* docs(NA): add documentation about how to deal with bazel packages

* chore(NA): addressed majority of the feedback received except for improved error logging

* chore(NA): disable ibazel info notification.

* chore(NA): remove iBazel notification

* chore(NA): remove iBazel notification - kbn pm dist

* chore(NA): move show_results option to kbn-pm only

* chore(NA): patch build bazel command to include packages target list

* chore(NA): add pretty logging for elastic-datemath

* chore(NA): remove double error output from commands ran with Bazel

* fix(NA): include simple error message to preserve subprocess failure state

* docs(NA): missing docs about how to independentely watch non bazel packages

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Tiago Costa 2021-04-13 01:24:19 +01:00 committed by GitHub
parent c218ba8397
commit e3f5249c88
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 1362 additions and 1099 deletions

View file

@ -66,7 +66,8 @@ yarn kbn bootstrap --force-install
(You can also run `yarn kbn` to see the other available commands. For
more info about this tool, see
{kib-repo}tree/{branch}/packages/kbn-pm[{kib-repo}tree/{branch}/packages/kbn-pm].)
{kib-repo}tree/{branch}/packages/kbn-pm[{kib-repo}tree/{branch}/packages/kbn-pm]. If you want more
information about how to actively develop over packages please read <<monorepo-packages>>)
When switching branches which use different versions of npm packages you
may need to run:
@ -169,3 +170,5 @@ include::debugging.asciidoc[leveloffset=+1]
include::building-kibana.asciidoc[leveloffset=+1]
include::development-plugin-resources.asciidoc[leveloffset=+1]
include::monorepo-packages.asciidoc[leveloffset=+1]

View file

@ -0,0 +1,66 @@
[[monorepo-packages]]
== {kib} Monorepo Packages
Currently {kib} works as a monorepo composed by a core, plugins and packages.
The latest are located in a folder called `packages` and are pieces of software that
composes a set of features that can be isolated and reused across the entire repository.
They are also supposed to be able to imported just like any other `node_module`.
Previously we relied solely on `@kbn/pm` to manage the development tools of those packages, but we are
now in the middle of migrating those responsibilities into Bazel. Every package already migrated
will contain in its root folder a `BUILD.bazel` file and other `build` and `watching` strategies should be used.
Remember that any time you need to make sure the monorepo is ready to be used just run:
[source,bash]
----
yarn kbn bootstrap
----
[discrete]
=== Building Non Bazel Packages
Non Bazel packages can be built independently with
[source,bash]
----
yarn kbn run build -i PACKAGE_NAME
----
[discrete]
=== Watching Non Bazel Packages
Non Bazel packages can be watched independently with
[source,bash]
----
yarn kbn watch -i PACKAGE_NAME
----
[discrete]
=== Building Bazel Packages
Bazel packages are built as a whole for now. You can use:
[source,bash]
----
yarn kbn build-bazel
----
[discrete]
=== Watching Bazel Packages
Bazel packages are watched as a whole for now. You can use:
[source,bash]
----
yarn kbn watch-bazel
----
[discrete]
=== List of Already Migrated Packages to Bazel
- @elastic/datemath