Skip to content

Commit af4af3f

Browse files
authored
Merge pull request #5570 from sulmoJ/develop
feat(web-storybook): create storybook setup & refactor for separation of concerns
2 parents ee3d116 + d5a30fa commit af4af3f

File tree

78 files changed

+2848
-4560
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+2848
-4560
lines changed

.dockerignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ deploy
1818
# Output
1919
out
2020
**/dist
21-
apps/storybook/.out
21+
apps/mirinae-storybook/.out
22+
apps/web-storybook/.out
2223
packages/mirinae/css
2324
packages/mirinae/types
2425

@@ -55,4 +56,4 @@ VERSION
5556
.idea
5657
*.swp
5758
*.bak
58-
**/.DS_Store
59+
**/.DS_Store

apps/storybook/.storybook/CloudforetTheme.js renamed to apps/mirinae-storybook/.storybook/CloudforetTheme.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
import { create } from '@storybook/theming/create';
2-
3-
export default create({
1+
export default {
42
base: 'light',
53
colorPrimary: '#6638B6',
64
colorSecondary: 'rgba(102, 56, 182, 0.9)',
@@ -29,4 +27,4 @@ export default create({
2927
brandTitle: 'Mirinae Design System',
3028
brandUrl: 'https://github.com/cloudforet-io/mirinae',
3129
brandImage: './images/SpaceONE_logoTypeA.svg',
32-
});
30+
};
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import type { StorybookConfig } from "@storybook/vue-vite";
2+
import { mainConfig } from "storybook-config-custom";
3+
4+
/** @type { import('@storybook/vue-vite').StorybookConfig } */
5+
const config: StorybookConfig = {
6+
...mainConfig,
7+
stories: [
8+
'../../../packages/mirinae/src/**/*.mdx',
9+
'../../../packages/mirinae/src/**/*.stories.@(js|jsx|ts|tsx)',
10+
],
11+
};
12+
13+
export default config;
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
import CloudforetThemeVar from './CloudforetTheme';
3+
import { setConfig } from 'storybook-config-custom';
4+
5+
// window.STORYBOOK_GA_ID = 'UA-159327743-4';
6+
7+
setConfig({
8+
theme: CloudforetThemeVar,
9+
})

apps/storybook/.storybook/preview.js renamed to apps/mirinae-storybook/.storybook/preview.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@ import VueRouter from 'vue-router';
1212
import SvgIcon from 'vue-svgicon';
1313
import webFontLoader from 'webfontloader';
1414

15-
import screens from '@/styles/screens.cjs';
16-
import { fontUrls, webFonts } from '@/styles/web-fonts.cjs';
15+
import screens from 'mirinae-foundation/screens.cjs';
1716

18-
import SpaceOneTheme from './CloudforetTheme';
17+
import { fontUrls, webFonts } from 'mirinae-foundation/web-fonts.cjs';
18+
19+
import CloudforetTheme from './CloudforetTheme';
20+
import { createTheme } from 'storybook-config-custom';
1921

2022
Vue.use(VueRouter);
2123
Vue.use(VueI18n);
@@ -63,7 +65,7 @@ const preview = {
6365
}
6466
return null;
6567
},
66-
theme: SpaceOneTheme,
68+
theme: createTheme(CloudforetTheme),
6769
},
6870
viewport: {
6971
viewports,
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "mirinae-storybook",
3+
"version": "1.0.0",
4+
"description": "",
5+
"main": "index.js",
6+
"scripts": {
7+
"dev": "storybook dev -p 6006",
8+
"build": "storybook build"
9+
},
10+
"keywords": [],
11+
"author": "",
12+
"license": "ISC",
13+
"devDependencies": {
14+
"eslint-config-custom": "*",
15+
"mirinae-foundation": "*",
16+
"postcss-config-custom": "*",
17+
"storybook-config-custom": "*",
18+
"tsconfig": "*"
19+
}
20+
}

0 commit comments

Comments
 (0)