{"id":19294523,"url":"https://github.com/jessekelly881/effect-schema-compilers","last_synced_at":"2025-08-08T04:11:31.173Z","repository":{"id":169576232,"uuid":"645515250","full_name":"jessekelly881/effect-schema-compilers","owner":"jessekelly881","description":"Compilers for @effect/schema","archived":false,"fork":false,"pushed_at":"2024-10-14T07:16:37.000Z","size":978,"stargazers_count":20,"open_issues_count":5,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-30T13:45:17.249Z","etag":null,"topics":["effect-ts","fakerjs","schema","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/jessekelly881.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["jessekelly881"]}},"created_at":"2023-05-25T20:41:19.000Z","updated_at":"2025-07-07T19:50:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"f7e29d88-d374-4f10-9ccf-925874c818eb","html_url":"https://github.com/jessekelly881/effect-schema-compilers","commit_stats":{"total_commits":150,"total_committers":3,"mean_commits":50.0,"dds":"0.19333333333333336","last_synced_commit":"079fb093e461101a2ec1078494b970f8dd02109d"},"previous_names":["jessekelly881/effect-schema-compilers"],"tags_count":17,"template":false,"template_full_name":"jessekelly881/ts-lib","purl":"pkg:github/jessekelly881/effect-schema-compilers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jessekelly881%2Feffect-schema-compilers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jessekelly881%2Feffect-schema-compilers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jessekelly881%2Feffect-schema-compilers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jessekelly881%2Feffect-schema-compilers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jessekelly881","download_url":"https://codeload.github.com/jessekelly881/effect-schema-compilers/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jessekelly881%2Feffect-schema-compilers/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269361565,"owners_count":24404392,"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-08T02:00:09.200Z","response_time":72,"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":["effect-ts","fakerjs","schema","typescript"],"created_at":"2024-11-09T22:38:35.730Z","updated_at":"2025-08-08T04:11:31.133Z","avatar_url":"https://github.com/jessekelly881.png","language":"TypeScript","funding_links":["https://github.com/sponsors/jessekelly881"],"categories":[],"sub_categories":[],"readme":"# effect-schema-compilers\n\nCompilers for @effect/schema. Currently in **alpha**; although, the api is pretty simple and probably won't change too much. For a collection of types preconfigured to work with these types see [effect-types](https://github.com/jessekelly881/effect-types)\n\n[![Npm package monthly downloads](https://badgen.net/npm/dm/effect-schema-compilers)](https://npmjs.com/package/effect-schema-compilers)\n\n![img](code.png)\n\n## Current TODOs\n\n- Convert to monorepo to allow supporting multiple compilers without dep issues.\n- Create compiler for avro\n\n## Empty\n\nGenerate \"empty\" values from a Schema. Similar to [zod-empty](https://github.com/toiroakr/zod-empty) with a similar motivation.\n\n```ts\nimport * as E from \"effect-schema-compilers/dist/empty\";\n\nconst s = E.to(S.struct({ num: S.number, str: S.string }))(); // { num: 0, str: \"\" }\n```\n\nAlso supports setting the empty value for a schema. E.g.\n\n```ts\nimport * as E from \"effect-schema-compilers/dist/empty\";\nimport { pipe } from \"@effect/data/Function\";\n\nconst s = pipe(S.number, E.empty(() =\u003e 1), E.to()) // 1\n```\n\n## Semigroup\n\nGenerates a [Semigroup](https://effect-ts.github.io/data/modules/typeclass/Semigroup.ts.html) from the provided Schema. The default Semigroup.last is used which simply overrides the previous value.\n\n```ts\nimport * as S from \"@effect/schema/Schema\";\nimport * as _ from \"effect-schema-compilers/dist/semigroup\";\n\nconst schema = S.struct({ a: S.number, b: S.string });\nconst { combine } = _.to(schema)()\nexpect(combine({ a: 0, b: \"0\" }, { a: 1, b: \"1\" })).toEqual({ a: 1, b: \"1\" })\n```\n\nThe semigroup for a Schema can be set using the semigroup() fn. For example,\n\n```ts\nimport * as S from \"@effect/schema/Schema\";\nimport * as Semi from \"@effect/typeclass/Semigroup\"'\nimport * as _ from \"effect-schema-compilers/dist/semigroup\";\nimport { pipe } from \"@effect/data/Function\";\n\nconst schema = S.struct({ \n    a: pipe(S.number, _.semigroup(Semi.min(n.Order))), \n    b: pipe(S.string, _.semigroup(Semi.string)),\n    c: S.boolean\n});\n\nconst { combine } = _.to(schema)()\nexpect(combine({ a: 0, b: \"0\", c: true }, { a: 1, b: \"1\", c: false })).toEqual({ a: 0, b: \"01\", c: false })\n```\n\n## Fakerjs\n\nGenerates realistic objects from a Schema using [fakerjs](@fakerjs/faker).\n\n```ts\nimport * as F from '@faker-js/faker';\nimport * as S from \"@effect/schema/Schema\"\nimport { pipe } from \"@effect/data/Function\";\nimport * as _ from \"effect-schema-compilers/dist/faker\";\n\nconst Person = S.struct({\n    name: pipe(S.string, _.faker(f =\u003e f.person.fullName())),\n    age: pipe(S.number, S.int(), S.greaterThanOrEqualTo(18), S.lessThanOrEqualTo(120)),\n    sex: S.literal(\"male\", \"female\")\n});\n\nconst fakeData = _.to(Person)(F.faker) // { name: \"Seth Gottlieb\", age: 36, sex: \"male\" }\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjessekelly881%2Feffect-schema-compilers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjessekelly881%2Feffect-schema-compilers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjessekelly881%2Feffect-schema-compilers/lists"}