Merge pull request #5080 from janicduplessis/website-windows
Fix issues running the website locally on windows with npm3
This commit is contained in:
commit
f39d45e61c
|
@ -89,7 +89,7 @@ var platformBlacklists = {
|
||||||
|
|
||||||
function escapeRegExp(pattern) {
|
function escapeRegExp(pattern) {
|
||||||
if (Object.prototype.toString.call(pattern) === '[object RegExp]') {
|
if (Object.prototype.toString.call(pattern) === '[object RegExp]') {
|
||||||
return pattern.source;
|
return pattern.source.replace(/\//g, path.sep);
|
||||||
} else if (typeof pattern === 'string') {
|
} else if (typeof pattern === 'string') {
|
||||||
var escaped = pattern.replace(/[\-\[\]\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&');
|
var escaped = pattern.replace(/[\-\[\]\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&');
|
||||||
// convert the '/' into an escaped local file separator
|
// convert the '/' into an escaped local file separator
|
||||||
|
|
|
@ -14,9 +14,7 @@ var Header = require('Header');
|
||||||
|
|
||||||
var H2 = React.createClass({
|
var H2 = React.createClass({
|
||||||
render: function() {
|
render: function() {
|
||||||
return this.transferPropsTo(
|
return <Header {...this.props} level={2}>{this.props.children}</Header>;
|
||||||
<Header level={2}>{this.props.children}</Header>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -811,13 +811,16 @@ Parser.prototype.tok = function() {
|
||||||
return React.DOM.hr(null, null);
|
return React.DOM.hr(null, null);
|
||||||
}
|
}
|
||||||
case 'heading': {
|
case 'heading': {
|
||||||
return Header(
|
return (
|
||||||
{level: this.token.depth, toSlug: this.token.text},
|
<Header
|
||||||
this.inline.output(this.token.text)
|
level={this.token.depth}
|
||||||
|
toSlug={this.token.text}>
|
||||||
|
{this.inline.output(this.token.text)}
|
||||||
|
</Header>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
case 'code': {
|
case 'code': {
|
||||||
return Prism(null, this.token.text);
|
return <Prism>{this.token.text}</Prism>;
|
||||||
}
|
}
|
||||||
case 'table': {
|
case 'table': {
|
||||||
var table = []
|
var table = []
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
"jstransform": "latest",
|
"jstransform": "latest",
|
||||||
"mkdirp": "latest",
|
"mkdirp": "latest",
|
||||||
"optimist": "0.6.0",
|
"optimist": "0.6.0",
|
||||||
"react": "~0.12.0",
|
"react": "~0.13.0",
|
||||||
"react-docgen": "^2.0.1",
|
"react-docgen": "^2.0.1",
|
||||||
"react-page-middleware": "git://github.com/facebook/react-page-middleware.git",
|
"react-page-middleware": "git://github.com/facebook/react-page-middleware.git",
|
||||||
"request": "latest"
|
"request": "latest"
|
||||||
|
|
|
@ -16,7 +16,7 @@ var extractDocs = require('./extractDocs');
|
||||||
var argv = optimist.argv;
|
var argv = optimist.argv;
|
||||||
|
|
||||||
function splitHeader(content) {
|
function splitHeader(content) {
|
||||||
var lines = content.split('\n');
|
var lines = content.split(/\r?\n/);
|
||||||
for (var i = 1; i < lines.length - 1; ++i) {
|
for (var i = 1; i < lines.length - 1; ++i) {
|
||||||
if (lines[i] === '---') {
|
if (lines[i] === '---') {
|
||||||
break;
|
break;
|
||||||
|
@ -87,15 +87,16 @@ function execute() {
|
||||||
' * @jsx React.DOM\n' +
|
' * @jsx React.DOM\n' +
|
||||||
' */\n' +
|
' */\n' +
|
||||||
'var React = require("React");\n' +
|
'var React = require("React");\n' +
|
||||||
'var layout = require("' + layout + '");\n' +
|
'var Layout = require("' + layout + '");\n' +
|
||||||
'var content = ' + backtickify(both.content) + '\n' +
|
'var content = ' + backtickify(both.content) + '\n' +
|
||||||
'var Post = React.createClass({\n' +
|
'var Post = React.createClass({\n' +
|
||||||
|
' statics: {\n' +
|
||||||
|
' content: content\n' +
|
||||||
|
' },\n' +
|
||||||
' render: function() {\n' +
|
' render: function() {\n' +
|
||||||
' return layout({metadata: ' + JSON.stringify(metadata) + '}, content);\n' +
|
' return <Layout metadata={' + JSON.stringify(metadata) + '}>{content}</Layout>;\n' +
|
||||||
' }\n' +
|
' }\n' +
|
||||||
'});\n' +
|
'});\n' +
|
||||||
// TODO: Use React statics after upgrading React
|
|
||||||
'Post.content = content;\n' +
|
|
||||||
'module.exports = Post;\n'
|
'module.exports = Post;\n'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue