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(extract): adds basic support for ESM urls (a.o. the node: protocol) #457

Merged
merged 1 commit into from
Apr 25, 2021

Conversation

sverweij
Copy link
Owner

Description

  • Adds recognition of protocol and mime type in module references so things like import * as fs from 'node:fs' and import lalala from 'file:application/json,holadijee.json' get recognised.
  • Adds them to the cruise output model for later use

The new protocol and mimeType attributes aren't used anywhere yet - this might follow in next PR's

Motivation and Context

TIL: you can specify a protocol (and mime type) with ES modules references. As @sindresorhus is pushing for its use (see this issue in the nodejs repo and the new prefer-node-protocol rule in eslint-plugin-unicorn) it'll likely become more commonplace.

How Has This Been Tested?

  • automated non-regression tests, green ci
  • additional automated unit tests
  • manual tests against dependency-cruiser's 'tools' folder

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/add-protocol-support branch from 5f70596 to 33adc53 Compare April 24, 2021 19:42
@sverweij sverweij force-pushed the feature/add-protocol-support branch from 33adc53 to 38e3cfd Compare April 25, 2021 13:54
@sverweij sverweij merged commit 1d1f9b4 into develop Apr 25, 2021
@sverweij sverweij deleted the feature/add-protocol-support branch April 25, 2021 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: released
Development

Successfully merging this pull request may close these issues.

1 participant