Allow using system node (#18172)

Release Notes:

- (Potentially breaking change) Zed will now use the node installed on
your $PATH (if it is more recent than v18) instead of downloading its
own. You can disable the new behavior with `{"node":
{"disable_path_lookup": true}}` in your settings. We do not yet use
system/project-local node_modules.

---------

Co-authored-by: Mikayla <mikayla@zed.dev>
This commit is contained in:
Conrad Irwin 2024-09-23 15:28:04 -06:00 committed by GitHub
parent e4080ef565
commit 3ba071b993
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
34 changed files with 614 additions and 391 deletions

View file

@ -34,6 +34,10 @@ pub struct ProjectSettings {
#[serde(default)]
pub git: GitSettings,
/// Configuration for Node-related features
#[serde(default)]
pub node: NodeBinarySettings,
/// Configuration for how direnv configuration should be loaded
#[serde(default)]
pub load_direnv: DirenvSettings,
@ -43,6 +47,17 @@ pub struct ProjectSettings {
pub session: SessionSettings,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize, JsonSchema)]
pub struct NodeBinarySettings {
/// The path to the node binary
pub path: Option<String>,
/// The path to the npm binary Zed should use (defaults to .path/../npm)
pub npm_path: Option<String>,
/// If disabled, zed will download its own copy of node.
#[serde(default)]
pub disable_path_lookup: Option<bool>,
}
#[derive(Clone, Debug, Default, Serialize, Deserialize, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum DirenvSettings {