Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions .github/workflows/publish-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ on:

permissions:
contents: read
# For npm OIDC (https://docs.npmjs.com/trusted-publishers)
id-token: write

env:
COMMIT_SHA: ${{ github.sha }}
Expand Down Expand Up @@ -115,8 +117,6 @@ jobs:

- name: Publish
working-directory: packages/${{ matrix.package }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
# Install deps
pnpm install --frozen-lockfile
Expand Down
6 changes: 2 additions & 4 deletions apps/site/components/Common/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import BaseButton from '@node-core/ui-components/Common/BaseButton';
import type { ButtonProps } from '@node-core/ui-components/Common/BaseButton';
import type { FC, ComponentProps } from 'react';
import type { FC } from 'react';

import Link from '#site/components/Link';

const Button: FC<
Omit<ButtonProps, 'as'> & Omit<ComponentProps<typeof Link>, 'as' | 'size'>
> = props => <BaseButton as={Link} {...props} />;
const Button: FC<ButtonProps> = props => <BaseButton as={Link} {...props} />;

export default Button;
26 changes: 9 additions & 17 deletions apps/site/components/Link.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,17 @@
import type { FC, HTMLProps } from 'react';
import type { FC, AnchorHTMLAttributes, ComponentProps } from 'react';

import { Link as LocalizedLink } from '#site/navigation.mjs';

const Link: FC<HTMLProps<HTMLAnchorElement>> = ({
children,
href,
...props
}) => {
if (!href || /^https?:/.test(href.toString())) {
return (
<a href={href} {...props}>
{children}
</a>
);
export type LinkProps =
| ComponentProps<typeof LocalizedLink>
| AnchorHTMLAttributes<HTMLAnchorElement>;

const Link: FC<LinkProps> = ({ href, ...props }) => {
if (!href || /^https?:/.test(href as string)) {
return <a href={href as string} {...props} />;
}

return (
<LocalizedLink href={href?.toString()} {...props}>
{children}
</LocalizedLink>
);
return <LocalizedLink href={href} {...props} />;
};

export default Link;
7 changes: 4 additions & 3 deletions apps/site/components/LinkWithArrow.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { ArrowUpRightIcon } from '@heroicons/react/24/solid';
import type { SlotProps } from '@radix-ui/react-slot';
import { Slot } from '@radix-ui/react-slot';
import type { ComponentProps, FC, PropsWithChildren } from 'react';
import type { FC, PropsWithChildren } from 'react';

import Link from '#site/components/Link';
import type { LinkProps } from '#site/components/Link';

type LinkWithArrowProps =
| ({ asChild?: false } & ComponentProps<typeof Link>)
| ({ asChild?: false } & LinkProps)
| ({ asChild: true } & SlotProps);

const LinkWithArrow: FC<PropsWithChildren<LinkWithArrowProps>> = ({
Expand All @@ -17,7 +18,7 @@ const LinkWithArrow: FC<PropsWithChildren<LinkWithArrowProps>> = ({
const Comp = asChild ? Slot : Link;

return (
<Comp {...props}>
<Comp {...(props as SlotProps)}>
<span>
{children}
<ArrowUpRightIcon className="ml-1 inline w-3 fill-neutral-600 dark:fill-white" />
Expand Down
11 changes: 2 additions & 9 deletions apps/site/components/Releases/MinorReleasesTable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,23 +36,16 @@ export const MinorReleasesTable: FC<MinorReleasesTableProps> = ({
<td>
<div className={styles.links}>
<Link
kind="neutral"
href={`https://nodejs.org/download/release/v${release.version}/`}
>
{t('components.minorReleasesTable.actions.release')}
</Link>
<Separator orientation="vertical" />
<Link
kind="neutral"
href={`${BASE_CHANGELOG_URL}${release.version}`}
>
<Link href={`${BASE_CHANGELOG_URL}${release.version}`}>
{t('components.minorReleasesTable.actions.changelog')}
</Link>
<Separator orientation="vertical" />
<Link
kind="neutral"
href={getNodeApiUrl(`v${release.version}`)}
>
<Link href={getNodeApiUrl(`v${release.version}`)}>
{t('components.minorReleasesTable.actions.docs')}
</Link>
</div>
Expand Down
2 changes: 1 addition & 1 deletion apps/site/next.constants.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ export const GITHUB_API_KEY = process.env.NEXT_GITHUB_API_KEY || '';
* The resource we point people to when discussing internationalization efforts.
*/
export const TRANSLATION_URL =
'https://github.com/nodejs/nodejs.org/blob/main/TRANSLATION.md#how-to-translate';
'https://github.com/nodejs/nodejs.org/blob/main/docs/translation.md#how-to-translate';

/**
* Define the order in which vulnerabilities should be sorted
Expand Down
Loading