Skip to content
This repository has been archived by the owner on Apr 6, 2021. It is now read-only.

Commit

Permalink
Merge 66b0f8b into b5a1a09
Browse files Browse the repository at this point in the history
  • Loading branch information
FDiskas committed Dec 18, 2017
2 parents b5a1a09 + 66b0f8b commit 8fb88fa
Show file tree
Hide file tree
Showing 11 changed files with 105 additions and 51 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
BASE_PATH="."
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ coverage/
*.css.d.ts
*.scss.d.ts
storybook-static/
/.env.production
/.env.staging
/.env
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ language: node_js
node_js:
- 8.4

env:
global:
- BASE_PATH=$BASE_PATH

cache:
directories:
- node_modules
Expand All @@ -24,6 +28,8 @@ script:
- yarn build
- yarn test:coverage

before_deploy:
- export CI=false
deploy:
- provider: pages
name: Github Pages
Expand Down
6 changes: 3 additions & 3 deletions config/storybook/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
require("ts-node").register(
{filename: '../webpack.prod.ts'}
);
const webpacConfig = require('../webpack.prod').default;
const webpackConfig = require('../webpack.prod').config;

module.exports = {
plugins: [
// your custom plugins
],
resolve: {
extensions: webpacConfig.resolve.extensions,
extensions: webpackConfig.resolve.extensions,
},
module: {
rules: [
webpacConfig.module.rules[0],
webpackConfig.module.rules[0],
{
test: /\.(css|sass|scss)$/,
exclude: /node_modules/,
Expand Down
8 changes: 2 additions & 6 deletions config/webpack.common.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as path from 'path';
import * as webpack from 'webpack';

const config = {
export const webpackCommon = {
entry: {
vendors: Object.keys(require(path.resolve('package.json')).dependencies),
},
Expand All @@ -23,9 +23,7 @@ const config = {
],
minChunks: Infinity,
}),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
}),
new webpack.EnvironmentPlugin(['NODE_ENV']),
],
externals: [],
node: {
Expand All @@ -37,5 +35,3 @@ const config = {
child_process: 'empty',
},
};

export default config;
11 changes: 7 additions & 4 deletions config/webpack.dev.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import * as webpack from 'webpack';
import webpackCommon from './webpack.common';
import { webpackCommon } from './webpack.common';
import { strategy } from 'webpack-merge';
import * as HtmlWebpackPlugin from 'html-webpack-plugin';
import * as ExtractTextPlugin from 'extract-text-webpack-plugin';
import * as path from 'path';
import * as DashboardPlugin from 'webpack-dashboard/plugin';
import * as Dashboard from 'webpack-dashboard';
import * as DotenvPlugin from 'webpack-dotenv-plugin';

const dashboard = new Dashboard();

const config: webpack.Configuration = strategy(
export const config: webpack.Configuration = strategy(
{
plugins: 'prepend',
},
Expand Down Expand Up @@ -78,12 +79,14 @@ const config: webpack.Configuration = strategy(
minify: false,
}),
new ExtractTextPlugin('static/css/styles.css'),
new DotenvPlugin({
sample: './.env.example',
path: './.env',
}),
],
devServer: {
hot: true,
quiet: true,
historyApiFallback: true,
},
});

export default config;
11 changes: 7 additions & 4 deletions config/webpack.prod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import * as path from 'path';
import * as HtmlWebpackPlugin from 'html-webpack-plugin';
import * as OptimizeCssAssetsPlugin from 'optimize-css-assets-webpack-plugin';
import * as ExtractTextPlugin from 'extract-text-webpack-plugin';
import webpackCommon from './webpack.common';
import { webpackCommon } from './webpack.common';
import * as DotenvPlugin from 'webpack-dotenv-plugin';

const config: webpack.Configuration = strategy(
export const config: webpack.Configuration = strategy(
{
plugins: 'prepend',
},
Expand Down Expand Up @@ -81,7 +82,9 @@ const config: webpack.Configuration = strategy(
cssProcessorOptions: { discardComments: { removeAll: true } },
canPrint: false,
}),
new DotenvPlugin({
sample: '.env.example',
path: `.env.${process.env.NODE_ENV}`,
}),
],
});

