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

write a script to update package versions to * automatically #1346

Closed
danisharora099 opened this issue May 11, 2023 · 3 comments
Closed

write a script to update package versions to * automatically #1346

danisharora099 opened this issue May 11, 2023 · 3 comments

Comments

@danisharora099
Copy link
Collaborator

This is a feature request

Problem

In our npm workspaces monorepo, we have several packages that depend on each other, and these dependencies are specified in their respective package.json files.

Currently, when we install these packages in other packages as dependencies, they are installed with their specific version numbers, for example: "@waku/build-utils": "0.2". This forces us to manually update the version numbers whenever a package is updated.

Our requirement is to automate this process such that the version numbers are always set to * instead of the explicit version number. This would enable npm to always fetch the latest version of the packages within the monorepo. For instance, we would like @waku/build-utils to be installed like: "@waku/build-utils": "*".

This issue is causing some inefficiencies in our development process as we often have to manually update the version numbers of our packages in the package.json files.

Proposed Solutions

We could write a JS script that will recursively go through all the package.json files in our monorepo and replace the version numbers of the dependencies with * if the package belongs to our monorepo.

This script can be integrated into our build script or set up as a pre-commit hook. This will ensure that our package.json files are always up-to-date with the latest version of their dependencies within the monorepo, even before the changes are committed to the repository.

@weboko
Copy link
Collaborator

weboko commented May 16, 2023

In short: we do not need such script since release-please would do this automatically in places where version is bumped. For private packages I think it is not relevant since we do not update their versions.

Relevant comment - #1316 (comment)

@fryorcraken
Copy link
Collaborator

Regarding the discrepancy where some packages have a wildcard whereas other don't is because release-please only updates dependencies when the dependency's version is bumped.
Some packages haven't yet been release with release-please so the wildcard was not replaced for a version.

@fryorcraken
Copy link
Collaborator

Closed as discrepancy is understood but not an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

3 participants