-
Notifications
You must be signed in to change notification settings - Fork 790
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
feat: support cordova versioning #76
Conversation
I haven't used cordova for a long time. Just thought people might ask for bumping |
This is cool, but I kind of worry about the same thing as @stevemao, in that how many different files we'll end up bumping. Would it be possible to make these plugins, or at least standardise the process of adding and testing different formats and files in the code to avoid spaghetti? There's also the burden of maintaining different formats if they happen to change, but I think that might be a moot point since version formats should rarely change. If it's structured / maintainable, I think this would be really cool though! 👍 |
Great to hear about you guys, I am on the same page with you. Perhaps my implementation could be already moved to a separate bump plugin:) Do you have some ideas how this can be elaborated? Would you be able to provide me with a plugin framework structure so it can be easily extended? |
bower actually doesn't recommend updating or using a version field in |
@gkatsev good point about bower, but not really an issue in this PR since it is about bumping the version number in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -7,7 +7,7 @@ | |||
|
|||
> stop using `npm version`, use `standard-version` it rocks! | |||
|
|||
Automatic versioning and CHANGELOG management, using GitHub's new squash button and | |||
NPM and Cordova Automatic versioning and CHANGELOG management, using GitHub's new squash button and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than changing this copy, lets a section towards the end of the the README (below Badges!) that's something along the lines of:
Cordova Support
standard-version works with Cordova, and will automatically increment android-versionCode
in your config.xml.
2. uses [conventional-changelog](https://github.com/conventional-changelog/conventional-changelog) to update _CHANGELOG.md_ | ||
3. commits _package.json_ and _CHANGELOG.md_ | ||
4. tags a new release | ||
2. bumps the _version_ and _android-versionCode_ in _config.xml_ (based on your commit history) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's keep the original copy here, and as suggested above add a section on Cordova (we can do the same if we add more technologies).
@@ -55,7 +56,7 @@ This has the benefit of making your repo/package more portable, so that other de | |||
Install globally (add to your `PATH`): | |||
|
|||
``` | |||
npm i -g standard-version | |||
npm i -g azachar/standard-version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remember to change this back.
var pkg = require(pkgPath) | ||
var semver = require('semver') | ||
var util = require('util') | ||
|
||
function isCordovaProject () { | ||
return !!fs.existsSync(cordovaPath) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should make this slightly stricter; check whether file exists, and also confirm that it contains android-versionCode
perhaps? I can imagine projects having a config.xml that are not cordova.
@@ -23,6 +23,11 @@ | |||
"standard" | |||
], | |||
"author": "Ben Coe <ben@npmjs.com>", | |||
"contributors": [ | |||
{ | |||
"name": "Andrej Zachar <andrej@chocolatejar.eu>" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't usually keep this updated; instead letting people click the contributors link in GitHub; if you'd like to toss your name here, mind also adding all the other folks listed under contributors; alternatively let's take this out 👍
var pkg = require(pkgPath) | ||
var semver = require('semver') | ||
var util = require('util') | ||
|
||
function isCordovaProject () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mind pulling these three new methods (isCordovaProject, andriodVersionCode, bumpCordova) into a library file:
lib/cordova
I think this would be a good way to divide things up, and would provide a clear path for other people adding new file formats.
execCli().code.should.equal(0) | ||
var content = fs.readFileSync('config.xml', 'utf-8') | ||
content.should.match(/version="1.2.4"/) | ||
content.should.match(/android-versionCode="1020040"/) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
love the tests!
@azachar still interested in contributing this patch? |
Yep, I am, just busy with work and life :) I will come back to you next week. |
@azachar @Tapppi I've refactored @lexich's work on bower.json support, such that it provides a fairly generic foundation for adding more config file formats: @azachar if you want to work from this, I think it adds a good foundation for adding |
@bcoe Thank you for making that happen, I should've written my comment on the changes here probably.. I think abstracting out the write step will be helpful, we'll see when someone has the time to pick this up 😄 |
@azachar would love to land this if you have any time to put in and still need this feature; closing ticket for now since we haven't had activity since December. |
@bcoe im assigning myself to this, I want to tackle this and some other issues once I finally get some kind of a holiday (maybe one day...) |
@Tapppi awesome 👍 I'm actually off to climb in Yosemite for a few days ⛰ -- hoping to get some OSS work done at night. |
Wrong thread -- off Topic. But that is frickin awesome. Yosemite is like top 5 on my list of places to visit. Big into bouldering and beatiful places 😉 have fun, I hear it's an amazing places! |
Hello,
I have implemented Cordova versioning support. So it bumps versions to
package.json
andconfig.xml
too.This PR contains doc and tests.
Best regards,
Andrej