mathiasbynens / emoji-regex

A regular expression to match all Emoji-only symbols as per the Unicode Standard.
https://mths.be/emoji-regex
MIT License
1.72k stars 175 forks source link

Reintroduce changes from #78, #79 (missing RGI_Emoji.d.ts) previously removed by force push #86

Closed mattbroussard closed 3 years ago

mattbroussard commented 3 years ago

It appears that a force push in the main repo (presumably accidentally) removed the merged commits for #78 and #79 from the main branch. This PR reintroduces the changes from those PRs (as new cherry-picked commits, since the merged commits are now orphaned and don't exist in a new clone).

The force push can be seen in the history of #81: image

mathiasbynens commented 3 years ago

It was not an accident -- the type definitions weren't working as desired. What happens if you run npm run build after these changes? Is the tree dirty?

mattbroussard commented 3 years ago

Ah. I assumed it was accidental since I didn't see any comments talking about the force push and most public repos tend to prefer reverting over force-pushing.

In my case, this caused a problem because I'd pointed a private TypeScript project at the repo directly rather than npm since at the time (Jan 22) there hadn't yet been a new npm release containing the new types. With the force push, my project was now pulling in a copy of the package without the new types and failing typecheck.

What happens if you run npm run build after these changes? Is the tree dirty?

Yes, it seems that npm run build removes the whole es2015 folder and Babel does not do anything with the .d.ts files that exist outside the src folder it's pointed at. I hadn't noticed that before since I didn't try the build.

I've just pushed another commit to this PR to have Babel copy the .d.ts files into place (edit: just noticed this is pretty similar to what #81 does, except having Babel do it rather than cping directly); now tree is clean after npm run build. Does this solution work for you?

the type definitions weren't working as desired

Was there any problem other than the above one involving the files being blown away by npm run build?

mattbroussard commented 3 years ago

Oops, did not mean to close.