bubkoo / html-to-image

✂️ Generates an image from a DOM node using HTML5 canvas and SVG.
MIT License
5.4k stars 505 forks source link

fix: use path extensions for esm #380

Open maheshsundaram opened 1 year ago

maheshsundaram commented 1 year ago

Description

Note: If this change is against the project's maintainers' goals, feel free to close. I forked this library and made this change so that I could utilize this library in browser code using ES modules and importmap.

ES Module resolution does not perform automatic file extension resolution and tsc does not rewrite import statements during emit. The recommendation from the Typescript handbook is to use the extension of the output files.

Add .js file extensions to imports

Motivation and Context

Provide valid ES module

Types of changes

Self Check before Merge

vivcat[bot] commented 1 year ago

👋 @maheshsundaram

💖 Thanks for opening this pull request! 💖

Please follow the contributing guidelines. And we use semantic commit messages to streamline the release process.

Examples of commit messages with semantic prefixes:

Things that will help get your PR across the finish line:

We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can.

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 100.00% and no project coverage change

Comparison is base (b751cbf) 62.93% compared to head (7acfc92) 62.93%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #380 +/- ## ======================================= Coverage 62.93% 62.93% ======================================= Files 10 10 Lines 580 580 Branches 143 143 ======================================= Hits 365 365 Misses 151 151 Partials 64 64 ``` | [Impacted Files](https://codecov.io/gh/bubkoo/html-to-image/pull/380?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=%E5%B4%96) | Coverage Δ | | |---|---|---| | [src/apply-style.ts](https://codecov.io/gh/bubkoo/html-to-image/pull/380?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=%E5%B4%96#diff-c3JjL2FwcGx5LXN0eWxlLnRz) | `100.00% <ø> (ø)` | | | [src/dataurl.ts](https://codecov.io/gh/bubkoo/html-to-image/pull/380?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=%E5%B4%96#diff-c3JjL2RhdGF1cmwudHM=) | `60.00% <ø> (ø)` | | | [src/util.ts](https://codecov.io/gh/bubkoo/html-to-image/pull/380?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=%E5%B4%96#diff-c3JjL3V0aWwudHM=) | `62.80% <ø> (ø)` | | | [src/clone-node.ts](https://codecov.io/gh/bubkoo/html-to-image/pull/380?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=%E5%B4%96#diff-c3JjL2Nsb25lLW5vZGUudHM=) | `71.42% <100.00%> (ø)` | | | [src/clone-pseudos.ts](https://codecov.io/gh/bubkoo/html-to-image/pull/380?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=%E5%B4%96#diff-c3JjL2Nsb25lLXBzZXVkb3MudHM=) | `29.16% <100.00%> (ø)` | | | [src/embed-images.ts](https://codecov.io/gh/bubkoo/html-to-image/pull/380?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=%E5%B4%96#diff-c3JjL2VtYmVkLWltYWdlcy50cw==) | `78.04% <100.00%> (ø)` | | | [src/embed-resources.ts](https://codecov.io/gh/bubkoo/html-to-image/pull/380?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=%E5%B4%96#diff-c3JjL2VtYmVkLXJlc291cmNlcy50cw==) | `82.92% <100.00%> (ø)` | | | [src/embed-webfonts.ts](https://codecov.io/gh/bubkoo/html-to-image/pull/380?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=%E5%B4%96#diff-c3JjL2VtYmVkLXdlYmZvbnRzLnRz) | `30.63% <100.00%> (ø)` | | | [src/index.ts](https://codecov.io/gh/bubkoo/html-to-image/pull/380?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=%E5%B4%96#diff-c3JjL2luZGV4LnRz) | `89.47% <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=%E5%B4%96). 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=%E5%B4%96)

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