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

[Regression] types within augmentations.d.ts are not part of dist build #1162

Closed
3 tasks done
jbjhjm opened this issue Feb 22, 2024 · 3 comments
Closed
3 tasks done

Comments

@jbjhjm
Copy link

jbjhjm commented Feb 22, 2024

Current behavior

Updated to 20.0.1 and got a type error on window.testState being unknown.

image

Desired behavior

window.testState should be known, it is typed within augmentations.d.ts.

Investigation

All types besides those from augmentations.d.ts will be found.

I checked the distributed package and it turns out that it does not contain augmentations.d.ts anymore.

It seems that the file is ignored/discarded when building the library.

Versions

  • Cypress version: 13.0.0
  • Preprocessor version: 20.0.1
  • Node version: 18.17.0

Checklist

  • I've read the FAQ.
  • I've read instructions for logging issues.
  • I'm not using cypress-cucumber-preprocessor@4.3.1 (package name has changed and it is no longer the most recent version, see #689).
@badeball
Copy link
Owner

It seems that the file is ignored/discarded when building the library.

This was intentionally removed during some refactoring or other shenanigans. This SO thread outlines the challenge of exposing global variables: https://stackoverflow.com/questions/55659710/how-to-make-an-npm-module-with-globally-accessible-types

I just didn't feel inclined to comb through that stuff at the time, so I removed the types altogether.

If someone feels otherwise and want to do the work, then feel free to do so.

@ludo550
Copy link

ludo550 commented May 15, 2024

@jbjhjm , This is how I went about this to not show an error. (window as any).testState.pickle.tags . Not the cleanest, but for me, it not showing up with a red underline is good enough.

@jbjhjm
Copy link
Author

jbjhjm commented May 16, 2024

thanks @ludo550 , workarounds are possible of course, I was just irritated no typings for these are exported.
However we've moved on and are not using cucumber anymore, so this issue is not really relevant for me anymore.
I think I'll close this for now, and if someone comes along with the same problem it should be easy to find and write a PR for this.

@jbjhjm jbjhjm closed this as completed May 16, 2024
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