Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated the whole package dependacies to the latest using React 16.8, Webpack 4 #849

Merged
merged 6 commits into from
Jul 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
{
"env": {
"development": {
"presets": ["es2015", "stage-0", "react"]
"presets": ["@babel/preset-env", "@babel/preset-react"],
"plugins": ["@babel/plugin-proposal-class-properties"]
},
"build": {
"plugins": ["lodash"],
"presets": ["es2015", "stage-0", "react"],
"ignore": [
"**/__tests__/*.js",
"**/fake-*"
]
"plugins": ["lodash", "@babel/plugin-proposal-class-properties"],
"presets": ["@babel/preset-env", "@babel/preset-react"],
"ignore": ["**/__tests__/*.js", "**/fake-*"]
},
"test": {
"presets": ["@babel/preset-env", "@babel/preset-react"],
"plugins": ["@babel/plugin-proposal-class-properties"],
"only": ["./**/*.js", "node_modules/jest-runtime"]
}

}
}
4 changes: 4 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"singleQuote": true,
"arrowParens": "always"
}
4 changes: 2 additions & 2 deletions .storybook/config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { configure } from '@kadira/storybook';
import { configure } from '@storybook/react';

function loadStories() {
require('../stories');
require('../stories/index.tsx');
}

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

// you can use this file to add your custom webpack plugins, loaders and anything you like.
// This is just the basic way to add addional webpack configurations.
// For more information refer the docs: https://goo.gl/qPbSyX

// IMPORTANT
// When you add this file, we won't add the default configurations which is similar
// to "React Create App". This only has babel loader to load JavaScript.

module.exports = {
devtool: 'source-map',
entry: './stories/index.tsx',
output: {
path: path.join(__dirname, '/dist/examples/'),
filename: 'storybook.js'
},
resolve: {
extensions: ['.webpack.js', '.web.js', '.ts', '.tsx', '.js']
},
module: {
rules: [
{
test: /\.(ts|tsx)$/,
use: [
{
loader: 'babel-loader'
},
{
loader: 'awesome-typescript-loader'
},
{
loader: 'react-docgen-typescript-loader'
}
],
exclude: ['/node_modules/']
},
{
test: /\.(js|jsx)$/,
use: [
{
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env', '@babel/preset-react']
}
}
],
exclude: ['/node_modules/']
}
]
}
};
54 changes: 15 additions & 39 deletions .storybook/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,41 +1,17 @@
const failPlugin = require('webpack-fail-plugin');
const path = require("path");
const include = path.resolve(__dirname, '../');

// you can use this file to add your custom webpack plugins, loaders and anything you like.
// This is just the basic way to add addional webpack configurations.
// For more information refer the docs: https://goo.gl/qPbSyX

// IMPORTANT
// When you add this file, we won't add the default configurations which is similar
// to "React Create App". This only has babel loader to load JavaScript.

module.exports = {
devtool: 'source-map',
entry: './stories/index.tsx',
output: {
filename: include + '/dist/examples/storybook.js'
},
plugins: [
failPlugin
],
resolve: {
// Add `.ts` and `.tsx` as a resolvable extension.
extensions: ["", ".webpack.js", ".web.js", ".ts", ".tsx", ".js"]
},
module: {
loaders: [
{ test: /\.tsx?$/,
loader: 'babel-loader!ts-loader',
exclude: /node_modules/,
cacheDirectory: true,
include,
const path = require('path');
module.exports = (baseConfig, env, config) => {
config.module.rules.push({
test: /\.(ts|tsx)$/,
use: [
{ loader: 'babel-loader' },
{
loader: 'awesome-typescript-loader'
},
{
loader: 'react-docgen-typescript-loader'
}
],
},
ts: {
compilerOptions: {
noEmit: false,
},
},
]
});
config.resolve.extensions.push('.ts', '.tsx');
return config;
};
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"editor.formatOnSave": true
}
Loading