Skip to content

Conversation

@Twinki14
Copy link
Contributor

@Twinki14 Twinki14 commented Apr 15, 2025

Motivations

JsonPoke isn't technically required, and while it is beneficial to use something that's specifically meant for JSON file writing, we don't really need it.

Modifications

  • Instead of utilizing JsonPoke, opt-for the built-in WriteLinesToFile. This did require a little hacky fix for proper indention, but it's not that hacky in my opinion. While WriteLinesToFile doesn't specifically support writing JSON, we aren't really writing much JSON in the first place.
  • Drop references to JsonPoke

Results

  • One less nuget package reference
  • No breaking changes

@JonnyOThan JonnyOThan requested a review from drewcassidy April 15, 2025 14:41
@JonnyOThan
Copy link
Contributor

I like it, especially because I think jsonpoke isn’t available for non-sdk projects. I’ll have to go over it in more detail and hopefully drew can take a look too since he set that stuff up initially.

@drewcassidy
Copy link
Member

Looks like this only generates the json? it cant modify an existing version file?

@Twinki14
Copy link
Contributor Author

Twinki14 commented Nov 1, 2025

Looks like this only generates the json? it cant modify an existing version file?

No, WriteLinesToFile would simply overwrite the file if it already exists. Which, if you're wanting an out-of-the-box version-file generator you don't really need to read existing JSON. It's more efficient to just overwrite anything already existing.

EDIT: Let me know if you agree with this PR or not, I'll resolve the conflicts.

Personally IMO, don't depend on jq or jsonPoke, the more complicated basic things are made the more time you spend maintaining it in the long-term.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants