Skip to content

Commit 8625e6e

Browse files
authored
Merge pull request trungvose#78 from trungk18/feature/storybook
Feature/storybook
2 parents b41a67b + b1317a1 commit 8625e6e

File tree

16 files changed

+24747
-7124
lines changed

16 files changed

+24747
-7124
lines changed

frontend/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,5 @@ testem.log
4444
# System Files
4545
.DS_Store
4646
Thumbs.db
47+
48+
storybook-static

frontend/.storybook/main.js

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
module.exports = {
2+
"stories": [
3+
"../src/**/*.stories.mdx",
4+
"../src/**/*.stories.@(js|jsx|ts|tsx)"
5+
],
6+
"addons": [
7+
"@storybook/addon-links",
8+
"@storybook/addon-essentials",
9+
"@storybook/addon-google-analytics"
10+
],
11+
webpackFinal: async (config, { configType }) => {
12+
// `configType` has a value of 'DEVELOPMENT' or 'PRODUCTION'
13+
// You can change the configuration based on that.
14+
// 'PRODUCTION' is used when building the static version of storybook.
15+
16+
// Make whatever fine-grained changes you need
17+
config.module.rules.push({
18+
test: /\.scss$/,
19+
use: [
20+
{
21+
loader: 'postcss-loader',
22+
options: {
23+
ident: 'postcss',
24+
syntax: 'postcss-scss',
25+
plugins: () => [
26+
require('postcss-import'),
27+
require('tailwindcss'),
28+
require('autoprefixer')
29+
]
30+
}
31+
},
32+
{
33+
loader: 'sass-loader'
34+
}
35+
]
36+
});
37+
38+
// Return the altered config
39+
return config;
40+
},
41+
}

frontend/.storybook/preview.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
import { setCompodocJson } from "@storybook/addon-docs/angular";
3+
import docJson from "../documentation.json";
4+
setCompodocJson(docJson);
5+
import "../src/styles.scss";
6+
7+
8+
export const parameters = {
9+
actions: { argTypesRegex: "^on[A-Z].*" },
10+
controls: { expanded: true }
11+
}

frontend/.storybook/tsconfig.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"extends": "../tsconfig.app.json",
3+
"compilerOptions": {
4+
"types": [
5+
"node"
6+
]
7+
},
8+
"exclude": [
9+
"../src/test.ts",
10+
"../src/**/*.spec.ts",
11+
"../projects/**/*.spec.ts"
12+
],
13+
"include": [
14+
"../src/**/*",
15+
"../projects/**/*"
16+
],
17+
"files": [
18+
"./typings.d.ts"
19+
]
20+
}

frontend/.storybook/typings.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
declare module '*.md' {
2+
const content: string;
3+
export default content;
4+
}

0 commit comments

Comments
 (0)