Skip to content

Commit

Permalink
Publish Docs to The NPM Registry (#381)
Browse files Browse the repository at this point in the history
* organize docs.

* install zio-sbt-website plugin.

* update gitignore.

* remove website.

* generate site workflow.

* update ci.

* remove mdoc from plugins.

* remove scala 2.11 support.

* remove docs generation from root project.
  • Loading branch information
khajavi authored Nov 16, 2022
1 parent b459def commit 7a6c00c
Show file tree
Hide file tree
Showing 32 changed files with 48 additions and 766 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- name: Cache scala dependencies
uses: coursier/cache-action@v6
- name: Check Document Generation
run: sbt docs/docusaurusCreateSite
run: sbt docs/compileDocs

test:
runs-on: ubuntu-20.04
Expand Down
30 changes: 19 additions & 11 deletions .github/workflows/site.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,28 @@
name: Website
# This file was autogenerated using `zio-sbt` via `sbt generateGithubWorkflow`
# task and should be included in the git repository. Please do not edit
# it manually.

name: website

on:
push:
branches: [master]
release:
types:
- published
types: [ published ]

jobs:
publish:
publish-docs:
runs-on: ubuntu-20.04
timeout-minutes: 30
if: github.event_name != 'pull_request'
steps:
- uses: actions/checkout@v3
- uses: olafurpg/setup-scala@v13
- run: sbt docs/docusaurusPublishGhpages
- uses: actions/[email protected]
with:
fetch-depth: 0
- name: Setup Scala and Java
uses: olafurpg/setup-scala@v13
- uses: actions/setup-node@v3
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
- name: Publishing Docs to NPM Registry
run: sbt docs/publishToNpm
env:
GIT_DEPLOY_KEY: ${{ secrets.GIT_DEPLOY_KEY }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -415,3 +415,4 @@ website/node_modules
website/build
website/i18n/en.json
website/static/api
.bsp
9 changes: 2 additions & 7 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,7 @@ lazy val docs = project
scalacOptions -= "-Xfatal-warnings",
libraryDependencies ++= Seq(
"dev.zio" %% "zio" % zioVersion
),
ScalaUnidoc / unidoc / unidocProjectFilter := inProjects(root),
ScalaUnidoc / unidoc / target := (LocalRootProject / baseDirectory).value / "website" / "static" / "api",
cleanFiles += (ScalaUnidoc / unidoc / target).value,
docusaurusCreateSite := docusaurusCreateSite.dependsOn(Compile / unidoc).value,
docusaurusPublishGhpages := docusaurusPublishGhpages.dependsOn(Compile / unidoc).value
)
)
.dependsOn(zioQueryJVM)
.enablePlugins(MdocPlugin, DocusaurusPlugin, ScalaUnidocPlugin)
.enablePlugins(WebsitePlugin)
45 changes: 0 additions & 45 deletions docs/about/code_of_conduct.md

This file was deleted.

284 changes: 0 additions & 284 deletions docs/about/contributing.md

This file was deleted.

8 changes: 0 additions & 8 deletions docs/about/index.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
id: overview_creating_data_sources
id: creating-data-sources
title: "Creating Data Sources"
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
id: overview_creating_queries
id: creating-queries
title: "Creating Queries"
---

Expand Down
7 changes: 4 additions & 3 deletions docs/overview/index.md → docs/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
id: overview_index
title: "Summary"
id: index
title: "Introduction to ZIO Query"
sidebar_label: "ZIO Query"
---

A `ZQuery[R, E, A]` is a purely functional description of an effectual query that may contain requests from one or more data sources, requires an environment `R`, and may fail with an `E` or succeed with an `A`.
Expand Down Expand Up @@ -31,5 +32,5 @@ This would normally require N + 1 queries, one for `getAllUserIds` and one for e
Include ZIO Query in your project by adding the following to your `build.sbt` file:

```scala
libraryDependencies += "dev.zio" %% "zio-query" % "0.2.0"
libraryDependencies += "dev.zio" %% "zio-query" % "@VERSION@"
```
5 changes: 5 additions & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "@zio.dev/zio-query",
"description": "ZIO Query Documentation",
"license": "Apache-2.0"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
id: overview_running_queries
id: running-queries
title: "Running Queries"
---

Expand Down
10 changes: 10 additions & 0 deletions docs/sidebars.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const sidebars = {
sidebar: [
"index",
"creating-data-sources",
"creating-queries",
"running-queries"
]
};

module.exports = sidebars;
6 changes: 0 additions & 6 deletions docs/usecases/index.md

This file was deleted.

4 changes: 3 additions & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ addSbtPlugin("org.scalameta" % "sbt-scalafmt" %
addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.3")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.11.0")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.6")
addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.3.2")
addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "1.5.4")
addSbtPlugin("com.github.sbt" % "sbt-unidoc" % "0.5.0")
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.10")
addSbtPlugin("com.github.cb372" % "sbt-explicit-dependencies" % "0.2.16")
addSbtPlugin("com.thoughtworks.sbt-api-mappings" % "sbt-api-mappings" % "3.0.2")
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.10.4")
addSbtPlugin("dev.zio" % "zio-sbt-website" % "0.0.0+84-6fd7d64e-SNAPSHOT")

libraryDependencies += "org.snakeyaml" % "snakeyaml-engine" % "2.5"

resolvers += Resolver.sonatypeRepo("public")
67 changes: 0 additions & 67 deletions website/core/Footer.js

This file was deleted.

15 changes: 0 additions & 15 deletions website/package.json

This file was deleted.

Loading

0 comments on commit 7a6c00c

Please sign in to comment.