{"id":18684985,"url":"https://github.com/h1alexbel/fsl","last_synced_at":"2025-04-12T04:32:43.946Z","repository":{"id":256603404,"uuid":"855870326","full_name":"h1alexbel/fsl","owner":"h1alexbel","description":"FakeHub State Language. DSL for managing state in fakehub","archived":false,"fork":false,"pushed_at":"2025-03-15T14:47:45.000Z","size":547,"stargazers_count":4,"open_issues_count":3,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-26T00:11:13.355Z","etag":null,"topics":["fakehub","programming-language","testing","testing-fixtures","transpiler"],"latest_commit_sha":null,"homepage":"","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/h1alexbel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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}},"created_at":"2024-09-11T15:35:24.000Z","updated_at":"2024-11-15T07:39:46.000Z","dependencies_parsed_at":"2024-10-16T20:03:18.143Z","dependency_job_id":null,"html_url":"https://github.com/h1alexbel/fsl","commit_stats":null,"previous_names":["h1alexbel/fsl"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h1alexbel%2Ffsl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h1alexbel%2Ffsl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h1alexbel%2Ffsl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h1alexbel%2Ffsl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/h1alexbel","download_url":"https://codeload.github.com/h1alexbel/fsl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248517346,"owners_count":21117435,"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":["fakehub","programming-language","testing","testing-fixtures","transpiler"],"created_at":"2024-11-07T10:19:56.952Z","updated_at":"2025-04-12T04:32:38.935Z","avatar_url":"https://github.com/h1alexbel.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fsl. FakeHub State Language\n\n[![EO principles respected here](https://www.elegantobjects.org/badge.svg)](https://www.elegantobjects.org)\n[![DevOps By Rultor.com](http://www.rultor.com/b/h1alexbel/fsl)](http://www.rultor.com/p/h1alexbel/fsl)\n[![We recommend IntelliJ IDEA](https://www.elegantobjects.org/intellij-idea.svg)](https://www.jetbrains.com/idea/)\n\n[![just](https://github.com/h1alexbel/fsl/actions/workflows/just.yml/badge.svg)](https://github.com/h1alexbel/fsl/actions/workflows/just.yml)\n[![Crates.io Version](https://img.shields.io/crates/v/fsl)](https://crates.io/crates/fsl)\n[![codecov](https://codecov.io/github/h1alexbel/fsl/graph/badge.svg?token=GXcsA2ffuN)](https://codecov.io/github/h1alexbel/fsl)\n[![PDD status](http://www.0pdd.com/svg?name=h1alexbel/fsl)](http://www.0pdd.com/p?name=h1alexbel/fsl)\n[![Hits-of-Code](https://hitsofcode.com/github/h1alexbel/fsl)](https://hitsofcode.com/view/github/h1alexbel/fsl)\n[![License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/h1alexbel/fsl/blob/master/LICENSE.txt)\n[![Known Vulnerabilities](https://snyk.io/test/github/h1alexbel/fsl/badge.svg)](https://snyk.io/test/github/h1alexbel/fsl)\n\nFSL is a specific [DSL] for managing state inside [fakehub].\n\n**Motivation**. When working with [fakehub], automated testing tool that mocks\nGitHub REST API, we often require to setup initial state of the system with\ntesting data. Instead of repeating testing preparations, we developed\nFSL, a language that takes file as an input, processes it, and creates FakeHub\ninstance with desired data.\n\n## Quick Start\n\nFirst, install `fsl` from [crates][fsl-crates]:\n\n```bash\ncargo add fsl\n```\n\nThen, create `init.fsl`:\n\n```fsl\nme: @jeff\n\n+repo me/foo \u003e foo\n+repo me/bar\n+issue \"this is testing\" +label \"bug\" -\u003e foo\n```\n\nHere, we logged in as `@jeff` fake GitHub user, created two repositories:\n`jeff/foo`, `jeff/bar`, submitted new issue with title `\"this is testing\"` and\n`\"bug\"` label to `jeff/foo`.\n\nAnd then transpile it:\n\n```rust\nuse fsl::transpiler::fsl_transpiler::Fslt;\nuse std::path::Path;\n\nlet output = Fslt::file(Path::new(\"init.fsl\")).out();\n// output...\n```\n\nThis should transpile `init.fsl` to [fakehub-compatible][fakehub] output in\n[JSON] format.\n\n### Apply to fakehub\n\nTo apply it on fakehub, run (make sure you have [fakehub] installed):\n\n```bash\nfakehub start --include init.fsl -d\n```\n\nThen, pull newly created data:\n\n```bash\ncurl -L \\\n  -H \"Accept: application/vnd.github+json\" \\\n  -H \"Authorization: Bearer @jeff\" \\\n  -H \"X-GitHub-Api-Version: 2022-11-28\" \\\n  http://localhost:3000/repos/jeff/foo/issues/1\n```\n\nResponse should be:\n\n```json\n{\n  \"url\": \"http://localhost:3000/repos/jeff/foo/issues/1\",\n  \"repository_url\": \"http://localhost:3000/repos/jeff/foo\",\n  \"labels_url\": \"http://localhost:3000/repos/jeff/foo/issues/1/labels{/name}\",\n  ...\n}\n```\n\n## How to contribute?\n\nMake sure that you have [Rust] and [just] installed on your system, then fork\nthis repository, make changes, send us a [pull request][guidelines]. We will\nreview your changes and apply them to the `master` branch shortly, provided\nthey don't violate our quality standards. To avoid frustration, before sending\nus your pull request please run full build:\n\n```bash\njust full\n```\n\n[fakehub]: https://github.com/h1alexbel/fakehub\n[DSL]: https://en.wikipedia.org/wiki/Domain-specific_language\n[guidelines]: https://www.yegor256.com/2014/04/15/github-guidelines.html\n[Rust]: https://www.rust-lang.org/tools/install\n[just]: https://just.systems/man/en/chapter_4.html\n[fsl-crates]: https://crates.io/crates/fsl\n[JSON]: https://en.wikipedia.org/wiki/JSON\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fh1alexbel%2Ffsl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fh1alexbel%2Ffsl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fh1alexbel%2Ffsl/lists"}