Contains changes for two flub commands, `generate:releaseNotes` and
`generate:changelog`.
### generate:releaseNotes
The changeset generator no longer fails with an error message when no
changes are detected. Instead, it outputs a prompt:
> No changed packages have been detected. Do you want to create a
changeset associated with no packages?
If the user selects Yes, then the package selection is skipped but the
user can still provide a summary, description, and release notes
section. If they select No, then they can select affected packages from
the complete list.
The prompt chain was simplified by using functions for the "type"
property and returning false when the question should be skipped. This
allows all the questions to be in a single prompt chain and
conditionally ask questions based on previous responses and other input.
The full prompt flow is now:
1. IFF no changed packages are detected, ask "Do you want to create a
changeset associated with no packages?". If YES, go to 3. IF NO, go to
2.
2. Prompt to select affected packages and bump levels.
3. Prompt to select release notes section.
4. Prompt to enter summary.
5. Prompt to enter body.
The code was also reorganized to optimize checking for changes. The
previous code ended up comparing the local to the remote at least twice;
now that check is only done twice if the user is prompted to select a
different target branch - and does. Otherwise, the check is done once
and the results of that check are used where needed. This speeds up the
default case.
### generate:changelog
When generating changelogs, we invoke the `changeset version` command to
apply the changesets to all the packages. This is what actually writes
the changelogs. However, our changesets have additional custom metadata
in a second front-matter section (see
https://github.com/microsoft/FluidFramework/wiki/Changesets#custom-metadata).
To enable the existing tools like
[@changesets/cli](https://www.npmjs.com/package/@changesets/cli) to work
with our changesets, commands like the `generate:changelog` command
first updates all the changesets to be "canonical" changesets by
removing the additional metadata section. We update the changesets to be
canonical, then we invoke `changeset version`, which consumes the
updated changesets, and then do some cleanup on the resulting changes.