jeffijoe / typesync

Install missing TypeScript typings for dependencies in your package.json.
MIT License
1.53k stars 22 forks source link

do actual install #3

Closed tomas-sereikis closed 6 years ago

tomas-sereikis commented 7 years ago

Great package, but why not add the actual install if the dependencies where added and lest say put it under custom flag like typesync --install. Because what i would love to do is just to add it in my post install scripts and do not care about it at all.

jeffijoe commented 7 years ago

Because TypeSync does not make any assumptions about what package manager you're using.

For example, yarn has to update yarn.lock, npm updates package-lock.json.

Additionally, doing typesync && yarn or typesync && npm install does the trick nicely without TypeSync having to worry about what package manager you're using. 😃

Does that resolve this issue, or do you think there's something that can be done on TypeSync's side?

tomas-sereikis commented 7 years ago

well just so you can not use it with post-install scripts because it will give you a infinite loop, install triggers -> typesync that triggers -> install that triggers -> typesync and so on :)

jeffijoe commented 7 years ago

Yeah that's what I was thinking would happen! :D Even so, there's still the case of npm vs yarn.

1natsu172 commented 5 years ago

@tomas-sereikis @jeffijoe

Great package! We can now use --ignore-scripts to suppress the postinstall infinite loop.

"scripts": {
  "postinstall": "npx typesync && yarn install --ignore-scripts" 
}

This may be better if written in README as an example of Tips?

jeffijoe commented 5 years ago

Alternatively, add my original suggestion as a run script 😄