0

I'm wondering what's the way to go for it and I was not able to find anything about it. (Maybe I didn't use the right terms?)

Lets say I have a project with a main JS file and a CSS one and their respective minified version. They usually have some credits in the top stating the licence and the version of the library like in Bootstrap:

/*!
 * Bootstrap v3.3.5 (http://getbootstrap.com)
 * Copyright 2011-2015 Twitter, Inc.
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 */
  • Should I have the same version number for all the files within the application?
  • Or a different version number per file?

In case of having a group one. Does it make sense to commit a new version of every file when only the .js files have changed?

In case I have a different version per file it can lead to confusions for the developers using the library, as it can be announced as "Project v2.6.4" and you can find the CSS file with an older version such as "v.2.1.2".

1 Answer 1

1

You can follow Semantic Versioning approach:

Given a version number MAJOR.MINOR.PATCH, increment the:

MAJOR version when you make incompatible API changes, MINOR version when you add functionality in a backwards-compatible manner, and PATCH version when you make backwards-compatible bug fixes. Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format.

So, just increment the PATCH version and that's it.

You can get more information from semver.org

Sign up to request clarification or add additional context in comments.

6 Comments

That is not answering my question regarding the change of the version of each file or of the modified one only. I'm talking about the credits in each file at the very top.
You can think like that, yes. Any small backwards-compatible change is a PATCH.
I changed my answer. The docs don't state in which files should I update the PATCH.
No-one can tell you which file should be considered as PATCH and which file MINOR. They are clearly stated that what is a PATCH, what is a MINOR and what is a MAJOR version. If you follow this approach, all of your css/js changes will be PATCH unless you add a new functionality or something. In this case, it'll be a MINOR. So, it doesn't take the files one by one, it looks how your project grows.
So you are saying I should update the version number in all files whenever one of them changes?
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.