Skip to content

Conversation

@zingazzi
Copy link

Description

wget https://registry.npmjs.org/@redis/client/-/client-5.9.0.tgz
mkdir client-5.9.0
tar -xzvf client-5.9.0.tgz -C client-5.9.0
grep "version" client-5.9.0/package.json # "version": "5.9.0",

but inside the dist/

grep "version" client-5.9.0/dist/package.json # "version": "5.9.0-beta

The release workflow has a timing issue where:

  • The build process (npm run build) runs before the version bump
    This creates the dist/package.json with the beta version (5.9.0-beta.3)

  • Then release-it updates the source package.json to the final version (5.9.0)
    But the dist/package.json is never updated, so it still contains the beta version

The Solution:
The release workflow needs to rebuild the packages after the version bump but before publishing to npm.


Checklist

  • [ x] Does npm test pass with this change (including linting)?
  • Is the new or changed code fully tested?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?

@jit-ci
Copy link

jit-ci bot commented Oct 30, 2025

Hi, I’m Jit, a friendly security platform designed to help developers build secure applications from day zero with an MVS (Minimal viable security) mindset.

In case there are security findings, they will be communicated to you as a comment inside the PR.

Hope you’ll enjoy using Jit.

Questions? Comments? Want to learn more? Get in touch with us.

NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# Rebuild packages after version bump to ensure dist/package.json is updated

Choose a reason for hiding this comment

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

Hi :) Isn't the package then already on the NPM registry with the previous npm run releases step?

Copy link
Author

@zingazzi zingazzi Oct 30, 2025

Choose a reason for hiding this comment

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

You are absoluty right! Sorry my fault. I think another solution to fix this error can be add an Hook in release-it.json.

Something like this

"hooks": {
    "before:release": "npm run build"
  }

What do you think about this solution?

Choose a reason for hiding this comment

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

I'm not very familiar with these hooks but it sounds reasonable to me.

Copy link
Author

Choose a reason for hiding this comment

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

I've update the hook. Feel free to merge it if you consider it a valid solution.
Thank you for your patience.

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