kibana/packages
Josh Dover 306d06c0e9
[6.x] Upgrade Hapi in legacy platform to v17 (#21707) (#24608)
* Upgrade Hapi in legacy platform to v17 (#21707)

* Disable even-better monitoring

* Upgrade to Hapi v15

* Upgrade to Hapi v16

* Handle optional req params correctly

* Update http and kbnServer

* Get mocha tests passing

* Convert `reply` usages [wip]

* Fix Joi and Plugin incompatibilities

* Get server up and running

* Get basic logging working

* Fix optimizer

* Fix recent route handlers

* Various fixes

* Fix recent routes

* Upgrade wreck for async/await

* Fix mocha tests

* Fix joi issues

* Fix xpack jest tests

* Fix recent routes

* Fix tests

* Fix index setup

* Decouple monitoring stats collection from good plugin

* Update reload logging test to work

* Reimplement logging with updated good plugin

* Fix unit tests

* Fix getConnections back

* Make LegacyLoggingServer compatible with Hapi v17

* Update joi types

* Fix x-pack unit tests

* Remove stray debugger

* Remove hapi-compat

* Fix API integrations

* Upgrade boom

* Fix security plugin

* Misc fixes

* bump

* Fix licensePreRoutingFactory

* Fix failing integration tests

* Remove unnecessary test change

* Remove hapi-latest package

* fx

* Various cleanup

* Fix race condition in oppsy events

* Use elastic/good fork

* Fix boom.wrap and hapi-latest changes

* Simplify LegacyLoggingServer updates

* package.json cleanup + test fix

* yarn.lock cleanup

* Change good tag

* Fixes

* Change return err -> throw err in routes

* Fix await returns

* Fix new load_data test

* Make cookie security flags consistent

* tmp doc

* Fix types

* Fix tests

* Upgrade canvas plugin

* Move good package to published @elastic/good one

* Fix SO test

* Fix logging reloading

* Update APM apis

* Fix error logging

* Fix logging test

* Convert spaces plugin

* Add validation error shim

* Remove 7.0 release notes

* Await renderApp

* Fix ccr routes

* Prevent header popovers from scrolling with page content (#23850)

* Fix spaces test

* new yarn.lock-s

* Fix spaces tests

* Remove h2o2-latest

* Fix @types/hapi

* Upgrade InfraOps plugin

* Fix package.json

* Add back isSameSite: false

* Upgrade beats_management plugin

* Update snapshot

* Fix InfraOps

* Upgrade kql_telemetry

* Merge upstream/master

* Upgrade apm and ml

* Put snapshot test back

* Fx beats

* Upgrade rollups

* Update boom usages in new plugins

* Update url shortener

* Don't throw errors in optimizer (#24660)
2018-10-26 16:37:05 -05:00
..
eslint-config-kibana Upgrade eslint/tslint/prettier plugin versions. (#23562) 2018-09-27 14:17:45 +02:00
eslint-plugin-kibana-custom [packages] add licenses (#17072) 2018-03-12 12:40:15 -05:00
kbn-babel-preset [6.x] [yarn] Upgrade to 1.10.1 (#23971) (#24054) 2018-10-15 18:20:26 -07:00
kbn-config-schema [6.x] Upgrade Hapi in legacy platform to v17 (#21707) (#24608) 2018-10-26 16:37:05 -05:00
kbn-datemath Introduce date histogram time base configuration to EditorConfig (#22344) (#24555) 2018-10-24 18:06:10 -07:00
kbn-dev-utils Handle exit code of 1 when terminating Kibana process on windows (#24151) (#24357) 2018-10-23 09:24:05 -06:00
kbn-es [6.x] Initial handling of windows process termination (#23441) (#24359) 2018-10-23 09:23:40 -06:00
kbn-eslint-import-resolver-kibana [6.x] [yarn] Upgrade to 1.10.1 (#23971) (#24054) 2018-10-15 18:20:26 -07:00
kbn-eslint-plugin-license-header [6.x] [yarn] Upgrade to 1.10.1 (#23971) (#24054) 2018-10-15 18:20:26 -07:00
kbn-i18n [Tools] Add "values" property validation (#22538) (#24573) 2018-10-25 16:36:33 +03:00
kbn-plugin-generator [6.x] Upgrade Hapi in legacy platform to v17 (#21707) (#24608) 2018-10-26 16:37:05 -05:00
kbn-plugin-helpers [6.x] [yarn] Upgrade to 1.10.1 (#23971) (#24054) 2018-10-15 18:20:26 -07:00
kbn-pm [kbn-pm] update kbn-pm build 2018-10-26 07:57:57 -07:00
kbn-system-loader [6.x] [yarn] Upgrade to 1.10.1 (#23971) (#24054) 2018-10-15 18:20:26 -07:00
kbn-test Update rmrfSync method (#23854) (#24351) 2018-10-22 16:57:58 -06:00
kbn-test-subj-selector [6.x] [yarn] Upgrade to 1.10.1 (#23971) (#24054) 2018-10-15 18:20:26 -07:00
kbn-ui-framework Introduce query bar update button with dirty checking (#24529) (#24545) 2018-10-24 18:08:49 -04:00
README.md [6.x] [mocha] remove grunt-simple-mocha (#19079) (#19139) 2018-05-16 16:25:59 -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 link: dependencies in Yarn, which sets up a symlink to the package.

For example if you want to use the @kbn/datemath package in Kibana itself, you can specify the dependency like this:

"@kbn/datemath": "link:packages/kbn-datemath"

However, if you want to use this from a Kibana plugin, you need to account for the relative location of the Kibana repo, so it would instead be:

"@kbn/datemath": "link:../../kibana/packages/kbn-datemath"

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/datemath the folder name should be kbn-datemath.

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 tasks/config/simplemocha.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.