Skip to content

Commit

Permalink
Revert "refactor: updated release script and updated shiki (#5997)"
Browse files Browse the repository at this point in the history
This reverts commit dafcdaa.
  • Loading branch information
RafaelGSS committed Oct 17, 2023
1 parent 3c59de3 commit 500a77c
Show file tree
Hide file tree
Showing 8 changed files with 261 additions and 146 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"rehype-slug": "~6.0.0",
"semver": "~7.5.4",
"sharp": "0.32.6",
"shiki": "^0.14.5",
"shiki": "^0.14.3",
"tailwindcss": "^3.3.3",
"turbo": "^1.10.14",
"typescript": "~5.2.2",
Expand Down
2 changes: 1 addition & 1 deletion pages/en/blog/release/v15.1.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ When generating snapshots, garbage collection may be triggered and bring the hea

Generating V8 snapshots takes time and memory (both memory managed by the V8 heap and native memory outside the V8 heap). The bigger the heap is, the more resources it needs. Node.js will adjust the V8 heap to accommondate the additional V8 heap memory overhead, and try its best to avoid using up all the memory avialable to the process.

```console
```shell-session
$ node --max-old-space-size=100 --heapsnapshot-near-heap-limit=3 index.js
Wrote snapshot to Heap.20200430.100036.49580.0.001.heapsnapshot
Wrote snapshot to Heap.20200430.100037.49580.0.002.heapsnapshot
Expand Down
2 changes: 1 addition & 1 deletion pages/en/blog/release/v18.16.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ author: Danielle Adams

Compile a JavaScript file into a single executable application:

```console
```shell-session
$ echo 'console.log(`Hello, ${process.argv[2]}!`);' > hello.js
$ cp $(command -v node) hello
Expand Down
118 changes: 115 additions & 3 deletions scripts/release-post/downloadsTable.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import semVer from 'semver';

const downloadOptions = [
const allDownloads = [
{
title: 'Windows 32-bit Installer',
templateUrl: 'https://nodejs.org/dist/v%version%/node-v%version%-x86.msi',
Expand Down Expand Up @@ -41,6 +41,11 @@ const downloadOptions = [
templateUrl:
'https://nodejs.org/dist/v%version%/node-v%version%-darwin-x64.tar.gz',
},
{
title: 'Linux 32-bit Binary',
templateUrl:
'https://nodejs.org/dist/v%version%/node-v%version%-linux-x86.tar.xz',
},
{
title: 'Linux 64-bit Binary',
templateUrl:
Expand All @@ -51,6 +56,11 @@ const downloadOptions = [
templateUrl:
'https://nodejs.org/dist/v%version%/node-v%version%-linux-ppc64le.tar.xz',
},
{
title: 'Linux PPC BE 64-bit Binary',
templateUrl:
'https://nodejs.org/dist/v%version%/node-v%version%-linux-ppc64.tar.xz',
},
{
title: 'Linux s390x 64-bit Binary',
templateUrl:
Expand All @@ -61,6 +71,21 @@ const downloadOptions = [
templateUrl:
'https://nodejs.org/dist/v%version%/node-v%version%-aix-ppc64.tar.gz',
},
{
title: 'SmartOS 32-bit Binary',
templateUrl:
'https://nodejs.org/dist/v%version%/node-v%version%-sunos-x86.tar.xz',
},
{
title: 'SmartOS 64-bit Binary',
templateUrl:
'https://nodejs.org/dist/v%version%/node-v%version%-sunos-x64.tar.xz',
},
{
title: 'ARMv6 32-bit Binary',
templateUrl:
'https://nodejs.org/dist/v%version%/node-v%version%-linux-armv6l.tar.xz',
},
{
title: 'ARMv7 32-bit Binary',
templateUrl:
Expand All @@ -77,13 +102,98 @@ const downloadOptions = [
},
];

// v0.x of Node.js
const legacyDownloads = [
{
title: 'Windows 32-bit Installer',
templateUrl: 'https://nodejs.org/dist/v%version%/node-v%version%-x86.msi',
},
{
title: 'Windows 64-bit Installer',
templateUrl:
'https://nodejs.org/dist/v%version%/x64/node-v%version%-x64.msi',
},
{
title: 'Windows 32-bit Binary',
templateUrl: 'https://nodejs.org/dist/v%version%/node.exe',
},
{
title: 'Windows 64-bit Binary',
templateUrl: 'https://nodejs.org/dist/v%version%/x64/node.exe',
},
{
title: 'macOS Universal Installer',
templateUrl: 'https://nodejs.org/dist/v%version%/node-v%version%.pkg',
},
{
title: 'macOS 64-bit Binary',
templateUrl:
'https://nodejs.org/dist/v%version%/node-v%version%-darwin-x64.tar.gz',
},
{
title: 'macOS 32-bit Binary',
templateUrl:
'https://nodejs.org/dist/v%version%/node-v%version%-darwin-x86.tar.gz',
},
{
title: 'Linux 32-bit Binary',
templateUrl:
'https://nodejs.org/dist/v%version%/node-v%version%-linux-x86.tar.gz',
},
{
title: 'Linux 64-bit Binary',
templateUrl:
'https://nodejs.org/dist/v%version%/node-v%version%-linux-x64.tar.gz',
},
{
title: 'SmartOS 32-bit Binary',
templateUrl:
'https://nodejs.org/dist/v%version%/node-v%version%-sunos-x86.tar.gz',
},
{
title: 'SmartOS 64-bit Binary',
templateUrl:
'https://nodejs.org/dist/v%version%/node-v%version%-sunos-x64.tar.gz',
},
{
title: 'Source Code',
templateUrl: 'https://nodejs.org/dist/v%version%/node-v%version%.tar.gz',
},
];

const resolveUrl = (item, version) => {
const url = item.templateUrl.replace(/%version%/g, version);
return Object.assign({ url }, item);
};

const resolveDownloads = version => {
let downloads = downloadOptions;
let downloads = allDownloads;

if (semVer.satisfies(version, '< 1.0.0')) {
return legacyDownloads;
}

if (semVer.satisfies(version, '>= 8.0.0')) {
downloads = downloads.filter(
ver => ver.title !== 'Linux PPC BE 64-bit Binary'
);
}

if (semVer.satisfies(version, '>= 10.0.0')) {
downloads = downloads.filter(
ver =>
ver.title !== 'Linux 32-bit Binary' &&
ver.title !== 'SmartOS 32-bit Binary'
);
}

if (semVer.satisfies(version, '>= 12.0.0')) {
downloads = downloads.filter(ver => ver.title !== 'ARMv6 32-bit Binary');
}

if (semVer.satisfies(version, '>= 14.0.0')) {
downloads = downloads.filter(ver => ver.title !== 'SmartOS 64-bit Binary');
}

if (semVer.satisfies(version, '< 16.0.0')) {
downloads = downloads.filter(
Expand All @@ -102,5 +212,7 @@ const resolveDownloads = version => {
return downloads;
};

export const downloadsTable = version =>
const downloadsTable = version =>
resolveDownloads(version).map(item => resolveUrl(item, version));

export default downloadsTable;
Loading

0 comments on commit 500a77c

Please sign in to comment.