Skip to content

Commit

Permalink
Update: docs - fixed version info and dependency info
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin-lee committed Nov 9, 2024
1 parent 8a602be commit 1ee5d0d
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 143 deletions.
22 changes: 15 additions & 7 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -234,22 +234,30 @@ lazy val docs = (project in file("docs-gen-tmp/docs"))
"io.kevinlee" %%% "refined4s-chimney" % latestVersion,
"io.kevinlee" %%% "refined4s-circe" % latestVersion,
"io.kevinlee" %%% "refined4s-pureconfig" % latestVersion,
"io.kevinlee" %% "refined4s-doobie-ce2" % latestVersion,
"io.kevinlee" %% "refined4s-doobie-ce2" % latestVersion,
"io.kevinlee" %%% "refined4s-extras-render" % latestVersion,
"io.kevinlee" %%% "refined4s-tapir" % latestVersion,
libs.circeCore.value,
libs.circeLiteral.value,
libs.circeParser.value,
)
},
mdocVariables := Map(
"VERSION" -> {
mdocVariables := {
val latestVersion = {
import sys.process.*
"git fetch --tags".!
val tag = "git rev-list --tags --max-count=1".!!.trim
s"git describe --tags $tag".!!.trim.stripPrefix("v")
}
),
val websiteDir = docusaurDir.value

val latestVersionFile = websiteDir / "latestVersion.json"
val latestVersionJson = s"""{"version":"$latestVersion"}"""
IO.write(latestVersionFile, latestVersionJson)
Map(
"VERSION" -> latestVersion
)
},
docusaurDir := (ThisBuild / baseDirectory).value / "website",
docusaurBuildDir := docusaurDir.value / "build",
)
Expand All @@ -265,14 +273,14 @@ lazy val docsV0 = (project in file("docs-gen-tmp/docs-v0"))
cleanFiles += ((ThisBuild / baseDirectory).value / "website" / "versioned_docs" / "version-v0"),
scalacOptions ~= (ops => ops.filter(op => !op.startsWith("-Wunused:imports") && op != "-Wnonunit-statement")),
libraryDependencies ++= {
val theVersion = "0.19.0"
val theVersion = "0.19.0"
List(
"io.kevinlee" %%% "refined4s-core" % theVersion,
"io.kevinlee" %%% "refined4s-cats" % theVersion,
"io.kevinlee" %%% "refined4s-chimney" % theVersion,
"io.kevinlee" %%% "refined4s-circe" % theVersion,
"io.kevinlee" %%% "refined4s-pureconfig" % theVersion,
"io.kevinlee" %% "refined4s-doobie-ce2" % theVersion,
"io.kevinlee" %% "refined4s-doobie-ce2" % theVersion,
"io.kevinlee" %%% "refined4s-extras-render" % theVersion,
"io.kevinlee" %%% "refined4s-tapir" % theVersion,
libs.circeCore.value,
Expand All @@ -281,7 +289,7 @@ lazy val docsV0 = (project in file("docs-gen-tmp/docs-v0"))
)
},
mdocVariables := Map(
"VERSION" -> "0.19.0",
"VERSION" -> "0.19.0"
),
)
.settings(noPublish)
Expand Down
126 changes: 0 additions & 126 deletions docs/v0/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,6 @@ In `build.sbt`,

```scala
"io.kevinlee" %% "refined4s-core" % "@VERSION@"
```

or for Scala.js

```scala
"io.kevinlee" %%% "refined4s-core" % "@VERSION@"
```

</TabItem>
Expand All @@ -66,12 +60,6 @@ In `build.sbt`,

```scala
libraryDependencies += "io.kevinlee" %% "refined4s-core" % "@VERSION@"
```

or for Scala.js

```scala
libraryDependencies += "io.kevinlee" %%% "refined4s-core" % "@VERSION@"
```

</TabItem>
Expand Down Expand Up @@ -101,12 +89,6 @@ In `build.sbt`,

```scala
"io.kevinlee" %% "refined4s-cats" % "@VERSION@"
```

or for Scala.js

```scala
"io.kevinlee" %%% "refined4s-cats" % "@VERSION@"
```

</TabItem>
Expand All @@ -117,12 +99,6 @@ In `build.sbt`,

```scala
libraryDependencies += "io.kevinlee" %% "refined4s-cats" % "@VERSION@"
```

or for Scala.js

```scala
libraryDependencies += "io.kevinlee" %%% "refined4s-cats" % "@VERSION@"
```

</TabItem>
Expand Down Expand Up @@ -153,12 +129,6 @@ In `build.sbt`,

```scala
"io.kevinlee" %% "refined4s-chimney" % "@VERSION@"
```

or for Scala.js

```scala
"io.kevinlee" %%% "refined4s-chimney" % "@VERSION@"
```

</TabItem>
Expand All @@ -169,12 +139,6 @@ In `build.sbt`,

```scala
libraryDependencies += "io.kevinlee" %% "refined4s-chimney" % "@VERSION@"
```

or for Scala.js

```scala
libraryDependencies += "io.kevinlee" %%% "refined4s-chimney" % "@VERSION@"
```

</TabItem>
Expand Down Expand Up @@ -204,12 +168,6 @@ In `build.sbt`,

```scala
"io.kevinlee" %% "refined4s-circe" % "@VERSION@"
```

or for Scala.js

```scala
"io.kevinlee" %%% "refined4s-circe" % "@VERSION@"
```

</TabItem>
Expand All @@ -220,12 +178,6 @@ In `build.sbt`,

```scala
libraryDependencies += "io.kevinlee" %% "refined4s-circe" % "@VERSION@"
```

or for Scala.js

```scala
libraryDependencies += "io.kevinlee" %%% "refined4s-circe" % "@VERSION@"
```

</TabItem>
Expand Down Expand Up @@ -257,10 +209,6 @@ In `build.sbt`,
"io.kevinlee" %% "refined4s-pureconfig" % "@VERSION@"
```

:::note
Pureconfig doesn't support Scala.js. So, `refined4s-pureconfig` is not available for Scala.js.
:::

</TabItem>

<TabItem value="refined4s-sbt-lib">
Expand All @@ -271,10 +219,6 @@ In `build.sbt`,
libraryDependencies += "io.kevinlee" %% "refined4s-pureconfig" % "@VERSION@"
```

:::note
Pureconfig doesn't support Scala.js. So, `refined4s-pureconfig` is not available for Scala.js.
:::

</TabItem>

<TabItem value="refined4s-scala-cli">
Expand Down Expand Up @@ -304,10 +248,6 @@ In `build.sbt`,
"io.kevinlee" %% "refined4s-doobie-ce2" % "@VERSION@"
```

:::note
Doobie doesn't support Scala.js. So, `refined4s-doobie-ce2` is not available for Scala.js.
:::

</TabItem>

<TabItem value="refined4s-sbt-lib">
Expand All @@ -318,10 +258,6 @@ In `build.sbt`,
libraryDependencies += "io.kevinlee" %% "refined4s-doobie-ce2" % "@VERSION@"
```

:::note
Doobie doesn't support Scala.js. So, `refined4s-doobie-ce2` is not available for Scala.js.
:::

</TabItem>

<TabItem value="refined4s-scala-cli">
Expand Down Expand Up @@ -351,10 +287,6 @@ In `build.sbt`,
"io.kevinlee" %% "refined4s-doobie-ce3" % "@VERSION@"
```

:::note
Doobie doesn't support Scala.js. So, `refined4s-doobie-ce3` is not available for Scala.js.
:::

</TabItem>

<TabItem value="refined4s-sbt-lib">
Expand All @@ -365,10 +297,6 @@ In `build.sbt`,
libraryDependencies += "io.kevinlee" %% "refined4s-doobie-ce3" % "@VERSION@"
```

:::note
Doobie doesn't support Scala.js. So, `refined4s-doobie-ce3` is not available for Scala.js.
:::

</TabItem>

<TabItem value="refined4s-scala-cli">
Expand Down Expand Up @@ -398,12 +326,6 @@ In `build.sbt`,

```scala
"io.kevinlee" %% "refined4s-extras-render" % "@VERSION@"
```

or for Scala.js

```scala
"io.kevinlee" %%% "refined4s-extras-render" % "@VERSION@"
```

</TabItem>
Expand All @@ -414,12 +336,6 @@ In `build.sbt`,

```scala
libraryDependencies += "io.kevinlee" %% "refined4s-extras-render" % "@VERSION@"
```

or for Scala.js

```scala
libraryDependencies += "io.kevinlee" %%% "refined4s-extras-render" % "@VERSION@"
```

