diff --git a/website/customFields.ts b/website/customFields.ts index 8836189..669d00b 100644 --- a/website/customFields.ts +++ b/website/customFields.ts @@ -17,42 +17,43 @@ 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; + if (releaseSemver.endsWith('.0')) { + // Remove the patch number if zero (wine uses both 2 and 3 numbers). + upstreamVersion = releaseSemver.replace(/[.]0*$/, ''); + } - console.log(`package version: ${topPackageJson.version}`); + let versionFields = { + packageVersion, + releaseVersion, + releaseSemver, + upstreamVersion, + } - let versionFields; + console.log(`package version: ${topPackageJson.version}`); 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; - if (xpackSemver.endsWith('.0')) { - // Remove the patch number if zero (wine uses both 2 and 3 numbers). - upstreamVersion = xpackSemver.replace(/[.]0*$/, ''); - } - 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 c587a3d..9a97ba5 100644 --- a/website/docs/install/index.mdx +++ b/website/docs/install/index.mdx @@ -502,7 +502,10 @@ The macOS versions of **xPack GNU sed** are packed as `.tar.gz` archives. Download the latest version named like: -- xpack-sed-{customField('xpackVersion')}-darwin-x64.tar.gz- xpack-sed-{customField('xpackVersion')}-darwin-arm64.tar.gz + :::note @@ -534,7 +537,11 @@ The GNU/Linux versions of **xPack GNU sed** are packed as `.tar.gz` archives. Download the latest version named like: -- xpack-sed-{customField('xpackVersion')}-linux-x64.tar.gz- xpack-sed-{customField('xpackVersion')}-linux-arm64.tar.gz- xpack-sed-{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 415d138..66ccd0f 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 sed'} 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 c10515d..dcefa1b 100644 --- a/website/docusaurus.config.ts +++ b/website/docusaurus.config.ts @@ -275,7 +275,7 @@ const config: Config = { label: 'GitHub', items: [ { - label: `sed-xpack`, + label: `sed-xpack project`, href: `https://github.com/xpack-dev-tools/sed-xpack/`, }, { @@ -348,7 +348,7 @@ const config: Config = { href: 'https://www.paypal.com/donate/?hosted_button_id=5MFRG9ZRBETQ8', }, { - label: 'GitHub sed-xpack', + label: 'GitHub sed-xpack project', href: 'https://github.com/xpack-dev-tools/sed-xpack/', }, {