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

Switch create-redwood-app template to TypeScript #1810

Merged
merged 19 commits into from
Mar 7, 2021

Conversation

peterp
Copy link
Contributor

@peterp peterp commented Feb 18, 2021

We would like to give people the option to generate a TypeScript project. This PR will allow people to create both a JS and a TS RedwoodJS project. JavaScript will always be the default.

  • Create a working TypeScript template.
  • Convert the TypeScript project to a JavaScript project.
  • Use prettier to clean up the output.
  • Add a flag to not convert the TypeScript project to TypeScript.

@peterp peterp marked this pull request as draft February 18, 2021 13:18
@peterp peterp marked this pull request as draft February 18, 2021 13:18
@github-actions
Copy link

github-actions bot commented Feb 18, 2021

📦 PR Packages

Click to Show Package Download Links

https://rw-pr-redwoodjs-com.s3.amazonaws.com/1810/create-redwood-app-0.26.2-84f7fa1.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/1810/redwoodjs-api-0.26.2-84f7fa1.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/1810/redwoodjs-api-server-0.26.2-84f7fa1.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/1810/redwoodjs-auth-0.26.2-84f7fa1.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/1810/redwoodjs-cli-0.26.2-84f7fa1.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/1810/redwoodjs-core-0.26.2-84f7fa1.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/1810/redwoodjs-dev-server-0.26.2-84f7fa1.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/1810/redwoodjs-eslint-config-0.26.2-84f7fa1.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/1810/redwoodjs-eslint-plugin-redwood-0.26.2-84f7fa1.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/1810/redwoodjs-forms-0.26.2-84f7fa1.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/1810/redwoodjs-internal-0.26.2-84f7fa1.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/1810/redwoodjs-prerender-0.26.2-84f7fa1.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/1810/redwoodjs-router-0.26.2-84f7fa1.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/1810/redwoodjs-structure-0.26.2-84f7fa1.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/1810/redwoodjs-testing-0.26.2-84f7fa1.tgz
https://rw-pr-redwoodjs-com.s3.amazonaws.com/1810/redwoodjs-web-0.26.2-84f7fa1.tgz

Install this PR by running yarn rw upgrade --pr 1810:0.26.2-84f7fa1

@peterp peterp force-pushed the pp-convert-template-to-typescript branch from 63d8a62 to aa1ab68 Compare February 18, 2021 14:44
@jvanbaarsen
Copy link
Contributor

@peterp Does that mean that you "need" to use typescript when using Redwood? Or will it remain optional?

@peterp
Copy link
Contributor Author

peterp commented Feb 18, 2021

@jvanbaarsen 100% optional. It'll always be JavaScript by default.

@papaponmx
Copy link
Contributor

It looks like the only thing missing is to solve the conflicts, right?

@peterp peterp marked this pull request as ready for review February 19, 2021 15:25
@thedavidprice
Copy link
Contributor

adding @dac09 as a reviewer to confirm changes he made to CRWA template are reflected in the final changes here

@dac09
Copy link
Collaborator

dac09 commented Mar 1, 2021

Just needs:

  • App.js -> App.tsx after the changes in the last release.
  • Do we worry about custom index being JS in the TS version of the project when running yarn rw setup custom-web-index?

@cypress
Copy link

cypress bot commented Mar 7, 2021



Test summary

8 0 0 0Flakiness 1


Run details

Project RedwoodJS Framework
Status Passed
Commit a0c1155 ℹ️
Started Mar 7, 2021 6:44 AM
Ended Mar 7, 2021 6:46 AM
Duration 01:41 💡
OS Linux Ubuntu - 16.04
Browser Chrome 88

View run in Cypress Dashboard ➡️


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

@peterp peterp force-pushed the pp-convert-template-to-typescript branch from 9c4e341 to 3dab340 Compare March 7, 2021 06:11
@peterp
Copy link
Contributor Author

peterp commented Mar 7, 2021

@dac09 I'm sorry, I rewrote the test-tutorial function. It was failing for me when I was trying to make this work. I wanted to have it a bit more composable, so I broke each task into a separate function.

You can now do something like this:

./tasks/run-cypress /tmp/path --no-create --no-copy --no-start

https://github.com/redwoodjs/redwood/pull/1810/files#diff-e4d8d48827bb7da131ab93737cf7a718801e74e8c86b22e011f27dd4f948b1edR134-R143

/cc @thedavidprice

tasks/run-e2e Outdated Show resolved Hide resolved
packages/cli/src/commands/generate/scaffold/scaffold.js Outdated Show resolved Hide resolved
packages/internal/src/index.ts Outdated Show resolved Hide resolved
@peterp peterp merged commit 91cef20 into main Mar 7, 2021
dac09 added a commit to dac09/redwood that referenced this pull request Mar 7, 2021
…-e2e-tests

* 'main' of github.com:redwoodjs/redwood:
  Bump @apollo/client from 3.3.7 to 3.3.11 (redwoodjs#1923)
  Switch create-redwood-app template to TypeScript (redwoodjs#1810)
  Bump @graphql-tools/merge from 6.2.7 to 6.2.10 (redwoodjs#1910)
  Adds resolution to template, to prevent module duplication in web/node_modules (redwoodjs#1933)
  Update service generator to use Prisma namespace (redwoodjs#1853)
  Make storybook configurable in a redwood app  (redwoodjs#1828)
@thedavidprice thedavidprice added this to the next release milestone Mar 8, 2021
@thedavidprice thedavidprice deleted the pp-convert-template-to-typescript branch July 27, 2021 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants