Skip to content
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

Add produceSourceMap option #393

Closed
wants to merge 5 commits into from

Conversation

kpdecker
Copy link
Member

This allows the user to control the source map output post instrumentation.

Not fully straightforward right now, but when combined with a fork of source-map-support that has inline support (or placing the files in the proper location), end to end covered source maps can be achieved.

For runtime source-map-support, see evanw/node-source-map-support#118. Will be forking to @kpdecker/source-map-support soon, since the canonical project appears to be dead.

Fix for #285 (When combined with the above)

This allows the user to control the source map output post instrumentation.

Not fully straightforward right now, but when combined with a fork of source-map-support that has inline support (or placing the files in the proper location), end to end covered source maps can be achieved.

For runtime source-map-support, see evanw/node-source-map-support#118. Will be forking to @kpdecker/source-map-support soon, since the canonical project appears to be dead.
@kpdecker
Copy link
Member Author

The above PR is published under @kpdecker/source-map-support

require('@kpdecker/source-map-support').install({
  hookRequire: true
});

@coveralls
Copy link

coveralls commented Sep 16, 2016

Coverage Status

Changes Unknown when pulling 5f531b7 on kpdecker:expose-source-map into * on istanbuljs:master*.

@bcoe
Copy link
Member

bcoe commented Oct 2, 2016

Hey @kpdecker sorry for the slow turn around on this; haven't had nearly as much time to work on OSS software lately as I would like.

I like where you're going with this, a couple comments:

  • would you mind adding a test that demonstrates source-map support in action?
  • I'd also love a section in the docs, that explains how to use these libraries in conjunction.
  • reading through nyc makes stack traces unreadable #285, did your investigation indicate that this would solve the issue they were running into?

@kpdecker
Copy link
Member Author

kpdecker commented Oct 9, 2016

@bcoe, I hear you on the OSS time. I'm in the same boat these days. WIll look at tests and docs. I believe that this will resolve #285 but it has to be combined with a hookRequire version of source-map-support in some cases, so it's not quite turn-key yet.

@kpdecker
Copy link
Member Author

@bcoe Added tests showing that this does fix #285 when hookRequire is enabled and provided some basic documentation. Both are sort of pending evanw/node-source-map-support#118, but I think are good enough to move forward for now.

@coveralls
Copy link

coveralls commented Oct 10, 2016

Coverage Status

Changes Unknown when pulling 4e8c205 on kpdecker:expose-source-map into * on istanbuljs:master*.

@bcoe
Copy link
Member

bcoe commented Oct 16, 2016

@kpdecker hey! I've been heads down on a fancy-pants new feature for yargs, so a bit behind on nyc. I saw that node-soure-map-support landed, awesome! have you confirmed that it behaves well with your changes?

I'll work on getting this landed this week.

@bcoe
Copy link
Member

bcoe commented Oct 30, 2016

@kpdecker bringing this issue back to your attention, have you tested this branch with node-source-map-support? I would love to get this over the finish line.

@kpdecker
Copy link
Member Author

kpdecker commented Nov 1, 2016

@bcoe, I've been using this for all of my work projects off of @kpdecker/node-source-map-support for about a month now and it is working just fine.

@kpdecker
Copy link
Member Author

kpdecker commented Nov 1, 2016

I'll update this PR to restore the dependency back to the standard package.

@coveralls
Copy link

coveralls commented Nov 1, 2016

Coverage Status

Changes Unknown when pulling be92706 on kpdecker:expose-source-map into * on istanbuljs:master*.

@@ -1,12 +1,13 @@
function InstrumenterIstanbul (cwd) {
function InstrumenterIstanbul (cwd, options) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should 'use strict'; at the top of these files.

@JaKXz
Copy link
Member

JaKXz commented Nov 6, 2016

Other than minor style nitpicks, this LGTM :)

curious if there's more test coverage we could get though?

@bcoe
Copy link
Member

bcoe commented Nov 7, 2016

@JaKXz @kpdecker closing in favor of #439, which has a minor refactor.

@bcoe bcoe closed this Nov 7, 2016
@kpdecker kpdecker deleted the expose-source-map branch May 24, 2017 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants