From de5162085a34ff8175d4894b03fc49c717cc6a51 Mon Sep 17 00:00:00 2001 From: Liviu Ionescu Date: Tue, 21 Jan 2025 12:14:12 +0200 Subject: [PATCH] website: re-generate commons --- website/customFields.ts | 31 ++++++++++--------- website/docs/install/index.mdx | 11 +++++-- .../_common/_arm-toolchain-versioning.mdx | 4 +-- website/docs/user/_common/_versioning.mdx | 4 +-- website/docusaurus.config.ts | 4 +-- 5 files changed, 31 insertions(+), 23 deletions(-) diff --git a/website/customFields.ts b/website/customFields.ts index c8d8cdf..9435c8b 100644 --- a/website/customFields.ts +++ b/website/customFields.ts @@ -17,38 +17,39 @@ export function getCustomFields() { const topFileContent = fs.readFileSync(topFilePath); const topPackageJson = JSON.parse(topFileContent.toString()); - const releaseVersion = topPackageJson.version.replace(/[.-]pre/, ''); + const packageVersion = topPackageJson.version; + // Remove the pre used during development. + const releaseVersion = packageVersion.replace(/[.-]pre.*/, ''); + // Remove the pre-release. + const releaseSemver = releaseVersion.replace(/[-].*$/, ''); + + let upstreamVersion = releaseSemver; + + let versionFields = { + packageVersion, + releaseVersion, + releaseSemver, + upstreamVersion, + } console.log(`package version: ${topPackageJson.version}`); - let versionFields; - if (topPackageJson.xpack && !releaseVersion.startsWith('0.0.0')) { + // Remove the first part, up to the last dot. const npmSubversion = releaseVersion.replace(/^.*[.]/, ''); // Remove from the last dot to the end. const xpackVersion = releaseVersion.replace(/[.][0-9]*$/, ''); - // Remove the pre-release. - const xpackSemver = xpackVersion.replace(/[-].*$/, ''); - // Remove the first part, up to the dash. const xpackSubversion = xpackVersion.replace(/^.*[-]/, ''); - let upstreamVersion = xpackSemver; - versionFields = { - releaseVersion, + ...versionFields, xpackVersion, - xpackSemver, xpackSubversion, npmSubversion, - upstreamVersion, - } - } else { - versionFields = { - releaseVersion } } diff --git a/website/docs/install/index.mdx b/website/docs/install/index.mdx index cdc6819..d047362 100644 --- a/website/docs/install/index.mdx +++ b/website/docs/install/index.mdx @@ -502,7 +502,10 @@ The macOS versions of **xPack GNU texinfo** are packed as `.tar.gz` archives. Download the latest version named like: -- xpack-texinfo-{customField('xpackVersion')}-darwin-x64.tar.gz- xpack-texinfo-{customField('xpackVersion')}-darwin-arm64.tar.gz + :::note @@ -534,7 +537,11 @@ The GNU/Linux versions of **xPack GNU texinfo** are packed as `.tar.gz` archives. Download the latest version named like: -- xpack-texinfo-{customField('xpackVersion')}-linux-x64.tar.gz- xpack-texinfo-{customField('xpackVersion')}-linux-arm64.tar.gz- xpack-texinfo-{customField('xpackVersion')}-linux-arm.tar.gz + :::note diff --git a/website/docs/user/_common/_arm-toolchain-versioning.mdx b/website/docs/user/_common/_arm-toolchain-versioning.mdx index 2db7a96..d5f4de8 100644 --- a/website/docs/user/_common/_arm-toolchain-versioning.mdx +++ b/website/docs/user/_common/_arm-toolchain-versioning.mdx @@ -20,14 +20,14 @@ upstream **Arm GNU Toolchain** project is a bit unusual and unstable in time, (like {versionMajor()}.{versionMinor()}.Rel1) therefore the upstream GCC version is preferred, which is a three number string -like {customField('xpackSemver')}; +like {customField('releaseSemver')}; to this string the xPack distribution adds a fourth number that represents the Arm release with the same GCC release, and a fifth number that represents the xPack release of the same Arm release; since [SemVer](https://semver.org) allows only three numbers, all additional ones can be added only as pre-release strings, separated by a dash, -like {customField('xpackSemver')}-{customField('xpackSubversion')}. When +like {customField('releaseSemver')}-{customField('xpackSubversion')}. When published as a npm package, the version gets a sixth number, like {customField('xpackVersion')}.{customField('npmSubversion')}. diff --git a/website/docs/user/_common/_versioning.mdx b/website/docs/user/_common/_versioning.mdx index 6a76dad..e7abbbd 100644 --- a/website/docs/user/_common/_versioning.mdx +++ b/website/docs/user/_common/_versioning.mdx @@ -15,12 +15,12 @@ import LinksVsForwarders from '@site/src/components/LinksVsForwarders' The version string used by the upstream {props.upstreamName ? props.upstreamName : 'GNU texinfo'} project is a three number string -like {customField('xpackSemver')}; +like {customField('releaseSemver')}; to this string the xPack distribution adds a fourth number, but since [SemVer](https://semver.org) allows only three numbers, all additional ones can be added only as pre-release strings, separated by a dash, -like {customField('xpackSemver')}-{customField('xpackSubversion')}. When +like {customField('releaseSemver')}-{customField('xpackSubversion')}. When published as a npm package, the version gets a fifth number, like {customField('xpackVersion')}.{customField('npmSubversion')}. diff --git a/website/docusaurus.config.ts b/website/docusaurus.config.ts index 6fa30b6..d7944df 100644 --- a/website/docusaurus.config.ts +++ b/website/docusaurus.config.ts @@ -275,7 +275,7 @@ const config: Config = { label: 'GitHub', items: [ { - label: `texinfo-xpack`, + label: `texinfo-xpack project`, href: `https://github.com/xpack-dev-tools/texinfo-xpack/`, }, { @@ -348,7 +348,7 @@ const config: Config = { href: 'https://www.paypal.com/donate/?hosted_button_id=5MFRG9ZRBETQ8', }, { - label: 'GitHub texinfo-xpack', + label: 'GitHub texinfo-xpack project', href: 'https://github.com/xpack-dev-tools/texinfo-xpack/', }, {