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

ts-pnp should be a peer/optional dependency. #7

Closed
jpickwell opened this issue Dec 17, 2018 · 3 comments
Closed

ts-pnp should be a peer/optional dependency. #7

jpickwell opened this issue Dec 17, 2018 · 3 comments

Comments

@jpickwell
Copy link

To avoid getting an unmet peer dependency "typescript@*" warning, ts-pnp should be a peer or optional dependency. Your only use of ts-pnp is in an exported function that isn't used by your code. I don't see why your code should have anything typescript specific in it. If it's needed by external code, then make your interface more generic, and let that external code do whatever it needs to to hook in to your code.

@arcanis
Copy link
Owner

arcanis commented Dec 17, 2018

Unfortunately if ts-pnp was a peer dependency the same problem would happen (except that the warning would be unmet peer dependency "ts-pnp@*"). If it was an optional dependency, the warning would also always be there (optional dependencies only downgrade hard failures). The TS helper is very small and could be implemented in a separate package, but I wanted pnp-webpack-plugin to be as ready-to-use as possible.

Starting from Yarn 1.14 (scheduled for release in a few days) we'll add support for optional peer dependencies, which will hopefully solve this issue - I'll just declare typescript as an optional peer dependency of pnp-webpack-plugin, which will silence the warning 🙂

@wedi
Copy link

wedi commented May 13, 2019

optionalDependencies are here! 🎉

Is it just a matter of adding it to package.json? I havent' created a pull request (yet) as I don't know which version selector to use.

    "optionalDependencies": {
        "typescript": "^3.4.5"
    }

@arcanis
Copy link
Owner

arcanis commented May 13, 2019

Optional *peer dependency 🙂

It should already be good - typescript is declared as an optional peer dependency of ts-pnp (cf here), so that should fix the problem.

@arcanis arcanis closed this as completed May 13, 2019
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

No branches or pull requests

3 participants