Skip to content

Commit

Permalink
Merge 29b6710 into f62a078
Browse files Browse the repository at this point in the history
  • Loading branch information
jbadan committed Oct 1, 2019
2 parents f62a078 + 29b6710 commit 38f9fc0
Show file tree
Hide file tree
Showing 183 changed files with 6,805 additions and 649 deletions.
2 changes: 1 addition & 1 deletion .size-limit
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
name: "Fundamental-React Size",
webpack: true,
path: "lib/index.js",
limit: "175 KB"
limit: "150 KB"
}
]
4 changes: 4 additions & 0 deletions .storybook/addons.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import '@storybook/addon-knobs/register';
import '@storybook/addon-a11y/register';
import '@storybook/addon-storysource/register';
import '@storybook/addon-notes/register';
11 changes: 11 additions & 0 deletions .storybook/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { addDecorator, configure } from '@storybook/react';
import { withA11y } from '@storybook/addon-a11y';

addDecorator(withA11y);

function loadStories() {
const req = require.context('../src', true, /\.stories\.js$/);
req.keys().forEach(filename => req(filename));
}

configure(loadStories, module);
10 changes: 10 additions & 0 deletions .storybook/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const path = require('path');

module.exports = function({ config }) {
config.module.rules.push({
test: /\.stories\.js?$/,
loaders: [require.resolve('@storybook/source-loader')],
enforce: 'pre',
});
return config;
};
3 changes: 2 additions & 1 deletion config/webpack.config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,8 @@ module.exports = {
]
},
plugins: [
// Generates an `index.html` file with the <script> injected.
new webpack.IgnorePlugin(/src\/utils\/withStyles\/customStylesTest.css/),
// Generates an `index.html` file with the <script> injected.
new HtmlWebpackPlugin({
inject: true,
template: paths.appHtml,
Expand Down
8 changes: 7 additions & 1 deletion devtools/buildIndexFiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,13 @@ componentDirs.map((directory) => {

Object.keys(components).map((component) => {
if (component === 'default') {
fileContents += `export { default as ${components.default.name} } from './${fileName}';\n`;
//components wrapped in withStyles HOC
if (components.default.render) {
fileContents += `export { default as ${components.default.render.displayName} } from './${fileName}';\n`;
} else {
//components not wrapped in HOC
fileContents += `export { default as ${components.default.name} } from './${fileName}';\n`;
}
} else {
fileContents += `export { ${component} } from './${fileName}';\n`;
}
Expand Down
Loading

0 comments on commit 38f9fc0

Please sign in to comment.