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(resolve)!: makes alias type derivation more correct and precise BREAKING #867

Merged
merged 20 commits into from
Dec 9, 2023

Conversation

sverweij
Copy link
Owner

@sverweij sverweij commented Nov 15, 2023

Description

  • takes 'workspaces' field into account when merging package manifests
  • same for the 'imports' field
  • when determining what kind of an alias a thing is use the parsed tsconfig to determine it
  • adds alias-tsconfig-base-url and alias-tsconfig-paths dependency types to distinguish between the two types of aliases one can use within tsconfigs. B.t.w. for both dependency-cruiser will keep emitting the alias and alias-tsconfig dependency types as well - both for convenience and backwards compatibility.

This PR is theoretically 🚨 BREAKING as rules previously defined on aliases, that didn't fire now will because they're now detected correctly.

Motivation and Context

Now we're doing explicit things with workspaces and imports fields we need to have them in merged package manifests as well, so in monorepos we still take them into account. The rewrite of the tsconfig alias detection logic is necessary to ensure we detect tsconfig aliases correctly and more precisely.

Also see #863.

How Has This Been Tested?

  • green ci
  • additional unit tests
  • additional integration 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 bugfix/also-merge-workspaces branch 3 times, most recently from eaec411 to 89e8e8b Compare November 24, 2023 09:30
@sverweij sverweij force-pushed the bugfix/also-merge-workspaces branch 4 times, most recently from b54b02d to 5a6dd8a Compare December 1, 2023 12:28
@sverweij sverweij changed the title fix(resolve): takes 'workspaces' field into account when merging package manifests this is an INCORRECT PR TITLE takes 'workspaces' field into account when merging package manifests Dec 1, 2023
@sverweij sverweij changed the title this is an INCORRECT PR TITLE takes 'workspaces' field into account when merging package manifests fix(resolve): takes 'workspaces' field into account when merging package manifests Dec 1, 2023
@sverweij sverweij changed the title fix(resolve): takes 'workspaces' field into account when merging package manifests fix(resolve): makes alias type derivation more correct Dec 3, 2023
@sverweij sverweij changed the title fix(resolve): makes alias type derivation more correct fix(resolve): makes alias type derivation more correct and precise Dec 3, 2023
@sverweij sverweij force-pushed the bugfix/also-merge-workspaces branch 2 times, most recently from 6452d6d to 54c39f6 Compare December 6, 2023 13:35
Copy link

codeclimate bot commented Dec 9, 2023

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

View more on Code Climate.

@sverweij sverweij changed the title fix(resolve): makes alias type derivation more correct and precise fix(resolve)~: makes alias type derivation more correct and precise BREAKING Dec 9, 2023
@sverweij sverweij changed the title fix(resolve)~: makes alias type derivation more correct and precise BREAKING fix(resolve)!: makes alias type derivation more correct and precise BREAKING Dec 9, 2023
@sverweij sverweij merged commit 03bdda2 into main Dec 9, 2023
13 of 14 checks passed
@sverweij sverweij deleted the bugfix/also-merge-workspaces branch December 9, 2023 10:43
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