kibana/packages
Patryk Kopyciński fda6b27145
Optimize react-query dependencies (#144206)
* Update react-query to ^4.12.0

* cleanup

* bump

* WIP

* WIP

* es-query

* revert react-use

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-10-31 20:53:42 +01:00
..
analytics [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
content-management [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
core [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
home [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-ace [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-alerts [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-ambient-storybook-types [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-ambient-ui-types [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-analytics [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-apm-config-loader [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-apm-synthtrace [APM] AWS lambda estimated cost (#143986) 2022-10-31 15:27:41 -04:00
kbn-apm-utils [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-axe-config [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-babel-plugin-synthetic-packages [bazel] fix some BUILD.bazel file inconsistencies 2022-10-26 11:07:55 -05:00
kbn-babel-preset Update dependency core-js to ^3.26.0 (main) (#144211) 2022-10-31 10:46:49 -07:00
kbn-bazel-packages [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-bazel-runner [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-cases-components [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-chart-icons [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-ci-stats-core [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-ci-stats-performance-metrics [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-ci-stats-reporter [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-cli-dev-mode [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-coloring [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-config [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-config-mocks [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-config-schema [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-crypto [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-crypto-browser [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-datemath [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-dev-cli-errors [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-dev-cli-runner [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-dev-proc-runner [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-dev-utils [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-doc-links [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-docs-utils [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-ebt-tools remove unnecessary import aliases (#144250) 2022-10-31 17:56:59 +01:00
kbn-es [bazel] fix some BUILD.bazel file inconsistencies 2022-10-26 11:07:55 -05:00
kbn-es-archiver [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-es-errors [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-es-query [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-es-types [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-eslint-config [bazel] fix some BUILD.bazel file inconsistencies 2022-10-26 11:07:55 -05:00
kbn-eslint-plugin-disable [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-eslint-plugin-eslint [bazel] fix some BUILD.bazel file inconsistencies 2022-10-26 11:07:55 -05:00
kbn-eslint-plugin-imports [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-expect [bazel] fix some BUILD.bazel file inconsistencies 2022-10-26 11:07:55 -05:00
kbn-failed-test-reporter-cli [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-field-types [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-find-used-node-modules [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-flot-charts [bazel] fix some BUILD.bazel file inconsistencies 2022-10-26 11:07:55 -05:00
kbn-ftr-common-functional-services [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-ftr-screenshot-filename [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-generate chore(NA): remove @types/pkg link creation when generating a new package (#144200) 2022-10-28 15:56:02 -07:00
kbn-get-repo-files [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-guided-onboarding [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-handlebars [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-hapi-mocks [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-i18n [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-i18n-react [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-import-resolver [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-interpreter [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-io-ts-utils [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-jest-serializers [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-journeys [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-kibana-manifest-schema [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-language-documentation-popover [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-logging [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-logging-mocks [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-managed-vscode-config [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-managed-vscode-config-cli [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-mapbox-gl [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-monaco [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-optimizer [babel/node] invalidate cache when synth pkg map is updated (#144258) 2022-10-31 12:36:03 -07:00
kbn-optimizer-webpack-helpers [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-osquery-io-ts-types [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-performance-testing-dataset-extractor [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-plugin-discovery [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-plugin-generator [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-plugin-helpers [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-react-field [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-repo-source-classifier [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-repo-source-classifier-cli [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-rule-data-utils [Security Solution][Investigations] - Alert Details Summary Page (#141709) 2022-10-31 12:16:37 -07:00
kbn-safer-lodash-set [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-securitysolution-autocomplete [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-securitysolution-es-utils [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-securitysolution-exception-list-components [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-securitysolution-hook-utils [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-securitysolution-io-ts-alerting-types [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-securitysolution-io-ts-list-types [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-securitysolution-io-ts-types [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-securitysolution-io-ts-utils [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-securitysolution-list-api [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-securitysolution-list-constants [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-securitysolution-list-hooks [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-securitysolution-list-utils [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-securitysolution-rules [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-securitysolution-t-grid [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-securitysolution-utils [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-server-http-tools [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-server-route-repository [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-shared-svg [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-shared-ux-utility [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-some-dev-log [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-sort-package-json [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-spec-to-console [bazel] fix some BUILD.bazel file inconsistencies 2022-10-26 11:07:55 -05:00
kbn-std [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-stdio-dev-helpers [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-storybook [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-synthetic-package-map [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-telemetry-tools [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-test [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-test-jest-helpers [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-test-subj-selector [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-timelion-grammar [bazel] fix some BUILD.bazel file inconsistencies 2022-10-26 11:07:55 -05:00
kbn-tinymath [bazel] fix some BUILD.bazel file inconsistencies 2022-10-26 11:07:55 -05:00
kbn-tooling-log [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-type-summarizer [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-type-summarizer-cli [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-type-summarizer-core [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-typed-react-router-config [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-ui-framework [bazel] fix some BUILD.bazel file inconsistencies 2022-10-26 11:07:55 -05:00
kbn-ui-shared-deps-npm Optimize react-query dependencies (#144206) 2022-10-31 20:53:42 +01:00
kbn-ui-shared-deps-src Optimize react-query dependencies (#144206) 2022-10-31 20:53:42 +01:00
kbn-ui-theme [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-user-profile-components [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-utility-types [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-utility-types-jest [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-utils [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
kbn-yarn-lock-validator [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
shared-ux [auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
BUILD.bazel [ts] stop building @types packages in bootstrap 2022-10-28 14:03:55 -05:00
README.md [kbn/pm] rewrite to avoid needing a build process (#136207) 2022-07-18 08:46:13 -07: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"

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.