kibana/packages
István Zoltán Szabó 8b60f94ddd
[8.1] Removes perlGuide from doc link service (#148803) (#148823)
# Backport

This will backport the following commits from `main` to `8.1`:
- [Removes perlGuide from doc link service
(#148803)](https://github.com/elastic/kibana/pull/148803)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"István Zoltán
Szabó","email":"szabosteve@gmail.com"},"sourceCommit":{"committedDate":"2023-01-12T15:13:14Z","message":"Removes
perlGuide from doc link service
(#148803)","sha":"a82e62f0cd29497a8dbbb5f2f7eff07ed14fbf2e","branchLabelMapping":{"^v8.7.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Docs","release_note:skip","docs","v8.0.2","v8.1.4","v8.2.4","v8.3.4","v8.4.4","v8.7.0","v8.6.1","v8.5.4"],"number":148803,"url":"https://github.com/elastic/kibana/pull/148803","mergeCommit":{"message":"Removes
perlGuide from doc link service
(#148803)","sha":"a82e62f0cd29497a8dbbb5f2f7eff07ed14fbf2e"}},"sourceBranch":"main","suggestedTargetBranches":["8.0","8.1"],"targetPullRequestStates":[{"branch":"8.0","label":"v8.0.2","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.1","label":"v8.1.4","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.2","label":"v8.2.4","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/148812","number":148812,"state":"OPEN"},{"branch":"8.3","label":"v8.3.4","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/148813","number":148813,"state":"OPEN"},{"branch":"8.4","label":"v8.4.4","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/148814","number":148814,"state":"OPEN"},{"branch":"main","label":"v8.7.0","labelRegex":"^v8.7.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/148803","number":148803,"mergeCommit":{"message":"Removes
perlGuide from doc link service
(#148803)","sha":"a82e62f0cd29497a8dbbb5f2f7eff07ed14fbf2e"}},{"branch":"8.6","label":"v8.6.1","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/148816","number":148816,"state":"OPEN"},{"branch":"8.5","label":"v8.5.4","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/148815","number":148815,"state":"OPEN"}]}]
BACKPORT-->
2023-01-13 13:19:05 +00:00
..
elastic-apm-synthtrace [bazel] avoid a little boilerplate in packages (#126309) (#126380) 2022-02-24 21:15:20 +00:00
elastic-datemath [bazel] avoid a little boilerplate in packages (#126309) (#126380) 2022-02-24 21:15:20 +00:00
elastic-eslint-config-kibana [8.1] chore(NA): upgrade typescript-eslint packages to v5.14.0 (#127275) (#127532) 2022-03-14 08:14:28 -07:00
elastic-safer-lodash-set chore(NA): splits types from code on @elastic/safer-lodash-set (#122697) 2022-01-12 19:10:36 +00:00
kbn-ace [bazel] avoid a little boilerplate in packages (#126309) (#126380) 2022-02-24 21:15:20 +00:00
kbn-alerts [bazel] avoid a little boilerplate in packages (#126309) (#126380) 2022-02-24 21:15:20 +00:00
kbn-analytics [bazel] avoid a little boilerplate in packages (#126309) (#126380) 2022-02-24 21:15:20 +00:00
kbn-apm-config-loader Debugging with apm - fixes and tutorial (#127892) (#128256) 2022-03-22 07:35:42 -07:00
kbn-apm-utils [bazel] avoid a little boilerplate in packages (#126309) (#126380) 2022-02-24 21:15:20 +00:00
kbn-babel-code-parser [eslint] automatically determine dev packages (#127089) (#127147) 2022-03-08 08:25:12 -07:00
kbn-babel-preset chore(NA): use internal pkg_npm on @kbn/babel-preset (#120123) 2021-12-02 02:34:59 +00:00
kbn-bazel-packages [bazel] validate packages/BUILD.bazel in CI (#127241) (#127691) 2022-03-14 21:09:04 -07:00
kbn-cli-dev-mode [bazel] avoid a little boilerplate in packages (#126309) (#126380) 2022-02-24 21:15:20 +00:00
kbn-config [bazel] avoid a little boilerplate in packages (#126309) (#126380) 2022-02-24 21:15:20 +00:00
kbn-config-schema [bazel] avoid a little boilerplate in packages (#126309) (#126380) 2022-02-24 21:15:20 +00:00
kbn-crypto [bazel] avoid a little boilerplate in packages (#126309) (#126380) 2022-02-24 21:15:20 +00:00
kbn-dev-utils [ci-stats-reporter] prevent Request body larger than maxBodyLength limit error (#128840) (#128845) 2022-03-29 18:25:43 -07:00
kbn-doc-links [8.1] Removes perlGuide from doc link service (#148803) (#148823) 2023-01-13 13:19:05 +00:00
kbn-docs-utils [plugin-discovery] move logic to a package (#128684) (#128817) 2022-03-29 14:09:53 -07:00
kbn-es [ToolingLog] remove some manual indent management (#126636) (#126794) 2022-03-03 09:53:57 -07:00
kbn-es-archiver [bazel] avoid a little boilerplate in packages (#126309) (#126380) 2022-02-24 21:15:20 +00:00
kbn-es-query [bazel] avoid a little boilerplate in packages (#126309) (#126380) 2022-02-24 21:15:20 +00:00
kbn-eslint-import-resolver-kibana chore(NA): use internal pkg_npm on @kbn/eslint-import-resolver-kibana (#120786) 2021-12-08 10:48:49 -07:00
kbn-eslint-plugin-eslint chore(NA): use internal pkg_npm on @kbn/eslint-plugin-eslint (#120940) 2021-12-10 02:45:33 +00:00
kbn-expect chore(NA): use internal pkg_npm on @kbn/expect (#120941) 2021-12-10 02:45:49 +00:00
kbn-field-types [bazel] avoid a little boilerplate in packages (#126309) (#126380) 2022-02-24 21:15:20 +00:00
kbn-flot-charts chore(NA): splits types from code on @kbn/ui-shared-deps-src (#123313) 2022-01-20 22:04:19 +00:00
kbn-generate [8.1] fix(NA): do not declare @types packages as prod dependencies when generating the pkg.json (#128805) (#128827) 2022-03-29 16:09:15 -07:00
kbn-i18n [bazel] avoid a little boilerplate in packages (#126309) (#126380) 2022-02-24 21:15:20 +00:00
kbn-i18n-react [bazel] avoid a little boilerplate in packages (#126309) (#126380) 2022-02-24 21:15:20 +00:00
kbn-interpreter [bazel] avoid a little boilerplate in packages (#126309) (#126380) 2022-02-24 21:15:20 +00:00
kbn-io-ts-utils [bazel] avoid a little boilerplate in packages (#126309) (#126380) 2022-02-24 21:15:20 +00:00
kbn-logging [bazel] avoid a little boilerplate in packages (#126309) (#126380) 2022-02-24 21:15:20 +00:00
kbn-mapbox-gl [bazel] avoid a little boilerplate in packages (#126309) (#126380) 2022-02-24 21:15:20 +00:00
kbn-monaco [bazel] avoid a little boilerplate in packages (#126309) (#126380) 2022-02-24 21:15:20 +00:00
kbn-optimizer [plugin-discovery] move logic to a package (#128684) (#128817) 2022-03-29 14:09:53 -07:00
kbn-plugin-discovery [8.1] Avoid loading all plugins on anonymous pages (#129555) (#129741) 2022-04-07 08:25:27 -07:00
kbn-plugin-generator [eslint] automatically determine dev packages (#127089) (#127147) 2022-03-08 08:25:12 -07:00
kbn-plugin-helpers [plugin-discovery] move logic to a package (#128684) (#128817) 2022-03-29 14:09:53 -07:00
kbn-pm chore(NA): use new and more performant BuildBuddy servers (#130350) (#130440) 2022-04-17 19:52:59 -07:00
kbn-react-field [bazel] avoid a little boilerplate in packages (#126309) (#126380) 2022-02-24 21:15:20 +00:00
kbn-rule-data-utils [bazel] avoid a little boilerplate in packages (#126309) (#126380) 2022-02-24 21:15:20 +00:00
kbn-securitysolution-autocomplete [bazel] avoid a little boilerplate in packages (#126309) (#126380) 2022-02-24 21:15:20 +00:00
kbn-securitysolution-es-utils [bazel] avoid a little boilerplate in packages (#126309) (#126380) 2022-02-24 21:15:20 +00:00
kbn-securitysolution-hook-utils [bazel] avoid a little boilerplate in packages (#126309) (#126380) 2022-02-24 21:15:20 +00:00
kbn-securitysolution-io-ts-alerting-types [bazel] avoid a little boilerplate in packages (#126309) (#126380) 2022-02-24 21:15:20 +00:00
kbn-securitysolution-io-ts-list-types [bazel] avoid a little boilerplate in packages (#126309) (#126380) 2022-02-24 21:15:20 +00:00
kbn-securitysolution-io-ts-types [bazel] avoid a little boilerplate in packages (#126309) (#126380) 2022-02-24 21:15:20 +00:00
kbn-securitysolution-io-ts-utils [bazel] avoid a little boilerplate in packages (#126309) (#126380) 2022-02-24 21:15:20 +00:00
kbn-securitysolution-list-api [bazel] avoid a little boilerplate in packages (#126309) (#126380) 2022-02-24 21:15:20 +00:00
kbn-securitysolution-list-constants [bazel] avoid a little boilerplate in packages (#126309) (#126380) 2022-02-24 21:15:20 +00:00
kbn-securitysolution-list-hooks [bazel] avoid a little boilerplate in packages (#126309) (#126380) 2022-02-24 21:15:20 +00:00
kbn-securitysolution-list-utils [bazel] avoid a little boilerplate in packages (#126309) (#126380) 2022-02-24 21:15:20 +00:00
kbn-securitysolution-rules [bazel] avoid a little boilerplate in packages (#126309) (#126380) 2022-02-24 21:15:20 +00:00
kbn-securitysolution-t-grid [bazel] avoid a little boilerplate in packages (#126309) (#126380) 2022-02-24 21:15:20 +00:00
kbn-securitysolution-utils [bazel] avoid a little boilerplate in packages (#126309) (#126380) 2022-02-24 21:15:20 +00:00
kbn-server-http-tools [bazel] avoid a little boilerplate in packages (#126309) (#126380) 2022-02-24 21:15:20 +00:00
kbn-server-route-repository [bazel] avoid a little boilerplate in packages (#126309) (#126380) 2022-02-24 21:15:20 +00:00
kbn-spec-to-console chore(NA): use internal pkg_npm on @kbn/spec-to-console (#121812) 2021-12-22 03:21:00 +00:00
kbn-std [bazel] avoid a little boilerplate in packages (#126309) (#126380) 2022-02-24 21:15:20 +00:00
kbn-storybook [bazel] avoid a little boilerplate in packages (#126309) (#126380) 2022-02-24 21:15:20 +00:00
kbn-telemetry-tools [8.1] chore(NA): upgrade typescript-eslint packages to v5.14.0 (#127275) (#127532) 2022-03-14 08:14:28 -07:00
kbn-test [reporting/upgrade/tests] rewrite waitForJobToFinish to handle errors (#128309) (#128322) 2022-03-22 16:29:50 -07:00
kbn-test-subj-selector chore(NA): use internal pkg_npm on @kbn/test-subj-selector (#121839) 2021-12-22 14:00:50 -07:00
kbn-timelion-grammar chore(NA): use internal pkg_npm on @kbn/timelion-grammar (#121840) 2021-12-22 09:36:21 -07:00
kbn-tinymath chore(NA): use internal pkg_npm on @kbn/tinymath (#121920) 2021-12-23 02:53:20 +00:00
kbn-typed-react-router-config [bazel] avoid a little boilerplate in packages (#126309) (#126380) 2022-02-24 21:15:20 +00:00
kbn-ui-framework chore(NA): use internal pkg_npm on @kbn/ui-framework (#121922) 2021-12-23 02:53:36 +00:00
kbn-ui-shared-deps-npm [bazel] avoid a little boilerplate in packages (#126309) (#126380) 2022-02-24 21:15:20 +00:00
kbn-ui-shared-deps-src [bazel] avoid a little boilerplate in packages (#126309) (#126380) 2022-02-24 21:15:20 +00:00
kbn-ui-theme [bazel] avoid a little boilerplate in packages (#126309) (#126380) 2022-02-24 21:15:20 +00:00
kbn-utility-types [eslint] automatically determine dev packages (#127089) (#127147) 2022-03-08 08:25:12 -07:00
kbn-utils [bazel] avoid a little boilerplate in packages (#126309) (#126380) 2022-02-24 21:15:20 +00:00
BUILD.bazel [plugin-discovery] move logic to a package (#128684) (#128817) 2022-03-29 14:09:53 -07:00
README.md Remove grunt (#111882) 2021-09-16 15:24:42 -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.