-
Notifications
You must be signed in to change notification settings - Fork 46
Configuration file support #31
Comments
I'm thinking about implementing this since I just switched my build to typewiz-webpack and I really want to take advantage of the newer features which aren't enabled by default. I imagine the following: Config File
the result would look something like:
Plugin Integrationtypewiz-webpackWe can pass the config path to the loader:
and to the plugin:
typewiz-nodeWe could pass the config path to the normal command or detect it automatically, the former might be difficult when using it with mocha though. Internal HandlingThis leaves the question what the config file actually does. Do we want a central config file handling in typewiz (with |
Great write up @zoehneto, pretty much summarizes my thoughts :) As for the internal handling part, I see two approaches:
{
"common": {
"rootDir": "...",
"tsConfig": "..."
},
"instrument": {
"instrumentCallExpressions": true,
"instrumentImplicitThis": true
},
"applyTypes": {
"prefix": "TypeWiz |"
}
} Then you can just pass the appropriate section to each of the functions, merged with the "common" section. Another approach would be to create helper functions that only return the relevant part of configurations for each of the functions, e.g. Thoughts? |
I like the splitting into different sections from approach 1 since it nicely represents the stages of the typewiz process and also makes it more clear what options do / where they are used ('prefix' by its self doesn't tell you when its used). But we should probably still create the helper functions so we can decouple the config file properties from the options passed to the individual functions. |
Basic config file support is merged, here are the tasks left for full support:
|
I created a PR for Schema Store at SchemaStore/schemastore#433 |
I just submitted a PR for urish/typewiz-webpack-demo. That means that once all relevant PRs are merged this issue is resolved. |
Once #27 is merged, or #29 is implemented, it will make sense to have some configuration file to toggle these behaviors. A few more things the user may want to configure:
And I am pretty sure we will have more down the road. This also paves the road to adding experimental features, which will be turned off by default, but available for adventurous users.
The text was updated successfully, but these errors were encountered: