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
2 changes: 1 addition & 1 deletion data/tables/copilot/model-release-status.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
# xAI models
- name: 'Grok Code Fast 1'
provider: 'xAI'
release_status: 'Public preview'
release_status: 'GA'
agent_mode: true
ask_mode: true
edit_mode: true
8 changes: 5 additions & 3 deletions next.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ const config: NextConfig = {
typescript: {
ignoreBuildErrors: true,
},
eslint: {
ignoreDuringBuilds: true,
},

i18n: {
locales: languageKeys,
defaultLocale: 'en',
Expand All @@ -49,6 +47,10 @@ const config: NextConfig = {
}
})
},
// Turbopack is the default bundler in Next.js 16
// Keep webpack config for now to support both bundlers
turbopack: {},

webpack: (webpackConfig) => {
webpackConfig.experiments = webpackConfig.experiments || {}
webpackConfig.experiments.topLevelAwait = true
Expand Down
1,073 changes: 542 additions & 531 deletions package-lock.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"all-documents": "tsx src/content-render/scripts/all-documents/cli.ts",
"analyze-text": "tsx src/search/scripts/analyze-text.ts",
"analyze-comment": "tsx src/events/scripts/analyze-comment-cli.ts",
"build": "next build",
"build": "next build --webpack",
"check-content-type": "tsx src/workflows/check-content-type.ts",
"check-github-github-links": "tsx src/links/scripts/check-github-github-links.ts",
"clone-translations": "./src/languages/scripts/clone-translations.sh",
Expand Down Expand Up @@ -161,7 +161,7 @@
"@primer/live-region-element": "^0.7.2",
"@primer/octicons": "^19.19.0",
"@primer/octicons-react": "^19.14.0",
"@primer/react": "^37.31.0",
"@primer/react": "^38.0.0",
"accept-language-parser": "^1.5.0",
"ajv": "^8.17.1",
"ajv-errors": "^3.0.0",
Expand Down Expand Up @@ -210,7 +210,7 @@
"mdast-util-to-hast": "^13.2.0",
"mdast-util-to-markdown": "2.1.2",
"mdast-util-to-string": "^4.0.0",
"next": "^15.4.7",
"next": "^16.0.1",
"ora": "^9.0.0",
"parse5": "7.1.2",
"quick-lru": "7.0.1",
Expand Down Expand Up @@ -316,7 +316,7 @@
"typescript": "^5.8.3",
"unist-util-remove": "^4.0.0",
"unist-util-visit-parents": "6.0.1",
"vitest": "^3.1.2",
"vitest": "^4.0.4",
"website-scraper": "^5.3.1"
},
"overrides": {
Expand Down
18 changes: 10 additions & 8 deletions src/data-directory/lib/data-schemas/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ function loadTableSchemas(): DataSchemas {
const schemaPath = path.join(schemasDir, `${name}.ts`)

if (fs.existsSync(schemaPath)) {
tableSchemas[`data/tables/${yamlFile}`] = `@/data-directory/lib/data-schemas/tables/${name}`
// Use relative path from test file for vitest 4.x compatibility with dynamic imports
tableSchemas[`data/tables/${yamlFile}`] = `../lib/data-schemas/tables/${name}.ts`
}
}
}
Expand All @@ -31,14 +32,15 @@ function loadTableSchemas(): DataSchemas {
}

// Manual schema registrations for non-table data
// Use relative paths from the test file for vitest 4.x compatibility with dynamic imports
const manualSchemas: DataSchemas = {
'data/features': '@/data-directory/lib/data-schemas/features',
'data/variables': '@/data-directory/lib/data-schemas/variables',
'data/learning-tracks': '@/data-directory/lib/data-schemas/learning-tracks',
'data/release-notes': '@/data-directory/lib/data-schemas/release-notes',
'data/code-languages.yml': '@/data-directory/lib/data-schemas/code-languages',
'data/glossaries/candidates.yml': '@/data-directory/lib/data-schemas/glossaries-candidates',
'data/glossaries/external.yml': '@/data-directory/lib/data-schemas/glossaries-external',
'data/features': '../lib/data-schemas/features.ts',
'data/variables': '../lib/data-schemas/variables.ts',
'data/learning-tracks': '../lib/data-schemas/learning-tracks.ts',
'data/release-notes': '../lib/data-schemas/release-notes.ts',
'data/code-languages.yml': '../lib/data-schemas/code-languages.ts',
'data/glossaries/candidates.yml': '../lib/data-schemas/glossaries-candidates.ts',
'data/glossaries/external.yml': '../lib/data-schemas/glossaries-external.ts',
}

