kibana/packages
Uladzislau Lasitsa 67acb7fa11
Bump "monaco-editor" and "react-monaco-editor" to latest versions (#90158) (#91019)
* Update version of react-monaco-editor and monaco-editor libraries

* Fix yarn lock file

* Fix CI

* Fix unit tests

* Fix CI

* Fix comment

* move monaco instance in window.MonacoEnvironment

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-02-11 10:07:29 +03:00
..
elastic-datemath
elastic-eslint-config-kibana
elastic-safer-lodash-set
kbn-ace
kbn-analytics
kbn-apm-config-loader
kbn-babel-code-parser
kbn-babel-preset
kbn-config
kbn-config-schema
kbn-dev-utils [7.x] [dev-utils/ci-stats] support disabling ship errors (#90851) (#90885) 2021-02-09 20:58:44 -05:00
kbn-es [7.x] [es] disable wildcards in destructive actions (#88986) (#90804) 2021-02-09 13:15:14 -05:00
kbn-es-archiver [7.x] [esArchiver] log when migrations complete and we're done loading data (#89938) (#90249) 2021-02-03 22:01:39 -07:00
kbn-eslint-import-resolver-kibana
kbn-eslint-plugin-eslint
kbn-expect
kbn-i18n
kbn-interpreter
kbn-legacy-logging [7.x] Fix issue where logs fail to calculate size of gunzip streams. (#90353) (#90431) 2021-02-05 09:59:09 -07:00
kbn-logging
kbn-monaco Bump "monaco-editor" and "react-monaco-editor" to latest versions (#90158) (#91019) 2021-02-11 10:07:29 +03:00
kbn-optimizer [7.x] [Maps] remove maps_file_upload plugin and fold public folder into file_upload plugin (#90292) (#90946) 2021-02-10 16:44:00 -07:00
kbn-plugin-generator
kbn-plugin-helpers [7.x] [kbn/optimizer][ci-stats] ship metrics separate from build (#90482) (#90659) 2021-02-08 16:40:11 -07:00
kbn-pm chore(NA): move the instruction to remove yarn global bazelisk package into the first place on install bazel tools (#91026) (#91058) 2021-02-10 19:29:59 -05:00
kbn-release-notes
kbn-spec-to-console
kbn-std [Core] add timeout for "stop" lifecycle (#90432) (#90783) 2021-02-09 17:41:29 +01:00
kbn-storybook
kbn-telemetry-tools
kbn-test Bump "monaco-editor" and "react-monaco-editor" to latest versions (#90158) (#91019) 2021-02-11 10:07:29 +03:00
kbn-test-subj-selector
kbn-tinymath Expand Tinymath grammar, including named arguments (#89795) (#90801) 2021-02-09 15:24:44 -05:00
kbn-ui-framework
kbn-ui-shared-deps Bump "monaco-editor" and "react-monaco-editor" to latest versions (#90158) (#91019) 2021-02-11 10:07:29 +03:00
kbn-utility-types
kbn-utils
BUILD.bazel chore(NA): support bazel and kbn packages in parallel on kbn pm and on distributable build scripts (#89961) (#90256) 2021-02-03 22:33:49 -08: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"

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 or yarn grunt 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.