Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version Packages #230

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Version Packages #230

wants to merge 1 commit into from

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Dec 31, 2024

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

Releases

[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 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 } 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()
  • 919b73d: Configures the JavaScript RegExp Engine for shiki.

  • 213cc11: Adds an option for specifying the port number when using createServer from renoun/server:

    import { createServer } from 'renoun/server'
    
    createServer({ port: 3001 })
  • 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

  • 7b90440: Fixes getType erroring when inferring a re-exported type.
  • 54eeb9e: Fixes duplicate exports when there are overloads.

Copy link

vercel bot commented Dec 31, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
renoun ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 5, 2025 7:16am

@github-actions github-actions bot force-pushed the changeset-release/main branch from 448f2de to 1be7651 Compare December 31, 2024 21:28
@github-actions github-actions bot force-pushed the changeset-release/main branch from 1be7651 to 4a7f5d3 Compare December 31, 2024 23:16
@github-actions github-actions bot force-pushed the changeset-release/main branch from 4a7f5d3 to f8fa28b Compare January 1, 2025 01:00
@github-actions github-actions bot force-pushed the changeset-release/main branch from f8fa28b to 99de572 Compare January 1, 2025 01:04
@github-actions github-actions bot force-pushed the changeset-release/main branch from 99de572 to 6e7b171 Compare January 1, 2025 01:59
@github-actions github-actions bot force-pushed the changeset-release/main branch from 6e7b171 to c1b5803 Compare January 1, 2025 02:19
@github-actions github-actions bot force-pushed the changeset-release/main branch from c1b5803 to cabb1fc Compare January 1, 2025 04:50
@github-actions github-actions bot force-pushed the changeset-release/main branch from cabb1fc to 6f11d65 Compare January 1, 2025 04:54
@github-actions github-actions bot force-pushed the changeset-release/main branch from 6f11d65 to 4701b7e Compare January 1, 2025 07:58
@github-actions github-actions bot force-pushed the changeset-release/main branch from 4701b7e to e01e867 Compare January 1, 2025 19:38
@github-actions github-actions bot force-pushed the changeset-release/main branch from e01e867 to 79eaa08 Compare January 3, 2025 05:08
@github-actions github-actions bot force-pushed the changeset-release/main branch from 79eaa08 to d87df36 Compare January 3, 2025 06:51
@github-actions github-actions bot force-pushed the changeset-release/main branch from d87df36 to ab52f4b Compare January 3, 2025 08:02
@github-actions github-actions bot force-pushed the changeset-release/main branch from ab52f4b to 6880a44 Compare January 3, 2025 08:35
@github-actions github-actions bot force-pushed the changeset-release/main branch from 6880a44 to 9b03c03 Compare January 3, 2025 09:10
@github-actions github-actions bot force-pushed the changeset-release/main branch from 9b03c03 to 7d16d65 Compare January 3, 2025 09:15
@github-actions github-actions bot force-pushed the changeset-release/main branch from 7d16d65 to 7a3990d Compare January 3, 2025 18:56
@github-actions github-actions bot force-pushed the changeset-release/main branch from 7a3990d to 529575e Compare January 3, 2025 22:18
@github-actions github-actions bot force-pushed the changeset-release/main branch from 529575e to 46a3d0a Compare January 3, 2025 22:28
@github-actions github-actions bot force-pushed the changeset-release/main branch from 46a3d0a to 2e8f626 Compare January 3, 2025 22:55
@github-actions github-actions bot force-pushed the changeset-release/main branch from 2e8f626 to 20a9175 Compare January 4, 2025 07:20
@github-actions github-actions bot force-pushed the changeset-release/main branch from 20a9175 to c691167 Compare January 4, 2025 19:47
@github-actions github-actions bot force-pushed the changeset-release/main branch from c691167 to dc39cbf Compare January 4, 2025 19:53
@github-actions github-actions bot force-pushed the changeset-release/main branch from dc39cbf to ff8936d Compare January 4, 2025 21:23
@github-actions github-actions bot force-pushed the changeset-release/main branch from ff8936d to 0185045 Compare January 4, 2025 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants