Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
Note that the site index template has been rewritten. It's EJS instead
of Blueimp now.
  • Loading branch information
bebraw committed Jan 28, 2016
1 parent bfcd3c9 commit 4024abd
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 67 deletions.
52 changes: 52 additions & 0 deletions lib/index_template.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<!DOCTYPE html>
<html<% if(htmlWebpackPlugin.files.manifest) { %> manifest="<%= htmlWebpackPlugin.files.manifest %>"<% } %>>
<head>
<meta charset="UTF-8">
<title><%= htmlWebpackPlugin.options.title || 'Webpack App'%></title>

<% if (htmlWebpackPlugin.files.favicon) { %>
<link rel="shortcut icon" href="<%= htmlWebpackPlugin.files.favicon%>">
<% } %>

<% if (htmlWebpackPlugin.options.mobile) { %>
<meta name="viewport" content="width=device-width, initial-scale=1">
<% } %>

<% for (var css in htmlWebpackPlugin.files.css) { %>
<link href="<%= htmlWebpackPlugin.files.css[css] %>" rel="stylesheet">
<% } %>

<% if (htmlWebpackPlugin.options.baseHref) { %>
<base href="<%= htmlWebpackPlugin.options.baseHref %>" />
<% } %>
</head>
<body>
<div class="pure-g">
<header class="pure-u-1">
<% if (htmlWebpackPlugin.options.name) { %>
<h1><%= htmlWebpackPlugin.options.name %></h1>
<% } %>

<% if (htmlWebpackPlugin.options.description) { %>
<div class="description"><%= htmlWebpackPlugin.options.description %></div>
<% } %>
</header>

<article class="pure-u-1">
<h2>Demonstration</h2>
<section class="demonstration">
<%= htmlWebpackPlugin.options.demonstration %>
</section>

<h2>Documentation</h2>
<section class="documentation">
<%= htmlWebpackPlugin.options.documentation %>
</section>
</article>
</div>

<% for (var chunk in htmlWebpackPlugin.files.chunks) { %>
<script src="<%= htmlWebpackPlugin.files.chunks[chunk].entry %>"></script>
<% } %>
</body>
</html>
34 changes: 0 additions & 34 deletions lib/index_template.tpl

This file was deleted.

14 changes: 3 additions & 11 deletions lib/render.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,16 @@ import MTRC from 'markdown-to-react-components';
export default function (rootPath, context, demoTemplate) {
demoTemplate = demoTemplate || '';

var tpl = fs.readFileSync(
path.join(rootPath, 'lib/index_template.tpl'), 'utf8'
);
var readme = fs.readFileSync(
path.join(rootPath, 'README.md'), 'utf8'
);
var replacements = {

return {
name: context.name,
description: context.description,
demo: demoTemplate,
demonstration: demoTemplate,
documentation: ReactDOM.renderToStaticMarkup(
<div key="documentation">{MTRC(readme).tree}</div>
)
};

return tpl.replace(/%(\w*)%/g, function(match) {
var key = match.slice(1, -1);

return typeof replacements[key] === 'string' ? replacements[key] : match;
});
}
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,39 +27,39 @@
"react-dom": "^0.14.6"
},
"devDependencies": {
"babel-cli": "^6.4.0",
"babel-core": "^6.4.0",
"babel-cli": "^6.4.5",
"babel-core": "^6.4.5",
"babel-eslint": "^5.0.0-beta6",
"babel-loader": "^6.2.1",
"babel-preset-es2015": "^6.3.13",
"babel-preset-react": "^6.3.13",
"babel-preset-react-hmre": "^1.0.1",
"babel-register": "^6.4.3",
"chai": "^3.4.1",
"clean-webpack-plugin": "^0.1.6",
"chai": "^3.5.0",
"clean-webpack-plugin": "^0.1.7",
"css-loader": "^0.23.1",
"eslint": "^1.10.3",
"eslint-loader": "^1.2.0",
"eslint-plugin-react": "^3.15.0",
"eslint-loader": "^1.2.1",
"eslint-plugin-react": "^3.16.1",
"extract-text-webpack-plugin": "^1.0.1",
"file-loader": "^0.8.5",
"gh-pages": "^0.8.0",
"git-prepush-hook": "^1.0.1",
"highlight.js": "^9.1.0",
"html-webpack-plugin": "^1.7.0",
"html-webpack-plugin": "^2.7.2",
"isparta-instrumenter-loader": "^1.0.0",
"json-loader": "^0.5.4",
"karma": "^0.13.19",
"karma-chai": "^0.1.0",
"karma-coverage": "^0.5.3",
"karma-mocha": "^0.2.1",
"karma-phantomjs-launcher": "^0.2.3",
"karma-phantomjs-launcher": "^1.0.0",
"karma-sourcemap-loader": "^0.3.7",
"karma-spec-reporter": "0.0.23",
"karma-webpack": "^1.7.0",
"markdown-to-react-components": "bebraw/markdown-to-react-components#highlight",
"mocha": "^2.3.4",
"phantomjs": "^1.9.19",
"mocha": "^2.4.4",
"phantomjs-prebuilt": "^2.1.3",
"phantomjs-polyfill": "0.0.1",
"purecss": "^0.6.0",
"react-addons-test-utils": "^0.14.6",
Expand All @@ -68,7 +68,7 @@
"sync-exec": "^0.6.2",
"system-bell-webpack-plugin": "^1.0.0",
"url-loader": "^0.5.7",
"webpack": "^1.12.11",
"webpack": "^1.12.12",
"webpack-dev-server": "^1.14.1",
"webpack-merge": "^0.7.3"
},
Expand Down
22 changes: 11 additions & 11 deletions webpack.config.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,12 @@ if (TARGET === 'start') {
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('development')
}),
new HtmlWebpackPlugin({
new HtmlWebpackPlugin(Object.assign({}, {
title: pkg.name + ' - ' + pkg.description,
templateContent: renderJSX.bind(null, __dirname, pkg)
}),
template: 'lib/index_template.ejs',

inject: false
}, renderJSX(__dirname, pkg))),
new webpack.HotModuleReplacementPlugin()
],
module: {
Expand Down Expand Up @@ -140,15 +142,13 @@ if (TARGET === 'gh-pages' || TARGET === 'gh-pages:stats') {
// This has effect on the react lib size
'process.env.NODE_ENV': JSON.stringify('production')
}),
new HtmlWebpackPlugin({
new HtmlWebpackPlugin(Object.assign({}, {
title: pkg.name + ' - ' + pkg.description,
templateContent: renderJSX.bind(
null,
__dirname,
pkg,
RENDER_UNIVERSAL ? ReactDOM.renderToString(<App />) : ''
)
}),
template: 'lib/index_template.ejs',
inject: false
}, renderJSX(
__dirname, pkg, RENDER_UNIVERSAL ? ReactDOM.renderToString(<App />) : '')
)),
new webpack.optimize.DedupePlugin(),
new webpack.optimize.UglifyJsPlugin({
compress: {
Expand Down

0 comments on commit 4024abd

Please sign in to comment.