Skip to content

Add optional dependencies

Camil Staps requested to merge 25-add-optional-dependencies into main

What does this MR do?

Adds support for optional dependencies (#25 (closed)), which allows packages to put a constraint on the version of another package without requiring that package to be installed.

Changes to public APIs

  • Adds an optional switch for dependencies in nitrile.yml
  • In the metadata file generated by nitrile publish, dependencies can now have two formats:
    • "base": "^1.0.0", a simple version constraint (the old format)
    • "base": {"version": "^1.0.0", "optional": true}, a version constraint with additional info (currently only optional) (the new format)
  • This means the same two formats are now available at the /api/packages endpoint on clean-lang.org (clean-lang.org!13 (merged))

Author's checklist (required)

  • Intermediate commits compile (use git rebase -i main if not)
  • Newly added code has a style consistent with the rest of the repository
  • Newly added code is documented (guidelines)
  • If bugs have been solved, tests have been added (guidelines)
  • A changelog entry has been added (guidelines)
  • If the nitrile.yml format has changed, a migration has been defined in Nitrile.Package.Migrate

Related issues

Closes #25 (closed)

Edited by Camil Staps

Merge request reports