Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement a class to store and retrieve the semantic version number #13

Open
MatthewKosloski opened this issue Sep 15, 2021 · 0 comments
Labels
feature New feature or request

Comments

@MatthewKosloski
Copy link
Owner

Currently, we're storing the semantic version number of the compiler as a string (see here). To provide more semantics and validation, we should implement a Version class (similar to that used in TypeScript, here) that can store the three dot-separated numeric identifiers we use to describe the compiler version numbers.

Should use the following regex to validate against (taken from the node-semver package here):

(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)

Tentative acceptance criteria:

  • Should be able to construct new versions by passing in a major number, minor number, patch number, or all three (if one is not provided, then default to zero).
  • Should provide accessor methods to retrieve parts of the version number (e.g., getMajor(), getMinor(), getPatch()).
  • Should provide string representation of the version number via a toString() method.
  • Should provide a public method to increment the version number (like what's used in tsc here).
@MatthewKosloski MatthewKosloski added the feature New feature or request label Sep 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant