Utility to include a codename for your application based on version (up-to v10.X.X-X).
This works great alongside version bump utility: gulp-bump for keeping your version numbers and names up-to-date with each build.
Included codenames and patch names created with the help of the excellent codenamegenerator.com website.
This plugin requires gulp.
Once you're familiar with that process, you may install this plugin with this command:
npm install gulp-codename --save-dev
var codename = ;
The project follows the SemVer guidelines for version numbers; specifically following:
N.B. The supplied codenames and patch names only include support for single-digit numbers used for minor and patch of the version field (and major up to 10) - you must supply your own custom codenames and patch names if you can't handle this restriction (but that's a lot of names)!
The "codename" task
In your project's gulpfile.js, add a task named
codename allows to set the codename and patch name based on the version number of the configuration file (package.json) in your project. Only JSON files are supported, and each file must have a
version field compliant to SemVer guidelines; specifically following:
Remember: The supplied codenames and patch names only include support for single-digit numbers used for minor and patch of the version field (and major up to 10) - you must supply your own custom codenames and patch names if you can't handle this restriction (but that's a lot of names)!
codename is designed to update your package.json, manifest.json or any other JSON file with a "version" field (configured as noted above).
An example of a manifest.json file is below:
Once codename has been used (with patch names enabled); the manifest.json file would be updated automatically as follows:
||Generate a name for the patch version as well as the main codename.|
||Use a custom JSON file for codenames.|
Running the task in this way, the
patchname fields of each source file will be automatically changed to the correct codename and patch name for the build release.
Running the task in this way, the
codename field of each source file will be changed to the correct codename but patch name will not be included.
The names contained within the user-supplied myCodenames.json file will be used.
Use with gulp-bump
You can add the codename task alongside your bump task as follows:
Any contribution to improve the project and/or expand it is welcome.
If you're interested in contributing to this project, take care to maintain the existing coding style.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature)
- Commit your changes (
git commit -am 'Add some feature')
- Push to the branch (
git push origin my-new-feature)
- Create new Pull Request
Add unit tests for any new or changed functionality. Lint and test your code using gulp.
Changes, bug fixes and enhancements made to gulp-codename.
- Release promoted to v0.1.0.
- BREAKING CHANGE (if using own JSON file): Renamed "codeNames" to "codenames" within codenames.json.
- BREAKING CHANGE (if using own JSON file): Renamed "patchNames" to "patchnames" within codenames.json.
- Code cleanup.
- Code commented.
- Included additional error checking.
- Updated gulp log during codename generation for readability.
- Removed unnecessary patch name "0".
- README.md updates/fixes.
"Perseus Amber" (Malbrouck)
- Corrected README.md.
- Included "gulpfriendly" within package.json.
"Perseus Amber" (Anoa)
- Ignores unsupported 2-digit version numbers (e.g. "v.0.10.0") - unless custom JSON is used and includes support for this.
- Codename unaltered if unavailable for current version.
- Patch name cleared if unavailable for current version.
"Perseus Amber" (Uromastix)
- Updated log output.
"Perseus Amber" (Tayra)
- Removed debug log.
- Updated README.md detailing use alongside bump task.
"Perseus Amber" (Pangolin)
- Fixed problem with loading the codenames.json file.
gulp-codename v0.0.2 (Deleted)
"Perseus Amber" (Ithomiid)
- Fixed README.md
gulp-codename v0.0.1 (Deleted)
"Perseus Amber" (Saiga)
- Initial commit
See the LICENSE distributed with the project.