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

Include ts-to-js transpiling within create-redwood-app.js (instead of the current separate CLI command) #1954

Closed
Tracked by #3989
thedavidprice opened this issue Mar 10, 2021 · 8 comments
Labels
topic/crwa create-redwood-app

Comments

@thedavidprice
Copy link
Contributor

Currently, we skip the ...rw ts-to-js command in the current E2E tests, which is good for testings a TS project. However, since this is a critical path and the default for new project installation, it seems to me we should include it. And I don't believe the E2E tests will differ based on project being TS or JS, will it?

A simple way would be to change this line by removing --no-javascript flag:

[REDWOOD_PROJECT_DIRECTORY, '--no-yarn-install', '--no-javascript'],

Is there reason to not do this here? If so, where else could we add the test?

@thedavidprice
Copy link
Contributor Author

Scratch that. I wrote this after diagnosing QA problems but hadn't looked at the GitHub runner. Confirming we are testing this command in the CI Check.

The run-e2e.js Yargs options are not intuitive for local workflows. Will re-evaluate and suggest next steps.

@peterp
Copy link
Contributor

peterp commented Mar 10, 2021

Sorry that this isn't as intuitive as I imagined, the reason why we're doing this is because we don't install the packages once the project is created. This means the rw command isn't available.

We copy the packages from the framework and then install everything, then we convert it.

If you do run-e2e --help you get the following options:

Options:
  --version                   Show version number                      [boolean]
  --create-project, --create                           [boolean] [default: true]
  --copy-framework, --copy                             [boolean] [default: true]
  --js-project, --js                                   [boolean] [default: true]
  --auto-start, --start                                [boolean] [default: true]
  --help                      Show help                                [boolean]

Examples:
  run-cypress
  run-cypress /tmp/redwood-app --no-js-project

Not supplying any options does everything standard; so in your case I think you want to point it to an existing project?

./tasks/run-e2e /path/to/existing-project --no-create --no-copy --no-js

@thedavidprice
Copy link
Contributor Author

It made sense why once I went through the CI workflow along with command. Thanks!

Yes, that's what I did. Then upgraded to canary and then ran ts-to-js. Confirming it all worked.

@peterp
Copy link
Contributor

peterp commented Mar 10, 2021

I can also make the code that transpiles the TS to JS part of create-redwood-app instead of a separate command, which is probably what I should do so that we don't have these issues.

Re-opening with that as the task.

@peterp peterp reopened this Mar 10, 2021
@peterp peterp changed the title CI: add yarn rw ts-to-js to E2E script (and checks) Inline ts-to-js code instead of making it a separate command. Mar 10, 2021
@peterp peterp self-assigned this Mar 10, 2021
@thedavidprice
Copy link
Contributor Author

@peterp bumping this one. I think your comment above about transpiling as part of CRWA is the right way to go.

Updating title.

@thedavidprice thedavidprice changed the title Inline ts-to-js code instead of making it a separate command. Include ts-to-js transpiling within create-redwood-app.js (instead of the current separate CLI command) May 26, 2021
@thedavidprice
Copy link
Contributor Author

Another issue this will resolve --> Currently it's impossible to run --no-yarn-install without also adding --typescript option. It will otherwise fail because it tries to convert ts to js but can't because no yarn.

@jtoar jtoar added topic/crwa create-redwood-app and removed good first issue help wanted labels Jun 5, 2021
@jtoar jtoar self-assigned this Jun 10, 2021
@jtoar jtoar added this to the future-release milestone Jun 10, 2021
@peterp peterp removed their assignment Nov 3, 2021
@jtoar jtoar removed this from the future-release milestone Dec 10, 2021
@Josh-Walker-GM
Copy link
Collaborator

@jtoar Thoughts on closing this one out? We now include both js and ts templates in the create redwood app package and simply copy over the relevant template at install time - no transpilation needed. I think this meets the general theme of this issue.

@jtoar
Copy link
Contributor

jtoar commented Sep 16, 2023

@Josh-Walker-GM good call!

@jtoar jtoar closed this as completed Sep 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic/crwa create-redwood-app
Projects
Status: Done
Development

No branches or pull requests

4 participants