Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions lib/release/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,17 @@ export function getLTSMaintenanceStartDate(ltsStartDate) {
export function getStartLTSBlurb({ date, ltsCodename, versionComponents }) {
const dateFormat = { month: 'long', year: 'numeric' };
// TODO pull these from the schedule.json in the Release repo?
const mainDate = getLTSMaintenanceStartDate(date);
const mainStart = mainDate.toLocaleString('en-US', dateFormat);
const eolDate = getEOLDate(date);
const eol = eolDate.toLocaleString('en-US', dateFormat);
const { major } = versionComponents;
return [
`This release marks the transition of Node.js ${major}.x into Long Term Support (LTS)`,
`with the codename '${ltsCodename}'. The ${major}.x release line now moves into "Active LTS"`,
`and will remain so until ${mainStart}. After that time, it will move into`,
`"Maintenance" until end of life in ${eol}.`
`with the codename '${ltsCodename}'. It will continue to receive updates through to`,
`the end of ${eol}.`,
'',
'Other than updating metadata, such as the `process.release` object, to reflect',
'that the release is LTS, no further changes since the previous release are',
'included.'
].join('\n');
}

Expand Down
17 changes: 10 additions & 7 deletions test/unit/prepare_release.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,18 @@ describe('prepare_release: utils.getLTSMaintenanceStartDate', () => {
describe('prepare_release: utils.getStartLTSBlurb', () => {
it('generates first LTS release text with correct dates', () => {
const expected = [
'This release marks the transition of Node.js 14.x into Long Term Support (LTS)',
'with the codename \'Fermium\'. The 14.x release line now moves into "Active LTS"',
'and will remain so until October 2021. After that time, it will move into',
'"Maintenance" until end of life in April 2023.'
'This release marks the transition of Node.js 27.x into Long Term Support (LTS)',
'with the codename \'Magnesium\'. It will continue to receive updates through to',
'the end of April 2030.',
'',
'Other than updating metadata, such as the `process.release` object, to reflect',
'that the release is LTS, no further changes since the previous release are',
'included.'
].join('\n');
const text = utils.getStartLTSBlurb({
date: '2020-10-27',
ltsCodename: 'Fermium',
versionComponents: { major: 14 }
date: '2027-10-20',
ltsCodename: 'Magnesium',
versionComponents: { major: 27 }
});
assert.strictEqual(text, expected);
});
Expand Down
Loading