Skip to content

Run Prettier as part of the blog post script #6041

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

Closed
bmuenzenmeyer opened this issue Oct 24, 2023 · 8 comments · Fixed by #6044
Closed

Run Prettier as part of the blog post script #6041

bmuenzenmeyer opened this issue Oct 24, 2023 · 8 comments · Fixed by #6044
Labels
good first issue Issues for newcomers hacktoberfest This Issue is meant for Hacktoberfest 2023 help wanted

Comments

@bmuenzenmeyer
Copy link
Collaborator

bmuenzenmeyer commented Oct 24, 2023

          Now we have to run Prettier on blog posts? Please do it as part of the script that generates them!

Originally posted by @targos in #6040 (comment)

See https://github.com/nodejs/nodejs.org/blob/main/scripts/release-post/index.mjs - add a exec call to run prettier in some way.

You can validate this works by re-running the 21.1.0 release from which this issue came

@bmuenzenmeyer bmuenzenmeyer added hacktoberfest This Issue is meant for Hacktoberfest 2023 good first issue Issues for newcomers help wanted labels Oct 24, 2023
@bmuenzenmeyer bmuenzenmeyer changed the title Run Prettier as part of the script that generates them Run Prettier as part of the blog post script Oct 24, 2023
@ovflowd
Copy link
Member

ovflowd commented Oct 24, 2023

I feel that this is a mismanagement of expectations: #6040 (comment)

As if they simply run npm install that would automatically setup their Git Hooks. So I assume they just didn't do that.

@targos have you at least run npm install and npm run serve to test locally that the blog post was created and rendered as expected?

@targos
Copy link
Member

targos commented Oct 24, 2023

I did run npm install. Not npm run serve. I respectfully ask that we are not expected to do that. The release process is already complicated enough.

@ovflowd
Copy link
Member

ovflowd commented Oct 24, 2023

Not npm run serve. I respectfully ask that we are not expected to do that.

You're not expected. Just saying that you can run that command to test/view the blog post locally :)

I did run npm install.

That's odd, because Husky should be adding a precommit hook to prettify files. @bmuenzenmeyer can you check into that / see if there's a ignore maybe?

@targos
Copy link
Member

targos commented Oct 24, 2023

Note that Git Hooks and npm install scripts are disabled globally on my computer for security reasons.

@targos
Copy link
Member

targos commented Oct 24, 2023

You're not expected. Just saying that you can run that command to test/view the blog post locally :)

I think in this case the rendered post wouldn't look different. Prettier only asked to remove unnecessary escapes.

@ovflowd
Copy link
Member

ovflowd commented Oct 24, 2023

You're not expected. Just saying that you can run that command to test/view the blog post locally :)

I think in this case the rendered post wouldn't look different. Prettier only asked to remove unnecessary escapes.

Youre absolutely right. Sorry my prettier comment was not related to running locally to preview the post.

Just wanted to say that previewing a new blog post to verify it looks as expected is nice. But I suppose Vercel branch deployments already do that for you, so disregard that!

@ovflowd
Copy link
Member

ovflowd commented Oct 24, 2023

Note that Git Hooks and npm install scripts are disabled globally on my computer for security reasons.

Oh, that makes sense. Right, then @bmuenzenmeyer might make sense to invoke prettier/eslint CLI directly from the blog script. And then write the resulting content to the file.

@targos
Copy link
Member

targos commented Oct 24, 2023

I'm also fine with a documentation update in https://github.com/nodejs/node/blob/main/doc/contributing/releases.md#17-create-a-blog-post that asks to run whatever is needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Issues for newcomers hacktoberfest This Issue is meant for Hacktoberfest 2023 help wanted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants