renoun@7.5.0
github-actions
released this
19 Nov 20:14
·
70 commits
to main
since this release
Minor Changes
-
abb441d: Improves error handling for the
CodeBlock
component when falsey values are provided. -
0b6e426: Adds
sort
method toDirectory
to allow sorting all entries within each directory:import { Directory, isFileWithExtension } from 'renoun' type PostType = { frontmatter: { title: string } } const posts = new Directory<{ mdx: PostType }>({ path: 'posts' }) .filter((entry) => isFileWithExtension(entry, 'mdx')) .sort(async (a, b) => { const aFrontmatter = await a.getExport('frontmatter').getRuntimeValue() const bFrontmatter = await b.getExport('frontmatter').getRuntimeValue() return aFrontmatter.title.localeCompare(bFrontmatter.title) }) const files = await posts.getEntries() // JavaScriptFile<PostType>[] sorted by front matter title
-
cac71c1: Improves
<VirtualFileSystem>.transpileFile
error handling. -
2c55b51: Adds
filter
method toDirectory
to allow filtering all entries within each directory:import { Directory, isFileWithExtension } from 'renoun' type PostType = { frontmatter: { title: string } } const posts = new Directory<{ mdx: PostType }>({ path: 'posts' }).filter( (entry) => isFileWithExtension(entry, 'mdx') ) const files = await posts.getEntries() // JavaScriptFile<PostType>[]
-
40c6cdd: Scopes
VirtualFileSystem
using aprojectId
added to the baseFileSystem
class. This ensures the TypeScript project is unique to the virtual file system it is instantiated with.
Patch Changes
- 1c77620: Fixes the
<Directory>.getEntries
methodrecursive
option to only recurse ingetEntries
instead of the file system.