FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Sort packages alphabetically in changeset add prompt by Filipoliko · Pull Request #1122 · changesets/changesets · GitHub

Sort packages alphabetically in changeset add prompt - #1122

Closed
Filipoliko wants to merge 2 commits into
changesets:mainfrom
Filipoliko:main
Closed

Sort packages alphabetically in changeset add prompt#1122
Filipoliko wants to merge 2 commits into
changesets:mainfrom
Filipoliko:main

Conversation

Copy link
Copy Markdown

Resolves #1077

changeset-bot Bot commented Mar 28, 2023
edited
Loading

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 14ce52f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@changesets/cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

codesandbox-ci Bot commented Mar 28, 2023
edited
Loading

Copy link
Copy Markdown

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit ae3fd61:

Sandbox Source
Vanilla Configuration

{
name: "changed packages",
choices: changedPackages,
choices: changedPackages.sort(),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

this should sort using the .name property of each package

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

The changedPackages is actually already an array of strings (names).

);
});

it("should sort packages alphabetically in the prompt", async () => {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

That likely won't test this behavior. I would probably create such layout to test it:

packages-1/pkg-b/package.json
packages-2/pkg-a/package.json

The point here is that pkg-a is contained in a directory that comes after the directory in which pkg-b is contained.

Filipoliko Mar 28, 2023
edited
Loading

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

You are right, thanks to a different mistake (the packages location did not match packages names), it seemed like it was doing the right thing, but not really.

I created 2 testing scenarios, one for changedPackages and one for unchangedPackages and named the directories packages-1/packages-2 as suggested. It seems like the unchangedPackages are already sorting alphabetically, so the new .sort call does not really change anything, but I feel like it is still a good reassurance, that it will still work even if something in the background changes.

I tried removing the .sort call and at least for changedPackages use-case the tests failed, so it seems to be working.

Filipoliko force-pushed the main branch 2 times, most recently from 8da4a2b to f6f089a Compare March 28, 2023 14:06

Copy link
Copy Markdown
Author

@Andarist Thanks for the quick review, I updated the test, so hopefully it will work as expected. Feel free to check it when you have some more time :)

bluwy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I wonder if we should cut this as a minor since it could affect existing users' muscle memory, and is sort of a feature-ish.

codecov Bot commented Nov 18, 2025
edited
Loading

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.05%. Comparing base (e520bf5) to head (14ce52f).
⚠️ Report is 50 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1122   +/-   ##
=======================================
  Coverage   81.05%   81.05%           
=======================================
  Files          54       54           
  Lines        2265     2265           
  Branches      684      683    -1     
=======================================
  Hits         1836     1836           
  Misses        424      424           
  Partials        5        5           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown

Hi! Is there any progress on this? We have s monorepo with ~ 50 packages and it is hard to look for a changed package everytime. This feature will be very handy

bluwy commented May 4, 2026

Copy link
Copy Markdown
Member

I think it might be better to merge this in next altogether. In #1879 it'll already sort though

Andarist commented May 4, 2026

Copy link
Copy Markdown
Member

Yeah, @Filipoliko - I'm sorry this got stale and didn't get in. As mentioned, #1879 revamps this area quite a bit and kinda includes this change anyway. So it's better for us to close this PR to avoid future conflicts and stuff.

Andarist closed this May 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

CLI changed packages should be sorted alphabetically

4 participants


Back | FazBrowse Home | New Git URL