{"id":50866125,"url":"https://github.com/astzweig/swiftpm-embedder","last_synced_at":"2026-06-15T01:07:12.270Z","repository":{"id":351896519,"uuid":"1212965813","full_name":"astzweig/swiftpm-embedder","owner":"astzweig","description":"Inline static files in Swift binaries","archived":false,"fork":false,"pushed_at":"2026-04-16T23:14:29.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-17T01:21:11.143Z","etag":null,"topics":["static-files","swift","swift-package-manager-plugin"],"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/astzweig.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-16T23:04:29.000Z","updated_at":"2026-04-16T23:14:31.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/astzweig/swiftpm-embedder","commit_stats":null,"previous_names":["astzweig/swiftpm-embedder"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/astzweig/swiftpm-embedder","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astzweig%2Fswiftpm-embedder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astzweig%2Fswiftpm-embedder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astzweig%2Fswiftpm-embedder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astzweig%2Fswiftpm-embedder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/astzweig","download_url":"https://codeload.github.com/astzweig/swiftpm-embedder/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astzweig%2Fswiftpm-embedder/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34343378,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-14T02:00:07.365Z","response_time":62,"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":["static-files","swift","swift-package-manager-plugin"],"created_at":"2026-06-15T01:07:11.455Z","updated_at":"2026-06-15T01:07:12.263Z","avatar_url":"https://github.com/astzweig.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Embedder\n\nA Swift Package Manager build-tool plugin that compiles every textual file in a\ntarget's `Static Inline` subdirectory into a generated `Embedded` enum with\n`static let` properties for each file.\n\nThe generated code embeds file contents as raw string literals at build time;\nno bundle or runtime I/O is involved.\n\n## Usage\n\n1. Add this package as a dependency:\n\n   ```swift\n   .package(url: \"https://github.com/astzweig/swiftpm-embedder\", from: \"1.0.0\")\n   ```\n\n2. Apply the plugin to your target and exclude the `Static Inline` directory\n   from the target's own source scan:\n\n   ```swift\n   .target(\n       name: \"MyApp\",\n       exclude: [\"Static Inline\"],\n       plugins: [\n           .plugin(name: \"Embedder\", package: \"swiftpm-embedder\")\n       ]\n   )\n   ```\n\n3. Place your text assets under `Sources/\u003cTarget\u003e/Static Inline/`:\n\n   ```\n   Sources/\u003cTarget\u003e/\n       MyApp.swift\n       Static Inline/\n           config.json\n           emails/\n               welcome.html\n               receipt.eml\n   ```\n\n4. Reference the generated constants from your code:\n\n   ```swift\n   let welcomeBody: String = Embedded.Emails.welcomeHtml\n   let config: String = Embedded.configJson\n   ```\n\n## Generated shape\n\nGiven the tree above, the plugin produces:\n\n```swift\nenum Embedded {\n    static let configJson: String = #\"\"\"\n    {\"appName\": \"Sample\"}\n    \"\"\"#\n\n    enum Emails {\n        static let receiptEml: String = #\"\"\"\n        Subject: Your receipt\n        \"\"\"#\n\n        static let welcomeHtml: String = #\"\"\"\n        \u003c!doctype html\u003e\n        ...\n        \"\"\"#\n    }\n}\n```\n\nSubdirectories become nested enums with `UpperCamelCase` names; files become\n`lowerCamelCase` `static let` properties. Filenames that start with a digit or\ncollide with Swift reserved words are escaped automatically.\n\n## Allowed extensions\n\nThe plugin only embeds files whose extension is in a curated textual allow-list\n(`json`, `yaml`, `yml`, `html`, `htm`, `eml`, `txt`, `md`, `markdown`, `xml`,\n`csv`, `tsv`, `svg`, `css`, `js`, `mjs`, `sql`, `graphql`, `gql`, `toml`, `ini`,\n`log`, `plist`, `jsonl`). Other files are ignored, so dropping an image or a\nfont into `Static Inline` is harmless.\n\n## Requirements\n\n- `swift-tools-version: 6.1` or newer\n- macOS 13+, iOS 16+, tvOS 16+, or watchOS 9+ for packages that consume the\n  plugin\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastzweig%2Fswiftpm-embedder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fastzweig%2Fswiftpm-embedder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastzweig%2Fswiftpm-embedder/lists"}