kibana/packages
Spencer 5b99289c29
[7.16] Remove direct usage of EUI theme vars (#116232) (#118229)
* Remove direct usage of EUI theme vars (#116232)

Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
# Conflicts:
#	packages/kbn-ui-shared-deps-src/src/theme.ts
#	src/plugins/discover/public/application/components/discover_grid/discover_grid_document_selection.tsx
#	src/plugins/expressions/public/react_expression_renderer.tsx
#	x-pack/plugins/apm/ftr_e2e/cypress/integration/read_only_user/service_inventory/service_inventory.spec.ts

* commit using @elastic.co

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-11-10 20:48:19 -05:00
..
elastic-apm-synthtrace [7.16] [x-pack/test/apm_api_integration] make registry a service (#116365) (#117759) 2021-11-08 18:45:24 +00:00
elastic-datemath chore(NA): replace babel config files by inline presets by default in the jsts_transpiler rule (#110620) (#111217) 2021-09-03 18:41:32 -04:00
elastic-eslint-config-kibana [7.16] Remove direct usage of EUI theme vars (#116232) (#118229) 2021-11-10 20:48:19 -05:00
elastic-safer-lodash-set Updates Github link references from master to main (#116789) (#116792) 2021-10-29 10:08:30 -07:00
kbn-ace chore(NA): replace babel config files by inline presets by default in the jsts_transpiler rule (#110620) (#111217) 2021-09-03 18:41:32 -04:00
kbn-alerts chore(NA): replace babel config files by inline presets by default in the jsts_transpiler rule (#110620) (#111217) 2021-09-03 18:41:32 -04:00
kbn-analytics [7.x][DX] Upgrade prettier to v2.4.0 (#112359) (#112524) 2021-09-19 22:34:46 -07:00
kbn-apm-config-loader [ci] Updates APM server (#114588) (#114723) 2021-10-12 19:25:35 -04:00
kbn-apm-utils chore(NA): replace babel config files by inline presets by default in the jsts_transpiler rule (#110620) (#111217) 2021-09-03 18:41:32 -04:00
kbn-babel-code-parser Updates Github link references from master to main (#116789) (#116792) 2021-10-29 10:08:30 -07:00
kbn-babel-preset [kbn/ui-shared-deps] split into two packages (#110558) (#112475) 2021-09-16 18:02:17 -04:00
kbn-cli-dev-mode [kbn/optimizer] log about high-level optimizer progress (#103354) (#114398) 2021-10-08 18:51:33 -04:00
kbn-config [7.16] [eslint] enable type-specific lint rules (#114184) (#117451) 2021-11-03 23:58:42 -06:00
kbn-config-schema [7.16] [eslint] enable type-specific lint rules (#114184) (#117451) 2021-11-03 23:58:42 -06:00
kbn-crypto chore(NA): replace babel config files by inline presets by default in the jsts_transpiler rule (#110620) (#111217) 2021-09-03 18:41:32 -04:00
kbn-dev-utils [vscode] ignore tsconfig.tsbuildinfo and .map files (#117458) (#117468) 2021-11-04 06:27:08 +00:00
kbn-docs-utils Updates Github link references from master to main (#116789) (#116792) 2021-10-29 10:08:30 -07:00
kbn-es [ci] Explicitly define tasks for ES snapshot build (#115074) (#115116) 2021-10-14 21:30:14 -04:00
kbn-es-archiver [7.16] [eslint] enable type-specific lint rules (#114184) (#117451) 2021-11-03 23:58:42 -06:00
kbn-es-query Update ES client to 7.16-canary.6 (#117305) 2021-11-04 16:48:31 +01:00
kbn-eslint-import-resolver-kibana Updates Github link references from master to main (#116789) (#116792) 2021-10-29 10:08:30 -07:00
kbn-eslint-plugin-eslint Bump eslint@7 (#94347) (#114256) 2021-10-07 13:35:23 -04:00
kbn-expect
kbn-field-types [7.16] [eslint] enable type-specific lint rules (#114184) (#117451) 2021-11-03 23:58:42 -06:00
kbn-i18n [i18n] remove angular i18n and move the remains to monitoring plugin (#115003) (#115156) 2021-10-18 12:20:36 +00:00
kbn-interpreter [7.16] [eslint] enable type-specific lint rules (#114184) (#117451) 2021-11-03 23:58:42 -06:00
kbn-io-ts-utils [7.x][DX] Upgrade prettier to v2.4.0 (#112359) (#112524) 2021-09-19 22:34:46 -07:00
kbn-legacy-logging [7.16] [eslint] enable type-specific lint rules (#114184) (#117451) 2021-11-03 23:58:42 -06:00
kbn-logging [7.16] [eslint] enable type-specific lint rules (#114184) (#117451) 2021-11-03 23:58:42 -06:00
kbn-mapbox-gl chore(NA): replace babel config files by inline presets by default in the jsts_transpiler rule (#110620) (#111217) 2021-09-03 18:41:32 -04:00
kbn-monaco [7.16] [eslint] enable type-specific lint rules (#114184) (#117451) 2021-11-03 23:58:42 -06:00
kbn-optimizer [7.16] [eslint] enable type-specific lint rules (#114184) (#117451) 2021-11-03 23:58:42 -06:00
kbn-plugin-generator Updates Github link references from master to main (#116789) (#116792) 2021-10-29 10:08:30 -07:00
kbn-plugin-helpers [npm] Updates Browserslist caniuse-lite database (#112523) (#112527) 2021-09-19 13:14:47 -04:00
kbn-pm [7.16] [eslint] enable type-specific lint rules (#114184) (#117451) 2021-11-03 23:58:42 -06:00
kbn-rule-data-utils [RAC] Store rule params in the alert document (#113429) (#113965) 2021-10-05 18:45:00 +00:00
kbn-securitysolution-autocomplete [7.x] [data views] clarify field subtype typescript types (#112499) (#114222) 2021-10-07 17:49:42 -04:00
kbn-securitysolution-es-utils Update ES client to 7.16-canary.6 (#117305) 2021-11-04 16:48:31 +01:00
kbn-securitysolution-hook-utils Increases the timeout for the test from default 1 second. (#117389) (#117534) 2021-11-04 16:52:57 +00:00
kbn-securitysolution-io-ts-alerting-types [7.x][DX] Upgrade prettier to v2.4.0 (#112359) (#112524) 2021-09-19 22:34:46 -07:00
kbn-securitysolution-io-ts-list-types [Security Solution][Platform] - Update rule exported counts to include total object count (#116338) (#117464) 2021-11-04 05:34:21 +00:00
kbn-securitysolution-io-ts-types chore(NA): replace babel config files by inline presets by default in the jsts_transpiler rule (#110620) (#111217) 2021-09-03 18:41:32 -04:00
kbn-securitysolution-io-ts-utils [7.x][DX] Upgrade prettier to v2.4.0 (#112359) (#112524) 2021-09-19 22:34:46 -07:00
kbn-securitysolution-list-api Fixing exceptions export format (#114920) (#114949) 2021-10-14 02:06:34 -04:00
kbn-securitysolution-list-constants [Security Solution] Fix casing for host isolation exceptions name and hide search bar when no entries (#115349) (#115387) 2021-10-18 13:25:09 -04:00
kbn-securitysolution-list-hooks [Security Solutions] Fix host isolation exception list showing up on the exceptions list (#114987) (#115269) 2021-10-16 04:44:15 +00:00
kbn-securitysolution-list-utils [Security Solutions] Fix host isolation exception list showing up on the exceptions list (#114987) (#115269) 2021-10-16 04:44:15 +00:00
kbn-securitysolution-t-grid chore(NA): replace babel config files by inline presets by default in the jsts_transpiler rule (#110620) (#111217) 2021-09-03 18:41:32 -04:00
kbn-securitysolution-utils Fixing exceptions export format (#114920) (#114949) 2021-10-14 02:06:34 -04:00
kbn-server-http-tools chore(NA): replace babel config files by inline presets by default in the jsts_transpiler rule (#110620) (#111217) 2021-09-03 18:41:32 -04:00
kbn-server-route-repository [7.16] [eslint] enable type-specific lint rules (#114184) (#117451) 2021-11-03 23:58:42 -06:00
kbn-spec-to-console Updates Github link references from master to main (#116789) (#116792) 2021-10-29 10:08:30 -07:00
kbn-std [7.16] [eslint] enable type-specific lint rules (#114184) (#117451) 2021-11-03 23:58:42 -06:00
kbn-storybook Updates Github link references from master to main (#116789) (#116792) 2021-10-29 10:08:30 -07:00
kbn-telemetry-tools chore(NA): replace babel config files by inline presets by default in the jsts_transpiler rule (#110620) (#111217) 2021-09-03 18:41:32 -04:00
kbn-test [7.16] [x-pack/test/apm_api_integration] make registry a service (#116365) (#117759) 2021-11-08 18:45:24 +00:00
kbn-test-subj-selector
kbn-timelion-grammar [7.x] [timelion] Move grammar to package (#111881) (#112373) 2021-09-16 12:59:21 -04:00
kbn-tinymath [7.x][DX] Upgrade prettier to v2.4.0 (#112359) (#112524) 2021-09-19 22:34:46 -07:00
kbn-typed-react-router-config [APM] Ensure refresh button works (#112652) (#114082) 2021-10-06 09:32:55 -04:00
kbn-ui-framework [jest] update config files to get coverage per plugin (#111299) (#111674) 2021-09-09 04:47:28 -04:00
kbn-ui-shared-deps-npm [7.16] Remove direct usage of EUI theme vars (#116232) (#118229) 2021-11-10 20:48:19 -05:00
kbn-ui-shared-deps-src [7.16] Remove direct usage of EUI theme vars (#116232) (#118229) 2021-11-10 20:48:19 -05:00
kbn-utility-types [7.16] [eslint] enable type-specific lint rules (#114184) (#117451) 2021-11-03 23:58:42 -06:00
kbn-utils [config] Deprecate KIBANA_PATH_CONF in favor of KBN_PATH_CONF (#111550) (#111791) 2021-09-09 23:23:42 +00:00
BUILD.bazel Rename apm-generator to apm-synthtrace (#116075) (#116420) 2021-10-27 13:29:28 +01:00
README.md Remove grunt (#111882) (#112474) 2021-09-16 17:48:57 -04: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 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.