-
Notifications
You must be signed in to change notification settings - Fork 1k
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
TypeScript: Generators and Templates tracking issue #523
Comments
I've picked up SDL and Service, will post in the forum for volunteers for the rest! |
I would start with Helpers 😎 |
@MarkPollmann FYI I've extracted the functionality to transform generated TS into prettier-ified JS, you can take a look at my PR or just branch off it. |
Hello hello, I'd like to pick up the Component work next week. It would be what's under wait, it appears twice in the checklist 🤔 |
@kimadeline That would be amazing, thank you! None of the core folks are TS experts so any help is greatly appreciated. Looks like @thedavidprice already updated the list to remove that second reference—we do only have one component generator, honest! |
Hi @kimadeline! Grateful in advance for the help --> yes, please 🚀 For examples of implementation in progress, do check out the work on #515 and #557 (I'm behind on reviews but will make it a priority this weekend.)
^^ yes, indeed
^^ 'cause we are super thorough around here... also double pleasure of checking off lists when done! (great catch, thank you --> edited 😉) |
@peterp @kimadeline
^^ original idea was to have the generator refuse if either language exists. But I proposed that without any discussion. I have no strong opinion either way other than to defer to what we think user will expect and either warn or refuse if generator behavior might be unanticipated. And to have all the generators behave the same. Thoughts/recommendations? 1) refuse on either language 2) refuse on same language 3) middle path (e.g. warn) |
I have no strong opinion either, mostly from lack of exposure to hybrid projects 🙈 I agree with your other points though, going with what users would expect and unifying generator behaviour. Now, what do you think users would expect? 🤔 |
Hey, guys. I'd like to help with this adding TS support, is Scaffold is still available? |
HI @papaponmx! Thanks for jumping in here and offering to help, which would be 🚀 However, the Scaffold generator is blocked by Cells and potentially the Router. Before being able to convert the generators, Cells will have to be completed. Looping in @peterp Copy+paste from the linked thread in the OP:
This is a bit outdated. @peterp do you have direction about the next steps for Cell's TS Support? Also, am I correct in understanding the necessary Router TS support is completed? |
The Router TS support is in progress here: #1651 |
This is a sub-tracking issue of #234
Generators are a part of the CLI package and located in this directory:
https://github.com/redwoodjs/redwood/tree/master/packages/cli/src/commands/generate
The CLI package is built with Yargs. Read more here.
Goal
The intention is to provide a path for a collaborative, incremental transition to having 100% TypeScript generators. This means the scope of a PR can be an individual generator, which can be merged into the master branch on its own when it's ready.
.ts
.ts
and.js
; this applies to 1) refusing to run if files already exist and 2) overwriting existing files using--force
--force
option; a clear explanation message should be givents.transpile
and prettier, but this needs evaluation)ts.ScriptTarget
; "ESNext" seems like a candidate--javascript
or--typescript
redwood.toml
if given.tsconfig.json
exists and there is noredwood.toml
override, the generator will automatically set--typescript
totrue
. Therefore, runningyarn rw g [option]
will target typescript....test.ts|js
files need to passyarn rw test
andyarn rw lint
Steps to Convert a Specific Generator
__tests__
directory files and fixtures to TS[--javascript|--typescript]
to each generator CLI command[-js|-ts]
respectively--javascript
or--typescript
option..test.ts/js
files passyarn rw lint
andyarn rw test
?Checklist: Templates and Generators
PR CLI: Convert helpers and src/lib to ts #557stalled out)__tests__/helpers.test.js
to TShelpers.js
to TSnote: these files are outside generators/, but the functionality that relates to generators should be moved to
src/commands/generators
templates/
files to TS__tests__/
fixtures andtest.js
to TS--javascript
as defaulttemplates/
file to TS__tests__/
fixtures andtest.js
to TS--javascript
as defaulttemplates/
files to TS__tests__/
fixtures andtest.js
to TS--javascript
as defaulttemplates/
files to TS__tests__/
fixtures andtest.js
to TS--javascript
as defaulttemplates/
file to TS__tests__/
fixtures andtest.js
to TS--javascript
as defaulttemplates/
files to TS__tests__/
fixtures andtest.js
to TS--javascript
as defaulttemplates/
files to TS__tests__/
fixtures andtest.js
to TS--javascript
as defaulttemplates/
files to TS: components, layouts, and pages__tests__/
fixtures andtest.js
to TS--javascript
as defaultThe text was updated successfully, but these errors were encountered: