{"id":20690507,"url":"https://github.com/octree/yep","last_synced_at":"2025-09-05T03:34:10.097Z","repository":{"id":45278556,"uuid":"195239485","full_name":"octree/Yep","owner":"octree","description":"根据 Assets/.strings 文件，自动生成 Swift 代码","archived":false,"fork":false,"pushed_at":"2023-08-28T05:15:40.000Z","size":49,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-01T14:48:52.467Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/octree.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,"zenodo":null}},"created_at":"2019-07-04T12:41:42.000Z","updated_at":"2023-09-07T10:07:22.000Z","dependencies_parsed_at":"2025-04-22T16:58:04.000Z","dependency_job_id":"918dc8c9-a2b8-439a-b63c-b6d48d8fb247","html_url":"https://github.com/octree/Yep","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/octree/Yep","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octree%2FYep","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octree%2FYep/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octree%2FYep/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octree%2FYep/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/octree","download_url":"https://codeload.github.com/octree/Yep/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octree%2FYep/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273707377,"owners_count":25153724,"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-05T02:00:09.113Z","response_time":402,"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":[],"created_at":"2024-11-16T23:13:27.999Z","updated_at":"2025-09-05T03:34:05.065Z","avatar_url":"https://github.com/octree.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Yep\n\n\n\n根据 XCAssets 内容，自动生成 Swift 代码。\n\n- [x] 根据 `Assets` 生成 Images 代码\n- [x] 根据 `Assets` 生成 Colors 代码\n- [x] 根据 `.strings` 生成 i18n 代码\n\n## 自动生成的代码示例\n\n```swift\n//\n//  I18n\n//\n//  ⚠️ DO NOT EDIT.\n//  Code generated by Yep(https://github.com/octree/Yep) on 2019/7/5.\n//  Copyright © 2019 Octree. All rights reserved.\n//\n\nimport UIKit\n\n\nstruct I18n {\n    /// \"删除\"\n    @inline(__always) static var delete: String {\n        return NSLocalizedString(\"delete\", comment: \"\")\n    }\n\n    /// \"置顶\"\n    @inline(__always) static var pin: String {\n        return NSLocalizedString(\"pin\", comment: \"\")\n    }\n}\n\n```\n\n### Assets 支持 Namespace\n\n```swift\n//\n//  Images\n//\n//  ⚠️ DO NOT EDIT.\n//  Code generated by Yep(https://github.com/octree/Yep) on 2019/7/5.\n//  Copyright © 2019 Octree. All rights reserved.\n//\n\nimport SwiftUI\n\n// MARK: - ImageRes\nextension Image {\n    public enum Assets {\n        public enum CalendarUI {\n            public static var chevronLeft: Image {\n                return Image(\"CalendarUI/chevronLeft\", bundle: .module)\n            }\n        }\n    }\n}\n```\n\n\n## Usage\n\n在工程目录创建 `.yep.json` 文件\n\n\n\n```json\n{\n    \"assetPath\": \"./Sources/Assets/Resources/Media.xcassets\",\n    \"uiColorDestination\": \"./Sources/Assets/Generated/UIColor.Generated.swift\",\n    \"uiImageDestination\": \"./Sources/Assets/Generated/UIImage.Generated.swift\",\n    \"swiftUIColorDestination\": \"./Sources/Assets/Generated/Color.Generated.swift\",\n    \"swiftUIImageDestination\": \"./Sources/Assets/Generated/Image.Generated.swift\",\n    \"i18nStringsPath\": \"./Sources/Assets/Resources/en.lproj/Localizable.strings\",\n    \"i18nDestination\": \"./Sources/Assets/Generated/I18n.swift\",\n    \"isSPM\": true\n}\n```\n\n\n\n然后在工程目录执行命令即可\n\n```shell\n# just works\nyep\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foctree%2Fyep","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foctree%2Fyep","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foctree%2Fyep/lists"}