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

Support package.json and component.json (and other json) bumping simultneously #21

Closed
wants to merge 2 commits into from

Conversation

nbubna
Copy link

@nbubna nbubna commented May 20, 2013

This adds a files option (defaulting to ['component.json']), allowing multiple json descriptors to be updated as part of a grunt-release task.

@nbubna nbubna mentioned this pull request May 22, 2013
@mar10
Copy link

mar10 commented May 26, 2013

Instead of bumping a series of files, wouldn't it be more robust to have an authorative place for the semver (e.g. package.json), bump this, and then copy/replace that version over to other sources (e.g. myplugin.jquery.json, but also source files)?
What about running a task like grunt-replace after bump (related to #22 and #10 )?

@nbubna
Copy link
Author

nbubna commented May 27, 2013

Yeah, that makes sense.

@nbubna
Copy link
Author

nbubna commented May 30, 2013

Ok, actually, i don't think it does. At least, not grunt-replace. Because grunt-replace is for replacing a variable reference like @@Version while copying files. I don't see how it will work for files like bower.json and component.json that need the version number to be present in their original source location. We'd have to keep a non-replaced form in a different directory and the replaced form in the main directory. This will certainly confuse contributers and needlessly duplicates the file. I think my solution is probably the better one, after playing around with grunt-replace.

@mar10
Copy link

mar10 commented May 31, 2013

I still like the idea of a single 'canonical' place for the number. Maybe grunt-version would be a better example then, since (if I understand correctly) it replaces existing version numbers with a new one.
Thinking about it a bit more, maybe 'bump' - and the part between bump and commit - is sometimes too complex to be handled by this plugin altogether.
For example I might like to build minified versions that contain the new version number as part of the file name.
I'll try to set bump: false and set up a grunt task that does what I want (using grunt-release for the final git part only).

@mar10 mar10 mentioned this pull request May 31, 2013
@nbubna
Copy link
Author

nbubna commented May 31, 2013

Was thinking about grunt-version. I'm not very familiar with the capabilities of node/grunt, but it seems to me that a grunt-version plugin would be best if it could, by default, scan the root directory for json files, and update any root-level 'version' property in them. It could have include: ['.'] and exclude: [] as defaults (directories included would not need deep scanning either). Sound reasonable? Let me know if you want help. I'm trying to learn more about grunt, and this could be a good thing to work on.

@geddski
Copy link
Owner

geddski commented Jun 1, 2013

This is a tricky issue. Say you're developing a project that contains both a node module (uses package.json) and a bower component (bower.json). The node module likely has a different version number, and gets published to npm rather than the bower registry. Forcing them to be on the same version isn't flexible enough.

Ultimately I think I'm going to separate out all the tasks into their own plugins, and make grunt-release use them all with a sensible default (same as current) so grunt-release can continue to be used with little or no config. I'll hack on that this weekend.

@geddski
Copy link
Owner

geddski commented Jun 1, 2013

Closing this issue, think we're going to go the separate tasks route.

@geddski geddski closed this Jun 1, 2013
@gxxcastillo gxxcastillo mentioned this pull request Dec 2, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants