-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
feat(core): load native files from tmp location instead of node_modules #22648
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
☁️ Nx Cloud ReportCI is running/has finished running commands for commit ccff88e. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution ✅ Successfully ran 6 targets
Sent with 💌 from NxCloud. |
6809bb7
to
6a20bcc
Compare
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.
The js file that napi produces is set in packages/nx/project.json
. If you update that, then you can keep the index file the correct import path.
No more lint rule
No more merge conflicts
No more weird imports
a52ad76
to
480c972
Compare
6991b52
to
b9d8396
Compare
280837b
to
dedb502
Compare
dedb502
to
97efb73
Compare
97efb73
to
1b60ef5
Compare
const nxPackages = new Set([ | ||
'@nx/nx-android-arm64', | ||
'@nx/nx-android-arm-eabi', | ||
'@nx/nx-win32-x64-msvc', | ||
'@nx/nx-win32-ia32-msvc', | ||
'@nx/nx-win32-arm64-msvc', | ||
'@nx/nx-darwin-universal', | ||
'@nx/nx-darwin-x64', | ||
'@nx/nx-darwin-arm64', | ||
'@nx/nx-freebsd-x64', | ||
'@nx/nx-linux-x64-musl', | ||
'@nx/nx-linux-x64-gnu', | ||
'@nx/nx-linux-arm64-musl', | ||
'@nx/nx-linux-arm64-gnu', | ||
'@nx/nx-linux-arm-gnueabihf', | ||
]); | ||
|
||
let nativeBinding = null | ||
let localFileExisted = false | ||
let loadError = null | ||
const localNodeFiles = [ | ||
'nx.android-arm64.node', | ||
'nx.android-arm-eabi.node', | ||
'nx.win32-x64-msvc.node', | ||
'nx.win32-ia32-msvc.node', | ||
'nx.win32-arm64-msvc.node', | ||
'nx.darwin-universal.node', | ||
'nx.darwin-x64.node', | ||
'nx.darwin-arm64.node', | ||
'nx.freebsd-x64.node', | ||
'nx.linux-x64-musl.node', | ||
'nx.linux-x64-gnu.node', | ||
'nx.linux-arm64-musl.node', | ||
'nx.linux-arm64-gnu.node', | ||
'nx.linux-arm-gnueabihf.node', | ||
]; |
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.
Followup: Can we make these lists by reading package.json
?
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
Currently native code is loaded straight from the package location in
node_modules
(for example anx.darwin-arm64.node
file).This is causing issues - especially on windows - when trying to delete
node_modules
or reinstalling packages while the file is still held in memory. This often surfaces in Nx Console where the daemon is started in the background.Expected Behavior
Users should be able to delete
node_modules
at will without having to worry about whether the daemon is still running & locking files in the background.Fixes nrwl/nx-console#1863