Skip to content

Move typescript to dev dependencies #28

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

Closed
wants to merge 1 commit into from

Conversation

rvikmanis
Copy link

Fixes issue #27.

@ezolenko
Copy link
Owner

ezolenko commented Aug 9, 2017

Thanks!

I'd rather add an option to override used typescript instead, with whatever user requires manually themselves. (I won't be able to work on it for some time though) This pr will break builds for some people.

There was a similar issue in the original plugin, they settled on having ts as direct dependency iirc.

Could you elaborate what's your use case, maybe there is a better way?

@rvikmanis
Copy link
Author

We're using your plugin in a big project, and simply haven't yet gotten around to updating our code for typescript 2.4.

I believe this issue would be a deal breaker for many, or would fragment the rollup-typescript plugin space even more by encouraging forks.

@ezolenko
Copy link
Owner

I see. I was going to suggest trying moving it to peerDependencies, but then I saw it is already there... And it is also depreciated in npm3... (https://codingwithspike.wordpress.com/2016/01/21/dealing-with-the-deprecation-of-peerdependencies-in-npm-3/)

If you are using npm3, could you try relaxing dependency rule for typescript to 2.x and see if you end up with one typescript in npm_modules that matches your project?

@wessberg
Copy link
Contributor

Imagine the following scenario:

  • This PR is merged.
  • A user (or automated build system for continuous integration), who has no local or global installation of Typescript npm install's this package.
  • The build fails: Typescript could not be resolved.

This plugin does have a runtime dependency on Typescript since the Language Service is used by the plugin. Hence, making it a development dependency will not only be a breaking change for many, but also make usage of automated builds via Travis/CircleCI/etc impossible without adding a hard dependency on Typescript which not all users may be aware of.

I agree with @ezolenko that we should make it possible to pass in another version of Typescript as an argument. Typescript v>=2.4.2 would then still be installed but not conflict with the version your team is using.

It would solve the problem without breaking changes and reduce possible errors and confusion for new users

@ezolenko
Copy link
Owner

Custom typescript option is in master now. If that works as expected we can close this PR.

@rvikmanis rvikmanis closed this Aug 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants