From f4ec39016186040cf7ad920f99dbc0d4a3ec6031 Mon Sep 17 00:00:00 2001 From: Avinder Bahra Date: Sun, 15 Jan 2023 09:59:32 +0000 Subject: [PATCH] porting documentation changes from series/1.x to series/2.x (#142) --- .github/workflows/ci.yml | 27 +- .github/workflows/site.yml | 73 +++++ .gitignore | 1 + README.md | 82 +++--- build.sbt | 21 +- docs/about/code_of_conduct.md | 45 --- docs/about/contributing.md | 274 ------------------ docs/about/index.md | 6 - ...ustomisation.md => codec-customization.md} | 5 + docs/getting-started.md | 50 ++++ docs/index.md | 66 +++++ docs/overview/index.md | 6 - docs/package.json | 5 + docs/sidebars.js | 17 ++ docs/transactions.md | 62 ++++ docs/usecases/index.md | 7 - project/plugins.sbt | 20 +- website/core/Footer.js | 67 ----- website/package.json | 15 - website/pages/en/index.js | 180 ------------ website/sidebars.json | 25 -- website/siteConfig.js | 118 -------- website/static/css/custom.css | 41 --- website/static/img/discord.png | Bin 4131 -> 0 bytes website/static/img/favicon.png | Bin 657 -> 0 bytes website/static/img/navbar_brand.png | Bin 13615 -> 0 bytes website/static/img/navbar_brand2x.png | Bin 16064 -> 0 bytes website/static/img/sidebar_brand.png | Bin 12777 -> 0 bytes website/static/img/sidebar_brand2x.png | Bin 17424 -> 0 bytes website/static/img/undraw_code_review.svg | 1 - website/static/img/undraw_online.svg | 0 website/static/img/undraw_open_source.svg | 1 - .../static/img/undraw_operating_system.svg | 1 - website/static/img/undraw_tweetstorm.svg | 1 - 34 files changed, 363 insertions(+), 854 deletions(-) create mode 100644 .github/workflows/site.yml delete mode 100644 docs/about/code_of_conduct.md delete mode 100644 docs/about/contributing.md delete mode 100644 docs/about/index.md rename docs/{usecases/codec-customisation.md => codec-customization.md} (98%) create mode 100644 docs/getting-started.md create mode 100644 docs/index.md delete mode 100644 docs/overview/index.md create mode 100644 docs/package.json create mode 100644 docs/sidebars.js create mode 100644 docs/transactions.md delete mode 100644 docs/usecases/index.md delete mode 100755 website/core/Footer.js delete mode 100644 website/package.json delete mode 100755 website/pages/en/index.js delete mode 100755 website/sidebars.json delete mode 100644 website/siteConfig.js delete mode 100755 website/static/css/custom.css delete mode 100644 website/static/img/discord.png delete mode 100755 website/static/img/favicon.png delete mode 100644 website/static/img/navbar_brand.png delete mode 100644 website/static/img/navbar_brand2x.png delete mode 100644 website/static/img/sidebar_brand.png delete mode 100644 website/static/img/sidebar_brand2x.png delete mode 100755 website/static/img/undraw_code_review.svg delete mode 100755 website/static/img/undraw_online.svg delete mode 100755 website/static/img/undraw_open_source.svg delete mode 100755 website/static/img/undraw_operating_system.svg delete mode 100755 website/static/img/undraw_tweetstorm.svg diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 527f6c406..8e78531d0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,7 +3,7 @@ name: CI on: pull_request: push: - branches: ['master', 'zio2'] + branches: ['series/2.x'] release: types: - published @@ -46,10 +46,33 @@ jobs: - name: Run integration tests run: sbt -J-XX:+UseG1GC -J-Xmx6g -J-Xms6g -J-Xss16m ++${{ matrix.scala }}! it:test + mdoc: + runs-on: ubuntu-20.04 + timeout-minutes: 30 + if: github.event_name != 'pull_request' + steps: + - name: Checkout current branch + uses: actions/checkout@v2.4.0 + - name: Setup Scala and Java + uses: olafurpg/setup-scala@v13 + - name: Setup GPG + uses: olafurpg/setup-gpg@v3 + - name: Cache scala dependencies + uses: coursier/cache-action@v6 + - name: Check Document Generation + run: ./sbt docs/compileDocs + + ci: + runs-on: ubuntu-20.04 + needs: [build, lint, mdoc] + steps: + - name: Report successful build + run: echo "ci passed" + publish: runs-on: ubuntu-20.04 timeout-minutes: 30 - needs: [build,lint] + needs: [ci] if: github.event_name != 'pull_request' steps: - uses: actions/checkout@v2.3.4 diff --git a/.github/workflows/site.yml b/.github/workflows/site.yml new file mode 100644 index 000000000..03de4a6e5 --- /dev/null +++ b/.github/workflows/site.yml @@ -0,0 +1,73 @@ +# This file was autogenerated using `zio-sbt-website` via `sbt generateGithubWorkflow` +# task and should be included in the git repository. Please do not edit it manually. + +name: Website +'on': + workflow_dispatch: {} + release: + types: + - published + push: + branches: + - series/2.x +jobs: + publish-docs: + name: Publish Docs + runs-on: ubuntu-latest + if: ${{ ((github.event_name == 'release') && (github.event.action == 'published')) || (github.event_name == 'workflow_dispatch') }} + steps: + - name: Git Checkout + uses: actions/checkout@v3.1.0 + with: + fetch-depth: '0' + - name: Setup Scala + uses: actions/setup-java@v3.6.0 + with: + distribution: temurin + java-version: 17 + check-latest: true + - name: Setup NodeJs + uses: actions/setup-node@v3 + with: + node-version: 16.x + registry-url: https://registry.npmjs.org + - name: Publish Docs to NPM Registry + run: sbt docs/publishToNpm + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + generate-readme: + name: Generate README + runs-on: ubuntu-latest + steps: + - name: Git Checkout + uses: actions/checkout@v3.1.0 + with: + ref: ${{ github.head_ref }} + fetch-depth: '0' + - name: Setup Scala + uses: actions/setup-java@v3.6.0 + with: + distribution: temurin + java-version: 17 + check-latest: true + - name: Generate Readme + run: sbt docs/generateReadme + - name: Commit Changes + run: | + git config --local user.email "github-actions[bot]@users.noreply.github.com" + git config --local user.name "github-actions[bot]" + git add README.md + git commit -m "Update README.md" || echo "No changes to commit" + - name: Create Pull Request + uses: peter-evans/create-pull-request@v4 + with: + title: Update README.md + commit-message: Update README.md + branch: zio-sbt-website/update-readme + body: | + Autogenerated changes after running the `sbt docs/generateReadme` command of the [zio-sbt-website](https://zio.dev/zio-sbt) plugin. + + I will automatically update the README.md file whenever there is new change for README.md, e.g. + - After each release, I will update the version in the installation section. + - After any changes to the "docs/index.md" file, I will update the README.md file accordingly. + diff --git a/.gitignore b/.gitignore index 95e567426..33f7015b2 100644 --- a/.gitignore +++ b/.gitignore @@ -477,3 +477,4 @@ shell.nix # direnv .envrc .direnv +/.vscode/ diff --git a/README.md b/README.md index 1af25e2fc..40794033b 100644 --- a/README.md +++ b/README.md @@ -1,32 +1,36 @@ -# zio-dynamodb +[//]: # (This file was autogenerated using `zio-sbt-website` plugin via `sbt generateReadme` command.) +[//]: # (So please do not edit it manually. Instead, change "docs/index.md" file or sbt setting keys) +[//]: # (e.g. "readmeDocumentation" and "readmeSupport".) -| Project Stage | CI | Release | Snapshot | Discord | -| --- | --- | --- | --- | --- | -| [![Project stage][Stage]][Stage-Page] | ![CI][Badge-CI] | [![Release Artifacts][Badge-SonatypeReleases]][Link-SonatypeReleases] | [![Snapshot Artifacts][Badge-SonatypeSnapshots]][Link-SonatypeSnapshots] | [![Badge-Discord]][Link-Discord] | +# ZIO DynamoDB -# Summary Simple, type-safe, and efficient access to DynamoDB -# Documentation +|Project Stage | CI | Release | Snapshot | Discord | Github | +|--------------|----|---------|----------|---------|--------| +|[![Experimental](https://img.shields.io/badge/Project%20Stage-Experimental-yellowgreen.svg)](https://github.com/zio/zio/wiki/Project-Stages) |![CI Badge](https://github.com/zio/zio-dynamodb/workflows/CI/badge.svg) |[![Sonatype Releases](https://img.shields.io/nexus/r/https/oss.sonatype.org/dev.zio/zio-dynamodb_2.12.svg)](https://oss.sonatype.org/content/repositories/releases/dev/zio/zio-dynamodb_2.12/) |[![Sonatype Snapshots](https://img.shields.io/nexus/s/https/oss.sonatype.org/dev.zio/zio-dynamodb_2.12.svg)](https://oss.sonatype.org/content/repositories/snapshots/dev/zio/zio-dynamodb_2.12/) |[![Chat on Discord!](https://img.shields.io/discord/629491597070827530?logo=discord)](https://discord.gg/2ccFBr4) |[![ZIO DynamoDB](https://img.shields.io/github/stars/zio/zio-dynamodb?style=social)](https://github.com/zio/zio-dynamodb) | -### Getting Started +## Introduction -```sbt -// only snapshots are published at the moment -resolvers += Resolver.sonatypeRepo("snapshots") +ZIO DynamoDB is a library that is used for type-safe, efficient, and boilerplate free access to AWS's DynamoDB service. It provides a type-safe API for many query types and the number of type-safe APIs is expanding. ZIO DynamoDB will automatically batch queries and execute unbatchable queries in parallel. -// add zio-dynamodb to your dependencies - lookup the latest snapshot version here https://oss.sonatype.org/content/repositories/snapshots/dev/zio/zio-dynamodb_2.13/ +Under the hood we use the excellent [ZIO AWS](docs/https://zio.dev/zio-aws) library for type-safe DynamoDB access, and the awesome [ZIO Schema](https://zio.dev/zio-schema) library for schema derived codecs (see here for documentation on how to [customise these through annotations](codec-customization.md)). + +## Installation + +To use ZIO DynamoDB, we need to add the following lines to our `build.sbt` file: + +```scala libraryDependencies ++= Seq( - // ... - "dev.zio" %% "zio-dynamodb" % "0.0.1" + "dev.zio" %% "zio-dynamodb" % "0.2.0-RC2" ) ``` -For examples please see [examples sbt module](examples/src/main/scala/zio/dynamodb/examples). Below is `Main.scala` from that module. +## Example -```scala -package zio.dynamodb.examples +For examples please see [examples sbt module](../examples/src/main/scala/zio/dynamodb/examples). Below is `Main.scala` from that module: +```scala import io.github.vigoo.zioaws.http4s import zio.{ App, ExitCode, Has, URIO, ZLayer } import zio.dynamodb.DynamoDBQuery.{ get, put } @@ -36,7 +40,7 @@ import io.github.vigoo.zioaws.core.config import io.github.vigoo.zioaws.dynamodb import zio.clock.Clock -object Main extends ZIOAppDefault { +object Main extends App { final case class Person(id: Int, firstName: String) object Person { @@ -47,55 +51,41 @@ object Main extends ZIOAppDefault { private val program = for { _ <- put("tableName", examplePerson).execute person <- get[Person]("tableName", PrimaryKey("id" -> 1)).execute - _ <- zio.Console.printLine(s"hello $person") + _ <- zio.console.putStrLn(s"hello $person") } yield () - override def run = { + override def run(args: List[String]): URIO[zio.ZEnv, ExitCode] = { - val dynamoDbLayer = - http4s.Http4sClient.default >>> config.AwsConfig.default >>> dynamodb.DynamoDb.live // uses real AWS dynamodb - val executorLayer = dynamoDbLayer >>> DynamoDBExecutor.live + val dynamoDbLayer = http4s.default >>> config.default >>> dynamodb.live // uses real AWS dynamodb + val executorLayer = (dynamoDbLayer ++ ZLayer.identity[Has[Clock.Service]]) >>> DynamoDBExecutor.live - program.provide(executorLayer) + program.provideCustomLayer(executorLayer).exitCode } } - ``` -For examples on how to use the DynamoDBLocal in memory database please see the [integration tests](dynamodb/src/it/scala/zio/dynamodb/LiveSpec.scala) -and [StudentZioDynamoDbExample](examples/src/main/scala/zio/dynamodb/examples/dynamodblocal/StudentZioDynamoDbExample.scala) +For examples on how to use the DynamoDBLocal in memory database please see the [integration tests](../dynamodb/src/it/scala/zio/dynamodb/LiveSpec.scala) +and [StudentZioDynamoDbExample](../examples/src/main/scala/zio/dynamodb/examples/dynamodblocal/StudentZioDynamoDbExample.scala) -Under the hood we use the excellent [ZIO AWS](https://github.com/zio/zio-aws) library for type-safe DynamoDB access, and -the awesome [ZIO Schema](https://github.com/zio/zio-schema) library for schema derived codecs (see here for documentation -on how to [customise these through annotations](docs/usecases/codec-customisation.md)). +## Documentation -Microsite content to come soon. +Learn more on the [ZIO DynamoDB homepage](https://zio.dev/zio-dynamodb/)! +## Contributing -[ZIO DynamoDB Microsite](https://zio.github.io/zio-dynamodb/) - -# Contributing -[Documentation for contributors](https://zio.github.io/zio-dynamodb/docs/about/about_contributing) +For the general guidelines, see ZIO [contributor's guide](https://zio.dev/about/contributing). ## Code of Conduct -See the [Code of Conduct](https://zio.github.io/zio-dynamodb/docs/about/about_coc) +See the [Code of Conduct](https://zio.dev/about/code-of-conduct) ## Support Come chat with us on [![Badge-Discord]][Link-Discord]. - -# License -[License](LICENSE) - -[Badge-SonatypeReleases]: https://img.shields.io/nexus/r/https/oss.sonatype.org/dev.zio/zio-dynamodb_2.12.svg "Sonatype Releases" -[Badge-SonatypeSnapshots]: https://img.shields.io/nexus/s/https/oss.sonatype.org/dev.zio/zio-dynamodb_2.12.svg "Sonatype Snapshots" [Badge-Discord]: https://img.shields.io/discord/629491597070827530?logo=discord "chat on discord" -[Link-SonatypeReleases]: https://oss.sonatype.org/content/repositories/releases/dev/zio/zio-dynamodb_2.12/ "Sonatype Releases" -[Link-SonatypeSnapshots]: https://oss.sonatype.org/content/repositories/snapshots/dev/zio/zio-dynamodb_2.12/ "Sonatype Snapshots" [Link-Discord]: https://discord.gg/2ccFBr4 "Discord" -[Badge-CI]: https://github.com/zio/zio-dynamodb/workflows/CI/badge.svg -[Stage]: https://img.shields.io/badge/Project%20Stage-Experimental-yellow.svg -[Stage-Page]: https://github.com/zio/zio/wiki/Project-Stages +## License + +[License](LICENSE) diff --git a/build.sbt b/build.sbt index a173e8fed..8aff7fba4 100644 --- a/build.sbt +++ b/build.sbt @@ -3,7 +3,7 @@ import BuildHelper._ inThisBuild( List( organization := "dev.zio", - homepage := Some(url("https://zio.github.io/zio-dynamodb/")), + homepage := Some(url("https://zio.dev/zio-dynamodb/")), licenses := List("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")), developers := List( Developer( @@ -23,7 +23,7 @@ inThisBuild( pgpPublicRing := file("/tmp/public.asc"), pgpSecretRing := file("/tmp/secret.asc"), scmInfo := Some( - ScmInfo(url("https://github.com/googley42/zio-dynamodb"), "scm:git:git@github.com:googley42/zio-dynamodb.git") + ScmInfo(url("https://github.com/zio/zio-dynamodb"), "scm:git:git@github.com:zio/zio-dynamodb.git") ) ) ) @@ -62,7 +62,7 @@ lazy val root = project .in(file(".")) .settings(skip in publish := true) - .aggregate(zioDynamodb, examples) + .aggregate(zioDynamodb, examples, docs) lazy val zioDynamodb = module("zio-dynamodb", "dynamodb") .enablePlugins(BuildInfoPlugin) @@ -323,10 +323,13 @@ lazy val docs = project libraryDependencies ++= Seq( "dev.zio" %% "zio" % zioVersion ), - unidocProjectFilter in (ScalaUnidoc, unidoc) := inProjects(root), - target in (ScalaUnidoc, unidoc) := (baseDirectory in LocalRootProject).value / "website" / "static" / "api", - cleanFiles += (target in (ScalaUnidoc, unidoc)).value, - docusaurusCreateSite := docusaurusCreateSite.dependsOn(unidoc in Compile).value, - docusaurusPublishGhpages := docusaurusPublishGhpages.dependsOn(unidoc in Compile).value + projectName := "ZIO DynamoDB", + badgeInfo := Some( + BadgeInfo( + artifact = "zio-dynamodb_2.12", + projectStage = ProjectStage.Experimental + ) + ), + docsPublishBranch := "series/2.x" ) - .enablePlugins(MdocPlugin, DocusaurusPlugin, ScalaUnidocPlugin) + .enablePlugins(WebsitePlugin) diff --git a/docs/about/code_of_conduct.md b/docs/about/code_of_conduct.md deleted file mode 100644 index 7e9df263c..000000000 --- a/docs/about/code_of_conduct.md +++ /dev/null @@ -1,45 +0,0 @@ ---- -id: about_coc -title: "ZIO Code of Conduct" ---- - -We are committed to providing a friendly, safe and welcoming -environment for all, regardless of level of experience, gender, gender -identity and expression, sexual orientation, disability, personal -appearance, body size, race, ethnicity, age, religion, nationality, or -other such characteristics. - -The ZIO project follows the [Scala Code of Conduct](https://www.scala-lang.org/conduct/), with -an additional clause regarding moderation that is detailed below. All participants, contributors and -members are expected to follow the Scala Code of Conduct when discussing the project on the available -communication channels. If you are being harassed, please contact us immediately so that we can support you. - -## Moderation and Steering Committee - -The ZIO project is moderated by the Steering Committee team members: - -- Itamar Ravid [@iravid](https://github.com/iravid) -- John De Goes [@jdegoes](https://github.com/jdegoes) -- Kai [@neko-kai](https://github.com/neko-kai) -- Paul Shirshov [@pshirshov](https://github.com/pshirshov) -- Pierre Ricadat [@ghostdogpr](https://github.com/ghostdogpr) -- Wiem Zine El Abidine [@wi101](https://github.com/wi101) - -The ZIO project requires that drastic moderation actions detailed in the code of -conduct - for example, removing a user from the Gitter channel - be agreed upon -a group of over 2/3rds of the steering committee. - -For any questions, concerns, or moderation requests please contact any member of -the project, or the people listed above. - -## BDFL - -In addition to the above, the ZIO project's BDFL (benevolent dictator for life) is -John De Goes (@jdegoes), owing to his original founding of the project and continued -investments in it. While John adheres to the same code of conduct as everyone else, -he is entitled to override moderation decisions made by the steering committee. - -We do not take the BDFL position lightly, especially with regards to moderation. John -has consistently shown he is level-headed and able to handle conflict responsibly. Feel -free to reach out to any member of the steering committee, including John himself, -with any concern you might have. diff --git a/docs/about/contributing.md b/docs/about/contributing.md deleted file mode 100644 index b703f5d80..000000000 --- a/docs/about/contributing.md +++ /dev/null @@ -1,274 +0,0 @@ ---- -id: about_contributing -title: "ZIO-Dynamodb Contributor Guidelines" ---- - -Thank you for your interest in contributing to ZIO-DynamoDB, which is a small, zero-dependency library for doing type-safe, composable concurrent and asynchronous programming! - -We welcome contributions from all people! You will learn about functional programming, and you will add your own unique touch to the ZIO-DynamoDB project. We are happy to help you to get started and to hear your suggestions and answer your questions. - -_You too can contribute to ZIO-DynamoDB, we believe in you!_ - -# Contributing - -## Getting Started - -To begin contributing, please follow these steps: - -### Get The Project - -If you don't already have one, sign up for a free [GitHub Account](https://github.com/join?source=header-home). - -After you [log into](https://github.com/login) GitHub using your account, go to the [ZIO-DynamoDB Project Page](https://github.com/zio/zio-dynamodb), and click on [Fork](https://github.com/zio/zio-dynamodb/fork) to fork the ZIO-DynamoDB repository into your own account. - -You will make _all_ contributions from your own account. No one contributes _directly_ to the main repository. Contributors only ever merge code from other people's forks into the main repository. - -Once you have forked the repository, you can now clone your forked repository to your own machine, so you have a complete copy of the project and can begin safely making your modifications (even without an Internet connection). - -To clone your forked repository, first make sure you have installed [Git](https://git-scm.com/downloads), the version control system used by GitHub. Then open a Terminal and type the following commands: - -```bash -git clone git@github.com:your-user-name/zio-dynamodb.git . -``` - -If these steps were successful, then congratulations, you now have a complete copy of the ZIO DynamoDB project! - -The next step is to build the project on your machine, to ensure you know how to compile the project and run tests. - -### Build the Project - -The official way to build the project is with sbt. An sbt build file is included in the project, so if you choose to build the project this way, you won't have to do any additional configuration or setup (others choose to build the project using IntelliJ IDEA, Gradle, Maven, Mill, or Fury). - -We use a custom sbt script, which is included in the repository, in order to ensure settings are uniform across all development machines, and the continuous integration service (Circle CI). - -The sbt script is in the root of the repository. To launch this script from your Terminal window, simply type: - -```bash -./sbt -``` - -Sbt will launch, read the project build file, and download dependencies as required. - -You can now compile the production source code with the following sbt command: - -```bash -compile -``` - -You can compile the test source code with the following sbt command: - -```bash -test:compile -``` - -[Learn more](https://www.scala-sbt.org) about sbt to understand how you can list projects, switch projects, and otherwise manage an sbt project. - -### Find an Issue - -You may have your own idea about what contributions to make to ZIO-DynamoDB, which is great! If you want to make sure the ZIO contributors are open to your idea, you can [open an issue](https://github.com/zio/zio-dynamodb/issues/new) first on the ZIO project site. - -Otherwise, if you have no ideas about what to contribute, you can find a large supply of feature requests and bugs on the project's [issue tracker](https://github.com/zio/zio-dynamodb/issues). - -Issues are tagged with various labels, such as `good first issue`, which help you find issues that are a fit for you. - -If some issue is confusing or you think you might need help, then just post a comment on the issue asking for help. Typically, the author of the issue will provide as much help as you need, and if the issue is critical, leading ZIO-DynamoDB contributors will probably step in to mentor you and give you a hand, making sure you understand the issue thoroughly. - -Once you've decided on an issue and understand what is necessary to complete the issue, then it's a good idea to post a comment on the issue saying that you intend to work on it. Otherwise, someone else might work on it too! - -### Fix an Issue - -Once you have an issue, the next step is to fix the bug or implement the feature. Since ZIO-DynamoDB is an open source project, there are no deadlines. Take your time! - -The only thing you have to worry about is if you take too long, especially for a critical issue, eventually someone else will come along and work on the issue. - -If you shoot for 2-3 weeks for most issues, this should give you plenty of time without having to worry about having your issue stolen. - -If you get stuck, please consider [opening a pull request](https://github.com/zio/zio-dynamodb/compare) for your incomplete work, and asking for help (just prefix the pull request by _WIP_). In addition, you can comment on the original issue, pointing people to your own fork. Both of these are great ways to get outside help from people more familiar with the project. - -### Prepare Your Code - -If you've gotten this far, congratulations! You've implemented a new feature or fixed a bug. Now you're in the last mile, and the next step is submitting your code for review, so that other contributors can spot issues and help improve the quality of the code. - -To do this, you need to commit your changes locally. A good way to find out what you did locally is to use the `git status` command: - -```bash -git status -``` - -If you see new files, you will have to tell `git` to add them to the repository using `git add`: - -```bash -git add src/main/zio/zmx/NewFile.scala -``` - -Then you can commit all your changes at once with the following command: - -```bash -git commit -am "Fixed #94211 - Optimized race for lists of effects" -``` - -At this point, you have saved your work locally, to your machine, but you still need to push your changes to your fork of the repository. To do that, use the `git push` command: - -```bash -git push -``` - -Now while you were working on this great improvement, it's quite likely that other ZIO-DynamoDB contributors were making their own improvements. You need to pull all those improvements into your own code base to resolve any conflicts and make sure the changes all work well together. - -To do that, use the `git pull` command: - -```bash -git pull git@github.com:zio/zio-dynamodb.git master -``` - -You may get a warning from Git that some files conflicted. Don't worry! That just means you and another contributor edited the same parts of the same files. - -Using a text editor, open up the conflicted files, and try to merge them together, preserving your changes and the other changes (both are important!). - -Once you are done, you can commit again: - -```bash -git commit -am "merged upstream changes" -``` - -At this point, you should re-run all tests to make sure everything is passing: - -```bash -# If you are already in a SBT session you can type only 'test' - -sbt test -``` - -If all the tests are passing, then you can format your code: - -```bash -# If you are already in a SBT session you can type only 'fmt' - -sbt fmt -``` - -If your changes altered an API, then you may need to rebuild the microsite to make sure none of the (compiled) documentation breaks: - -```bash -# If you are already in a SBT session you can type only 'docs/docusaurusCreateSite' - -sbt docs/docusaurusCreateSite -``` - -Finally, if you are up-to-date with master, all your tests are passing, you have properly formatted your code, and the microsite builds properly, then it's time to submit your work for review! - -### Create a Pull Request - -To create a pull request, first push all your changes to your fork of the project repository: - -```bash -git push -``` - -Next, [open a new pull request](https://github.com/zio/zio-dynamodb/compare) on GitHub, and select _Compare Across Forks_. On the right hand side, choose your own fork of the ZIO-DynamoDB repository, in which you've been making your contribution. - -Provide a description for the pull request, which details the issue it is fixing, and has other information that may be helpful to developers reviewing the pull request. - -Finally, click _Create Pull Request_! - -### Get Your Pull Request Merged - -Once you have a pull request open, it's still your job to get it merged! To get it merged, you need at least one core ZIO-DynamoDB contributor to approve the code. - -If you know someone who would be qualified to review your code, you can request that person, either in the comments of the pull request, or on the right-hand side, if you have appropriate permissions. - -Code reviews can sometimes take a few days, because open source projects are largely done outside of work, in people's leisure time. Be patient, but don't wait forever. If you haven't gotten a review within a few days, then consider gently reminding people that you need a review. - -Once you receive a review, you will probably have to go back and make minor changes that improve your contribution and make it follow existing conventions in the code base. This is normal, even for experienced contributors, and the rigorous reviews help ensure ZIO-DynamoDB' code base stays high quality. - -After you make changes, you may need to remind reviewers to check out the code again. If they give a final approval, it means your code is ready for merge! Usually this will happen at the same time, though for controversial changes, a contributor may wait for someone more senior to merge. - -If you don't get a merge in a day after your review is successful, then please gently remind folks that your code is ready to be merged. - -Sit back, relax, and enjoy being a ZIO-DynamoDB contributor! - -# ZIO-DynamoDB Contributor License Agreement - -Thank you for your interest in contributing to the ZIO-DynamoDB open source project. - -This contributor agreement ("Agreement") describes the terms and conditions under which you may Submit a Contribution to Us. By Submitting a Contribution to Us, you accept the terms and conditions in the Agreement. If you do not accept the terms and conditions in the Agreement, you must not Submit any Contribution to Us. - -This is a legally binding document, so please read it carefully before accepting the terms and conditions. If you accept this Agreement, the then-current version of this Agreement shall apply each time you Submit a Contribution. The Agreement may cover more than one software project managed by Us. - -## 1. Definitions - -"We" or "Us" means Ziverge, Inc., and its duly appointed and authorized representatives. - -"You" means the individual or entity who Submits a Contribution to Us. - -"Contribution" means any work of authorship that is Submitted by You to Us in which You own or assert ownership of the Copyright. You may not Submit a Contribution if you do not own the Copyright in the entire work of authorship. - -"Copyright" means all rights protecting works of authorship owned or controlled by You, including copyright, moral and neighboring rights, as appropriate, for the full term of their existence including any extensions by You. - -"Material" means the work of authorship which is made available by Us to third parties. When this Agreement covers more than one software project, the Material means the work of authorship to which the Contribution was Submitted. After You Submit the Contribution, it may be included in the Material. - -"Submit" means any form of electronic, verbal, or written communication sent to Us or our representatives, including but not limited to electronic mailing lists, electronic mail, source code control systems, pull requests, and issue tracking systems that are managed by, or on behalf of, Us for the purpose of discussing and improving the Material, but excluding communication that is conspicuously marked or otherwise designated in writing by You as "Not a Contribution." - -"Submission Date" means the date on which You Submit a Contribution to Us. - -"Effective Date" means the earliest date You execute this Agreement by Submitting a Contribution to Us. - -## 2. Grant of Rights - -### 2.1 Copyright License - -2.1.1. You retain ownership of the Copyright in Your Contribution and have the same rights to use or license the Contribution which You would have had without entering into the Agreement. - -2.1.2. To the maximum extent permitted by the relevant law, You grant to Us a perpetual, worldwide, non-exclusive, transferable, royalty-free, irrevocable license under the Copyright covering the Contribution, with the right to sublicense such rights through multiple tiers of sublicensees, to reproduce, modify, display, perform and distribute the Contribution as part of the Material; provided that this license is conditioned upon compliance with Section 2.3. - -### 2.2 Patent License - -For patent claims including, without limitation, method, process, and apparatus claims which You own, control or have the right to grant, now or in the future, You grant to Us a perpetual, worldwide, non-exclusive, transferable, royalty-free, irrevocable patent license, with the right to sublicense these rights to multiple tiers of sublicensees, to make, have made, use, sell, offer for sale, import and otherwise transfer the Contribution and the Contribution in combination with the Material (and portions of such combination). This license is granted only to the extent that the exercise of the licensed rights infringes such patent claims; and provided that this license is conditioned upon compliance with Section 2.3. - -### 2.3 Outbound License - -Based on the grant of rights in Sections 2.1 and 2.2, if We include Your Contribution in a Material, We may license the Contribution under any license, including copyleft, permissive, commercial, or proprietary licenses. As a condition on the exercise of this right, We agree to also license the Contribution under the terms of the license or licenses which We are using for the Material on the Submission Date. - -### 2.4 Moral Rights - -If moral rights apply to the Contribution, to the maximum extent permitted by law, You waive and agree not to assert such moral rights against Us or our successors in interest, or any of our licensees, either direct or indirect. - -### 2.5 Our Rights - -You acknowledge that We are not obligated to use Your Contribution as part of the Material and may decide to include any Contribution We consider appropriate. - -### 2.6 Reservation of Rights - -Any rights not expressly licensed under this section are expressly reserved by You. - -## 3. Agreement - -You confirm that: - -a. You have the legal authority to enter into this Agreement. - -b. You own the Copyright and patent claims covering the Contribution which are required to grant the rights under Section 2. - -c. The grant of rights under Section 2 does not violate any grant of rights which You have made to third parties, including Your employer. If You are an employee, You have had Your employer approve this Agreement or sign the Entity version of this document. If You are less than eighteen years old, please have Your parents or guardian sign the Agreement. - -d. You have followed the instructions in, if You do not own the Copyright in the entire work of authorship Submitted. - -## 4. Disclaimer - -EXCEPT FOR THE EXPRESS WARRANTIES IN SECTION 3, THE CONTRIBUTION IS PROVIDED "AS IS". MORE PARTICULARLY, ALL EXPRESS OR IMPLIED WARRANTIES INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE EXPRESSLY DISCLAIMED BY YOU TO US. TO THE EXTENT THAT ANY SUCH WARRANTIES CANNOT BE DISCLAIMED, SUCH WARRANTY IS LIMITED IN DURATION TO THE MINIMUM PERIOD PERMITTED BY LAW. - -## 5. Consequential Damage Waiver - -TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT WILL YOU BE LIABLE FOR ANY LOSS OF PROFITS, LOSS OF ANTICIPATED SAVINGS, LOSS OF DATA, INDIRECT, SPECIAL, INCIDENTAL, CONSEQUENTIAL AND EXEMPLARY DAMAGES ARISING OUT OF THIS AGREEMENT REGARDLESS OF THE LEGAL OR EQUITABLE THEORY (CONTRACT, TORT OR OTHERWISE) UPON WHICH THE CLAIM IS BASED. - -## 6. Miscellaneous - -6.1. This Agreement will be governed by and construed in accordance with the laws of the state of Maryland, in the United States of America, excluding its conflicts of law provisions. Under certain circumstances, the governing law in this section might be superseded by the United Nations Convention on Contracts for the International Sale of Goods ("UN Convention") and the parties intend to avoid the application of the UN Convention to this Agreement and, thus, exclude the application of the UN Convention in its entirety to this Agreement. - -6.2. This Agreement sets out the entire agreement between You and Us for Your Contributions to Us and overrides all other agreements or understandings. - -6.3. If You or We assign the rights or obligations received through this Agreement to a third party, as a condition of the assignment, that third party must agree in writing to abide by all the rights and obligations in the Agreement. - -6.4. The failure of either party to require performance by the other party of any provision of this Agreement in one situation shall not affect the right of a party to require such performance at any time in the future. A waiver of performance under a provision in one situation shall not be considered a waiver of the performance of the provision in the future or a waiver of the provision in its entirety. - -6.5. If any provision of this Agreement is found void and unenforceable, such provision will be replaced to the extent possible with a provision that comes closest to the meaning of the original provision and which is enforceable. The terms and conditions set forth in this Agreement shall apply notwithstanding any failure of essential purpose of this Agreement or any limited remedy to the maximum extent possible under law. diff --git a/docs/about/index.md b/docs/about/index.md deleted file mode 100644 index 910430fbe..000000000 --- a/docs/about/index.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: about_index -title: "About ZIO DynamoDB" ---- - -ZIO DynamoDB is a simple, type-safe, and efficient library for accessing DynamoDB without boilerplate. ZIO DynamoDB will automatically batch queries and execute unbatchable queries in parallel. diff --git a/docs/usecases/codec-customisation.md b/docs/codec-customization.md similarity index 98% rename from docs/usecases/codec-customisation.md rename to docs/codec-customization.md index 9148a9b15..9571abd9d 100644 --- a/docs/usecases/codec-customisation.md +++ b/docs/codec-customization.md @@ -1,3 +1,8 @@ +--- +id: codec-customization +title: "Codec Customization" +--- + # Default encoding ## Sealed trait members that are case classes diff --git a/docs/getting-started.md b/docs/getting-started.md new file mode 100644 index 000000000..c954ca6c2 --- /dev/null +++ b/docs/getting-started.md @@ -0,0 +1,50 @@ +--- +id: getting-started +title: "Getting Started" +--- + +## Add the dependency to your build.sbt file + +```scala +libraryDependencies += "dev.zio" %% "zio-dynamodb" % @VERSION@ +``` + +### Read & write data to/from DynamoDB + +```scala +import zio._ +import zio.clock.Clock +import zio.schema.{ DeriveSchema, Schema } +import zio.dynamodb._ +import zio.dynamodb.DynamoDBQuery._ +import io.github.vigoo.zioaws.dynamodb +import io.github.vigoo.zioaws.dynamodb.DynamoDb +import io.github.vigoo.zioaws.core.config +import io.github.vigoo.zioaws.http4s + +final case class Student(email: String, subject: String) +object Student { + implicit lazy val schema: Schema[Student] = DeriveSchema.gen[Student] +} + +object Main extends App { + private val liveDynamoDbLayer: ZLayer[Any, Throwable, DynamoDb] = + http4s.default >>> config.default >>> dynamodb.live + + // Assuming table "student" exists with email as HASH key and subject as the RANGE key + val avi = Student("avi@gmail.com", "maths") + val adam = Student("adam@gmail.com", "english") + + def run(args: List[String]) = { + (for { + _ <- (put("student", avi) zip put("student", adam)).execute + listOfStudentsOrError <- forEach(List(avi, adam)) { student => + get[Student]("student", + PrimaryKey("email" -> student.email, "subject" -> student.subject) + )}.execute + } yield ()) + .provideLayer((liveDynamoDbLayer ++ Clock.live) >>> DynamoDBExecutor.live) + .exitCode + } +} +``` diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 000000000..77b2cad44 --- /dev/null +++ b/docs/index.md @@ -0,0 +1,66 @@ +--- +id: index +title: "Introduction to ZIO DynamoDB" +sidebar_title: "ZIO DynamoDB" +--- + +Simple, type-safe, and efficient access to DynamoDB + +@PROJECT_BADGES@ + +## Introduction + +ZIO DynamoDB is a library that is used for type-safe, efficient, and boilerplate free access to AWS's DynamoDB service. It provides a type-safe API for many query types and the number of type-safe APIs is expanding. ZIO DynamoDB will automatically batch queries and execute unbatchable queries in parallel. + +Under the hood we use the excellent [ZIO AWS](https://zio.dev/zio-aws) library for type-safe DynamoDB access, and the awesome [ZIO Schema](https://zio.dev/zio-schema) library for schema derived codecs (see here for documentation on how to [customise these through annotations](codec-customization.md)). + +## Installation + +To use ZIO DynamoDB, we need to add the following lines to our `build.sbt` file: + +```scala +libraryDependencies ++= Seq( + "dev.zio" %% "zio-dynamodb" % "@VERSION@" +) +``` + +## Example + +For examples please see [examples sbt module](../examples/src/main/scala/zio/dynamodb/examples). Below is `Main.scala` from that module: + +```scala +import io.github.vigoo.zioaws.http4s +import zio.{ App, ExitCode, Has, URIO, ZLayer } +import zio.dynamodb.DynamoDBQuery.{ get, put } +import zio.dynamodb.{ DynamoDBExecutor, PrimaryKey } +import zio.schema.{ DeriveSchema, Schema } +import io.github.vigoo.zioaws.core.config +import io.github.vigoo.zioaws.dynamodb +import zio.clock.Clock + +object Main extends App { + + final case class Person(id: Int, firstName: String) + object Person { + implicit lazy val schema: Schema[Person] = DeriveSchema.gen[Person] + } + val examplePerson = Person(1, "avi") + + private val program = for { + _ <- put("tableName", examplePerson).execute + person <- get[Person]("tableName", PrimaryKey("id" -> 1)).execute + _ <- zio.console.putStrLn(s"hello $person") + } yield () + + override def run(args: List[String]): URIO[zio.ZEnv, ExitCode] = { + + val dynamoDbLayer = http4s.default >>> config.default >>> dynamodb.live // uses real AWS dynamodb + val executorLayer = (dynamoDbLayer ++ ZLayer.identity[Has[Clock.Service]]) >>> DynamoDBExecutor.live + + program.provideCustomLayer(executorLayer).exitCode + } +} +``` + +For examples on how to use the DynamoDBLocal in memory database please see the [integration tests](../dynamodb/src/it/scala/zio/dynamodb/LiveSpec.scala) +and [StudentZioDynamoDbExample](../examples/src/main/scala/zio/dynamodb/examples/dynamodblocal/StudentZioDynamoDbExample.scala) diff --git a/docs/overview/index.md b/docs/overview/index.md deleted file mode 100644 index 54e7a12a1..000000000 --- a/docs/overview/index.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: overview_index -title: "Contents" ---- - -ZIO DynamoDB is a library that is used for type-safe, efficient, and boilerplate free access to AWS's DynamoDB service. It provides a type-safe API for many query types and the number of type-safe APIs is expanding. diff --git a/docs/package.json b/docs/package.json new file mode 100644 index 000000000..3103d60fb --- /dev/null +++ b/docs/package.json @@ -0,0 +1,5 @@ +{ + "name": "@zio.dev/zio-dynamodb", + "description": "ZIO DynamoDB Documentation", + "license": "Apache-2.0" +} diff --git a/docs/sidebars.js b/docs/sidebars.js new file mode 100644 index 000000000..48a548df9 --- /dev/null +++ b/docs/sidebars.js @@ -0,0 +1,17 @@ +const sidebars = { + sidebar: [ + { + type: "category", + label: "ZIO DynamoDB", + collapsed: false, + link: { type: "doc", id: "index" }, + items: [ + "getting-started", + "codec-customization", + "transactions", + ] + } + ] +}; + +module.exports = sidebars; \ No newline at end of file diff --git a/docs/transactions.md b/docs/transactions.md new file mode 100644 index 000000000..93f670216 --- /dev/null +++ b/docs/transactions.md @@ -0,0 +1,62 @@ +--- +id: transactions +title: "DynamoDB Transactions" +sidebar_label: "Transactions" +--- + +Transactions are as simple as calling the `.transact` method on a `DynamoDBQuery`. As long as every component of the query is a valid transaction item and the `DyanmoDBQuery` does not have a mix of get and write transaction items. A list of valid items for both types of queries is listed below. + +## Examples + +### Write Transactions +```scala +final case class Bill(studentEmail: String, semesters: Int) + +val student = Student("avi@gmail.com", "maths") +val bill = Bill("avi@gmail.com", 1) + +val putStudent = put("student", student) +val billedStudent = put("billing", bill) +val deleteFromWaitlist = deleteItem("waitlist", PrimaryKey("email" -> student.email)) + +val studentEnrollmentTransaction = (putStudent zip billedStudent zip deleteFromWaitlist).transact + +for { + _ <- studentEnrollmentTransaction.execute +} yield () +``` + +### ReadTransactions + +```scala +final case class EnrolledClass(courseId: String, studentEmail: String) + +val avi = Student("avi@gmail.com", "maths") +val maths101 = EnrolledClass("mth-101", avi.email) +val maths102 = EnrolledClass("mth-102", avi.email) + +val putAvi = put("student", avi) +val putClasses = put("enrolledClass", maths101) zip put("enrolledClass", maths102) + +val enrollAvi = (putAvi zip putClasses).transaction +``` + +## Transaction Failures + +DynamoDBQueries using the `.transaction` method will fail at runtime if there are invalid transaction actions such as creating a table, scanning for items, or querying. The [DynamoDB documentation] has a limited number of actions that can be performed for either a read or a write transaction. There is a `.safeTransaction` method that is also available that will return `Either[Throwable, DynamoDBQuery[A]]`. + +There are more examples in our [integration tests](../dynamodb/src/it/scala/zio/dynamodb/LiveSpec.scala). + +### Valid Transact Write Items + +* PutItem +* DeleteItem +* BatchWriteItem +* UpdateItem +* ConditionCheck + + +### Valid Transact Get Item + +* GetItem +* BatchGetItem diff --git a/docs/usecases/index.md b/docs/usecases/index.md deleted file mode 100644 index 862e4c6c1..000000000 --- a/docs/usecases/index.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -id: usecases_index -title: "Contents" ---- - -[Codec Cusomisation](./codec-customisation.md) -[Transactions](./transactions.md) diff --git a/project/plugins.sbt b/project/plugins.sbt index da1fc25ae..4b708ef9c 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,9 +1,11 @@ -addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.0") -addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.0") -addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.10.0") -addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.6.1") -addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.2.16") -addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "1.4.6") -addSbtPlugin("com.eed3si9n" % "sbt-unidoc" % "0.4.3") -addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.5") -addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.34") +addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.0") +addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.0") +addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.10.0") +addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.6.1") +addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.2.16") +addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "1.4.6") +addSbtPlugin("com.eed3si9n" % "sbt-unidoc" % "0.4.3") +addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.5") +addSbtPlugin("dev.zio" % "zio-sbt-website" % "0.1.5+28-4b5b0374-SNAPSHOT") + +resolvers += Resolver.sonatypeRepo("public") diff --git a/website/core/Footer.js b/website/core/Footer.js deleted file mode 100755 index 8947d9a02..000000000 --- a/website/core/Footer.js +++ /dev/null @@ -1,67 +0,0 @@ -/** - * Copyright (c) 2017-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -const React = require('react'); - -class Footer extends React.Component { - docUrl(doc, language) { - const baseUrl = this.props.config.baseUrl; - const docsUrl = this.props.config.docsUrl; - const docsPart = `${docsUrl ? `${docsUrl}/` : ''}`; - const langPart = `${language ? `${language}/` : ''}`; - return `${baseUrl}${docsPart}${langPart}${doc}`; - } - - pageUrl(doc, language) { - const baseUrl = this.props.config.baseUrl; - return baseUrl + (language ? `${language}/` : '') + doc; - } - - render() { - return ( - - ); - } -} - -module.exports = Footer; diff --git a/website/package.json b/website/package.json deleted file mode 100644 index 29180a4c6..000000000 --- a/website/package.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "scripts": { - "examples": "docusaurus-examples", - "start": "docusaurus-start", - "build": "docusaurus-build", - "publish-gh-pages": "docusaurus-publish", - "write-translations": "docusaurus-write-translations", - "version": "docusaurus-version", - "rename-version": "docusaurus-rename-version" - }, - "devDependencies": { - "docusaurus": "^1.12.0", - "react-sidecar": "^0.1.1" - } -} diff --git a/website/pages/en/index.js b/website/pages/en/index.js deleted file mode 100755 index 2fcd50663..000000000 --- a/website/pages/en/index.js +++ /dev/null @@ -1,180 +0,0 @@ -/** - * Copyright (c) 2017-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -const React = require('react'); - -const CompLibrary = require('../../core/CompLibrary.js'); - -const MarkdownBlock = CompLibrary.MarkdownBlock; /* Used to read markdown */ -const Container = CompLibrary.Container; -const GridBlock = CompLibrary.GridBlock; - -class HomeSplash extends React.Component { - render() { - const {siteConfig, language = ''} = this.props; - const {baseUrl, docsUrl} = siteConfig; - const docsPart = `${docsUrl ? `${docsUrl}/` : ''}`; - const langPart = `${language ? `${language}/` : ''}`; - const docUrl = doc => `${baseUrl}${docsPart}${langPart}${doc}`; - - const SplashContainer = props => ( -
-
-
{props.children}
-
-
- ); - - const Logo = props => ( -
- Project Logo -
- ); - - const ProjectTitle = () => ( -

- {siteConfig.title} - {siteConfig.tagline} -

- ); - - const PromoSection = props => ( -
-
-
{props.children}
-
-
- ); - - const Button = props => ( -
- - {props.children} - -
- ); - - return ( - -
- - - - - - -
-
- ); - } -} - -class Index extends React.Component { - render() { - const {config: siteConfig, language = ''} = this.props; - const {baseUrl} = siteConfig; - - const Block = props => ( - - - - ); - - const FeatureCallout = () => ( -
-

Welcome to ZIO DynamoDB

- - A high-performance, purely-functional library for building, composing, and supervising typed actors - backed by `ZIO`. - - - - The [Actor Model](https://en.wikipedia.org/wiki/Actor_model) is used to build distributed highly - scalable applications. - The core concept behind the actor model is the ability to create multiple actors which run - concurrently. - The actor would receive a message do some computation on the message and then output a new message. - Each actor runs independently of each other with no shared state between them and as such failure of - one actor won't have an affect on the running of another. - In its simplest form the goal of this project is to provide the ability to write actors in - Functional Way that are typed leveraging [ZIO](https://github.com/zio/zio). - - -

- ZIO Actors current alternatives -

- - - - [Akka](https://akka.io) (Scala & Java) - - - - - [Akka .net](https://getakka.net) (C#) - - - - - [Orleans](https://dotnet.github.io/orleans/) (C#) - - - - - [Erlang/Otp](http://www.erlang.org) (Erlang) - - - - - [Elixir](https://elixir-lang.org) (Elixir) - - - - We differentiate ourselves from the above competition by having the following benefits: - * Purely Functional - * Everything Typed - * Light Weight - -
- ); - - const Features = () => ( - - {[ - { - content: 'Model actors\' communication without side effects', - image: `${baseUrl}img/undraw_tweetstorm.svg`, - imageAlign: 'top', - title: 'Effectful', - }, - { - content: 'Fully typed - with message, response and error type', - image: `${baseUrl}img/undraw_operating_system.svg`, - imageAlign: 'top', - title: 'Typed', - }, - ]} - - ); - - return ( -
- -
- - -
-
- ); - } -} - -module.exports = Index; diff --git a/website/sidebars.json b/website/sidebars.json deleted file mode 100755 index fdaadd2cb..000000000 --- a/website/sidebars.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "overview-sidebar": { - "Overview": [ - "overview/overview_index", - "overview/overview_basics", - "overview/overview_supervision", - "overview/overview_remoting", - "overview/overview_persistence", - "overview/overview_akkainterop" - ] - }, - "usecases-sidebar": { - "Use Cases": [ - "usecases/usecases_index", - "usecases/usecases_pingpong" - ] - }, - "about-sidebar": { - "About": [ - "about/about_index", - "about/about_contributing", - "about/about_coc" - ] - } -} \ No newline at end of file diff --git a/website/siteConfig.js b/website/siteConfig.js deleted file mode 100644 index b06c856bd..000000000 --- a/website/siteConfig.js +++ /dev/null @@ -1,118 +0,0 @@ -/** - * Copyright (c) 2017-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -// See https://docusaurus.io/docs/site-config for all the possible -// site configuration options. - -// List of projects/orgs using your project for the users page. -const users = [ - // { - // caption: 'User1', - // // You will need to prepend the image path with your baseUrl - // // if it is not '/', like: '/test-site/img/image.jpg'. - // image: '/img/undraw_open_source.svg', - // infoLink: 'https://www.facebook.com', - // pinned: true, - // }, -]; - -const siteConfig = { - title: 'ZIO Actors', - tagline: 'High-performance, purely-functional library for building and supervising typed actors backed by ZIO', - url: 'https://zio.github.io', - baseUrl: '/zio-dynamodb/', - - projectName: 'zio-dynamodb', - organizationName: 'zio', - - // For no header links in the top nav bar -> headerLinks: [], - headerLinks: [ - {doc: 'overview/overview_index', label: 'Overview'}, - {doc: 'usecases/usecases_index', label: 'Use Cases'}, - {doc: 'about/about_index', label: 'About'} - ], - - // by default Docusaurus combines CSS files in a way that doesn't play nicely with Scaladoc - separateCss: ["api"], - - // If you have users set above, you add it here: - users, - - /* path to images for header/footer */ - headerIcon: 'img/navbar_brand2x.png', - footerIcon: 'img/sidebar_brand2x.png', - favicon: 'img/favicon.png', - - /* Colors for website */ - colors: { - primaryColor: '#000000', - secondaryColor: '#000000', - }, - - /* Custom fonts for website */ - /* - fonts: { - myFont: [ - "Times New Roman", - "Serif" - ], - myOtherFont: [ - "-apple-system", - "system-ui" - ] - }, - */ - - // This copyright info is used in /core/Footer.js and blog RSS/Atom feeds. - copyright: `Copyright © ${new Date().getFullYear()} ZIO Maintainers`, - - highlight: { - // Highlight.js theme to use for syntax highlighting in code blocks. - theme: 'default', - }, - - // Add custom scripts here that would be placed in