Skip to content
Open
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
5 changes: 3 additions & 2 deletions .github/workflows/publish-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,11 @@ jobs:
# Check if a custom publish script exists in package.json
if jq -e '.scripts.release' package.json > /dev/null; then
pnpm run release
else
pnpm publish --access public --no-git-checks
fi
# Then publish the package to npm
pnpm publish --access public --no-git-checks
- name: Notify on Manual Release
if: ${{ github.event_name == 'workflow_dispatch' }}
uses: rtCamp/action-slack-notify@e31e87e03dd19038e411e38ae27cbad084a90661 # 2.3.3
Expand Down
15 changes: 7 additions & 8 deletions apps/site/components/Common/Partners/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import Tooltip from '@node-core/ui-components/Common/Tooltip';
import * as PartnerLogos from '@node-core/ui-components/Icons/PartnerLogos';

import providePartners from '#site/next-data/providers/partners';
Expand Down Expand Up @@ -36,15 +35,15 @@ const renderSmallPartner = (partner: Partner) => {
const Logo = PartnerLogos[partner.id];

return (
<Tooltip
<PartnerButton
aria-label={partner.name}
key={partner.id}
asChild
content={<div className={style.tooltip}>{partner.name}</div>}
size="small"
href={partner.href}
data-tooltip={partner.name}
>
<PartnerButton aria-label={partner.name} size="small" href={partner.href}>
<Logo.Favicon />
</PartnerButton>
</Tooltip>
<Logo.Favicon />
</PartnerButton>
);
};

Expand Down
8 changes: 2 additions & 6 deletions apps/site/components/withMetaBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,7 @@ const WithMetaBar: FC = () => {
// Since we cannot show the same number of avatars in Mobile / Tablet
// resolution as we do on desktop and there is overflow, we are adjusting
// the number of avatars manually for the resolutions below
const isMobileResolution = useMediaQuery('(max-width: 890px)');

const isTabletResolution = useMediaQuery(
'(min-width: 890px) and (max-width: 1280px)'
);
const isSmallerThanDesktop = useMediaQuery('(max-width: 1280px)');

return (
<MetaBar
Expand All @@ -55,7 +51,7 @@ const WithMetaBar: FC = () => {
)]: (
<WithAvatarGroup
usernames={usernames}
limit={isMobileResolution ? 7 : isTabletResolution ? 5 : 9}
limit={isSmallerThanDesktop ? 5 : 8}
/>
),
}),
Expand Down
8 changes: 4 additions & 4 deletions apps/site/layouts/layouts.module.css
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
@reference "../styles/index.css";

.baseLayout {
@apply grid
@apply ml:grid
ml:grid-cols-[1fr]
ml:grid-rows-[auto_1fr_auto]
h-max
min-h-full
w-full
grid-cols-[1fr]
grid-rows-[auto_1fr_auto];
w-full;
}

