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

Fix event timing #6

Merged
merged 2 commits into from Dec 1, 2017
Merged

Fix event timing #6

merged 2 commits into from Dec 1, 2017

Conversation

TimothyGu
Copy link
Contributor

Fixes the symptoms documented at nodejs/node#17336. This commit contains multiple parts that are hard to separate into separate commits/PRs, but I've documented the bits that I changed below:

  • Use process.execPath instead of hardcoding 'node'
  • Make sure to call done() in the foreground() callback; doing this used to segfault for unknown reasons (presumably inside V8), but will no longer do so after the timing fixes in this PR
  • Listen for Inspector events before enabling Profiler/Runtime/Debugger, since events will start flowing in as soon as those are enabled
  • Attempt to enable Profiler/Runtime/Debugger before runIfWaitingForDebugger, but do not expect them to complete before runIfWaitingForDebugger finishes
  • Wait for the initial pause brought about by --inspect-brk before doing anything further, like starting coverage tracking
  • Ignore executionContextDestroyed signals for non-main contexts (e.g. VM contexts)
  • Use Promises more extensively

bin/c8.js Outdated
}
)
try {
await waitTillPortOpen(port)
const client = await CRI({port: port})

const initialPause = new Promise((resolve) => {
client.once('Debugger.paused', resolve)
Copy link
Owner

Choose a reason for hiding this comment

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

was not waiting on the Debugger.paused event the root cause of the issues I was seeing? Interesting that this worked for CommonJS files.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

was not waiting on the Debugger.paused event the root cause of the issues I was seeing?

Yes, I believe so.

Interesting that this worked for CommonJS files.

I agree, with the minor amendment that if you rename c.mjs to d.js the same issue would be seen.

bin/c8.js Outdated
Runtime.enable(),
Debugger.enable(),
Runtime.runIfWaitingForDebugger(),
initialPause
Copy link
Owner

Choose a reason for hiding this comment

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

weirdly, this does not seem to work for process.exit or throw in a script, unless you refactor thusly:

    const {Debugger, Runtime, Profiler} = client
    await Promise.all([
      Profiler.enable(),
      Runtime.enable(),
      Debugger.enable(),
      Runtime.runIfWaitingForDebugger(),
    ])
    await Profiler.startPreciseCoverage({callCount: true, detailed: true})
    await initialPause
    await Debugger.resume()

you can exercise this by running ./bin/c8.js test/fixtures/c.mjs (which should output block coverage information when running properly) -- any idea why that order of operations matters? feels a little nit-picky.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The proposed solution crashes with a segfault here. Will investigate further.

Copy link
Contributor Author

@TimothyGu TimothyGu Nov 27, 2017

Choose a reason for hiding this comment

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

Some more discoveries:

  1. The reason why nothing in c.mjs, the main file, gets tracked is that Profiler.startPreciseCoverage was executed after the main file has been parsed. As such, you are correct in discovering that Profiler.startPreciseCoverage needs to be executed as early as possible.
  2. However, the V8 used in Node.js 9.x and master crashes with a segmentation fault if Profiler.startPreciseCoverage is received before Debugger.paused -- but not when Profiler.startPreciseCoverage is received, rather it continues normally until when Debugger.paused is expected to be emitted.
  3. The V8 used in canary builds (6.4.358-node.0 tested) does not exhibit the crash above, and works fully as expected, due to v8/v8@1420e44.

What I'm going to do is put this PR on hold, before the issue with V8 gets resolved. Then I will look into backporting the V8 commit to Node.js.

TimothyGu added a commit to TimothyGu/node that referenced this pull request Nov 27, 2017
Original commit message:

    [coverage] Correctly free DebugInfo in the absence of breakpoints

    It's quite possible for DebugInfos to exist without the presence of a
    bytecode array, since DebugInfos are created for all functions for which
    we have a CoverageInfo. Free such objects properly.

    Also move the corresponding deletion of CoverageInfos on unload up
    before the early exit.

    Bug: v8:6000
    Change-Id: Idde45b222290aa8b6828b61ff2251918b8ed2aed
    Reviewed-on: https://chromium-review.googlesource.com/664811
    Reviewed-by: Yang Guo <yangguo@chromium.org>
    Commit-Queue: Jakob Gruber <jgruber@chromium.org>
    Cr-Commit-Position: refs/heads/master@{nodejs#48024}

Fixes crash when passing Profiler.startPreciseCoverage before
Debug.paused is received.

Refs: v8/v8@1420e44
Refs: bcoe/c8#6 (comment)
@bcoe
Copy link
Owner

bcoe commented Nov 28, 2017

@TimothyGu awesome; worth noting, we have a lot of test coverage related tweaks landing in v8 soon -- I've been doing most of my testing with the canary build of v8/Node.js.

@bcoe
Copy link
Owner

bcoe commented Nov 28, 2017

@TimothyGu when you have two secs, mind updating this with the timing tweaks and I'll land it?

TimothyGu added a commit to TimothyGu/node that referenced this pull request Nov 29, 2017
Original commit message:

    [coverage] Correctly free DebugInfo in the absence of breakpoints

    It's quite possible for DebugInfos to exist without the presence of a
    bytecode array, since DebugInfos are created for all functions for which
    we have a CoverageInfo. Free such objects properly.

    Also move the corresponding deletion of CoverageInfos on unload up
    before the early exit.

    Bug: v8:6000
    Change-Id: Idde45b222290aa8b6828b61ff2251918b8ed2aed
    Reviewed-on: https://chromium-review.googlesource.com/664811
    Reviewed-by: Yang Guo <yangguo@chromium.org>
    Commit-Queue: Jakob Gruber <jgruber@chromium.org>
    Cr-Commit-Position: refs/heads/master@{nodejs#48024}

Fixes crash when passing Profiler.startPreciseCoverage before
Debug.paused is received.

PR-URL: nodejs#17344
Refs: v8/v8@1420e44
Refs: bcoe/c8#6 (comment)
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
@TimothyGu
Copy link
Contributor Author

@bcoe Done. Note, that this will need a node binary with nodejs/node#17344 applied for it to work though.

@bcoe
Copy link
Owner

bcoe commented Nov 29, 2017

@TimothyGu thank you; I will test when I get home tonight.

@TimothyGu
Copy link
Contributor Author

I've just rebased this.

@bcoe
Copy link
Owner

bcoe commented Dec 1, 2017

@TimothyGu awesome; @chrisdickinson and I actually just tested your branch, it's working great.

@bcoe bcoe merged commit 01f654e into bcoe:master Dec 1, 2017
@TimothyGu TimothyGu deleted the timing branch December 1, 2017 07:04
MylesBorins pushed a commit to nodejs/node that referenced this pull request Dec 12, 2017
Original commit message:

    [coverage] Correctly free DebugInfo in the absence of breakpoints

    It's quite possible for DebugInfos to exist without the presence of a
    bytecode array, since DebugInfos are created for all functions for which
    we have a CoverageInfo. Free such objects properly.

    Also move the corresponding deletion of CoverageInfos on unload up
    before the early exit.

    Bug: v8:6000
    Change-Id: Idde45b222290aa8b6828b61ff2251918b8ed2aed
    Reviewed-on: https://chromium-review.googlesource.com/664811
    Reviewed-by: Yang Guo <yangguo@chromium.org>
    Commit-Queue: Jakob Gruber <jgruber@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#48024}

Fixes crash when passing Profiler.startPreciseCoverage before
Debug.paused is received.

PR-URL: #17344
Refs: v8/v8@1420e44
Refs: bcoe/c8#6 (comment)
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
MylesBorins pushed a commit to nodejs/node that referenced this pull request Dec 12, 2017
Original commit message:

    [coverage] Correctly free DebugInfo in the absence of breakpoints

    It's quite possible for DebugInfos to exist without the presence of a
    bytecode array, since DebugInfos are created for all functions for which
    we have a CoverageInfo. Free such objects properly.

    Also move the corresponding deletion of CoverageInfos on unload up
    before the early exit.

    Bug: v8:6000
    Change-Id: Idde45b222290aa8b6828b61ff2251918b8ed2aed
    Reviewed-on: https://chromium-review.googlesource.com/664811
    Reviewed-by: Yang Guo <yangguo@chromium.org>
    Commit-Queue: Jakob Gruber <jgruber@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#48024}

Fixes crash when passing Profiler.startPreciseCoverage before
Debug.paused is received.

PR-URL: #17344
Refs: v8/v8@1420e44
Refs: bcoe/c8#6 (comment)
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
targos pushed a commit to targos/node that referenced this pull request Jan 15, 2018
Original commit message:

    [coverage] Correctly free DebugInfo in the absence of breakpoints

    It's quite possible for DebugInfos to exist without the presence of a
    bytecode array, since DebugInfos are created for all functions for which
    we have a CoverageInfo. Free such objects properly.

    Also move the corresponding deletion of CoverageInfos on unload up
    before the early exit.

    Bug: v8:6000
    Change-Id: Idde45b222290aa8b6828b61ff2251918b8ed2aed
    Reviewed-on: https://chromium-review.googlesource.com/664811
    Reviewed-by: Yang Guo <yangguo@chromium.org>
    Commit-Queue: Jakob Gruber <jgruber@chromium.org>
    Cr-Commit-Position: refs/heads/master@{nodejs#48024}

Fixes crash when passing Profiler.startPreciseCoverage before
Debug.paused is received.

PR-URL: nodejs#17344
Refs: v8/v8@1420e44
Refs: bcoe/c8#6 (comment)
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
gibfahn pushed a commit to gibfahn/node that referenced this pull request Jan 16, 2018
Original commit message:

    [coverage] Correctly free DebugInfo in the absence of breakpoints

    It's quite possible for DebugInfos to exist without the presence of a
    bytecode array, since DebugInfos are created for all functions for which
    we have a CoverageInfo. Free such objects properly.

    Also move the corresponding deletion of CoverageInfos on unload up
    before the early exit.

    Bug: v8:6000
    Change-Id: Idde45b222290aa8b6828b61ff2251918b8ed2aed
    Reviewed-on: https://chromium-review.googlesource.com/664811
    Reviewed-by: Yang Guo <yangguo@chromium.org>
    Commit-Queue: Jakob Gruber <jgruber@chromium.org>
    Cr-Commit-Position: refs/heads/master@{nodejs#48024}

Fixes crash when passing Profiler.startPreciseCoverage before
Debug.paused is received.

PR-URL: nodejs#17344
Backport-PR-URL: nodejs#16413
Refs: v8/v8@1420e44
Refs: bcoe/c8#6 (comment)
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
gibfahn pushed a commit to gibfahn/node that referenced this pull request Jan 22, 2018
Original commit message:

    [coverage] Correctly free DebugInfo in the absence of breakpoints

    It's quite possible for DebugInfos to exist without the presence of a
    bytecode array, since DebugInfos are created for all functions for which
    we have a CoverageInfo. Free such objects properly.

    Also move the corresponding deletion of CoverageInfos on unload up
    before the early exit.

    Bug: v8:6000
    Change-Id: Idde45b222290aa8b6828b61ff2251918b8ed2aed
    Reviewed-on: https://chromium-review.googlesource.com/664811
    Reviewed-by: Yang Guo <yangguo@chromium.org>
    Commit-Queue: Jakob Gruber <jgruber@chromium.org>
    Cr-Commit-Position: refs/heads/master@{nodejs#48024}

Fixes crash when passing Profiler.startPreciseCoverage before
Debug.paused is received.

PR-URL: nodejs#17344
Backport-PR-URL: nodejs#16413
Refs: v8/v8@1420e44
Refs: bcoe/c8#6 (comment)
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
MylesBorins pushed a commit to targos/node that referenced this pull request Feb 7, 2018
Original commit message:

    [coverage] Correctly free DebugInfo in the absence of breakpoints

    It's quite possible for DebugInfos to exist without the presence of a
    bytecode array, since DebugInfos are created for all functions for which
    we have a CoverageInfo. Free such objects properly.

    Also move the corresponding deletion of CoverageInfos on unload up
    before the early exit.

    Bug: v8:6000
    Change-Id: Idde45b222290aa8b6828b61ff2251918b8ed2aed
    Reviewed-on: https://chromium-review.googlesource.com/664811
    Reviewed-by: Yang Guo <yangguo@chromium.org>
    Commit-Queue: Jakob Gruber <jgruber@chromium.org>
    Cr-Commit-Position: refs/heads/master@{nodejs#48024}

Fixes crash when passing Profiler.startPreciseCoverage before
Debug.paused is received.

PR-URL: nodejs#17344
Refs: v8/v8@1420e44
Refs: bcoe/c8#6 (comment)
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
gibfahn pushed a commit to nodejs/node that referenced this pull request Feb 18, 2018
Original commit message:

    [coverage] Correctly free DebugInfo in the absence of breakpoints

    It's quite possible for DebugInfos to exist without the presence of a
    bytecode array, since DebugInfos are created for all functions for which
    we have a CoverageInfo. Free such objects properly.

    Also move the corresponding deletion of CoverageInfos on unload up
    before the early exit.

    Bug: v8:6000
    Change-Id: Idde45b222290aa8b6828b61ff2251918b8ed2aed
    Reviewed-on: https://chromium-review.googlesource.com/664811
    Reviewed-by: Yang Guo <yangguo@chromium.org>
    Commit-Queue: Jakob Gruber <jgruber@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#48024}

Fixes crash when passing Profiler.startPreciseCoverage before
Debug.paused is received.

PR-URL: #17344
Backport-PR-URL: #16413
Refs: v8/v8@1420e44
Refs: bcoe/c8#6 (comment)
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
github-actions bot pushed a commit to prantlf/c8 that referenced this pull request Apr 2, 2023
# 1.0.0 (2023-04-02)

### Bug Fixes

* `--all` now respects `--extension` flag. ([bcoe#357](https://github.com/prantlf/c8/issues/357)) ([a5deb27](a5deb27))
* add missing space in text ([bcoe#245](https://github.com/prantlf/c8/issues/245)) ([efe6d04](efe6d04))
* address bugs with source remapping on Windows ([bcoe#301](https://github.com/prantlf/c8/issues/301)) ([c817902](c817902))
* address file:// issue with CJS ([bcoe#39](https://github.com/prantlf/c8/issues/39)) ([d4f9cab](d4f9cab))
* all flag not propagated to check-coverage command ([bcoe#188](https://github.com/prantlf/c8/issues/188)) ([86eaf72](86eaf72))
* **config:** support configuration inheritance ([bcoe#343](https://github.com/prantlf/c8/issues/343)) ([e81ed5d](e81ed5d))
* **deps:** merging failed when the same script occurred multiple times in the same report ([bcoe#147](https://github.com/prantlf/c8/issues/147)) ([1ebcaf9](1ebcaf9))
* **deps:** update dependency find-up to v4 ([bcoe#119](https://github.com/prantlf/c8/issues/119)) ([c568d96](c568d96))
* **deps:** update dependency find-up to v5 ([bcoe#242](https://github.com/prantlf/c8/issues/242)) ([8a0cfd7](8a0cfd7))
* **deps:** update dependency furi to v2 ([bcoe#193](https://github.com/prantlf/c8/issues/193)) ([6b9af6e](6b9af6e))
* **deps:** update dependency rimraf to v3 ([bcoe#132](https://github.com/prantlf/c8/issues/132)) ([7601748](7601748))
* **deps:** update dependency v8-to-istanbul to v4 ([bcoe#167](https://github.com/prantlf/c8/issues/167)) ([97b9769](97b9769))
* **deps:** update dependency yargs to v14 ([bcoe#134](https://github.com/prantlf/c8/issues/134)) ([e49737f](e49737f))
* **deps:** update dependency yargs to v15 ([bcoe#164](https://github.com/prantlf/c8/issues/164)) ([e41a483](e41a483))
* **deps:** update dependency yargs to v16 ([bcoe#251](https://github.com/prantlf/c8/issues/251)) ([0436816](0436816))
* **deps:** update dependency yargs-parser to v13 ([bcoe#124](https://github.com/prantlf/c8/issues/124)) ([1eb3394](1eb3394))
* **deps:** update dependency yargs-parser to v14 ([bcoe#144](https://github.com/prantlf/c8/issues/144)) ([9b3d089](9b3d089))
* **deps:** update dependency yargs-parser to v15 ([bcoe#153](https://github.com/prantlf/c8/issues/153)) ([80153de](80153de))
* **deps:** update dependency yargs-parser to v16 ([bcoe#157](https://github.com/prantlf/c8/issues/157)) ([15746e5](15746e5))
* **deps:** update dependency yargs-parser to v17 ([bcoe#201](https://github.com/prantlf/c8/issues/201)) ([d730c63](d730c63))
* **deps:** update dependency yargs-parser to v18 ([bcoe#202](https://github.com/prantlf/c8/issues/202)) ([983de44](983de44))
* **deps:** update dependency yargs-parser to v19 ([bcoe#241](https://github.com/prantlf/c8/issues/241)) ([baa01df](baa01df))
* **deps:** update dependency yargs-parser to v20 ([bcoe#252](https://github.com/prantlf/c8/issues/252)) ([ae845f0](ae845f0))
* **deps:** update deps to address warning in cross-spawn ([bcoe#141](https://github.com/prantlf/c8/issues/141)) ([4b66221](4b66221))
* **deps:** update deps to latest ([bcoe#384](https://github.com/prantlf/c8/issues/384)) ([78eac8c](78eac8c)), closes [bcoe#375](https://github.com/prantlf/c8/issues/375)
* **deps:** v8-to-istanbul with fix for Windows paths ([bcoe#311](https://github.com/prantlf/c8/issues/311)) ([ef1b875](ef1b875))
* **deps:** v8-to-istanbul with patch for crasher ([bcoe#200](https://github.com/prantlf/c8/issues/200)) ([d4b7d80](d4b7d80))
* **deps:** v8-to-istnbul with fixes for Node 10/18 ([bcoe#392](https://github.com/prantlf/c8/issues/392)) ([d5f642a](d5f642a))
* do not override NODE_V8_COVERAGE if set ([bcoe#70](https://github.com/prantlf/c8/issues/70)) ([8bb67b0](8bb67b0))
* don't load JSON that does not look like coverage ([bcoe#146](https://github.com/prantlf/c8/issues/146)) ([a6481f1](a6481f1))
* escaping issue with cobertura reporter ([bcoe#203](https://github.com/prantlf/c8/issues/203)) ([e93747b](e93747b))
* exclude coverage of the CJS-ESM bridge from results ([bcoe#83](https://github.com/prantlf/c8/issues/83)) ([da2c945](da2c945))
* exit with code 1 when report output fails ([bcoe#92](https://github.com/prantlf/c8/issues/92)) ([a27b694](a27b694))
* file URL to system path conversion ([bcoe#46](https://github.com/prantlf/c8/issues/46)) ([e7f8cf2](e7f8cf2))
* fix package.json `test:snap` script to use cross-env ([bcoe#366](https://github.com/prantlf/c8/issues/366)) ([5d2981c](5d2981c))
* Fix usage of excludeAfterRemap not to set the coverage always to 100 ([9113449](9113449)), closes [bcoe#462](https://github.com/prantlf/c8/issues/462)
* float patch for branch/function coverage merge bug ([bcoe#56](https://github.com/prantlf/c8/issues/56)) ([1de0cca](1de0cca))
* HTML report now has correct source positions for Node >10.16.0 ([bcoe#125](https://github.com/prantlf/c8/issues/125)) ([c49fa7f](c49fa7f))
* ignore missing source maps in raw coverage output ([bcoe#233](https://github.com/prantlf/c8/issues/233)) ([eed98af](eed98af))
* make tests run on Windows ([bcoe#25](https://github.com/prantlf/c8/issues/25)) ([08e44d0](08e44d0))
* make tmp directory regardless of clean ([44d2185](44d2185))
* **perf:** cache `this.exclude.shouldInstrument` for improved performance ([bcoe#388](https://github.com/prantlf/c8/issues/388)) ([8b36f23](8b36f23))
* pin to functional version of spawn-wrap ([d1ced8c](d1ced8c))
* process coverage merging ([bcoe#37](https://github.com/prantlf/c8/issues/37)) ([67959b4](67959b4))
* regex flags in dependency were breaking Node 8 ([a9d9645](a9d9645))
* remove the unmaintained mkdirp dependency ([bcoe#91](https://github.com/prantlf/c8/issues/91)) ([a465b65](a465b65))
* snapshot ([7fd9e13](7fd9e13))
* support node@v15.x.x built-in modules ([bcoe#265](https://github.com/prantlf/c8/issues/265)) ([1b90a22](1b90a22))
* switch to mkdirp for Node 8 ([206b83f](206b83f))
* temporary files should be in tmp folder ([bcoe#106](https://github.com/prantlf/c8/issues/106)) ([64dd2e6](64dd2e6))
* tweak inspector event timing ([bcoe#6](https://github.com/prantlf/c8/issues/6)) ([01f654e](01f654e))
* **types:** add excludeAfterRemap and allowExternal  ([bcoe#297](https://github.com/prantlf/c8/issues/297)) ([e32a53f](e32a53f))
* Upgrade dependencies ([c288f5f](c288f5f))
* upgrade to @bcoe/v8-coverage with breaking regex dropped ([6c28e7f](6c28e7f))
* **v8-to-istanbul:** fixes shebang handling/ignore behavior ([bcoe#267](https://github.com/prantlf/c8/issues/267)) ([21cd41f](21cd41f))
* **v8-to-istanbul:** pull in fix for missing branches ([bcoe#258](https://github.com/prantlf/c8/issues/258)) ([eaffa78](eaffa78))
* **v8-to-istanbul:** revert off by one that broke TypeScript ([bcoe#262](https://github.com/prantlf/c8/issues/262)) ([81ab5b7](81ab5b7))
* we were not exiting with 1 if mkdir failed ([bcoe#89](https://github.com/prantlf/c8/issues/89)) ([fb02ed6](fb02ed6))

* feat!: use Node.js' source-map cache, to support tools like ts-node (bcoe#152) ([53bba15](53bba15)), closes [bcoe#152](https://github.com/prantlf/c8/issues/152)
* feat!: default temp directory to report directory (bcoe#102) ([8602f4a](8602f4a)), closes [bcoe#102](https://github.com/prantlf/c8/issues/102)

### Features

* `--100` ([bcoe#332](https://github.com/prantlf/c8/issues/332)) ([4205f2f](4205f2f))
* add --config option and documentation on options and configs ([bcoe#308](https://github.com/prantlf/c8/issues/308)) ([99436ef](99436ef))
* add --exclude-node-modules option ([bcoe#321](https://github.com/prantlf/c8/issues/321)) ([a4733c6](a4733c6))
* add --extension option ([bcoe#331](https://github.com/prantlf/c8/issues/331)) ([ff01cd8](ff01cd8))
* add --report-dir alias (for consistency with nyc) ([0dd1b04](0dd1b04))
* add --skip-full ([bcoe#287](https://github.com/prantlf/c8/issues/287)) ([8b01b63](8b01b63))
* add `skipFull` and `excludeNodeModules` to type definitions ([bcoe#417](https://github.com/prantlf/c8/issues/417)) ([b93b9c0](b93b9c0))
* add support for 1:1 source-maps ([bcoe#85](https://github.com/prantlf/c8/issues/85)) ([6ca4345](6ca4345))
* add support for ignoring lines, functions, and blocks ([bcoe#87](https://github.com/prantlf/c8/issues/87)) ([c66950e](c66950e))
* add thresholds for enforcing coverage percentage ([bcoe#59](https://github.com/prantlf/c8/issues/59)) ([70e8943](70e8943))
* adds --all functionality ([bcoe#158](https://github.com/prantlf/c8/issues/158)) ([2eb631e](2eb631e))
* adds support for 1:many source maps ([bcoe#238](https://github.com/prantlf/c8/issues/238)) ([dbf94a0](dbf94a0))
* adds TypeScript definitions ([d39801b](d39801b)), closes [bcoe#195](https://github.com/prantlf/c8/issues/195)
* **all:** handle base64 inline source maps ([bcoe#283](https://github.com/prantlf/c8/issues/283)) ([3f12dd4](3f12dd4))
* allow  --reports-dir to be configured ([bcoe#65](https://github.com/prantlf/c8/issues/65)) ([5ab31f5](5ab31f5))
* allow relative paths to be optionally included ([3806c79](3806c79))
* allow script wrapper length to be specified ([bcoe#51](https://github.com/prantlf/c8/issues/51)) ([a22c4e0](a22c4e0))
* first pass at functional prototype without subprocess support ([bcoe#5](https://github.com/prantlf/c8/issues/5)) ([9534f56](9534f56))
* foreground-child's done() method was not being called ([bcoe#82](https://github.com/prantlf/c8/issues/82)) ([fde596e](fde596e))
* implement Istanbul reporting ([bcoe#8](https://github.com/prantlf/c8/issues/8)) ([8e430bf](8e430bf))
* improve test assertions ([bcoe#28](https://github.com/prantlf/c8/issues/28)) ([522720e](522720e))
* introduce --exclude-after-remap flag ([bcoe#293](https://github.com/prantlf/c8/issues/293)) ([53c4234](53c4234)), closes [bcoe#224](https://github.com/prantlf/c8/issues/224)
* load .nycrc/.nycrc.json to simplify migration ([bcoe#100](https://github.com/prantlf/c8/issues/100)) ([bd7484f](bd7484f))
* playing around with initial implementation ([18f5471](18f5471))
* support --check-coverage for reports ([bcoe#60](https://github.com/prantlf/c8/issues/60)) ([b542930](b542930))
* support for instrumenting files outside of current working directory ([7e53a0e](7e53a0e))
* support ignore start/stop comment ([bcoe#273](https://github.com/prantlf/c8/issues/273)) ([90949fa](90949fa)), closes [bcoe#271](https://github.com/prantlf/c8/issues/271)
* support passing reporter options ([bcoe#423](https://github.com/prantlf/c8/issues/423)) ([bc347a9](bc347a9))
* switch to stderr and default port ([bcoe#7](https://github.com/prantlf/c8/issues/7)) ([bb117b7](bb117b7))
* switch to using Node's built in coverage ([bcoe#22](https://github.com/prantlf/c8/issues/22)) ([3c1b92b](3c1b92b))
* **types:** add typings for reporterOptions ([bcoe#446](https://github.com/prantlf/c8/issues/446)) ([3646e6e](3646e6e))
* use debuglog rather than console.warn ([bcoe#279](https://github.com/prantlf/c8/issues/279)) ([7c04a4d](7c04a4d))
* use process.stdout.columns for reporter maxCols ([bcoe#409](https://github.com/prantlf/c8/issues/409)) ([7731574](7731574))
* warn instead of throw on exception ([bcoe#29](https://github.com/prantlf/c8/issues/29)) ([a8620d4](a8620d4))

### BREAKING CHANGES

* Node.js' source-map and lineLength cache is now used to remap coverage output (this allows tools like ts-node to be supported, which transpile at runtime).
* temp directory now defaults to setting for report directory
* c8 will now load source-maps if possible and remap coverage accordingly
* switches to using NODE_V8_COVERAGE rather than inspector directly
* dropped subprocess support for the time being, while we march towards an initial implementation.
github-actions bot pushed a commit to prantlf/c8 that referenced this pull request Apr 2, 2023
# 1.0.0 (2023-04-02)

### Bug Fixes

* `--all` now respects `--extension` flag. ([bcoe#357](https://github.com/prantlf/c8/issues/357)) ([a5deb27](a5deb27))
* add missing space in text ([bcoe#245](https://github.com/prantlf/c8/issues/245)) ([efe6d04](efe6d04))
* address bugs with source remapping on Windows ([bcoe#301](https://github.com/prantlf/c8/issues/301)) ([c817902](c817902))
* address file:// issue with CJS ([bcoe#39](https://github.com/prantlf/c8/issues/39)) ([d4f9cab](d4f9cab))
* all flag not propagated to check-coverage command ([bcoe#188](https://github.com/prantlf/c8/issues/188)) ([86eaf72](86eaf72))
* **config:** support configuration inheritance ([bcoe#343](https://github.com/prantlf/c8/issues/343)) ([e81ed5d](e81ed5d))
* **deps:** merging failed when the same script occurred multiple times in the same report ([bcoe#147](https://github.com/prantlf/c8/issues/147)) ([1ebcaf9](1ebcaf9))
* **deps:** update dependency find-up to v4 ([bcoe#119](https://github.com/prantlf/c8/issues/119)) ([c568d96](c568d96))
* **deps:** update dependency find-up to v5 ([bcoe#242](https://github.com/prantlf/c8/issues/242)) ([8a0cfd7](8a0cfd7))
* **deps:** update dependency furi to v2 ([bcoe#193](https://github.com/prantlf/c8/issues/193)) ([6b9af6e](6b9af6e))
* **deps:** update dependency rimraf to v3 ([bcoe#132](https://github.com/prantlf/c8/issues/132)) ([7601748](7601748))
* **deps:** update dependency v8-to-istanbul to v4 ([bcoe#167](https://github.com/prantlf/c8/issues/167)) ([97b9769](97b9769))
* **deps:** update dependency yargs to v14 ([bcoe#134](https://github.com/prantlf/c8/issues/134)) ([e49737f](e49737f))
* **deps:** update dependency yargs to v15 ([bcoe#164](https://github.com/prantlf/c8/issues/164)) ([e41a483](e41a483))
* **deps:** update dependency yargs to v16 ([bcoe#251](https://github.com/prantlf/c8/issues/251)) ([0436816](0436816))
* **deps:** update dependency yargs-parser to v13 ([bcoe#124](https://github.com/prantlf/c8/issues/124)) ([1eb3394](1eb3394))
* **deps:** update dependency yargs-parser to v14 ([bcoe#144](https://github.com/prantlf/c8/issues/144)) ([9b3d089](9b3d089))
* **deps:** update dependency yargs-parser to v15 ([bcoe#153](https://github.com/prantlf/c8/issues/153)) ([80153de](80153de))
* **deps:** update dependency yargs-parser to v16 ([bcoe#157](https://github.com/prantlf/c8/issues/157)) ([15746e5](15746e5))
* **deps:** update dependency yargs-parser to v17 ([bcoe#201](https://github.com/prantlf/c8/issues/201)) ([d730c63](d730c63))
* **deps:** update dependency yargs-parser to v18 ([bcoe#202](https://github.com/prantlf/c8/issues/202)) ([983de44](983de44))
* **deps:** update dependency yargs-parser to v19 ([bcoe#241](https://github.com/prantlf/c8/issues/241)) ([baa01df](baa01df))
* **deps:** update dependency yargs-parser to v20 ([bcoe#252](https://github.com/prantlf/c8/issues/252)) ([ae845f0](ae845f0))
* **deps:** update deps to address warning in cross-spawn ([bcoe#141](https://github.com/prantlf/c8/issues/141)) ([4b66221](4b66221))
* **deps:** update deps to latest ([bcoe#384](https://github.com/prantlf/c8/issues/384)) ([78eac8c](78eac8c)), closes [bcoe#375](https://github.com/prantlf/c8/issues/375)
* **deps:** v8-to-istanbul with fix for Windows paths ([bcoe#311](https://github.com/prantlf/c8/issues/311)) ([ef1b875](ef1b875))
* **deps:** v8-to-istanbul with patch for crasher ([bcoe#200](https://github.com/prantlf/c8/issues/200)) ([d4b7d80](d4b7d80))
* **deps:** v8-to-istnbul with fixes for Node 10/18 ([bcoe#392](https://github.com/prantlf/c8/issues/392)) ([d5f642a](d5f642a))
* do not override NODE_V8_COVERAGE if set ([bcoe#70](https://github.com/prantlf/c8/issues/70)) ([8bb67b0](8bb67b0))
* don't load JSON that does not look like coverage ([bcoe#146](https://github.com/prantlf/c8/issues/146)) ([a6481f1](a6481f1))
* escaping issue with cobertura reporter ([bcoe#203](https://github.com/prantlf/c8/issues/203)) ([e93747b](e93747b))
* exclude coverage of the CJS-ESM bridge from results ([bcoe#83](https://github.com/prantlf/c8/issues/83)) ([da2c945](da2c945))
* exit with code 1 when report output fails ([bcoe#92](https://github.com/prantlf/c8/issues/92)) ([a27b694](a27b694))
* file URL to system path conversion ([bcoe#46](https://github.com/prantlf/c8/issues/46)) ([e7f8cf2](e7f8cf2))
* fix package.json `test:snap` script to use cross-env ([bcoe#366](https://github.com/prantlf/c8/issues/366)) ([5d2981c](5d2981c))
* Fix usage of excludeAfterRemap not to set the coverage always to 100 ([9113449](9113449)), closes [bcoe#462](https://github.com/prantlf/c8/issues/462)
* float patch for branch/function coverage merge bug ([bcoe#56](https://github.com/prantlf/c8/issues/56)) ([1de0cca](1de0cca))
* HTML report now has correct source positions for Node >10.16.0 ([bcoe#125](https://github.com/prantlf/c8/issues/125)) ([c49fa7f](c49fa7f))
* ignore missing source maps in raw coverage output ([bcoe#233](https://github.com/prantlf/c8/issues/233)) ([eed98af](eed98af))
* make tests run on Windows ([bcoe#25](https://github.com/prantlf/c8/issues/25)) ([08e44d0](08e44d0))
* make tmp directory regardless of clean ([44d2185](44d2185))
* **perf:** cache `this.exclude.shouldInstrument` for improved performance ([bcoe#388](https://github.com/prantlf/c8/issues/388)) ([8b36f23](8b36f23))
* pin to functional version of spawn-wrap ([d1ced8c](d1ced8c))
* process coverage merging ([bcoe#37](https://github.com/prantlf/c8/issues/37)) ([67959b4](67959b4))
* regex flags in dependency were breaking Node 8 ([a9d9645](a9d9645))
* remove the unmaintained mkdirp dependency ([bcoe#91](https://github.com/prantlf/c8/issues/91)) ([a465b65](a465b65))
* snapshot ([7fd9e13](7fd9e13))
* support node@v15.x.x built-in modules ([bcoe#265](https://github.com/prantlf/c8/issues/265)) ([1b90a22](1b90a22))
* switch to mkdirp for Node 8 ([206b83f](206b83f))
* temporary files should be in tmp folder ([bcoe#106](https://github.com/prantlf/c8/issues/106)) ([64dd2e6](64dd2e6))
* tweak inspector event timing ([bcoe#6](https://github.com/prantlf/c8/issues/6)) ([01f654e](01f654e))
* **types:** add excludeAfterRemap and allowExternal  ([bcoe#297](https://github.com/prantlf/c8/issues/297)) ([e32a53f](e32a53f))
* Upgrade dependencies ([985b219](985b219))
* upgrade to @bcoe/v8-coverage with breaking regex dropped ([6c28e7f](6c28e7f))
* **v8-to-istanbul:** fixes shebang handling/ignore behavior ([bcoe#267](https://github.com/prantlf/c8/issues/267)) ([21cd41f](21cd41f))
* **v8-to-istanbul:** pull in fix for missing branches ([bcoe#258](https://github.com/prantlf/c8/issues/258)) ([eaffa78](eaffa78))
* **v8-to-istanbul:** revert off by one that broke TypeScript ([bcoe#262](https://github.com/prantlf/c8/issues/262)) ([81ab5b7](81ab5b7))
* we were not exiting with 1 if mkdir failed ([bcoe#89](https://github.com/prantlf/c8/issues/89)) ([fb02ed6](fb02ed6))

* feat!: use Node.js' source-map cache, to support tools like ts-node (bcoe#152) ([53bba15](53bba15)), closes [bcoe#152](https://github.com/prantlf/c8/issues/152)
* feat!: default temp directory to report directory (bcoe#102) ([8602f4a](8602f4a)), closes [bcoe#102](https://github.com/prantlf/c8/issues/102)

### Features

* `--100` ([bcoe#332](https://github.com/prantlf/c8/issues/332)) ([4205f2f](4205f2f))
* add --config option and documentation on options and configs ([bcoe#308](https://github.com/prantlf/c8/issues/308)) ([99436ef](99436ef))
* add --exclude-node-modules option ([bcoe#321](https://github.com/prantlf/c8/issues/321)) ([a4733c6](a4733c6))
* add --extension option ([bcoe#331](https://github.com/prantlf/c8/issues/331)) ([ff01cd8](ff01cd8))
* add --report-dir alias (for consistency with nyc) ([0dd1b04](0dd1b04))
* add --skip-full ([bcoe#287](https://github.com/prantlf/c8/issues/287)) ([8b01b63](8b01b63))
* add `skipFull` and `excludeNodeModules` to type definitions ([bcoe#417](https://github.com/prantlf/c8/issues/417)) ([b93b9c0](b93b9c0))
* add support for 1:1 source-maps ([bcoe#85](https://github.com/prantlf/c8/issues/85)) ([6ca4345](6ca4345))
* add support for ignoring lines, functions, and blocks ([bcoe#87](https://github.com/prantlf/c8/issues/87)) ([c66950e](c66950e))
* add thresholds for enforcing coverage percentage ([bcoe#59](https://github.com/prantlf/c8/issues/59)) ([70e8943](70e8943))
* adds --all functionality ([bcoe#158](https://github.com/prantlf/c8/issues/158)) ([2eb631e](2eb631e))
* adds support for 1:many source maps ([bcoe#238](https://github.com/prantlf/c8/issues/238)) ([dbf94a0](dbf94a0))
* adds TypeScript definitions ([d39801b](d39801b)), closes [bcoe#195](https://github.com/prantlf/c8/issues/195)
* **all:** handle base64 inline source maps ([bcoe#283](https://github.com/prantlf/c8/issues/283)) ([3f12dd4](3f12dd4))
* allow  --reports-dir to be configured ([bcoe#65](https://github.com/prantlf/c8/issues/65)) ([5ab31f5](5ab31f5))
* allow relative paths to be optionally included ([3806c79](3806c79))
* allow script wrapper length to be specified ([bcoe#51](https://github.com/prantlf/c8/issues/51)) ([a22c4e0](a22c4e0))
* first pass at functional prototype without subprocess support ([bcoe#5](https://github.com/prantlf/c8/issues/5)) ([9534f56](9534f56))
* foreground-child's done() method was not being called ([bcoe#82](https://github.com/prantlf/c8/issues/82)) ([fde596e](fde596e))
* implement Istanbul reporting ([bcoe#8](https://github.com/prantlf/c8/issues/8)) ([8e430bf](8e430bf))
* improve test assertions ([bcoe#28](https://github.com/prantlf/c8/issues/28)) ([522720e](522720e))
* introduce --exclude-after-remap flag ([bcoe#293](https://github.com/prantlf/c8/issues/293)) ([53c4234](53c4234)), closes [bcoe#224](https://github.com/prantlf/c8/issues/224)
* load .nycrc/.nycrc.json to simplify migration ([bcoe#100](https://github.com/prantlf/c8/issues/100)) ([bd7484f](bd7484f))
* playing around with initial implementation ([18f5471](18f5471))
* support --check-coverage for reports ([bcoe#60](https://github.com/prantlf/c8/issues/60)) ([b542930](b542930))
* support for instrumenting files outside of current working directory ([7e53a0e](7e53a0e))
* support ignore start/stop comment ([bcoe#273](https://github.com/prantlf/c8/issues/273)) ([90949fa](90949fa)), closes [bcoe#271](https://github.com/prantlf/c8/issues/271)
* support passing reporter options ([bcoe#423](https://github.com/prantlf/c8/issues/423)) ([bc347a9](bc347a9))
* switch to stderr and default port ([bcoe#7](https://github.com/prantlf/c8/issues/7)) ([bb117b7](bb117b7))
* switch to using Node's built in coverage ([bcoe#22](https://github.com/prantlf/c8/issues/22)) ([3c1b92b](3c1b92b))
* **types:** add typings for reporterOptions ([bcoe#446](https://github.com/prantlf/c8/issues/446)) ([3646e6e](3646e6e))
* use debuglog rather than console.warn ([bcoe#279](https://github.com/prantlf/c8/issues/279)) ([7c04a4d](7c04a4d))
* use process.stdout.columns for reporter maxCols ([bcoe#409](https://github.com/prantlf/c8/issues/409)) ([7731574](7731574))
* warn instead of throw on exception ([bcoe#29](https://github.com/prantlf/c8/issues/29)) ([a8620d4](a8620d4))

### BREAKING CHANGES

* Node.js' source-map and lineLength cache is now used to remap coverage output (this allows tools like ts-node to be supported, which transpile at runtime).
* temp directory now defaults to setting for report directory
* c8 will now load source-maps if possible and remap coverage accordingly
* switches to using NODE_V8_COVERAGE rather than inspector directly
* dropped subprocess support for the time being, while we march towards an initial implementation.
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.

None yet

2 participants