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

chore(wdio-types): remove implicit dependency on ts-node #8151

Merged

Conversation

boneskull
Copy link
Contributor

Before this, @wdio/types needs ts-node installed to be used (which is not present in its dependencies, devDependencies or otherwise). This is pretty annoying if you don't use ts-node otherwise.

I have copied the relevant types from ts-node and put them into src/Compiler.ts.

I have added typescript as a peerDependency, because @wdio/types now depends on types in the typescript package itself. Given that typescript is probably installed anyway by consumers, it did not seem appropriate to add it to dependencies. I can understand if we just want to drop this from peerDependencies altogether, but it does mean that there's still an implicit dependency, which doesn't really solve the problem.

Proposed changes

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Checklist

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • I have added proper type definitions for new commands (if appropriate)

Further comments

Reviewers: @webdriverio/project-committers

Before this, `@wdio/types` needs `ts-node` installed to be used (which is not present in its `dependencies`, `devDependencies` or otherwise). This is pretty annoying if you don't use `ts-node` otherwise.

I have copied the relevant types from `ts-node` and put them into `src/Compiler.ts`.

I have added `typescript` as a `peerDependency`, because `@wdio/types` now depends on types in the `typescript` package itself. Given that `typescript` is _probably installed anyway_ by consumers, it did not seem appropriate to add it to `dependencies`.  I can understand if we just want to drop this from `peerDependencies` altogether, but it _does_ mean that there's still an implicit dependency, which doesn't really solve the problem.
@boneskull
Copy link
Contributor Author

cc @christian-bromann

@boneskull
Copy link
Contributor Author

Another way to approach this would be to move the types which needed ts-node originally into a separate package or otherwise split these up. As a consumer of @wdio/types, I don't actually need any of the types that rely on it.

Copy link
Member

@christian-bromann christian-bromann left a comment

Choose a reason for hiding this comment

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

Thanks 👍

Even though we might run into issues when these types change upstream I think this is the best solution for now to move forward.

packages/wdio-types/src/Options.ts Outdated Show resolved Hide resolved
@christian-bromann christian-bromann added the PR: Polish 💅 PRs that contain improvements on existing features label Mar 23, 2022
@christian-bromann christian-bromann merged commit 03e0ffd into webdriverio:main Mar 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: Polish 💅 PRs that contain improvements on existing features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants