Skip to content

Commit

Permalink
Upgrade docusaurus 3.0.0 (#126)
Browse files Browse the repository at this point in the history
  • Loading branch information
agilelab-tmnd1991 authored Nov 2, 2023
1 parent 37a065b commit 9149059
Show file tree
Hide file tree
Showing 8 changed files with 4,115 additions and 2,021 deletions.
15 changes: 13 additions & 2 deletions docsite/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
import com.github.gradle.node.npm.task.NpmTask
import java.util.stream.Collectors

abstract class KillAllDocusaurus : DefaultTask() {
@TaskAction
fun destroy() {
project.logger.lifecycle("Killing ALL Docusaurus processes")
val docusarusProcesses =
ProcessHandle
.allProcesses()
.filter { p -> p.info().commandLine().orElse("").contains("docusaurus start") }
.forEach(ProcessHandle::destroy)
.collect(Collectors.toList())
project.logger.lifecycle("Found ${docusarusProcesses.size} processes to kill")
docusarusProcesses
.forEach { p ->
project.logger.lifecycle("Killing Docusaurus process ${p.pid()}")
p.destroy()
}
}
}

Expand All @@ -25,4 +34,6 @@ node {
version = "20.9.0"
}

tasks.register<KillAllDocusaurus>("killAllDocusaurus")
val killAllDocusaurus = tasks.register<KillAllDocusaurus>("killAllDocusaurus")

tasks.findByName("npm_run_start")?.finalizedBy(killAllDocusaurus)
2 changes: 1 addition & 1 deletion docsite/docs/architecture/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ toc_max_heading_level: 5
---
# Architecture

Unders this section architectural design decisions are collected.
Under this section architectural design decisions are collected.
2 changes: 1 addition & 1 deletion docsite/docs/architecture/memos/001_Memo.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@

- Client libs coupling: we don’t want to embed into our lib the ones related to the support table and file formats.
- Our clients will have a soft dependency, the users will need to couple their own Iceberg/Hudi/Delta libs and load in their runtime
- The versions used for writing is included in the metadata, we assume the clients will always be able to read with libs version x everything written with versions <= x.
- The versions used for writing is included in the metadata, we assume the clients will always be able to read with libs version x everything written with versions \<= x.
- The server will load its own dependencies (ideally latest iceberg/delta/hudi standalone libraries)
- Follow a cloud-native and decoupled approach for infrastructural dependencies (e.g. the underlying DB to host metadata shouldn't be a hard dependency, users should be able to plug the DB of their choice as long as it provides the APIs we need)
6 changes: 3 additions & 3 deletions docsite/docs/development_guidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ to "serve" the documentation server locally you can simply issue:
./gradlew docsite:npm_run_start
```

this will start a server on port 3000 on localhost where you can preview the result. The problem is that even if you kill
the gradle terminal (with ctrl+c) the node process will keep running. You will need to kill it with
`./gradlew docsite:killAllDocusaurus`
this will start a server on port 3000 on localhost where you can preview the result. When you kill
the gradle terminal (with ctrl+c) the node process will be killed automatically by the custom gradleTask
`killAllDocusaurus` (that you can also run manually through `./gradlew docsite:killAllDocusaurus`).

The *only* thing that will differ on the published site is that the `protocol` is copied to `docsite/static/protocol`
in order to have a "working" swagger UI. If you want to reproduce the same locally and have a working swagger UI at
Expand Down
61 changes: 28 additions & 33 deletions docsite/docs/protocols/delta-sharing-protocol.md

Large diffs are not rendered by default.

16 changes: 9 additions & 7 deletions docsite/docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion
// `@type` JSDoc annotations allow editor autocompletion and type checking
// (when paired with `@ts-check`).
// There are various equivalent ways to declare your Docusaurus config.
// See: https://docusaurus.io/docs/api/docusaurus-config

const lightCodeTheme = require('prism-react-renderer/themes/github');
const darkCodeTheme = require('prism-react-renderer/themes/dracula');
import {themes as prismThemes} from 'prism-react-renderer';

/** @type {import('@docusaurus/types').Config} */
const config = {
Expand Down Expand Up @@ -40,15 +42,15 @@ const config = {
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
sidebarPath: require.resolve('./sidebars.js'),
sidebarPath: './sidebars.js',
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
editUrl:
'https://github.com/agile-lab-dev/whitefox/tree/main/docsite/',
},
blog: false,
theme: {
customCss: require.resolve('./src/css/custom.css'),
customCss: './src/css/custom.css',
},
}),
],
Expand Down Expand Up @@ -121,8 +123,8 @@ const config = {
copyright: `Copyright © ${new Date().getFullYear()} Whitefox. Built with Docusaurus.`,
},
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
theme: prismThemes.github,
darkTheme: prismThemes.dracula,
},
}),
};
Expand Down
Loading

0 comments on commit 9149059

Please sign in to comment.