Skip to content

Commit f1840f0

Browse files
author
Razvan Puscasu
committed
- add storybook support
1 parent 651cdea commit f1840f0

File tree

7 files changed

+57
-7
lines changed

7 files changed

+57
-7
lines changed

.storybook/config.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import moment from 'moment';
2+
import { configure, addDecorator, setAddon } from '@kadira/storybook';
3+
//import infoAddon from '@kadira/react-storybook-addon-info';
4+
5+
addDecorator((story) => {
6+
moment.locale('en');
7+
return (story());
8+
});
9+
10+
function loadStories() {
11+
require('../basis/views/stories/button');
12+
}
13+
14+
//setAddon(infoAddon);
15+
16+
configure(loadStories, module);

.storybook/webpack.config.js

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
const path = require('path');
2+
3+
console.log('XXXXX');
4+
module.exports = {
5+
context: path.join(__dirname, '../basis'),
6+
resolve: {
7+
root: [path.join(__dirname, 'basis')],
8+
extensions: ['', '.js', '.jsx', '.es6', '.scss'],
9+
modulesDirectories: [
10+
'basis',
11+
'node_modules',
12+
],
13+
},
14+
module: {
15+
loaders: [
16+
{
17+
test: /\.js$|.jsx$/,
18+
loader: 'babel',
19+
exclude: /node_modules/,
20+
query: {
21+
presets: ['es2015', 'stage-1', 'react'],
22+
plugins: [
23+
"transform-runtime",
24+
"babel-plugin-add-module-exports",
25+
'babel-plugin-transform-decorators-legacy',
26+
]
27+
},
28+
},
29+
{
30+
test: /\.(scss|css)$/,
31+
loader: 'style-loader!css-loader!autoprefixer-loader?browsers=last 2 version!sass-loader?outputStyle=expanded&' +
32+
'includePaths[]=' + path.resolve(__dirname, '/basis/styles') + '&' +
33+
'&includePaths[]=' + path.resolve(__dirname, 'node_modules', 'basis'),
34+
}
35+
]
36+
}
37+
};

basis/views/components/icons/icons.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { Component } from 'react';
22

3-
export default class Icons extends Component {
3+
class Icons extends Component {
44
render() {
55
const style = {
66
display: 'none',

dist/mylocal-components.css renamed to dist/components.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
File renamed without changes.

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
var mylocalComponents = require('./dist/mylocal-components');
1+
var components = require('./dist/components');
22

3-
module.exports = mylocalComponents;
3+
module.exports = components;

package.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,6 @@
6666
"eslint-plugin-react": "^3.13.1",
6767
"expose-loader": "^0.7.1",
6868
"extract-text-webpack-plugin": "^0.8.2",
69-
"gulp": "^3.9.0",
70-
"gulp-html-replace": "^1.5.1",
71-
"gulp-rename": "^1.2.2",
7269
"image-webpack-loader": "^1.6.1",
7370
"imagemin": "^3.2.0",
7471
"jsdom": "^6.5.1",

0 commit comments

Comments
 (0)