Releases: souporserious/renoun
[email protected]
Patch Changes
- 076403c: Update
restyle
dependency to latest version.
[email protected]
Patch Changes
- ae38994: Update
shiki
dependency to latest version. - Updated dependencies [ae38994]
- @renoun/[email protected]
@renoun/[email protected]
Patch Changes
- ae38994: Update
shiki
dependency to latest version.
[email protected]
Minor Changes
-
b7895d2: Renames file system
pathCasing
option toslugCasing
to better reflect its purpose. This also adds an option for configuring the casing used forJavaScriptFileExport
. -
03d7591: Exports a
parseCodeProps
utility for theCodeInline
component to makie it easier to parse and type custom MDX components correctly:import { CodeInline, parseCodeProps } from 'renoun/components' import type { MDXComponents } from 'renoun/mdx' export function useMDXComponents() { return { code: (props) => { return <CodeInline {...parseCodeProps(props)} /> }, } satisfies MDXComponents }
-
3547b64: Exports the
parsePreProps
utility for theCodeBlock
component instead of attaching it to the component itself:import { CodeBlock, parsePreProps } from 'renoun/components' import type { MDXComponents } from 'renoun/mdx' export function useMDXComponents() { return { pre: (props) => { return <CodeBlock {...parsePreProps(props)} /> }, } satisfies MDXComponents }
Patch Changes
- 1555cca: Fixes return type in
APIReference
always spanning entire width.
[email protected]
Minor Changes
- 2a150d6: Updates custom readline implementation to use
@clack/prompts
.
[email protected]
Minor Changes
-
2af679d: Adds
createFile
method toMemoryFileSystem
. -
dec8620: Removes predefined
MDXComponents
components since it's easy to instantiate yourself which allows overriding defaults. The same functionality can be achieved by defining the components directly:import { CodeBlock, CodeInline } from 'renoun/components' import type { MDXComponents } from 'renoun/mdx' const mdxComponents = { pre: (props) => { const { value, language } = CodeBlock.parsePreProps(props) return <CodeBlock value={value} language={language} /> }, code: (props) => { return <CodeInline value={props.children} language="typescript" /> }, } satisfies MDXComponents
-
2b4aa82: Renames
File#getModifier
toFile#getModifierName
to be more descriptive and avoid confusion.
Patch Changes
[email protected]
Major Changes
- 35921f5: Adds the initial release of the
create-renoun
CLI. This package is a scaffolding tool for renoun examples. It provides a simple way to clone an example with the necessary configuration and dependencies.
[email protected]
Minor Changes
- 339ef75: Aligns
CodeBlock
scroll container styles withCodeInline
.
Patch Changes
- 5390d03: Fixes Standard Schema types not working by copying them directly into the project.
- 94f53da: Fixes
CodeBlock
fallback layout shift during development. - 5a641b3: Fixes collapsed right padding for
CodeInline
when container is scrolled to the end. - ca25cd3: Fixes missing bottom padding for
CodeInline
in iOS Safari.
[email protected]
Major Changes
-
02facb1: Removes
renoun/collections
package export and all related types and utilities that were deprecated in v7.8.0.Breaking Changes
The
renoun/collections
package was removed. To upgrade, move to therenoun/file-system
package and use theDirectory
class instead. In most cases, you can replaceCollection
withDirectory
andCompositeCollection
withEntryGroup
.Before
import { Collection, CompositeCollection } from 'renoun/collections' const docs = new Collection({ filePattern: '*.mdx', baseDirectory: 'docs', }) const components = new Collection({ filePattern: '*.{ts,tsx}', baseDirectory: 'src/components', }) const compositeCollection = new CompositeCollection(docs, components)
After
import { Directory, EntryGroup } from 'renoun/file-system' const docs = new Directory({ path: 'docs', include: '*.mdx', }) const components = new Directory({ path: 'src/components', include: '*.{ts,tsx}', }) const entryGroup = new EntryGroup({ entries: [docs, components], })
-
eda5977: Removes all
*OrThrow
methods fromDirectory
andEntryGroup
. This also exports two new custom errors,FileNotFoundError
andFileExportNotFoundError
to handle missing files and exports.Breaking Changes
Directory
andEntryGroup
no longer have*OrThrow
methods, use the respective methods instead. To get the same functionality as before, you can catch the error and handle it accordingly:import { Directory, FileNotFoundError } from 'renoun/file-system' const posts = new Directory({ path: 'posts' }) posts.getFile('hello-world', 'mdx').catch((error) => { if (error instanceof FileNotFoundError) { return undefined } throw error })
Minor Changes
-
fcd11af: Now
Directory#getParent
throws when called for the root directory. This makes the method easier to work with and aligns better withFile#getParent
always returning aDirectory
instance. -
71aa01f: Adds a default
mdx
loader toJavaScriptFile
that uses theMDXRenderer
component. This allows MDX files without imports to be rendered easily:import { Directory } from 'renoun/file-system' const posts = new Directory({ path: 'posts' }) export default async function Page({ params, }: { params: Promise<{ slug: string }> }) { const slug = (await params).slug const post = await posts.getFile(slug, 'mdx') const Content = await post.getExportValue('default') return <Content /> }
-
21a952a: Adds
File#getText
method for retrieving the text contents of the file. -
e107c2f: Allows instantiating
File
andJavaScriptFile
more easily using only apath
:import { JavaScriptFile } from 'renoun/file-system' const indexFile = new JavaScriptFile({ path: 'src/index.ts' }) const indexFileExports = await indexFile.getExports()
-
3298b6b: Refactors
Generic
kind that can be returned fromJavaScriptFileExport#getType
into two separateUtility
andUtilityReference
kinds. This is more explicit in how types are resolved based on where the type resolution starts from.// "Partial" is resolved as a "Utility" kind when starting from the type alias type Partial<Type> = { [Key in keyof Type]?: Type[Key] } // Whereas "Partial" here is resolved as a "UtilityReference" kind when resolved from within a type interface Props<Type> { options: Partial<Type> }
-
a470c98: Adds an overload to
Directory#getFile
that allows for querying files by their path including the extension instead of needing to provide the extension separately:const rootDirectory = new Directory() const file = await rootDirectory.getFile('tsconfig.json')
-
919b73d: Configures the JavaScript RegExp Engine for
shiki
. -
eb6a7f2: The WebSocket server now uses
.gitignore
to ignore watching files instead of a hardcoded array. -
213cc11: Adds an option for specifying the
port
number when usingcreateServer
fromrenoun/server
:import { createServer } from 'renoun/server' createServer({ port: 3001 })
-
b82df87: Allows File System type guards (
isDirectory
,isFile
,isJavaScriptFile
) to acceptundefined
. This saves from having to check if a file exists before checking its type. -
37cb7bb: Fixes running multiple renoun WebSocket servers by setting the port to
0
by default. This allows the OS to assign an available port. -
446effc: Exports
FileSystem
,MemoryFileSystem
, andNodeFileSystem
classes for creating custom file systems as well asRepository
for normalizing git providers.import { Directory, MemoryFileSystem } from 'renoun/file-system' const fileSystem = new MemoryFileSystem({ 'index.mdx': '# Hello, World!', }) const directory = new Directory({ fileSystem })
Patch Changes
- 8f64055: Fixes error when adding a file at a previously deleted path by flushing the file deletion immediately.
- 334f859: Fixes duplicate unions appearing in
JavaScriptFileExport#getType
. - 438dc94: Avoids creating duplicate watchers for the same directory.
- 1cc52b8: Fixes Webpack cache warning from dynamic prettier import by moving to require.
- ce751f1: Fixes non-exported types not being resolved.
- 7b90440: Fixes
getType
erroring when inferring a re-exported type. - 54eeb9e: Fixes duplicate exports when there are overloads.
- Updated dependencies [c394b9c]
- @renoun/[email protected]
@renoun/[email protected]
Patch Changes
- c394b9c: Moves
shiki
to dynamic import to avoid ESM require errors.