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(init): adds extensions detection to one shot configs #712

Merged
merged 1 commit into from Dec 27, 2022

Conversation

sverweij
Copy link
Owner

@sverweij sverweij commented Dec 27, 2022

Description

  • adds detection of extensions in the current project to the --init command

Currently limited to the (likely not widely used) 'one shot configs' so we can gain experience before baking it into the regular set up code.
Only used to reduce the array of extensions to pass to enhanced-resolve

Also (🏕️ camping site rule):

  • corrects dependency-cruiser's own config to also check for .mjs extensions
  • corrects user input code to be typed correctly
  • moves some utility functions from src/extract/utl to src/utl as they're now use from both src/extract and src/cli
  • adds a file that gets temporarily created during testing to .gitignore

Motivation and Context

It's typically faster to pass less extensions to enhanced resolve than everything dependency-cruiser supports - each extra extension potentially leads to one extra lookup on the file system per dependency. Also the resolver traverses the array in order, so putting the most likely extension to occur at the front will also make it find things faster.

How Has This Been Tested?

  • green ci
  • additional unit test(s)

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 feature/adds-more-environment-detection-in-init branch from e339c27 to 7aaabe4 Compare December 27, 2022 19:58
@sverweij sverweij merged commit 76508e3 into develop Dec 27, 2022
@sverweij sverweij deleted the feature/adds-more-environment-detection-in-init branch December 27, 2022 21:14
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