From b387f4b2d255f9f2f2af4ff2ee3c3a93b15cdbaa Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 13 May 2026 08:33:48 +0000 Subject: [PATCH 1/3] feat: dynamically inject latest QuickFIX/J release version at build time Agent-Logs-Url: https://github.com/quickfix-j/quickfixj-pages/sessions/329396b6-0dea-4ef0-824d-8b6ec208d36f Co-authored-by: chrjohn <6644028+chrjohn@users.noreply.github.com> --- .github/workflows/deploy.yml | 3 + docs/examples.md | 4 +- docs/overview.md | 4 +- docusaurus.config.ts | 314 ++++++++++++++++++++--------------- src/pages/index.tsx | 6 +- 5 files changed, 193 insertions(+), 138 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 63487f0..90fa1c4 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -5,6 +5,9 @@ on: branches: - main - master + # Rebuild nightly so the latest QuickFIX/J release version is always reflected + schedule: + - cron: '0 3 * * *' # Allows you to run this workflow manually from the Actions tab workflow_dispatch: diff --git a/docs/examples.md b/docs/examples.md index 414501f..d4aaa24 100644 --- a/docs/examples.md +++ b/docs/examples.md @@ -16,8 +16,8 @@ QuickFIX/J comes with several example applications located in the `quickfix/exam The QuickFIX/J version number can be determined by running the core JAR file from the command line: ```bash -java -jar quickfixj-core-3.0.0.jar +java -jar quickfixj-core-{{QUICKFIXJ_VERSION}}.jar # Output: -# Version: 3.0.0 +# Version: {{QUICKFIXJ_VERSION}} ``` diff --git a/docs/overview.md b/docs/overview.md index 88ab347..9e9a52e 100644 --- a/docs/overview.md +++ b/docs/overview.md @@ -40,14 +40,14 @@ To start using QuickFIX/J, add the following dependencies to your `pom.xml`. Qui org.quickfixj quickfixj-core - 3.0.0 + {{QUICKFIXJ_VERSION}} org.quickfixj quickfixj-messages-fix44 - 3.0.0 + {{QUICKFIXJ_VERSION}} ``` diff --git a/docusaurus.config.ts b/docusaurus.config.ts index c1a1c94..93d347a 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -1,151 +1,201 @@ import {themes as prismThemes} from 'prism-react-renderer'; import type {Config} from '@docusaurus/types'; import type * as Preset from '@docusaurus/preset-classic'; +import type {Plugin} from 'unified'; +import type {Node} from 'unist'; +import type {Root} from 'mdast'; -const config: Config = { - title: 'QuickFIX/J', - tagline: 'The Open Source FIX Protocol Engine for Java', - favicon: 'img/favicon.png', +const VERSION_PLACEHOLDER = '{{QUICKFIXJ_VERSION}}'; +const VERSION_FALLBACK = '3.0.0'; - future: { - v4: true, - }, +async function fetchLatestVersion(fallback: string): Promise { + try { + const response = await fetch( + 'https://api.github.com/repos/quickfix-j/quickfixj/releases/latest', + {headers: {'User-Agent': 'quickfixj-pages-docusaurus'}}, + ); + if (!response.ok) { + console.warn(`GitHub API returned ${response.status}, using fallback version ${fallback}`); + return fallback; + } + const data = (await response.json()) as {tag_name: string}; + return data.tag_name.replace(/^v/, ''); + } catch (err) { + console.warn(`Failed to fetch latest QuickFIX/J version: ${err}. Using fallback ${fallback}`); + return fallback; + } +} - url: 'https://quickfixj.org', // Placeholder URL - baseUrl: process.env.BASE_URL || '/', +// Remark plugin that replaces {{QUICKFIXJ_VERSION}} in all markdown text, +// inline-code, and fenced-code-block nodes at build time. +function versionReplacerPlugin(version: string): Plugin<[], Root> { + return () => (tree: Root) => { + function walk(node: Node & {value?: string; children?: Node[]}) { + if ( + ['text', 'inlineCode', 'code'].includes(node.type) && + typeof node.value === 'string' + ) { + node.value = node.value.replaceAll(VERSION_PLACEHOLDER, version); + } + if (Array.isArray(node.children)) { + node.children.forEach(walk); + } + } + walk(tree); + }; +} - organizationName: 'quickfix-j', - projectName: 'quickfixj', +export default async function createConfig(): Promise { + const quickfixjVersion = await fetchLatestVersion(VERSION_FALLBACK); - onBrokenLinks: 'throw', + return { + title: 'QuickFIX/J', + tagline: 'The Open Source FIX Protocol Engine for Java', + favicon: 'img/favicon.png', - i18n: { - defaultLocale: 'en', - locales: ['en'], - }, + future: { + v4: true, + }, - markdown: { - mermaid: true, - }, + url: 'https://quickfixj.org', // Placeholder URL + baseUrl: process.env.BASE_URL || '/', - themes: ['@docusaurus/theme-mermaid'], + organizationName: 'quickfix-j', + projectName: 'quickfixj', - presets: [ - [ - 'classic', - { - docs: { - sidebarPath: './sidebars.ts', - editUrl: 'https://github.com/quickfix-j/quickfixj-pages/edit/main/', - }, - blog: false, // Disabling blog for a purely technical docs site - theme: { - customCss: './src/css/custom.css', - }, - } satisfies Preset.Options, - ], - ], + onBrokenLinks: 'throw', - themeConfig: { - image: 'img/quickfixj-social-card.jpg', - announcementBar: { - id: 'quickfixj_news', - content: - '⚡ QuickFIX/J — The industry standard open source FIX engine for Java. Star us on GitHub', - isCloseable: true, + i18n: { + defaultLocale: 'en', + locales: ['en'], }, - colorMode: { - defaultMode: 'dark', - disableSwitch: false, - respectPrefersColorScheme: true, + + markdown: { + mermaid: true, }, - navbar: { - title: 'QuickFIX/J', - logo: { - alt: 'QuickFIX/J Logo', - src: 'img/logo.png', - srcDark: 'img/logo-dark.png', - }, - items: [ - { - type: 'docSidebar', - sidebarId: 'docsSidebar', - position: 'left', - label: 'Documentation', - }, - { - to: '/docs/architecture', - label: 'Core Concepts', - position: 'left', - }, - { - to: '/docs/developer-docs', - label: 'Developer Guide', - position: 'left', - }, - { - to: '/docs/acceptor-dynamic', - label: 'Advanced Topics', - position: 'left', - }, - { - href: 'https://github.com/quickfix-j/quickfixj', - label: 'GitHub', - position: 'right', - }, - ], + + themes: ['@docusaurus/theme-mermaid'], + + customFields: { + quickfixjVersion, }, - footer: { - style: 'dark', - links: [ - { - title: 'Learn', - items: [ - { - label: 'Overview', - to: '/docs/overview', - }, - { - label: 'Architecture', - to: '/docs/architecture', - }, - { - label: 'Configuration', - to: '/docs/configuration', - }, - ], - }, - { - title: 'Community', - items: [ - { - label: 'Mailing List', - href: 'https://sourceforge.net/p/quickfixj/mailman/', - }, - { - label: 'Stack Overflow', - href: 'https://stackoverflow.com/questions/tagged/quickfixj', - }, - ], - }, + + presets: [ + [ + 'classic', { - title: 'More', - items: [ - { - label: 'GitHub', - href: 'https://github.com/quickfix-j/quickfixj', - }, - ], - }, + docs: { + sidebarPath: './sidebars.ts', + editUrl: 'https://github.com/quickfix-j/quickfixj-pages/edit/main/', + remarkPlugins: [versionReplacerPlugin(quickfixjVersion)], + }, + blog: false, // Disabling blog for a purely technical docs site + theme: { + customCss: './src/css/custom.css', + }, + } satisfies Preset.Options, ], - copyright: `Copyright © ${new Date().getFullYear()} QuickFIX/J Contributors. Built with Docusaurus.`, - }, - prism: { - theme: prismThemes.github, - darkTheme: prismThemes.dracula, - additionalLanguages: ['java', 'properties', 'bash'], - }, - } satisfies Preset.ThemeConfig, -}; + ], -export default config; + themeConfig: { + image: 'img/quickfixj-social-card.jpg', + announcementBar: { + id: 'quickfixj_news', + content: + '⚡ QuickFIX/J — The industry standard open source FIX engine for Java. Star us on GitHub', + isCloseable: true, + }, + colorMode: { + defaultMode: 'dark', + disableSwitch: false, + respectPrefersColorScheme: true, + }, + navbar: { + title: 'QuickFIX/J', + logo: { + alt: 'QuickFIX/J Logo', + src: 'img/logo.png', + srcDark: 'img/logo-dark.png', + }, + items: [ + { + type: 'docSidebar', + sidebarId: 'docsSidebar', + position: 'left', + label: 'Documentation', + }, + { + to: '/docs/architecture', + label: 'Core Concepts', + position: 'left', + }, + { + to: '/docs/developer-docs', + label: 'Developer Guide', + position: 'left', + }, + { + to: '/docs/acceptor-dynamic', + label: 'Advanced Topics', + position: 'left', + }, + { + href: 'https://github.com/quickfix-j/quickfixj', + label: 'GitHub', + position: 'right', + }, + ], + }, + footer: { + style: 'dark', + links: [ + { + title: 'Learn', + items: [ + { + label: 'Overview', + to: '/docs/overview', + }, + { + label: 'Architecture', + to: '/docs/architecture', + }, + { + label: 'Configuration', + to: '/docs/configuration', + }, + ], + }, + { + title: 'Community', + items: [ + { + label: 'Mailing List', + href: 'https://sourceforge.net/p/quickfixj/mailman/', + }, + { + label: 'Stack Overflow', + href: 'https://stackoverflow.com/questions/tagged/quickfixj', + }, + ], + }, + { + title: 'More', + items: [ + { + label: 'GitHub', + href: 'https://github.com/quickfix-j/quickfixj', + }, + ], + }, + ], + copyright: `Copyright © ${new Date().getFullYear()} QuickFIX/J Contributors. Built with Docusaurus.`, + }, + prism: { + theme: prismThemes.github, + darkTheme: prismThemes.dracula, + additionalLanguages: ['java', 'properties', 'bash'], + }, + } satisfies Preset.ThemeConfig, + }; +} diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 0614edc..b59ca21 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -235,6 +235,8 @@ function TechStackSection() { } function QuickStartSection() { + const { siteConfig } = useDocusaurusContext(); + const version = siteConfig.customFields?.quickfixjVersion as string; return (
@@ -248,12 +250,12 @@ function QuickStartSection() { org.quickfixj quickfixj-core - 3.0.0 + ${version} org.quickfixj quickfixj-messages-fix44 - 3.0.0 + ${version} `}
From 2d193c18e6b38d4c9a5be78902411a2926db6d5b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 13 May 2026 08:39:35 +0000 Subject: [PATCH 2/3] revert: remove nightly schedule trigger from deploy.yml Agent-Logs-Url: https://github.com/quickfix-j/quickfixj-pages/sessions/56b37b77-8804-4b8b-9c60-bd57df8fb78b Co-authored-by: chrjohn <6644028+chrjohn@users.noreply.github.com> --- .github/workflows/deploy.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 90fa1c4..63487f0 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -5,9 +5,6 @@ on: branches: - main - master - # Rebuild nightly so the latest QuickFIX/J release version is always reflected - schedule: - - cron: '0 3 * * *' # Allows you to run this workflow manually from the Actions tab workflow_dispatch: From cff55172d7348051478426f4689db145823500f5 Mon Sep 17 00:00:00 2001 From: Christoph John Date: Wed, 13 May 2026 10:53:19 +0200 Subject: [PATCH 3/3] Update VERSION_FALLBACK to 3.0.1 --- docusaurus.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docusaurus.config.ts b/docusaurus.config.ts index 93d347a..0fa8e59 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -6,7 +6,7 @@ import type {Node} from 'unist'; import type {Root} from 'mdast'; const VERSION_PLACEHOLDER = '{{QUICKFIXJ_VERSION}}'; -const VERSION_FALLBACK = '3.0.0'; +const VERSION_FALLBACK = '3.0.1'; async function fetchLatestVersion(fallback: string): Promise { try {