Code Monkey home page Code Monkey logo

bezelkit-generator's Introduction

BezelKit

Perfecting Corners, One Radius at a Time

Languages Platforms Licence

Overview

This is the command line generator for the BezelKit Swift package.

Important

Running this script standalone will fail as it attempts to copy the bezel.min.json into the /Resources directory (which does not exist).

To use this repo script it is aimed to be run from the BezelKit repo directory.

Generating New Bezels

You can generate new bezel data for additional devices using the index.js NodeJS script located in the Generator folder.

Requirements

  • iOS/iPadOS runtime installed on your macOS machine to get the simulator.
  • NodeJS installed to run the script.
  • All requirements for running a simulator, opening an Xcode project, etc.

Recommendation: Install it on a macOS VM so as not to interfere with your personal Xcode setup.

Steps

All devices (pending, problematic, and completed) are stored within the apple-device-database.json file.

The file is sectioned into a few areas:

  1. devices: These are the completed, and computed device identifiers and their names and bezel size. This is broken into three categories - iPad, iPhone, and iPod.

  2. pending: The script uses the pending objects to decide which simulators to boot and fetch bezel sizes from. They are to be inserted as:

    "pending" : {
      "identifier" : { "name" : "Simulator name" }
    }
    
    "pending" : {
      "iPhone16,2" : { "name" : "iPhone 15 Pro Max" }
    }
  3. Success & Failure:

    • If the simulator lookup succeeds, the simulator data is moved to the devices object.
    • If the simulator lookup fails, the simulator identifier and object data is moved to the problematic object.

Running the script

cd ./Generator
node index.js

Updating Data

If you'd like to update or extend the list of device bezel sizes, you can easily do so by:

  1. Adding to pending object: Add more devices and their identifiers to the existing JSON file. Make sure the friendly names in the JSON match the "Device Type" from the Create New Simulator screen in Xcode.

    Add New Simulator

    "pending" : {
      "iPhone8,1" : { "name" : "iPhone 6s" }
    }
  2. Problematic Simulators: If any simulators are listed under the problematic key, they are automatically moved into pending the next time the script is run.

By following these steps, you can continually update and maintain the device bezel data.

Once the script completes and updates the bezel.min.json for the actual package, pending and problematic keys are deleted, and the JSON is minified.

Contributing

Contributions are more than welcome. If you find a bug or have an idea for an enhancement, please open an issue or provide a pull request.

Please follow the code style present in the current code base when making contributions.

Note: any pull requests need to have the title in the following format, otherwise it will be rejected.

YYYY-mm-dd - {title}
eg. 2023-08-24 - Updated README file

I like to track the day from logged request to completion, allowing sorting, and extraction of data. It helps me know how long things have been pending and provides OCD structure.

Licence

The BezelKit package is released under the MIT licence. See LICENCE for more information.

bezelkit-generator's People

Contributors

markbattistella avatar

Watchers

 avatar

bezelkit-generator's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.