Skip to content

Commit

Permalink
feat: 🎸 address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
streamich committed Jan 14, 2020
1 parent 1b2d995 commit eef1fc0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
5 changes: 3 additions & 2 deletions src/dev/storybook/commands/clean.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@
*/

import { ToolingLog } from '@kbn/dev-utils';
import { REPO_ROOT } from '@kbn/dev-utils';
import { join } from 'path';
import del from 'del';

export const clean = async ({ log, rootDir }: { log: ToolingLog; rootDir: string }) => {
export const clean = async ({ log }: { log: ToolingLog }) => {
log.info('Cleaning Storybook build folder');

const dir = join(rootDir, 'built_assets', 'storybook');
const dir = join(REPO_ROOT, 'built_assets', 'storybook');
log.info('Deleting folder:', dir);
await del([join(dir, '*')]);
await del([dir]);
Expand Down
11 changes: 5 additions & 6 deletions src/dev/storybook/run_storybook_cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@

import { join } from 'path';
import { run, createFlagError } from '@kbn/dev-utils';
import { REPO_ROOT } from '@kbn/dev-utils';
import { storybookAliases } from './aliases';
import { clean } from './commands/clean';

const rootDir = join(__dirname, '..', '..', '..');

run(
async params => {
const { flags, log } = params;
Expand All @@ -32,11 +31,11 @@ run(
} = flags;

if (flags.verbose) {
log.info('Flags:', flags);
log.verbose('Flags:', flags);
}

if (flags.clean) {
await clean({ log, rootDir });
await clean({ log });
return;
}

Expand All @@ -49,9 +48,9 @@ run(
}

const relative = (storybookAliases as any)[alias];
const absolute = join(rootDir, relative);
const absolute = join(REPO_ROOT, relative);

log.info('Loading Storybook:', absolute);
log.verbose('Loading Storybook:', absolute);
process.chdir(join(absolute, '..', '..'));
require(absolute);
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export const ColorManager: FunctionComponent<Props> = ({
<EuiFieldText
value={value}
isInvalid={!validColor && value.length > 0}
placeholder={'strings.getCodePlaceholder()'}
placeholder={strings.getCodePlaceholder()}
onChange={e => onChange(e.target.value)}
/>
</EuiFlexItem>
Expand Down

0 comments on commit eef1fc0

Please sign in to comment.