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

support typescript #37

Closed
Morriz opened this issue Jun 15, 2020 · 13 comments
Closed

support typescript #37

Morriz opened this issue Jun 15, 2020 · 13 comments

Comments

@Morriz
Copy link

Morriz commented Jun 15, 2020

Hi, it would be nice if you could support typescript as well, knowing that cypress supports it out of the box now.

@archfz
Copy link
Owner

archfz commented Jun 15, 2020

@Morriz what do you mean by typescript support ?

@Morriz
Copy link
Author

Morriz commented Jun 15, 2020

I think you would have to export the types for your javascript exports in a separate .d.ts file.

@archfz
Copy link
Owner

archfz commented Jun 15, 2020

I am not sure I follow. Do you mean that this plugin is not usable if you have webpack with typescript enabled for cypress?

@archfz
Copy link
Owner

archfz commented Jun 15, 2020

Or do you mean that we should write this plugin in typescript? I think it's not that important for this module to be in typescript.

@archfz
Copy link
Owner

archfz commented Jun 16, 2020

@Morriz ?

@Morriz
Copy link
Author

Morriz commented Jun 17, 2020

I am not sure I follow. Do you mean that this plugin is not usable if you have webpack with typescript enabled for cypress?

No, it’s usable as is, but with the types added it works with ts as well. There are probably some type inference tools out there so you can build it

@Morriz
Copy link
Author

Morriz commented Jun 17, 2020

@archfz
Copy link
Owner

archfz commented Jun 17, 2020

I still don't quite get what the requirement would be here.

  1. Transform this repository to be written in typescript? - I think there is no need for it, I don't expect too much growth on this repo at this time
  2. Add d.ts files for the install plugin and install support? - If this is what you are asking then I will leave this task; but still there is not much value to gain from it. It would only help a bit with the options typing. But since cypress either way uses .js for the support.js and plugin.js I don't even think it would work.

@Morriz
Copy link
Author

Morriz commented Jun 28, 2020

I allows TS now everywhere...also plugins and support

@SgtPooki
Copy link

It would work if you add types. Types do not hinder a js package in any way except for maintenance. But you can still write your package in js, and use //@ts-check and even benefit from your own type definitions.

@archfz
Copy link
Owner

archfz commented Sep 18, 2020

@SgtPooki If types in need we should transform the whole code to typescript. It wouldnt be that hard and in that way we can generate also automatically d.ts file. This could be a good exercise so help on this is welcome.

@archfz
Copy link
Owner

archfz commented Oct 3, 2020

Done in #52. Coming up in next release.

@archfz
Copy link
Owner

archfz commented Oct 8, 2020

Released in 2.1.0.

@archfz archfz closed this as completed Oct 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants