Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion apps/site/app/[locale]/next-data/api-data/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const GET = async () => {
const deflatedSource = deflateSync(cleanedContent).toString('base64');

return {
filename,
filename: filename,
pathname: getPathnameForApiFile(name, versionWithPrefix),
content: deflatedSource,
};
Expand Down
4 changes: 2 additions & 2 deletions apps/site/app/[locale]/next-data/page-data/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ export const GET = async () => {
const cleanedContent = parseRichTextIntoPlainText(matter(source).content);

// Deflates a String into a base64 string-encoded (zlib compressed)
const deflatedSource = deflateSync(cleanedContent).toString('base64');
const content = deflateSync(cleanedContent).toString('base64');

// Returns metadata of each page available on the Website
return {
filename,
pathname,
title,
description,
content: deflatedSource,
content,
};
});

Expand Down
8 changes: 4 additions & 4 deletions apps/site/app/[locale]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,11 @@ const getPage: FC<DynamicParams> = async props => {

// Metadata and shared Context to be available through the lifecycle of the page
const sharedContext = {
frontmatter,
headings,
frontmatter: frontmatter,
headings: headings,
pathname: `/${pathname}`,
readingTime,
filename,
readingTime: readingTime,
filename: filename,
};

// Defines a shared Server Context for the Client-Side
Expand Down
6 changes: 3 additions & 3 deletions apps/site/components/withAvatarGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ const WithAvatarGroup: FC<WithAvatarGroupProps> = ({
}) => (
<AvatarGroup
avatars={getAuthors({
usernames: usernames,
names: names,
clickable: clickable,
usernames,
names,
clickable,
})}
as={Link}
{...props}
Expand Down
4 changes: 3 additions & 1 deletion apps/site/components/withBreadcrumbs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ const WithBreadcrumbs: FC<WithBreadcrumbsProps> = ({ navKeys = [] }) => {
// Goes deeper on the tree of items if there are any.
currentNode = items;

return label ? [...breadcrumbs, { label, href: link }] : breadcrumbs;
return label
? [...breadcrumbs, { label: label, href: link }]
: breadcrumbs;
}

return breadcrumbs;
Expand Down
5 changes: 4 additions & 1 deletion apps/site/components/withFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ const WithFooter: FC = () => {
// Add OpenJS link
updatedFooterLinks.push(footerLinks.at(-1)!);

const navigation = { socialLinks, footerLinks: updatedFooterLinks };
const navigation = {
socialLinks: socialLinks,
footerLinks: updatedFooterLinks,
};

return <Footer navigation={navigation} as={Link} pathname={pathname} />;
};
Expand Down
4 changes: 2 additions & 2 deletions apps/site/components/withNavBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ const WithNavBar: FC = () => {

<NavBar
navItems={navigationItems.map(([, { label, link, target }]) => ({
link,
link: link,
text: label,
target,
target: target,
}))}
pathname={pathname}
as={Link}
Expand Down
4 changes: 2 additions & 2 deletions apps/site/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { FlatCompat } from '@eslint/eslintrc';
import importX from 'eslint-plugin-import-x';
import { flatConfigs } from 'eslint-plugin-import-x';
import * as mdx from 'eslint-plugin-mdx';
import react from 'eslint-plugin-react';
import tseslint from 'typescript-eslint';
Expand All @@ -25,7 +25,7 @@ export default tseslint.config(
extends: [
react.configs.flat['jsx-runtime'],
...tseslint.configs.recommended,
importX.flatConfigs.typescript,
flatConfigs.typescript,
...compatConfig,
],
files: ['**/*.{js,md,mdx,mjs,ts,tsx}'],
Expand Down
2 changes: 1 addition & 1 deletion apps/site/hooks/react-generic/useSiteNavigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const useSiteNavigation = () => {
] => [
key,
{
target,
target: target,
label: label ? getFormattedMessage(label, key) : '',
link: link ? replaceLinkWithContext(link, context[key]) : '',
items: items ? mapNavigationEntries(items, context) : [],
Expand Down
2 changes: 1 addition & 1 deletion apps/site/i18n.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default getRequestConfig(async ({ requestLocale }) => {
}

return {
locale,
locale: locale,
// This is the dictionary of messages to be loaded
messages: await loadLocaleDictionary(locale),
// We always define the App timezone as UTC
Expand Down
7 changes: 6 additions & 1 deletion apps/site/layouts/Blog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@ const getBlogCategory = (pathname: string) => {
Number(page)
);

return { category, posts, pagination, page: Number(page) };
return {
category: category,
posts: posts,
pagination: pagination,
page: Number(page),
};
};

const BlogLayout: FC = async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ describe('generateWebsiteFeeds', () => {
id: blogData.posts[0].slug,
title: blogData.posts[0].title,
guid: `${blogData.posts[0].slug}?${date.getTime()}`,
date,
date: date,
link: `${base}${blogData.posts[0].slug}`,
},
]);
Expand Down
11 changes: 9 additions & 2 deletions apps/site/next-data/generators/blogData.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,14 @@ const getFrontMatter = (filename, source) => {
// this is the url used for the blog post it based on the category and filename
const slug = `/blog/${category}/${basename(filename, extname(filename))}`;

return { title, author, username, date: new Date(date), categories, slug };
return {
title: title,
author: author,
username: username,
date: new Date(date),
categories: categories,
slug: slug,
};
};

/**
Expand Down Expand Up @@ -103,7 +110,7 @@ const generateBlogData = async () => {
)
);

return { categories: [...blogCategories], posts };
return { categories: [...blogCategories], posts: posts };
};

export default generateBlogData;
8 changes: 4 additions & 4 deletions apps/site/next-data/generators/releaseData.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const generateReleaseData = async () => {
absolute: false,
});

const nodevuOutput = await nodevu({ fetch: fetch });
const nodevuOutput = await nodevu({ fetch });

const majors = Object.entries(nodevuOutput).filter(
([version, { support }]) => {
Expand Down Expand Up @@ -91,7 +91,7 @@ const generateReleaseData = async () => {

return {
...support,
status,
status: status,
major: latestVersion.semver.major,
version: latestVersion.semver.raw,
versionWithPrefix: `v${latestVersion.semver.raw}`,
Expand All @@ -101,8 +101,8 @@ const generateReleaseData = async () => {
v8: latestVersion.dependencies.v8,
releaseDate: latestVersion.releaseDate,
modules: latestVersion.modules.version || '',
releaseAnnounceLink,
minorVersions,
releaseAnnounceLink: releaseAnnounceLink,
minorVersions: minorVersions,
};
});
};
Expand Down
2 changes: 1 addition & 1 deletion apps/site/next-data/generators/websiteFeeds.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const generateWebsiteFeeds = ({ posts }) => {
id: post.slug,
title: post.title,
author: post.author,
date,
date: date,
link: `${canonicalUrl}${post.slug}`,
guid:
time > guidTimestampStartDate
Expand Down
4 changes: 2 additions & 2 deletions apps/site/next.calendar.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ export const getCalendarEvents = async (calendarId = '', maxResults = 20) => {
nextWeekDate.setDate(currentDate.getDate() + 7);

const calendarQueryParams = new URLSearchParams({
calendarId,
maxResults,
calendarId: calendarId,
maxResults: maxResults,
singleEvents: true,
timeZone: 'Etc/Utc',
key: SHARED_CALENDAR_KEY,
Expand Down
8 changes: 4 additions & 4 deletions apps/site/next.dynamic.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const getPathname = (path = []) => path.join('/');
// we use a platform-specific separator to split the pathname
// since we're using filepaths here and not URL paths
const mapPathToRoute = (locale = defaultLocale.code, path = '') => ({
locale,
locale: locale,
path: path.split(sep),
});

Expand Down Expand Up @@ -122,7 +122,7 @@ const getDynamicRouter = async () => {
`${locale}${normalizedPathname}`
);

return { source: fileContent, filename };
return { source: fileContent, filename: filename };
}

// Attempts to read a file or simply (and silently) fail, as the file might
Expand All @@ -140,7 +140,7 @@ const getDynamicRouter = async () => {
fileLanguageContent
);

return { source: fileLanguageContent, filename };
return { source: fileLanguageContent, filename: filename };
}

// Prevent infinite loops as if at this point the file does not exist with the default locale
Expand All @@ -160,7 +160,7 @@ const getDynamicRouter = async () => {
// of the same locale for this file and improve read performance
cachedMarkdownFiles.set(`${locale}${normalizedPathname}`, fileContent);

return { source: fileContent, filename };
return { source: fileContent, filename: filename };
}

return { filename: '', source: '' };
Expand Down
10 changes: 5 additions & 5 deletions apps/site/next.mdx.use.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ import WithNodeRelease from './components/withNodeRelease';
* @satisfies {import('mdx/types').MDXComponents}
*/
export const mdxComponents = {
DownloadReleasesTable: DownloadReleasesTable,
DownloadReleasesTable,
// HOC for getting Node.js Release Metadata
WithNodeRelease: WithNodeRelease,
WithNodeRelease,
// HOC for providing Banner Data
WithBanner: WithBanner,
WithBanner,
// HOC for providing Badge Data
WithBadgeGroup: WithBadgeGroup,
WithBadgeGroup,
// Renders an container for Upcoming Node.js Meetings
UpcomingMeetings: UpcomingMeetings,
UpcomingMeetings,
};
4 changes: 2 additions & 2 deletions apps/site/next.rewrites.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const redirects = async () => {
// We prevent permanent redirects as in general the redirects are safeguards
// of legacy or old pages or pages that moved, and in general we don't want permanent redirects
permanent: false,
destination,
destination: destination,
}));
};

Expand All @@ -40,7 +40,7 @@ const rewrites = async () => {
const mappedRewrites = siteRedirects.internal.map(
({ source, destination }) => ({
source: source.replace('/:locale', localesMatch),
destination,
destination: destination,
})
);

Expand Down
11 changes: 6 additions & 5 deletions apps/site/reducers/releaseReducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@ export const releaseState: Types.ReleaseState = {
export const getActions = (
dispatch: Dispatch<Types.ReleaseAction>
): Types.ReleaseDispatchActions => ({
setVersion: payload => dispatch({ type: 'SET_VERSION', payload }),
setOS: payload => dispatch({ type: 'SET_OS', payload }),
setPlatform: payload => dispatch({ type: 'SET_PLATFORM', payload }),
setVersion: payload => dispatch({ type: 'SET_VERSION', payload: payload }),
setOS: payload => dispatch({ type: 'SET_OS', payload: payload }),
setPlatform: payload => dispatch({ type: 'SET_PLATFORM', payload: payload }),
setInstallMethod: payload =>
dispatch({ type: 'SET_INSTALL_METHOD', payload }),
setPackageManager: payload => dispatch({ type: 'SET_MANAGER', payload }),
dispatch({ type: 'SET_INSTALL_METHOD', payload: payload }),
setPackageManager: payload =>
dispatch({ type: 'SET_MANAGER', payload: payload }),
});

const reducer = (
Expand Down
2 changes: 1 addition & 1 deletion apps/site/scripts/orama-search/get-documents.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export const siteContent = [...pageData, ...apiData]
const path = `${pathname}#${slug(section.pageSectionTitle)}`;

return {
path,
path: path,
siteSection: uppercaseFirst(siteSection),
pageTitle: title,
...section,
Expand Down
5 changes: 3 additions & 2 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import js from '@eslint/js';
import importX from 'eslint-plugin-import-x';
import { flatConfigs } from 'eslint-plugin-import-x';

export default [
js.configs.recommended,
importX.flatConfigs.recommended,
flatConfigs.recommended,
{
ignores: [
'node_modules',
Expand Down Expand Up @@ -44,6 +44,7 @@ export default [
},
},
],
'object-shorthand': ['error', 'consistent-as-needed'],
},
},
];
4 changes: 2 additions & 2 deletions packages/i18n/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import importX from 'eslint-plugin-import-x';
import { flatConfigs } from 'eslint-plugin-import-x';
import tseslint from 'typescript-eslint';

import baseConfig from '../../eslint.config.js';

export default [
...baseConfig,
...tseslint.configs.recommended,
importX.flatConfigs.typescript,
flatConfigs.typescript,
{
rules: {
'@typescript-eslint/array-type': ['error', { default: 'generic' }],
Expand Down
12 changes: 6 additions & 6 deletions packages/rehype-shiki/src/highlighter.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ export const createHighlighter = options => {
* Highlights code and returns the inner HTML inside the <code> tag
*
* @param {string} code - The code to highlight
* @param {string} language - The programming language to use for highlighting
* @param {string} lang - The programming language to use for highlighting
* @returns {string} The inner HTML of the highlighted code
*/
const highlightToHtml = (code, language) =>
const highlightToHtml = (code, lang) =>
shiki
.codeToHtml(code, { lang: language, theme })
.codeToHtml(code, { lang, theme })
// Shiki will always return the Highlighted code encapsulated in a <pre> and <code> tag
// since our own CodeBox component handles the <code> tag, we just want to extract
// the inner highlighted code to the CodeBox
Expand All @@ -53,10 +53,10 @@ export const createHighlighter = options => {
* Highlights code and returns a HAST tree
*
* @param {string} code - The code to highlight
* @param {string} language - The programming language to use for highlighting
* @param {string} lang - The programming language to use for highlighting
*/
const highlightToHast = (code, language) =>
shiki.codeToHast(code, { lang: language, theme });
const highlightToHast = (code, lang) =>
shiki.codeToHast(code, { lang, theme });

return {
shiki,
Expand Down
2 changes: 1 addition & 1 deletion packages/rehype-shiki/src/plugin.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export default function rehypeShikiji() {
properties: {
languages: languages.join('|'),
displayNames: displayNames.join('|'),
defaultTab,
defaultTab: defaultTab,
},
};

Expand Down
Loading
Loading