Skip to content

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

Merged
merged 3 commits into from
Jun 6, 2025

Conversation

FrozenPandaz
Copy link
Collaborator

@FrozenPandaz FrozenPandaz commented Jun 4, 2025

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:

  • Prompt for automatic Nx Console installation with user preferences
  • Enhanced native logger with proper formatting and levels
  • Better development documentation for IDE setup
  • Updated documentation links to use the new format

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.

@FrozenPandaz FrozenPandaz requested review from a team as code owners June 4, 2025 21:33
Copy link

vercel bot commented Jun 4, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
nx-dev ✅ Ready (Inspect) Visit Preview Jun 6, 2025 4:28pm

@FrozenPandaz FrozenPandaz marked this pull request as draft June 4, 2025 21:34
@FrozenPandaz FrozenPandaz changed the title feat: enhance IDE integration with Nx Console auto-installation and improved logging feat(misc): enhance IDE integration with Nx Console auto-installation and improved logging Jun 4, 2025
Copy link
Contributor

nx-cloud bot commented Jun 4, 2025

View your CI Pipeline Execution ↗ for commit 236ebd6.

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-c... ✅ Succeeded 6m 18s View ↗
nx run-many -t check-imports check-commit check... ✅ Succeeded 21s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 2s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 7s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded 5s View ↗
nx documentation ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2025-06-06 17:14:47 UTC

Comment on lines 20 to 24
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),
Copy link
Contributor

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.

Suggested change
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.

Copy link
Contributor

@Copilot Copilot AI left a 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"

Comment on lines 2 to 7
use tracing::{debug, error};

#[napi]
pub fn log_info(message: String) {
enable_logger();
info!(message);
debug!(message);
Copy link
Preview

Copilot AI Jun 5, 2025

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.

…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
@FrozenPandaz FrozenPandaz enabled auto-merge (squash) June 6, 2025 16:04
@FrozenPandaz FrozenPandaz merged commit 77ff63f into master Jun 6, 2025
7 checks passed
@FrozenPandaz FrozenPandaz deleted the setup-ide branch June 6, 2025 17:15
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 12, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy