{"id":23070243,"url":"https://github.com/markbattistella/bezelkit-generator","last_synced_at":"2026-04-29T21:32:55.897Z","repository":{"id":198995521,"uuid":"701921388","full_name":"markbattistella/BezelKit-Generator","owner":"markbattistella","description":"BezelKit-Generator is a NodeJS CLI designed to generate device-specific bezel sizes for Apple devices.","archived":false,"fork":false,"pushed_at":"2025-03-06T01:48:13.000Z","size":66,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-06T02:36:24.806Z","etag":null,"topics":["corner-radius","hacktoberfest","javascript","nodejs","open-source","package-manager","swift","swift-package-manager","swiftui","ui-design"],"latest_commit_sha":null,"homepage":"https://github.com/markbattistella/BezelKit","language":"JavaScript","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/markbattistella.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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},"funding":{"github":["markbattistella"],"custom":["https://www.paypal.me/markbattistella/5AUD","https://www.paypal.me/markbattistella/10AUD","https://www.paypal.me/markbattistella/20AUD"]}},"created_at":"2023-10-08T00:59:02.000Z","updated_at":"2025-03-06T01:48:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"4ea26311-3a53-42c4-9443-a113c4111ecc","html_url":"https://github.com/markbattistella/BezelKit-Generator","commit_stats":null,"previous_names":["markbattistella/bezelkit-generator"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markbattistella%2FBezelKit-Generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markbattistella%2FBezelKit-Generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markbattistella%2FBezelKit-Generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markbattistella%2FBezelKit-Generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/markbattistella","download_url":"https://codeload.github.com/markbattistella/BezelKit-Generator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246981167,"owners_count":20863828,"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","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":["corner-radius","hacktoberfest","javascript","nodejs","open-source","package-manager","swift","swift-package-manager","swiftui","ui-design"],"created_at":"2024-12-16T06:25:25.780Z","updated_at":"2026-04-29T21:32:55.892Z","avatar_url":"https://github.com/markbattistella.png","language":"JavaScript","funding_links":["https://github.com/sponsors/markbattistella","https://www.paypal.me/markbattistella/5AUD","https://www.paypal.me/markbattistella/10AUD","https://www.paypal.me/markbattistella/20AUD"],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n\u003cimg alt=\"BezelKit Generator icon\" src=\"https://raw.githubusercontent.com/markbattistella/BezelKit/main/data/kit-icon.png\" width=\"128\" height=\"128\"/\u003e\n\n# BezelKit — Generator\n\n\u003csmall\u003ePerfecting Corners, One Radius at a Time\u003c/small\u003e\n\n![Language](https://img.shields.io/badge/Language-Swift-white?labelColor=orange\u0026style=flat)\n![Platform](https://img.shields.io/badge/Platform-macOS_13%2B-white?labelColor=gray\u0026style=flat)\n![Licence](https://img.shields.io/badge/Licence-MIT-white?labelColor=blue\u0026style=flat)\n\n\u003c/div\u003e\n\n## Overview\n\nThe Generator is a Swift CLI tool that extracts device bezel (corner radius) data from iOS Simulators and writes the results into the `BezelKit` package resource.\n\nIt uses a SwiftUI app (`FetchBezel`) that reads the private `UIScreen._displayCornerRadius` API from within a simulator — keeping the public-facing package completely free of private API usage.\n\n## Requirements\n\n- macOS 13 or later\n- Xcode with at least one iOS Simulator runtime installed\n- Swift 5.10+\n\nPure Swift — no external toolchain required.\n\n## Building\n\nFrom the `Generator/` directory:\n\n```bash\nswift build\n```\n\nDependencies are resolved automatically on first build.\n\n## Usage\n\nRun from the `Generator/` directory of the BezelKit repo:\n\n```bash\nswift run BezelGenerator\n```\n\nThis processes any devices listed in `pending` inside `apple-device-database.json`, boots the corresponding simulators, captures their bezel values, and updates both the cache database and the minified package resource.\n\n### Subcommands\n\n| Command | Description |\n| ------- | ----------- |\n| `generate` *(default)* | Process pending devices and update the database |\n| `generate-docs` | Regenerate `SupportedDeviceList.md` from `bezel.min.json` |\n| `test` | Test the full pipeline on one simulator without touching the database |\n\n---\n\n### `generate` — process pending devices\n\n```bash\nswift run BezelGenerator\n# or explicitly:\nswift run BezelGenerator generate\n```\n\n| Option | Default | Description |\n| ------ | ------- | ----------- |\n| `--database` | `./apple-device-database.json` | Path to the device database JSON |\n| `--project` | `./FetchBezel/FetchBezel.xcodeproj` | Path to the FetchBezel Xcode project |\n| `--scheme` | `FetchBezel` | Xcode scheme name |\n| `--bundle-id` / `-b` | `com.markbattistella.FetchBezel` | App bundle ID |\n| `--output` | `../Sources/BezelKit/Resources/bezel.min.json` | Output path for the minified resource |\n| `--app-output` | `./output` | Xcode build output directory |\n| `--verbose` / `--no-verbose` | enabled | Toggle terminal output |\n\n---\n\n### `test` — verify the pipeline without modifying the database\n\n```bash\nswift run BezelGenerator test --name \"iPhone 16 Pro\"\n```\n\nBoots the named simulator, reads its bezel value, and tears everything down — without reading or writing `apple-device-database.json`. Use this to verify the pipeline works for a specific device before adding it to `pending`.\n\n| Option | Default | Description |\n| ------ | ------- | ----------- |\n| `--name` / `-n` | *(required)* | Simulator display name to test |\n| `--project`, `--scheme`, `--bundle-id`, `--app-output` | *(same as generate)* | Same options as `generate` |\n\n---\n\n### `generate-docs` — regenerate the supported device list\n\n```bash\nswift run BezelGenerator generate-docs\n```\n\nReads `bezel.min.json` and writes `SupportedDeviceList.md` in the repo root. This is also called automatically by the pre-push git hook.\n\n| Option | Default | Description |\n| ------ | ------- | ----------- |\n| `--input` | `../Sources/BezelKit/Resources/bezel.min.json` | Path to the minified JSON |\n| `--output` | `../SupportedDeviceList.md` | Output path for the markdown file |\n\n---\n\n## Database Structure\n\nAll device data lives in `apple-device-database.json`:\n\n```json\n{\n  \"_metadata\": { \"Author\": \"...\", \"Project\": \"...\", \"Website\": \"...\" },\n  \"devices\": {\n    \"iPad\":   { \"iPad16,1\":   { \"bezel\": 21.5, \"name\": \"iPad mini (A17 Pro)\" } },\n    \"iPhone\": { \"iPhone17,1\": { \"bezel\": 62,   \"name\": \"iPhone 16 Pro\" } },\n    \"iPod\":   {}\n  },\n  \"pending\": {\n    \"iPhone18,1\": { \"name\": \"iPhone 17 Pro\" }\n  },\n  \"problematic\": {}\n}\n```\n\n| Section | Purpose |\n| ------- | ------- |\n| `devices` | Processed devices with confirmed bezel values, split by `iPad`, `iPhone`, and `iPod` |\n| `pending` | Devices queued for processing on the next `generate` run |\n| `problematic` | Devices that could not be processed (no simulator runtime available); automatically retried on every run |\n\n### Adding new devices\n\n1. Add the device identifier and its simulator display name to `pending` in `apple-device-database.json`:\n\n    ```json\n    \"pending\": {\n      \"iPhone18,1\": { \"name\": \"iPhone 17 Pro\" }\n    }\n    ```\n\n    The name must match the **Device Type** shown in Xcode's *Create New Simulator* screen.\n\n    ![Add New Simulator](https://raw.githubusercontent.com/markbattistella/BezelKit/main/data/simulator.jpg)\n\n2. Run the generator:\n\n    ```bash\n    swift run BezelGenerator\n    ```\n\nIdentifiers that share the same simulator name (e.g. Wi-Fi and Cellular variants) are grouped and processed in a single simulator boot — the bezel value is written to all matching identifiers automatically.\n\n### Success and failure\n\n| Outcome | Result |\n| ------- | ------ |\n| Simulator boots and returns data | Entry moves from `pending` → `devices` with the captured bezel value |\n| No runtime available for the device | Entry moves from `pending` → `problematic`; retried automatically on future runs |\n\n## Contributing\n\nContributions are welcome. If you find a bug or want to add device support, please open an issue or pull request.\n\n\u003e [!Note]\n\u003e Pull request titles must follow this format:\n\u003e\n\u003e ```text\n\u003e YYYY-mm-dd - {title}\n\u003e eg. 2025-03-01 - Add iPhone 17 series\n\u003e ```\n\n## Licence\n\nReleased under the MIT licence. See [LICENCE](./LICENCE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkbattistella%2Fbezelkit-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarkbattistella%2Fbezelkit-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkbattistella%2Fbezelkit-generator/lists"}