The NASA WorldWind Javascript SDK (WebWW) includes the library and examples for creating geo-browser web applications and for embedding a 3D globe in HTML5 web pages.
898
stars
384
forks
source link
Added version consistency check before each build #896
Additionally to the version number located in package.json which provides us with versioning for the npm package, we internally store a VERSION property in the main WorldWind object. Since the latter predated the publishing of the npm package and due requiring manual updating, it has not been in sync with the package.json value.
This change adds a script that verifies consistency between these two values before performing a build, canceling the build if the check fails.
The value in WorldWind.js is updated to reflect the numbering as found in the npm package and GitHub's releases.
Tested regex in line 23 of the script at https://regex101.com/. I also tested an assortment of version numbers and nonsensical strings.
Why Should This Be In Core?
It provides the developer the means to ensure that version numbers are consistent across the project without incurring in breaking changes to the WorldWind object.
Benefits
Simple way to maintain version consistency between the two files where the value is stored.
Potential Drawbacks
For future releases, It still requires manually updating the version number in WorldWind.VERSION. Since automatically rewriting it with each build could be considered an antipattern, manual updating is deemed acceptable.
Description of the Change
Additionally to the version number located in package.json which provides us with versioning for the npm package, we internally store a VERSION property in the main WorldWind object. Since the latter predated the publishing of the npm package and due requiring manual updating, it has not been in sync with the package.json value.
Tested regex in line 23 of the script at https://regex101.com/. I also tested an assortment of version numbers and nonsensical strings.
Why Should This Be In Core?
It provides the developer the means to ensure that version numbers are consistent across the project without incurring in breaking changes to the WorldWind object.
Benefits
Simple way to maintain version consistency between the two files where the value is stored.
Potential Drawbacks
For future releases, It still requires manually updating the version number in WorldWind.VERSION. Since automatically rewriting it with each build could be considered an antipattern, manual updating is deemed acceptable.