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 TypeScript app creation #5550

Merged
merged 20 commits into from
Oct 24, 2018
Merged

Add TypeScript app creation #5550

merged 20 commits into from
Oct 24, 2018

Conversation

Timer
Copy link
Contributor

@Timer Timer commented Oct 24, 2018

This adds a --typescript flag to CRA. This flag will create an application with TypeScript instead of normal JavaScript.

@Timer Timer added this to the 2.1 milestone Oct 24, 2018
@Timer Timer mentioned this pull request Oct 24, 2018
3 tasks
@@ -0,0 +1,26 @@
{
Copy link
Contributor

Choose a reason for hiding this comment

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

Some notes: We would need to keep this in sync with the auto-generated tsconfig; and these comments will trigger a git diff if the user edit any property and rerun the server

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, maybe a plain file would be better.

Copy link
Contributor

@brunolemos brunolemos left a comment

Choose a reason for hiding this comment

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

On paths.js we have template/ hard coded, should that change?

@Timer
Copy link
Contributor Author

Timer commented Oct 24, 2018

On paths.js we have template/ hard coded, should that change?

No, this is a separate template.

@Timer Timer merged commit b50590f into facebook:master Oct 24, 2018
@Timer Timer deleted the typescript-template branch October 24, 2018 20:28
chanand pushed a commit to chanand/create-react-app that referenced this pull request Oct 25, 2018
* Add TypeScript app creation

* Actually specify new extension

* Check for ts and tsx

* Fix types in default service worker file

* Mirror changes in JS version of SW

* Separate templates

* Use separate template directory

* Remove unused function

* Add a tsconfig file to the template

* Test install of typescript

* Add e2e for TypeScript

* Check for index.tsx to make sure we're not in the JS template

* Ensure TypeScript doesn't leak into normal installs

* Ignore some files

* Print version of CRA

* Fix script

* Add new template

* Move test to correct location

* Use `verifyTypeScriptSetup` routine to populate files

* Ensure tsconfig is created
@rolandjitsu
Copy link

I'm guessing this has no support for tslint, or am I mistaken?

@bmingles
Copy link

I tried this npx [email protected] my-app-ts --typescript. Looks like typescript was installed in the project, but the source code is still plain .js

@brunolemos
Copy link
Contributor

npx create-react-app@next app-name --scripts-version=2.0.6-next.c662dfb0 --typescript

@bmingles
Copy link

That worked. Thanks.

zmitry pushed a commit to zmitry/create-react-app that referenced this pull request Oct 29, 2018
* Add TypeScript app creation

* Actually specify new extension

* Check for ts and tsx

* Fix types in default service worker file

* Mirror changes in JS version of SW

* Separate templates

* Use separate template directory

* Remove unused function

* Add a tsconfig file to the template

* Test install of typescript

* Add e2e for TypeScript

* Check for index.tsx to make sure we're not in the JS template

* Ensure TypeScript doesn't leak into normal installs

* Ignore some files

* Print version of CRA

* Fix script

* Add new template

* Move test to correct location

* Use `verifyTypeScriptSetup` routine to populate files

* Ensure tsconfig is created
nate770 pushed a commit to ONTW/create-react-app that referenced this pull request Oct 30, 2018
* Add TypeScript app creation

* Actually specify new extension

* Check for ts and tsx

* Fix types in default service worker file

* Mirror changes in JS version of SW

* Separate templates

* Use separate template directory

* Remove unused function

* Add a tsconfig file to the template

* Test install of typescript

* Add e2e for TypeScript

* Check for index.tsx to make sure we're not in the JS template

* Ensure TypeScript doesn't leak into normal installs

* Ignore some files

* Print version of CRA

* Fix script

* Add new template

* Move test to correct location

* Use `verifyTypeScriptSetup` routine to populate files

* Ensure tsconfig is created
@lock lock bot locked and limited conversation to collaborators Jan 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants