{"id":13995229,"url":"https://github.com/thumbtack/star","last_synced_at":"2025-04-14T00:40:51.936Z","repository":{"id":41828664,"uuid":"238542597","full_name":"thumbtack/star","owner":"thumbtack","description":"Generate reports on how frequently specified Swift types are being used in your iOS codebase","archived":false,"fork":false,"pushed_at":"2023-12-11T16:06:33.000Z","size":53,"stargazers_count":27,"open_issues_count":0,"forks_count":5,"subscribers_count":99,"default_branch":"main","last_synced_at":"2024-04-24T21:01:00.028Z","etag":null,"topics":["ios","swift","swift-package","swift-package-manager","swift-syntax"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thumbtack.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}},"created_at":"2020-02-05T20:32:11.000Z","updated_at":"2024-04-24T21:01:00.029Z","dependencies_parsed_at":"2024-01-18T05:27:19.047Z","dependency_job_id":"67075047-3484-4b74-9f03-c2d99451727c","html_url":"https://github.com/thumbtack/star","commit_stats":{"total_commits":21,"total_committers":3,"mean_commits":7.0,"dds":0.1428571428571429,"last_synced_commit":"b249ab5bf27147699789fe66af9214f22b448d28"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thumbtack%2Fstar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thumbtack%2Fstar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thumbtack%2Fstar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thumbtack%2Fstar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thumbtack","download_url":"https://codeload.github.com/thumbtack/star/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248804436,"owners_count":21164125,"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":["ios","swift","swift-package","swift-package-manager","swift-syntax"],"created_at":"2024-08-09T14:03:18.899Z","updated_at":"2025-04-14T00:40:51.917Z","avatar_url":"https://github.com/thumbtack.png","language":"Swift","funding_links":[],"categories":["Swift"],"sub_categories":[],"readme":"[![Build Status](https://badgen.net/travis/thumbtack/star)](https://travis-ci.com/thumbtack/star)\n[![SPM Latest Version](https://img.shields.io/github/v/release/thumbtack/star?label=SPM)](https://swiftpackageindex.com/thumbtack/star)\n[![License](https://img.shields.io/github/license/thumbtack/star?color=important)](https://github.com/thumbtack/star/blob/main/LICENSE)\n\n# Swift Type Adoption Reporter (STAR)\n\nGenerate reports on how frequently specified Swift types are being used in your iOS codebase with a simple command-line interface.\n\n## Install\n\n```\n$ cd star\n$ make install\n```\n\n## Usage\n\n```\n$ star --types Avatar Button Color Pill --files ./\n\nAvatar used 27 times.\nButton used 167 times.\nColor used 2711 times.\nPill used 9 times.\n```\n\nTo report on types which are in a separate module, specify a `--moduleName`. This will ensure that  references like `Thumbprint.Button()` are captured too.\n\n```\n$ star --types Avatar Button Color Pill --files ./ --module Thumbprint\n\nAvatar used 30 times.\nButton used 182 times.\nColor used 2786 times.\nPill used 11 times.\n```\n\n### Options\n\n```\nUSAGE: star [--types \u003ctypes\u003e ...] [--module \u003cmodule\u003e] [--format \u003cformat\u003e] [--files \u003cfiles\u003e ...] [--includeTypeInheritance] [--verbose]\n\nOPTIONS:\n  -t, --types \u003ctypes\u003e     List of types on which to report\n  -m, --module \u003cmodule\u003e   Name of module containing types, to ensure types referenced by \u003cmodule name\u003e.\u003ctype name\u003e are counted\n  -f, --format \u003cformat\u003e   Output format (humanReadable|json) (default: humanReadable)\n  --files \u003cfiles\u003e         Paths in which to look for Swift source\n  --includeTypeInheritance\n                          Include subclass and protocol conformance declarations in usage counts\n  -v, --verbose           Print additional information about source as it is parsed\n  -h, --help              Show help information.\n```\n\n## How it Works\n\nSTAR uses [SwiftSyntax](https://github.com/apple/swift-syntax) to traverse the AST and find references to the specified identifiers.\nSince STAR operates on the untyped AST, usage reports may contain imperfect information when linking a reference to its identifier would require full type checking.\n\nThe reporter attempts to provide as useful information as possible, so some types of references are intentionally filtered out. For example, the line of code\n```\nlet foo: UIView = UIView()\n```\ntechnically includes two nodes in the AST for the `UIView` identifier: one in the type annotation, and one in the constructor call. For most business uses, though, it is preferable to only count this line as a single use of `UIView`. Therefore, type annotations are ignored by STAR.\n\nSome other examples of intentionally ignored references are code comments, class/struct/extension/etc. declarations, and inner classes within components (e.g., `MyComponent.SomeInnerClass` will match neither `MyComponent`, nor `SomeInnerClass`).\n\n## Uninstall\n\n```\n$ cd star\n$ make uninstall\n```\n\n## Importing into another Swift package\n\nIn addition to the command-line executable `star`, STAR's core functionality is also available through Swift Package Manager as the static library `STARLib`. To use `STARLib` in your Swift package, add the following to your Package.swift:\n```\nlet package = Package(\n    ...\n    dependencies: [\n        ...\n        .package(name: \"SwiftTypeAdoptionReporter\", url: \"https://github.com/thumbtack/star.git\", \u003cversion (e.g., `.upToNextMinor(from: \"3.0.0\")`)\u003e),\n    ],\n    targets: [\n        .target(\n            ...\n            dependencies: [\n                ...\n                .product(name: \"STARLib\", package: \"SwiftTypeAdoptionReporter\"),\n            ]\n        ),\n    ]\n)\n```\n\n## Contributing\n\nIf you have ideas to make STAR more useful, open an issue or submit a pull request! See below for instructions on building/testing locally.\n\n```\n$ git clone git@github.com/thumbtack/star.git\n$ cd star\n$ open -a Xcode .\n```\n\n### To build \u0026 run locally:\n```\n$ swift run star ...\n```\n\nPassing in the `--verbose` argument will print out additional information which can be useful for debugging.\n\n### To run test suite:\n\n#### From command line:\n```\n$ swift test\n```\n\n#### With Xcode:\n1. Create Xcode project:\n\n    ```\n    $ swift package generate-xcodeproj\n    ```\n2. Open `SwiftTypeAdoptionReporter.xcodeproj`\n3. In Xcode, **Product -\u003e Test**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthumbtack%2Fstar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthumbtack%2Fstar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthumbtack%2Fstar/lists"}