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
1 change: 1 addition & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ updates:
- vfile
- vfile-*
- reading-time
- twoslash
orama:
patterns:
- '@orama/*'
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/lint-and-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ jobs:

- name: Upload test results to Codecov
if: ${{ !cancelled() && github.event_name != 'merge_group' }}
uses: codecov/test-results-action@47f89e9acb64b76debcd5ea40642d25a4adced9f # v1.1.1
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
with:
report_type: test_results
files: ./apps/site/junit.xml,./packages/*/junit.xml
14 changes: 6 additions & 8 deletions apps/site/app/[locale]/next-data/og/[category]/[title]/route.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,15 @@ export const GET = async (_: Request, props: StaticParams) => {
const gridBackground = `radial-gradient(circle, ${categoryColour}, transparent)`;

return new ImageResponse(
(
<div tw="relative flex items-center justify-center bg-black w-[1200px] h-[600px]">
<HexagonGrid style={{ background: gridBackground }} />
<div tw="relative flex items-center justify-center bg-black w-[1200px] h-[600px]">
<HexagonGrid style={{ background: gridBackground }} />

<div tw="absolute mx-auto flex max-w-xl flex-col text-center text-3xl font-semibold text-white">
<JsWhiteIcon width={71} height={80} tw="mx-auto" />
<div tw="absolute mx-auto flex max-w-xl flex-col text-center text-3xl font-semibold text-white">
<JsWhiteIcon width={71} height={80} tw="mx-auto" />

<h2>{params.title.slice(0, 100)}</h2>
</div>
<h2>{params.title.slice(0, 100)}</h2>
</div>
),
</div>,
{ width: 1200, height: 600 }
);
};
Expand Down
38 changes: 17 additions & 21 deletions apps/site/components/Common/CodeBox.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
'use client';

import { CodeBracketIcon } from '@heroicons/react/24/outline';
import {
DocumentDuplicateIcon,
CodeBracketIcon,
} from '@heroicons/react/24/outline';
import BaseCodeBox from '@node-core/ui-components/Common/BaseCodeBox';
import styles from '@node-core/ui-components/Common/BaseCodeBox/index.module.css';
import { useNotification } from '@node-core/ui-components/Providers/NotificationProvider';
import { useTranslations } from 'next-intl';

import Link from '#site/components/Link';
Expand All @@ -14,34 +15,29 @@ import type { FC, PropsWithChildren } from 'react';
type CodeBoxProps = {
language: string;
className?: string;
showCopyButton?: boolean;
};

const CodeBox: FC<PropsWithChildren<CodeBoxProps>> = props => {
const [, copyToClipboard] = useCopyToClipboard();
const notify = useNotification();
const [copied, copyToClipboard] = useCopyToClipboard();
const t = useTranslations();

const onCopy = (text: string) => {
copyToClipboard(text);

notify({
duration: 800,
message: (
<div className="flex items-center gap-3">
<CodeBracketIcon className={styles.icon} />
{t('components.common.codebox.copied')}
</div>
),
});
};
const ButtonIcon = copied ? DocumentDuplicateIcon : CodeBracketIcon;

return (
<BaseCodeBox
as={Link}
onCopy={onCopy}
onCopy={copyToClipboard}
buttonContent={
<>
<ButtonIcon className="size-4" />
{t(
copied
? 'components.common.codebox.copied'
: 'components.common.codebox.copy'
)}
</>
}
{...props}
buttonText={t('components.common.codebox.copy')}
/>
);
};
Expand Down
10 changes: 8 additions & 2 deletions apps/site/components/Common/Partners/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@ const renderSmallPartner = (partner: Partner) => {
return (
<Tooltip
key={partner.id}
asChild
content={<div className={style.tooltip}>{partner.name}</div>}
>
<PartnerButton size="small" href={partner.href}>
<PartnerButton aria-label={partner.name} size="small" href={partner.href}>
<Logo.Favicon />
</PartnerButton>
</Tooltip>
Expand All @@ -51,7 +52,12 @@ const renderLargePartner = (partner: Partner) => {
const Logo = PartnerLogos[partner.id];

return (
<PartnerButton key={partner.id} size="large" href={partner.href}>
<PartnerButton
aria-label={partner.name}
key={partner.id}
size="large"
href={partner.href}
>
<Logo.Logo />
</PartnerButton>
);
Expand Down
13 changes: 3 additions & 10 deletions apps/site/components/MDX/CodeBox/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,17 @@ import { getLanguageDisplayName } from '@node-core/rehype-shiki';

import CodeBox from '#site/components/Common/CodeBox';

import type { FC, PropsWithChildren } from 'react';
import type { FC, HTMLAttributes } from 'react';

type CodeBoxProps = { className?: string; showCopyButton?: string };

const MDXCodeBox: FC<PropsWithChildren<CodeBoxProps>> = ({
const MDXCodeBox: FC<HTMLAttributes<HTMLElement>> = ({
children: code,
className,
showCopyButton,
}) => {
const matches = className?.match(/language-(?<language>[a-zA-Z]+)/);
const language = matches?.groups?.language ?? '';

return (
<CodeBox
language={getLanguageDisplayName(language)}
showCopyButton={showCopyButton ? showCopyButton === 'true' : undefined}
className={className}
>
<CodeBox language={getLanguageDisplayName(language)} className={className}>
{code}
</CodeBox>
);
Expand Down
12 changes: 3 additions & 9 deletions apps/site/layouts/Base.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
'use client';

import { NotificationProvider } from '@node-core/ui-components/Providers/NotificationProvider';

import { NavigationStateProvider } from '#site/providers/navigationStateProvider';

import type { FC, PropsWithChildren } from 'react';

import styles from './layouts.module.css';

const BaseLayout: FC<PropsWithChildren> = ({ children }) => (
<NotificationProvider>
<NavigationStateProvider>
<div className={styles.baseLayout}>{children}</div>
</NavigationStateProvider>
</NotificationProvider>
<NavigationStateProvider>
<div className={styles.baseLayout}>{children}</div>
</NavigationStateProvider>
);

export default BaseLayout;
5 changes: 2 additions & 3 deletions apps/site/next-data/generators/__tests__/releaseData.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@ describe('generateReleaseData', () => {
}),
});

const { default: generateReleaseData } = await import(
'#site/next-data/generators/releaseData.mjs'
);
const { default: generateReleaseData } =
await import('#site/next-data/generators/releaseData.mjs');

const result = await generateReleaseData();

Expand Down
1 change: 0 additions & 1 deletion apps/site/next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ const nextConfig = {
'@radix-ui/react-label',
'@radix-ui/react-select',
'@radix-ui/react-tabs',
'@radix-ui/react-toast',
'@radix-ui/react-tooltip',
'@radix-ui/react-avatar',
'@orama/highlight',
Expand Down
20 changes: 10 additions & 10 deletions apps/site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@
"@opentelemetry/instrumentation": "~0.206.0",
"@opentelemetry/resources": "~1.30.1",
"@opentelemetry/sdk-logs": "~0.206.0",
"@orama/core": "^1.2.15",
"@orama/core": "^1.2.16",
"@orama/ui": "^1.5.4",
"@radix-ui/react-tabs": "^1.1.13",
"@radix-ui/react-tooltip": "^1.2.8",
"@tailwindcss/postcss": "~4.1.17",
"@tailwindcss/postcss": "~4.1.18",
"@types/node": "catalog:",
"@types/react": "catalog:",
"@vcarl/remark-headings": "~0.1.0",
Expand All @@ -64,14 +64,14 @@
"next-themes": "~0.4.6",
"postcss-calc": "~10.1.1",
"react": "catalog:",
"react-dom": "^19.2.1",
"react-dom": "^19.2.3",
"reading-time": "~1.5.0",
"rehype-autolink-headings": "~7.1.0",
"rehype-slug": "~6.0.0",
"remark-gfm": "~4.0.1",
"remark-reading-time": "~2.0.2",
"semver": "~7.7.2",
"sval": "^0.6.3",
"sval": "^0.6.8",
"tailwindcss": "catalog:",
"twoslash": "^0.3.6",
"unist-util-visit": "^5.0.0",
Expand All @@ -90,23 +90,23 @@
"@types/semver": "~7.7.1",
"babel-plugin-react-compiler": "^1.0.0",
"dedent": "^1.7.0",
"eslint-config-next": "16.0.7",
"eslint-config-next": "16.1.1",
"eslint-plugin-mdx": "~3.6.2",
"eslint-plugin-react": "~7.37.5",
"eslint-plugin-react-hooks": "^7.0.1",
"global-jsdom": "^27.0.0",
"handlebars": "4.7.8",
"jsdom": "^27.2.0",
"jsdom": "^27.4.0",
"mdast-util-from-markdown": "^2.0.2",
"nock": "^14.0.10",
"remark-frontmatter": "^5.0.0",
"stylelint": "16.24.0",
"stylelint-config-standard": "39.0.0",
"stylelint-order": "7.0.0",
"stylelint": "16.26.1",
"stylelint-config-standard": "39.0.1",
"stylelint-order": "7.0.1",
"stylelint-selector-bem-pattern": "4.0.1",
"tsx": "^4.21.0",
"typescript": "catalog:",
"typescript-eslint": "~8.45.0",
"typescript-eslint": "~8.50.1",
"user-agent-data-types": "0.4.2",
"wrangler": "^4.53.0"
},
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,22 @@
},
"dependencies": {
"husky": "9.1.7",
"lint-staged": "16.2.3",
"lint-staged": "16.2.7",
"turbo": "2.6.1"
},
"devDependencies": {
"@eslint/js": "~9.36.0",
"@eslint/js": "~9.39.2",
"@reporters/github": "^1.11.0",
"@testing-library/react": "~16.3.0",
"@testing-library/react": "~16.3.1",
"cross-env": "^10.1.0",
"eslint": "~9.36.0",
"eslint": "~9.39.2",
"eslint-import-resolver-typescript": "~4.4.4",
"eslint-plugin-import-x": "~4.16.1",
"globals": "^16.5.0",
"prettier": "3.6.2",
"prettier": "3.7.4",
"prettier-plugin-tailwindcss": "0.7.2",
"typescript": "catalog:",
"typescript-eslint": "~8.45.0"
"typescript-eslint": "~8.50.1"
},
"packageManager": "[email protected]",
"devEngines": {
Expand Down
10 changes: 5 additions & 5 deletions packages/rehype-shiki/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
"test:unit": "cross-env NODE_NO_WARNINGS=1 node --experimental-test-coverage --experimental-test-module-mocks --test \"**/*.test.mjs\""
},
"dependencies": {
"@shikijs/core": "^3.19.0",
"@shikijs/engine-javascript": "^3.19.0",
"@shikijs/engine-oniguruma": "^3.19.0",
"@shikijs/twoslash": "^3.19.0",
"@shikijs/core": "^3.20.0",
"@shikijs/engine-javascript": "^3.20.0",
"@shikijs/engine-oniguruma": "^3.20.0",
"@shikijs/twoslash": "^3.20.0",
"classnames": "catalog:",
"hast-util-to-string": "^3.0.1",
"shiki": "~3.19.0",
"shiki": "~3.20.0",
"unist-util-visit": "^5.0.0"
},
"devDependencies": {
Expand Down
5 changes: 2 additions & 3 deletions packages/rehype-shiki/src/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@ async function getEngine({ wasm = false }) {
return createOnigurumaEngine(await import('shiki/wasm'));
}

const { createJavaScriptRegexEngine } = await import(
'@shikijs/engine-javascript'
);
const { createJavaScriptRegexEngine } =
await import('@shikijs/engine-javascript');
return createJavaScriptRegexEngine();
}

Expand Down
9 changes: 0 additions & 9 deletions packages/rehype-shiki/src/plugin.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -181,15 +181,6 @@ export default async function rehypeShikiji(options) {
codeLanguage
);

// Adds a Copy Button to the CodeBox if requested as an additional parameter
// And avoids setting the property (overriding) if undefined or invalid value
if (
meta.showCopyButton &&
['true', 'false'].includes(meta.showCopyButton)
) {
children[0].properties.showCopyButton = meta.showCopyButton;
}

// Replaces the <pre> element with the updated one
parent.children.splice(index, 1, ...children);
});
Expand Down
7 changes: 0 additions & 7 deletions packages/ui-components/.storybook/preview.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { withThemeByDataAttribute } from '@storybook/addon-themes';

import { NotificationProvider } from '#ui/Providers/NotificationProvider';

import type { Preview, ReactRenderer } from '@storybook/react-webpack5';

import { STORYBOOK_MODES, STORYBOOK_SIZES } from './constants';
Expand All @@ -17,11 +15,6 @@ const preview: Preview = {
},

decorators: [
Story => (
<NotificationProvider>
<Story />
</NotificationProvider>
),
withThemeByDataAttribute<ReactRenderer>({
themes: { light: '', dark: 'dark' },
defaultTheme: 'light',
Expand Down
Loading
Loading