File tree Expand file tree Collapse file tree 14 files changed +34
-42
lines changed
Expand file tree Collapse file tree 14 files changed +34
-42
lines changed Original file line number Diff line number Diff line change 6767 # this should be a last resort in case by any chances the build memory gets too high
6868 # but in general this should never happen
6969 NODE_OPTIONS : ' --max_old_space_size=4096'
70- # We want to ensure that static exports for all locales do not occur on `pull_request` events
71- NEXT_PUBLIC_STATIC_EXPORT_LOCALE : ${{ github.event_name == 'push' }}
7270 # See https://github.com/vercel/next.js/pull/81318
7371 TURBOPACK_STATS : ${{ matrix.os == 'ubuntu-latest' }}
7472
7775 with :
7876 name : webpack-stats
7977 path : apps/site/.next/server/webpack-stats.json
78+
79+ - name : Build Next.js (Static Export)
80+ # We want to generate a static build, as it is a requirement of our website.
81+ run : node_modules/.bin/turbo deploy ${{ env.TURBO_ARGS }}
82+ env :
83+ # We want to ensure we have enough RAM allocated to the Node.js process
84+ # this should be a last resort in case by any chances the build memory gets too high
85+ # but in general this should never happen
86+ NODE_OPTIONS : ' --max_old_space_size=4096'
87+ # We want to ensure that static exports for all locales do not occur on `pull_request` events
88+ NEXT_PUBLIC_STATIC_EXPORT_LOCALE : ${{ github.event_name == 'push' }}
Original file line number Diff line number Diff line change 1- 'use server' ;
2-
31import { getTranslations } from 'next-intl/server' ;
42
53import Button from '#site/components/Common/Button' ;
Original file line number Diff line number Diff line change @@ -22,19 +22,21 @@ const WithDownloadSection: FC<WithDownloadSectionProps> = async ({
2222} ) => {
2323 const locale = await getLocale ( ) ;
2424
25- const snippets = await provideDownloadSnippets ( locale ) ;
25+ const snippets = await provideDownloadSnippets ( ) ;
26+
27+ const localeSnippets = snippets . get ( locale ) ?? [ ] ;
2628
2729 // By default the translated languages do not contain all the download snippets
2830 // Hence we always merge any translated snippet with the fallbacks for missing snippets
29- const fallbackSnippets = await provideDownloadSnippets ( defaultLocale . code ) ;
31+ const fallbackSnippets = snippets . get ( defaultLocale . code ) ?? [ ] ;
3032
3133 const { pathname } = getClientContext ( ) ;
3234
3335 // Some available translations do not have download snippets translated or have them partially translated
3436 // This aims to merge the available translated snippets with the fallback snippets
3537 const memoizedSnippets = fallbackSnippets
36- . filter ( snippet => ! snippets . some ( s => s . name === snippet . name ) )
37- . concat ( snippets ) ;
38+ . filter ( snippet => ! localeSnippets . some ( s => s . name === snippet . name ) )
39+ . concat ( localeSnippets ) ;
3840
3941 // Decides which initial release to use based on the current pathname
4042 const initialRelease = pathname . endsWith ( '/current' )
Original file line number Diff line number Diff line change 1- 'use server' ;
2-
31import provideReleaseData from '#site/next-data/providers/releaseData' ;
42
53import type { NodeRelease , NodeReleaseStatus } from '#site/types' ;
Original file line number Diff line number Diff line change 1- 'use server' ;
2-
31import StatelessSelect from '@node-core/ui-components/Common/Select/StatelessSelect' ;
42
53import Link from '#site/components/Link' ;
Original file line number Diff line number Diff line change 1- 'use server' ;
2-
31import provideSupporters from '#site/next-data/providers/supportersData' ;
42
53import type { FC , PropsWithChildren } from 'react' ;
Original file line number Diff line number Diff line change 22
33import nodevu from '@nodevu/core' ;
44
5- const nodevuData = await nodevu ( { fetch } ) ;
6-
75/**
86 * Filters Node.js release data to return only major releases with documented support.
97 */
108export default async function getMajorNodeReleases ( ) {
9+ const nodevuData = await nodevu ( { fetch } ) ;
10+
1111 return Object . entries ( nodevuData ) . filter ( ( [ version , { support } ] ) => {
1212 // Filter out those without documented support
1313 // Basically those not in schedule.json
Original file line number Diff line number Diff line change 1- 'use cache';
1+ import { cache } from 'react ';
22
33import generateDownloadSnippets from '#site/next-data/generators/downloadSnippets.mjs' ;
44
5- const provideDownloadSnippets = async ( language : string ) => {
6- const downloadSnippets = await generateDownloadSnippets ( ) ;
7-
8- if ( downloadSnippets . has ( language ) ) {
9- return downloadSnippets . get ( language ) ! ;
10- }
11-
12- return [ ] ;
13- } ;
14-
15- export default provideDownloadSnippets ;
5+ export default cache ( generateDownloadSnippets ) ;
Original file line number Diff line number Diff line change 1- 'use cache';
1+ import { cache } from 'react ';
22
3- import provideReleaseData from '#site/next-data/generators/releaseData.mjs' ;
3+ import generateReleaseData from '#site/next-data/generators/releaseData.mjs' ;
44
5- export default provideReleaseData ;
5+ export default cache ( generateReleaseData ) ;
Original file line number Diff line number Diff line change 1- 'use cache';
1+ import { cache } from 'react ';
22
3- import provideReleaseVersions from '#site/next-data/generators/releaseVersions.mjs' ;
3+ import generateReleaseVersions from '#site/next-data/generators/releaseVersions.mjs' ;
44
5- export default provideReleaseVersions ;
5+ export default cache ( generateReleaseVersions ) ;
You can’t perform that action at this time.
0 commit comments