Skip to content

Commit 216e95e

Browse files
authored
Refactor code structure for improved readability and maintainability (#309)
2 parents 83dbf80 + 19ad916 commit 216e95e

File tree

12 files changed

+855
-973
lines changed

12 files changed

+855
-973
lines changed

.github/actions/build-artifacts/action.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ inputs:
55
description: 'A Github PAT'
66
required: true
77
runs:
8-
using: "composite"
8+
using: 'composite'
99
steps:
1010
- uses: ./.github/actions/pnpm-setup
1111

@@ -15,11 +15,11 @@ runs:
1515

1616
- uses: actions/setup-node@v4
1717
with:
18-
node-version: 20
19-
registry-url: "https://npm.pkg.github.com"
20-
scope: "@public-ui"
18+
node-version: 22
19+
registry-url: 'https://npm.pkg.github.com'
20+
scope: '@public-ui'
2121

22-
- name: Download Docs (2.2)
22+
- name: Download Docs (v2)
2323
env:
2424
NODE_AUTH_TOKEN: ${{ inputs.PERSONAL_ACCESS_TOKEN }}
2525
shell: bash
@@ -28,9 +28,9 @@ runs:
2828
npm pack @public-ui/docs-v2@latest > /dev/null
2929
tar -xzvf public-ui-docs-*.tgz > /dev/null
3030
31-
rm -rf build/docs/2.2
32-
mkdir -p build/docs/2.2
33-
mv package/build/* build/docs/2.2/
31+
rm -rf build/docs/2.2 build/v2
32+
mkdir -p build/v2
33+
mv package/build/* build/v2/
3434
3535
rm -rf package *.tgz
3636

.github/actions/pnpm-setup/action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@
55
name: pnpm Setup
66
description: Install Node and pnpm, install dependencies
77
runs:
8-
using: "composite"
8+
using: 'composite'
99
steps:
1010
- uses: pnpm/action-setup@v4
1111
with:
12-
version: 9
12+
version: 10
1313
run_install: false
1414

1515
- uses: actions/setup-node@v4
1616
with:
17-
node-version: '20'
17+
node-version: '22'
1818
cache: 'pnpm'
1919

2020
- run: pnpm install

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- uses: ./.github/actions/pnpm-setup
1717

1818
- name: Lint
19-
run: pnpm run lint:hard
19+
run: pnpm run lint
2020

2121
- name: Build
2222
run: pnpm run build

.github/workflows/dod-checker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ concurrency:
99

1010
jobs:
1111
check-dod:
12-
runs-on: ubuntu-24.04
12+
runs-on: ubuntu-latest
1313
steps:
1414
- name: Print Pull Request ID
1515
run: |

docusaurus.config.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33

44
const { themes } = require('prism-react-renderer');
55

6-
const PUBLIC_BASE_URL = 'https://public-ui.github.io/';
6+
const PUBLIC_BASE_URL = 'https://public-ui.github.io';
77

88
/** @type {import('@docusaurus/types').Config} */
99
const config = {
1010
title: 'KoliBri - Public UI',
1111
tagline: 'The accessible Web Component Library',
12-
url: 'https://public-ui.github.io',
12+
url: PUBLIC_BASE_URL,
1313
baseUrl: '/',
1414
onBrokenLinks: 'throw',
1515
trailingSlash: false,
@@ -97,16 +97,16 @@ const config = {
9797
position: 'left',
9898
dropdownActiveClassDisabled: true,
9999
dropdownItemsAfter: [
100+
{ to: `${PUBLIC_BASE_URL}/v2/`, label: 'Version 2' },
100101
{
101102
type: 'html',
102103
value: '<hr class="dropdown-separator">',
103104
},
104105
{
105106
type: 'html',
106107
className: 'dropdown-archived-versions',
107-
value: '<b>Archive</b>',
108+
value: '<span class="dropdown__link">Version 1</span>',
108109
},
109-
{ to: `${PUBLIC_BASE_URL}docs/2.2/`, label: '2.2' },
110110
],
111111
},
112112
{

i18n/de/code.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,5 +350,8 @@
350350
},
351351
"custom.view-component-example": {
352352
"message": "Beispiel der Komponente ansehen"
353+
},
354+
"custom.docs-version-hint": {
355+
"message": "Diese Dokumentation behandelt KoliBri - Public UI {version}. Die aktuellste Dokumentation finden Sie hier: {link}"
353356
}
354357
}

i18n/en/code.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,5 +350,8 @@
350350
},
351351
"custom.view-component-example": {
352352
"message": "View the example of the component"
353+
},
354+
"custom.docs-version-hint": {
355+
"message": "This documentation covers KoliBri - Public UI {version}. You can find the latest documentation here: {link}"
353356
}
354357
}

package.json

