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

fix(extract): also detects node:test as a core module #822

Merged
merged 1 commit into from
Jul 15, 2023

Conversation

sverweij
Copy link
Owner

Description

  • ensures node:test is detected as a core module

Motivation and Context

Currently node:test dependencies are classified as unable to resolve. This is because node:test or test are not listed as builtinModules in node's module module. From the discussion on nodejs/node#42785 I understand this is never going to happen either. Alternative is to use module's isBuiltin() function, but that is not available in the lowest version of nodejs dependency-cruiser supports (16.14), so we have to work around that.

Additionally the node:test module can only be required via the node: protocol (const { test} = require('test')/ import { test } from 'test' don't work). This means that with the current the way we split the protocol from the module name, using isBuiltin won't work either...

How Has This Been Tested?

  • green ci
  • additional automated tests

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 marked this pull request as ready for review July 15, 2023 08:15
@sverweij sverweij merged commit 231a399 into main Jul 15, 2023
5 checks passed
@sverweij sverweij deleted the feature/also-detect-node-test-as-core-module branch July 15, 2023 08:15
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.

1 participant