export default config;
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"@types/storybook__react": "3.0.5",
"@types/uniqid": "4.1.2",
"@types/webpack": "3.8.1",
"@types/webpack-dotenv-plugin": "2.0.0",
"@types/webpack-env": "1.13.3",
"@types/webpack-merge": "4.1.1",
"awesome-typescript-loader": "3.4.1",
Expand Down Expand Up @@ -122,6 +123,7 @@
"webpack-dashboard": "0.4.0",
"webpack-dev-middleware": "1.12.2",
"webpack-dev-server": "2.9.7",
"webpack-dotenv-plugin": "2.0.2",
"webpack-hot-middleware": "2.21.0",
"webpack-merge": "4.1.1"
},
Expand Down
8 changes: 3 additions & 5 deletions src/client/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import * as React from 'react';
import * as ReactDOM from 'react-dom';
import { Provider } from 'react-redux';
import { AppContainer } from 'react-hot-loader';
import { createBrowserHistory } from 'history';
import { Router, Switch } from 'react-router-dom';
import { Switch, BrowserRouter as Router } from 'react-router-dom';
import { Route } from 'react-router4-with-layouts';

import { configureStore } from './core/store';
Expand All @@ -14,12 +13,11 @@ import { EmptyLayout } from './layouts/empty/EmptyLayout';
import { DemoPage } from './pages/demo/DemoPage';

const store = configureStore();
const history = createBrowserHistory();

