Skip to content
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

coloring is broken #120

Closed
richardlau opened this issue Dec 2, 2021 · 3 comments · Fixed by #121
Closed

coloring is broken #120

richardlau opened this issue Dec 2, 2021 · 3 comments · Fixed by #121

Comments

@richardlau
Copy link
Member

#98 has broken coloring of changelog entries in a terminal.

e.g. with current v14.x-staging
image

expected (with changelog-maker@2.6.0)
image

It looks like the formatting is corrupting the ansi escape codes. Both @BethGriggs and I ran into this preparing the most recent releases and we had to manually remove the corrupted ansi when pasting into the changelogs.

I guess we could stripAnsi() before formatting but then we'd lose the coloring completely.

cc @Trott

@Trott
Copy link
Member

Trott commented Dec 2, 2021

Hopefully the fix is an options setting in remark-stringify or something simple like that...

@richardlau
Copy link
Member Author

Could we move the formatting into commit-to-output.js?

function toStringMarkdown (data) {
let s = ''
s += `* \\[[\`${data.sha.substr(0, 10)}\`](${data.shaUrl})] - `
s += (data.semver || []).length ? `**(${data.semver.join(', ').toUpperCase()})** ` : ''
s += data.revert ? '***Revert*** "' : ''
s += data.group ? `**${data.group}**: ` : ''
s += cleanMarkdown(data.summary)
s += data.revert ? '" ' : ' '
s += data.author ? `(${data.author}) ` : ''
s += data.pr ? `[${data.pr}](${data.prUrl})` : ''
s = s.trim()
return (data.semver && data.semver.length)
? chalk.green(chalk.bold(s))
: (data.group === 'doc'
? chalk.grey(s)
: s)
}

I had a go but got really confused trying to call the asynchronous format from a sync function.

@Trott
Copy link
Member

Trott commented Dec 3, 2021

The text color doesn't end up in our changelogs, website release notes/announcements, or anywhere else as far as I can tell. Is that correct? It's just for the terminal output of the person running the command? If so, a simple workaround (at least temporarily) is to add the --simple flag.

rvagg added a commit that referenced this issue Dec 3, 2021
* upgrade all deps, including ESM-only deps
* --simple is now default output, including colourising, with
  --markdown being an opt-in output format.
* move process + print logic to separate module for exporting
  for simplifying branch-diff
* add --sha and --reverse options from branch-diff to dedupe some
  processing code

Fixes: #120
Closes: #107
Closes: #119
rvagg added a commit that referenced this issue Dec 3, 2021
* upgrade all deps, including ESM-only deps
* --simple is now default output, including colourising, with
  --markdown being an opt-in output format.
* move process + print logic to separate module for exporting
  for simplifying branch-diff
* add --sha and --reverse options from branch-diff to dedupe some
  processing code

Fixes: #120
Closes: #107
Closes: #119
rvagg added a commit that referenced this issue Dec 3, 2021
…nch-diff

* upgrade all deps, including ESM-only deps
* --simple is now default output, including colourising, with
  --markdown being an opt-in output format.
* move process + print logic to separate module for exporting
  for simplifying branch-diff
* add --sha and --reverse options from branch-diff to dedupe some
  processing code

Fixes: #120
Closes: #107
Closes: #119
rvagg added a commit that referenced this issue Dec 3, 2021
…nch-diff

* upgrade all deps, including ESM-only deps
* --simple is now default output, including colourising, with
  --markdown being an opt-in output format.
* move process + print logic to separate module for exporting
  for simplifying branch-diff
* add --sha and --reverse options from branch-diff to dedupe some
  processing code

Fixes: #120
Closes: #107
Closes: #119
rvagg added a commit that referenced this issue Dec 3, 2021
…nch-diff

* upgrade all deps, including ESM-only deps
* --simple is now default output, including colourising, with
  --markdown being an opt-in output format.
* move process + print logic to separate module for exporting
  for simplifying branch-diff
* add --sha and --reverse options from branch-diff to dedupe some
  processing code

Fixes: #120
Closes: #107
Closes: #119
rvagg added a commit that referenced this issue Jan 17, 2022
…nch-diff

* upgrade all deps, including ESM-only deps
* --simple is now default output, including colourising, with
  --markdown being an opt-in output format.
* move process + print logic to separate module for exporting
  for simplifying branch-diff
* add --sha and --reverse options from branch-diff to dedupe some
  processing code

Fixes: #120
Closes: #107
Closes: #119
rvagg added a commit that referenced this issue Jan 17, 2022
…nch-diff

* upgrade all deps, including ESM-only deps
* --simple is now default output, including colourising, with
  --markdown being an opt-in output format.
* move process + print logic to separate module for exporting
  for simplifying branch-diff
* add --sha and --reverse options from branch-diff to dedupe some
  processing code

Fixes: #120
Closes: #107
Closes: #119
renawolford6 added a commit to renawolford6/changelog-maker-javascript that referenced this issue Nov 9, 2022
…nch-diff

* upgrade all deps, including ESM-only deps
* --simple is now default output, including colourising, with
  --markdown being an opt-in output format.
* move process + print logic to separate module for exporting
  for simplifying branch-diff
* add --sha and --reverse options from branch-diff to dedupe some
  processing code

Fixes: nodejs/changelog-maker#120
Closes: nodejs/changelog-maker#107
Closes: nodejs/changelog-maker#119
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 a pull request may close this issue.

2 participants