-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Corey Robertson
committed
May 5, 2020
1 parent
4d19fe6
commit 4884d8d
Showing
31 changed files
with
715 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# OS | ||
.DS_Store | ||
|
||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (http://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules | ||
jspm_packages | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
target | ||
build | ||
.kibana-plugin-helpers.dev.json | ||
|
||
# JetBrains IDEs | ||
.idea | ||
*.iml | ||
|
||
# TEMPORARY: sass build output | ||
public/style/index.css | ||
|
||
# Don't commit built plugin files | ||
canvas_plugin/* | ||
|
||
# Don't commit the Webpack statistics | ||
webpack_stats.json | ||
|
||
# Don't commit storybook builds | ||
storybook |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"singleQuote": true, | ||
"semi": true, | ||
"printWidth": 100, | ||
"trailingComma": "es5" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"env": { | ||
"test": { | ||
"plugins": [ | ||
"require-context-hook" | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import '@storybook/addon-actions/register'; | ||
import '@storybook/addon-knobs/register'; | ||
import '@storybook/addon-console'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import React from 'react'; | ||
import { configure, addDecorator, addParameters } from '@storybook/react'; | ||
import { withKnobs } from '@storybook/addon-knobs/react'; | ||
import { withInfo } from '@storybook/addon-info'; | ||
import { create } from '@storybook/theming'; | ||
|
||
import { KibanaContextProvider } from '../../../../src/plugins/kibana_react/public'; | ||
|
||
// If we're running Storyshots, be sure to register the require context hook. | ||
// Otherwise, add the other decorators. | ||
if (process.env.NODE_ENV === 'test') { | ||
require('babel-plugin-require-context-hook/register')(); | ||
} else { | ||
// Customize the info for each story. | ||
addDecorator( | ||
withInfo({ | ||
inline: true, | ||
styles: { | ||
infoBody: { | ||
margin: 20, | ||
}, | ||
infoStory: { | ||
margin: '40px 60px', | ||
}, | ||
}, | ||
}) | ||
); | ||
|
||
// Add optional knobs to customize each story. | ||
addDecorator(withKnobs); | ||
} | ||
|
||
// Add New Platform Context for any stories that need it | ||
const settings = new Map(); | ||
settings.set('darkMode', true); | ||
const platform = { | ||
uiSettings: settings, | ||
}; | ||
addDecorator(fn => <KibanaContextProvider services={platform}>{fn()}</KibanaContextProvider>); | ||
|
||
function loadStories() { | ||
require('./dll_contexts'); | ||
|
||
// Only gather and require CSS files related to Canvas. The other CSS files | ||
// are built into the DLL. | ||
const css = require.context( | ||
'../../../../../built_assets/css', | ||
true, | ||
/plugins\/(?=canvas).*light\.css/ | ||
); | ||
css.keys().forEach(filename => css(filename)); | ||
|
||
// Find all files ending in *.examples.ts | ||
const req = require.context('./..', true, /.(stories|examples).tsx$/); | ||
req.keys().forEach(filename => req(filename)); | ||
} | ||
|
||
// Set up the Storybook environment with custom settings. | ||
addParameters({ | ||
options: { | ||
theme: create({ | ||
base: 'light', | ||
brandTitle: 'Canvas Storybook', | ||
brandUrl: 'https://github.com/elastic/kibana/tree/master/x-pack/plugins/canvas', | ||
}), | ||
showPanel: true, | ||
isFullscreen: false, | ||
panelPosition: 'bottom', | ||
isToolshown: true, | ||
}, | ||
}); | ||
|
||
configure(loadStories, module); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
const path = require('path'); | ||
|
||
const DLL_NAME = 'canvas_storybook_dll'; | ||
const KIBANA_ROOT = path.resolve(__dirname, '../../../../..'); | ||
const BUILT_ASSETS = path.resolve(KIBANA_ROOT, 'built_assets'); | ||
const DLL_OUTPUT = path.resolve(BUILT_ASSETS, DLL_NAME); | ||
|
||
module.exports = { | ||
DLL_NAME, | ||
KIBANA_ROOT, | ||
BUILT_ASSETS, | ||
DLL_OUTPUT, | ||
}; |
Oops, something went wrong.