Skip to content

Commit a159b1c

Browse files
committed
Add Release Schedule
Pulls data from nodejs/Release#380 Fixes: #1889
1 parent 376193f commit a159b1c

File tree

8 files changed

+207
-1
lines changed

8 files changed

+207
-1
lines changed

layouts/about-release-schedule.hbs

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<!DOCTYPE html>
2+
<html lang="{{site.locale}}" {{#if site.rtl}}dir="rtl"{{/if}}>
3+
{{> html-head }}
4+
5+
<body>
6+
{{> header }}
7+
8+
<div id="main">
9+
<div class="container has-side-nav">
10+
11+
{{> navigation key='about'}}
12+
13+
<article>
14+
<h1>{{ title }}</h1>
15+
16+
<p>
17+
<img alt="{{ title }}" src="https://raw.githubusercontent.com/nodejs/Release/master/schedule.png">
18+
</p>
19+
20+
{{{ release-schedule }}}
21+
22+
<p>
23+
<small>{{ schedule-footer }}</small>
24+
</p>
25+
26+
27+
{{{ contents }}}
28+
</article>
29+
30+
</div>
31+
</div>
32+
33+
{{> footer }}
34+
</body>
35+
</html>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
table.release-schedule
2+
width 100%
3+
font-size 1rem
4+
border 1px solid $light-gray2
5+
6+
td
7+
padding 5px
8+
9+
> thead
10+
font-weight 600
11+
text-align left
12+
13+
> tbody
14+
border-top 1px solid $light-gray2
15+
16+
tr:nth-child(odd)
17+
background-color $light-gray3
18+
19+
tr:nth-child(even)
20+
background-color $white

layouts/css/styles.styl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
@import 'page-modules/_scrollToTop'
1818
@import 'page-modules/_anchorLinks'
1919
@import 'page-modules/_prev-next-navigation'
20+
@import 'page-modules/_release-schedule'
2021

2122
.intro
2223
margin-top 140px
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
layout: about-release-schedule.hbs
3+
title: Release Schedule
4+
statuses:
5+
maintenance: 'Maintenance LTS'
6+
active: 'Active LTS'
7+
current: 'Current'
8+
pending: 'Pending'
9+
columns:
10+
- 'Release'
11+
- 'Status'
12+
- 'Codename'
13+
- 'Initial Release'
14+
- 'Active LTS Start'
15+
- 'Maintenance LTS Start'
16+
- 'End-of-life'
17+
schedule-footer: Dates are subject to change.
18+
---

locale/en/site.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@
4949
"link": "about/releases",
5050
"text": "Releases"
5151
},
52+
"release-schedule": {
53+
"link": "about/release-schedule",
54+
"text": "Release Schedule"
55+
},
5256
"resources": {
5357
"link": "about/resources",
5458
"text": "Resources"

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@
88
"serve": "node server.js",
99
"external:survey": "rsync -avz --exclude 'node_modules*' --exclude 'package*' external/survey-2018/ build/en/user-survey-report",
1010
"gzip": "find build -type f \\( -name '*.html' -o -name '*.css' -o -name '*.js' -o -name '*.xml' -o -name '*.json' \\) -exec gzip -kf9 {} \\;",
11-
"deploy": "npm run build && npm run external:survey && npm run gzip",
11+
"deploy": "npm run load-schedule && npm run build && npm run external:survey && npm run gzip",
1212
"load-versions": "node scripts/load-versions.js",
13+
"load-schedule": "curl -sS https://raw.githubusercontent.com/nodejs/Release/master/schedule.json -o source/schedule.json",
1314
"start": "npm run serve",
1415
"test": "npm run test:lint && npm run test:unit && npm run test:smoke",
1516
"test:lint": "standard && htmllint **/*.hbs && stylint layouts/css",
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
'use strict'
2+
3+
const schedule = require('../../source/schedule.json')
4+
5+
const today = new Date()
6+
const datify = (release, key) => new Date(schedule[release][key])
7+
8+
module.exports = context => {
9+
const statuses = context.data.root.statuses
10+
11+
const header = context.data.root.columns
12+
.map(column => `<th>${column}</th>\n`)
13+
.join('')
14+
15+
let content = ''
16+
17+
Object.keys(schedule)
18+
.filter(release => datify(release, 'end') > today)
19+
.forEach(release => {
20+
const codename = schedule[release].codename
21+
const codenameLink = codename
22+
? `<a href="https://nodejs.org/download/release/latest-${codename.toLowerCase()}/">${codename}</a>`
23+
: ''
24+
25+
const releaseLink = datify(release, 'start') < today
26+
? `<a href="https://nodejs.org/download/release/latest-${release}.x/">${release}</a>`
27+
: release
28+
29+
let status
30+
31+
if (datify(release, 'start') > today) {
32+
status = statuses.pending
33+
} else if (!schedule[release].lts || datify(release, 'lts') > today) {
34+
status = statuses.current
35+
} else if (datify(release, 'maintenance') < today) {
36+
status = statuses.maintenance
37+
} else if (datify(release, 'lts') < today) {
38+
status = statuses.active
39+
}
40+
41+
content += `<tr>
42+
<td>${releaseLink}</td>
43+
<td>${status}</td>
44+
<td>${codenameLink}</td>
45+
<td>${schedule[release].start || ''}</td>
46+
<td>${schedule[release].lts || ''}</td>
47+
<td>${schedule[release].maintenance || ''}</td>
48+
<td>${schedule[release].end || ''}</td>
49+
</tr>`
50+
})
51+
52+
return `
53+
<table class="release-schedule">
54+
<thead>
55+
<tr>${header}</tr>
56+
</thead>
57+
<tbody>
58+
${content}
59+
</tbody>
60+
</table>
61+
`
62+
}

source/schedule.json

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{
2+
"v0.10": {
3+
"start": "2013-03-11",
4+
"end": "2016-10-31"
5+
},
6+
"v0.12": {
7+
"start": "2015-02-06",
8+
"end": "2016-12-31"
9+
},
10+
"v4": {
11+
"start": "2015-09-08",
12+
"lts": "2015-10-12",
13+
"maintenance": "2017-04-01",
14+
"end": "2018-04-30",
15+
"codename": "Argon"
16+
},
17+
"v5": {
18+
"start": "2015-10-29",
19+
"maintenance": "2016-04-30",
20+
"end": "2016-06-30"
21+
},
22+
"v6": {
23+
"start": "2016-04-26",
24+
"lts": "2016-10-18",
25+
"maintenance": "2018-04-30",
26+
"end": "2019-04-01",
27+
"codename": "Boron"
28+
},
29+
"v7": {
30+
"start": "2016-10-25",
31+
"maintenance": "2017-04-30",
32+
"end": "2017-06-30"
33+
},
34+
"v8": {
35+
"start": "2017-05-30",
36+
"lts": "2017-10-31",
37+
"maintenance": "2019-04-01",
38+
"end": "2019-12-31",
39+
"codename": "Carbon"
40+
},
41+
"v9": {
42+
"start": "2017-10-01",
43+
"maintenance": "2018-04-01",
44+
"end": "2018-06-30"
45+
},
46+
"v10": {
47+
"start": "2018-04-24",
48+
"lts": "2018-10-30",
49+
"maintenance": "2020-04-01",
50+
"end": "2021-04-01",
51+
"codename": "Dubnium"
52+
},
53+
"v11": {
54+
"start": "2018-10-23",
55+
"maintenance": "2019-04-01",
56+
"end": "2019-06-30"
57+
},
58+
"v12": {
59+
"start": "2019-04-23",
60+
"lts": "2019-10-22",
61+
"maintenance": "2021-04-01",
62+
"end": "2022-04-01",
63+
"codename": ""
64+
}
65+
}

0 commit comments

Comments
 (0)