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

[Feature] support for nightly versioning #6583

Closed
2 tasks done
snowystinger opened this issue Oct 29, 2024 · 0 comments · Fixed by #6629
Closed
2 tasks done

[Feature] support for nightly versioning #6583

snowystinger opened this issue Oct 29, 2024 · 0 comments · Fixed by #6629
Labels
enhancement New feature or request

Comments

@snowystinger
Copy link
Contributor

snowystinger commented Oct 29, 2024

  • I'd be willing to implement this feature (contributing guide)
  • This feature is important to have in this repository; a contrib plugin wouldn't do

Describe the user story

As a developer, I often want to do publish all of my packages daily, but I need to coordinate (pin) all the versions of my packages.

Describe the solution you'd like

I'd like to be able to use yarn version to apply my changes, which I've set up like so

    "version:nightly": "yarn workspaces foreach --all --no-private -t version -d 3.0.0-nightly-$(git rev-parse --short HEAD)-$(date +'%y%m%d') && yarn version apply --all",
    "publish:nightly": "yarn workspaces foreach --all --no-private -t npm publish --tag nightly --access public",

except that in our monorepo, all of our interworkspace dependencies use range dependencies, which, when published to npm, remain and resolve incorrectly.

I'd like for yarn version apply to take a flag to remove the range dependency.

For example, one of our packages

"@react-stately/layout": "^3.0.0-nightly-fb28ab3b4-241024" actually resolves to 3.13.9

Describe the drawbacks of your solution

there shouldn't be any drawbacks

Describe alternatives you've considered

When we switch to the workspace protocol, it'd be simple enough to strip the range through sed or an equivalent.
We could also write a plugin, however, most of the logic already exists in version, so it seems silly to copy all of that for this, when it would probably be used by others. This is the same versioning scheme that other libraries use.

@snowystinger snowystinger added the enhancement New feature or request label Oct 29, 2024
arcanis added a commit that referenced this issue Mar 28, 2025
## What's the problem this PR addresses?

<!-- Describe the rationale of your PR. -->
<!-- Link all issues that it closes. (Closes/Resolves #xxxx.) -->
Closes: #6583

## How did you fix it?

<!-- A detailed description of your implementation. -->
When applying versions, I removed the range character.

## Checklist

<!--- Don't worry if you miss something, chores are automatically
tested. -->
<!--- This checklist exists to help you remember doing the chores when
you submit a PR. -->
<!--- Put an `x` in all the boxes that apply. -->
- [x] I have read the [Contributing
Guide](https://yarnpkg.com/advanced/contributing).

<!-- See
https://yarnpkg.com/advanced/contributing#preparing-your-pr-to-be-released
for more details. -->
<!-- Check with `yarn version check` and fix with `yarn version check
-i` -->
- [x] I have set the packages that need to be released for my changes to
be effective.

<!-- The "Testing chores" workflow validates that your PR follows our
guidelines. -->
<!-- If it doesn't pass, click on it to see details as to what your PR
might be missing. -->
- [x] I will check that all automated PR checks pass before the PR gets
reviewed.

---------

Co-authored-by: Maël Nison <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant