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 71d62f8 commit 2c0fdc0
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 24 deletions.
31 changes: 16 additions & 15 deletions website/customFields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down
15 changes: 12 additions & 3 deletions website/docs/install/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,9 @@ The Windows versions of **xPack Ninja Build**
are packed as `.zip` files.
Download the latest version named like:

- <code>xpack-ninja-build-{customField('xpackVersion')}-win32-x64.zip</code>
<ul>
<li><code>xpack-ninja-build-{customField('xpackVersion')}-win32-x64.zip</code></li>
</ul>

:::note

Expand Down Expand Up @@ -587,7 +589,10 @@ The macOS versions of **xPack Ninja Build**
are packed as `.tar.gz` archives.
Download the latest version named like:

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

:::note

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

- <code>xpack-ninja-build-{customField('xpackVersion')}-linux-x64.tar.gz</code>- <code>xpack-ninja-build-{customField('xpackVersion')}-linux-arm64.tar.gz</code>- <code>xpack-ninja-build-{customField('xpackVersion')}-linux-arm.tar.gz</code>
<ul>
<li><code>xpack-ninja-build-{customField('xpackVersion')}-linux-x64.tar.gz</code></li>
<li><code>xpack-ninja-build-{customField('xpackVersion')}-linux-arm64.tar.gz</code></li>
<li><code>xpack-ninja-build-{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 : 'Ninja Build'} 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: `ninja-build-xpack`,
label: `ninja-build-xpack project`,
href: `https://github.com/xpack-dev-tools/ninja-build-xpack/`,
},
{
Expand Down Expand Up @@ -348,7 +348,7 @@ const config: Config = {
href: 'https://www.paypal.com/donate/?hosted_button_id=5MFRG9ZRBETQ8',
},
{
label: 'GitHub ninja-build-xpack',
label: 'GitHub ninja-build-xpack project',
href: 'https://github.com/xpack-dev-tools/ninja-build-xpack/',
},
{
Expand Down

0 comments on commit 2c0fdc0

Please sign in to comment.