-
Notifications
You must be signed in to change notification settings - Fork 42
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
Implements Istanbul coverage support and user-defined sourceTransformers #26
Conversation
* For fear that glboal.$$cov... might be present w/o istanbul, I wrapped the istanbul interceptor in a big try catch * To prevent the finding coffeescript.compile and istanbul instrumentSync on every single file, I cache them.
👍 |
An object of named functions which will transform the source code required with | ||
`SandboxedModule.require`. For example, CoffeeScript & | ||
[istanbul](https://github.com/gotwarlost/istanbul) support is implemented as | ||
default sourceTransformer functions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there an interface to set the default source transformers, project-wide? Also, I am not sure including istanbul by default is good; I would actually remove CoffeeScript except for backward-compat.
This looks very good. I only have the one comment, about how making Istanbul a new default might not be great, and also that the defaults should be configurable project-wide (so e.g. people who want to use, say, traceur, should be able to add a traceur source transformer once instead of on every Also, since I am no longer actively using this module, if @felixge is OK with it, I think it'd be cool to add you as a maintainer on GitHub and npm, continuing the chain of custodion-ship transfer that started when @felixge handed this off to me :). |
I agree with Dominic, but since I'm not actively maintaining this module right now, I'm not feeling strongly about it ; ).
Done. @searls you now have github / npm push access! Feel free to merge this patch once you're happy with it. |
Thanks @felixge & @domenic. I'm going to take a look at implementing two pieces of your feedback before merging this.
|
Presumably this will be appropriate for any future built-in source transformers added to the project.
Okay, I've made both those changes. Hopefully being able to set an app-wide global or require() stubbing will be of use to people even if the I'll merge and push a version, bumping minor. |
Ping @felixge -- it looks like I don't have Github Push access to this repo, after all :) |
@searls that's weird, it seems like GitHub forgot that I added you. Did you get an e-mail you were added? Anyway, I just added you again, should work now. |
Implements Istanbul coverage support and user-defined sourceTransformers
Thanks folks. Released as 0.3.0. |
💖 thx! |
This PR addresses #25. Three changes in this PR:
_getCompileInfo()
methodsourceTransformers
option passed toSandboxedModule.require
.I was sure to add unit tests to cover everything I did. I tried to write everything I added in a manner that was congruent with the existing code.
Suggestions: