microlinkhq / metascraper

Get unified metadata from websites using Open Graph, Microdata, RDFa, Twitter Cards, JSON-LD, HTML, and more.
https://metascraper.js.org
MIT License
2.35k stars 168 forks source link

Metascraper helpers depends on older version of url-regex-safe which breaks Node 16 support via re2 #474

Closed jmif closed 3 years ago

jmif commented 3 years ago

Prerequisites

Subject of the issue

Metascraper helpers depends on url-regex-safe:

"@metascraper/helpers@^5.25.0":
  version "5.25.0"
  resolved "https://registry.yarnpkg.com/@metascraper/helpers/-/helpers-5.25.0.tgz#ce53761a87326d3744cb8919cc6a881487406bec"
  integrity sha512-rdUC5HiTCmhJFJu1NGyqn9bATkBzfRIBZSvYytbo/mn4Fan0kKixrCw9GguW9rGMacmgUdqz/fjKnU/jYEIy0g==
  dependencies:
    audio-extensions "0.0.0"
    chrono-node "2.3.2"
    condense-whitespace "~2.0.0"
    entities "~3.0.1"
    file-extension "~4.0.5"
    has-values "~2.0.1"
    image-extensions "~1.1.0"
    is-relative-url "~3.0.0"
    is-uri "~1.2.0"
    iso-639-3 "~2.2.0"
    isostring "0.0.1"
    jsdom "~18.0.0"
    lodash "~4.17.21"
    memoize-one "~6.0.0"
    microsoft-capitalize "~1.0.5"
    mime-types "~2.1.33"
    normalize-url "~6.1.0"
    smartquotes "~2.3.2"
    url-regex-safe "~2.0.2"
    video-extensions "~1.2.0"

which in turn depends on re2 1.15.9, which does not have support for Node 16

url-regex-safe@~2.0.2:
  version "2.0.2"
  resolved "https://registry.yarnpkg.com/url-regex-safe/-/url-regex-safe-2.0.2.tgz#41d02bb7c927d57008389f636de0bd850a40fc7c"
  integrity sha512-n5qtPAWvMLTmgYMCX1195CKV9oJE6SkSa5bVsMrHSFA/hnqila9J1KVf6gF2M66lCWwPDhJyQlX1tEXqtzBOPQ==
  dependencies:
    ip-regex "^4.3.0"
    re2 "^1.15.9"
    tlds "^1.217.0"

re2 version 1.16.0 does have support for node 16 and it looks like url-regex-safe has recently upgraded to it. If a package upgrade is supported would be great to be able to use this with node 16!

codyogden commented 3 years ago

url-regex-safe recently made re2 optional and will fallback to the native RegExp in the 2.1.0 release. Bumping the version will likely resolve this issue. The new version of url-regex-safe is already merged into master, so we're waiting on a new release of metascraper.

Kikobeats commented 3 years ago

Thanks for notifying me. Released v5.25.1, can you confirm it works as expected?

jmif commented 3 years ago

Works! Thanks @Kikobeats