File tree Expand file tree Collapse file tree 9 files changed +1518
-15
lines changed
components/Releases/ReleaseSchedule Expand file tree Collapse file tree 9 files changed +1518
-15
lines changed Original file line number Diff line number Diff line change 1+ import { create } from 'lts' ;
2+
3+ import provideReleaseSchedule from '#site/next-data/providers/releaseSchedule' ;
4+
5+ import type { FC } from 'react' ;
6+
7+ const ReleaseSchedule : FC = async ( ) => {
8+ const schedule = await provideReleaseSchedule ( ) ;
9+
10+ const now = new Date ( ) ;
11+
12+ const threeMonthsAgo = new Date ( now ) ;
13+ threeMonthsAgo . setMonth ( now . getMonth ( ) - 3 ) ;
14+
15+ const sixMonthsFromNow = new Date ( ) ;
16+ sixMonthsFromNow . setMonth ( now . getMonth ( ) + 6 ) ;
17+
18+ const svg = create ( {
19+ data : schedule ,
20+ queryStart : threeMonthsAgo ,
21+ queryEnd : sixMonthsFromNow ,
22+ animate : true ,
23+ excludeMain : false ,
24+ projectName : 'Node.js' ,
25+ currentDateMarker : 'red' ,
26+ } ) ;
27+
28+ return (
29+ < div
30+ dangerouslySetInnerHTML = { { __html : svg . html ( ) } }
31+ className = "h-auto w-auto"
32+ />
33+ ) ;
34+ } ;
35+
36+ export default ReleaseSchedule ;
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ import MDXImage from '#site/components/MDX/Image';
3434import MinorReleasesTable from '#site/components/Releases/MinorReleasesTable' ;
3535import PreviousReleasesTable from '#site/components/Releases/PreviousReleasesTable' ;
3636import ReleaseOverview from '#site/components/Releases/ReleaseOverview' ;
37+ import ReleaseSchedule from '#site/components/Releases/ReleaseSchedule' ;
3738import WithBadgeGroup from '#site/components/withBadgeGroup' ;
3839import WithBanner from '#site/components/withBanner' ;
3940import WithDownloadArchive from '#site/components/withDownloadArchive' ;
@@ -96,6 +97,7 @@ export default {
9697 BadgeGroup,
9798 ReleaseOverview,
9899 MinorReleasesTable,
100+ ReleaseSchedule,
99101 UpcomingMeetings,
100102 EOLAlertBox,
101103 EOLReleaseTable,
Original file line number Diff line number Diff line change 1+ import { RELEASE_SCHEDULE_URL } from '#site/next.constants.mjs' ;
2+ import { fetchWithRetry } from '#site/util/fetch' ;
3+
4+ async function fetchReleaseSchedule ( ) {
5+ const response = await fetchWithRetry ( RELEASE_SCHEDULE_URL ) ;
6+
7+ const payload = await response . json ( ) ;
8+
9+ return payload ;
10+ }
11+
12+ export default fetchReleaseSchedule ;
Original file line number Diff line number Diff line change 1+ import { cache } from 'react' ;
2+
3+ import fetchReleaseSchedule from '#site/next-data/generators/releaseSchedule.mjs' ;
4+
5+ export default cache ( fetchReleaseSchedule ) ;
Original file line number Diff line number Diff line change 11/// <reference types="next" />
22/// <reference types="next/image-types/global" />
33/// <reference types="next/navigation-types/compat/navigation" />
4- import './.next/types/routes.d.ts' ;
4+ import './.next/dev/ types/routes.d.ts' ;
55
66// NOTE: This file should not be edited
77// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
Original file line number Diff line number Diff line change @@ -219,3 +219,9 @@ export const VULNERABILITIES_URL =
219219 */
220220export const OPENCOLLECTIVE_MEMBERS_URL =
221221 'https://opencollective.com/nodejs/members/all.json' ;
222+
223+ /**
224+ * The location of the Node.js release schedule JSON.
225+ */
226+ export const RELEASE_SCHEDULE_URL =
227+ 'https://raw.githubusercontent.com/nodejs/Release/refs/heads/main/schedule.json' ;
Original file line number Diff line number Diff line change 5858 "feed" : " ~5.1.0" ,
5959 "github-slugger" : " ~2.0.0" ,
6060 "gray-matter" : " ~4.0.3" ,
61+ "lts" : " github:araujogui/lts-schedule#refactor-website" ,
6162 "mdast-util-to-string" : " ^4.0.0" ,
6263 "next" : " 16.0.10" ,
6364 "next-intl" : " ~4.5.3" ,
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ Production applications should only use _Active LTS_ or _Maintenance LTS_ releas
1414
1515## Release Schedule
1616
17- ![ Releases ] ( https://raw.githubusercontent.com/nodejs/Release/main/schedule.svg?sanitize=true )
17+ < ReleaseSchedule />
1818
1919Full details regarding the Node.js release schedule are available [ on GitHub] ( https://github.com/nodejs/release#release-schedule ) .
2020
You can’t perform that action at this time.
0 commit comments