dappnode / DNP_DAPPMANAGER

Dappnode package responsible for providing the Dappnode Package Manager
GNU General Public License v3.0
31 stars 39 forks source link

Allow semver ranges #2011

Closed dappnodedev closed 2 months ago

dappnodedev commented 3 months ago

This PR refactors the DappGetFetcher class to improve the handling of dependencies and their version ranges. The main improvements include:

  1. Separation of Concerns:

    • The processDependencies method was introduced to handle two main responsibilities:
      • Filtering out dependencies that are already satisfied by installed packages.
      • Parsing and converting semver ranges to appropriate APM-compatible versions.
  2. Improved Optional Dependencies Handling:

    • A new mergeOptionalDependencies method was introduced to inject optional dependencies into the main dependencies object only if the corresponding packages are installed.
  3. Enhanced Semver Range Handling:

    • The parseSemverRangeToApmVersion method was created to convert semver ranges like ^x.x.x, ~x.x.x, >x.x.x, and >=x.x.x to appropriate APM-compatible versions or the latest version (*) if applicable.
    • Added checks to ensure that only simple version ranges are supported, throwing errors for complex or combined ranges.
  4. Code Readability and Maintainability:

    • The code was refactored to be more modular and easier to understand, with clear method responsibilities and added inline documentation.
    • Methods were renamed and reorganized for clarity, following best practices.
github-actions[bot] commented 3 months ago

🚀 Deployed on https://66bca12f7cf6aca07976e84b--objective-borg-9eeae5.netlify.app

github-actions[bot] commented 3 months ago

Dappnode bot has built and pinned the built packages to an IPFS node, for commit: e9e20dc586d11a5008d56cf0e145de74b53bd9f5

This is a development version and should only be installed for testing purposes.

  1. Package dappmanager.dnp.dappnode.eth

    Install link

    Hash: /ipfs/QmYgH3yKFQuLZ1Ks273kfNjL5V2aArt8AooCNvnUNUc5Ft

(by dappnodebot/build-action)

dappnodedev commented 2 months ago

This should not be necessary as it is already supported in another way