{"id":49751651,"url":"https://github.com/folk-project/folk-builder","last_synced_at":"2026-05-13T12:00:36.817Z","repository":{"id":356706867,"uuid":"1232815121","full_name":"Folk-Project/folk-builder","owner":"Folk-Project","description":"Custom binary builder for Folk — generates and compiles a Folk binary with selected plugins from folk.build.toml","archived":false,"fork":false,"pushed_at":"2026-05-09T11:19:59.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"develop","last_synced_at":"2026-05-09T11:39:09.449Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","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/Folk-Project.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-05-08T09:51:45.000Z","updated_at":"2026-05-09T11:20:03.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/Folk-Project/folk-builder","commit_stats":null,"previous_names":["folk-project/folk-builder"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Folk-Project/folk-builder","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Folk-Project%2Ffolk-builder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Folk-Project%2Ffolk-builder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Folk-Project%2Ffolk-builder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Folk-Project%2Ffolk-builder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Folk-Project","download_url":"https://codeload.github.com/Folk-Project/folk-builder/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Folk-Project%2Ffolk-builder/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32981543,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T11:31:52.688Z","status":"ssl_error","status_checked_at":"2026-05-13T11:31:52.072Z","response_time":115,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":"2026-05-10T11:16:35.362Z","updated_at":"2026-05-13T12:00:36.812Z","avatar_url":"https://github.com/Folk-Project.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# folk-builder\n\nCustom binary builder for Folk — generates and compiles a Folk server binary with your selected plugins.\n\n\u003e **Status:** in active development. See [folk-spec](https://github.com/Folk-Project/folk-spec) for the roadmap.\n\n## Requirements\n\n- Rust 1.85+ (with `cargo`)\n- A `folk.build.toml` file\n\n## Installation\n\n```bash\ncargo install --git https://github.com/Folk-Project/folk-builder\n```\n\n## Quick start\n\n1. Create `folk.build.toml`:\n\n```toml\n[build]\noutput = \"my-folk\"\n\n[[plugin]]\ncrate_name = \"folk-plugin-http\"\nversion = \"0.1\"\nconfig_key = \"http\"\n\n[[plugin]]\ncrate_name = \"folk-plugin-metrics\"\nversion = \"0.1\"\nconfig_key = \"metrics\"\n\n[[plugin]]\ncrate_name = \"folk-plugin-jobs\"\nversion = \"0.1\"\nconfig_key = \"jobs\"\n```\n\n2. Build:\n\n```bash\nfolk-builder build\n```\n\nOutput:\n\n```\nINFO reading folk.build.toml\nINFO generating Cargo.toml with 3 plugins\nINFO generating main.rs\nINFO running cargo build --release\n   Compiling folk_plugin_http v0.1.0\n   Compiling folk_plugin_metrics v0.1.0\n   Compiling folk_plugin_jobs v0.1.0\n   Compiling my-folk v0.1.0\n    Finished release [optimized] target(s)\nINFO copied binary to ./my-folk\n```\n\n3. Run the binary:\n\n```bash\n./my-folk serve --config folk.toml\n```\n\n## Configuration\n\n### `folk.build.toml` format\n\n#### `[build]`\n\n| Key | Type | Default | Description |\n|-----|------|---------|-------------|\n| `output` | `String` | (required) | Name of the generated binary. |\n| `rust_version` | `String` | `\"1.85\"` | Rust edition/version for the generated crate. |\n\n#### `[[plugin]]` (repeatable)\n\n| Key | Type | Default | Description |\n|-----|------|---------|-------------|\n| `crate_name` | `String` | (required) | Rust crate name of the plugin. |\n| `version` | `String` | — | Version constraint (for crates.io). |\n| `path` | `String` | — | Local filesystem path (overrides version). |\n| `git` | `String` | — | Git repository URL (overrides version). |\n| `config_key` | `String` | same as `crate_name` | TOML key in `folk.toml` for this plugin's config. |\n\n### CLI\n\n```\nfolk-builder build [OPTIONS]\n\nOptions:\n  --config \u003cCONFIG\u003e        Path to build config [default: folk.build.toml]\n  --output-dir \u003cDIR\u003e       Directory for the compiled binary [default: .]\n```\n\n## How it works\n\nThe builder generates a temporary Rust project, compiles it, and copies the resulting binary to your output directory.\n\n**What gets compiled in:**\n\n- `folk-core` — server core, worker pool, plugin registry\n- `folk-api` — plugin contract\n- `folk-runtime-pipe` — default pipe-based worker runtime\n- Every plugin listed in `[[plugin]]` sections\n- All transitive dependencies\n\n**What stays external (required at runtime):**\n\n- `folk.toml` — server configuration file\n- PHP binary and worker script\n- Any files your PHP application needs\n\n### Generated code\n\nThe builder produces two files in a temp directory:\n\n1. **`Cargo.toml`** — Lists folk-core, folk-api, the pipe runtime, and all plugin crates as dependencies.\n2. **`main.rs`** — A tokio async entry point that:\n   - Loads `FolkConfig` from `folk.toml`\n   - Creates the worker runtime\n   - Calls `folk_plugin_factory()` on each plugin crate\n   - Passes each plugin its config section (looked up by `config_key`)\n   - Starts the server\n\nEach plugin must export a `folk_plugin_factory()` function — this is the single required entry point that the builder calls by name.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffolk-project%2Ffolk-builder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffolk-project%2Ffolk-builder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffolk-project%2Ffolk-builder/lists"}