## Summary This PR is a followup to #205990, which removed references to all of the deprecated/renamed EUI vars in preparation for 9.0. Here, we address some of the non-critical tech debt related to the EUI refresh, namely the [removal of static EUI tokens](https://github.com/elastic/kibana/issues/199715#json-tokens) from our codebase. I made every attempt not to change any styles in this PR, except to simplify CSS to produce an equivalent design. A common example of this was removing a static `margin` or `padding` declaration referencing `euiThemeVars.size*`, and swapping it with an equivalent `gutterSize` prop on the `EuiFlexGroup` container, or with an `align-self` or other equivalent flexbox directive. ## Screenshots of Areas Affected The majority of changes here involved the Exception List/Item pages. I've attached screenshots of their current layout for comparison/review: <details> <summary> <h3>Rule Exceptions Tab</h3> </summary> <kbd> <h3>Before</h3> <img width="1395" alt="Rule exceptions tab - before" src="https://github.com/user-attachments/assets/db7a5487-7df3-4a5f-b88e-90ab34784970" /> </kbd> <kbd> <h3>After</h3> <img width="1421" alt="Rule exceptions tab - after" src="https://github.com/user-attachments/assets/77cbdefc-cbec-4b9e-8436-197f2f2f6677" /> </kbd> </details> <details> <summary> <h3>Shared Exception Lists</h3> </summary> <kbd> <img width="1517" alt="Shared Exception Lists" src="https://github.com/user-attachments/assets/5448dd65-60f7-470c-bf7a-7af75bb914fa" /> </kbd> </details> <details> <summary> <h3>Shared Exception List Details</h3> </summary> <kbd> <img width="1517" alt="Shared Exception List Details" src="https://github.com/user-attachments/assets/6e03fef6-af58-40bb-98c5-188651a584cc" /> </kbd> </details> <details> <summary> <h3>Threshold Input</h3> </summary> <kbd> <img width="1046" alt="Threshold Input" src="https://github.com/user-attachments/assets/28738857-6bdf-404f-a790-a9f4e66ff27a" /> </kbd> </details> ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [x] [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 - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> |
||
---|---|---|
.. | ||
kbn-ambient-common-types | ||
kbn-ambient-ftr-types | ||
kbn-ambient-storybook-types | ||
kbn-ambient-ui-types | ||
kbn-apm-synthtrace | ||
kbn-apm-synthtrace-client | ||
kbn-axe-config | ||
kbn-babel-preset | ||
kbn-babel-register | ||
kbn-babel-transform | ||
kbn-bazel-runner | ||
kbn-capture-oas-snapshot-cli | ||
kbn-check-mappings-update-cli | ||
kbn-check-prod-native-modules-cli | ||
kbn-ci-stats-core | ||
kbn-ci-stats-performance-metrics | ||
kbn-ci-stats-reporter | ||
kbn-ci-stats-shipper-cli | ||
kbn-cli-dev-mode | ||
kbn-code-owners | ||
kbn-cypress-config | ||
kbn-dependency-ownership | ||
kbn-dependency-usage | ||
kbn-dev-cli-errors | ||
kbn-dev-cli-runner | ||
kbn-dev-proc-runner | ||
kbn-dev-utils | ||
kbn-docs-utils | ||
kbn-es | ||
kbn-es-archiver | ||
kbn-eslint-config | ||
kbn-eslint-plugin-css | ||
kbn-eslint-plugin-disable | ||
kbn-eslint-plugin-eslint | ||
kbn-eslint-plugin-i18n | ||
kbn-eslint-plugin-imports | ||
kbn-eslint-plugin-telemetry | ||
kbn-expect | ||
kbn-failed-test-reporter-cli | ||
kbn-find-used-node-modules | ||
kbn-ftr-common-functional-services | ||
kbn-ftr-common-functional-ui-services | ||
kbn-ftr-screenshot-filename | ||
kbn-gen-ai-functional-testing | ||
kbn-generate | ||
kbn-generate-console-definitions | ||
kbn-get-repo-files | ||
kbn-import-locator | ||
kbn-import-resolver | ||
kbn-io-ts-utils | ||
kbn-jest-serializers | ||
kbn-journeys | ||
kbn-json-ast | ||
kbn-kibana-manifest-schema | ||
kbn-lint-packages-cli | ||
kbn-lint-ts-projects-cli | ||
kbn-managed-vscode-config | ||
kbn-managed-vscode-config-cli | ||
kbn-management | ||
kbn-manifest | ||
kbn-mock-idp-plugin | ||
kbn-mock-idp-utils | ||
kbn-openapi-bundler | ||
kbn-openapi-generator | ||
kbn-optimizer | ||
kbn-optimizer-webpack-helpers | ||
kbn-peggy | ||
kbn-peggy-loader | ||
kbn-performance-testing-dataset-extractor | ||
kbn-picomatcher | ||
kbn-plugin-check | ||
kbn-plugin-generator | ||
kbn-plugin-helpers | ||
kbn-relocate | ||
kbn-repo-file-maps | ||
kbn-repo-linter | ||
kbn-repo-path | ||
kbn-repo-source-classifier | ||
kbn-repo-source-classifier-cli | ||
kbn-scout | ||
kbn-scout-info | ||
kbn-scout-reporting | ||
kbn-set-map | ||
kbn-some-dev-log | ||
kbn-sort-package-json | ||
kbn-stdio-dev-helpers | ||
kbn-storybook | ||
kbn-styled-components-mapping-cli | ||
kbn-telemetry-tools | ||
kbn-test | ||
kbn-test-eui-helpers | ||
kbn-test-jest-helpers | ||
kbn-test-subj-selector | ||
kbn-tooling-log | ||
kbn-ts-projects | ||
kbn-ts-type-check-cli | ||
kbn-validate-next-docs-cli | ||
kbn-web-worker-stub | ||
kbn-whereis-pkg-cli | ||
kbn-yarn-lock-validator | ||
serverless/storybook/config | ||
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
inpackage.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/src/platform/packages/shared/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.