From d28a63ae6b5c03cd3369177d74bcb7b325a4b7c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Wa=C5=82ach?= Date: Tue, 14 Oct 2025 17:51:43 +0200 Subject: [PATCH 1/4] chore: improve changelog generation --- .../ListChangelogs/ListChangelogs.jsx | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/components/ListChangelogs/ListChangelogs.jsx b/src/components/ListChangelogs/ListChangelogs.jsx index be8d067cc..b434a04bb 100644 --- a/src/components/ListChangelogs/ListChangelogs.jsx +++ b/src/components/ListChangelogs/ListChangelogs.jsx @@ -66,17 +66,27 @@ export default function ListChangelogs({ dir }) { if (!ctx) return

No changelogs for "{dir}"

const keys = ctx.keys().sort(compareSemverDesc) - const Components = keys.map((k) => ctx(k).default) + const modules = keys.map((k) => ({ key: k, mod: ctx(k) })) + //const Components = modules.map((m) => m.mod.default) return ( <> - {Components.map((Comp, i) => { + {modules.map(({ key, mod }, i) => { + const Comp = mod.default const basename = baseFromPath(keys[i]) const version = extractVersion(basename) - // const id = slugify(version); + const hasContentTitle = Boolean(mod.contentTitle) + return ( -
- +
+ {hasContentTitle ? ( + + ) : ( + <> + {version} +

No changelog entries for this release.

+ + )}
) From 3435de42743ec70a8a85abb724bf79de49f220f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Wa=C5=82ach?= Date: Tue, 14 Oct 2025 23:34:59 +0200 Subject: [PATCH 2/4] chore: u --- .../ListChangelogs/ListChangelogs.jsx | 53 +++++++++++++++---- 1 file changed, 42 insertions(+), 11 deletions(-) diff --git a/src/components/ListChangelogs/ListChangelogs.jsx b/src/components/ListChangelogs/ListChangelogs.jsx index b434a04bb..9cad8b052 100644 --- a/src/components/ListChangelogs/ListChangelogs.jsx +++ b/src/components/ListChangelogs/ListChangelogs.jsx @@ -29,6 +29,34 @@ const contexts = { ), } +const rawContexts = { + keto: require.context( + "!!raw-loader!../../../docs/self-hosted/oel/keto/changelog", + false, + /\.md$/, + ), + kratos: require.context( + "!!raw-loader!../../../docs/self-hosted/oel/kratos/changelog", + false, + /\.md$/, + ), + oathkeeper: require.context( + "!!raw-loader!../../../docs/self-hosted/oel/oathkeeper/changelog", + false, + /\.md$/, + ), + oauth2: require.context( + "!!raw-loader!../../../docs/self-hosted/oel/oauth2/changelog", + false, + /\.md$/, + ), + polis: require.context( + "!!raw-loader!../../../docs/self-hosted/oel/polis/changelog", + false, + /\.md$/, + ), +} + function baseFromPath(p) { // "./v1.3.2.md" -> "v1.3.2" ; "./CHANGELOG_2.0.md" -> "CHANGELOG_2.0" return p.replace("./", "").replace(/\.md$/, "") @@ -63,29 +91,32 @@ function compareSemverDesc(a, b) { export default function ListChangelogs({ dir }) { const ctx = contexts[dir] + const rawCtx = rawContexts[dir] if (!ctx) return

No changelogs for "{dir}"

const keys = ctx.keys().sort(compareSemverDesc) - const modules = keys.map((k) => ({ key: k, mod: ctx(k) })) - //const Components = modules.map((m) => m.mod.default) + const Components = keys.map((k) => ctx(k).default) + const raws = rawCtx ? keys.map((k) => { + const mod = rawCtx(k) + return typeof mod === "string" ? mod : mod.default + }) : keys.map(() => "") return ( <> - {modules.map(({ key, mod }, i) => { - const Comp = mod.default + {Components.map((Comp, i) => { const basename = baseFromPath(keys[i]) const version = extractVersion(basename) - const hasContentTitle = Boolean(mod.contentTitle) - + const raw = raws[i] || "" + const isNoChanges = /no changelog entries found/i.test(raw.trim()) return ( -
- {hasContentTitle ? ( - - ) : ( +
+ {isNoChanges ? ( <> {version} -

No changelog entries for this release.

+

No changes requiring changelog in the {version}.

+ ) : ( + )}
From 9a748a341515448a2edd352a99a535327cf8d7bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Wa=C5=82ach?= Date: Mon, 20 Oct 2025 09:38:30 +0200 Subject: [PATCH 3/4] chore: format --- src/components/ListChangelogs/ListChangelogs.jsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/components/ListChangelogs/ListChangelogs.jsx b/src/components/ListChangelogs/ListChangelogs.jsx index 9cad8b052..96910044c 100644 --- a/src/components/ListChangelogs/ListChangelogs.jsx +++ b/src/components/ListChangelogs/ListChangelogs.jsx @@ -96,10 +96,12 @@ export default function ListChangelogs({ dir }) { const keys = ctx.keys().sort(compareSemverDesc) const Components = keys.map((k) => ctx(k).default) - const raws = rawCtx ? keys.map((k) => { - const mod = rawCtx(k) - return typeof mod === "string" ? mod : mod.default - }) : keys.map(() => "") + const raws = rawCtx + ? keys.map((k) => { + const mod = rawCtx(k) + return typeof mod === "string" ? mod : mod.default + }) + : keys.map(() => "") return ( <> From 49ebd2459605ad59eba8d9567acec5bab7ea8676 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Wa=C5=82ach?= Date: Mon, 3 Nov 2025 12:28:25 +0100 Subject: [PATCH 4/4] chore: update --- src/components/ListChangelogs/ListChangelogs.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/ListChangelogs/ListChangelogs.jsx b/src/components/ListChangelogs/ListChangelogs.jsx index 96910044c..32bcbdb85 100644 --- a/src/components/ListChangelogs/ListChangelogs.jsx +++ b/src/components/ListChangelogs/ListChangelogs.jsx @@ -115,7 +115,7 @@ export default function ListChangelogs({ dir }) { {isNoChanges ? ( <> {version} -

No changes requiring changelog in the {version}.

+

No changes requiring a changelog in the {version}.

) : (