PhilanthropyDataCommons / sdk

Instructions and supporting files for SDK generation
GNU Affero General Public License v3.0
1 stars 0 forks source link

Populate dynamic version in package.json #9

Closed slifty closed 9 months ago

slifty commented 9 months ago

I'd like to see the typescript template's package.json version number be driven by a combination of:

(A) The template version number

and

(B) The swagger specification version number

In particular I think that the algorithm should look something like this:

  1. If both (A) and (B) have had a major release, then the resulting sdk version number should be (A.major + B.major).(A.minor + B.minor).(A.patch + B.patch).
  2. If EITHER (a) or (B) are still in v0.x.x, then the resulting sdk version number should be 0.(A.major + B.major + A.minor + B.minor).(A.patch + B.patch).

Under this algorithm we will avoid situations where a breaking change from a 0.x.x release is interpreted as a minor change in the sdk release. We'll also ensure that every new version of either the template OR the api spec would result in an increased sdk version.


I believe this calculation will need to be performed as part of the custom template definition's settings object, which would then populate a custom variable to be made available in the mustache templates.