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

feat: bumped glob dependency from 8 to 10 #5250

Merged
merged 6 commits into from
Nov 23, 2024

Conversation

JoshuaKGoldberg
Copy link
Member

@JoshuaKGoldberg JoshuaKGoldberg commented Nov 11, 2024

PR Checklist

Overview

Bumps the glob version range in package.json. We can't yet use glob@11, as it only supports Node.js 20 up and Mocha 11 still supports Node.js 18.

The only change to JS source code is a manual 'en' alphabetical sort of glob.sync results. This is to preserve the legacy behavior of what order test files are found and run: https://github.com/mochajs/mocha/pull/5250/files#r1840469747.

I tested this on the https://github.com/eslint/eslint and https://github.com/Microsoft/TypeScript projects and all tests reported passing.

@JoshuaKGoldberg JoshuaKGoldberg added this to the v11.0.0 milestone Nov 11, 2024
@JoshuaKGoldberg JoshuaKGoldberg marked this pull request as draft November 11, 2024 17:04
// glob@8 and earlier sorted results in en; glob@9 depends on OS sorting.
// This preserves the older glob behavior.
// https://github.com/mochajs/mocha/pull/5250
.sort((a, b) => a.localeCompare(b, 'en'))
Copy link
Member Author

@JoshuaKGoldberg JoshuaKGoldberg Nov 13, 2024

Choose a reason for hiding this comment

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

This was "fun" to debug. The order of tests is different with the newer version of glob.

From npx mocha "test/integration/fixtures/options/parallel/test-*":

  • main: a, b, c, d
  • glob-10: d, c, b, a

This is isaacs/node-glob#576: that it's determined by OS latency. glob@8 used to sort (https://github.com/isaacs/node-glob/blob/v8.1.0/common.js#L20).

@JoshuaKGoldberg JoshuaKGoldberg marked this pull request as ready for review November 13, 2024 14:49
@JoshuaKGoldberg JoshuaKGoldberg requested a review from a team November 13, 2024 15:20
Copy link
Member

@Uzlopak Uzlopak left a comment

Choose a reason for hiding this comment

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

LGTM

@dotnetCarpenter
Copy link

dotnetCarpenter commented Nov 20, 2024

Seems like there are still ways to go for upgrading glob:

$ npm ls glob
[email protected]
├─┬ @11ty/[email protected]
│ ├─┬ [email protected]
│ │ └─┬ [email protected]
│ │   └── [email protected]
│ └─┬ [email protected]
│   └─┬ [email protected]
│     └── [email protected]
├─┬ @rollup/[email protected]
│ └── [email protected]
├─┬ @rollup/[email protected]
│ └─┬ [email protected]
│   └── [email protected]
├── [email protected]
├─┬ [email protected]
│ └─┬ [email protected]
│   └─┬ [email protected]
│     └─┬ [email protected]
│       └─┬ @npmcli/[email protected]
│         └── [email protected] deduped
├─┬ [email protected]
│ └─┬ [email protected] overridden
│   ├─┬ @wdio/[email protected]
│   │ └── [email protected]
│   └─┬ [email protected]
│     └─┬ [email protected]
│       └── [email protected]
├─┬ [email protected]
│ └── [email protected]
├─┬ [email protected]
│ └── [email protected]
├─┬ [email protected]
│ ├── [email protected]
│ └─┬ [email protected]
│   └── [email protected]
└─┬ [email protected]
  └── [email protected]

I tried to test this branch with https://github.com/Tyriar/vscode-sort-lines, but unfortunately @vscode/test-electron (2.4.1) doesn't work with npm link. So I didn't get far.

@JoshuaKGoldberg
Copy link
Member Author

Seems like there are still ways to go for upgrading glob:

Yeah, the internal dependencies for this repo have a ways to go 🥲. A lot of them come from the very old docs website setup we have. It's going to be a bit more till we internally are clean & up to date. Tracked in #5207.

@JoshuaKGoldberg JoshuaKGoldberg merged commit 43c3157 into mochajs:main Nov 23, 2024
105 checks passed
@JoshuaKGoldberg JoshuaKGoldberg deleted the glob-10 branch November 23, 2024 16:32
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.

🚀 Feature: Update glob from 8.1.0 which is no longer supported
3 participants