.centeredLayout {
Expand Down
2 changes: 1 addition & 1 deletion apps/site/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
/// <reference types="next/navigation-types/compat/navigation" />
import './.next/types/routes.d.ts';
import './.next/dev/types/routes.d.ts';

// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
2 changes: 1 addition & 1 deletion apps/site/next.fetch.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const fetchWithRetry = async (
const backoff = Math.max(0, Number(delay) || 0);

const attemptFetch = attempt =>
fetch(url, options).catch(e => {
fetch(url, { ...options, signal: AbortSignal.timeout(30000) }).catch(e => {
if (attempt === retries || !isTimeoutError(e)) {
throw e;
}
Comment on lines 28 to 32
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This overwrites any caller-provided options.signal, so upstream abort/cancellation will no longer work. If you want a 30s timeout and to respect an existing signal, combine them (e.g., AbortSignal.any([options.signal, AbortSignal.timeout(30000)]) when options.signal is present).

Copilot uses AI. Check for mistakes.
Expand Down
1 change: 1 addition & 0 deletions apps/site/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "Bundler",
"customConditions": ["default"],
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "react-jsx",
Expand Down
12 changes: 10 additions & 2 deletions packages/rehype-shiki/src/plugin.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ const languagePrefix = 'language-';
// The regex to match metadata
const rMeta = /(\w+)(?:=(?:"([^"]+)"|(\S+)))?/g;

const getLineCount = value =>
value
.split('\n')
.filter((_, i, arr) => !(i === arr.length - 1 && arr[i] === '')).length;

/**
* Parses a fenced code block metadata string into a JavaScript object.
* @param {string} meta - The metadata string from a Markdown code fence.
Expand Down Expand Up @@ -163,7 +168,9 @@ export default async function rehypeShikiji(options) {
const meta = parseMeta(preElement.data?.meta);

// Retrieve the whole <pre> contents as a parsed DOM string
const preElementContents = toString(preElement);
const preElementContents = toString(preElement).replace(/\n$/, '');

const lineCount = getLineCount(preElementContents);

// Grabs the relevant alias/name of the language
const languageId = codeLanguage.slice(languagePrefix.length);
Expand All @@ -178,7 +185,8 @@ export default async function rehypeShikiji(options) {
// Adds the original language back to the <pre> element
children[0].properties.class = classNames(
children[0].properties.class,
codeLanguage
codeLanguage,
{ 'no-line-numbers': lineCount < 5, 'no-footer': lineCount === 1 }
);

// Replaces the <pre> element with the updated one
Expand Down
20 changes: 20 additions & 0 deletions packages/ui-components/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,23 @@ The components are based on [this design file](https://www.figma.com/design/a10c
Most components in this package are available on [Chromatic](https://www.chromatic.com/library?appId=64c7d71358830e9105808652).

For additional details regarding specific components, refer to the [nodejs/nodejs.org](https://github.com/nodejs/nodejs.org) repository.

## Local development

To use this package via `npm link` in another repo (for example, doc-kit), build the
compiled outputs and keep them updated while you work.

```bash
# From nodejs.org/packages/ui-components
pnpm install
node --run compile:watch

# In another terminal, still in nodejs.org/packages/ui-components
npm link

# From the consumer repo (for example doc-kit)
npm link @node-core/ui-components
```

The `compile:watch` script keeps `dist/` up to date so consumers resolve compiled
CSS and JavaScript instead of the raw Tailwind source.
49 changes: 34 additions & 15 deletions packages/ui-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,20 @@
"version": "1.5.10",
"type": "module",
"exports": {
"./*": [
"./src/*",
"./src/*.tsx",
"./src/*/index.tsx",
"./src/*.ts",
"./src/*/index.ts"
]
"./*": {
"rolldown": [
"./dist/*",
"./dist/*.js",
"./dist/*/index.js"
],
"default": [
"./src/*",
"./src/*.tsx",
"./src/*/index.tsx",
"./src/*.ts",
Comment on lines +12 to +16
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default export condition points at ./src/*, but the package files list only publishes dist/**. Any consumer/runtime that doesn’t recognize the custom rolldown condition will fall back to default and fail to resolve because src/ isn’t shipped. Consider either publishing src/** as a fallback or making default point to dist/ and using a separate condition for workspace source.

Copilot uses AI. Check for mistakes.
"./src/*/index.ts"
]
}
},
"repository": {
"type": "git",
Expand All @@ -20,7 +27,8 @@
"compile:ts": "tsc",
"compile:css": "postcss --dir dist --base src \"src/**/*.module.css\" src/styles/index.css",
"compile": "node --run compile:ts && node --run compile:css",
"release": "node --run compile && node scripts/publish.mjs",
"compile:watch": "node --run compile:ts -- --watch & node --run compile:css -- --watch",
"release": "node --run compile",
Comment on lines 27 to +31
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

compile:watch uses & to run the TS and CSS watchers. This works in POSIX shells, but on Windows cmd.exe & does not background the first process, so postcss --watch may never start. Using a cross-platform runner (e.g., concurrently) avoids platform-specific behavior.

Copilot uses AI. Check for mistakes.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ain't adding a 3rd party package due to that.

"lint": "node --run lint:js && node --run lint:css",
"lint:css": "stylelint \"**/*.css\" --allow-empty-input --cache --cache-strategy=content --cache-location=.stylelintcache",
"lint:css:fix": "node --run lint:css -- --fix",
Expand Down Expand Up @@ -80,14 +88,25 @@
"typescript": "catalog:"
},
"imports": {
"#ui/*": [
"./src/*",
"./src/*.tsx",
"./src/*/index.tsx",
"./src/*.ts",
"./src/*/index.ts"
]
"#ui/*": {
"rolldown": [
"./dist/*",
"./dist/*.js",
"./dist/*/index.js"
],
"default": [
"./src/*",
"./src/*.tsx",
"./src/*/index.tsx",
"./src/*.ts",
"./src/*/index.ts"
]
}
},
"files": [
"dist/**",
"README.md"
],
"engines": {
"node": ">=20"
}
Expand Down
32 changes: 0 additions & 32 deletions packages/ui-components/scripts/publish.mjs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
px-4.5
py-2.5
text-center
font-semibold
motion-safe:transition-colors;
font-semibold;

svg {
@apply size-5;
Expand Down Expand Up @@ -124,7 +123,7 @@
after:mx-auto
after:h-px
after:w-2/5
after:bg-gradient-to-r
after:bg-linear-to-r
after:from-green-600/0
after:via-green-600
after:to-green-600/0
Expand Down
27 changes: 23 additions & 4 deletions packages/ui-components/src/Common/BaseCodeBox/index.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,19 @@
[counter-increment:line];
}
}

&[class*='plain-text'] {
@apply font-mono;
}
}

&[class*='no-line-numbers'] > code > [class='line'] {
@apply pl-0;

&:not(:empty:last-child)::after {
@apply content-none
[counter-reset:none];
}
}
}

Expand All @@ -62,8 +75,8 @@
justify-between
border-t
border-t-neutral-900
px-4
py-3
px-3
py-2
text-sm
font-medium;

Expand All @@ -72,9 +85,15 @@
}

& > .action {
@apply px-3
py-1.5
@apply px-2.5
py-1
text-xs
font-medium;

> svg {
@apply h-4
w-4;
}
}
}
}
Loading
Loading