Skip to content

Conversation

@JoeStanton
Copy link
Contributor

Resolves#275, #293. Discussed in #405.

Rewritten the init script in Node to remove the dependency on Ruby. I've also moved it into the react-native-cli directory as I thought it was cleaner.

@vjeux
Copy link
Contributor

Sweet!

init.sh should be outside of the cli folder. Since the cli is global, it's super hard to update. What it does is just forward all the commands to react-native which can be updated easily.

@JoeStantonJoeStantonforce-pushed the init-to-nodejs branch 2 times, most recently from 7fb25db to 1a2357bCompareMarch 29, 2015 15:13
@JoeStanton
Copy link
ContributorAuthor

Ah that makes sense, global packages are annoying to update. Moved it back out.

@vjeux
Copy link
Contributor

Looks good, i'll test it and merge it later today or tomorrow, thanks!

init.sh Outdated
Copy link
Contributor

Choose a reason for hiding this comment

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

This file no longer has to be invoked via shell. Since it's all JS, you can just require and run it from cli.js

@frantic
Copy link
Contributor

Awesome job @JoeStanton! I have a few suggestions - see inline comments

init.sh Outdated

Choose a reason for hiding this comment

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

Not 100% on this, but from when I started this over the weekend as well, I think that ruby’s __FILE__ returns just the filename (init.sh), while node’s __filename includes the full path resolution (/Users/user/path/to/react-native/init.sh).

@facebook-github-botfacebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Apr 7, 2015
@nicklockwood
Copy link
Contributor

@frantic what happened to this? Can we resurrect it?

@JoeStanton
Copy link
ContributorAuthor

Hey! My fault - Life got in the way for a few weeks. I can finish this up in the next couple of days if there's still the appetite for it?

@nicklockwood
Copy link
Contributor

@JoeStanton yes please!

This will remove the dependency on Ruby.
@JoeStantonJoeStantonforce-pushed the init-to-nodejs branch 2 times, most recently from 2f43e1d to 71abc5fCompareMay 14, 2015 14:24
@JoeStantonJoeStantonforce-pushed the init-to-nodejs branch 3 times, most recently from b15f5ed to 526890dCompareMay 14, 2015 14:56
@JoeStantonJoeStantonforce-pushed the init-to-nodejs branch 2 times, most recently from 8571ce3 to 52e7b80CompareMay 14, 2015 15:07
@JoeStanton
Copy link
ContributorAuthor

Hey Guys - Finally had a little bit of time, can you take a look at this? AFAIK I can't put init.js inside the local-cli folder as @vjeux said previously. Does this still apply?

Secondly, the init.js could be cleaned up nicely with some ES6 features, but I've targeted ES5 for the moment unless theres a way to run it through the packager (probably overkill).

@vjeux
Copy link
Contributor

@JoeStanton you can't put it in react-native-cli, but you CAN put it in local-cli (that's the right place where to put it)

@JoeStanton
Copy link
ContributorAuthor

Excellent - fixed that up.

Copy link
Contributor

Choose a reason for hiding this comment

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

nit: space after if

@vjeux
Copy link
Contributor

Thanks, a few minor details and we're good to go :)

@vjeux
Copy link
Contributor

Oh you are right, nevermind me

vjeux added a commit that referenced this pull request May 14, 2015
@vjeuxvjeux merged commit b2d1d6f into facebook:masterMay 14, 2015
@JoeStantonJoeStanton deleted the init-to-nodejs branch May 14, 2015 20:40
@JoeStantonJoeStanton mentioned this pull request May 14, 2015
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA SignedThis label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@JoeStanton@vjeux@frantic@nicklockwood@iamdustan@facebook-github-bot@reactjs-bot