angular / dgeni-packages

A collection of dgeni packages for generating documentation from source code.
MIT License
142 stars 106 forks source link

git decorateVersion: specific logic only for AngularJS causes doc generation to fail #289

Open christophercr opened 4 years ago

christophercr commented 4 years ago

The decorateVersion service of the git package contains very specific logic related to very old versions of AngularJS.

This means that in case you use dgeni-packages to generate your project documentation and your current version is by the chance the same version that the decorateVersion targets... then the doc generation process fails because the decorated version does not align with semver anymore: v1.0.0-alpha.0 is converted to v1.0.0alpha0.

TypeError: Invalid Version: v1.0.0alpha0

I understand the reason why this custom logic is needed for AngularJS (although I think this custom logic should not be included as part of this package if it is meant to be a generic library for doc generation) but I think this should be at least mentioned somewhere in the docs of dgeni-packages and explain how to override/workaround this, cause it was not that easy to find the cause of this issue.

Moreover, I think this issue has never pop up in the Angular AIO project since there the Angular version started in v2 😛

petebacondarwin commented 4 years ago

I'm sorry about this @christophercr. I am pleased to hear that people are still using dgeni! The workaround is fairly straightforward: since decorateVersion is a dgeni service, you can just provide your own version of it in your own dgeni-package. This will override the one provided by the git package, as long as you provide your service in a package that depends upon the git package.

We should clean up this git package and move the customizations to the angular.js repo.