-
Notifications
You must be signed in to change notification settings - Fork 2.6k
feat(misc): enhance IDE integration with Nx Console auto-installation and improved logging #31462
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
View your CI Pipeline Execution ↗ for commit 236ebd6.
☁️ Nx Cloud last updated this comment at |
packages/nx/src/native/config/dir.rs
Outdated
match env::var("XDG_CONFIG_HOME") { | ||
Ok(xdg_home) => PathBuf::from(xdg_home) | ||
.join(".config") | ||
.join(NX_CONFIG_DIR_NAME), | ||
Err(_) => home_dir.as_ref().join(".config").join(NX_CONFIG_DIR_NAME), |
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 XDG_CONFIG_HOME
environment variable already points to the config directory (typically ~/.config
), so appending .config
creates an incorrect path. The code should be modified to:
Ok(xdg_home) => PathBuf::from(xdg_home).join(NX_CONFIG_DIR_NAME),
This ensures the configuration is stored in the standard location according to the XDG Base Directory specification.
match env::var("XDG_CONFIG_HOME") { | |
Ok(xdg_home) => PathBuf::from(xdg_home) | |
.join(".config") | |
.join(NX_CONFIG_DIR_NAME), | |
Err(_) => home_dir.as_ref().join(".config").join(NX_CONFIG_DIR_NAME), | |
match env::var("XDG_CONFIG_HOME") { | |
Ok(xdg_home) => PathBuf::from(xdg_home) | |
.join(NX_CONFIG_DIR_NAME), | |
Err(_) => home_dir.as_ref().join(".config").join(NX_CONFIG_DIR_NAME), |
Spotted by Diamond
Is this helpful? React 👍 or 👎 to let us know.
cbf7d55
to
45a7fee
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.
Pull Request Overview
This PR enhances IDE integration by automating Nx Console installation, improving native logging formatting/levels, and updating related imports and documentation.
- Add prompt and preference persistence for automatic Nx Console installation
- Refactor TUI imports to use new
ide
module structure - Enhance native logger formatting with distinct INFO/ERROR prefixes and update console bindings
Reviewed Changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
packages/nx/src/utils/nx-console-prompt.ts | Add user prompt and preferences to auto-install Nx Console |
packages/nx/src/native/tui/mod.rs | Remove deprecated nx_console module import |
packages/nx/src/native/tui/lifecycle.rs | Update import path for NxConsoleMessageConnection |
packages/nx/src/native/tui/components/help_popup.rs | Clean up imports and replace nx_console::get_current_editor with get_current_editor |
packages/nx/src/native/tui/app.rs | Adjust imports for Action and NxConsoleMessageConnection |
packages/nx/src/native/native-bindings.js | Export new bindings: NxConsolePreferences , canInstallNxConsole , installNxConsole |
packages/nx/src/native/mod.rs | Add ide and config modules |
packages/nx/src/native/logger/mod.rs | Add distinct INFO/ERROR formatting, update default log level |
packages/nx/src/native/logger/console.rs | Change log_info to use debug! (should remain info! ) |
packages/nx/src/native/ide/preferences.rs | Introduce NxConsolePreferences for storing user prefs |
packages/nx/src/native/ide/nx_console/messaging.rs | Adjust import path for IpcTransport |
packages/nx/src/native/ide/nx_console.rs | New module re-exporting editor detection |
packages/nx/src/native/ide/mod.rs | Register detection , install , nx_console , preferences modules |
packages/nx/src/native/ide/install.rs | Implement can_install_nx_console and install_nx_console |
packages/nx/src/native/ide/detection.rs | Make detect_editor public for external use |
packages/nx/src/native/config/mod.rs | Add dir submodule for config directory logic |
packages/nx/src/native/config/dir.rs | Define get_user_config_dir utility |
packages/nx/src/native/CLAUDE.md | Add native development guide |
CLAUDE.md | Update top-level guidance numbering |
Comments suppressed due to low confidence (1)
packages/nx/src/native/tui/components/help_popup.rs:169
- [nitpick] The UI text references "Copilot" instead of "Nx Console", which could confuse users. Update the message to reference the correct extension name.
"Send terminal output to Copilot so that it can assist with any issues"
use tracing::{debug, error}; | ||
|
||
#[napi] | ||
pub fn log_info(message: String) { | ||
enable_logger(); | ||
info!(message); | ||
debug!(message); |
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 log_info
function should emit an info-level log (info!
) rather than a debug-level log, to match its intended purpose and naming.
Copilot uses AI. Check for mistakes.
adacaff
to
b592e8b
Compare
…tion - Move nx_console detection from tui/nx_console to ide module for better organization - Add comprehensive CLAUDE.md guide for Nx native development workflow - Integrate IDE extension installation into nx.ts startup process - Update project CLAUDE.md with nx_project mcp tool guidance - Export ensureNxConsoleInstalled function for IDE integration This improves the developer experience by providing clear documentation and automated IDE setup while reorganizing code for better modularity.
- Change log_info to use debug level instead of info for console.rs - Add proper TypeScript-style formatting for INFO and ERROR levels - Enable info-level logging by default instead of OFF - Update documentation for NX_NATIVE_LOGGING environment variable - Improve log output formatting to match existing TypeScript logger style
…on with async CLI handling - Add NxConsolePreferences struct for persistent user configuration - Implement async prompting system for Nx Console installation preference - Update CLI entry points to handle async initialization properly - Add configuration directory management for cross-platform support - Refactor IDE installation logic to check existing extensions before installing - Replace automatic installation with user-controlled preference system
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, IDE integration setup requires manual configuration and lacks streamlined auto-installation capabilities for Nx Console. The logging system also needs improvement for better developer experience.
Expected Behavior
With these changes, the IDE integration provides:
Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is merged. -->
This PR implements IDE integration improvements including Nx Console auto-installation and enhanced logging capabilities.