Lines changed: 37 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "root",
3-
"private": true,
2+
"name": "@public-ui/docs-v3",
3+
"version": "3.0.0-rc.7",
44
"scripts": {
55
"clean": "git clean -f -d -X",
66
"clean:branches": "git branch --merged | grep -v \\* | xargs git branch -D",
@@ -15,20 +15,21 @@
1515
"write-translations": "npm run gen:doc && docusaurus write-translations",
1616
"write-heading-ids": "npm run gen:doc && docusaurus write-heading-ids",
1717
"format": "prettier blog docs src -c",
18-
"lint": "eslint src",
19-
"lint:hard": "tsc --noemit && eslint src",
18+
"lint": "tsc --noemit && eslint src",
2019
"ncu:major": "ncu",
2120
"ncu:minor": "ncu -t minor -u",
2221
"ncu:patch": "ncu -t patch -u",
2322
"gen:doc": "node scripts/autogen.doc.js",
2423
":prepack": "npm run build",
2524
"unused": "knip",
26-
"postinstall": "npm-run-all postinstall:*",
25+
"postinstall": "npm-run-all2 postinstall:*",
2726
"postinstall:components-assets": "cpy \"node_modules/@public-ui/components/assets/**/*\" static/assets --dot",
2827
"postinstall:themes-assets": "cpy \"node_modules/@public-ui/theme-default/assets/**/*\" static/assets --dot",
29-
"update": "pnpm ncu:minor && pnpm ncu:major",
30-
"regenerate:version": "rimraf i18n/en/docusaurus-plugin-content-docs/version-2.0 versioned_docs/version-2.0 versioned_readmes/2.0 versioned_sidebars/version-2.0-sidebars.json && npm run docusaurus docs:version 2.0"
28+
"update": "pnpm ncu:minor && pnpm ncu:major"
3129
},
30+
"files": [
31+
"build"
32+
],
3233
"dependencies": {
3334
"@docusaurus/core": "3.7.0",
3435
"@docusaurus/eslint-plugin": "3.7.0",
@@ -41,46 +42,54 @@
4142
"@leanup/form": "1.3.54",
4243
"@mdx-js/react": "3.1.0",
4344
"@monaco-editor/react": "4.7.0",
44-
"@public-ui/components": "3.0.0-rc.6",
45-
"@public-ui/react": "3.0.0-rc.6",
46-
"@public-ui/theme-default": "3.0.0-rc.6",
45+
"@public-ui/components": "3.0.0-rc.7",
46+
"@public-ui/react": "3.0.0-rc.7",
47+
"@public-ui/theme-default": "3.0.0-rc.7",
4748
"classnames": "2.5.1",
4849
"docusaurus-lunr-search": "3.6.1",
49-
"mermaid": "11.4.1",
50+
"mermaid": "11.6.0",
5051
"prettier": "2.8.8",
51-
"react": "19.0.0",
52-
"react-dom": "19.0.0",
53-
"read-excel-file": "5.8.6"
52+
"react": "19.1.0",
53+
"react-dom": "19.1.0",
54+
"read-excel-file": "5.8.7"
5455
},
5556
"devDependencies": {
5657
"@docsearch/react": "3.9.0",
5758
"@docusaurus/module-type-aliases": "3.7.0",
59+
"@docusaurus/plugin-content-docs": "3.7.0",
60+
"@docusaurus/theme-classic": "3.7.0",
61+
"@docusaurus/theme-common": "3.7.0",
5862
"@docusaurus/types": "3.7.0",
59-
"@eslint/eslintrc": "3.3.0",
60-
"@eslint/js": "9.21.0",
63+
"@docusaurus/utils": "3.7.0",
64+
"@eslint/eslintrc": "3.3.1",
65+
"@eslint/js": "9.25.1",
6166
"@tsconfig/docusaurus": "2.0.3",
67+
"@types/node": "22.15.3",
6268
"@types/prettier": "2.7.3",
63-
"@typescript-eslint/eslint-plugin": "8.25.0",
64-
"@typescript-eslint/parser": "8.25.0",
65-
"adopted-style-sheets": "1.1.7",
66-
"autoprefixer": "10.4.20",
69+
"@types/react": "19.1.2",
70+
"@typescript-eslint/eslint-plugin": "8.31.0",
71+
"@typescript-eslint/parser": "8.31.0",
72+
"adopted-style-sheets": "1.1.8",
73+
"autoprefixer": "10.4.21",
6774
"cpy-cli": "5.0.0",
6875
"depcheck": "1.4.7",
6976
"docusaurus-plugin-sass": "0.2.6",
70-
"eslint": "9.21.0",
77+
"eslint": "9.25.1",
7178
"eslint-plugin-jsx-a11y": "6.10.2",
72-
"eslint-plugin-mdx": "3.1.5",
73-
"eslint-plugin-react": "7.37.4",
79+
"eslint-plugin-mdx": "3.4.1",
80+
"eslint-plugin-react": "7.37.5",
7481
"html-minifier-terser": "7.2.0",
75-
"knip": "5.45.0",
76-
"npm-check-updates": "17.1.15",
77-
"npm-run-all": "4.1.5",
82+
"knip": "5.50.5",
83+
"lunr": "2.3.9",
84+
"npm-check-updates": "18.0.1",
85+
"npm-run-all2": "7.0.2",
7886
"postcss": "8.5.3",
87+
"prism-react-renderer": "2.4.1",
7988
"prop-types": "15.8.1",
8089
"rimraf": "3.0.2",
81-
"sass": "1.85.1",
90+
"sass": "1.87.0",
8291
"tailwindcss": "3.4.17",
83-
"typescript": "5.7.3"
92+
"typescript": "5.8.3"
8493
},
8594
"browserslist": {
8695
"production": [

0 commit comments

Comments
 (0)