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

Add instructions for 'out-of-the-box' TypeScript support #412

Merged

Conversation

bauglir
Copy link
Contributor

@bauglir bauglir commented Jul 10, 2020

Cypress v4.4.0 supports TypeScript without additional preprocessors (cypress-io/cypress#1859).

These are the instructions for setting that up with the Cucumber preprocessor. Which, granted, are very similar to the tsify solution but require less additional dependencies.

I'm submitting this for consideration, but have to make the note that this is blocked by cypress-io/cypress-browserify-preprocessor#56, so merging will probably have to wait until that issue is resolved.

Cypress v4.4.0 supports TypeScript without additional preprocessors
(cypress-io/cypress#1859). These are the
instructions for setting that up with the Cucumber preprocessor.
@lgandecki
Copy link
Collaborator

wow, impressive debugging :)

Let's wait and see what the cypress guys say.

Thanks!

@bauglir
Copy link
Contributor Author

bauglir commented Jul 15, 2020

The fix was accepted and made it into @cypress/browserify-preprocessor@v3.0.1. I guess that means the current instructions should work as soon as Cypress itself (and possibly this package) depends on that version.

Looking back at the instructions, I guess it's also necessary to explicitly depend on the @cypress/browserify-preprocessor as well. It still helps that it's not necessary to introduce an additional dependency, but I don't think you can import transient dependencies either. That makes this slightly less useful than I had hoped :)

Even though this preprocessor itself also depends on the browserify-preprocessor, I don't think it makes sense to add functionality to expose the TypeScript functionality through that relation. Especially since it looks like there's a migration in progress for the default preprocessor to Webpack.

Just let me know if you want me to add a note to the instructions about depending on @cypress/browserify-preprocessor explicitly.

…nction transforms

The preprocessor provided by this package takes the form of a function,
which isn't supported by older versions of the browserify preprocessor.
The most recent versions are also necessary to support out-of-the-box
TypeScript.

References #412.
@bauglir
Copy link
Contributor Author

bauglir commented Aug 3, 2020

It looks like updating the dependency on @cypress/browserify-preprocessor in this package is actually sufficient to make this work. That does remove support for Node v8, I'm not sure if that's an issue. I guess it isn't as I don't think that version is officially supported anymore. But apart from that, I think this should be good to merge

That is if the tests were passing. I'm not sure what's going in CI, locally these tests fail, and from what I can see this doesn't happen in anything that I touched.

@lgandecki
Copy link
Collaborator

Circle runs on node 8, changing circle.yml here:
https://github.com/TheBrainFamily/cypress-cucumber-preprocessor/blob/master/circle.yml#L5
to:

  • image: cypress/base:12 should help, wanna give it a try?

The updated dependency on @cypress/browserify-preprocessor introduced in
5f73e4d no longer supports Node.js v8.

References #412.
@lgandecki
Copy link
Collaborator

Ok, looks like something is actually wrong with the dependency:
fs-extra/lib/mkdirs/make-dir.js:86
I will take a look.

@lgandecki
Copy link
Collaborator

What's interesting, I thought I saw this error before and I thought updating nodejs helped, now I see that this seems to be the solution:

vercel/pkg#883

not sure yet why it didn't help in our case

@bauglir
Copy link
Contributor Author

bauglir commented Aug 4, 2020

I'm already looking into it a bit as well. This issue had a similar error message and it looks like it's caused by an outdated fs-extra dependency. Upgrading to at least v9.0.0 should fix the issue. This is a transient dependency though, so updates to other packages are likely necessary.

The dependencies that depend on fs-extra are @semantic-release/github and @semantic-release/npm on ^v7.0.0, commitizen on ^v8.0.0 and cypress on v5.0.0. Given that the former three are not directly involved in tests, I'm pretty sure it's the Cypress dependency that's causing the issue. It looks like upgrading to at least v3.5.0 might do the trick.

@bauglir
Copy link
Contributor Author

bauglir commented Aug 4, 2020

After an upgrade to Cypress v3.8.3 all tests pass as expected, should I push a commit that includes that upgrade? Or would you like to introduce these types of upgrades separately? This is growing a bit out-of-proportion for a documentation update 😄

@lgandecki
Copy link
Collaborator

haha, you are right, it's getting a bit out of the original scope, but not a big deal, please do push here, it's ok :) just make sure you add a proper commit message and I will rebase instead of squashing

An outdated transient dependency (`fs-extra`) is causing syntax/parsing
issues on Node v12.  Upgrading the Cypress dependency includes an update
to this transient dependency allowing Cypress to run on more recent Node
versions.

References #412.
@bauglir
Copy link
Contributor Author

bauglir commented Aug 4, 2020

Looks like it's all good now :)

@lgandecki lgandecki merged commit 0b7be83 into badeball:master Aug 4, 2020
lgandecki pushed a commit that referenced this pull request Aug 4, 2020
…nction transforms

The preprocessor provided by this package takes the form of a function,
which isn't supported by older versions of the browserify preprocessor.
The most recent versions are also necessary to support out-of-the-box
TypeScript.

References #412.
lgandecki pushed a commit that referenced this pull request Aug 4, 2020
The updated dependency on @cypress/browserify-preprocessor introduced in
5f73e4d no longer supports Node.js v8.

References #412.
@bauglir bauglir deleted the document-out-of-the-box-typescript branch August 4, 2020 08:27
@bauglir
Copy link
Contributor Author

bauglir commented Aug 4, 2020

Thanks @lgandecki!

@lgandecki
Copy link
Collaborator

🎉 This PR is included in version 2.5.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants