devonfw / IDEasy

Tool to automate the setup and updates of a development environment for any project (Successor of devonfw-ide).
Apache License 2.0
7 stars 18 forks source link

Refactor NpmUrlUpdater #437

Open hohwille opened 3 days ago

hohwille commented 3 days ago

As discussed in #435 we want to refactor NpmUrlUpdater. It is currently a WebsiteUrlUpdater what is designed for grepping versions out of HTML content and should only be used as last resort solution if there is no better way. However, here the configured website is serving JSON and not HTML. Therefore, it would make sense to migrate to JsonUrlUpdater. Then we also do not need to "grep" the versions via regex pattern but find them from the JSON structure without the need for a regex.

Since the npmjs registry is a global concept just like the maven central repository, we should consider creating an abstract base class NpmBasedUrlUpdater that contains the logic to parse the JSON from the NPM registry so sub-classes of it like NpmUrlUpdater will only need minimal code/configuration.

hohwille commented 3 days ago

milestone for optimistic case, otherwise we move to 002