Skip to content

Run Prettier as part of the blog post script #6041

Closed

Description

@bmuenzenmeyer
          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

Activity

  1. changed the title [-]Run Prettier as part of the script that generates them[/-] [+]Run Prettier as part of the blog post script[/+] on Oct 24, 2023
  2. ovflowd commented on Oct 24, 2023

    @ovflowd
    Member

    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?

  3. targos commented on Oct 24, 2023

    @targos
    Member

    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.

  4. ovflowd commented on Oct 24, 2023

    @ovflowd
    Member

    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?

  5. targos commented on Oct 24, 2023

    @targos
    Member

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

  6. targos commented on Oct 24, 2023

    @targos
    Member

    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.

  7. ovflowd commented on Oct 24, 2023

    @ovflowd
    Member

    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!

  8. ovflowd commented on Oct 24, 2023

    @ovflowd
    Member

    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.

  9. targos commented on Oct 24, 2023

    @targos
    Member

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions