NathanWalker / nativescript-ng2-magic

Magically turn your Angular2 web app into a NativeScript app.
MIT License
64 stars 14 forks source link

Post install hooks are undesirable when sharing code #6

Closed vjoao closed 8 years ago

vjoao commented 8 years ago

I'm installing the ng2-magic and it's OK. The problem is when sharing code, as we changed the main.ts file to point to our start component and changed the run tasks on package.json. When another collaborator ran npm install to get his dependencies, the hooks just overwrote my changes on main.ts and on package.json.

I guess this is not the desirable behavior.

Any thoughts?

NathanWalker commented 8 years ago

Hi @vjoao thanks for this. Definitely not desirable behavior. I will circle @NathanaelA here, any thoughts on how we could avoid this scenario with the post installer?

NathanaelA commented 8 years ago

@vjoao interesting. I'm sure we can fix this. Can you tell me specifically which items it changed in your package.json and index.js, I thought I already had a safety check at least on the package.json...

NathanWalker commented 8 years ago

@NathanaelA I believe what's occurring here is for his collaborator, since he was just setting things up for the first time (pulling from @vjoao's repo which had already contained the postinstall modifications), it just overwrote them since it was a first time install for his collaborator.

@vjoao did you commit the nativescript folder to your repo? @NathanaelA We may be able to determine our '{N} is installed' check by seeing if that folder exists alone.

vjoao commented 8 years ago

Yes, the nativescript folder was on source control.

NathanWalker commented 8 years ago

@vjoao I have a fix coming this week for your reported issue. Thanks again for reporting it. In meantime, are you using routing? via @angular/router or @angular/router-deprecated?

vjoao commented 8 years ago

@NathanWalker cool =) I'm not using the router yet but we would go with the new one @angular/router

NathanWalker commented 8 years ago

Ok good to know. Thanks! I'll let you know when this issue is resolved!

vjoao commented 8 years ago

Well thank you! Amazing job =)

NathanWalker commented 8 years ago

Ok @vjoao Please update your main project package.json as well as nativescript/package.json to use latest version:

"nativescript-ng2-magic": "^1.5.0"

Lemme know if you have any further issues.