kibana/packages
CJ Cenizal 1cfecfcab9
Create Painless Lab app (#57538) (#61015)
* Create Painless Playground app (#54578)

* Replace heart script with smiley face script. (#57755)

* Rename Painless Playground -> Painless Lab. (#57545)

* Fix i18n namespace.

* Improve smiley face proportions.
- Add def keyword to Painless spec.
- Temporarily fix broken highlighting.
- Add small padding to main controls.

* [Painless Lab] Minor Fixes (#58135)

* Code restructure, improve types, add plugin id, introduced hook

Moved the code execution hook to a custom hook outside of main,
also chaining off promise to avoid lower level handling of
sequencing.

* Re-instated formatting code

To improve DX the execution error response from the painless API
was massaged to a more reader friendly state, only giving non-repeating
information.

Currently it is hard to determine the line and character information from
the painless endpoint. If the user wishes to see this raw information it
will be available in the API response flyout.

* Remove leading new line in default script

* Remove registration of feature flag

* Fix types

* Restore previous auto-submit request behaviour

* Remove use of null and remove old comment

Stick with "undefined" as the designation for something not existing.

* [Painless Lab] NP migration (#59794)

* Fix sample document editor.

* [Painless Lab] Fix float -> integer coercion bug (#60201)

* Clarify data and persistence flow. Fix floating point precision bug.
* Send a string to API and ES client instead of an object.

* Rename helpers lib to format. Add tests for formatRequestPayload.

* Add query parameter to score context (#60414)

* Fix typo and i18n

* Make state init lazy

Otherwise we are needlessly reading and JSON.parse'ing on every
state update

* Support the query parameter in requests to Painless

* Fix borked i18n

* Fix i18n

* Another i18n issue

* [Painless] Minor state update model refactor (#60532)

* Fix typo and i18n

* Make state init lazy

Otherwise we are needlessly reading and JSON.parse'ing on every
state update

* Support the query parameter in requests to Painless

* WiP on state refactor

* Some cleanup after manual testing

* Fix types and i18n

* Fix i18n in context_tab

* i18n

* [Painless] Language Service (#60612)

* Added language service

* Use the correct monaco instance and add wordwise operations

* Remove plugin context initializer for now

* [Painless] Replace hard-coded links (#60603)

* Replace hard-coded links

Also remove all props from Main component

* Pass the new links object to the request flyout too

* Link directly to painless execute API's contexts

* Remove responsive stacking from tabs with icons in them.

* Resize Painless Lab bottom bar to accommodate nav drawer width (#60833)

* Validate Painless Lab index field (#60841)

* Make JSON format of parameters field more prominent. Set default parameters to provide an example to users.
* Set default document to provide an example to users.
* Simplify context's updateState interface.
* Refactor store and context file organization.
  - Remove common directory, move constants and types files to root.
  - Move initialState into context file, where it's being used.
* Add validation for index input.
* Create context directory.

* Fix bottom bar z-index.

* Position flyout help link so it's bottom-aligned with the title and farther from the close button.

Co-authored-by: Matthias Wilhelm <matthias.wilhelm@elastic.co>
Co-authored-by: Jean-Louis Leysens <jloleysens@gmail.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Alison Goryachev <alison.goryachev@elastic.co>

Co-authored-by: Matthias Wilhelm <matthias.wilhelm@elastic.co>
Co-authored-by: Jean-Louis Leysens <jloleysens@gmail.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Alison Goryachev <alison.goryachev@elastic.co>
2020-03-23 18:17:19 -07:00
..
elastic-datemath [7.x] Update moment related packages (#46849) (#49517) 2019-10-28 15:40:39 -07:00
eslint-config-kibana Update eslint related packages (#54107) (#54166) 2020-01-08 05:49:06 +01:00
kbn-analytics [Telemetry] Application Usage implemented in @kbn/analytics (#58401) (#58904) 2020-02-28 18:52:33 +00:00
kbn-babel-code-parser autofix all violations 2019-12-13 23:55:01 -07:00
kbn-babel-preset chore(NA): use the same polyfill between the dev environment and the jest env (#57467) (#57482) 2020-02-12 20:14:34 +00:00
kbn-config-schema [7.x] Enforce required presence for value/key validation of recordOf and mapOf. (#60491) 2020-03-18 14:06:59 +01:00
kbn-dev-utils Upgrade @types/node to match Node.js runtime (#60368) (#60509) 2020-03-19 10:17:33 +01:00
kbn-es [7.x] upgrade execa to get stdout/stderr in error messages (#6… (#60588) 2020-03-18 20:22:00 -07:00
kbn-eslint-import-resolver-kibana [7.x] build immutable bundles for new platform plugins (#53976) (#57528) 2020-02-14 11:35:24 -07:00
kbn-eslint-plugin-eslint Update eslint related packages (#54107) (#54166) 2020-01-08 05:49:06 +01:00
kbn-expect [kbn-expect] add optional error message (#48895) (#49438) 2019-10-26 13:01:08 -04:00
kbn-i18n Add @kbn/i18n to @kbn/ui-shared-deps (#55891) (#55929) 2020-01-25 02:58:53 +02:00
kbn-interpreter Move canvas to use NP Expressions service (#58387) (#59749) 2020-03-13 10:56:23 -04:00
kbn-optimizer Revert "[7.x][SIEM] apollo@3 (#51926)" (#59637) 2020-03-09 12:17:25 -07:00
kbn-plugin-generator [7.x] upgrade execa to get stdout/stderr in error messages (#6… (#60588) 2020-03-18 20:22:00 -07:00
kbn-plugin-helpers [7.x] upgrade execa to get stdout/stderr in error messages (#6… (#60588) 2020-03-18 20:22:00 -07:00
kbn-pm [Alerting] Adds navigation by consumer and alert type to alerting (#58997) (#60605) 2020-03-19 13:05:44 +00:00
kbn-spec-to-console [Console][Chore] Update spec (#54564) (#54773) 2020-01-14 21:00:33 +01:00
kbn-storybook [7.x] upgrade execa to get stdout/stderr in error messages (#6… (#60588) 2020-03-18 20:22:00 -07:00
kbn-test Upgrade @types/node to match Node.js runtime (#60368) (#60509) 2020-03-19 10:17:33 +01:00
kbn-test-subj-selector Update eslint related packages (#48513) (#48853) 2019-10-22 06:41:28 -07:00
kbn-ui-framework Updating to @elastic/lodash@3.10.1-kibana4 (#54662) (#58231) 2020-02-21 09:43:19 -08:00
kbn-ui-shared-deps Create Painless Lab app (#57538) (#61015) 2020-03-23 18:17:19 -07:00
kbn-utility-types [resubmit] Prep agg types for new platform (#58893) (#58922) 2020-02-28 15:31:18 -07:00
README.md [test] remove x-pack mocha configuration (#42979) 2019-08-15 12:22:22 -05: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 are two patterns used to test packages, one using Mocha and one using Jest. These patterns emerged out of convention and we'd like to make them more similar to each other in the near future.

1. Mocha

Today a package can follow the pattern of having a __tests__ directory in each source code directory of a package which contains the tests for that module. These are usually run by Mocha.

If a package's tests should be run with Mocha, you'll have to opt-in to run them by appending the package's test file pattern(s) to Kibana's src/dev/mocha/run_mocha_cli.js file. These will then be run by the unit test runner.

  • yarn test or yarn grunt test runs all unit tests.
  • node scripts/mocha runs all Mocha tests.

2. Jest

A package can also 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.
  • node scripts/jest runs all Jest tests in Kibana.

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.