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

Support node 7 and directories with spaces #762

Merged

Conversation

drewpc
Copy link
Collaborator

@drewpc drewpc commented Nov 16, 2016

Fixes bootstrap process identified in #761. Also fixes a minor issue when running tests in a folder structure with invalid shell characters in the folder names (spaces, single quotes, etc).

…oupled with recent versions of nodejs (like v7.1.0). Update Travis to use stable versions of node.
… single quotes, etc) in them while executing the generator-react-server tests to install dependencies with npm. We get lazy with Mac OS X and have poorly named folder structures that don't work well when executing shell scripts.
@CLAassistant
Copy link

CLAassistant commented Nov 16, 2016

CLA assistant check
All committers have signed the CLA.

@@ -8,7 +8,6 @@
"prepublish": "gulp build",
"start": "react-server start",
"test": "gulp test",
"debug": "node-debug --debug-brk=0 -p 9000 react-server start",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pretty sure we want to keep the debug target for test pages -- it's purpose is a place to repro and debug issues.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually suggested on slack that we just drop it for now and re-add with node --inspect once someone figures out how to do that.

Didn't want to put that on @drewpc for this PR, since getting node 7 working is already tangential to what he's actually trying to do. 😆

@@ -37,7 +37,8 @@
"yeoman-test": "^1.0.0",
"babel-eslint": "^7.0.0",
"eslint": "^3.8.1",
"eslint-plugin-react": "^6.4.1"
"eslint-plugin-react": "^6.4.1",
"shell-escape": "^0.2.0"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the indentation is off here

@@ -129,7 +130,7 @@ function installDeps() {
} else {
const localDeps = ['react-server-cli', 'react-server']
.map(dep => path.resolve(path.join(__dirname, '../..', dep)));
cp.exec('npm install ' + localDeps.join(' '), (error) => {
cp.exec(shellescape(['npm', 'install'].concat(localDeps)), (error) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity, is there a deps that needs escaping, or is this defensive in case we add one? I think the change is good either way

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when the current path has spaces in it, it screws up the cp.exec() call. Example:

cp.exec('npm install /my path with spaces/react-server-cli')

What should happen instead is something like this:

cp.exec('npm install /my\ path\ with\ spaces/react-server-cli')

Same thing would happen if there were a ' in the path...it would mess up the JavaScript string.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoa, nice extra fix here!

@gigabo
Copy link
Contributor

gigabo commented Nov 18, 2016

Looks like the indentation is cleaned up (thanks for catching that @doug-wade).

I've created #765 to capture the need to re-introduce a "debug" script to test pages.

Gonna get this merged to unblock folks on node 7. Thanks @drewpc!

@gigabo gigabo dismissed doug-wade’s stale review November 18, 2016 19:27

Next steps for the "debug" script in #765. Thanks!

@gigabo gigabo merged commit 0e0dead into redfin:master Nov 18, 2016
@gigabo gigabo changed the title Patch fix bootstrap using modern nodejs Support node 7 and directories with spaces Nov 18, 2016
@gigabo gigabo added the enhancement New functionality. label Nov 18, 2016
@drewpc drewpc deleted the patch-fix-bootstrap-using-modern-nodejs branch December 9, 2016 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants