-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEATURE] Preview a previous version #187
Conversation
a2299e5
to
0f64767
Compare
0f64767
to
55c95c6
Compare
src/cli/preview.js
Outdated
module.exports.preview = function (inputs, flags) { | ||
if (!!flags && flags.previousVersion) { | ||
const previousVersionRegex = new RegExp( | ||
`# \\[${flags.previousVersion}\\] - \\(.*\\)([^\\[]+)\\.` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 if someone change the default template, will this feature work?
I think this feature should work for any scenario and I think it will not be that simple.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In order of our talk, I've added a metadata injection in between the generated changelog so we don't need to worry about custom templates. Nice idea, though 🥇 . What do you think now?
src/build-template.js
Outdated
module.exports.renderTemplate = function (changelogTemplate, data) { | ||
function injectMetadata(compiledTemplate, version) { | ||
return ` | ||
[//]: # (start ${version}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about simplifying this metadata?
[//]: # s-${version}
[//]: # e-${version}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In order to the comment properly work, we need to maintain the ()
, but I'll update to s-
and e-
instead of start
and end
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done :)
@matheusfiorin could you fix the code smell? |
dda7ce2
to
88fcf60
Compare
Kudos, SonarCloud Quality Gate passed! |
Explore the meow package used in CLI to upgrade the
preview
command - now with an option to preview a previous generated version.Usage: