{"id":25815309,"url":"https://github.com/durban/seals","last_synced_at":"2025-02-28T04:19:48.058Z","repository":{"id":54253869,"uuid":"67359800","full_name":"durban/seals","owner":"durban","description":"Tools for schema evolution and language-integrated schemata","archived":false,"fork":false,"pushed_at":"2021-03-01T12:01:07.000Z","size":914,"stargazers_count":64,"open_issues_count":15,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-07-07T21:41:10.190Z","etag":null,"topics":["generic-derivation","generic-programming","scala","schema","schema-evolution","serialization"],"latest_commit_sha":null,"homepage":null,"language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/durban.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-09-04T17:50:28.000Z","updated_at":"2023-03-16T23:34:35.000Z","dependencies_parsed_at":"2022-08-13T10:10:20.280Z","dependency_job_id":null,"html_url":"https://github.com/durban/seals","commit_stats":null,"previous_names":[],"tags_count":16,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/durban%2Fseals","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/durban%2Fseals/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/durban%2Fseals/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/durban%2Fseals/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/durban","download_url":"https://codeload.github.com/durban/seals/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241100315,"owners_count":19909692,"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":["generic-derivation","generic-programming","scala","schema","schema-evolution","serialization"],"created_at":"2025-02-28T04:19:47.499Z","updated_at":"2025-02-28T04:19:48.049Z","avatar_url":"https://github.com/durban.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!--\n\n   Copyright 2016-2020 Daniel Urban and contributors listed in AUTHORS\n   Copyright 2020 Nokia\n   SPDX-License-Identifier: Apache-2.0\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n\n---\u003e\n\n# seals\n\n[![Latest version](https://index.scala-lang.org/durban/seals/seals-core/latest.svg)](\nhttps://index.scala-lang.org/durban/seals/seals-core)\n\n[*seals*](https://github.com/durban/seals) is an experimental project\nby [Daniel Urban](https://github.com/durban), which provides tools for\n**s**chema **e**volution **a**nd **l**anguage-integrated **s**chemata.\n\nBy using it, you will be able to\n\n- define schemata by creating ordinary Scala datatypes;\n- check the compatibility of different versions of a schema\n  at compile time, as well as runtime;\n- automatically derive serializers and deserializers for your\n  schema-datatypes (currently only [circe] and [scodec] encoders\n  and decoders are implemented);\n- and communicate between components using different (but compatible)\n  versions of a schema.\n\nSince it's a fairly new project, not all of these features are\nimplemented yet. Bugs are to be expected as well.\n[Contributions](CONTRIBUTING.md) to improve the project, and reports about\n[issues](https://github.com/durban/seals/issues) you encounter are welcome.\n\n## Getting started\n\n*seals* is currently available for Scala 2.12 and 2.13. JARs are available\non [Maven Central](https://search.maven.org/search?q=g:dev.tauri%20seals).\nTo use it, put this into your `build.sbt` (see [below](#project-structure)\nfor the available modules):\n\n```scala\nlibraryDependencies += \"dev.tauri\" %% \"seals-core\" % \"0.4.0-RC2\"\n```\n\nAll releases (and commits on the `master` branch) are signed by key\n`36A8 2002 483A 4CBF A5F8 DF6F 48B2 9573 BF19 7B13`.\n\n## Features\n\n### Defining schemata\n\nBy using `seals-core`, you can define a schema simply by creating an ADT:\n\n```scala mdoc:silent\nfinal case class User(id: Int, name: String)\n```\n\nAn abstract representation of this schema can be retrieved by requesting\nan instance of the `Reified` type class.\n\n```scala mdoc\nimport dev.tauri.seals.Reified\nReified[User]\n```\n\nThis abstract representation is used to implement the following features.\n(End users usually don't have to work with `Reified` directly.)\n\n### Compile-time compatibility checking\n\nIn the next version of the schema defined above, you may want to add a new field\n(with a default value):\n\n```scala mdoc:silent\nfinal case class UserV2(id: Int, name: String, age: Int = 42)\n```\n\nThanks to the default value, these two versions are compatible with\neach other. We can assert this by using the `Compat` type class:\n\n```scala mdoc\nimport dev.tauri.seals.Compat\nCompat[User, UserV2]\n```\n\nIf they wouldn't be compatible, we would get a *compile time* error\n(because there would be no `Compat` instance available). For example,\nif we define a new schema like this:\n\n```scala mdoc:silent\nfinal case class UserV3(id: Int, name: String, age: Int) // no default `age`\n```\n\nThen there will be no `Compat` instance available, since the schemata\nare not compatible:\n\n```scala mdoc:fail\nCompat[User, UserV3] // error: could not find implicit value for ...\n```\n\nFor a more detailed introduction to the `Compat` type class,\nsee [this example](core/src/main/tut/Compat.md).\n\n### Build-time compatibility checking\n\nBy using the `seals-plugin` module (which is an sbt plugin), we can\ncheck in our build whether our current schemata are compatible with\npreviously released versions. (Similarly to how [MiMa] checks binary\ncompatibility with previous versions.) For how to do this, see\n[this example](plugin/src/sbt-test/seals-plugin/example). The plugin\nis available for sbt 1.x.\n\n### Other features\n\nIf you are interested in other features (like automatic derivation of\nserializers, or runtime compatibility checking), at the moment\nthe best way is to look at the [examples](examples) or directly\nat the sources (and Scaladoc comments, and laws/tests).\n\n## Project structure\n\nThe subprojects are as follows:\n\n- [`core`](core): essential type classes (required)\n- [`circe`](circe): automatic derivation of [circe]\n  encoders and decoders (optional)\n- [`scodec`](scodec): automatic derivation of [scodec]\n  codecs, encoders and decoders (optional)\n- [`refined`](refined): support for [refined] types\n- [`plugin`](plugin): sbt plugin for build-time compatibility\n  checking of schema definitions (basically [MiMa] for schemata)\n- [`checker`](checker): the schema checker used by the sbt plugin\n- [`macros`](macros): a few macros used internally by `core`\n- [`laws`](laws): definitions of laws for the type classes in `core` (incomplete, for testing)\n- [`tests`](tests): unittests (don't depend on this)\n- [`examples`](examples): a few examples for using the library\n\n## Dependencies\n\n*seals* depends on the following projects:\n\n- [shapeless](https://github.com/milessabin/shapeless) provides\n  the macros and type classes to automatically derive schemata\n  and other type class instances for ADTs.\n- [Cats](https://github.com/typelevel/cats) provides general\n  functional programming tools which complement the Scala standard library.\n- [scodec-bits](https://github.com/scodec/scodec-bits) provides an\n  immutable `ByteVector` datatype.\n- [MiMa] provides some utilities for working with artifacts in `seals-plugin`.\n\nCurrently there are interop modules for the following projects:\n\n- [circe] provides the JSON framework for which `seals` derives encoders and decoders.\n- [scodec] provides a binary encoding/serialization framework for which `seals` derives codecs.\n  - [FS2](https://github.com/functional-streams-for-scala/fs2) enables streaming encoding\n    and decoding of data with scodec.\n- [refined] provides refinement types, some of which are supported by `seals`.\n\nFor testing, it also uses:\n\n- [ScalaTest](https://github.com/scalatest/scalatest) for the unittests,\n- [ScalaCheck](https://github.com/rickynils/scalacheck) for automated\n  property-based testing,\n- and [scalacheck-shapeless](https://github.com/alexarchambault/scalacheck-shapeless)\n  to generate pseudorandom ADT instances.\n\n## License\n\n*seals* is open source software under the [Apache License v2.0](https://www.apache.org/licenses/LICENSE-2.0).\nFor details, see the [LICENSE.txt](LICENSE.txt), [NOTICE.txt](NOTICE.txt), and [AUTHORS](AUTHORS) files.\n\n[circe]: https://github.com/circe/circe\n[scodec]: https://github.com/scodec/scodec\n[refined]: https://github.com/fthomas/refined\n[MiMa]: https://github.com/typesafehub/migration-manager\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdurban%2Fseals","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdurban%2Fseals","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdurban%2Fseals/lists"}