-
Notifications
You must be signed in to change notification settings - Fork 800
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: custom 'bumpFiles' and 'packageFiles' support #372
Conversation
@jbottigliero 👋 I've been at a variety of conferences for the past couple weeks, sorry for the slow reviews. Thanks for the hard work you've been putting into Are you in the slack, you should feel free to interact with me there (it's a good way to help keep me in line 😉 ). |
First of all, thanks for the great tool! What is the status of this feature? It would really help me to use this tool with a gradle-based project. If has anything that I can do to help this, please let me know 😁 |
@jbottigliero I really like this work, it's not dissimilar to some work I'm doing here: https://github.com/googleapis/release-please/tree/master/src/updaters To make version updates more extensible; perhaps it would make sense to do something similar, where we have some default updating patterns, but we can also extend on the logic used to update a version for edge-case file formats? @caiorcferreira I'm a proponent of this feature 👌 @jbottigliero what could you use help with to see it over the finish line? |
@bcoe I think at this point it's really it's just coming up with an acceptable API for folks. I dig the defmodule Phoenix.MixProject do
use Mix.Project
@version "1.5.0-dev"
def project do
[
app: :phoenix,
version: @version, defmodule ExercismTestRunner.Mixfile do
use Mix.Project
def project do
[
app: :tests,
version: "0.0.1", It's probably best we don't make any assumptions about these files. Maybe we could offer out-of-the-box solutions for the most common scenarios, while allowing customization. Maybe rather than Where the |
I've made some tweaks to the proposal – the object will just support strings for both If this direction seems reasonable, I think as far as what is left:
I'm also considering using the Taking a look at |
Support for a Basically, what I've proposed as the {
bumpFiles: [
'version.txt',
'VERSION',
{
filename: 'other-plain-text-file-that-is-in-my-repo.txt',
// Not sure the best way to express this in the configuration,
// but I think this describes my intent.
updater: '@standard-version/package-files/plain-text'
// Maybe just using `type` here would resolve to internal updaters instead, ie.
// type: 'plain-text'
// ...this would reserve `updater` for custom updaters.
}
]
} |
46926dc
to
be30936
Compare
@jbottigliero this is awesome. I've been using it for the past day or so and it's been working good for me. Used this to installe it:
|
@jbottigliero this API is looking great to me I'll make an effort to give a more thorough review soon? I'd say go ahead and start working on an updated README though? |
Exactly what I am looking for... Working on a python project, and that would help! I have not yet found a workaround to do this, even using Actually would this allow to setup the files to bump and the text to look for?
|
be30936
to
3c3d80a
Compare
@@ -307,69 +322,111 @@ standardVersion({ | |||
}) | |||
``` | |||
|
|||
## Commit Message Convention, at a Glance |
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've removed this section – the README is pretty big and it seems like this is better handled by linking out to conventionalcommits.org.
index.js
Outdated
let pkg | ||
bump.pkgFiles.forEach((filename) => { | ||
args.packageFiles.forEach((filename) => { |
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.
@jbottigliero If the list of package files is configurable, updaters should be allowed as for bump files. Otherwise, this configuration will not work:
"packageFiles": [
"pom.xml"
],
"bumpFiles": [
{
"filename": "pom.xml",
"updater": "xml-updater.js"
}
]
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.
Updated - thanks!
2eb2128
to
c0f2b5e
Compare
Alright! I believe this is good to go... I'm not super happy with the API (when you have a custom Semi-related, also considering adding an |
d63e86e
to
57ce557
Compare
@tommywo enlist your feedback on this? You've been doing a lot of work on conventional changelog, and trust your opinion. |
Hello guys, @jbottigliero. Personally I think this solution is really universal but it's may be "to match". I think it's ok to have unnecessary In other hand Regex probably be common used option for version update. So I think everyone will be happy to have |
@FixRM – thanks for the feedback! I moved away from the I haven't had the chance to test this out, but I'm hoping to port a few non-JS projects to use |
Hello guys, any update on this? |
@FixRM 👋 hello, I've been a bit buried in issues lately and unfortunately haven't had much time for |
Any progress ? |
Tested the branch with a custom YAML parser and it works amazingly! Would be great to see this get merged in and released |
Co-Authored-By: Sébastien Règne <[email protected]>
- Ensure `packageFile` parsing supports custo updaters. - Abstracts the updater resolution code for bumpFiles and packageFiles
57ce557
to
3be2404
Compare
This is a POC for allowing version bumps in custom
bumpFiles
. It movespackageFiles
andbumpFiles
to command line "arguments" ...but the configuration forbumpFiles
is better served as part of a configuration file.I've added a test showing how it can be used to support a basic
mix.exs
file (mentioned in #313).I'm not super happy with the option (
{filename: string, replacer: Regex}
), but it seemed like a decent place to get the conversation started (since we'll likely want to get something added to theconventional-changelog-config-spec
before anything changes here).Ideally, I'd like to come up with a single solution that solves for #313, #322 and #348.
Some alternatives I've considered:
replacer: Regex
, we could process ahandler: Function
option (this also assumesyargs.config
will be ok with aFunction
).semver
to detect version... but this seems extremely error-prone and less precise than alternatives.