-
Notifications
You must be signed in to change notification settings - Fork 250
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
feat(cli): change react to create-react-app #1978
feat(cli): change react to create-react-app #1978
Conversation
As reported (stryker-mutator#1435) the react preset is only applicable to a react project set up by create-react-app. In addition, the error (unable to locate package react-scripts) isn't that useful either. Therefore, I propose we change the projectType to react-create-app as it resembles the applicability of this preset.
Lookin' good! Now that create-react-app also supports TypeScript, do the defaults of the |
@mthmulders good catch! See #1362 about CRA with TypeScript. This was still an open question from my end. @mthmulders or @MrFix93 do you know what the correct defaults are for different CRA setups? For example, our vue-cli has some more questions is asks before writing the config. We could do the same thing for CRA. |
I don't really know. I think the biggest difference is whether one uses TypeScript. If so, we should have Stryker use the TypeScript mutators instead of the JavaScript ones. Other than that none that I'm aware of. |
Good question @mthmulders. While I was implementing this, I questioned whether the react-ts is used at all. In addition, @nicojs, it looks like the only difference in both presets (jsx and tsx React) is that tsx uses So. We do need to know if the user wants tsx support, as it requires different dependencies (the typescript mutator). However, the create-react-app-ts preset in the jest-runner might be abandoned. Any views on this? In addition, it doesn't look like jest-runner supports Typescript and Javascript in a single project. Is that correct? |
That's an interesting idea. Let's do that in a future PR. It's smart to keep features in separate PR's.
In that case I would expect there to be 1 question after you choose for CRA. Namely: what source code language do you use. @MrFix93 do you mind adding that? Thanks again for your work so far! |
@MrFix93 If you want, we can also merge this PR and add the option in a separate PR. It's up to you |
There is already a question after the preset: That will suffice, right? If so, let's merge 🚀 |
Ah yes, damn we we're smart in the past 😅 |
@MrFix93 congrats on your first PR 🎉 |
As reported in issue #1435, the react preset is only applicable to a react project set up by create-react-app. It causes some confusion whereas the error (unable to locate package react-scripts) isn't that useful either. Therefore, I propose we change the projectType to react-create-app as it resembles the applicability of this preset.
For backwards compatibility, "react" and "react-ts" can still be used, however, it does log a deprecation warning.
ps. First PR 🚀