Skip to content

Commit

Permalink
[pre-req] Move .storybook to storybook; standardize files (#72384)
Browse files Browse the repository at this point in the history
  • Loading branch information
clintandrewhall authored Jul 21, 2020
1 parent 990d4c5 commit bfbb8d2
Show file tree
Hide file tree
Showing 71 changed files with 136 additions and 938 deletions.
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ target
/x-pack/plugins/canvas/canvas_plugin
/x-pack/plugins/canvas/canvas_plugin_src/lib/flot-charts
/x-pack/plugins/canvas/shareable_runtime/build
/x-pack/plugins/canvas/storybook
/x-pack/plugins/canvas/storybook/build
/x-pack/plugins/monitoring/public/lib/jquery_flot
/x-pack/plugins/reporting/server/export_types/printable_pdf/server/lib/pdf/assets/**
/x-pack/legacy/plugins/infra/common/graphql/types.ts
Expand Down
6 changes: 6 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -1222,6 +1222,12 @@ module.exports = {
],
},
},
{
files: ['x-pack/plugins/canvas/storybook/**'],
rules: {
'import/no-extraneous-dependencies': 0,
},
},
{
files: ['x-pack/plugins/canvas/canvas_plugin_src/**/*.js'],
globals: { canvas: true, $: true },
Expand Down
2 changes: 1 addition & 1 deletion src/dev/precommit_hook/casing_check_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const IGNORE_FILE_GLOBS = [
'.ci/pipeline-library/**/*',

// Files in this directory must match a pre-determined name in some cases.
'x-pack/plugins/canvas/.storybook/*',
'x-pack/plugins/canvas/storybook/*',

// filename must match language code which requires capital letters
'**/translations/*.json',
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/canvas/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ canvas_plugin/*
webpack_stats.json

# Don't commit storybook builds
storybook
storybook/build

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

import { action } from '@storybook/addon-actions';
import { boolean, withKnobs } from '@storybook/addon-knobs';
import { boolean } from '@storybook/addon-knobs';
import { storiesOf } from '@storybook/react';
import React from 'react';
import { ColorPicker } from '../color_picker';
Expand Down Expand Up @@ -54,7 +54,6 @@ class Interactive extends React.Component<
}

storiesOf('components/Color/ColorPicker', module)
.addDecorator(withKnobs)
.addParameters({
info: {
inline: true,
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import { action } from '@storybook/addon-actions';
import { storiesOf } from '@storybook/react';
import { withKnobs, array, radios, boolean } from '@storybook/addon-knobs';
import { array, radios, boolean } from '@storybook/addon-knobs';
import React from 'react';

import { ExtendedTemplate } from '../extended_template';
Expand Down Expand Up @@ -64,7 +64,6 @@ storiesOf('arguments/SeriesStyle', module)
.addDecorator((story) => (
<div style={{ width: '323px', padding: '16px', background: '#fff' }}>{story()}</div>
))
.addDecorator(withKnobs)
.add('extended', () => <Interactive />);

storiesOf('arguments/SeriesStyle/components', module)
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/canvas/scripts/jest.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ run(
if (all) {
log.info('Running all available tests. This will take a while...');
} else if (storybook) {
path = 'plugins/canvas/.storybook';
path = 'plugins/canvas/storybook';
log.info('Running Storybook Snapshot tests...');
} else {
log.info('Running tests. This does not include Storybook Snapshots...');
Expand Down
6 changes: 3 additions & 3 deletions x-pack/plugins/canvas/scripts/storybook.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ const del = require('del');
const { run } = require('@kbn/dev-utils');
const storybook = require('@storybook/react/standalone');
const execa = require('execa');
const { DLL_OUTPUT } = require('./../.storybook/constants');
const { DLL_OUTPUT } = require('./../storybook/constants');

const options = {
stdio: ['ignore', 'inherit', 'inherit'],
buffer: false,
};

const storybookOptions = {
configDir: path.resolve(__dirname, './../.storybook'),
configDir: path.resolve(__dirname, './../storybook'),
mode: 'dev',
};

Expand Down Expand Up @@ -51,7 +51,7 @@ run(
[
'webpack',
'--config',
'x-pack/plugins/canvas/.storybook/webpack.dll.config.js',
'x-pack/plugins/canvas/storybook/webpack.dll.config.js',
'--progress',
'--hide-modules',
'--display-entrypoints',
Expand Down
Loading

0 comments on commit bfbb8d2

Please sign in to comment.