-
-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Description
If a project version is being bumped after v1.0.0, options.dryRun === true, and release notes are being generated from a project CHANGELOG, the notes lifecycle does not log the generated release notes.
Instead, an Exception is thrown because the new project version hasn't been written to the CHANGELOG, and therefore can not be found within the CHANGELOG content.
Steps to reproduce
- Run
greasewithoptions.dryRun === truein a project versioned afterv1.0.0 - See error during
noteslifecycle
Expected behavior
The notes lifecycle should not require a version argument if options.dryRun === true.
Relevant screenshots
grease output for @flex-development/[email protected]
Environment
- Node Version:
v16.6.0 - OS:
macOS v11.3.1 - Package Manager:
[email protected] - Package version(s):
grease<=1.1.0
Possible solution
If possible, the notes lifecycle should tap into standard-version changelog lifecycle to use its options.dryRun output.
The changelog lifecycle could also be re-implemented in grease, but it may be difficult to keep track of future updates to standard-version. If it is re-implemented, however, the lifecycle signature could be updated and the return type could be changed to Promise<string>, where string is the new CHANGELOG entry, Promise<void>:
const Changelog: (
options?: IGreaseOptions,
newVersion?: NullishSemanticVersion
) => Promise<NullishString>The notes lifecycle signature could also be updated:
const Notes: (
options?: IGreaseOptions,
changelog?: NullishString,
version?: NullishSemanticVersion
) => Promise<NullishString>Additional context
Exception origin in notes lifecycle
// Search for package version in changelog content
if (!versions.includes(version)) {
const data = { errors: { version }, versions }
const message = `${version} not found in ${options.infile}`
throw new Exception(ExceptionStatusCode.NOT_FOUND, message, data)
}Metadata
Metadata
Assignees
Labels
Type
Projects
Status
