This repository was archived by the owner on Apr 3, 2026. It is now read-only.
fix(init): skip npm install if deps already present (fixes #5, #6)#18
Open
prabhatrm23git wants to merge 246 commits intorust-ui:masterfrom
Open
fix(init): skip npm install if deps already present (fixes #5, #6)#18prabhatrm23git wants to merge 246 commits intorust-ui:masterfrom
prabhatrm23git wants to merge 246 commits intorust-ui:masterfrom
Conversation
Smooth init with app config
Smooth component addition
…with the one from `_add`.
registration of components module
- Add diff_components() to command_diff/_diff.rs (reused by both ui diff and ui add --diff) - Add view_components() to command_view/_view.rs (reused by both ui view and ui add --view) - process_diff() now delegates its inner loop to diff_components() - _add.rs --diff and --view blocks reduced to 2-line delegates with clean top-level imports
…--diff/--view flags
- Remove user_input.rs (auto-selected "Default" style but never saved anything) - Remove fetch.rs (was a thin wrapper only used by user_input) - Remove RustUIClient::fetch_styles_index / styles_index_url (only used by fetch.rs) - Remove CliError::MalformedRegistry / RegistryInvalidFormat variants (only used by above) - Remove stray println! in write_component_name_in_mod_rs_if_not_exists - Fix __FEATURES.md: --yes flag was already implemented (was incorrectly marked missing)
Replace direct slice indexing in the LCS diff algorithm with safe .get() access. Use a flat 1D table instead of 2D Vec, pre-fetch line values before comparisons, and refactor extract_hunks to use a Peekable iterator instead of index-based looping.
Switch command_diff to use the `similar` crate (Myers algorithm) instead of a custom LCS implementation. Eliminates DiffLine, DiffHunk, ComponentDiffJson, compute_diff, format_single_diff, and extract_hunks by leveraging TextDiff::grouped_ops for both human and JSON output.
- Add command_mcp module with rmcp-based stdio MCP server - Expose 5 tools: list_components, search_components, view_component, get_add_command, get_audit_checklist - Add ui mcp init --client <claude|cursor|vscode|opencode> to write editor config files (.mcp.json, .cursor/mcp.json, etc.) - Reuse existing list/search/view registry logic in tool handlers - Add schemars = "1" and rmcp = "1" dependencies
- ui add: warn and exit when a deprecated component is requested (toast → sonner) - ui init --yes / -y and --force / -f: skip confirmation prompts, force overwrite existing files - __FEATURES.md: mark mcp ✅, deprecated warnings ✅, --yes/--force ✅ - CHANGELOG: add entries under Unreleased
- ui init: back up ui_config.toml before writing using RAII FileBackup guard; restored automatically on failure, disarmed on success - ui init --reinstall: detect installed components, prompt to re-download them; --reinstall flag skips prompt; --force implies reinstall - add process_add_components(): programmatic reinstall entry point reusing full add pipeline with force=true (avoids circular deps via main.rs dispatch) - remove stray debug printlns from tree_parser, add comment to intentional ones - __FEATURES.md: mark backup/restore and reinstall as done
- slow-timeout: warn after 5s, kill after 30s - network tests (test_fetch*): 2 retries, 30s timeout
- Add `colors.rs` with `BaseColor` (7) and `AccentColor` (18) enums, all OKLCH data mirrored from /create page, and `generate_theme_vars()` - `template.rs`: replace hardcoded CSS with `build_css(base, accent)` that composes header + dynamic :root/.dark vars + footer - `_init.rs`: prompt for base color and accent color before writing tailwind.css; `--yes`/`--force` skips prompts and uses defaults - `config.rs`: add `color_theme` field (serde default = "default") for backward-compat with existing ui_config.toml files - 274/274 tests passing
- colors.rs: add #[allow(dead_code)] on from_str utility methods - _init.rs: use struct update syntax for UiConfig (field-assignment lint) - _init.rs: fix overindented doc list item - _mcp.rs: remove needless borrow &labels → labels - _mcp.rs: replace indexing_slicing names[idx] with safe .get(idx)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Right now ui init always runs npm install even if node_modules already contains every required package.
This PR adds a fast check so we skip the install entirely if nothing is missing.
Fixes #5 (redundant waits) and #6 ( noisy npm install output in CI )
Changes
Added missing_dependencies() helper
→ Checks if each required package exists in node_modules (via package.json file)
Updated install_dependencies()
→ Skips install + shows clear "already up to date" message iff nothing is missing
Changed install_with_package_manager()
→ Now only receives the list of missing packages
Better spinner messages
→ Shows "Checking…" → either "Skipping (all present)" or "Installing X packages…"