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
6 changes: 3 additions & 3 deletions app/services/articleService.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import fs from 'fs';
import path from 'path';
import yaml from 'js-yaml';
import { load as loadYaml } from 'js-yaml';
import matter from 'gray-matter';
import { Article } from '../types/Article';
import { Link } from '../types/Link';
Expand Down Expand Up @@ -1031,7 +1031,7 @@ function updateDocumentDbLocalContent(content: string): string {
export function getArticleContent(): Article {
const contentPath = path.join(articlesDirectory, 'content.yml');
const fileContents = fs.readFileSync(contentPath, 'utf8');
return yaml.load(fileContents) as Article;
return loadYaml(fileContents) as Article;
}

export function getArticleNavigation(section: string): Link[] {
Expand All @@ -1042,7 +1042,7 @@ export function getArticleNavigation(section: string): Link[] {
}

const fileContents = fs.readFileSync(navPath, 'utf8');
const rawLinks = yaml.load(fileContents) as Link[];
const rawLinks = loadYaml(fileContents) as Link[];
const normalizedLinks = splitPrebuiltNavigation(section, rawLinks);

// Transform Markdown file links to published relative URIs
Expand Down
33 changes: 28 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"change-case": "^5.4.4",
"gray-matter": "^4.0.3",
"handlebars": "^4.7.8",
"js-yaml": "^4.1.1",
"js-yaml": "^5.2.2",
"next": "^16.2.12",
"pluralize": "^8.0.0",
"react": "^19.2.3",
Expand Down
4 changes: 2 additions & 2 deletions scripts/compile-samples.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import path from 'path';
import { spawnSync } from 'child_process';
import React from 'react';
import { render, Box, Text } from 'ink';
import yaml from 'js-yaml';
import { load as loadYaml } from 'js-yaml';

/**
* Configuration for the samples registry
Expand Down Expand Up @@ -103,7 +103,7 @@ async function compileSamples(config: SamplesConfig): Promise<CompileResult> {
throw new Error(`Registry file not found: ${config.registryFile}`);
}

const registry = yaml.load(fs.readFileSync(registryPath, 'utf8')) as Registry;
const registry = loadYaml(fs.readFileSync(registryPath, 'utf8')) as Registry;

if (!registry?.samples || !Array.isArray(registry.samples)) {
throw new Error('registry.yml must contain a top-level "samples" array');
Expand Down