kibana/packages
Stacey Gammon 52ee65b8d5
Make owner attribute required on kibana.json (#108231)
* make owner attribute required

* Add owner properties in more places

* add test for owner attribute

* add error check too in the test

* Fix tests

* fix tests and update docs

* wip

* More test fixes

* Fix All The Errorz

* Adding more owner attributes

* Update x-pack/test/saved_object_api_integration/common/fixtures/saved_object_test_plugin/kibana.json

Co-authored-by: Larry Gregory <lgregorydev@gmail.com>

* Update x-pack/test/ui_capabilities/common/fixtures/plugins/foo_plugin/kibana.json

Co-authored-by: Larry Gregory <lgregorydev@gmail.com>

* commeeeooonnnn

* Update docs

* soooo many kibanajsons

* adjust plugin generator to add an owner

* Add owner to the plugin generator scripts

* update snapshot

* Fix snapshot

* review updates

Co-authored-by: Larry Gregory <lgregorydev@gmail.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-08-24 10:02:32 -04:00
..
elastic-datemath [build_ts_refs] improve caches, allow building a subset of projects (#107981) 2021-08-10 22:12:45 -07:00
elastic-eslint-config-kibana chore(NA): moving @kbn/es-query to babel transpiler (#107281) 2021-07-30 18:38:02 +01:00
elastic-safer-lodash-set [build_ts_refs] improve caches, allow building a subset of projects (#107981) 2021-08-10 22:12:45 -07:00
kbn-ace [build_ts_refs] improve caches, allow building a subset of projects (#107981) 2021-08-10 22:12:45 -07:00
kbn-alerts chore(NA): moving @kbn/alerts to babel transpiler (#109320) 2021-08-20 18:55:18 -04:00
kbn-analytics [build_ts_refs] improve caches, allow building a subset of projects (#107981) 2021-08-10 22:12:45 -07:00
kbn-apm-config-loader [build_ts_refs] improve caches, allow building a subset of projects (#107981) 2021-08-10 22:12:45 -07:00
kbn-apm-utils [build_ts_refs] improve caches, allow building a subset of projects (#107981) 2021-08-10 22:12:45 -07:00
kbn-babel-code-parser chore(NA): moving @kbn/babel-code-parser to babel transpiler (#107574) 2021-08-03 17:06:28 -04:00
kbn-babel-preset chore(NA): moving @kbn/es-query to babel transpiler (#107281) 2021-07-30 18:38:02 +01:00
kbn-cli-dev-mode [build_ts_refs] improve caches, allow building a subset of projects (#107981) 2021-08-10 22:12:45 -07:00
kbn-config chore(NA): moving @kbn/logging to babel transpiler (#108702) 2021-08-20 11:54:46 +01:00
kbn-config-schema [build_ts_refs] improve caches, allow building a subset of projects (#107981) 2021-08-10 22:12:45 -07:00
kbn-crypto chore(NA): moving @kbn/crypto to babel transpiler (#108189) 2021-08-12 03:09:50 +01:00
kbn-dev-utils Make owner attribute required on kibana.json (#108231) 2021-08-24 10:02:32 -04:00
kbn-docs-utils Make owner attribute required on kibana.json (#108231) 2021-08-24 10:02:32 -04:00
kbn-es [build_ts_refs] improve caches, allow building a subset of projects (#107981) 2021-08-10 22:12:45 -07:00
kbn-es-archiver chore(NA): moving @kbn/es-archiver to babel transpiler (#108370) 2021-08-13 18:38:56 +01:00
kbn-es-query [Data][Es Query] Use ES types in Filters (#108378) 2021-08-24 11:28:22 +02:00
kbn-eslint-import-resolver-kibana chore(NA): moving @kbn/eslint-import-resolver-kibana into bazel (#98798) 2021-04-30 20:14:18 +01:00
kbn-eslint-plugin-eslint Enable CSS-in-JS styling with emotion (#98157) 2021-07-09 13:42:50 -05:00
kbn-expect [build_ts_refs] improve caches, allow building a subset of projects (#107981) 2021-08-10 22:12:45 -07:00
kbn-field-types [build_ts_refs] improve caches, allow building a subset of projects (#107981) 2021-08-10 22:12:45 -07:00
kbn-i18n [build_ts_refs] improve caches, allow building a subset of projects (#107981) 2021-08-10 22:12:45 -07:00
kbn-interpreter chore(NA): moving @kbn/interpreter to babel transpiler (#108512) 2021-08-20 11:50:40 +01:00
kbn-io-ts-utils chore(NA): moving @kbn/io-ts-utils to babel transpiler (#108517) 2021-08-13 18:39:35 +01:00
kbn-legacy-logging chore(NA): moving @kbn/legacy-logging to babel transpiler (#108703) 2021-08-17 22:24:48 +01:00
kbn-logging chore(NA): moving @kbn/logging to babel transpiler (#108702) 2021-08-20 11:54:46 +01:00
kbn-mapbox-gl chore(NA): moving @kbn/mapbox-gl to babel transpiler (#109082) 2021-08-18 15:51:52 -04:00
kbn-monaco [build_ts_refs] improve caches, allow building a subset of projects (#107981) 2021-08-10 22:12:45 -07:00
kbn-optimizer Make owner attribute required on kibana.json (#108231) 2021-08-24 10:02:32 -04:00
kbn-plugin-generator Make owner attribute required on kibana.json (#108231) 2021-08-24 10:02:32 -04:00
kbn-plugin-helpers Make owner attribute required on kibana.json (#108231) 2021-08-24 10:02:32 -04:00
kbn-pm [build_ts_refs] improve caches, allow building a subset of projects (#107981) 2021-08-10 22:12:45 -07:00
kbn-rule-data-utils [RAC] [Observability] Use simpler alert severity level mapping (#109068) 2021-08-18 16:29:24 -04:00
kbn-securitysolution-autocomplete chore(NA): moving @kbn/securitysolution-autocomplete to babel transpiler (#109423) 2021-08-21 00:08:22 -04:00
kbn-securitysolution-es-utils chore(NA): moving @kbn/securitysolution-es-utils to babel transpiler (#109426) 2021-08-23 15:51:31 +01:00
kbn-securitysolution-hook-utils chore(NA): moving @kbn/securitysolution-hook-utils to babel transpiler (#109432) 2021-08-23 15:26:42 +01:00
kbn-securitysolution-io-ts-alerting-types [build_ts_refs] improve caches, allow building a subset of projects (#107981) 2021-08-10 22:12:45 -07:00
kbn-securitysolution-io-ts-list-types [build_ts_refs] improve caches, allow building a subset of projects (#107981) 2021-08-10 22:12:45 -07:00
kbn-securitysolution-io-ts-types [build_ts_refs] improve caches, allow building a subset of projects (#107981) 2021-08-10 22:12:45 -07:00
kbn-securitysolution-io-ts-utils [build_ts_refs] improve caches, allow building a subset of projects (#107981) 2021-08-10 22:12:45 -07:00
kbn-securitysolution-list-api [build_ts_refs] improve caches, allow building a subset of projects (#107981) 2021-08-10 22:12:45 -07:00
kbn-securitysolution-list-constants [build_ts_refs] improve caches, allow building a subset of projects (#107981) 2021-08-10 22:12:45 -07:00
kbn-securitysolution-list-hooks [build_ts_refs] improve caches, allow building a subset of projects (#107981) 2021-08-10 22:12:45 -07:00
kbn-securitysolution-list-utils [Data][Es Query] Use ES types in Filters (#108378) 2021-08-24 11:28:22 +02:00
kbn-securitysolution-t-grid chore(NA): moving @kbn/securitysolution-t-grid to babel transpiler (#109442) 2021-08-23 15:54:15 +01:00
kbn-securitysolution-utils chore(NA): moving @kbn/securitysolution-utils to babel transpiler (#109439) 2021-08-20 22:04:39 +01:00
kbn-server-http-tools [build_ts_refs] improve caches, allow building a subset of projects (#107981) 2021-08-10 22:12:45 -07:00
kbn-server-route-repository [build_ts_refs] improve caches, allow building a subset of projects (#107981) 2021-08-10 22:12:45 -07:00
kbn-spec-to-console [Console] Autocomplete definitions (manual backport) (#105086) 2021-07-13 10:31:50 +02:00
kbn-std [build_ts_refs] improve caches, allow building a subset of projects (#107981) 2021-08-10 22:12:45 -07:00
kbn-storybook [build_ts_refs] improve caches, allow building a subset of projects (#107981) 2021-08-10 22:12:45 -07:00
kbn-telemetry-tools [build_ts_refs] improve caches, allow building a subset of projects (#107981) 2021-08-10 22:12:45 -07:00
kbn-test chore(NA): moving @kbn/optimizer to babel transpiler (#109231) 2021-08-19 19:40:50 +01:00
kbn-test-subj-selector [build_ts_refs] improve caches, allow building a subset of projects (#107981) 2021-08-10 22:12:45 -07:00
kbn-tinymath [build_ts_refs] improve caches, allow building a subset of projects (#107981) 2021-08-10 22:12:45 -07:00
kbn-typed-react-router-config [APM] Support multiple route paths in useApmParams (#109370) 2021-08-23 15:38:06 +02:00
kbn-ui-framework chore(NA): moving @kbn/ui-framework into bazel (#102908) 2021-06-22 13:11:24 -04:00
kbn-ui-shared-deps chore(NA): moving @kbn/ui-shared-deps to babel transpiler (#109323) 2021-08-20 17:12:08 +01:00
kbn-utility-types [build_ts_refs] improve caches, allow building a subset of projects (#107981) 2021-08-10 22:12:45 -07:00
kbn-utils [build_ts_refs] improve caches, allow building a subset of projects (#107981) 2021-08-10 22:12:45 -07:00
BUILD.bazel [Security Solution] - Updating UI to work with new kibana privileges abstraction on alerts (#108961) 2021-08-18 14:48:31 -04:00
README.md chore(NA): remove mocha junit ci integrations (#88129) 2021-01-15 21:17:25 +00:00

Kibana-related packages

This folder contains packages that are intended for use in Kibana and Kibana plugins.

tl;dr:

  • Don't publish to npm registry
  • Always use the @kbn namespace
  • Always set "private": true in package.json

Using these packages

We no longer publish these packages to the npm registry. Now, instead of specifying a version when including these packages, we rely on yarn workspaces, which sets up a symlink to the package.

For example if you want to use the @kbn/i18n package in Kibana itself, you can specify the dependency like this:

"@kbn/i18n": "1.0.0"

However, if you want to use this from a Kibana plugin, you need to use a link: dependency and account for the relative location of the Kibana repo, so it would instead be:

"@kbn/i18n": "link:../../kibana/packages/kbn-i18n"

How all of this works is described in more detail in the @kbn/pm docs.

Creating a new package

Create a new sub-folder. The name of the folder should mirror the name in the package's package.json. E.g. if the name is @kbn/i18n the folder name should be kbn-i18n.

All new packages should use the @kbn namespace, and should be marked with "private": true.

Unit tests for a package

Currently there is only one tool being used in order to test packages which is Jest. Below we will explain how it should be done.

Jest

A package should follow the pattern of having .test.js files as siblings of the source code files, and these run by Jest.

A package using the .test.js naming convention will have those tests automatically picked up by Jest and run by the unit test runner, currently mapped to the Kibana test script in the root package.json.

  • yarn test or yarn grunt test runs all unit tests.
  • yarn jest runs all Jest tests in Kibana.

In order for the plugin or package to use Jest, a jest.config.js file must be present in it's root. However, there are safeguards for this in CI should a test file be added without a corresponding config file.


Each package can also specify its own test script in the package's package.json, for cases where you'd prefer to run the tests from the local package directory.