Skip to content
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
prabhatrm23git:master
Open

fix(init): skip npm install if deps already present (fixes #5, #6)#18
prabhatrm23git wants to merge 246 commits intorust-ui:masterfrom
prabhatrm23git:master

Conversation

@prabhatrm23git
Copy link
Copy Markdown

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…"

max-wells and others added 30 commits May 16, 2025 20:01
max-wells and others added 29 commits March 7, 2026 10:12
- 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
- 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)
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.

init: Don't reinstall dependencies in package.json if already installed.

2 participants