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 c8619f6 commit 208ca65
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 17 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
4 changes: 2 additions & 2 deletions website/docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ const config: Config = {
label: 'GitHub',
items: [
{
label: `xpm-js`,
label: `xpm-js project`,
href: `https://github.com/xpack/xpm-js/`,
},
{
Expand Down Expand Up @@ -337,7 +337,7 @@ const config: Config = {
href: 'https://www.paypal.com/donate/?hosted_button_id=5MFRG9ZRBETQ8',
},
{
label: 'GitHub xpm-js',
label: 'GitHub xpm-js project',
href: 'https://github.com/xpack/xpm-js/',
},
{
Expand Down

0 comments on commit 208ca65

Please sign in to comment.