Skip to content

Commit

Permalink
website: re-generate commons
Browse files Browse the repository at this point in the history
  • Loading branch information
ilg-ul committed Jan 21, 2025
1 parent c7bea71 commit f2b8f35
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 27 deletions.
39 changes: 20 additions & 19 deletions website/customFields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down
11 changes: 9 additions & 2 deletions website/docs/install/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,10 @@ The macOS versions of **xPack GNU realpath**
are packed as `.tar.gz` archives.
Download the latest version named like:

- <code>xpack-realpath-{customField('xpackVersion')}-darwin-x64.tar.gz</code>- <code>xpack-realpath-{customField('xpackVersion')}-darwin-arm64.tar.gz</code>
<ul>
<li><code>xpack-realpath-{customField('xpackVersion')}-darwin-x64.tar.gz</code></li>
<li><code>xpack-realpath-{customField('xpackVersion')}-darwin-arm64.tar.gz</code></li>
</ul>

:::note

Expand Down Expand Up @@ -534,7 +537,11 @@ The GNU/Linux versions of **xPack GNU realpath**
are packed as `.tar.gz` archives.
Download the latest version named like:

- <code>xpack-realpath-{customField('xpackVersion')}-linux-x64.tar.gz</code>- <code>xpack-realpath-{customField('xpackVersion')}-linux-arm64.tar.gz</code>- <code>xpack-realpath-{customField('xpackVersion')}-linux-arm.tar.gz</code>
<ul>
<li><code>xpack-realpath-{customField('xpackVersion')}-linux-x64.tar.gz</code></li>
<li><code>xpack-realpath-{customField('xpackVersion')}-linux-arm64.tar.gz</code></li>
<li><code>xpack-realpath-{customField('xpackVersion')}-linux-arm.tar.gz</code></li>
</ul>

:::note

Expand Down
4 changes: 2 additions & 2 deletions website/docs/user/_common/_arm-toolchain-versioning.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ upstream **Arm GNU Toolchain** project is a bit unusual and unstable in time,
(like <code>{versionMajor()}.{versionMinor()}.Rel1</code>)
therefore the upstream GCC version is preferred, which
is a three number string
like <code>{customField('xpackSemver')}</code>;
like <code>{customField('releaseSemver')}</code>;
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 <code>{customField('xpackSemver')}-<b>{customField('xpackSubversion')}</b></code>. When
like <code>{customField('releaseSemver')}-<b>{customField('xpackSubversion')}</b></code>. When
published as a npm package, the version gets
a sixth number,
like <code>{customField('xpackVersion')}.<b>{customField('npmSubversion')}</b></code>.
Expand Down
4 changes: 2 additions & 2 deletions website/docs/user/_common/_versioning.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ 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 <code>{customField('xpackSemver')}</code>;
like <code>{customField('releaseSemver')}</code>;
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 <code>{customField('xpackSemver')}-<b>{customField('xpackSubversion')}</b></code>. When
like <code>{customField('releaseSemver')}-<b>{customField('xpackSubversion')}</b></code>. When
published as a npm package, the version gets
a fifth number,
like <code>{customField('xpackVersion')}.<b>{customField('npmSubversion')}</b></code>.
Expand Down
4 changes: 2 additions & 2 deletions website/docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ const config: Config = {
label: 'GitHub',
items: [
{
label: `realpath-xpack`,
label: `realpath-xpack project`,
href: `https://github.com/xpack-dev-tools/realpath-xpack/`,
},
{
Expand Down Expand Up @@ -348,7 +348,7 @@ const config: Config = {
href: 'https://www.paypal.com/donate/?hosted_button_id=5MFRG9ZRBETQ8',
},
{
label: 'GitHub realpath-xpack',
label: 'GitHub realpath-xpack project',
href: 'https://github.com/xpack-dev-tools/realpath-xpack/',
},
{
Expand Down

0 comments on commit f2b8f35

Please sign in to comment.