build-assets/build/{props.platform}/deploy
folder:
-* xpack-realpath-{customField('xpackVersion')}-{props.platform}.tar.gz
-* xpack-realpath-{customField('xpackVersion')}-{props.platform}.tar.gz.sha
+- xpack-realpath-{customField('xpackVersion')}-{props.platform}.tar.gz
+- xpack-realpath-{customField('xpackVersion')}-{props.platform}.tar.gz.sha
To rerun the build, invoke the **deep-clean** action and repeat from install:
diff --git a/website/docs/developer/_common/_platform-native-section.mdx b/website/docs/developer/_common/_platform-native-section.mdx
index 0ff81da..77fb700 100644
--- a/website/docs/developer/_common/_platform-native-section.mdx
+++ b/website/docs/developer/_common/_platform-native-section.mdx
@@ -44,8 +44,8 @@ or, for more verbosity, run the similar development build:
archive and its SHA signature, created in
the build-assets/build/{props.platform}/deploy
folder:
-* xpack-realpath-{customField('xpackVersion')}-{props.platform}.tar.gz
-* xpack-realpath-{customField('xpackVersion')}-{props.platform}.tar.gz.sha
+- xpack-realpath-{customField('xpackVersion')}-{props.platform}.tar.gz
+- xpack-realpath-{customField('xpackVersion')}-{props.platform}.tar.gz.sha
To rerun the build, invoke the **deep-clean** action and repeat from install:
diff --git a/website/docs/install/_folders-hierarchies-linux.mdx b/website/docs/install/_folders-hierarchies-linux.mdx
index a5bc29e..b47e183 100644
--- a/website/docs/install/_folders-hierarchies-linux.mdx
+++ b/website/docs/install/_folders-hierarchies-linux.mdx
@@ -6,8 +6,8 @@ import customField from '@site/src/libs/customField';
{/* ------------------------------------------------------------------------ */}
build-assets/build/{props.platform}/deploy
folder:
-* xpack-realpath-{customField('xpackVersion')}-{props.platform}.{props.platform === 'win32-x64' ? 'zip' : 'tar.gz'}
-* xpack-realpath-{customField('xpackVersion')}-{props.platform}.{props.platform === 'win32-x64' ? 'zip' : 'tar.gz'}.sha
+- xpack-realpath-{customField('xpackVersion')}-{props.platform}.{props.platform === 'win32-x64' ? 'zip' : 'tar.gz'}
+- xpack-realpath-{customField('xpackVersion')}-{props.platform}.{props.platform === 'win32-x64' ? 'zip' : 'tar.gz'}.sha
To update the build scripts and build the release binaries:
diff --git a/website/docs/maintainer/_common/_platform-native-build.mdx b/website/docs/maintainer/_common/_platform-native-build.mdx
index 7edc725..99c67fe 100644
--- a/website/docs/maintainer/_common/_platform-native-build.mdx
+++ b/website/docs/maintainer/_common/_platform-native-build.mdx
@@ -40,8 +40,8 @@ xpm run build-development --config ${props.platform} -C ~/Work/xpack-dev-tools/r
archive and its SHA signature, created in
the build-assets/build/{props.platform}/deploy
folder:
-* xpack-realpath-{customField('xpackVersion')}-{props.platform}.tar.gz
-* xpack-realpath-{customField('xpackVersion')}-{props.platform}.tar.gz.sha
+- xpack-realpath-{customField('xpackVersion')}-{props.platform}.tar.gz
+- xpack-realpath-{customField('xpackVersion')}-{props.platform}.tar.gz.sha
To update the build scripts and build the release binaries:
diff --git a/website/docs/user/_common/_arm-toolchain-versioning.mdx b/website/docs/user/_common/_arm-toolchain-versioning.mdx
index e5952ab..2db7a96 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('xpackVersion')}
;
+like {customField('xpackSemver')}
;
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('xpackVersion')}-{customField('xpackSubversion')}
. When
+like {customField('xpackSemver')}-{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 1c5f344..a503adc 100644
--- a/website/docs/user/_common/_versioning.mdx
+++ b/website/docs/user/_common/_versioning.mdx
@@ -15,15 +15,15 @@ import LinksVsForwarders from '@site/src/components/LinksVsForwarders'
The version string used by the
upstream {props.upstreamName ? props.upstreamName : 'GNU realpath'} project
is a three number string
-like {customField('xpackVersion')}
;
+like {customField('xpackSemver')}
;
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('xpackVersion')}
. When
+like {customField('xpackSemver')}-{customField('xpackSubversion')}
. When
published as a npm package, the version gets
a fifth number,
-like {customField('xpackVersion')}.{customField('npmSubversion')}
.
+like {customField('xpackVersion')}.{customField('npmSubversion')}
.
Since adherence of third party packages to SemVer is not guaranteed,
it is recommended to avoid referring to the xPack GNU realpath dependency via
diff --git a/website/docusaurus.config.ts b/website/docusaurus.config.ts
index ee308c4..1a6b39f 100644
--- a/website/docusaurus.config.ts
+++ b/website/docusaurus.config.ts
@@ -8,74 +8,13 @@ import type * as Preset from '@docusaurus/preset-classic';
import util from 'node:util';
import {redirects} from './docusaurus-config-redirects'
+import {getCustomFields} from './customFields'
// The node.js modules cannot be used in modules imported in browser code:
// webpack < 5 used to include polyfills for node.js core modules by default.
// so the entire initialisation code must be in this file, that is
// not processed by webpack.
-import {fileURLToPath} from 'node:url';
-import path from 'node:path';
-import fs from 'node:fs';
-
-// ----------------------------------------------------------------------------
-
-function getCustomFields() {
- const pwd = fileURLToPath(import.meta.url);
- // console.log(pwd);
-
- // First get the version from the top package.json.
- const topFilePath = path.join(path.dirname(path.dirname(pwd)), 'package.json');
- // console.log(filePath);
- const topFileContent = fs.readFileSync(topFilePath);
-
- const topPackageJson = JSON.parse(topFileContent.toString());
- const jsonVersion = topPackageJson.version.replace(/[.-]pre/, '');
-
- console.log(`package version: ${topPackageJson.version}`);
-
- // Remove the first part, up to the last dot.
- const npmSubversion = jsonVersion.replace(/^.*[.]/, '');
-
- // Remove from the last dot to the end.
- const xpackVersion = jsonVersion.replace(/[.][0-9]*$/, '');
-
- // Remove the pre-release.
- const xpackSemver = xpackVersion.replace(/[-].*$/, '');
-
- // Remove the first part, up to the dash.
- const xpackSubversion = xpackVersion.replace(/^.*[-]/, '');
-
- let websitePackageJson = {}
- try {
- const websiteFilePath = path.join(path.dirname(path.dirname(pwd)), 'website', 'package.json');
- // console.log(filePath);
- const websiteFileContent = fs.readFileSync(websiteFilePath);
- websitePackageJson = JSON.parse(websiteFileContent.toString());
- } catch (error) {
- }
-
- const customFields = websitePackageJson?.websiteConfig?.customFields ?? {};
-
- let upstreamVersion = xpackSemver;
- if (xpackSemver.endsWith('.0')) {
- // Remove the patch number if zero (wine uses both 2 and 3 numbers).
- upstreamVersion = xpackSemver.replace(/[.]0*$/, '');
- }
-
- return {
- version: jsonVersion,
- xpackVersion,
- xpackSemver,
- xpackSubversion,
- npmSubversion,
- upstreamVersion,
- docusaurusVersion: require('@docusaurus/core/package.json').version,
- buildTime: new Date().getTime(),
- ...customFields,
- }
-}
-
// ----------------------------------------------------------------------------
const customFields = getCustomFields();
diff --git a/website/src/pages/index.tsx b/website/src/pages/index.tsx
index ecb185f..6bf3fcd 100644
--- a/website/src/pages/index.tsx
+++ b/website/src/pages/index.tsx
@@ -34,7 +34,7 @@ function HomepageHeader() {
{siteConfig.tagline}