diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f0a3ef0..ed7114e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,16 +1,12 @@ name: Wails Build on: + # Only run on version tags (releases) push: - branches: - - main - - master tags: - 'v*' - pull_request: - branches: - - main - - master + # Allow manual trigger + workflow_dispatch: env: # Necessary for most environments @@ -69,9 +65,21 @@ jobs: fi shell: bash - # Optional: Upload build artifacts + # Upload build artifacts - name: Upload Artifacts uses: actions/upload-artifact@v4 with: - name: Wails-Build-${{ matrix.os }} + name: Wails-Build-${{ matrix.os }}-${{ github.ref_name }} path: build/bin/* + + # Create Release and upload assets (only on tags) + - name: Create Release + if: startsWith(github.ref, 'refs/tags/v') + uses: softprops/action-gh-release@v1 + with: + files: build/bin/* + draft: false + prerelease: false + generate_release_notes: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..d227f7a --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,90 @@ +name: Tests & Build Verification + +on: + pull_request: + branches: + - main + - master + paths: + - '**.go' + - 'go.mod' + - 'go.sum' + - '**.js' + - '**.jsx' + - '**.ts' + - '**.tsx' + - 'package.json' + - 'bun.lockb' + push: + branches: + - main + - master + paths: + - '**.go' + - 'go.mod' + - 'go.sum' + - '**.js' + - '**.jsx' + - '**.ts' + - '**.tsx' + - 'package.json' + - 'bun.lockb' + +jobs: + go-tests: + name: Go Tests + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version: '1.24.0' + check-latest: true + + - name: Download Dependencies + run: go mod download + + - name: Run Go Tests + run: go test ./internal/converter/... -v -race + + - name: Run Tests with Coverage + run: go test ./internal/converter/... -coverprofile=coverage.out + + - name: Upload Coverage Report + uses: actions/upload-artifact@v4 + with: + name: coverage-report + path: coverage.out + + frontend-build: + name: Frontend Build (Bun) + runs-on: ubuntu-latest + needs: go-tests + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Bun + uses: oven-sh/setup-bun@v1 + with: + bun-version: latest + + - name: Install Dependencies + run: bun install + + - name: Build Web Application + run: bun run build + + - name: Verify Build Output + run: | + if [ ! -d "dist" ]; then + echo "Error: dist directory not found after build" + exit 1 + fi + echo "Build successful - dist directory created" + ls -la dist/ diff --git a/README.md b/README.md index 1100b22..80e916a 100644 --- a/README.md +++ b/README.md @@ -1,118 +1,110 @@ # Developer Toolbox -## Overview +[![Tests & Build](https://github.com/vuon9/dev-toolbox/actions/workflows/tests.yml/badge.svg)](https://github.com/vuon9/dev-toolbox/actions/workflows/tests.yml) +[![Wails Build](https://github.com/vuon9/dev-toolbox/actions/workflows/build.yml/badge.svg)](https://github.com/vuon9/dev-toolbox/actions/workflows/build.yml) +[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) +[![Go Version](https://img.shields.io/badge/Go-1.24+-00ADD8?style=flat&logo=go&logoColor=white)](https://go.dev) -The **Developer Toolbox** is a modern, lightweight web‑based utility suite for developers. It bundles a collection of everyday tools—JSON/YAML/CSV conversion, Base64 encoding/decoding, UUID/ULID generation, QR code creation, JWT debugging, code formatting, Lorem Ipsum generation, and many more—into a single, cohesive UI. +A modern, all-in-one desktop application for developers featuring 40+ utilities for encoding, encryption, hashing, and data format conversions. -All UI components are built with the **Carbon Design System** (`@carbon/react`) to ensure a consistent, accessible, and premium look across the entire application. The app supports dark, light, and system‑preferred themes and includes a theme‑switcher in the top‑right corner. - -> **Why this toolbox?** -> - No need to install a dozen separate CLI tools. -> - Works offline in a desktop‑like environment powered by **Wails** (Go + Vite + React). -> - Extensible: new tools can be added by simply creating a React component that follows the UI conventions. - ---- +![Developer Toolbox Screenshot](screenshot.png) ## Features -| Category | Tool | Description | -|----------|------|-------------| -| **Data Conversion** | **Data Converter** | Convert between JSON, YAML, CSV, and PHP array formats. | -| | **CSV ↔ JSON** | Convert CSV files to JSON and vice‑versa. | -| **Encoding / Decoding** | **Base64 Converter** | Encode/decode text and images to/from Base64. | -| | **URL Tools** | Parse URLs, encode/decode components. | -| **Generators** | **UUID / ULID Generator** | Generate random UUID v4 or ULID values. | -| | **Lorem Ipsum Generator** | Produce placeholder paragraphs, sentences, or words. | -| | **QR Code Generator** | Generate QR codes from arbitrary text/URLs with preview and download. | -| **Debuggers** | **JWT Debugger** | Decode JWT header and payload, view errors. | -| **Formatters** | **Code Formatter** | Beautify HTML, CSS, JavaScript, XML. | -| | **JSON Formatter** | Pretty‑print or minify JSON. | -| | **Hex / ASCII Converter** | Convert between hexadecimal strings and ASCII text. | -| **Utilities** | **String Inspector** | Show character, word, line, byte, and sentence counts. | -| | **Line Sort / Dedupe** | Sort, deduplicate, trim, reverse lists of lines. | -| | **Hash Generator** | Compute MD5, SHA‑1, SHA‑256, SHA‑512 hashes. | -| | **Random String Generator** | Generate random alphanumeric strings. | -| | **Uuid Generator** | Generate UUIDs and ULIDs. | -| | **...** | Additional tools can be found in the sidebar. - ---- - -## Installation & Running - -### Prerequisites -- **Node.js** (>= 18) -- **Go** (>= 1.22) -- **Wails** CLI (`go install github.com/wailsapp/wails/v2/cmd/wails@latest`) - -### Steps +### **Text Based Converter** (Unified Tool) +The central hub with 40+ algorithms across 4 categories: + +| Category | Algorithms | +|----------|------------| +| **🔐 Encrypt / Decrypt** | AES, AES-GCM, DES, Triple DES, ChaCha20, Salsa20, XOR, RC4 | +| **🔀 Encode / Decode** | Base64, Base64URL, Base32, Base58, Base16 (Hex), URL, HTML Entities, Binary, Morse Code, ROT13, ROT47, Quoted-Printable | +| **🔄 Convert** | JSON ↔ YAML, JSON ↔ XML, JSON ↔ CSV, YAML ↔ TOML, Markdown ↔ HTML, CSV ↔ TSV, Properties ↔ JSON, INI ↔ JSON, Key-Value ↔ Query String, Number Bases, Case Swapping | +| **#️⃣ Hash** | MD5, SHA-1, SHA-224, SHA-256, SHA-384, SHA-512, SHA-3, BLAKE2b, BLAKE3, RIPEMD-160, bcrypt, scrypt, Argon2, HMAC, CRC32, Adler-32, MurmurHash3, xxHash, FNV-1a | + +**Special Features:** +- **"All Hashes" view** - Compute all 19 hash algorithms at once with copy buttons for each +- **Smart key/IV detection** - Automatically shows configuration pane when needed +- **Auto-run mode** - Results update instantly as you type +- **Horizontal/Vertical layout toggle** - Customize the workspace layout + +### **Other Tools** + +| Tool | Description | +|------|-------------| +| **JWT Debugger** | Decode and verify JWT tokens with header/payload inspection | +| **UUID / ULID Generator** | Generate random UUID v4 or ULID values | +| **QR Code Generator** | Create QR codes from text/URLs with preview and download | +| **JSON Formatter** | Pretty-print or minify JSON with syntax validation | +| **Code Formatter** | Beautify HTML, CSS, JavaScript, XML | +| **RegExp Tester** | Test regular expressions with real-time matching | +| **Unix Time Converter** | Convert between Unix timestamps and human-readable dates | +| **Color Converter** | Convert between HEX, RGB, HSL, and other color formats | +| **SQL Formatter** | Format SQL queries with proper indentation | +| **String Case Converter** | Convert between camelCase, snake_case, PascalCase, etc. | +| **Cron Job Parser** | Parse and explain cron expressions | +| **Text Diff Checker** | Compare two text blocks and highlight differences | +| **Line Sort / Dedupe** | Sort lines, remove duplicates, trim whitespace | +| **String Inspector** | Count characters, words, lines, bytes, and sentences | +| **Lorem Ipsum Generator** | Generate placeholder text | +| **Random String Generator** | Generate random alphanumeric strings with custom length | +| **HTML Preview** | Preview HTML rendering in real-time | +| **Markdown Preview** | Render Markdown with live preview | +| **Backslash Escaper** | Escape/unescape backslash characters | +| **PHP Serializer** | PHP serialization/unserialization | +| **URL Tools** | Parse URLs, extract components | + +## Installation + +### Download Pre-built Binaries +Download the latest release for your platform from the [Releases](https://github.com/your-org/dev-toolbox/releases) page. + +**Supported Platforms:** +- Windows (x64) +- macOS (Intel & Apple Silicon) +- Linux (x64) + +### Build from Source + +**Prerequisites:** +- Node.js (>= 18) +- Go (>= 1.22) +- Wails CLI: `go install github.com/wailsapp/wails/v2/cmd/wails@latest` + +**Build Steps:** ```bash # Clone the repository git clone https://github.com/your-org/dev-toolbox.git cd dev-toolbox -# Install frontend dependencies -cd frontend -npm install +# Install dependencies and build +wails build -# Build & run the desktop app (Wails) -cd .. -wails dev # development mode with hot‑reload -# or -wails build # production binary +# Or run in development mode +wails dev ``` -The app will open in a native window. The UI works offline; no external API calls are required. +## Key Features ---- +✅ **Works Offline** - All tools run locally, no internet connection required +✅ **Dark/Light Themes** - Switch between themes or use system preference +✅ **Pin Tools** - Pin frequently used tools to the top of the sidebar +✅ **Keyboard Shortcuts** - `Cmd/Ctrl + B` to toggle sidebar +✅ **Copy to Clipboard** - One-click copy buttons on all output fields +✅ **Auto-run** - See results instantly as you type (can be disabled) +✅ **Responsive Layout** - Horizontal or vertical split panes -## Project Structure -``` -dev-toolbox/ -├─ frontend/ # React + Vite source -│ ├─ src/ -│ │ ├─ components/ # Shared UI helpers (ToolUI, Sidebar, etc.) -│ │ ├─ tools/ # Individual tool components -│ │ ├─ App.jsx # Root component, Theme provider, routing -│ │ └─ index.scss # Global Carbon style overrides -│ └─ vite.config.js # Vite config with Sass deprecation suppression -├─ backend/ (Go) # Wails bridge, main entry point -│ ├─ main.go -│ └─ app.go -└─ AGENTS.md # Design principles & UI guidelines (auto‑generated) -``` +## UI Design ---- - -## UI / Design Guidelines (see `AGENTS.md`) -- **All components must use Carbon React components** (Button, TextArea, Select, Tabs, etc.). -- **TextAreas** for both input and output share the same style: monospace font, identical height, visible border, and a copy‑to‑clipboard button that is always shown next to the label. -- **Buttons** placed on the same line have a 1 rem gap and are grouped in a dedicated `ToolControls` area. -- **Labels** use Carbon’s label style (uppercase, small, secondary text color). -- **Theme switching** is available via the Settings overflow menu (System / Dark / Light). -- **Copy button** is positioned beside the pane label and never hidden. - ---- - -## Adding a New Tool -1. Create a new component under `src/tools/`. -2. Wrap the UI with the shared helpers from `src/components/ToolUI.jsx` (`ToolHeader`, `ToolControls`, `ToolPane`, `ToolSplitPane`). -3. Export the component and add a route entry in `src/App.jsx`. -4. Follow the UI rules in `AGENTS.md` to keep the look consistent. - ---- - -## Contributing -- Fork the repo and create a feature branch. -- Run `npm run lint` and `npm run format` before committing. -- Ensure any new UI respects the Carbon design system and the rules in `AGENTS.md`. -- Open a pull request with a clear description of the added functionality. - ---- +Built with **Carbon Design System** for a consistent, professional look: +- Clean, modern interface +- Accessible components +- Consistent spacing and typography +- Monospace fonts for code/data ## License -MIT License – feel free to use, modify, and distribute. +MIT License - free to use, modify, and distribute. --- -*Built with ❤️ and 🤖.* \ No newline at end of file +*Built with ❤️ using Go, React, and Wails.* diff --git a/TOOL_STATUS.md b/TOOL_STATUS.md index 4bf57d7..dad5b11 100644 --- a/TOOL_STATUS.md +++ b/TOOL_STATUS.md @@ -16,23 +16,16 @@ This document tracks the refactoring and development status of each tool compone | Tool | Status | Notes | Last Updated | |------|--------|-------|--------------| | JwtDebugger | 🟢 Done | Uses component abstraction system (ToolLayout, ToolTextArea, ToolInputGroup), toggleable layout, consistent button styling with icons (MagicWand, Security, Code), enhanced tabs (custom mode tabs, improved JSON/Claims tabs), resizable textareas with constraints, proper error handling | Completed 2026-01-25 | -| **TextBasedConverter** | 🟡 In Progress | Unified tool for all encoding, encryption, hashing, and format conversions. Smart ConfigurationPane adapts to algorithm requirements. Backend uses hierarchical structure (`internal/converter/`). Comprehensive unit tests. Implements 40+ algorithms across 4 categories. **Replaces**: Base64Converter, HashGenerator, HexAsciiConverter, HtmlEntityConverter, UrlEncoder, NumberBaseConverter, YamlToJson, CsvJsonConverter | Started 2026-01-25 | +| **TextBasedConverter** | 🟢 Done | Unified tool for all encoding, encryption, hashing, and format conversions. Smart ConfigurationPane adapts to algorithm requirements. Backend uses hierarchical structure (`internal/converter/`). Comprehensive unit tests. Implements 40+ algorithms across 4 categories | Completed 2026-01-31 | | BackslashEscaper | 🔴 Not Started | Legacy implementation | - | -| Base64Converter | ⚫ Deprecated | **Replaced by TextBasedConverter** (Encode - Decode → Base64) | - | | CodeFormatter | 🔴 Not Started | Legacy implementation | - | | ColorConverter | 🔴 Not Started | Legacy implementation | - | | CronJobParser | 🔴 Not Started | Legacy implementation | - | -| CsvJsonConverter | ⚫ Deprecated | **Replaced by TextBasedConverter** (Convert → JSON ↔ CSV / TSV) | - | -| DataConverter | 🔴 Not Started | Legacy implementation | - | -| HashGenerator | ⚫ Deprecated | **Replaced by TextBasedConverter** (Hash → MD5, SHA-1, SHA-256, etc.) | - | -| HexAsciiConverter | ⚫ Deprecated | **Replaced by TextBasedConverter** (Encode - Decode → Base16 (Hex)) | - | -| HtmlEntityConverter | ⚫ Deprecated | **Replaced by TextBasedConverter** (Encode - Decode → HTML Entities) | - | | HtmlPreview | 🔴 Not Started | Legacy implementation | - | | JsonFormatter | 🔴 Not Started | Legacy implementation | - | | LineSortDedupe | 🔴 Not Started | Legacy implementation | - | | LoremIpsumGenerator | 🔴 Not Started | Legacy implementation | - | | MarkdownPreview | 🔴 Not Started | Legacy implementation | - | -| NumberBaseConverter | ⚫ Deprecated | **Replaced by TextBasedConverter** (Convert → Number Bases) | - | | PhpJsonConverter | 🔴 Not Started | Legacy implementation | - | | PhpSerializer | 🔴 Not Started | Legacy implementation | - | | QrCodeGenerator | 🔴 Not Started | Legacy implementation | - | @@ -43,27 +36,59 @@ This document tracks the refactoring and development status of each tool compone | StringInspector | 🔴 Not Started | Legacy implementation | - | | TextDiffChecker | 🔴 Not Started | Legacy implementation | - | | UnixTimeConverter | 🔴 Not Started | Legacy implementation | - | -| UrlEncoder | ⚫ Deprecated | **Replaced by TextBasedConverter** (Encode - Decode → URL) | - | | UrlParser | 🔴 Not Started | Legacy implementation | - | | UrlTools | 🔴 Not Started | Legacy implementation | - | | UuidGenerator | 🔴 Not Started | Legacy implementation | - | -| YamlToJson | ⚫ Deprecated | **Replaced by TextBasedConverter** (Convert → JSON ↔ YAML) | - | --- ## Last tool tasks -### Text-based Converter - -- [ ] Implement remaining encryption algorithms (DES, Triple DES, ChaCha20, Salsa20, Blowfish, etc.) -- [ ] Implement remaining encoding algorithms (Base85, Punnycode, JWT Decode, Bencoded, Protobuf) -- [ ] Implement remaining conversion features (XML, TOML, Color codes, Timestamp, CURL, Cron) -- [ ] Implement remaining hashing algorithms (BLAKE3, scrypt, Argon2, HMAC with UI, MurmurHash) -- [ ] Add copy buttons to ConfigurationPane for sample values -- [ ] Consider adding "Generate Random Key" button for encryption -- [ ] Full browser testing with real Wails app (not test server) -- [ ] Consider removing deprecated tools from codebase -- [ ] Remove all deprecated tools after having functionality working well +### Text-based Converter - Implementation Status + +#### ✅ **COMPLETED** + +**Encryption (8 algorithms):** +- ✅ AES, AES-GCM, DES, Triple DES, ChaCha20, Salsa20, XOR, RC4 + +**Encoding (12 algorithms):** +- ✅ Base16 (Hex), Base32, Base58, Base64, Base64URL, URL, HTML Entities, Binary, Morse Code, ROT13, ROT47, Quoted-Printable + +**Conversion (11 formats):** +- ✅ JSON ↔ YAML, JSON ↔ XML, JSON ↔ CSV / TSV, YAML ↔ TOML, Markdown ↔ HTML, CSV ↔ TSV, Key-Value ↔ Query String, Number Bases, Case Swapping, Properties ↔ JSON, INI ↔ JSON + +**Hashing (19 algorithms + All view):** +- ✅ MD5, SHA-1, SHA-224, SHA-256, SHA-384, SHA-512, SHA-3 (Keccak), BLAKE2b, BLAKE3, RIPEMD-160, bcrypt, scrypt, Argon2, HMAC, CRC32, Adler-32, MurmurHash3, xxHash, FNV-1a +- ✅ "All" hash view with grid display of all algorithms + +**Features:** +- ✅ Comprehensive unit tests (56 test cases) +- ✅ GitHub Actions CI/CD for Go tests +- ✅ Removed deprecated tools from codebase + +--- + +#### ⏳ **PENDING IMPLEMENTATION** + +The following algorithms are listed in CONVERTER_MAP but **not yet implemented** in the backend: + +**Encryption (7 algorithms):** +- ⏳ Rabbit, RC4Drop, Blowfish, Twofish, RSA, Fernet, BIP38 + +**Encoding (5 algorithms):** +- ⏳ Base85, Punnycode, JWT Decode, Bencoded, Protobuf + +**Conversion (5 formats):** +- ⏳ Unix Timestamp ↔ ISO 8601 (exists but needs improvement) +- ⏳ Color Codes (exists but needs improvement) +- ⏳ SQL Insert ↔ JSON Array +- ⏳ CURL Command ↔ Fetch +- ⏳ Cron Expression ↔ Text + +**UI Improvements:** +- ⏳ Add copy buttons to ConfigurationPane for sample values +- ⏳ Consider adding "Generate Random Key" button for encryption +- ⏳ Full browser testing with real Wails app (not test server) --- diff --git a/internal/converter/converter_test.go b/internal/converter/converter_test.go index c66a7d5..1ade475 100644 --- a/internal/converter/converter_test.go +++ b/internal/converter/converter_test.go @@ -1,6 +1,7 @@ package converter import ( + "encoding/json" "strings" "testing" ) @@ -24,6 +25,25 @@ func TestEncodingConverter(t *testing.T) { {"URL Encode", "hello world", "url", "Encode", "hello+world"}, {"HTML Encode", "