1
0
mirror of https://github.com/tw93/Mole.git synced 2026-03-22 19:40:07 +00:00
Commit Graph

1795 Commits

Author SHA1 Message Date
Oleksandr Redko
603df79a01 refactor: fix modernize lint issues (#539) 2026-03-05 20:46:12 +08:00
tw93
fc006e32be remove startup intro animation from main menu 2026-03-05 19:13:20 +08:00
Tw93
a4890764d3 chore: auto format code 2026-03-05 09:51:52 +00:00
tw93
c3ea57d301 Resolve merge conflict in mole update helpers 2026-03-05 17:50:32 +08:00
tw93
f91975e5be Refine update/uninstall UX and stabilize brew flows 2026-03-05 17:46:05 +08:00
Tw93
6ce1ea17d8 chore: auto format code 2026-03-05 07:31:50 +00:00
tw93
9ee425766d chore: Update Mole version to 1.29.0 2026-03-05 15:31:11 +08:00
tw93
2578d0a920 chore: Bump version to 1.29.0 V1.29.0 2026-03-05 15:16:55 +08:00
tw93
9fea75af25 Merge branch 'main' of https://github.com/tw93/Mole 2026-03-05 13:58:25 +08:00
tw93
8e4b8a5e0d Improve update checks and cleanup UX, add timeout regressions 2026-03-05 12:00:07 +08:00
Noah Qin
a9d7c3912f fix(sudo): add GUI mode support for non-TTY environments (#536)
When Mole is called from GUI applications (e.g., SwiftUI apps), the
request_sudo_access() function would fail with '/dev/tty: Device not
configured' error because /dev/tty is not available in non-TTY contexts.

This commit adds automatic detection of the runtime environment and uses
macOS native password dialog (via osascript) when running in GUI mode,
while preserving all existing TTY behavior including Touch ID support.

Changes:
- Detect TTY availability before attempting terminal-based authentication
- Use osascript to display native password dialog in GUI mode
- Maintain backward compatibility with all terminal-based workflows
- Ensure secure password handling (unset after use)

Fixes commands like 'mole clean', 'mole optimize', 'mole purge' when
invoked from GUI applications.
2026-03-05 09:35:26 +08:00
tw93
fbee8da9f7 feat: add Helium Browser cleanup support
Add cleanup support for Helium Browser (Chromium-based) on macOS.

Helium paths added:
- ~/Library/Caches/net.imput.helium/*
- ~/Library/Application Support/net.imput.helium/*/GPUCache/*
- ~/Library/Application Support/net.imput.helium/component_crx_cache/*
- ~/Library/Application Support/net.imput.helium/extensions_crx_cache/*
- ~/Library/Application Support/net.imput.helium/GrShaderCache/*
- ~/Library/Application Support/net.imput.helium/GraphiteDawnCache/*
- ~/Library/Application Support/net.imput.helium/ShaderCache/*
- ~/Library/Application Support/net.imput.helium/*/Application Cache/*

Also added "Helium" to the browser process detection list in optimize/tasks.sh.

Closes #534
2026-03-04 19:40:35 +08:00
tw93
ff69504f89 fix: harden CI test stability and status collector resilience 2026-03-04 16:49:20 +08:00
Noah Qin
c88691c2c8 feat: add --json flag to analyze command for non-TTY environments (#533)
* feat: add --json flag to analyze command

* feat: implement JSON output mode for analyze

* refactor: rename jsonOutput flag to jsonMode to avoid conflict
2026-03-04 16:22:09 +08:00
github-actions[bot]
d35f6d0665 chore: update contributors [skip ci] 2026-03-03 18:59:46 +00:00
Noah Qin
fbaf5e7c91 fix(status): enable network data in JSON mode (#532)
Network rate calculation requires two samples to compute the delta.
In JSON mode, the collector was only called once, causing the network
field to always return nil.

This change adds a second collection call with a 1-second interval,
allowing the network rates to be calculated properly.
2026-03-04 02:59:01 +08:00
github-actions[bot]
68430737cf chore: update contributors [skip ci] 2026-03-03 08:58:53 +00:00
tw93
d12cde5405 refactor: use bytes_to_human_kb for dynamic size formatting
- Replace inline dynamic formatting with shared bytes_to_human_kb()
- Apply to both clean and purge commands
- Simplify movie comparison with integer arithmetic
2026-03-03 16:58:31 +08:00
tw93
814b3680b9 feat(version): show commit hash for nightly installs (#517)
Display commit hash in parentheses after "Nightly" channel label
to help users identify exact version when testing nightly builds.
2026-03-03 16:58:31 +08:00
github-actions[bot]
c8ed94698d chore: update contributors [skip ci] 2026-03-03 08:30:16 +00:00
tw93
8f86659032 docs: remove dev branch workflow from contributing guide 2026-03-03 16:29:51 +08:00
tw93
25cba0cf38 refactor(clean): simplify Xcode DeviceSupport cleanup logic
- Use array slicing instead of manual loop for splitting dirs
- Remove redundant early returns with duplicated safe_clean calls
- Consolidate cache/logs cleanup to single location at function end
2026-03-03 16:16:52 +08:00
tw93
b663974f76 Merge branch 'dev' 2026-03-03 16:06:42 +08:00
github-actions[bot]
7e19b2673b chore: update contributors [skip ci] 2026-03-03 08:06:16 +00:00
Noah Qin
2a4eaf007b feat(status): add --json flag for programmatic access (#529)
Add --json command-line flag to mo status that outputs system metrics
in JSON format without requiring a TTY environment.

This enables:
- Integration with GUI applications (e.g., native macOS apps)
- Use in automation scripts and monitoring systems
- Piping output to tools like jq for data extraction
- Recording metrics for analysis

Implementation:
- Add JSON struct tags to all metric types
- Add --json flag using Go's flag package
- Implement runJSONMode() for one-time metric collection
- Refactor main() to support both TUI and JSON modes
- Maintain 100% backward compatibility (default TUI unchanged)

Testing:
- All 454 existing tests pass
- JSON output validated with jq and python json.tool
- Pipeline and redirection work correctly
- No breaking changes to existing functionality
2026-03-03 16:05:55 +08:00
github-actions[bot]
b6fd68009f chore: update contributors [skip ci] 2026-03-03 08:05:54 +00:00
Nour
607073c333 feat(clean): clean old Xcode DeviceSupport versions instead of just their caches (#519) 2026-03-03 16:05:29 +08:00
tw93
677077818e refactor(clean): simplify Go cache whitelist logic
- Fix undefined ICON_SKIP, use ICON_SUCCESS instead
- Reduce code from 46 to 27 lines with early return pattern
- Consistent styling with other whitelist skip messages
2026-03-03 16:02:39 +08:00
github-actions[bot]
ab35f2e8f1 chore: update contributors [skip ci] 2026-03-03 07:58:03 +00:00
Noah Qin
5d4c304797 fix(clean): respect whitelist when cleaning Go caches (#530)
- Add whitelist checking to clean_dev_go() function
- Check both GOCACHE and GOMODCACHE before cleaning
- Show appropriate messages for protected caches
- Fix whitelist pattern from ~/go/pkg/mod/cache/* to ~/go/pkg/mod/*
- Split Go cache into separate build and module entries

Fixes #521
2026-03-03 15:57:45 +08:00
tw93
66ba1889c6 fix: correct missing $ in color variable reference
Fix typo from PR #523: {NC} → ${NC}
2026-03-03 15:57:18 +08:00
Tw93
c41dcbcdee chore: auto format code 2026-03-03 07:52:51 +00:00
Angelk90
00f29cff20 Clean dynamic size formatting (#523) 2026-03-03 15:52:04 +08:00
github-actions[bot]
87bf90f712 chore: update contributors [skip ci] 2026-03-03 07:42:46 +00:00
tw93
d0e5e3618e Merge branch 'main' into dev 2026-03-03 15:42:13 +08:00
tw93
abb0b2b688 fix(clean): use defined ICON_WARNING instead of undefined ICON_SKIP
Ref #531
2026-03-03 15:39:45 +08:00
github-actions[bot]
509bbbfbcc chore: update contributors [skip ci] 2026-03-03 07:38:19 +00:00
Noah Qin
0da3d4ab23 fix(clean): enhance Xcode simulator cleanup with fallback mechanism (#531)
- Add simctl availability check before attempting cleanup
- Capture and analyze error output for better diagnostics
- Implement fallback: manual deletion when simctl fails
- Provide specific error hints (permission, in-use, service issues)
- Skip early when no unavailable simulators exist
- Show partial success status when some deletions fail

Error scenarios now handled:
- simctl not available → skip with friendly message
- Permission denied → show hint and try manual deletion
- Device in use → show hint and try manual deletion
- CoreSimulator service issues → show hint
- Partial failures → show "partially cleaned X/Y"

Fixes #520
2026-03-03 15:38:01 +08:00
github-actions[bot]
38601ec0d1 chore: update contributors [skip ci] 2026-03-03 02:04:59 +00:00
dependabot[bot]
0736892a57 chore(deps): bump actions/setup-go from 6.2.0 to 6.3.0 (#524)
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 6.2.0 to 6.3.0.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](7a3fe6cf4c...4b73464bb3)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-version: 6.3.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-03 10:04:22 +08:00
dependabot[bot]
fd6d444e00 chore(deps): bump actions/upload-artifact from 6.0.0 to 7.0.0 (#525)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 6.0.0 to 7.0.0.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](b7c566a772...bbbca2ddaa)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: 7.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-03 10:04:08 +08:00
dependabot[bot]
e992cd351b chore(deps): bump actions/download-artifact from 7.0.0 to 8.0.0 (#526)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 7.0.0 to 8.0.0.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](37930b1c2a...70fc10c6e5)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: 8.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-03 10:03:59 +08:00
dependabot[bot]
046af7682c chore(deps): bump github.com/shirou/gopsutil/v4 from 4.26.1 to 4.26.2 (#527)
Bumps [github.com/shirou/gopsutil/v4](https://github.com/shirou/gopsutil) from 4.26.1 to 4.26.2.
- [Release notes](https://github.com/shirou/gopsutil/releases)
- [Commits](https://github.com/shirou/gopsutil/compare/v4.26.1...v4.26.2)

---
updated-dependencies:
- dependency-name: github.com/shirou/gopsutil/v4
  dependency-version: 4.26.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-03 10:03:50 +08:00
tw93
27a2cc5927 feat: show nightly channel in version output
Refs #517
2026-03-02 10:55:36 +08:00
github-actions[bot]
0a8f92cf83 chore: update contributors [skip ci] 2026-03-01 13:06:02 +00:00
tw93
d4116fbd49 docs(readme): reduce duplicate quick-start guidance 2026-03-01 21:04:48 +08:00
tw93
de57a20828 refactor(dry-run): unify flag handling in completion and remove 2026-03-01 21:04:41 +08:00
tw93
241e6a7a34 fix(purge): avoid counting failed dry-run removals 2026-03-01 20:35:49 +08:00
陳德生
05446e0847 Add dry-run support across destructive commands (#516)
* chore: update contributors [skip ci]

* Add dry-run support across destructive commands

Implement dry-run for uninstall, purge, installer, touchid, completion, and remove flows.\nGuard side effects in uninstall path (launchctl, defaults writes, kill/brew actions), update help/README, and add coverage in CLI/Bats tests.\n\nValidation: ./scripts/check.sh and ./scripts/test.sh (452 tests, 0 failures, 8 skipped).

* test(purge): keep dev-compatible purge coverage

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Tw93 <hitw93@gmail.com>
2026-03-01 20:03:22 +08:00
tw93
adcd98096a fix(update): keep sudo session alive during installer run
Start sudo keepalive after authorization and clean it up on all failure/success paths to avoid repeated password prompts and overlapping update UI output. Closes #514.
2026-03-01 19:56:42 +08:00