{"id":25930299,"url":"https://github.com/codepurge/codepurgekit","last_synced_at":"2026-05-07T04:38:29.461Z","repository":{"id":280007238,"uuid":"939022836","full_name":"CodePurge/CodePurgeKit","owner":"CodePurge","description":"Swift package providing shared data models, utilities, and SwiftUI components to manage and organize purgable items in Xcode environments.","archived":false,"fork":false,"pushed_at":"2025-03-10T17:56:16.000Z","size":48,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-03-10T18:49:33.716Z","etag":null,"topics":["cleaning-data","cleanup","developer-tools","macos","swift","swiftui","swiftui-example","xcode"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CodePurge.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-25T21:40:57.000Z","updated_at":"2025-03-10T17:56:17.000Z","dependencies_parsed_at":"2025-02-28T21:57:34.595Z","dependency_job_id":"e1c1078f-e254-4749-8ac6-520424f7c1bb","html_url":"https://github.com/CodePurge/CodePurgeKit","commit_stats":null,"previous_names":["codepurge/codepurgekit"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/CodePurge/CodePurgeKit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodePurge%2FCodePurgeKit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodePurge%2FCodePurgeKit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodePurge%2FCodePurgeKit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodePurge%2FCodePurgeKit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CodePurge","download_url":"https://codeload.github.com/CodePurge/CodePurgeKit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodePurge%2FCodePurgeKit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276077894,"owners_count":25581305,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-20T02:00:10.207Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cleaning-data","cleanup","developer-tools","macos","swift","swiftui","swiftui-example","xcode"],"created_at":"2025-03-03T23:01:15.880Z","updated_at":"2025-09-20T09:48:16.463Z","avatar_url":"https://github.com/CodePurge.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# CodePurgeKit\n\n![Swift](https://img.shields.io/badge/Swift-5.7-blue)\n![Platform](https://img.shields.io/badge/Platform-macOS%2013.0-lightgrey)\n![License](https://img.shields.io/badge/License-MIT-green)\n\u003c!-- ![Version](https://img.shields.io/github/v/release/CodePurge/CodePurgeKit?refresh=true) --\u003e\n\n**CodePurgeKit** is a shared module within the [CodePurge](https://github.com/CodePurge) project. It contains shared data models, utilities, and view components used throughout the CodePurge app. While the main CodePurge app is private, this package is open-source and provides the foundation for managing and organizing purgable items efficiently.\n\nAlthough **CodePurgeKit** is primarily intended as part of the larger CodePurge app, its lack of dependencies makes it adaptable for use in other projects. A comprehensive documentation file is included to provide developers with detailed guidance and examples.\n\n## Features\n\n- **Shared Data Models**: Protocols and classes for managing purgable items with flexibility and type safety.\n- **Observable State Management**: Combine-powered observable objects to track changes in item states and trigger UI updates.\n- **Reusable SwiftUI Components**: Prebuilt views and modifiers for interactive interfaces.\n- **Utilities**: Handy extensions for formatting, calculations, and size management.\n- **Environment Keys**: Custom keys for additional functionality, such as `purgeIsLive`.\n- **Comprehensive Documentation**: A detailed `.md` file explains components, usage, and customization options.\n\n## Installation\n\n### Swift Package Manager\n\nTo use **CodePurgeKit** in your project, add it to your `Package.swift`:\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/CodePurge/CodePurgeKit\", branch: \"main\")\n]\n```\n\nThen, import it wherever needed:\n\n```swift\nimport CodePurgeKit\n```\n\n## Components\n\n### Data Models\n- **`PurgableItem`**: Protocol defining the structure of items that can be purged.\n- **`PurgeCategoryDetailInfo`**: Provides detailed information about purgable categories, including tips and guidance.\n- **`ScannableCategory`**: Protocol for categories that can be scanned, including their metadata and details.\n\n### Observable Objects\n- **`BasePurgeObservableObject`**: Tracks total size, selected size, and item counts with live updates using Combine.\n- **`PurgableItemDataSource`**: Manages lists of items and their selection states, publishing changes in real-time.\n\n### UI Components\n- **SwiftUI Views**:\n  - `ScanStartCategoryListView`: Displays a list of categories and allows selection for scanning.\n  - `ScanResultView`: Displays the results of a scan, including scanned categories and their details.\n  - `ListItemSectionView`: Represents a list section with its name, size, and selection status.\n  - `ListItemSectionCheckbox`: Adds a checkbox reflecting the selection state of a section.\n  - `ShortFormattedDateLabel`: Displays a formatted date label with optional metadata.\n\n- **View Modifiers**:\n  - `PurgeContentViewModifier`: Manages a button view to present `PurgeContentView`, which triggers purges.\n  - `CheckBoxRowViewModifier`: Adds a checkbox for selecting or toggling items in a row, also dependent on the `purgeIsLive` key.\n  - `SelectionDetailFooterViewModifer`: Shows detailed footers with selection counts and sizes.\n  - `RoundedListViewModifier`: Adds rounded styling to list views.\n\n### Utilities\n- **Extensions**:\n  - `Int64+Extensions`: Human-readable storage size formatting.\n  - `Array+Extensions`: Summation utilities for arrays of sizes.\n  - `LinearGradient+Extensions`: Custom gradients for UI elements.\n\n### Environment Keys\n- **`purgeIsLive`**: Determines whether the app is in \"live\" mode or \"practice\" mode. This key affects the appearance of various UI elements, such as colors and labels.\n\n## Documentation\n\nFor more detailed information about the components, usage examples, and customization options, refer to the [comprehensive documentation file](docs/CodePurgeKit_Documentation.md) included in this package.\n\n## Getting Started\n\n1. **Add the Package**: Follow the installation instructions above to integrate `CodePurgeKit` into your project.\n2. **Implement Your Models**: Conform your models to protocols like `PurgableItem` and `ScannableCategory`.\n3. **Use the Components**: Utilize the views and modifiers to build your interface.\n\n### Example\n```swift\nScanStartCategoryListView(\n    options: categories,\n    selections: selectedCategories,\n    toggleScanCategory: { category in\n        // Handle toggle\n    },\n    startScan: {\n        // Start scanning logic\n    }\n)\n```\n\n## Contributing\nAny feedback or ideas to enhance CodePurgeKit would be well received. Please feel free to [open an issue](https://github.com/CodePurge/CodePurgeKit/issues/new) if you'd like to help improve this Swift package.\n\n## About\nThis package is part of the [CodePurge](https://github.com/CodePurge) organization, providing tools to streamline project management and storage optimization for Xcode developers.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodepurge%2Fcodepurgekit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodepurge%2Fcodepurgekit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodepurge%2Fcodepurgekit/lists"}