Skip to content

Commit 1d7016a

Browse files
committed
Merge remote-tracking branch 'upstream/main'
2 parents 15a8e1d + ad86795 commit 1d7016a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+2583
-381
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Security Notes
2+
# Only selected Actions are allowed within this repository. Please refer to (https://github.com/nodejs/nodejs.org/settings/actions)
3+
# for the full list of available actions. If you want to add a new one, please reach out a maintainer with Admin permissions.
4+
# REVIEWERS, please always double-check security practices before merging a PR that contains Workflow changes!!
5+
# AUTHORS, please only use actions with explicit SHA references, and avoid using `@master` or `@main` references or `@version` tags.
6+
7+
name: Create Release Blog Post
8+
9+
on:
10+
workflow_dispatch:
11+
inputs:
12+
version:
13+
description: The version to generate a blog post for.
14+
type: string
15+
required: true
16+
17+
defaults:
18+
run:
19+
# This ensures that the working directory is the root of the repository
20+
working-directory: ./
21+
22+
permissions:
23+
contents: write
24+
25+
jobs:
26+
create-post:
27+
runs-on: ubuntu-latest
28+
29+
steps:
30+
- uses: nodejs/web-team/actions/setup-environment@2c2897a93eb99b4cdca270729100bc0887c758d9
31+
with:
32+
pnpm: true
33+
use-version-file: true
34+
35+
- run: node --run scripts:release-post "$VERSION"
36+
env:
37+
VERSION: ${{ inputs.version }}
38+
39+
- name: Open pull request
40+
uses: gr2m/create-or-update-pull-request-action@b65137ca591da0b9f43bad7b24df13050ea45d1b # v1.10.1
41+
# Creates a PR or update the Action's existing PR, or
42+
# no-op if the base branch is already up-to-date.
43+
with:
44+
update-pull-request-title-and-body: true
45+
branch: release-${{ inputs.version }}
46+
body: |
47+
Creates a new blog post for ${{ inputs.version }}
48+
49+
Check this workflow's logs at ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}.
50+
commit-message: 'feat(blog): create post for ${{ inputs.version }}'
51+
labels: fast-track
52+
title: 'feat(blog): create post for ${{ inputs.version }}'
53+
draft: true

