Skip to content

Commit

Permalink
Merge branch 'master' into ndelangen/add-dirname
Browse files Browse the repository at this point in the history
  • Loading branch information
ndelangen committed Jan 26, 2018
2 parents 237e9b7 + ba3da9d commit 243366c
Show file tree
Hide file tree
Showing 31 changed files with 134 additions and 75 deletions.
4 changes: 3 additions & 1 deletion app/angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"@storybook/core": "^3.4.0-alpha.5",
"@storybook/node-logger": "^3.4.0-alpha.5",
"@storybook/ui": "^3.4.0-alpha.5",
"airbnb-js-shims": "^1.1.1",
"airbnb-js-shims": "^1.4.1",
"angular2-template-loader": "^0.6.2",
"autoprefixer": "^7.2.5",
"babel-core": "^6.26.0",
Expand All @@ -50,6 +50,7 @@
"core-js": "^2.4.1",
"cross-env": "^5.1.1",
"css-loader": "^0.28.9",
"dotenv-webpack": "^1.5.4",
"express": "^4.15.3",
"file-loader": "^0.11.1",
"find-cache-dir": "^1.0.0",
Expand All @@ -68,6 +69,7 @@
"qs": "^6.5.1",
"raw-loader": "^0.5.1",
"react": "^16.0.0",
"react-dev-utils": "^5.0.0",
"react-dom": "^16.0.0",
"react-modal": "^2.2.4",
"redux": "^3.6.0",
Expand Down
2 changes: 2 additions & 0 deletions app/angular/src/server/build.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import '@storybook/core/env';

