kibana/x-pack/plugins/observability
Nathan L Smith 564a7b1a17
Storybook 6 and config changes (#75357)
Upgrade to Storybook 6 and attempt to use the declarative configuration.

The goals of this PR (as part of Kibana's Storybook roadmap, are:

Upgrade to Storybook 6
Still allow running Storybooks with yarn storybook plugin_name
Use the declarative configuration to (hopefully) make the configuration simpler to use an easier to understand, as well as avoiding deprecation warnings and loss of future compatibility
The ways in which what I have so far differs from how we do things today are:

In the alias configuration it takes a path to a storybook configuration directory instead of the storybook.js file from before
Each plugin (it doesn't have to be a plugin; can be any directory) has a .storybook/main.js (the aliases file in @kbn/storybook specifies these locations) where they can define their Storybook configuration. You can require('@kbn/storybook').defaultConfig to get defaults and override them
@kbn/storybook has a preset that can provide Webpack and Babel configuration and Storybook parameters and decorators
Instead of dynamically creating the list of stories to import, we define them in the globs of the stories property in .storybook/main.js.
Do not build a DLL. We are using @kbn/ui-shared-deps as externals. Startup time is not quite as fast but still acceptable.
Other things done in this PR:

Allow default exports in .stories. to allow for Common Story Format CSF stories
Add guard in Webpack configuration needed for overriding CSS rules
Update filename casing check to allow for files with required names in Storybook
Clean up observability stories
Rename *.examples.tsx and *.story.tsx to *.stories.tsx
2020-09-29 19:34:05 -05:00
..
.storybook Storybook 6 and config changes (#75357) 2020-09-29 19:34:05 -05:00
common [APM] Annotations API (#64796) 2020-05-05 19:49:39 +02:00
public Storybook 6 and config changes (#75357) 2020-09-29 19:34:05 -05:00
scripts Observability overview page (#69141) 2020-07-08 21:52:16 +02:00
server Move and rename legacy elasticsearch client (#69797) 2020-06-29 17:43:31 +02:00
typings [Monitoring] Usage collection (#75878) 2020-09-25 10:19:53 -04:00
jest.config.js Add Jest configuration and README to observability plugin (#70340) 2020-06-30 14:03:05 -05:00
kibana.json [Observability] Collect UI telemetry (#78258) 2020-09-23 15:44:40 +02:00
README.md Add Jest configuration and README to observability plugin (#70340) 2020-06-30 14:03:05 -05:00

Observability plugin

This plugin provides shared components and services for use across observability solutions, as well as the observability landing page UI.

Unit testing

Note: Run the following commands from kibana/x-pack/plugins/observability.

Run unit tests

npx jest --watch

Update snapshots

npx jest --updateSnapshot

Coverage

HTML coverage report can be found in target/coverage/jest after tests have run.

open target/coverage/jest/index.html