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

nx release & Single Version Policy monorepos #23258

Closed
1 task done
gregorholzmann opened this issue May 8, 2024 · 1 comment
Closed
1 task done

nx release & Single Version Policy monorepos #23258

gregorholzmann opened this issue May 8, 2024 · 1 comment

Comments

@gregorholzmann
Copy link

gregorholzmann commented May 8, 2024

Documentation issue

  • Documentation improvement

Is there a specific documentation page you are reporting?

https://nx.dev/recipes/nx-release/get-started-with-nx-release

Additional context or description

Though the "getting started" page of the nx release docs mention configuring projects for release, there is no mention of how (if at all) the utility is supposed to interact with repos using a Single Version Policy.

If there is a way to configure nx release to auto-increment the version of the package.json in the workspace root, that would be great information to have -- if not, it would be useful to have that lack of functionality and/or intent called out in the docs, to prevent users using this pattern from trying to implement a solution that will not work for their use cases.

@JamesHenry
Copy link
Collaborator

JamesHenry commented May 21, 2024

Hi @gregorholzmann, I would recommend not having a version in your root package.json and simply using "private": true. This makes it crystal clear that there is no publishable/consumable project at the root of the workspace. Having a version at the root would at best imply that your packages are all versioned together, but it would never be a source of truth for it, so it's not an approach that we will document or build into nx release natively

With that said, if you want to implement this for yourself it would be very straightforward. One of the powerful things about nx release is its first-class programmatic API.

You would simply use it as shown here: https://nx.dev/features/manage-releases#using-the-programmatic-api-for-nx-release and take the returned workspaceVersion property from the versioning step and write it to the root package.json as part of your script.

Hope that helps!

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

No branches or pull requests

3 participants