Skip to content

Commit 9fe2a3b

Browse files
Update docusaurus, yarn, and 3rd part dependencies (#94)
* Upgrade to Yarn 4 * Add plugin-content-docs as it generates warning since upgrade of yarn 1 to 4 * Fix an issue related to mermaid plugin upgrade * Address deprecation notice (removal warning starting with docusaurus v4) That way we are ready for later upgrade * Adapt other pipelines
1 parent 4d48f1d commit 9fe2a3b

File tree

7 files changed

+13633
-9698
lines changed

7 files changed

+13633
-9698
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,12 @@ jobs:
1919
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
2020
with:
2121
node-version: 21
22+
- name: Use yarn 4.12
23+
run: |
24+
corepack enable
25+
corepack prepare yarn@4.12.0 --activate
2226
- name: Install dependencies
23-
run: yarn install --frozen-lockfile
27+
run: yarn install --immutable
2428
- name: Build documentation website
2529
# Check paths are valid, markdown, etc.
2630
run: yarn build

.github/workflows/deploy.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,12 @@ jobs:
1717
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
1818
with:
1919
node-version: 21
20+
- name: Use yarn 4.12
21+
run: |
22+
corepack enable
23+
corepack prepare yarn@4.12.0 --activate
2024
- name: Install dependencies
21-
run: yarn install --frozen-lockfile
25+
run: yarn install --immutable
2226
- name: Build website
2327
run: yarn build
2428
# Popular action to deploy to GitHub Pages:

.github/workflows/pushpreview.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,18 @@ jobs:
2525

2626
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
2727
with:
28-
node-version: 18
28+
node-version: 21
29+
- name: Use yarn 4.12
30+
run: |
31+
corepack enable
32+
corepack prepare yarn@4.12.0 --activate
2933
3034
- name: Set BASE_URL
3135
run: echo "BASE_URL=/github/${{ github.repository }}/${{ github.event.number }}/" >> $GITHUB_ENV
3236

3337
- name: Build site
3438
run: |
35-
yarn install --frozen-lockfile
39+
yarn install --immutable
3640
yarn build
3741
3842
- name: Generate preview

docs/advanced/architecture.md

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ title: Architecture
33
sidebar_position: 7
44
---
55

6-
import Centered from '@site/src/components/Centered';
76
import Label from '@site/src/components/Label';
7+
import Centered from '@site/src/components/Centered';
8+
import BrowserOnly from '@docusaurus/BrowserOnly';
89

910
# Architecture
1011

@@ -26,24 +27,30 @@ There are 3 software components written for the NSPanel Manager project:
2627

2728
## Data flow
2829

30+
2931
<Centered>
30-
```mermaid
31-
flowchart TD
32-
HAS(Home Assistant/OpenHAB)
33-
NSPM(NSPanel Manager container)
34-
MQTT(MQTT Server)
35-
NSP1(NSPanel 1)
36-
NSP2(NSPanel 2)
37-
HAS <--> NSPM
38-
NSPM <--> NSP1
39-
NSPM <--> NSP2
40-
MQTT <--> HAS
41-
MQTT <--> NSPM
42-
MQTT <--> NSP1
43-
MQTT <--> NSP2
44-
```
32+
<BrowserOnly fallback={<div>Loading diagram...</div>}>
33+
{() => (
34+
<div className="mermaid">
35+
{`
36+
flowchart TD
37+
HAS(Home Assistant/OpenHAB)
38+
NSPM(NSPanel Manager container)
39+
MQTT(MQTT Server)
40+
NSP1(NSPanel 1)
41+
NSP2(NSPanel 2)
42+
HAS <--> NSPM
43+
NSPM <--> NSP1
44+
NSPM <--> NSP2
45+
MQTT <--> HAS
46+
MQTT <--> NSPM
47+
MQTT <--> NSP1
48+
MQTT <--> NSP2
49+
`}
50+
</div>
51+
)}
52+
</BrowserOnly>
4553
</Centered>
46-
4754
The data flow within NSPanel Manager might look intimidating but it’s not that bad. Below is an explanation of all the
4855
arrows above.
4956

docusaurus.config.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ const config: Config = {
2121
projectName: 'NSPanelManager-docs',
2222

2323
onBrokenLinks: 'throw',
24-
onBrokenMarkdownLinks: 'warn',
2524

2625
// Even if you don't use internationalization, you can use this field to set
2726
// useful metadata like html lang. For example, if your site is Chinese, you
@@ -35,6 +34,9 @@ const config: Config = {
3534

3635
markdown: {
3736
mermaid: true,
37+
hooks: {
38+
onBrokenMarkdownLinks: 'warn',
39+
}
3840
},
3941

4042
presets: [

package.json

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,24 @@
1515
"typecheck": "tsc"
1616
},
1717
"dependencies": {
18-
"@docusaurus/core": "^3.8.1",
19-
"@docusaurus/preset-classic": "^3.8.1",
20-
"@docusaurus/theme-mermaid": "^3.8.1",
21-
"@mdx-js/react": "^3.0.0",
22-
"clsx": "^2.0.0",
18+
"@docusaurus/core": "^3.9.2",
19+
"@docusaurus/plugin-content-docs": "3.9.2",
20+
"@docusaurus/preset-classic": "^3.9.2",
21+
"@docusaurus/theme-mermaid": "^3.9.2",
22+
"@mdx-js/react": "^3.1.1",
23+
"clsx": "^2.1.1",
2324
"prism-react-renderer": "^2.4.1",
24-
"react": "^19.0.0",
25-
"react-dom": "^19.0.0"
25+
"react": "^19.2.1",
26+
"react-dom": "^19.2.1"
2627
},
2728
"devDependencies": {
28-
"@docusaurus/module-type-aliases": "^3.8.1",
29-
"@docusaurus/tsconfig": "^3.8.1",
30-
"@docusaurus/types": "^3.7.0",
31-
"typescript": "~5.9.2"
29+
"@docusaurus/module-type-aliases": "^3.9.2",
30+
"@docusaurus/tsconfig": "^3.9.2",
31+
"@docusaurus/types": "^3.9.2",
32+
"typescript": "~5.9.3"
33+
},
34+
"resolutions": {
35+
"mermaid": "10.9.0"
3236
},
3337
"browserslist": {
3438
"production": [

0 commit comments

Comments
 (0)