.github/workflows/notify-on-push.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,5 @@ jobs:
1616
runs-on: ubuntu-latest
1717
steps:
1818
- uses: nodejs/web-team/actions/notify-on-push@2c2897a93eb99b4cdca270729100bc0887c758d9
19+
with:
20+
webhook: ${{ secrets.SLACK_WEBHOOK }}
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Security Notes
2+
# Only selected Actions are allowed within this repository. Please refer to (https://github.com/nodejs/nodejs.org/settings/actions)
3+
# for the full list of available actions. If you want to add a new one, please reach out a maintainer with Admin permissions.
4+
# REVIEWERS, please always double-check security practices before merging a PR that contains Workflow changes!!
5+
# AUTHORS, please only use actions with explicit SHA references, and avoid using `@master` or `@main` references or `@version` tags.
6+
7+
# Note: this is a temporary workflow for deploying the OpenNext version of the site (hosted on https://node-test.org)
8+
# this version of the site is just used for testing purposes and ideally we want to keep it in sync with the
9+
#  official website
10+
11+
name: Deploy the Cloudflare OpenNext test version of the site (https://node-test.org)
12+
13+
on:
14+
workflow_dispatch:
15+
push:
16+
branches:
17+
- main
18+
19+
concurrency:
20+
group: ${{ github.workflow }}-${{ github.ref }}
21+
cancel-in-progress: true
22+
23+
permissions:
24+
contents: read
25+
26+
jobs:
27+
deploy:
28+
name: Deploy Open-Next site
29+
runs-on: ubuntu-latest
30+
31+
steps:
32+
- name: Harden Runner
33+
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
34+
with:
35+
egress-policy: audit
36+
37+
- name: Git Checkout
38+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
39+
40+
- name: Set up pnpm
41+
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
42+
43+
- name: Set up Node.js
44+
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
45+
with:
46+
# We want to ensure that the Node.js version running here respects our supported versions
47+
node-version-file: '.nvmrc'
48+
cache: 'pnpm'
49+
50+
- name: Install packages
51+
run: pnpm install --frozen-lockfile
52+
53+
- name: Build blog data
54+
working-directory: apps/site
55+
run: node --run build:blog-data
56+
57+
- name: Build open-next site
58+
working-directory: apps/site
59+
run: node --run cloudflare:build:worker
60+
61+
- name: Deploy open-next site
62+
working-directory: apps/site
63+
run: node --run cloudflare:deploy
64+
env:
65+
CF_WORKERS_SCRIPTS_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
66+
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ Our documentation is organized in the [`docs/`](./docs/) directory, so check out
128128

129129
## Project Maintainers
130130

131-
This project is maintained by the [Node.js Website Team](https://github.com/nodejs/nodejs.org#readme). For questions about governance or high-level project direction, you can:
131+
This project is maintained by the [Node.js Website Team](https://github.com/nodejs/web-team/blob/main/MEMBERS.md#nodejs-website-team-nodejsnodejs-website). For questions about governance or high-level project direction, you can:
132132

133133
- Mention `@nodejs/nodejs-website` in issues or PRs
134134
- Contact team members directly for guidance

apps/site/app/[locale]/blog/[...path]/page.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ export const generateViewport = basePage.generateViewport;
1515

1616
// This generates each page's HTML Metadata
1717
// @see https://nextjs.org/docs/app/api-reference/functions/generate-metadata
18-
export const generateMetadata = basePage.generateMetadata;
18+
export const generateMetadata = ({ params }: PageParams) =>
19+
basePage.generateMetadata({ params, prefix: 'blog' });
1920

2021
// Generates all possible static paths based on the locales and environment configuration
2122
// - Returns an empty array if static export is disabled (`ENABLE_STATIC_EXPORT` is false)

apps/site/app/[locale]/download/archive/[version]/page.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import { notFound, redirect } from 'next/navigation';
22
import type { FC } from 'react';
33

44
import provideReleaseData from '#site/next-data/providers/releaseData';
5+
import provideReleaseVersions from '#site/next-data/providers/releaseVersions';
56
import { ENABLE_STATIC_EXPORT } from '#site/next.constants.mjs';
6-
import { ARCHIVE_DYNAMIC_ROUTES } from '#site/next.dynamic.constants.mjs';
77
import * as basePage from '#site/next.dynamic.page.mjs';
88
import { defaultLocale } from '#site/next.locales.mjs';
99
import type { DynamicParams } from '#site/types';
@@ -29,7 +29,9 @@ export const generateStaticParams = async () => {
2929
return [];
3030
}
3131

32-
return ARCHIVE_DYNAMIC_ROUTES.map(version => ({
32+
const versions = await provideReleaseVersions();
33+
34+
return versions.map(version => ({
3335
locale: defaultLocale.code,
3436
version,
3537
}));
@@ -46,15 +48,17 @@ const getPage: FC<PageParams> = async props => {
4648
const [locale, pathname] = basePage.getLocaleAndPath(version, routeLocale);
4749

4850
if (version === 'current') {
49-
const releaseData = provideReleaseData();
51+
const releaseData = await provideReleaseData();
5052

5153
const release = releaseData.find(release => release.status === 'Current');
5254

5355
redirect(`/${locale}/download/archive/${release?.versionWithPrefix}`);
5456
}
5557

58+
const versions = await provideReleaseVersions();
59+
5660
// Verifies if the current route is a dynamic route
57-
const isDynamicRoute = ARCHIVE_DYNAMIC_ROUTES.some(r => r.includes(pathname));
61+
const isDynamicRoute = versions.some(r => r.includes(pathname));
5862

5963
// Gets the Markdown content and context for Download Archive pages
6064
const [content, context] = await basePage.getMarkdownContext({

apps/site/app/[locale]/not-found.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
'use client';
1+
'use server';
22

33
import { ArrowRightIcon } from '@heroicons/react/24/solid';
4-
import { useTranslations } from 'next-intl';
4+
import { getTranslations } from 'next-intl/server';
55
import type { FC } from 'react';
66

77
import Button from '#site/components/Common/Button';
88
import Turtle from '#site/components/Common/Turtle';
99
import GlowingBackdropLayout from '#site/layouts/GlowingBackdrop';
1010

11-
const NotFoundPage: FC = () => {
12-
const t = useTranslations();
11+
const NotFoundPage: FC = async () => {
12+
const t = await getTranslations();
1313

1414
return (
1515
<GlowingBackdropLayout kind="default">
Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
1-
'use client';
2-
31
import BaseLinkTabs from '@node-core/ui-components/Common/BaseLinkTabs';
42
import type { LinkTabsProps } from '@node-core/ui-components/Common/BaseLinkTabs';
53
import type { FC } from 'react';
64

75
import Link from '#site/components/Link';
8-
import { useRouter } from '#site/navigation.mjs';
96

10-
const LinkTabs: FC<Omit<LinkTabsProps, 'as' | 'onSelect'>> = props => {
11-
const { push } = useRouter();
12-
return <BaseLinkTabs onSelect={value => push(value)} as={Link} {...props} />;
7+
const LinkTabs: FC<Omit<LinkTabsProps, 'as'>> = props => {
8+
return <BaseLinkTabs as={Link} {...props} />;
139
};
1410

1511
export default LinkTabs;

apps/site/components/Common/Supporters/index.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use client';
2-
31
import Avatar from '@node-core/ui-components/Common/AvatarGroup/Avatar';
42
import type { FC } from 'react';
53

@@ -11,8 +9,13 @@ type SupportersListProps = {
119

1210
const SupportersList: FC<SupportersListProps> = ({ supporters }) => (
1311
<div className="flex max-w-full flex-wrap items-center justify-center gap-1">
14-
{supporters.map(({ name, image }, i) => (
15-
<Avatar nickname={name} image={image} key={`${name}-${i}`} />
12+
{supporters.map(({ name, image, profile }, i) => (
13+
<Avatar
14+
nickname={name}
15+
image={image}
16+
key={`${name}-${i}`}
17+
url={profile}
18+
/>
1619
))}
1720
</div>
1821
);

apps/site/components/Downloads/DownloadButton/index.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
'use client';
2-
31
import { CloudArrowDownIcon } from '@heroicons/react/24/outline';
42
import classNames from 'classnames';
53
import type { FC, PropsWithChildren } from 'react';
64

5+
import { getClientContext } from '#site/client-context';
76
import Button from '#site/components/Common/Button';
8-
import { useClientContext } from '#site/hooks';
97
import type { NodeRelease } from '#site/types';
108
import { getNodeDownloadUrl } from '#site/util/url';
119
import { getUserPlatform } from '#site/util/userAgent';
@@ -18,7 +16,7 @@ const DownloadButton: FC<PropsWithChildren<DownloadButtonProps>> = ({
1816
release: { versionWithPrefix },
1917
children,
2018
}) => {
21-
const { os, bitness, architecture } = useClientContext();
19+
const { os, bitness, architecture } = getClientContext();
2220

2321
const platform = getUserPlatform(architecture, bitness);
2422
const downloadLink = getNodeDownloadUrl({ versionWithPrefix, os, platform });

0 commit comments

Comments
 (0)