Closed zoehneto closed 6 years ago
Very nice! I've reviewed the changes so far. Huzzah :tada:
@urish I have made the readFile calls asynchronous using util.promisify which breaks node 6 (see review above). If that is a problem I can add the polyfill, otherwise I would remove node 6 from .travis.yml
.
I added support for the config file to typewiz-webpack, usage:
use: [ 'ts-loader',
{
loader: 'typewiz-webpack',
options: {
typewizConfig: path.resolve(__dirname, "../typewiz.json")
}
}],
This only supports the instrumentation though, since typewiz-webpack doesn't apply types (it creates a json file with all gathered type information.
@zoehneto I think we can drop node 6 support from the core library, and then use the polyfill just inside typewiz-node
to provide a smoother experience there. WDYT?
According to the docs of the polyfill patching the util module from typewiz-node should work but we definitely have to test that. Do you want to do the same thing with typewiz-webpack?
I just implemented config support for typewiz-node (node 6 polyfill not yet included). It might be necessary to add a function to recursively search for typewiz.json
in parent folders to improve mocha handling (since we can't specify a path for mocha) but I can't say since I don't use it and have no way of testing it.
@zoehneto migrating to monorepo (#56) shifted some files around - basically, everything that was under src
is now in packages/typewiz-core/src
. If you need any help with rebasing (now or after the branch is ready), please ping here :-)
@urish I just did the rebase. I also changed the dependency for typewiz-node and typewiz-webpack to typewiz-core instead of typewiz.
@urish I just added the polyfill to typewiz-node and typewiz-webpack and updated the node version requirement for typewiz-core. That means this PR is ready for review, I'll add the documentation once that is done. Please also take a look at the open tasks in the PR description since most of those can only be performed once this PR is merged.
Thanks! Two more comments and I think we are ready to go :)
Lovely, thank you so much! Merge time :)
Thanks :) What do you want to do about the open tasks still left here (maybe put them in the original issue)?
Sounds good! Will you be willing to tackle them as well?
Certainly Schema Store, Documentation and updating the webpack demo (once the new version is relesed). Webpack type applying with config is probably a task to be tackled as part of the cli and correcting the dependency version for typewiz-core would probably best be done by you during publish.
Excellent
I have moved the remaining tasks to issue #31
Implements #31
instrument
andapplyTypes