kibana/packages
Eyo O. Eyo 7370cc712e
ES Lint rules for css-in-js declarations within Kibana (#200703)
## Summary

Closes https://github.com/elastic/kibana-team/issues/1272

This PR adds implementation for eslint rules to help facilitate the
migration away from SASS files to leveraging the design tokens EUI
provides for styling.

The introduced rules  in this PR are as follows;

- #### No CSS Color values
  Consider; 

  ```tsx
  <EuiCode style={{ color: '#dd4040' }}>Hello World!</EuiCode>
  ```

this expression because it specifies the css color property, with a
valid [CSS color
value](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value),
when the aforementioned rule is enabled depending on the set report
level set the user would get a feedback, see screenshot below;


<img width="735" alt="Screenshot 2024-11-20 at 12 46 17"
src="https://github.com/user-attachments/assets/d2f608dc-782c-4d83-88e6-92dfdd8f6101">

This rule also works for variables defined elsewhere in the code and
referenced as a value to the style prop, see screenshot below;

<img width="1658" alt="Screenshot 2024-11-26 at 13 29 45"
src="https://github.com/user-attachments/assets/f8aadf6b-318b-4c6a-b7c9-bb44fb867b58">

feedback will also be provided when some variable that is a literal
value is specified as a value for any earmarked property that should not
specify literal values.

<img width="1730" alt="Screenshot 2024-11-28 at 19 00 08"
src="https://github.com/user-attachments/assets/bc3a8674-9469-4c7a-b0c9-7a2bfa7f08dc">

feedback will be provided for referencing a member prop of some object
defined elsewhere as a value to any earmarked property that we have
deemed to not specify literal values

<img width="1676" alt="Screenshot 2024-11-29 at 11 36 44"
src="https://github.com/user-attachments/assets/c4537fbf-b2d8-46bb-ad5f-8582e8c9a932">

	Supports;
	- object values
	- object references
	- template literals
	- tagged templates 

This approach does not penalize variable declarations, only the usages
of any said variable when it doesn't conform to expectation

- #### Prefer CSS attributes for EUI components (optional)
  Consider; 

  ```tsx
<EuiCode style={{ someCSSProperty: 'propertyValue' }}>Hello
World!</EuiCode>
  ```
A declaration like the one above, will be regarded as an error and can
be fixed, when it's fixed it will be re-written as
  
  ```tsx
<EuiCode css={{ someCSSProperty: 'propertyValue' }}>Hello
World!</EuiCode>
  ```

	
<!--

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_node:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

### Identify risks

Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.

- [ ] [See some risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
- [ ] ...


-->

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-12-16 15:56:52 +00:00
..
analytics/utils/analytics_collection_utils Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
cloud Preparation for High Contrast Mode, Core/SharedUX domains (#202606) 2024-12-05 08:26:41 -07:00
content-management [TableListView] Improve help text of creator and view count (#202488) 2024-12-06 16:48:20 +01:00
core Removed TLSv1.1 from default set of supported protocols (#203856) 2024-12-16 16:27:44 +01:00
deeplinks kibana-management team module move (#203883) 2024-12-13 12:29:30 -06:00
default-nav/analytics kibana-management team module move (#203883) 2024-12-13 12:29:30 -06:00
home Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-actions-types Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-alerting-types [ResponseOps][Alerting] Decouple feature IDs from consumers (#183756) 2024-12-03 12:21:53 +02:00
kbn-alerts-as-data-utils [ResponseOps][Alerting] Decouple feature IDs from consumers (#183756) 2024-12-03 12:21:53 +02:00
kbn-alerts-grouping [ResponseOps][Alerting] Decouple feature IDs from consumers (#183756) 2024-12-03 12:21:53 +02:00
kbn-alerts-ui-shared Preparation for High Contrast Mode, ResponseOps domains (#202610) 2024-12-12 14:34:44 -06:00
kbn-ambient-common-types Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
kbn-ambient-ftr-types Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
kbn-ambient-storybook-types Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
kbn-ambient-ui-types Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
kbn-analytics Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-apm-config-loader Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-apm-data-view Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-apm-synthtrace [ObsUX][Synthtrace] Remove pidusage for logging cpu usage (#204043) 2024-12-13 17:58:49 +01:00
kbn-apm-synthtrace-client [Dataset Quality] Work around a geoip limitation in CI (#203165) 2024-12-11 12:46:40 +01:00
kbn-apm-types Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-apm-utils Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-axe-config Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
kbn-babel-preset [ObsUX][INFRA] Remove-infra-from-babel-preset-styled-components (#204213) 2024-12-13 15:40:26 +00:00
kbn-babel-register Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-babel-transform Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-bazel-runner Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
kbn-bfetch-error Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-calculate-auto Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
kbn-calculate-width-from-char-count [deps] Replace faker with @faker-js (#201105) 2024-12-03 18:17:49 +01:00
kbn-capture-oas-snapshot-cli Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
kbn-cases-components Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-cbor Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-chart-icons Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-check-mappings-update-cli Revert "[Response Ops][Alerting] Backfill actions schema changes for intermediate release (#203184)" (#204218) 2024-12-13 12:30:12 -05:00
kbn-check-prod-native-modules-cli Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
kbn-ci-stats-core Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-ci-stats-performance-metrics Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
kbn-ci-stats-reporter Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-ci-stats-shipper-cli Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
kbn-cli-dev-mode fix: kibana dev server not restarting for external plugin #171260 (#198246) 2024-11-20 20:24:58 +00:00
kbn-code-owners [kbn-code-owners] General improvements (#204023) 2024-12-12 12:05:01 -06:00
kbn-coloring [Visual Refresh] Borealis visualization palettes (#201015) 2024-12-11 14:58:56 -06:00
kbn-config [Config Service] Use stripUnknownKeys when checking enabled flags (#201579) 2024-12-02 10:30:09 -06:00
kbn-config-mocks Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-config-schema [Config Service] Use stripUnknownKeys when checking enabled flags (#201579) 2024-12-02 10:30:09 -06:00
kbn-content-management-utils Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-crypto Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-crypto-browser Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-custom-icons Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-custom-integrations Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-cypress-config Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-data-service Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-data-view-utils Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-datemath Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-dependency-ownership Dependency Ownership CLI (#201773) 2024-11-29 17:18:36 +01:00
kbn-dependency-usage Dependency usage CLI (#198920) 2024-11-25 14:07:40 +01:00
kbn-dev-cli-errors Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-dev-cli-runner Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-dev-proc-runner Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-dev-utils Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-discover-contextual-components [Logs UX][EUI Visual Refresh] Update theme usage (#202746) 2024-12-13 12:25:04 +01:00
kbn-discover-utils [One Discover] Revert token change from vis palette (#204054) 2024-12-12 18:01:49 +01:00
kbn-docs-utils Sustainable Kibana Architecture: Update tooling to take into account the new folders (#202327) 2024-12-02 04:04:35 -06:00
kbn-dom-drag-drop [deps] Replace faker with @faker-js (#201105) 2024-12-03 18:17:49 +01:00
kbn-ebt-tools [Perfomance] Track time range picker with onPageReady function (#202889) 2024-12-13 07:11:44 -06:00
kbn-elastic-agent-utils Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-es [kbn-es] update cluster definition in security roles (#202663) 2024-12-04 10:16:30 +01:00
kbn-es-archiver Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-es-errors Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-es-query Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-es-types [RCA] AI-assisted root cause analysis (#197200) 2024-12-11 12:35:01 +01:00
kbn-eslint-config ES Lint rules for css-in-js declarations within Kibana (#200703) 2024-12-16 15:56:52 +00:00
kbn-eslint-plugin-css ES Lint rules for css-in-js declarations within Kibana (#200703) 2024-12-16 15:56:52 +00:00
kbn-eslint-plugin-disable Add ESLINT constraints to detect inter-group dependencies (#194810) 2024-10-22 06:34:19 -05:00
kbn-eslint-plugin-eslint [Authz] Added section for migration routes created by utility function (#198401) 2024-10-30 13:05:38 -05:00
kbn-eslint-plugin-i18n Sustainable Kibana Architecture: Move modules owned by @elastic/obs-ux-management-team (#202832) 2024-12-12 14:28:21 -06:00
kbn-eslint-plugin-imports Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-eslint-plugin-telemetry Sustainable Kibana Architecture: Move modules owned by @elastic/obs-ux-management-team (#202832) 2024-12-12 14:28:21 -06:00
kbn-event-annotation-common Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-event-annotation-components [Visual Refresh] Borealis visualization palettes (#201015) 2024-12-11 14:58:56 -06:00
kbn-expect Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-failed-test-reporter-cli [Security Solution][Serverless] Github tickets / notifications (#197265) 2024-11-07 15:17:54 +02:00
kbn-field-types Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-field-utils Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-find-used-node-modules Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
kbn-flot-charts Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-formatters Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
kbn-ftr-common-functional-services Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-ftr-common-functional-ui-services [Data Usage] functional tests (#203166) 2024-12-12 08:08:08 -05:00
kbn-ftr-screenshot-filename Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-gen-ai-functional-testing Add base FTR test coverage for inference APIs (#198000) 2024-12-04 06:39:45 -06:00
kbn-generate Code owners - sort generated entries (#198901) 2024-11-06 13:38:31 +01:00
kbn-generate-console-definitions kibana-management team module move (#203883) 2024-12-13 12:29:30 -06:00
kbn-generate-csv Update dependency @elastic/elasticsearch to ^8.16.0 (main) (#200275) 2024-12-13 02:47:34 -06:00
kbn-get-repo-files Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-grid-layout [Dashboard] [Collapsable Panels] Add embeddable support (#198413) 2024-12-10 11:14:31 -06:00
kbn-grouping [React18] Migrate test suites to account for testing library upgrades response-ops (#201141) 2024-11-22 10:43:23 -06:00
kbn-guided-onboarding Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-handlebars Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-hapi-mocks Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-health-gateway-server Removed TLSv1.1 from default set of supported protocols (#203856) 2024-12-16 16:27:44 +01:00
kbn-i18n Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-i18n-react Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-import-locator Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
kbn-import-resolver Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-interpreter Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-io-ts-utils [Perfomance] Track time range picker with onPageReady function (#202889) 2024-12-13 07:11:44 -06:00
kbn-ipynb Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-item-buffer Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-jest-serializers Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-journeys Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-json-ast Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
kbn-kibana-manifest-schema Kibana Sustainable Architecture: Force visibility: 'private' for solutions in manifest (#199452) 2024-11-08 15:36:07 +01:00
kbn-lens-embeddable-utils Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-lens-formula-docs Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-lint-packages-cli [codeowners] Filter kibanamachine (#199404) 2024-11-12 12:39:17 -06:00
kbn-lint-ts-projects-cli Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
kbn-logging Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-logging-mocks Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-managed-content-badge Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-managed-vscode-config Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
kbn-managed-vscode-config-cli Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
kbn-management kibana-management team module move (#203883) 2024-12-13 12:29:30 -06:00
kbn-manifest Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-mapbox-gl Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-mock-idp-plugin Preparation for High Contrast Mode, Security domains (#202609) 2024-12-09 13:03:23 -07:00
kbn-mock-idp-utils Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-monaco [ES|QL] Improves the comments color in dark mode (#203965) 2024-12-12 12:08:55 +01:00
kbn-object-versioning Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-object-versioning-utils Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-openapi-bundler Updated js-yaml to v4 (#190678) 2024-09-19 12:25:03 +02:00
kbn-openapi-common [Security Solution] Fixes exception item comment validation on newline chars \n (#202063) 2024-12-10 17:19:32 -05:00
kbn-openapi-generator [Security Solution] Fixes exception item comment validation on newline chars \n (#202063) 2024-12-10 17:19:32 -05:00
kbn-optimizer [ML] Rename "Logs AIOps" panel section "Log analysis" (#203375) 2024-12-10 14:30:14 +01:00
kbn-optimizer-webpack-helpers Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-palettes [Visual Refresh] Borealis visualization palettes (#201015) 2024-12-11 14:58:56 -06:00
kbn-panel-loader Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-peggy Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-peggy-loader Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
kbn-performance-testing-dataset-extractor Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
kbn-picomatcher Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
kbn-plugin-check Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
kbn-plugin-generator Sustainable Kibana Architecture: Update tooling to take into account the new folders (#202327) 2024-12-02 04:04:35 -06:00
kbn-plugin-helpers Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
kbn-profiling-utils Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-react-field Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-react-hooks [React18] Migrate test suites to account for testing library upgrades obs-ux-logs-team (#201148) 2024-11-25 04:49:51 -06:00
kbn-react-mute-legacy-root-warning [React@18] Env variable to use React@18 (#193113) 2024-12-09 13:55:14 +01:00
kbn-recently-accessed Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-relocate Sustainable Kibana Architecture: Relocate script v4 (#204383) 2024-12-16 09:45:31 -06:00
kbn-repo-file-maps Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
kbn-repo-info Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-repo-linter Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
kbn-repo-packages Dependency usage CLI (#198920) 2024-11-25 14:07:40 +01:00
kbn-repo-path Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-repo-source-classifier Sustainable Kibana Architecture: Fix group inference logic: add missing packages folders (#201758) 2024-11-26 11:42:17 -06:00
kbn-repo-source-classifier-cli Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
kbn-reporting Preparation for High Contrast Mode, Core/SharedUX domains (#202606) 2024-12-05 08:26:41 -07:00
kbn-resizable-layout Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-rison Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-router-to-openapispec [OAS] Remove Elastic-Api-Version (#202923) 2024-12-05 17:05:42 +01:00
kbn-router-utils Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-rrule Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-rule-data-utils [ResponseOps][Alerting] Decouple feature IDs from consumers (#183756) 2024-12-03 12:21:53 +02:00
kbn-safer-lodash-set Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-saved-objects-settings Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-saved-search-component [Discover / Logs] Add new "Saved Search component" (#199787) 2024-11-29 23:09:24 +00:00
kbn-scout [Scout] add initial docs (#204050) 2024-12-13 16:38:09 +00:00
kbn-scout-info [kbn-scout] Custom event-oriented test reporter & persistence (#202906) 2024-12-09 14:34:25 +00:00
kbn-scout-reporting [kbn-code-owners] General improvements (#204023) 2024-12-12 12:05:01 -06:00
kbn-screenshotting-server Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-search-api-keys-components [Search] [Onboarding] Search api key refactor (#199790) 2024-11-27 08:57:46 -06:00
kbn-search-api-keys-server [Search] [Onboarding] Search api key refactor (#199790) 2024-11-27 08:57:46 -06:00
kbn-search-api-panels Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-search-connectors kibana-management team module move (#203883) 2024-12-13 12:29:30 -06:00
kbn-search-errors Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-search-index-documents [Search] Fix button without a11y aria-label (#201236) 2024-11-25 10:22:16 -06:00
kbn-search-response-warnings Preparation for High Contrast Mode, Analytics Experience domains (#202608) 2024-12-12 13:16:07 -06:00
kbn-search-types Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-security-hardening Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-securitysolution-autocomplete [React18] Migrate test suites to account for testing library upgrades security-detection-engine (#201149) 2024-12-11 14:46:09 +01:00
kbn-securitysolution-endpoint-exceptions-common [Security Solution] Fixes exception item comment validation on newline chars \n (#202063) 2024-12-10 17:19:32 -05:00
kbn-securitysolution-es-utils [Security Solution][Detection Engine] adds legacy siem signals telemetry (#202671) 2024-12-11 10:03:19 +00:00
kbn-securitysolution-exception-list-components [React18] Migrate test suites to account for testing library upgrades security-detection-engine (#201149) 2024-12-11 14:46:09 +01:00
kbn-securitysolution-exceptions-common [DOCS] Adds conceptual content to API docs (#202305) 2024-12-12 16:53:29 +00:00
kbn-securitysolution-hook-utils [React18] Migrate test suites to account for testing library upgrades security-detection-engine (#201149) 2024-12-11 14:46:09 +01:00
kbn-securitysolution-io-ts-alerting-types Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-securitysolution-io-ts-list-types Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-securitysolution-io-ts-types Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-securitysolution-io-ts-utils Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-securitysolution-list-api Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-securitysolution-list-constants Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-securitysolution-list-hooks [React18] Migrate test suites to account for testing library upgrades security-detection-engine (#201149) 2024-12-11 14:46:09 +01:00
kbn-securitysolution-list-utils Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-securitysolution-lists-common [DOCS] Adds conceptual content to API docs (#202305) 2024-12-12 16:53:29 +00:00
kbn-securitysolution-rules [ResponseOps][Alerting] Decouple feature IDs from consumers (#183756) 2024-12-03 12:21:53 +02:00
kbn-securitysolution-t-grid [Security Solution] [Timeline] Consolidate reduces, remove unneeded async/awaits, other small fixes (#197168) 2024-11-22 13:24:54 -05:00
kbn-securitysolution-utils [Security Solution] Move ES|QL parsing functionality into @kbn/securitysolution-utils package (#202772) 2024-12-05 10:12:32 +01:00
kbn-server-http-tools Removed TLSv1.1 from default set of supported protocols (#203856) 2024-12-16 16:27:44 +01:00
kbn-set-map Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
kbn-shared-svg Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-shared-ux-utility Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-some-dev-log Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-sort-package-json Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
kbn-sort-predicates Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-std Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-stdio-dev-helpers Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-storybook Preparation for High Contrast Mode, Core/SharedUX domains (#202606) 2024-12-05 08:26:41 -07:00
kbn-telemetry-tools [Sustainable Architecture] Telemetry schemas (#201760) 2024-11-27 18:18:09 +01:00
kbn-test [React@18] Improve console.error suppression in react-testing-library setup (#201142) (#202600) 2024-12-16 14:41:10 +01:00
kbn-test-eui-helpers Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-test-jest-helpers Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-test-subj-selector [scout] migrate more Discover tests (#201842) 2024-12-02 20:57:29 +01:00
kbn-timelion-grammar Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-timerange [Perfomance] Track time range picker with onPageReady function (#202889) 2024-12-13 07:11:44 -06:00
kbn-tinymath Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-tooling-log Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-transpose-utils Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-triggers-actions-ui-types [ResponseOps][Rules] Move Rule Form code into @kbn/response-ops-rule-form (#198725) 2024-12-03 12:40:48 -06:00
kbn-try-in-console Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-ts-projects Dependency usage CLI (#198920) 2024-11-25 14:07:40 +01:00
kbn-ts-type-check-cli Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
kbn-ui-actions-browser Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-ui-shared-deps-npm [React@18] Env variable to use React@18 (#193113) 2024-12-09 13:55:14 +01:00
kbn-ui-shared-deps-src [React@18] Env variable to use React@18 (#193113) 2024-12-09 13:55:14 +01:00
kbn-ui-theme Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-unified-data-table [Discover] Remove discover:searchFieldsFromSource setting (#202679) 2024-12-06 17:58:47 +01:00
kbn-unified-doc-viewer [Discover] Remove the legacy table (#201254) 2024-12-03 12:03:08 +01:00
kbn-unified-field-list [Discover][Borealis] Update colors in field stats for Borealis theme (#203579) 2024-12-11 09:59:54 +01:00
kbn-unsaved-changes-badge Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-use-tracked-promise Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
kbn-user-profile-components Preparation for High Contrast Mode, Security domains (#202609) 2024-12-09 13:03:23 -07:00
kbn-utility-types [Streams] App plugin (#200060) 2024-11-25 14:51:24 +01:00
kbn-utility-types-jest Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-utils Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-validate-next-docs-cli Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
kbn-visualization-ui-components [Visual Refresh] Borealis visualization palettes (#201015) 2024-12-11 14:58:56 -06:00
kbn-visualization-utils [React18] Migrate test suites to account for testing library upgrades kibana-visualizations (#201152) 2024-11-22 16:34:11 +01:00
kbn-web-worker-stub Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
kbn-whereis-pkg-cli Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
kbn-xstate-utils Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-yarn-lock-validator Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
kbn-zod Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
kbn-zod-helpers [Security Solution] Fixes exception item comment validation on newline chars \n (#202063) 2024-12-10 17:19:32 -05:00
presentation [Embeddables Rebuild] Make Serialize Function Synchronous (#203662) 2024-12-12 21:25:03 -05:00
react [Visual Refresh] Borealis visualization palettes (#201015) 2024-12-11 14:58:56 -06:00
response-ops Preparation for High Contrast Mode, ResponseOps domains (#202610) 2024-12-12 14:34:44 -06:00
serverless Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
shared-ux [SharedUX] EUI visual refresh for SharedUX (#202780) 2024-12-12 12:02:36 -07: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"

then run yarn kbn bootstrap from the plugin directory.

Creating a new package

Run the following command from the root of the Kibana repo:

node scripts/generate package @kbn/<PACKAGE_NAME> --web --owner @elastic/<TEAM_NAME>

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.