Skip to content

Provide complete E2E TypeScript scaffolding #27603

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

Open
MikeMcC399 opened this issue Aug 20, 2023 · 2 comments
Open

Provide complete E2E TypeScript scaffolding #27603

MikeMcC399 opened this issue Aug 20, 2023 · 2 comments
Labels
topic: typescript type: feature New feature that does not currently exist

Comments

@MikeMcC399
Copy link
Contributor

MikeMcC399 commented Aug 20, 2023

What would you like?

If the npm module typescript is installed with no other TypeScript configuration files defined, Cypress E2E scaffolding should set up a minimum configuration to enable the basic E2E example to run successfully with no errors. This would include adding the file tsconfig.json to the scaffolded Folder Structure.

Why is this needed?

First-time TypeScript users should experience the same smooth set up as JavaScript users currently do when installing Cypress and using a default configuration.

Steps to reproduce

mkdir cy-ts-test
cd cy-ts-test
git init
npm init -y
npm install typescript -D
npm install cypress -D
npx cypress open --e2e --browser electron

Click "Continue"
Click "Create new spec"
Click "Create spec"
Click "Okay, run the spec"

Note the error message

Error: Webpack Compilation Error
[tsl] ERROR
      TS18002: The 'files' list in config file 'tsconfig.json' is empty.

Note that if the line npm install typescript -D in the above steps is omitted, then scaffolding and running the example spec is successful.

Related issues

@jennifer-shehane
Copy link
Member

@MikeMcC399 We did want to make this change, but don't have the time to implement it. I anticipate this work will be a lot more complex than one might think when they start to implement it with all the logic and UI visuals that would be involved. I'll leave this open as a consideration.

@MikeMcC399
Copy link
Contributor Author

MikeMcC399 commented Sep 30, 2024

Scaffolding a TypeScript project so it runs without editing should also support when package.json is configured with Node.js type field set to module (ESM).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: typescript type: feature New feature that does not currently exist
Projects
None yet
Development

No branches or pull requests

2 participants