absolute-version / commit-and-tag-version

Fork of the excellent standard-version. Automate versioning and CHANGELOG generation, with semver.org and conventionalcommits.org :trophy:
ISC License
360 stars 33 forks source link

feat(updater): add YAML support (#33, #748) #137

Closed danielgrad closed 3 months ago

danielgrad commented 3 months ago

Adding support for YAML files. Based on #748. Geared towards Dart/Flutter pubspec.yaml files, but will work with any YAML file using root level version key.

TimothyJones commented 3 months ago

Thanks so much for this!

TimothyJones commented 3 months ago

npm run format:fix will fix the formatting issues - I tried to push a fix commit to your branch, but it seems I don't have permissions.

Anyway, this looks great - thanks for the feature, I'll merge it once it passes the format check

danielgrad commented 3 months ago

Fixed formatting issues.

TimothyJones commented 3 months ago

I suspect the failure might be due to line ending issues. I’m travelling this week so can’t take a detailed look at the moment, sorry

danielgrad commented 3 months ago

updated to preserve line endings

ixuz commented 3 months ago

Could this yaml version updater perhaps also support updating versions that are located deeper in the yaml document?

If that would be the case, then this PR could supersede the PR that I opened earlier. Which needs to bump the version located under property: info.version.

I don't want to scope creep your work, so maybe it's better to work this detail out under a separate issue later (after this is PR has been merged).

What do you think?

danielgrad commented 3 months ago

@ixuz I saw your PR already and I wanted to try to integrate a way to do that, but I did not see an easy way to add additional options to the command (to provide a specific path to update). Maybe there is and I missed it.

TimothyJones commented 3 months ago

Ah, apologies - I missed the notification about that PR for some reason. I've been travelling for the past few weeks, back on Friday. I'll take a quick look now.

The options system is a bit annoying in that it isn't clearly separated from the config - so not all options and ways of setting them are equal. This also makes it harder to add new ways of config, as there isn't a super consistent pattern.

There have been a couple of efforts to address this (the last one stalled I believe, possibly because introducing typescript at the same time made it a larger effort).

so maybe it's better to work this detail out under a separate issue later (after this is PR has been merged).

I think this makes sense - my gut feel is that it would be nice to have a general yaml support, and then perhaps a few specific ones (eg openapi) that could be just specific configurations of the yaml plugin, maybe? I don't know.

TimothyJones commented 3 months ago

Thanks both for your excellent work, by the way! It's a really nice maintainer experience to receive PRs that include documentation and tests 🙌 🙌

TimothyJones commented 3 months ago

Released as 12.3.0. Thanks again!