kibana/packages
Kibana Machine 92947dbbd7
fix(NA): @kbn/babel-code-parser bazel build to link to the local .babelrc config (#99003) (#99070)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Tiago Costa <tiagoffcc@hotmail.com>
2021-05-03 15:34:25 -04:00
..
elastic-datemath chore(NA): moving @kbn/babel-code-parser into bazel (#97675) (#98185) 2021-04-23 18:50:40 +00:00
elastic-eslint-config-kibana chore(NA): moving @elastic/eslint-config-kibana into bazel (#98648) (#98786) 2021-04-29 18:24:34 +00:00
elastic-safer-lodash-set chore(NA): moving @elastic/safer-lodash-set into bazel (#98187) (#98214) 2021-04-27 20:17:35 +00:00
kbn-ace chore(NA): moving @kbn/dev-utils into bazel (#98496) (#98696) 2021-04-29 00:50:19 +00:00
kbn-analytics chore(NA): moving @kbn/dev-utils into bazel (#98496) (#98696) 2021-04-29 00:50:19 +00:00
kbn-apm-config-loader [7.x] chore(NA): moving @kbn/apm-config-loader into bazel (#98323) (#98528) 2021-04-27 18:33:24 -04:00
kbn-apm-utils chore(NA): moving @kbn/babel-code-parser into bazel (#97675) (#98185) 2021-04-23 18:50:40 +00:00
kbn-babel-code-parser fix(NA): @kbn/babel-code-parser bazel build to link to the local .babelrc config (#99003) (#99070) 2021-05-03 15:34:25 -04:00
kbn-babel-preset chore(NA): moving @kbn/babel-code-parser into bazel (#97675) (#98185) 2021-04-23 18:50:40 +00:00
kbn-cli-dev-mode [Security Solutions] (Phase 1) Adds an application cache called metrics entities and integrates it within Security Solutions behind a feature flag (#96446) (#98967) 2021-04-30 16:42:47 -04:00
kbn-config chore(NA): moving @kbn/dev-utils into bazel (#98496) (#98696) 2021-04-29 00:50:19 +00:00
kbn-config-schema chore(NA): correctly define sourceRoot for @kbn/config-schema (#98788) (#98822) 2021-04-29 17:24:39 -04:00
kbn-crypto chore(NA): moving @kbn/dev-utils into bazel (#98496) (#98696) 2021-04-29 00:50:19 +00:00
kbn-dev-utils chore(NA): moving @kbn/dev-utils into bazel (#98496) (#98696) 2021-04-29 00:50:19 +00:00
kbn-docs-utils chore(NA): moving @kbn/dev-utils into bazel (#98496) (#98696) 2021-04-29 00:50:19 +00:00
kbn-es chore(NA): moving @kbn/dev-utils into bazel (#98496) (#98696) 2021-04-29 00:50:19 +00:00
kbn-es-archiver chore(NA): moving @kbn/dev-utils into bazel (#98496) (#98696) 2021-04-29 00:50:19 +00:00
kbn-eslint-import-resolver-kibana chore(NA): moving @kbn/eslint-import-resolver-kibana into bazel (#98798) (#98972) 2021-04-30 17:15:19 -04:00
kbn-eslint-plugin-eslint chore(NA): moving @kbn/eslint-plugin-eslint into bazel (#98926) (#98992) 2021-04-30 19:35:23 -04:00
kbn-expect chore(NA): moving @kbn/expect into bazel (#98322) (#98363) 2021-04-26 17:11:19 -04:00
kbn-i18n chore(NA): moving @kbn/dev-utils into bazel (#98496) (#98696) 2021-04-29 00:50:19 +00:00
kbn-interpreter chore(NA): moving @kbn/dev-utils into bazel (#98496) (#98696) 2021-04-29 00:50:19 +00:00
kbn-io-ts-utils
kbn-legacy-logging [packages] Move @kbn/legacy-logging to Bazel (#98810) (#98973) 2021-05-01 00:28:46 +00:00
kbn-logging chore(NA): moving @kbn/logging into bazel (#98564) (#98626) 2021-04-28 13:06:48 -04:00
kbn-monaco chore(NA): moving @kbn/dev-utils into bazel (#98496) (#98696) 2021-04-29 00:50:19 +00:00
kbn-optimizer [visualizations] Reduce page load bundle to under 100kB (#98302) (#99028) 2021-05-03 05:52:00 -07:00
kbn-plugin-generator chore(NA): moving @kbn/dev-utils into bazel (#98496) (#98696) 2021-04-29 00:50:19 +00:00
kbn-plugin-helpers chore(NA): moving @kbn/dev-utils into bazel (#98496) (#98696) 2021-04-29 00:50:19 +00:00
kbn-pm chore(NA): moving @kbn/dev-utils into bazel (#98496) (#98696) 2021-04-29 00:50:19 +00:00
kbn-server-http-tools
kbn-server-route-repository
kbn-spec-to-console
kbn-std
kbn-storybook [7.x] Turn off progress plugin in storybook (#98253) (#99067) 2021-05-03 14:17:55 -04:00
kbn-telemetry-tools chore(NA): moving @kbn/dev-utils into bazel (#98496) (#98696) 2021-04-29 00:50:19 +00:00
kbn-test improve type safety for integration test helpers (#98731) (#98883) 2021-04-30 09:48:36 -04:00
kbn-test-subj-selector
kbn-tinymath Tinymath escape characters and empty named args (#98559) (#98660) 2021-04-28 15:43:43 -04:00
kbn-ui-framework
kbn-ui-shared-deps chore(NA): moving @kbn/dev-utils into bazel (#98496) (#98696) 2021-04-29 00:50:19 +00:00
kbn-utility-types
kbn-utils chore(NA): chore(NA): moving @kbn/utils into bazel (#97833) (#98056) 2021-04-22 20:25:53 +00:00
BUILD.bazel [packages] Move @kbn/legacy-logging to Bazel (#98810) (#98973) 2021-05-01 00:28:46 +00:00
README.md

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.