Skip to content

Conversation

fleg
Copy link
Contributor

@fleg fleg commented Dec 17, 2019

No description provided.

bin/changelog Outdated

const changelog = fs.readFileSync('CHANGELOG.md', 'utf8')
.replace(/\n{3,}/g, '\n');
const rows = changelog.split('\n');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

мне кажется replace лучше тут сделать, чтобы оригинал был оригиналом

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

наверное да, хоть он потом и не используется нигде

const rest = [];
const links = [];

_(rows).each((row) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Смотри, а мы тут можем без регулярок, вроде читаемей получается:
image
Возможно, мы могли бы еще isHeader какой-то выделить в функцию, как думаешь?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

c isHeader тут думаю можно не парится


fs.writeFileSync('CHANGELOG.md', newChangelog);

exec('git add -A CHANGELOG.md');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

может в утилиту вынести commitFile, потому что дублируется с lib/version?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

да это отдельно надо как-то продумать

@fleg
Copy link
Contributor Author

fleg commented Dec 18, 2019

забыл еще написать что использовать это можно, добавив в package.json в scripts
"prerelease": "changelog"

@fleg fleg merged commit 36cc8fd into master Dec 19, 2019
@fleg fleg deleted the feature/changelog branch December 19, 2019 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants