Skip to content

Commit

Permalink
[Rename] kbn-storybook in packages directory to osd-storybook (#60)
Browse files Browse the repository at this point in the history
* [Rename] kbn-storybook in packages directory to osd-storybook

Signed-off-by: Mihir Soni <[email protected]>

* [Rename] in-corporate review comments

Signed-off-by: Mihir Soni <[email protected]>
  • Loading branch information
mihirsoni authored Mar 5, 2021
1 parent 25f6c1f commit 23f22e3
Show file tree
Hide file tree
Showing 13 changed files with 24 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This package provides ability to add [Storybook](https://storybook.js.org/) to any Kibana plugin.

- [Kibana Storybook](#kibana-storybook)
- [Kibana Storybook](#opensearch-dashboards-storybook)
- [Setup Instructions](#setup-instructions)
- [Customizing configuration](#customizing-configuration)

Expand All @@ -12,7 +12,7 @@ This package provides ability to add [Storybook](https://storybook.js.org/) to a
`src/plugins/<plugin>/.storybook/main.js`, with the following contents:

```js
module.exports = require('@kbn/storybook').defaultConfig;
module.exports = require('@osd/storybook').defaultConfig;
```

- Add your plugin alias to `src/dev/storybook/aliases.ts` config.
Expand All @@ -37,5 +37,5 @@ This package provides ability to add [Storybook](https://storybook.js.org/) to a

## Customizing configuration

The `defaultConfig` object provided by the @kbn/storybook package should be all you need to get running, but you can
The `defaultConfig` object provided by the @osd/storybook package should be all you need to get running, but you can
override this in your .storybook/main.js. Using [Storybook's configuration options](https://storybook.js.org/docs/react/configure/overview).
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

import { resolve } from 'path';
import { REPO_ROOT as KIBANA_ROOT } from '@kbn/dev-utils';
import { REPO_ROOT as OPENSEARCH_DASHBOARDS_ROOT } from '@osd/dev-utils';

export const REPO_ROOT = KIBANA_ROOT;
export const ASSET_DIR = resolve(KIBANA_ROOT, 'built_assets/storybook');
export const REPO_ROOT = OPENSEARCH_DASHBOARDS_ROOT;
export const ASSET_DIR = resolve(OPENSEARCH_DASHBOARDS_ROOT, 'built_assets/storybook');
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import { StorybookConfig } from '@storybook/core/types';

export const defaultConfig: StorybookConfig = {
addons: ['@kbn/storybook/preset', '@storybook/addon-knobs', '@storybook/addon-essentials'],
addons: ['@osd/storybook/preset', '@storybook/addon-knobs', '@storybook/addon-essentials'],
stories: ['../**/*.stories.tsx'],
typescript: {
reactDocgen: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import { create } from '@storybook/theming';
addons.setConfig({
theme: create({
base: 'light',
brandTitle: 'Kibana Storybook',
brandUrl: 'https://github.com/elastic/kibana/tree/master/packages/kbn-storybook',
brandTitle: 'OpenSearch Dashboards Storybook',
brandUrl: 'https://github.com/elastic/kibana/tree/master/packages/osd-storybook',
}),
showPanel: false,
isFullscreen: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
import { join } from 'path';
import { logger } from '@storybook/node-logger';
import buildStandalone from '@storybook/react/standalone';
import { Flags, run } from '@kbn/dev-utils';
import { distDir } from '@kbn/ui-shared-deps';
import { Flags, run } from '@osd/dev-utils';
import { distDir } from '@osd/ui-shared-deps';
import * as constants from './constants';

// Convert the flags to a Storybook loglevel
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<!-- This is a copy of the
[Storybook IFrame template](https://github.com/storybookjs/storybook/blob/7874ca357c6cb54f3f258dc61f6becae6783fba6/lib/core/src/server/templates/index.ejs).
We use this one instead because we want to add the @kbn/ui-shared-deps tags here.
We use this one instead because we want to add the @osd/ui-shared-deps tags here.
-->
<html lang="en">
<head>
Expand All @@ -16,12 +16,12 @@

<!-- Added for Kibana shared dependencies -->
<script>
window.__kbnPublicPath__ = { 'kbn-ui-shared-deps': '/' };
window.__osdPublicPath__ = { 'osd-ui-shared-deps': '/' };
</script>
<script src="/kbn-ui-shared-deps.@elastic.js"></script>
<script src="/kbn-ui-shared-deps.js"></script>
<link href="/kbn-ui-shared-deps.css" rel="stylesheet" />
<link href="/kbn-ui-shared-deps.v7.light.css" rel="stylesheet" />
<script src="/osd-ui-shared-deps.@opensearch.js"></script>
<script src="/osd-ui-shared-deps.js"></script>
<link href="/osd-ui-shared-deps.css" rel="stylesheet" />
<link href="/osd-ui-shared-deps.v7.light.css" rel="stylesheet" />
<!-- -->

<% if (typeof headHtmlSnippet !== 'undefined') { %> <%= headHtmlSnippet %> <% } %> <%
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "@kbn/storybook",
"name": "@osd/storybook",
"version": "1.0.0",
"private": true,
"license": "Apache-2.0",
"main": "./target/index.js",
"kibana": {
"opensearchDashboards": {
"devOnly": true
},
"dependencies": {
"@kbn/dev-utils": "1.0.0",
"@osd/dev-utils": "1.0.0",
"@storybook/addon-actions": "^6.0.16",
"@storybook/addon-essentials": "^6.0.16",
"@storybook/addon-knobs": "^6.0.16",
Expand All @@ -20,7 +20,7 @@
"@types/webpack": "^4.41.3",
"@types/webpack-env": "^1.15.2",
"@types/webpack-merge": "^4.1.5",
"@kbn/utils": "1.0.0",
"@osd/utils": "1.0.0",
"babel-loader": "^8.0.6",
"copy-webpack-plugin": "^6.0.2",
"fast-glob": "2.2.7",
Expand All @@ -38,7 +38,7 @@
},
"scripts": {
"build": "tsc",
"kbn:bootstrap": "yarn build",
"osd:bootstrap": "yarn build",
"watch": "yarn build --watch"
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { resolve } from 'path';
import { stringifyRequest } from 'loader-utils';
import { Configuration, Stats } from 'webpack';
import webpackMerge from 'webpack-merge';
import { externals } from '@kbn/ui-shared-deps';
import { externals } from '@osd/ui-shared-deps';
import { REPO_ROOT } from './lib/constants';

const stats = {
Expand Down Expand Up @@ -59,7 +59,7 @@ export default function ({ config: storybookConfig }: { config: Configuration })
loader: 'postcss-loader',
options: {
config: {
path: require.resolve('@kbn/optimizer/postcss.config.js'),
path: require.resolve('@osd/optimizer/postcss.config.js'),
},
},
},
Expand Down
File renamed without changes.

0 comments on commit 23f22e3

Please sign in to comment.