import webpack from 'webpack';
import program from 'commander';
import path from 'path';
Expand Down
4 changes: 4 additions & 0 deletions app/angular/src/server/config/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import path from 'path';
import webpack from 'webpack';
import Dotenv from 'dotenv-webpack';
import InterpolateHtmlPlugin from 'react-dev-utils/InterpolateHtmlPlugin';
import CaseSensitivePathsPlugin from 'case-sensitive-paths-webpack-plugin';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import { managerPath } from '@storybook/core/client';
Expand Down Expand Up @@ -27,6 +29,7 @@ export default function(configDir) {
publicPath: '/',
},
plugins: [
new InterpolateHtmlPlugin(process.env),
new HtmlWebpackPlugin({
filename: 'index.html',
chunks: ['manager'],
Expand All @@ -53,6 +56,7 @@ export default function(configDir) {
/angular(\\|\/)core(\\|\/)(@angular|esm5)/,
path.resolve(__dirname, '../src')
),
new Dotenv({ silent: true }),
],
module: {
rules: [
Expand Down
4 changes: 4 additions & 0 deletions app/angular/src/server/config/webpack.config.prod.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import path from 'path';
import webpack from 'webpack';
import UglifyJsPlugin from 'uglifyjs-webpack-plugin';
import Dotenv from 'dotenv-webpack';
import InterpolateHtmlPlugin from 'react-dev-utils/InterpolateHtmlPlugin';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import { managerPath } from '@storybook/core/client';

Expand Down Expand Up @@ -29,6 +31,7 @@ export default function(configDir) {
publicPath: '',
},
plugins: [
new InterpolateHtmlPlugin(process.env),
new HtmlWebpackPlugin({
filename: 'index.html',
chunks: ['manager'],
Expand Down Expand Up @@ -65,6 +68,7 @@ export default function(configDir) {
/angular(\\|\/)core(\\|\/)(@angular|esm5)/,
path.resolve(__dirname, '../src')
),
new Dotenv({ silent: true }),
],
module: {
rules: [
Expand Down
2 changes: 1 addition & 1 deletion app/angular/src/server/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env node
import '@storybook/core/env';

import express from 'express';
import https from 'https';
Expand Down
4 changes: 3 additions & 1 deletion app/polymer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"@storybook/node-logger": "^3.4.0-alpha.5",
"@storybook/ui": "^3.4.0-alpha.5",
"@webcomponents/webcomponentsjs": "^1.1.0",
"airbnb-js-shims": "^1.3.0",
"airbnb-js-shims": "^1.4.1",
"autoprefixer": "^7.1.6",
"babel-core": "^6.26.0",
"babel-loader": "^7.1.2",
Expand All @@ -52,6 +52,7 @@
"copy-webpack-plugin": "^4.2.0",
"core-js": "^2.5.1",
"css-loader": "^0.28.9",
"dotenv-webpack": "^1.5.4",
"express": "^4.16.2",
"file-loader": "^0.11.2",
"find-cache-dir": "^1.0.0",
Expand All @@ -67,6 +68,7 @@
"prop-types": "^15.6.0",
"qs": "^6.5.1",
"react": "^16.0.0",
"react-dev-utils": "^5.0.0",
"react-dom": "^16.0.0",
"react-modal": "^2.4.1",
"redux": "^3.7.2",
Expand Down
2 changes: 2 additions & 0 deletions app/polymer/src/server/build.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import '@storybook/core/env';

import webpack from 'webpack';
import program from 'commander';
import path from 'path';
Expand Down
4 changes: 4 additions & 0 deletions app/polymer/src/server/config/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import path from 'path';
import webpack from 'webpack';
import Dotenv from 'dotenv-webpack';
import InterpolateHtmlPlugin from 'react-dev-utils/InterpolateHtmlPlugin';
import CaseSensitivePathsPlugin from 'case-sensitive-paths-webpack-plugin';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import CopyWebpackPlugin from 'copy-webpack-plugin';
Expand Down Expand Up @@ -35,6 +37,7 @@ export default function() {
publicPath: '/',
},
plugins: [
new InterpolateHtmlPlugin(process.env),
new HtmlWebpackPlugin({
filename: 'index.html',
chunks: ['manager'],
Expand All @@ -61,6 +64,7 @@ export default function() {
new CaseSensitivePathsPlugin(),
new WatchMissingNodeModulesPlugin(nodeModulesPaths),
new webpack.ProgressPlugin(),
new Dotenv({ silent: true }),
],
module: {
rules: [
Expand Down
4 changes: 4 additions & 0 deletions app/polymer/src/server/config/webpack.config.prod.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import webpack from 'webpack';
import Dotenv from 'dotenv-webpack';
import InterpolateHtmlPlugin from 'react-dev-utils/InterpolateHtmlPlugin';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import CopyWebpackPlugin from 'copy-webpack-plugin';
import { managerPath } from '@storybook/core/client';
Expand Down Expand Up @@ -27,6 +29,7 @@ export default function() {
publicPath: '',
},
plugins: [
new InterpolateHtmlPlugin(process.env),
new HtmlWebpackPlugin({
filename: 'index.html',
chunks: ['manager'],
Expand Down Expand Up @@ -60,6 +63,7 @@ export default function() {
screw_ie8: true,
},
}),
new Dotenv({ silent: true }),
],
module: {
rules: [
Expand Down
2 changes: 2 additions & 0 deletions app/polymer/src/server/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import '@storybook/core/env';

import express from 'express';
import https from 'https';
import favicon from 'serve-favicon';
Expand Down
3 changes: 2 additions & 1 deletion app/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"@storybook/core": "^3.4.0-alpha.5",
"@storybook/node-logger": "^3.4.0-alpha.5",
"@storybook/ui": "^3.4.0-alpha.5",
"airbnb-js-shims": "^1.4.0",
"airbnb-js-shims": "^1.4.1",
"autoprefixer": "^7.2.5",
"babel-loader": "^7.1.2",
"babel-plugin-macros": "^2.0.0",
Expand Down Expand Up @@ -70,6 +70,7 @@
"postcss-loader": "^2.0.10",
"prop-types": "^15.6.0",
"qs": "^6.5.1",
"react-dev-utils": "^5.0.0",
"redux": "^3.7.2",
"request": "^2.83.0",
"serve-favicon": "^2.4.5",
Expand Down
2 changes: 2 additions & 0 deletions app/react/src/server/build.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import '@storybook/core/env';

import webpack from 'webpack';
import program from 'commander';
import path from 'path';
Expand Down
4 changes: 3 additions & 1 deletion app/react/src/server/config/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import path from 'path';
import webpack from 'webpack';
import Dotenv from 'dotenv-webpack';
import InterpolateHtmlPlugin from 'react-dev-utils/InterpolateHtmlPlugin';
import CaseSensitivePathsPlugin from 'case-sensitive-paths-webpack-plugin';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import { managerPath } from '@storybook/core/client';
Expand Down Expand Up @@ -28,6 +29,7 @@ export default function(configDir) {
publicPath: '/',
},
plugins: [
new InterpolateHtmlPlugin(process.env),
new HtmlWebpackPlugin({
filename: 'index.html',
chunks: ['manager'],
Expand All @@ -50,7 +52,7 @@ export default function(configDir) {
new CaseSensitivePathsPlugin(),
new WatchMissingNodeModulesPlugin(nodeModulesPaths),
new webpack.ProgressPlugin(),
new Dotenv(),
new Dotenv({ silent: true }),
],
module: {
rules: [
Expand Down
4 changes: 4 additions & 0 deletions app/react/src/server/config/webpack.config.prod.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import webpack from 'webpack';
import UglifyJsPlugin from 'uglifyjs-webpack-plugin';
import Dotenv from 'dotenv-webpack';
import InterpolateHtmlPlugin from 'react-dev-utils/InterpolateHtmlPlugin';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import { managerPath } from '@storybook/core/client';
import babelLoaderConfig from './babel.prod';
Expand Down Expand Up @@ -27,6 +29,7 @@ export default function(configDir) {
publicPath: '',
},
plugins: [
new InterpolateHtmlPlugin(process.env),
new HtmlWebpackPlugin({
filename: 'index.html',
chunks: ['manager'],
Expand Down Expand Up @@ -59,6 +62,7 @@ export default function(configDir) {
},
},
}),
new Dotenv({ silent: true }),
],
module: {
rules: [
Expand Down
2 changes: 2 additions & 0 deletions app/react/src/server/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import '@storybook/core/env';

import express from 'express';
import https from 'https';
import favicon from 'serve-favicon';
Expand Down
3 changes: 2 additions & 1 deletion app/vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"@storybook/channel-postmessage": "^3.4.0-alpha.5",
"@storybook/core": "^3.4.0-alpha.5",
"@storybook/ui": "^3.4.0-alpha.5",
"airbnb-js-shims": "^1.4.0",
"airbnb-js-shims": "^1.4.1",
"autoprefixer": "^7.2.5",
"babel-loader": "^7.1.2",
"babel-plugin-macros": "^2.0.0",
Expand Down Expand Up @@ -65,6 +65,7 @@
"prop-types": "^15.6.0",
"qs": "^6.5.1",
"react": "^16.2.0",
"react-dev-utils": "^5.0.0",
"react-dom": "^16.2.0",
"redux": "^3.7.2",
"request": "^2.83.0",
Expand Down
2 changes: 2 additions & 0 deletions app/vue/src/server/build.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import '@storybook/core/env';

import webpack from 'webpack';
import program from 'commander';
import path from 'path';
Expand Down
4 changes: 3 additions & 1 deletion app/vue/src/server/config/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import path from 'path';
import webpack from 'webpack';
import Dotenv from 'dotenv-webpack';
import InterpolateHtmlPlugin from 'react-dev-utils/InterpolateHtmlPlugin';
import CaseSensitivePathsPlugin from 'case-sensitive-paths-webpack-plugin';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import { managerPath } from '@storybook/core/client';
Expand Down Expand Up @@ -28,6 +29,7 @@ export default function(configDir) {
publicPath: '/',
},
plugins: [
new InterpolateHtmlPlugin(process.env),
new HtmlWebpackPlugin({
filename: 'index.html',
chunks: ['manager'],
Expand All @@ -50,7 +52,7 @@ export default function(configDir) {
new CaseSensitivePathsPlugin(),
new WatchMissingNodeModulesPlugin(nodeModulesPaths),
new webpack.ProgressPlugin(),
new Dotenv(),
new Dotenv({ silent: true }),
],
module: {
rules: [
Expand Down
4 changes: 4 additions & 0 deletions app/vue/src/server/config/webpack.config.prod.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import webpack from 'webpack';
import UglifyJsPlugin from 'uglifyjs-webpack-plugin';
import Dotenv from 'dotenv-webpack';
import InterpolateHtmlPlugin from 'react-dev-utils/InterpolateHtmlPlugin';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import { managerPath } from '@storybook/core/client';
import babelLoaderConfig from './babel.prod';
Expand Down Expand Up @@ -27,6 +29,7 @@ export default function(configDir) {
publicPath: '',
},
plugins: [
new InterpolateHtmlPlugin(process.env),
new HtmlWebpackPlugin({
filename: 'index.html',
chunks: ['manager'],
Expand Down Expand Up @@ -59,6 +62,7 @@ export default function(configDir) {
},
},
}),
new Dotenv({ silent: true }),
],
module: {
rules: [
Expand Down
2 changes: 2 additions & 0 deletions app/vue/src/server/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import '@storybook/core/env';

import express from 'express';
import https from 'https';
import favicon from 'serve-favicon';
Expand Down
22 changes: 11 additions & 11 deletions examples/angular-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,23 @@
"test": "ng test"
},
"dependencies": {
"@angular/animations": "^5.2.1",
"@angular/common": "^5.2.1",
"@angular/compiler": "^5.2.1",
"@angular/core": "^5.2.1",
"@angular/forms": "^5.2.1",
"@angular/http": "^5.2.1",
"@angular/platform-browser": "^5.2.1",
"@angular/platform-browser-dynamic": "^5.2.1",
"@angular/router": "^5.2.1",
"@angular/animations": "^5.2.2",
"@angular/common": "^5.2.2",
"@angular/compiler": "^5.2.2",
"@angular/core": "^5.2.2",
"@angular/forms": "^5.2.2",
"@angular/http": "^5.2.2",
"@angular/platform-browser": "^5.2.2",
"@angular/platform-browser-dynamic": "^5.2.2",
"@angular/router": "^5.2.2",
"core-js": "^2.4.1",
"rxjs": "^5.4.2",
"zone.js": "^0.8.20"
},
"devDependencies": {
"@angular/cli": "1.6.5",
"@angular/compiler-cli": "^5.2.1",
"@angular/language-service": "^5.2.1",
"@angular/compiler-cli": "^5.2.2",
"@angular/language-service": "^5.2.2",
"@storybook/addon-actions": "^3.4.0-alpha.5",
"@storybook/addon-links": "^3.4.0-alpha.5",
"@storybook/addon-notes": "^3.4.0-alpha.5",
Expand Down
1 change: 1 addition & 0 deletions examples/official-storybook/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DISPLAY_WARNING=none
2 changes: 1 addition & 1 deletion examples/official-storybook/addons.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ import '@storybook/addon-jest/register';

import addHeadWarning from './head-warning';

addHeadWarning('Manager');
addHeadWarning('Manager head not loaded', 'manager-head-not-loaded');
3 changes: 2 additions & 1 deletion examples/official-storybook/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import { setOptions } from '@storybook/addon-options';
import 'react-chromatic/storybook-addon';
import addHeadWarning from './head-warning';

addHeadWarning('Preview');
addHeadWarning('Preview head not loaded', 'preview-head-not-loaded');
addHeadWarning('Dotenv file not loaded', 'dotenv-file-not-loaded');

setOptions({
hierarchySeparator: /\/|\./,
Expand Down
6 changes: 3 additions & 3 deletions examples/official-storybook/head-warning.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { document } from 'global';

export default function addHeadWarning(bundle) {
export default function addHeadWarning(text, className) {
const warning = document.createElement('h1');
warning.textContent = `${bundle} head not loaded`;
warning.className = `${bundle.toLowerCase()}-head-not-loaded`;
warning.textContent = text;
warning.className = className;
warning.style.color = 'red';

document.body.insertBefore(warning, document.body.firstChild);
Expand Down
Loading

0 comments on commit 243366c

Please sign in to comment.