ReactDOM.render(
<AppContainer>
<Provider store={store}>
<Router history={history}>
<Router basename={`${process.env.c}`}>
<Switch>
<Route path="/" component={HomePage} exact={true} layout={DefaultLayout} />
<Route path="/demo" component={DemoPage} layout={DefaultLayout} />
Expand All @@ -37,7 +35,7 @@ if (module.hot) {
ReactDOM.render(
<AppContainer>
<Provider store={store}>
<Router history={history}>
<Router basename={`${process.env.BASE_PATH}`}>
<Switch>
<Route path="/" component={NextApp} layout={DefaultLayout} />
</Switch>
Expand Down
2 changes: 1 addition & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ module.exports = env => {
require("ts-node").register(
{filename: `config/webpack.${env}.ts`}
);
return require(`./config/webpack.${env}`).default;
return require(`./config/webpack.${env}`).config;
};
98 changes: 70 additions & 28 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
version "3.0.9"
resolved "https://registry.yarnpkg.com/@hypnosphi/fuse.js/-/fuse.js-3.0.9.tgz#ea99f6121b4a8f065b4c71f85595db2714498807"

"@storybook/addon-actions@3.2.17", "@storybook/addon-actions@^3.2.17":
"@storybook/addon-actions@3.2.17":
version "3.2.17"
resolved "https://registry.yarnpkg.com/@storybook/addon-actions/-/addon-actions-3.2.17.tgz#e85d38f743125157fdaf6669708e089bc2008e50"
dependencies:
Expand All @@ -17,6 +17,17 @@
react-inspector "^2.2.1"
uuid "^3.1.0"

"@storybook/addon-actions@^3.2.17":
version "3.2.18"
resolved "https://registry.yarnpkg.com/@storybook/addon-actions/-/addon-actions-3.2.18.tgz#46d97b0add955698d66becb5d51e68a4d387b822"
dependencies:
"@storybook/addons" "^3.2.18"
deep-equal "^1.0.1"
json-stringify-safe "^5.0.1"
prop-types "^15.6.0"
react-inspector "^2.2.2"
uuid "^3.1.0"

"@storybook/addon-info@3.2.17":
version "3.2.17"
resolved "https://registry.yarnpkg.com/@storybook/addon-info/-/addon-info-3.2.17.tgz#a1a612ca323c360089dd4d49aca8abf902d4929d"
Expand Down Expand Up @@ -47,37 +58,43 @@
react-textarea-autosize "^5.2.1"
util-deprecate "^1.0.2"

"@storybook/addon-links@3.2.17", "@storybook/addon-links@^3.2.17":
"@storybook/addon-links@3.2.17":
version "3.2.17"
resolved "https://registry.yarnpkg.com/@storybook/addon-links/-/addon-links-3.2.17.tgz#fb1d5f5f16575e56d560955d70c2a756c9f5b612"
dependencies:
"@storybook/addons" "^3.2.17"

"@storybook/addon-links@^3.2.17":
version "3.2.18"
resolved "https://registry.yarnpkg.com/@storybook/addon-links/-/addon-links-3.2.18.tgz#a1fd96dd91d56204da92632baa36a2263d2aeebb"
dependencies:
"@storybook/addons" "^3.2.18"

"@storybook/addon-options@3.2.17":
version "3.2.17"
resolved "https://registry.yarnpkg.com/@storybook/addon-options/-/addon-options-3.2.17.tgz#1ca1de1f3cf8ac7ec99bcdd534d6e034f9ee4f20"
dependencies:
"@storybook/addons" "^3.2.17"

"@storybook/addons@^3.2.17":
version "3.2.17"
resolved "https://registry.yarnpkg.com/@storybook/addons/-/addons-3.2.17.tgz#5c2ece24c5f7fbf7cedf4cfe503c5e356543e62d"
"@storybook/addons@^3.2.17", "@storybook/addons@^3.2.18":
version "3.2.18"
resolved "https://registry.yarnpkg.com/@storybook/addons/-/addons-3.2.18.tgz#2c1d42a0b661db2e429d1c406e79765ae5c71458"

"@storybook/channel-postmessage@^3.2.17":
version "3.2.17"
resolved "https://registry.yarnpkg.com/@storybook/channel-postmessage/-/channel-postmessage-3.2.17.tgz#530c1d6852b2c77df08490988fa943ba1373b1ec"
version "3.2.18"
resolved "https://registry.yarnpkg.com/@storybook/channel-postmessage/-/channel-postmessage-3.2.18.tgz#8193e2fbae4f46a20a58fb6cdfd722c1743a3dd0"
dependencies:
"@storybook/channels" "^3.2.17"
"@storybook/channels" "^3.2.18"
global "^4.3.2"
json-stringify-safe "^5.0.1"

"@storybook/channels@^3.2.17":
version "3.2.17"
resolved "https://registry.yarnpkg.com/@storybook/channels/-/channels-3.2.17.tgz#09219a512564d1aa2292419d8d6064dbf7f5a5b3"
"@storybook/channels@^3.2.18":
version "3.2.18"
resolved "https://registry.yarnpkg.com/@storybook/channels/-/channels-3.2.18.tgz#c5d8c4ac780c6ebb4b1c360d8faf9207fd4fbafd"

"@storybook/components@^3.2.17":
version "3.2.17"
resolved "https://registry.yarnpkg.com/@storybook/components/-/components-3.2.17.tgz#318c6e6a1d3ffb469523b5dcfee775639ccc500b"
"@storybook/components@^3.2.17", "@storybook/components@^3.2.18":
version "3.2.18"
resolved "https://registry.yarnpkg.com/@storybook/components/-/components-3.2.18.tgz#142dd10414a717c24734f063af6b2b7b9bd06b4a"
dependencies:
glamor "^2.20.40"
glamorous "^4.11.0"
Expand Down Expand Up @@ -181,11 +198,11 @@
webpack-hot-middleware "^2.21.0"

"@storybook/ui@^3.2.17":
version "3.2.17"
resolved "https://registry.yarnpkg.com/@storybook/ui/-/ui-3.2.17.tgz#8838fc5bbe21cedfafc65ee90fe525499370118a"
version "3.2.18"
resolved "https://registry.yarnpkg.com/@storybook/ui/-/ui-3.2.18.tgz#4d19f8daff7ec37cebe4d2b5d20e81e3676d8938"
dependencies:
"@hypnosphi/fuse.js" "^3.0.9"
"@storybook/components" "^3.2.17"
"@storybook/components" "^3.2.18"
"@storybook/mantra-core" "^1.7.0"
"@storybook/react-fuzzy" "^0.4.3"
"@storybook/react-komposer" "^2.0.0"
Expand All @@ -202,8 +219,8 @@
prop-types "^15.6.0"
qs "^6.5.1"
react-icons "^2.2.7"
react-inspector "^2.2.1"
react-modal "^3.1.4"
react-inspector "^2.2.2"
react-modal "^3.1.8"
react-split-pane "^0.1.71"
react-treebeard "^2.0.3"
redux "^3.7.2"
Expand Down Expand Up @@ -401,6 +418,12 @@
version "4.1.2"
resolved "https://registry.yarnpkg.com/@types/uniqid/-/uniqid-4.1.2.tgz#83c56995419696ffc6c7abd268177dac2c6f13c9"

"@types/webpack-dotenv-plugin@2.0.0":
version "2.0.0"
resolved "https://registry.yarnpkg.com/@types/webpack-dotenv-plugin/-/webpack-dotenv-plugin-2.0.0.tgz#32857d64c5558363331263b51a43c0df00d30249"
dependencies:
"@types/webpack" "*"

"@types/webpack-env@*":
version "1.13.2"
resolved "https://registry.yarnpkg.com/@types/webpack-env/-/webpack-env-1.13.2.tgz#c290b99dbef74df21b06671aea36e355bf3b27e1"
Expand Down Expand Up @@ -432,8 +455,8 @@
"@types/uglify-js" "*"

JSONStream@^1.0.4:
version "1.3.1"
resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.1.tgz#707f761e01dae9e16f1bcf93703b78c70966579a"
version "1.3.2"
resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.2.tgz#c102371b6ec3a7cf3b847ca00c20bb0fce4c6dea"
dependencies:
jsonparse "^1.2.0"
through ">=2.2.7 <3"
Expand Down Expand Up @@ -2645,8 +2668,8 @@ content-type@~1.0.4:
resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b"

conventional-changelog-angular@^1.5.2:
version "1.5.3"
resolved "https://registry.yarnpkg.com/conventional-changelog-angular/-/conventional-changelog-angular-1.5.3.tgz#ff0dd01d740e35bfdbc3f02dfea13cf0d96f0b82"
version "1.6.0"
resolved "https://registry.yarnpkg.com/conventional-changelog-angular/-/conventional-changelog-angular-1.6.0.tgz#0a26a071f2c9fcfcf2b86ba0cfbf6e6301b75bfa"
dependencies:
compare-func "^1.3.1"
q "^1.4.1"
Expand Down Expand Up @@ -2674,8 +2697,8 @@ conventional-changelog-codemirror@^0.2.1:
q "^1.4.1"

conventional-changelog-core@^1.9.3:
version "1.9.4"
resolved "https://registry.yarnpkg.com/conventional-changelog-core/-/conventional-changelog-core-1.9.4.tgz#a541e5354f91072f8583b19e34abb9f6e461c367"
version "1.9.5"
resolved "https://registry.yarnpkg.com/conventional-changelog-core/-/conventional-changelog-core-1.9.5.tgz#5db7566dad7c0cb75daf47fbb2976f7bf9928c1d"
dependencies:
conventional-changelog-writer "^2.0.3"
conventional-commits-parser "^2.1.0"
Expand Down Expand Up @@ -3431,6 +3454,12 @@ dot-prop@^4.1.0, dot-prop@^4.1.1:
dependencies:
is-obj "^1.0.0"

dotenv-safe@^4.0.4:
version "4.0.4"
resolved "https://registry.yarnpkg.com/dotenv-safe/-/dotenv-safe-4.0.4.tgz#8b0e7ced8e70b1d3c5d874ef9420e406f39425b3"
dependencies:
dotenv "^4.0.0"

dotenv-webpack@^1.5.4:
version "1.5.4"
resolved "https://registry.yarnpkg.com/dotenv-webpack/-/dotenv-webpack-1.5.4.tgz#9c92e46e412a1cfbc60217ed33d69d2bbfddbf9f"
Expand Down Expand Up @@ -7794,9 +7823,16 @@ react-inspector@^2.2.1:
babel-runtime "^6.26.0"
is-dom "^1.0.9"

react-modal@^3.1.4:
version "3.1.7"
resolved "https://registry.yarnpkg.com/react-modal/-/react-modal-3.1.7.tgz#21feb937c95cd722bf2d375cada751fdc8189c0e"
react-inspector@^2.2.2:
version "2.2.2"
resolved "https://registry.yarnpkg.com/react-inspector/-/react-inspector-2.2.2.tgz#c04f5248fa92ab6c23e37960e725fb7f48c34d05"
dependencies:
babel-runtime "^6.26.0"
is-dom "^1.0.9"

react-modal@^3.1.8:
version "3.1.8"
resolved "https://registry.yarnpkg.com/react-modal/-/react-modal-3.1.8.tgz#7d6b1958f44828babd2a1ce826c28fa40d026b0f"
dependencies:
exenv "^1.2.0"
prop-types "^15.5.10"
Expand Down Expand Up @@ -10066,6 +10102,12 @@ webpack-dev-server@2.9.7:
webpack-dev-middleware "^1.11.0"
yargs "^6.6.0"

webpack-dotenv-plugin@2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/webpack-dotenv-plugin/-/webpack-dotenv-plugin-2.0.2.tgz#27cf1512a34cf19858e8b00255f16a9f84f32745"
dependencies:
dotenv-safe "^4.0.4"

webpack-hot-middleware@2.21.0, webpack-hot-middleware@^2.21.0:
version "2.21.0"
resolved "https://registry.yarnpkg.com/webpack-hot-middleware/-/webpack-hot-middleware-2.21.0.tgz#7b3c113a7a4b301c91e0749573c7aab28b414b52"
Expand Down

0 comments on commit 8fb88fa

Please sign in to comment.