mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
Remove CI Composite Storybook (#171258)
## Summary Closes #160803 This PR removes the `CI Composite` story because it has been broken since at leastac23dce29f
(and possibly sinceb862a6c181
). The functionality is covered by the generated `index.html` indda4498fee/.buildkite/scripts/steps/storybooks/build_and_upload.ts (L105-L120)
To fix the composite story requires generating `stories.json` for every storybook, which requires migrating the repo off the deprecated `storiesOf` API. That task is quite extensive and would be better handled alongside an upgrade to Storybook 7.x
This commit is contained in:
parent
043f050187
commit
1919c87b90
3 changed files with 1 additions and 41 deletions
|
@ -16,7 +16,6 @@ const STORYBOOKS = [
|
|||
'canvas',
|
||||
'cases',
|
||||
'cell_actions',
|
||||
'ci_composite',
|
||||
'cloud_chat',
|
||||
'coloring',
|
||||
'chart_icons',
|
||||
|
@ -93,14 +92,12 @@ const upload = () => {
|
|||
console.log('--- Generating Storybooks HTML');
|
||||
|
||||
process.chdir(path.join('.', 'built_assets', 'storybook'));
|
||||
fs.renameSync('ci_composite', 'composite');
|
||||
|
||||
const storybooks = execSync(`ls -1d */`)
|
||||
.toString()
|
||||
.trim()
|
||||
.split('\n')
|
||||
.map((filePath) => filePath.replace('/', ''))
|
||||
.filter((filePath) => filePath !== 'composite');
|
||||
.map((filePath) => filePath.replace('/', ''));
|
||||
|
||||
const listHtml = storybooks
|
||||
.map((storybook) => `<li><a href="${STORYBOOK_BASE_URL}/${storybook}">${storybook}</a></li>`)
|
||||
|
@ -110,8 +107,6 @@ const upload = () => {
|
|||
<html>
|
||||
<body>
|
||||
<h1>Storybooks</h1>
|
||||
<p><a href="${STORYBOOK_BASE_URL}/composite">Composite Storybook</a></p>
|
||||
<h2>All</h2>
|
||||
<ul>
|
||||
${listHtml}
|
||||
</ul>
|
||||
|
|
|
@ -1,34 +0,0 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License
|
||||
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
||||
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
||||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
const config = require('@kbn/storybook').defaultConfig;
|
||||
const aliases = require('../../src/dev/storybook/aliases').storybookAliases;
|
||||
|
||||
config.refs = {};
|
||||
|
||||
// Required due to https://github.com/storybookjs/storybook/issues/13834
|
||||
config.babel = async (options) => ({
|
||||
...options,
|
||||
plugins: ['@babel/plugin-transform-typescript', ...options.plugins],
|
||||
});
|
||||
|
||||
for (const alias of Object.keys(aliases).filter((a) => a !== 'ci_composite')) {
|
||||
// snake_case -> Title Case
|
||||
const title = alias
|
||||
.replace(/_/g, ' ')
|
||||
.split(' ')
|
||||
.map((n) => n[0].toUpperCase() + n.slice(1))
|
||||
.join(' ');
|
||||
|
||||
config.refs[alias] = {
|
||||
title: title,
|
||||
url: `${process.env.STORYBOOK_BASE_URL}/${alias}`,
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = config;
|
|
@ -15,7 +15,6 @@ export const storybookAliases = {
|
|||
canvas: 'x-pack/plugins/canvas/storybook',
|
||||
cases: 'packages/kbn-cases-components/.storybook',
|
||||
cell_actions: 'packages/kbn-cell-actions/.storybook',
|
||||
ci_composite: '.ci/.storybook',
|
||||
cloud_chat: 'x-pack/plugins/cloud_integrations/cloud_chat/.storybook',
|
||||
coloring: 'packages/kbn-coloring/.storybook',
|
||||
language_documentation_popover: 'packages/kbn-language-documentation-popover/.storybook',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue