-
Notifications
You must be signed in to change notification settings - Fork 2
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
Feat: recover the complete changelog.md #10
Conversation
a60981a
to
8402b76
Compare
8402b76
to
8884e32
Compare
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 if a changelog exists (maybe used sgr
) and then I forgot to release 2 times with sgr
but then I want to recover those missing two. It won't work right?
lib/cli.js
Outdated
@@ -15,13 +15,16 @@ import getLatestVersion from './helpers/getLatestVersion'; | |||
import pkg from '../package.json'; | |||
import questions from './questions'; | |||
import tasks from './tasks'; | |||
import recoverTasks from './recover-tasks/index'; |
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.
/index
is not necessary
const tagsCount = countGitTags(); | ||
const tags = taggedCommits({ | ||
path: cwd, | ||
lookBehind: tagsCount, |
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.
I guess it would be more performant if you use Number.POSITIVE_INFINITE
commit: tag.hash, | ||
}).date; | ||
|
||
changelogData = `${tag.version} - ${moment(tagDate, 'ddd MMM D HH:mm:ss YYYY Z').format('MMMM, DD YYYY')}\n`; |
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.
I think we should make a global formating, since it is also here used (just with the moment()
param diff):
stream.write(`${version} - ${moment().format('MMMM, DD YYYY')}\n\n`); |
But if we want to change it at some point there is just one place for it.
return; | ||
} | ||
|
||
changelogData = `${changelogData} * ${commitInfo.shortHash} ${commitInfo.message.split('\n')[0]} (${commitInfo.author})\n`; |
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.
Maybe same here as with the header:
stream.write(`* ${commitInfo.shortHash} ${commitInfo.message.split('\n')[0]} (${commitInfo.author})\n`); |
Could be a global function where we pass in the entire commitInfo
as param. So we can vary better then (if something changes).
@@ -0,0 +1,94 @@ | |||
import fs from 'fs'; | |||
import fse from 'fs-extra'; |
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.
import fse
is not quite needed. You can actually write:
import fs from 'fs-extra';
@JPeer264 why shouldn't you not be able to recover those two releases? The changelog gets rewritten everytime you hit |
No description provided.