Skip to content

fix: changes to correct typescript detection behavior#22058

Merged
tgriesser merged 9 commits intodevelopfrom
tgriesser/fix/change-typescript-detection-rules
Jun 2, 2022
Merged

fix: changes to correct typescript detection behavior#22058
tgriesser merged 9 commits intodevelopfrom
tgriesser/fix/change-typescript-detection-rules

Conversation

@tgriesser
Copy link
Copy Markdown
Member

User facing changelog

  • Changes the detection to ensure typescript actually exists (via require.resolve) and is specified in dependencies / devDependencies before migrating a project to use it.
  • Improves the checks to match the algorithm of whether we should use the *tsconfig.json glob, which should only happen when we're creating a new project, not migrating an existing one. If we're migrating, looking at the existing files in the cypress folder should be enough info to make the determination.
  • Ensures we explicitly don't include .d.ts files when making the determination of JS vs. TS project

Additional details

Steps to test

How has the user experience changed?

PR Tasks

  • Have tests been added/updated?
  • Has the original issue (or this PR, if no issue exists) been tagged with a release in ZenHub? (user-facing changes only)
  • Has a PR for user-facing changes been opened in cypress-documentation?
  • Have API changes been updated in the type definitions?

@tgriesser tgriesser requested review from a team as code owners June 2, 2022 19:19
@tgriesser tgriesser requested review from jennifer-shehane and removed request for a team June 2, 2022 19:19
@cypress-bot
Copy link
Copy Markdown
Contributor

cypress-bot Bot commented Jun 2, 2022

Thanks for taking the time to open a PR!

@tgriesser tgriesser requested review from flotwig and mjhenkes June 2, 2022 19:21
@cypress
Copy link
Copy Markdown

cypress Bot commented Jun 2, 2022



Test summary

37552 1 454 0Flakiness 5


Run details

Project cypress
Status Failed
Commit 482f29b
Started Jun 2, 2022 9:29 PM
Ended Jun 2, 2022 9:46 PM
Duration 16:20 💡
OS Linux Debian - 10.11
Browser Multiple

View run in Cypress Dashboard ➡️


Failures

cypress/e2e/commands/actions/click.cy.js Failed
1 ... > scroll-behavior > can scroll to and click elements in html with scroll-behavior: smooth

Flakiness

commands/navigation.cy.js Flakiness
1 src/cy/commands/navigation > #visit > window immediately resolves and doesn't reload when visiting the same URL with hashes
e2e/origin/commands/actions.cy.ts Flakiness
1 cy.origin actions > #consoleProps > .submit()
cypress/proxy-logging.cy.ts Flakiness
1 Proxy Logging > request logging > xhr log has response body/status code when xhr response is logged second
2 Proxy Logging > request logging > xhr log has response body/status code when xhr response is logged second
e2e/origin/commands/assertions.cy.ts Flakiness
1 cy.origin assertions > #consoleProps > .should() and .and()

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

Comment thread packages/scaffold-config/src/detect.ts Outdated
Co-authored-by: Matt Henkes <mjhenkes@gmail.com>
@tgriesser tgriesser requested a review from mjhenkes June 2, 2022 20:13
Comment thread packages/scaffold-config/src/detect.ts Outdated
tgriesser added 3 commits June 2, 2022 16:20
…hub.com:cypress-io/cypress into tgriesser/fix/change-typescript-detection-rules

* 'tgriesser/fix/change-typescript-detection-rules' of github.com:cypress-io/cypress:
  Update packages/scaffold-config/src/detect.ts
@tgriesser tgriesser requested review from estrada9166 and mjhenkes June 2, 2022 20:22
@tgriesser tgriesser requested review from ZachJW34 and mjhenkes June 2, 2022 20:22
@mjhenkes mjhenkes linked an issue Jun 2, 2022 that may be closed by this pull request
tgriesser added 2 commits June 2, 2022 16:33
…hub.com:cypress-io/cypress into tgriesser/fix/change-typescript-detection-rules

* 'tgriesser/fix/change-typescript-detection-rules' of github.com:cypress-io/cypress:
  fix: do not watch specs on run mode (#22060)
  fix: #22038 support esm import for windows (#22042)
  fix: Change ffmpeg to post process at priority 20 (#21587)
Copy link
Copy Markdown
Contributor

@ZachJW34 ZachJW34 left a comment

Choose a reason for hiding this comment

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

Ran through all the scenarios, works great.

Comment thread packages/scaffold-config/src/detect.ts Outdated
}

if ('typescript' in (pkgJson.dependencies || {}) || 'typescript' in (pkgJson.devDependencies || {})) {
// If we can't find an installed TypeScript or ESBuild, there's no way we can assume the project is using TypeScript,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: or ESBuild I don't see anywhere we are checking for ESBuild

Comment thread packages/scaffold-config/src/detect.ts Outdated
@tgriesser tgriesser merged commit 309c31f into develop Jun 2, 2022
@tgriesser tgriesser deleted the tgriesser/fix/change-typescript-detection-rules branch June 2, 2022 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

4 participants