// Combine manual registrations with auto-discovered table schemas
Expand Down
24 changes: 16 additions & 8 deletions src/events/lib/analyze-comment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,15 @@ import { cuss } from 'cuss'
import { cuss as cussPt } from 'cuss/pt'
import { cuss as cussFr } from 'cuss/fr'
import { cuss as cussEs } from 'cuss/es'
import { Language } from '@horizon-rs/language-guesser'
let language: any = null

const language = new Language()
async function getLanguageInstance() {
if (!language) {
const { Language } = await import('@horizon-rs/language-guesser')
language = new Language()
}
return language
}

// Exported for the debugging CLI script
export const SIGNAL_RATINGS = [
Expand Down Expand Up @@ -48,8 +54,8 @@ export const SIGNAL_RATINGS = [
{
reduction: 0.2,
name: 'not-language',
validator: (comment: string, commentLanguage: string) =>
isNotLanguage(comment, commentLanguage),
validator: async (comment: string, commentLanguage: string) =>
await isNotLanguage(comment, commentLanguage),
},
{
reduction: 0.3,
Expand Down Expand Up @@ -80,7 +86,8 @@ export async function getGuessedLanguage(comment: string) {
return
}

const bestGuess = language.guessBest(comment.trim(), [])
const lang = await getLanguageInstance()
const bestGuess = lang.guessBest(comment.trim(), [])
if (!bestGuess) return // Can happen if the text is just whitespace
// // @horizon-rs/language-guesser is based on tri-grams and can lead
// // to false positives. For example, it thinks that 'Thamk you ❤️🙏' is
Expand All @@ -98,7 +105,7 @@ export async function analyzeComment(text: string, commentLanguage = 'en') {
const signals = []
let rating = 1.0
for (const { reduction, name, validator } of SIGNAL_RATINGS) {
if (validator(text, commentLanguage)) {
if (await validator(text, commentLanguage)) {
signals.push(name)
rating -= reduction
}
Expand Down Expand Up @@ -153,8 +160,9 @@ function isSingleWord(text: string) {
return whitespaceSplit.length === 1
}

function isNotLanguage(text: string, language_: string) {
const bestGuess = language.guessBest(text.trim(), [])
async function isNotLanguage(text: string, language_: string) {
const lang = await getLanguageInstance()
const bestGuess = lang.guessBest(text.trim(), [])
if (!bestGuess) return true // Can happen if the text is just whitespace
// @horizon-rs/language-guesser is based on tri-grams and can lead
// to false positives. For example, it thinks that 'Thamk you ❤️🙏' is
Expand Down
18 changes: 8 additions & 10 deletions src/frame/components/article/ArticleGridLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from 'react'
import cx from 'classnames'
import { Box } from '@primer/react'
import { SupportPortalVaIframe, SupportPortalVaIframeProps } from './SupportPortalVaIframe'

import styles from './ArticleGridLayout.module.scss'
Expand All @@ -26,32 +25,31 @@ export const ArticleGridLayout = ({
const containerBoxStyles = fullWidth ? '' : styles.containerBox
return (
<div className={cx(containerBoxStyles, className)}>
{topper && <Box gridArea="topper">{topper}</Box>}
{topper && <div style={{ gridArea: 'topper' }}>{topper}</div>}
{intro && (
<Box id="article-intro" gridArea="intro" className="f4 pb-4">
<div id="article-intro" style={{ gridArea: 'intro' }} className="f4 pb-4">
{intro}
</Box>
</div>
)}

{toc && (
<Box
<div
data-container="toc"
gridArea="sidebar"
alignSelf="flex-start"
style={{ gridArea: 'sidebar', alignSelf: 'flex-start' }}
className={cx(styles.sidebarBox, 'border-bottom border-lg-0 pb-4 mb-5 pb-xl-0 mb-xl-0')}
>
{toc}
</Box>
</div>
)}

<Box data-container="article" gridArea="content" data-search="article-body">
<div data-container="article" style={{ gridArea: 'content' }} data-search="article-body">
{supportPortalVaIframeProps &&
supportPortalVaIframeProps.supportPortalUrl &&
supportPortalVaIframeProps.vaFlowUrlParameter && (
<SupportPortalVaIframe supportPortalVaIframeProps={supportPortalVaIframeProps} />
)}
{children}
</Box>
</div>
</div>
)
}
31 changes: 16 additions & 15 deletions src/frame/components/article/ArticleInlineLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from 'react'
import cx from 'classnames'
import { Box } from '@primer/react'
import { SupportPortalVaIframe, SupportPortalVaIframeProps } from './SupportPortalVaIframe'

import styles from './ArticleInlineLayout.module.scss'
Expand Down Expand Up @@ -28,39 +27,41 @@ export const ArticleInlineLayout = ({
return (
<div className={cx(styles.containerBox, className)}>
{breadcrumbs && (
<Box gridArea="breadcrumbs" className={cx('d-none d-xxl-block mt-3 mr-auto width-full')}>
<div
style={{ gridArea: 'breadcrumbs' }}
className={cx('d-none d-xxl-block mt-3 mr-auto width-full')}
>
{breadcrumbs}
</Box>
</div>
)}
<div className={cx(styles.contentBox)}>
{topper && <Box gridArea="topper">{topper}</Box>}
{topper && <div style={{ gridArea: 'topper' }}>{topper}</div>}

{intro && (
<Box id="article-intro" gridArea="intro" className="f4">
<div id="article-intro" style={{ gridArea: 'intro' }} className="f4">
{intro}
</Box>
</div>
)}

{introCallOuts && (
<Box gridArea="intro" className="f4 mb-4">
<div style={{ gridArea: 'intro' }} className="f4 mb-4">
{introCallOuts}
</Box>
</div>
)}

{toc && (
<Box
<div
data-container="toc"
gridArea="sidebar"
alignSelf="flex-start"
style={{ gridArea: 'sidebar', alignSelf: 'flex-start' }}
className={cx(styles.sidebarBox, 'border-bottom border-lg-0 pb-4 mb-5 pb-xl-0 mb-xl-0')}
>
{toc}
</Box>
</div>
)}

<Box
<div
data-container="article"
gridArea="content"
style={{ gridArea: 'content' }}
data-search="article-body"
className={cx(styles.articleContainer, className)}
>
Expand All @@ -70,7 +71,7 @@ export const ArticleInlineLayout = ({
<SupportPortalVaIframe supportPortalVaIframeProps={supportPortalVaIframeProps} />
)}
{children}
</Box>
</div>
</div>
</div>
)
Expand Down
8 changes: 4 additions & 4 deletions src/graphql/scripts/utils/process-schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -401,17 +401,17 @@ export default async function processSchemas(
returnField.kind = fieldKind
returnField.href = helpers.getFullLink(returnField.kind, returnField.id)
returnField.description = await helpers.getDescription(
field.description?.value || '',
returnFieldDef.description?.value || '',
)
returnField.isDeprecated = helpers.getDeprecationStatus(
(field.directives || []) as readonly ConstDirectiveNode[],
(returnFieldDef.directives || []) as readonly ConstDirectiveNode[],
)
returnField.deprecationReason = await helpers.getDeprecationReason(
(field.directives || []) as readonly ConstDirectiveNode[],
(returnFieldDef.directives || []) as readonly ConstDirectiveNode[],
returnField as ReturnFieldInfo,
)
returnField.preview = await helpers.getPreview(
(field.directives || []) as readonly ConstDirectiveNode[],
(returnFieldDef.directives || []) as readonly ConstDirectiveNode[],
returnField as ReturnFieldInfo,
previewsPerVersion,
)
Expand Down
7 changes: 7 additions & 0 deletions src/landings/components/ArticleCard.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.topicsList {
list-style-type: none;
}

.label {
margin-right: 0.25rem;
}
6 changes: 4 additions & 2 deletions src/landings/components/ArticleCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { Label } from '@primer/react'
import { ArticleGuide } from '@/landings/components/ProductGuidesContext'
import { Link } from '@/frame/components/Link'

import styles from './ArticleCard.module.scss'

type Props = {
card: ArticleGuide
typeLabel: string
Expand All @@ -23,15 +25,15 @@ export const ArticleCard = ({ tabIndex, card, typeLabel }: Props) => {
</div>
<p className="color-fg-muted my-3">{card.intro}</p>
{card.topics.length > 0 && (
<ul style={{ listStyleType: 'none' }}>
<ul className={styles.topicsList}>
{card.topics.map((topic) => {
return (
<li className="d-inline-block" key={topic}>
<Label
data-testid="article-card-topic"
size="small"
variant="accent"
sx={{ mr: 1 }}
className={styles.label}
>
{topic}
</Label>
Expand Down
15 changes: 15 additions & 0 deletions src/landings/components/CookBookArticleCard.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.spotlightImage {
background-color: gray;
margin-bottom: 20px;
border-radius: 5px;
width: 100%;
height: auto;
}

.cardContainer {
min-height: 200px;
}

.label {
margin-right: 0.25rem;
}
Loading
Loading