</TabItem>
Expand Down Expand Up @@ -451,12 +367,6 @@ In `build.sbt`,

```scala
"io.kevinlee" %% "refined4s-tapir" % "@VERSION@"
```

or for Scala.js

```scala
"io.kevinlee" %%% "refined4s-tapir" % "@VERSION@"
```

</TabItem>
Expand All @@ -467,12 +377,6 @@ In `build.sbt`,

```scala
libraryDependencies += "io.kevinlee" %% "refined4s-tapir" % "@VERSION@"
```

or for Scala.js

```scala
libraryDependencies += "io.kevinlee" %%% "refined4s-tapir" % "@VERSION@"
```

</TabItem>
Expand Down Expand Up @@ -512,20 +416,6 @@ In `build.sbt`,
"io.kevinlee" %% "refined4s-doobie-ce3" % "@VERSION@", // OR refined4s-doobie-ce3
"io.kevinlee" %% "refined4s-extras-render" % "@VERSION@",
"io.kevinlee" %% "refined4s-tapir" % "@VERSION@",
```

or for Scala.js

```scala
"io.kevinlee" %%% "refined4s-core" % "@VERSION@",
"io.kevinlee" %%% "refined4s-cats" % "@VERSION@",
"io.kevinlee" %%% "refined4s-chimney" % "@VERSION@",
"io.kevinlee" %%% "refined4s-circe" % "@VERSION@",
"io.kevinlee" %% "refined4s-pureconfig" % "@VERSION@",
"io.kevinlee" %% "refined4s-doobie-ce2" % "@VERSION@", // Use either refined4s-doobie-ce2
"io.kevinlee" %% "refined4s-doobie-ce3" % "@VERSION@", // OR refined4s-doobie-ce3
"io.kevinlee" %%% "refined4s-extras-render" % "@VERSION@",
"io.kevinlee" %%% "refined4s-tapir" % "@VERSION@",
```

</TabItem>
Expand All @@ -546,22 +436,6 @@ libraryDependencies ++= Seq(
"io.kevinlee" %% "refined4s-extras-render" % "@VERSION@",
"io.kevinlee" %% "refined4s-tapir" % "@VERSION@",
)
```

or for Scala.js

```scala
libraryDependencies ++= Seq(
"io.kevinlee" %%% "refined4s-core" % "@VERSION@",
"io.kevinlee" %%% "refined4s-cats" % "@VERSION@",
"io.kevinlee" %%% "refined4s-chimney" % "@VERSION@",
"io.kevinlee" %%% "refined4s-circe" % "@VERSION@",
"io.kevinlee" %% "refined4s-pureconfig" % "@VERSION@",
"io.kevinlee" %% "refined4s-doobie-ce2" % "@VERSION@", // Use either refined4s-doobie-ce2
"io.kevinlee" %% "refined4s-doobie-ce3" % "@VERSION@", // OR refined4s-doobie-ce3
"io.kevinlee" %%% "refined4s-extras-render" % "@VERSION@",
"io.kevinlee" %%% "refined4s-tapir" % "@VERSION@",
)
```

</TabItem>
Expand Down
1 change: 1 addition & 0 deletions website/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ yarn-error.log*
package-lock.json

/versioned_docs
/latestVersion.json
5 changes: 4 additions & 1 deletion website/docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {themes as prismThemes} from 'prism-react-renderer';
import type {Config} from '@docusaurus/types';
import type * as Preset from '@docusaurus/preset-classic';

import LatestVersion from '@types/commonTypes';

const algoliaConfig = require('./algolia.config.json');
const googleAnalyticsConfig = require('./google-analytics.config.json');
Expand All @@ -17,6 +18,8 @@ const isEmptyObject = (obj: object) => Object.keys(obj).length === 0;
const isSearchable = !isEmptyObject(algoliaConfig);
const hasGoogleAnalytics = !isEmptyObject(googleAnalyticsConfig);

import LatestVersionImported from './latestVersion.json';
const latestVersionFound = LatestVersionImported as LatestVersion;

const config: Config = {
title: 'Refined4s',
Expand Down Expand Up @@ -59,7 +62,7 @@ const config: Config = {
"path": "v0",
},
"current": {
"label": "latest",
"label": `v${latestVersionFound.version}`,
},
}
},
Expand Down
Loading

0 comments on commit 1ee5d0d

Please sign in to comment.