kibana/packages
Kibana Machine de5ebc5cdc
fix(NA): creation of multiple processes on production by splitting no_transpilation when setting up node env (#115246) (#115994)
* fix(NA): adds no_transpilation_dist to avoid preserve_symlinks on dist

* chore(NA): setup node env correctly on functional tests

* chore(NA): try to fix tests

* chore(NA): correctly separate split

* chore(NA): check ensure preserve symlinks need

* chore(NA): investigate path resolve result

* chore(NA): investigate path resolve result #2

* chore(NA): comment out preserve symlinks

* chore(NA): apply fs.realpathSync into the calculated REPO_ROOT paths on babel_register_for_test_plugins

* chore(NA): removes debug code

* chore(NA): move array definition

* chore(NA): correctly import fs

* chore(NA): add debug code

* chore(NA): some more debug statements

* chore(NA): remove ensure symlinks

* chore(NA): trying to solve double symlinking

* chore(NA): test mappings

* chore(NA): process path

* chore(NA): test a second map

* chore(NA): using a different mappings

* chore(NA): more debug cases

* chore(NA): more debug logic

* chore(NA): more debug cases

* chore(NA): more debug cases

* chore(NA): more debug cases

* chore(NA): try to add realpathSync into require

* chore(NA): try to add realpathSync into require

* fix(NA): jenkins and buildkite run

* chore(NA): add debug logs

* chore(NA): correct path

* chore(NA): correct path

* chore(NA): add more test maps

* chore(NA): add more test maps

* chore(NA): add some more test maps experiments

* chore(NA): try to remove another test map dep

* chore(NA): try to remove another test map dep

* chore(NA): try to remove another test map dep

* chore(NA): try to remove another test map dep

* chore(NA): try to remove another test map dep

* chore(NA): try to remove another test map dep

* chore(NA): try to remove another test map dep

* chore(NA): try to remove another test map dep

* chore(NA): include all correct transpilations for each jenkins path

* chore(NA): include all correct transpilations for each used asset path

* chore(NA): include all correct transpilations for each used asset path

* chore(NA): remove jenkins support

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Tiago Costa <tiagoffcc@hotmail.com>
2021-10-21 20:41:38 +01:00
..
elastic-datemath
elastic-eslint-config-kibana [eslint] forbid trailing slashes in package imports (#113455) (#113559) 2021-09-30 15:42:27 -04:00
elastic-safer-lodash-set
kbn-ace
kbn-alerts chore(NA): moving @kbn/alerts to babel transpiler (#109320) (#109562) 2021-08-20 21:15:07 -04:00
kbn-analytics
kbn-apm-config-loader [ci] Updates APM server (#114588) (#114724) 2021-10-12 19:07:53 -04:00
kbn-apm-utils
kbn-babel-code-parser
kbn-babel-preset
kbn-cli-dev-mode
kbn-config [7.15] chore(NA): moving @kbn/logging to babel transpiler (#108702) (#109411) 2021-08-20 16:57:20 +00:00
kbn-config-schema
kbn-crypto
kbn-dev-utils [ftr] ensure indentation is reset between configs (#114359) (#114580) 2021-10-11 21:44:16 -04:00
kbn-docs-utils
kbn-es [ci] Explicitly define tasks for ES snapshot build (#115074) (#115123) 2021-10-14 23:20:32 -04:00
kbn-es-archiver
kbn-es-query [7.x] Update dependency @elastic/elasticsearch to ^7.15.0-canary.3 (#107536) (#108890) 2021-08-17 14:14:50 -04:00
kbn-eslint-import-resolver-kibana
kbn-eslint-plugin-eslint [eslint] forbid trailing slashes in package imports (#113455) (#113559) 2021-09-30 15:42:27 -04:00
kbn-expect
kbn-field-types
kbn-i18n
kbn-interpreter chore(NA): moving @kbn/interpreter to babel transpiler (#108512) (#109409) 2021-08-20 09:11:09 -04:00
kbn-io-ts-utils
kbn-legacy-logging chore(NA): moving @kbn/legacy-logging to babel transpiler (#108703) (#109001) 2021-08-17 23:53:06 +00:00
kbn-logging [7.15] chore(NA): moving @kbn/logging to babel transpiler (#108702) (#109411) 2021-08-20 16:57:20 +00:00
kbn-mapbox-gl chore(NA): moving @kbn/mapbox-gl to babel transpiler (#109082) (#109163) 2021-08-18 18:21:25 -04:00
kbn-monaco
kbn-optimizer [7.15] [Security Solutions] Search results deepLinks fix inconsistency (#113046) (#113537) 2021-10-01 06:58:12 -04:00
kbn-plugin-generator chore(NA): moving @kbn/plugin-generator to babel transpiler (#109083) (#109229) 2021-08-19 09:52:18 -04:00
kbn-plugin-helpers skip flaky suite 2021-09-19 07:52:08 -07:00
kbn-pm [ftr] ensure indentation is reset between configs (#114359) (#114580) 2021-10-11 21:44:16 -04:00
kbn-rule-data-utils [RAC][Security Solution] Remove ALERT_RULE_ID in favor of ALERT_RULE_UUID (#108922) (#112049) 2021-09-14 02:42:13 -04:00
kbn-securitysolution-autocomplete chore(NA): moving @kbn/securitysolution-autocomplete to babel transpiler (#109423) (#109569) 2021-08-21 02:30:27 -04:00
kbn-securitysolution-es-utils chore(NA): moving @kbn/securitysolution-es-utils to babel transpiler (#109426) (#109673) 2021-08-23 13:08:33 -04:00
kbn-securitysolution-hook-utils chore(NA): moving @kbn/securitysolution-hook-utils to babel transpiler (#109432) (#109665) 2021-08-23 12:50:33 -04:00
kbn-securitysolution-io-ts-alerting-types chore(NA): moving @kbn/securitysolution-io-ts-alerting-types to babel transpiler (#109745) (#110103) 2021-08-25 19:29:14 +00:00
kbn-securitysolution-io-ts-list-types Fix exceptions page table pagination (#111000) (#111208) 2021-09-06 15:38:23 +00:00
kbn-securitysolution-io-ts-types
kbn-securitysolution-io-ts-utils
kbn-securitysolution-list-api
kbn-securitysolution-list-constants
kbn-securitysolution-list-hooks Fix exceptions page table pagination (#111000) (#111208) 2021-09-06 15:38:23 +00:00
kbn-securitysolution-list-utils
kbn-securitysolution-t-grid chore(NA): moving @kbn/securitysolution-t-grid to babel transpiler (#109442) (#109676) 2021-08-23 13:14:41 -04:00
kbn-securitysolution-utils chore(NA): moving @kbn/securitysolution-utils to babel transpiler (#109439) (#109549) 2021-08-20 19:24:10 -04:00
kbn-server-http-tools
kbn-server-route-repository
kbn-spec-to-console
kbn-std
kbn-storybook
kbn-telemetry-tools
kbn-test fix(NA): creation of multiple processes on production by splitting no_transpilation when setting up node env (#115246) (#115994) 2021-10-21 20:41:38 +01:00
kbn-test-subj-selector
kbn-tinymath
kbn-typed-react-router-config
kbn-ui-framework
kbn-ui-shared-deps chore(NA): moving @kbn/ui-shared-deps to babel transpiler (#109323) (#109508) 2021-08-20 14:42:03 -04:00
kbn-utility-types
kbn-utils
BUILD.bazel [Security Solution] - Updating UI to work with new kibana privileges abstraction on alerts (#108961) (#109155) 2021-08-18 22:19:15 +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.