{"id":22517580,"url":"https://github.com/lockieluke/swift-precompiler","last_synced_at":"2025-08-03T18:31:48.947Z","repository":{"id":216870725,"uuid":"742644891","full_name":"lockieluke/swift-precompiler","owner":"lockieluke","description":"🚀 A precompiler for Swift that allows you to use additional macros, include files, and more.","archived":false,"fork":false,"pushed_at":"2025-06-03T22:00:30.000Z","size":62,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-27T15:53:36.103Z","etag":null,"topics":["macros","precompiler","rust","swift"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/swift-precompiler","language":"Rust","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/lockieluke.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,"zenodo":null},"funding":{"github":"ciderapp","ko_fi":"cryptofyre","open_collective":"ciderapp","custom":"https://opencollective.com/ciderapp/donate/10/month/Support%20Development?redirect=https://cidercollective.dev/thanks"}},"created_at":"2024-01-13T00:12:57.000Z","updated_at":"2025-06-03T22:00:31.000Z","dependencies_parsed_at":"2024-01-13T10:43:14.476Z","dependency_job_id":"53a0ff35-53b3-4c34-b726-10ed66376384","html_url":"https://github.com/lockieluke/swift-precompiler","commit_stats":null,"previous_names":["ciderapp/swift-precompiler","lockieluke/swift-precompiler"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/lockieluke/swift-precompiler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lockieluke%2Fswift-precompiler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lockieluke%2Fswift-precompiler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lockieluke%2Fswift-precompiler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lockieluke%2Fswift-precompiler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lockieluke","download_url":"https://codeload.github.com/lockieluke/swift-precompiler/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lockieluke%2Fswift-precompiler/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268594133,"owners_count":24275733,"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-08-03T02:00:12.545Z","response_time":2577,"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":["macros","precompiler","rust","swift"],"created_at":"2024-12-07T04:09:53.007Z","updated_at":"2025-08-03T18:31:48.939Z","avatar_url":"https://github.com/lockieluke.png","language":"Rust","funding_links":["https://github.com/sponsors/ciderapp","https://ko-fi.com/cryptofyre","https://opencollective.com/ciderapp","https://opencollective.com/ciderapp/donate/10/month/Support%20Development?redirect=https://cidercollective.dev/thanks"],"categories":[],"sub_categories":[],"readme":"# Swift Precompiler\n\n⚡ A fast, lightweight precompiler for Swift\n\n### Features\n\n- Add Rust's `includeStr!` like functionality to Swift with the `precompileIncludeStr` function\n\n### Installation\n\nCargo:\n```shell\ncargo install swift-precompiler\n```\n\n### Configuration\n\nRun `swift-precompiler init` to initialise a config file `swift-precompiled.toml` with the default values\n\nAvailable options:\n- `dirs` - An array of directories to search for Swift source files that require precompilation\n- `path_aliases` - A dictionary of path aliases to use in precompile calls\n\nExample:\n```toml\ndirs = [\"Cider/\", \"CiderPlaybackAgent/\"]\n\n[path_aliases]\n# \"@\" as a path alias refers to the current working directory in most cases\n\"@\" = \"./\"\n```\n\n### Usage\n\n\u003e [!IMPORTANT]  \n\u003e Disable **User Script Sandboxing** before making a build phase for precompilation\n\u003e \u003cimg width=\"449\" alt=\"image\" src=\"https://github.com/user-attachments/assets/344ec7a6-3343-4a88-b596-6c524e931aa8\" /\u003e\n\nIncluding a file as a string literal at compile time:\n```swift\nlet javaScript = precompileIncludeStr(\"path/to/file.js\")\n```\n\nInclude a file as a Data at compile time:\n```swift\nlet image = precompileIncludeData(\"path/to/image.png\")\n```\n\nRun `swift-precompiler` to precompile all Swift files in the directories specified in the config file\n```shell\nswift-precompiler precompile\n```\n\nXcode build phase:\n```shell\n$HOME/.cargo/bin/swift-precompiler precompile --xcode-script-renderer --config $SRCROOT/swift-precompiled.toml\n```\n\n\u003csub\u003eYou should add `Precompiled.swift` to your `.gitignore`\u003c/sub\u003e\n\nSwift Precompiler encodes your strings with Base64, you can add [swift-extras-base64](https://github.com/swift-extras/swift-extras-base64) to your project using SPM to enable faster Base64 decode.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flockieluke%2Fswift-precompiler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flockieluke%2Fswift-precompiler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flockieluke%2Fswift-precompiler/lists"}