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

refactor: replaces 'glob' with 'picomatch' #841

Merged
merged 14 commits into from
Sep 23, 2023

Conversation

sverweij
Copy link
Owner

@sverweij sverweij commented Sep 22, 2023

Description

  • replaces glob with picomatch

This PR makes use of the fact that dependency-cruiser just dropped support for node 16 and 19, using nodejs >=18.17 feature - readdirSync's recursive option.

Motivation and Context

See #839; reduces number of external dependencies, which reduces both security risks, maintenance effort and install size.

Not the goal of this exercise, but it also reduces the start-up time and the execution speed of the gatherInitialSources step:

test glob picomatch
npm test -f "[I] extract/gatherInitialSources" as measured by mocha 70ms 43ms
gatherInitialSources step in node ./bin/dependency-cruise.mjs --no-cache -Tnull 'src/**' ('real' time) 39ms 24ms
gatherInitialSources step in node ./bin/dependency-cruise.mjs --no-cache -Tnull src ('real' time) 14ms 8ms
nodejs starting step ('loading external modules') in node ./bin/dependency-cruise.mjs --no-cache -Tnull 'src/**' ('real' time) 340ms 326ms

all averages over ~5 runs, on a quiet old mac (2,6 GHz Quad-Core Intel Core i7)

How Has This Been Tested?

  • green ci

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • Documentation only change
  • Refactor (non-breaking change which fixes an issue without changing functionality)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • 📖

    • My change doesn't require a documentation update, or ...
    • it does and I have updated it
  • ⚖️

    • The contribution will be subject to The MIT license, and I'm OK with that.
    • The contribution is my own original work.
    • I am ok with the stuff in CONTRIBUTING.md.

@sverweij sverweij force-pushed the refactor/replaces-glob-with-picomatch branch from 9f945f9 to 8031c8d Compare September 22, 2023 20:23
@socket-security
Copy link

socket-security bot commented Sep 23, 2023

Removed dependencies detected. Learn more about Socket for GitHub ↗︎

🚮 Removed packages: glob@10.3.6

@sverweij sverweij force-pushed the refactor/replaces-glob-with-picomatch branch from cfaaf80 to 8fb031a Compare September 23, 2023 18:26
@sverweij sverweij force-pushed the refactor/replaces-glob-with-picomatch branch from 8fb031a to 9d38a3c Compare September 23, 2023 18:52
@sverweij sverweij marked this pull request as ready for review September 23, 2023 18:56
@codeclimate
Copy link

codeclimate bot commented Sep 23, 2023

Code Climate has analyzed commit 9e8121e and detected 0 issues on this pull request.

View more on Code Climate.

@sverweij sverweij merged commit 5b6c48f into main Sep 23, 2023
7 checks passed
@sverweij sverweij deleted the refactor/replaces-glob-with-picomatch branch September 23, 2023 19:18
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.

None yet

1 participant