-
Notifications
You must be signed in to change notification settings - Fork 10
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
typing support for public capabilities of Greenwood #1250
Comments
I do like writing my config files in typescript, with typing support, because it helps avoid problems where you write an invalid configuration file and unexpected things do and do not work. I'm not sure which is worse, when a program fails to start on an invalid config file and you have no clue why or where in the file you go something wrong because the file is entirely untyped, or where it loads a partial file and you can't tell if the config file is wrong or the feature doesn't work as expected. |
Indeed! This will definitely be looked into as part of the next batch of work we take on (just finishing up a new release line as we speak), and for sure even just typing the configuration file alone would be a really nice quality of life enhancement; be it JS Doc style annotations, or just full on TS support, e.g. greenwood.config.ts. 💯 |
Summary
While Greenwood is a build tool without much of a public API other than its CLI and plugins, there are some areas that should probably provide typing to users through JSDocs, maybe TS but I'm not super keen on TypeScript in libraries.
Details
Most obvious ones that come to mind are:
ResourceInterface
lol)We would also want to make sure we validate these through CI somehow, ideally using these config files in our own projects and / or test cases.
Raised in #1292 (comment), a good point was raised about authoring Greenwood plugins (and probably also _greenwood.config.js in TypeScript. Might need to make another issue for that once we can land this one first, unless its easy to do it all in one go with something like sucrase, which we are using now in WCC.
The text was updated successfully, but these errors were encountered: