question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature Request: Support changesets for repos with multiple releases per package

See original GitHub issue

The Problem

I have a simple repo which looks like this:

index.js

module.exports = () => {
  if (process.env.PLATFORM === 'web') {
    console.log('Hi web');
  } else if (process.env.PLATFORM === 'ios') {
    console.log('Hi Steve');
  } else {
    console.log('Beep Boop'); // Android
  }
}

And I have a build process setup:

(imaging there's a webpack config here)

Important to note in this build process is the output bundle changes depending on the value of PLATFORM env var.

End goal

Because I have two separate platforms generated from the one codebase, I also want two separate changelogs generated.

For example, I may want:

changelog-ios.md

# beingawesome

## 1.0.0
### Major Changes
- Initial release

changelog-web.md

# beingawesome

## 1.0.0
### Major Changes
- Initial release

… etc.

But now I realise there’s a bug on iOS, so I do a fix:

index.js

-    console.log('Hi Steve');
+    console.log('Hi iOS');

So now I want to release only the ios variant (PLATFORM=ios).

Which means I only want to generate a change to the changelog-ios.md file:

changelog-ios.md

 # beingawesome

+## 1.0.1
+### Patch Changes
+- Fix output for iOS

 ## 1.0.0
 ### Major Changes
 - Initial release

Alternative

Alternatively, the changelogs may be combined into one:

changelog.md

# beingawesome

## Android 1.0.0
### Major Changes
- Initial release

## iOS 1.0.0
### Major Changes
- Initial release

Then the above change would look like:

 # beingawesome

+## iOS 1.0.1
+### Patch Changes
+- Fix output for iOS

 ## Android 1.0.0
 ### Major Changes
 - Initial release

 ## iOS 1.0.0
 ### Major Changes
 - Initial release

Proposed solution

?

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Novinycommented, Mar 4, 2020

Thanks for raising this!

There’s a bit of a bigger thing that might require some sparring (assuming you only have one package.json, have you bumped it to 1.0.1 - what does that mean for next time you release android)

as well as the fact that changelogs currently allow you to generate lines but not the whole added block.

The changelog generation is something we want to rethink at some point to get a right mix between ‘I can have exactly my preferred format’ and 'this is easy to set up and I don’t have to think about it.


If we move a bit slow and you need this, I’d recommend writing a custom version command that would look something like:

async function customVersion() {
  let releasePlan = await getReleasePlan()

  applyReleasePlan(releasePlan, { changelog: false })

  customChangelogWriter(releasePlan)
}
0reactions
emmatowncommented, Mar 4, 2020

Yep, that.

Read more comments on GitHub >

github_iconTop Results From Across the Web

changesets/changesets: A way to manage your versioning ...
Changesets has a focus on solving these problems for multi-package repositories, and keeps packages that rely on each other within the multi-package ......
Read more >
Adopting Changesets for release and changelog automation
The tools work great and they are very helpful to manage and release multiple packages within the same repository.
Read more >
Find and view changesets - Azure Repos | Microsoft Learn
Find a changeset by ID. In Visual Studio Source Control Explorer, press Ctrl+G. The Go to Changeset dialog box appears.
Read more >
Contributing | skuba - GitHub Pages
When a pull request with a changeset is merged, our CI workflow will create a new Version Packages PR. The changesets are used...
Read more >
Version control concepts and best practices
In distributed version control, each user gets his or her own repository and working copy. ... merge requests help from the user by...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found