-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Closed
Closed
Copy link
Labels
Area: Build SystemResolution: Soft CloseSoft closing inactive issues over a certain periodSoft closing inactive issues over a certain periodStatus: In PR
Description
Describe the issue:
Because of TS AST bug microsoft/TypeScript#47597, when NX builds dependency graph based on source files it runs into following issue nrwl/nx#8938.
This was exposed and fix in #21751 ( PR includes a naive check only for 1 particular project, thus should be generalized ).
To mitigate that incorrect graph resolution we need to create a check that will fail pipeline and notify user that his code needs to be updated, to not create phantom/incorrect dependency resolution in dep-graph.
Actual behavior:
If our js module contains following code/pattern
- there is a string literal interpolation
- there is a static import of monorepo package within a string
// @filename packages/proj-a/index.js
const npmScope = 'myorg';
// 🚨 this is the root cause - template strings interpolation
console.log(`@${npmScope}`);
// 🚨 now your project depends on proj-b ( which is not true )
console.log(`import {foo} from '@my-org/proj-b'`)Pipeline will pass
Expected behavior:
Pipeline checks for this patterns in affected files and fails if present
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Area: Build SystemResolution: Soft CloseSoft closing inactive issues over a certain periodSoft closing inactive issues over a certain periodStatus: In PR