From b3b09b019e6fdfbedb1514c2a764b0f70ae199f4 Mon Sep 17 00:00:00 2001 From: Hermesis Date: Thu, 3 Jul 2025 17:01:51 +0200 Subject: [PATCH 1/3] macOS support --- .github/workflows/build-and-release.yml | 73 ++++++++++++++++++++++++- CHANGELOG.md | 8 +++ README.md | 13 +++++ package.json | 25 ++++++++- src/main/appDataCleaner.js | 20 ++++++- 5 files changed, 135 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index a733013..75b87fb 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -108,10 +108,49 @@ jobs: ${{ steps.find-installer.outputs.deb_path }} dist/DevNullifier-linux-unpacked.zip + build-macos: + if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.merged == true) + runs-on: macos-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: "18" + cache: "npm" + + - name: Install dependencies + run: npm ci + + - name: Build application + run: npm run build:mac + + - name: Create ZIP archive from unpacked + run: | + cd dist + zip -r DevNullifier-mac-unpacked.zip mac/ + + - name: Find installer files + id: find-installer + run: | + DMG=$(find dist -name "*.dmg" | head -1) + echo "dmg_path=$DMG" >> $GITHUB_OUTPUT + + - name: Upload macOS artifacts + uses: actions/upload-artifact@v4 + with: + name: macos-artifacts + path: | + ${{ steps.find-installer.outputs.dmg_path }} + dist/DevNullifier-mac-unpacked.zip + create-release: if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.merged == true) runs-on: ubuntu-latest - needs: [build-windows, build-linux] + needs: [build-windows, build-linux, build-macos] permissions: contents: write @@ -132,6 +171,12 @@ jobs: name: linux-artifacts path: artifacts/linux/ + - name: Download macOS artifacts + uses: actions/download-artifact@v4 + with: + name: macos-artifacts + path: artifacts/macos/ + - name: Create Release id: create_release uses: actions/create-release@v1 @@ -177,6 +222,12 @@ jobs: echo "appimage_path=$appimage" >> $GITHUB_OUTPUT echo "deb_path=$deb" >> $GITHUB_OUTPUT + - name: Find macOS files + id: find-macos-files + run: | + dmg=$(find artifacts/macos -name "*.dmg" | head -1) + echo "dmg_path=$dmg" >> $GITHUB_OUTPUT + - name: Upload Linux AppImage uses: actions/upload-release-asset@v1 env: @@ -206,3 +257,23 @@ jobs: asset_path: artifacts/linux/DevNullifier-linux-unpacked.zip asset_name: ${{ github.ref_name == 'develop' && 'DevNullifier-linux-unpacked-dev.zip' || 'DevNullifier-linux-unpacked.zip' }} asset_content_type: application/zip + + - name: Upload macOS DMG + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ${{ steps.find-macos-files.outputs.dmg_path }} + asset_name: ${{ github.ref_name == 'develop' && 'DevNullifier-mac-x64-dev.dmg' || 'DevNullifier-mac-x64.dmg' }} + asset_content_type: application/octet-stream + + - name: Upload macOS ZIP Archive + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: artifacts/macos/DevNullifier-mac-unpacked.zip + asset_name: ${{ github.ref_name == 'develop' && 'DevNullifier-mac-unpacked-dev.zip' || 'DevNullifier-mac-unpacked.zip' }} + asset_content_type: application/zip diff --git a/CHANGELOG.md b/CHANGELOG.md index a92fdf6..8da614d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,14 @@ All notable changes to DevNullifier will be documented in this file. +## [1.2.1] - macOS Support + +### Added + +- **macOS Support**: Add support for macOS operating systems +- **DMG Support**: Add support for DMG packaging +- **ZIP Support**: Add support for ZIP packaging + ## [1.2.0] - Linux Support ### Added diff --git a/README.md b/README.md index fbdf094..9c8060e 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ A cross-platform cleaner for application data and developer caches (node_modules - Windows (AppData: Local, Roaming, LocalLow) - Linux (User directories: ~/.config, ~/.cache, ~/.local/share, ~/.local/state, /tmp) +- macOS (User directories: ~/Library/Caches, ~/Library/Application Support, ~/Library/Logs) ## Download @@ -26,6 +27,7 @@ Cleans application data folders that accumulate temporary files, caches, and jun - **Windows**: Temp folders, cache folders, crash dumps, pending files, log files in AppData (Local, Roaming, LocalLow) - **Linux**: Cache and temp folders in ~/.config, ~/.cache, ~/.local/share, ~/.local/state, /tmp +- **macOS**: Cache and temp folders in ~/Library/Caches, ~/Library/Application Support, ~/Library/Logs ## Dev Cleaner @@ -87,6 +89,16 @@ build.bat # Build for production run.bat # Run built application ``` +**Using macOS:** + +```bash +npm install # Install dependencies +npm run dev # Run in development +npm run build # Build for production +``` + +**Note for macOS users:** The app is unsigned, so you'll need to right-click → "Open" → "Open" the first time to bypass Gatekeeper. + ## Usage 1. Launch the application @@ -109,6 +121,7 @@ npm run build:renderer # Build renderer (Vue app) npm run build # Build entire app npm run build:win # Build for Windows npm run build:linux # Build for Linux +npm run build:mac # Build for macOS ``` ## License diff --git a/package.json b/package.json index 1060289..c8a7152 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "devnullifier", - "version": "1.2.0", + "version": "1.2.1", "description": "DevNullifier: Clean application data, dev caches (node_modules, .cache, Library, Binary, Intermediate, etc) with Electron, Vue 3, and Vuetify 3.", "main": "src/main/main.js", "scripts": { @@ -11,7 +11,8 @@ "build:renderer": "vite build", "build:main": "electron-builder --publish=never", "build:linux": "npm run build:renderer && electron-builder --linux --publish=never", - "build:win": "npm run build:renderer && electron-builder --win --publish=never" + "build:win": "npm run build:renderer && electron-builder --win --publish=never", + "build:mac": "npm run build:renderer && electron-builder --mac --publish=never" }, "keywords": [ "electron", @@ -98,6 +99,26 @@ "category": "Utility", "icon": "src/assets/icon-256.png" }, + "mac": { + "target": [ + { + "target": "dmg", + "arch": [ + "x64", + "arm64" + ] + }, + { + "target": "dir", + "arch": [ + "x64", + "arm64" + ] + } + ], + "category": "public.app-category.utilities", + "icon": "src/assets/icon-512.png" + }, "nsis": { "oneClick": false, "allowToChangeInstallationDirectory": true diff --git a/src/main/appDataCleaner.js b/src/main/appDataCleaner.js index 1510b88..ff38d83 100644 --- a/src/main/appDataCleaner.js +++ b/src/main/appDataCleaner.js @@ -14,7 +14,7 @@ const KEYWORDS = [ "pending" ]; -// Get AppData paths (Windows) or equivalent user directories (Linux) +// Get AppData paths (Windows) or equivalent user directories (Linux/macOS) function getAppDataPaths() { const paths = []; @@ -48,6 +48,24 @@ function getAppDataPaths() { paths.push(dirPath); } }); + } else if (process.platform === "darwin") { + const homeDir = os.homedir(); + + // Common macOS user directories where apps store data + const macOSPaths = [ + path.join(homeDir, "Library/Caches"), // Application caches + path.join(homeDir, "Library/Application Support"), // Application data + path.join(homeDir, "Library/Logs"), // Application logs + path.join(homeDir, "Library/Preferences"), // Application preferences + "/tmp" // System temporary files + ]; + + // Add paths that exist + macOSPaths.forEach(dirPath => { + if (fsSync.existsSync(dirPath)) { + paths.push(dirPath); + } + }); } return paths; From 8ff64f63b4006a9eb95a3eb6a68d8b702f812087 Mon Sep 17 00:00:00 2001 From: Hermesis Date: Thu, 3 Jul 2025 18:35:13 +0200 Subject: [PATCH 2/3] Dark mode --- CHANGELOG.md | 6 ++++ README.md | 2 ++ package.json | 2 +- src/renderer/App.vue | 32 +++++++++++++++++-- .../DeveloperCleaner/CacheGroup.vue | 19 +++++++++-- src/renderer/main.js | 11 +++++++ 6 files changed, 65 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8da614d..c733831 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to DevNullifier will be documented in this file. +## [1.2.2] - Dark Mode + +### Added + +- **Dark Mode**: Add dark mode to the application + ## [1.2.1] - macOS Support ### Added diff --git a/README.md b/README.md index 9c8060e..1c3c72c 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ A cross-platform cleaner for application data and developer caches (node_modules, .cache, Library, Binary, Intermediate, etc.) built with Electron, Vue 3, and Vuetify 3. +Now with dark mode! + **Supported Platforms:** - Windows (AppData: Local, Roaming, LocalLow) diff --git a/package.json b/package.json index c8a7152..f90ba38 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "devnullifier", - "version": "1.2.1", + "version": "1.2.2", "description": "DevNullifier: Clean application data, dev caches (node_modules, .cache, Library, Binary, Intermediate, etc) with Electron, Vue 3, and Vuetify 3.", "main": "src/main/main.js", "scripts": { diff --git a/src/renderer/App.vue b/src/renderer/App.vue index 094744d..09c651a 100644 --- a/src/renderer/App.vue +++ b/src/renderer/App.vue @@ -5,6 +5,12 @@ mdi-broom DevNullifier + + + + + {{ isDarkTheme ? 'mdi-brightness-7' : 'mdi-brightness-4' }} + @@ -32,18 +38,38 @@ - -