GoogleChrome / chrome-types

Code to parse Chrome's internal extension type definitions—published on NPM as chrome-types
https://www.npmjs.com/package/chrome-types
Apache License 2.0
189 stars 30 forks source link

Correctly record history of returns_async return values. #45

Closed oliverdunk closed 1 year ago

oliverdunk commented 1 year ago

Prior to this change return values defined using the returns_async keyword did not properly appear in the history. This is because returns_async was not considered when creating the list of expansions.

Once this was added, there was a second issue because the old void/callback expansion was seen after the promise-based one and overwrote the history data we had generated. To avoid this I added logic which always prefers a return type over void.

Resolves #35

codecov[bot] commented 1 year ago

Codecov Report

Base: 35.47% // Head: 35.60% // Increases project coverage by +0.13% :tada:

Coverage data is based on head (13b4a32) compared to base (8ba5062). Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #45 +/- ## ========================================== + Coverage 35.47% 35.60% +0.13% ========================================== Files 21 21 Lines 3986 3991 +5 Branches 183 185 +2 ========================================== + Hits 1414 1421 +7 + Misses 2572 2570 -2 ``` | [Impacted Files](https://codecov.io/gh/GoogleChrome/chrome-types/pull/45?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=GoogleChrome) | Coverage Δ | | |---|---|---| | [tools/lib/render-context.js](https://codecov.io/gh/GoogleChrome/chrome-types/pull/45?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=GoogleChrome#diff-dG9vbHMvbGliL3JlbmRlci1jb250ZXh0Lmpz) | `57.83% <100.00%> (+0.54%)` | :arrow_up: | | [tools/lib/traverse.js](https://codecov.io/gh/GoogleChrome/chrome-types/pull/45?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=GoogleChrome#diff-dG9vbHMvbGliL3RyYXZlcnNlLmpz) | `93.54% <100.00%> (ø)` | | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=GoogleChrome). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=GoogleChrome)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

oliverdunk commented 1 year ago

To test this, I ran the tool with and without this change and compared the output. The changes looked as expected:

I also compared version numbers with a number of CLs/commits and found them to be accurate.