-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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(devkit): make devkit backwards compatible back to nx 14.1 #14854
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 37994ea. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this branch ✅ Successfully ran 1 targetSent with 💌 from NxCloud. |
b219c8e
to
7b4842c
Compare
7b4842c
to
8511be6
Compare
3b5ffe9
to
74b2ef9
Compare
74b2ef9
to
0b56a32
Compare
0b56a32
to
781531a
Compare
781531a
to
6d2b75e
Compare
6d2b75e
to
ea442c2
Compare
ea442c2
to
ffe1e10
Compare
dependencies: { '@angular/core': '~13.2.0' }, | ||
})); | ||
jest.spyOn(nxFileutils, 'readJsonFile').mockImplementation((file) => { | ||
console.log('HELLO?'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be removed?
ffe1e10
to
37994ea
Compare
"patterns": [ | ||
{ | ||
"group": ["nx/**/*"], | ||
"message": "Use getNx() from packages/devkit/nx.ts OR use a type import instead.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"message": "Use getNx() from packages/devkit/nx.ts OR use a type import instead.", | |
"message": "Use requireNx() from packages/devkit/nx.ts OR use a type import instead.", |
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
Current Behavior
@nrwl/devkit is supposed to be backwards compatible back to Nx 14 but currently fails if you have something like.
This makes it harder for plugin owners to maintain backwards compatibility for older versions of Nx while keeping up with the latest
@nrwl/devkit
Expected Behavior
The following should always work.
There's a
nx/src/devkit-exports
andnx/src/devkit-testing-exports
file which exports things to devkit.In v17, @nrwl/devkit will only import from nx using path. This will make the compatibility more robust in the future.
To facilitate this, when importing nx from @nrwl/devkit, we should use
requireNx()
until v17.Related Issue(s)
Fixes #