Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions crates/aube-codes/src/warnings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ pub const WARN_AUBE_LOCKFILE_MALFORMED_PEER_SUFFIX: &str =
"WARN_AUBE_LOCKFILE_MALFORMED_PEER_SUFFIX";
pub const WARN_AUBE_GLOBAL_OUTDATED_NO_LOCKFILE: &str = "WARN_AUBE_GLOBAL_OUTDATED_NO_LOCKFILE";

// ── global installs ─────────────────────────────────────────────────
pub const WARN_AUBE_GLOBAL_DIR_LEGACY_LOCATION: &str = "WARN_AUBE_GLOBAL_DIR_LEGACY_LOCATION";
pub const WARN_AUBE_GLOBAL_BIN_DIR_NOT_ON_PATH: &str = "WARN_AUBE_GLOBAL_BIN_DIR_NOT_ON_PATH";

// ── progress UI ─────────────────────────────────────────────────────
pub const WARN_AUBE_PROGRESS_OVERFLOW: &str = "WARN_AUBE_PROGRESS_OVERFLOW";

Expand Down Expand Up @@ -136,6 +140,7 @@ pub mod category {
pub const WORKSPACE_RECURSION: &str = "Workspace recursion";
pub const SUPPLY_CHAIN: &str = "Supply chain (add-time)";
pub const NODE_RUNTIME: &str = "Node runtime";
pub const GLOBAL_INSTALLS: &str = "Global installs";
}

/// Registry of every warning code with its category and description.
Expand Down Expand Up @@ -537,6 +542,19 @@ pub const ALL: &[CodeMeta] = &[
description: "`aube outdated -g` found a global install without a lockfile and skipped that install.",
exit_code: None,
},
// Global installs
CodeMeta {
name: WARN_AUBE_GLOBAL_DIR_LEGACY_LOCATION,
category: category::GLOBAL_INSTALLS,
description: "Global packages were found under the pnpm-named directory aube used before it owned its own global layout (`$PNPM_HOME`, `$XDG_DATA_HOME/pnpm`, `~/Library/pnpm`, `%LOCALAPPDATA%\\pnpm`), while the current global directory holds none. Those installs are no longer visible to `aube list -g` / `remove -g`; reinstall them with `aube add -g`, or point `AUBE_HOME` at the old directory.",
exit_code: None,
},
CodeMeta {
name: WARN_AUBE_GLOBAL_BIN_DIR_NOT_ON_PATH,
category: category::GLOBAL_INSTALLS,
description: "`aube add -g` linked a bin into a directory that is not on `$PATH`, so the command it installed won't be found. Add the directory to `PATH`, or point `globalBinDir` / `AUBE_HOME` at one that already is.",
exit_code: None,
Comment thread
greptile-apps[bot] marked this conversation as resolved.
},
// Progress UI
CodeMeta {
name: WARN_AUBE_PROGRESS_OVERFLOW,
Expand Down
21 changes: 19 additions & 2 deletions crates/aube-settings/settings.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2617,7 +2617,16 @@ npmShared = true
description = "Directory where globally installed packages live."
type = "path"
default = "platform-specific"
docs = "Overrides the directory where globally installed packages live. Falls back to `AUBE_HOME` / `PNPM_HOME` / platform default."
docs = """
Overrides the directory holding the physical per-package install dirs
for `aube add -g`. Falls back to `AUBE_HOME` (when set, installs go in
a `global-aube/` subdir of it), otherwise `<dataDir>/global-aube` —
`$XDG_DATA_HOME/aube/global-aube`, `~/.local/share/aube/global-aube`,
or `%LOCALAPPDATA%\\aube\\global-aube` on Windows.

`PNPM_HOME` is not consulted: aube keeps its global layout under its
own data root rather than installing into pnpm's directories.
"""
sources.cli = []
sources.env = ["npm_config_global_dir", "NPM_CONFIG_GLOBAL_DIR", "AUBE_GLOBAL_DIR"]
sources.npmrc = ["globalDir"]
Expand All @@ -2627,7 +2636,15 @@ examples = []
description = "Directory where global binaries are symlinked."
type = "path"
default = "platform-specific"
docs = "Overrides the directory where global binaries are symlinked. Independent of `globalDir`; falls back to `AUBE_HOME` / `PNPM_HOME` / platform default."
docs = """
Overrides the directory global binaries are symlinked into — the one
you put on `$PATH`. Independent of `globalDir`; falls back to
`AUBE_HOME`, otherwise `<dataDir>/bin` (`$XDG_DATA_HOME/aube/bin`,
`~/.local/share/aube/bin`, or `%LOCALAPPDATA%\\aube\\bin` on Windows).

`PNPM_HOME` is not consulted: aube keeps its global layout under its
own data root rather than installing into pnpm's directories.
"""
sources.cli = []
sources.env = ["npm_config_global_bin_dir", "NPM_CONFIG_GLOBAL_BIN_DIR", "AUBE_GLOBAL_BIN_DIR"]
sources.npmrc = ["globalBinDir"]
Expand Down
4 changes: 4 additions & 0 deletions crates/aube/src/commands/add/global.rs
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,10 @@ async fn run_global_inner(
pluralizer::pluralize("bin", linked.len() as isize, true),
layout.bin_dir.display()
);
// Linking a bin into a directory that isn't on `$PATH` produces a
// successful install whose command is not found — the symptom the
// user reports is "aube add -g did nothing". Say so here instead.
global::warn_if_bin_dir_not_on_path(&layout.bin_dir);
}

Ok(())
Expand Down
Loading
Loading