Skip to content

Releases: souporserious/renoun

[email protected]

31 Jan 21:33
6bf47dd
Compare
Choose a tag to compare

Patch Changes

  • 076403c: Update restyle dependency to latest version.

[email protected]

31 Jan 18:43
cbf823d
Compare
Choose a tag to compare

Patch Changes

@renoun/[email protected]

31 Jan 18:43
cbf823d
Compare
Choose a tag to compare

Patch Changes

  • ae38994: Update shiki dependency to latest version.

[email protected]

30 Jan 19:51
145c23b
Compare
Choose a tag to compare

Minor Changes

  • b7895d2: Renames file system pathCasing option to slugCasing to better reflect its purpose. This also adds an option for configuring the casing used for JavaScriptFileExport.

  • 03d7591: Exports a parseCodeProps utility for the CodeInline 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 the CodeBlock 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]

30 Jan 19:51
145c23b
Compare
Choose a tag to compare

Minor Changes

  • 2a150d6: Updates custom readline implementation to use @clack/prompts.

[email protected]

29 Jan 07:49
7c4f29c
Compare
Choose a tag to compare

Minor Changes

  • 2af679d: Adds createFile method to MemoryFileSystem.

  • 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 to File#getModifierName to be more descriptive and avoid confusion.

Patch Changes

  • f05656d: Fixes missing JS Doc metadata for overloads in JavaScriptFileExport#getType.
  • f47bd21: Fixes type aliases being inferred as components in JavaScriptFileExport#getType.
  • 38a8ae1: Exports DirectoryOptions interface.
  • 72b8e58: Fixes APIReference documentation for overloads.

[email protected]

29 Jan 07:49
7c4f29c
Compare
Choose a tag to compare

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]

22 Jan 23:25
48c94a2
Compare
Choose a tag to compare

Minor Changes

  • 339ef75: Aligns CodeBlock scroll container styles with CodeInline.

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]

20 Jan 18:56
d243515
Compare
Choose a tag to compare

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 the renoun/file-system package and use the Directory class instead. In most cases, you can replace Collection with Directory and CompositeCollection with EntryGroup.

    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 from Directory and EntryGroup. This also exports two new custom errors, FileNotFoundError and FileExportNotFoundError to handle missing files and exports.

    Breaking Changes

    Directory and EntryGroup 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 with File#getParent always returning a Directory instance.

  • 71aa01f: Adds a default mdx loader to JavaScriptFile that uses the MDXRenderer 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 and JavaScriptFile more easily using only a path:

    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 from JavaScriptFileExport#getType into two separate Utility and UtilityReference 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 using createServer from renoun/server:

    import { createServer } from 'renoun/server'
    
    createServer({ port: 3001 })
  • b82df87: Allows File System type guards (isDirectory, isFile, isJavaScriptFile) to accept undefined. 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, and NodeFileSystem classes for creating custom file systems as well as Repository 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]

20 Jan 18:56
d243515
Compare
Choose a tag to compare

Patch Changes

  • c394b9c: Moves shiki to dynamic import to avoid ESM require errors.