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 #226

Merged
merged 1 commit into from
Dec 30, 2024
Merged

Version Packages #226

merged 1 commit into from
Dec 30, 2024

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Dec 8, 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

@renoun/[email protected]

Minor Changes

  • 97bc268: Renames @renoun/mdx Headings type to MDXHeadings. This adds better clarity and consistency with the other MDX prefixed types.

    Breaking Changes

    • Rename any Headings references from @renoun/mdx to MDXHeadings.

Patch Changes

  • ece3cc2: Fixes inline code language inference by considering language aliases.
  • df4d29d: Removes mdast dependency. This was added by mistake and is not needed since @types/mdast is already a dependency.

[email protected]

Minor Changes

  • 3022d63: Renames Directory and File getParentDirectory methods to getParent to better align with getSiblings. This also aligns more closely with the web File System API's getParent method.

    Breaking Changes

    • Directory.getParentDirectory is now Directory.getParent
    • File.getParentDirectory is now File.getParent
  • ba2d5e1: Adds pathCasing option to Directory for setting the casing of all path methods. This is useful for ensuring that all paths are in a consistent casing, regardless of the underlying file system.

    import { Directory } from 'renoun/file-system'
    
    const directory = new Directory({
      path: 'components',
      pathCasing: 'kebab',
    })
    const file = await directory.getFileOrThrow('button')
    
    file.getPath() // '/button'
    
    const directory = await directory.getDirectoryOrThrow('card')
    
    directory.getPath() // '/card'
  • 87e380b: Renames the MDXContent component to MDXRenderer. This was causing confusion with the MDXContent type exported from renoun/mdx and better reflects the purpose of the component.

    Breaking Changes

    • Rename any MDXContent component references from renoun/components to MDXRenderer.
  • 4149b39: Refactors the Directory builder pattern to move back to an object configuration with the addition of a new withSchema helper, allowing strong type inference and colocated file export type definitions:

    import { Directory, withSchema } from 'renoun/file-system'
    import { z } from 'zod'
    
    export const Posts = new Directory({
      path: 'posts',
      include: '*.mdx',
      loaders: {
        mdx: withSchema(
          {
            frontmatter: z.object({
              title: z.string(),
              description: z.string(),
              date: z.date(),
              tags: z.array(z.string()).optional(),
            }),
          },
          (path) => import(`@/posts/${path}.mdx`)
        ),
      },
    })

    Note, some additional changes have also been made:

    • withModule has been replaced in favor of a loaders option.
    • withFilter has been replaced by an include option to better align with TypeScript's configuration naming.
    • The new include filter now also accepts a string glob file pattern e.g. *.mdx.
    • An extension must be provided for loaders, this ensures that arbitrary file extensions are not loaded by mistake.
    • Standard Schema is now used to automatically infer types from libraries that adhere to the spec (Zod, Valibot, Arktype).
    • The MDXContent type is now included by default for MDX file default exports.
    • Internally, the JavaScriptFileWithRuntime class was collapsed into JavaScriptFile. This was originally added to provide strong types when a runtime loader was or was not available, but caused too much complexity. In the future, a runtime loader will be added automatically if not explicitly defined.

    Breaking Changes

    The builder pattern configuration for Directory has been refactored to use an object configuration with the addition of a new withSchema helper. This change is breaking for any existing code that uses the Directory builder pattern. The withSchema helper is now required to provide strong type inference and colocated file export type definitions.

    Before

    import { Directory } from 'renoun/file-system'
    
    interface PostTypes {
      mdx: {
        default: MDXContent
      }
    }
    
    const posts = new Directory<PostTypes>('posts').withModule(
      (path) => import(`./posts/${path}`)
    )

    After

    import { Directory } from 'renoun/file-system'
    
    const posts = new Directory<PostTypes>({
      path: 'posts',
      loaders: {
        mdx: (path) => import(`./posts/${path}.mdx`),
      },
    })
  • 80ae7f2: Marks the Directory#duplicate method as private since this was previously only exposed for EntryGroup which no longer requires a new instance to be created.

  • 1f6603d: Removes getEditPath in favor of getEditUrl and getEditorUri for a more explicit API. Prior, the getEditPath method switched between the editor and the git provider source based on the environment. This was confusing and not always the desired behavior. Now you can explicitly choose the behavior you want.

    Breaking Changes

    The getEditPath method has been removed. Use getEditUrl and getEditorUri instead.

    To get the same behavior as getEditPath you can use both getEditUrl and getEditorUri together:

    import { Directory } from 'renoun/file-system'
    
    const directory = new Directory('src/components')
    const file = directory.getFileOrThrow('Button', 'tsx')
    const editUrl =
      process.env.NODE_ENV === 'development'
        ? file.getEditorUri()
        : file.getEditUrl()
  • 97bc268: Renames @renoun/mdx Headings type to MDXHeadings. This adds better clarity and consistency with the other MDX prefixed types.

    Breaking Changes

    • Rename any Headings references from @renoun/mdx to MDXHeadings.

Patch Changes

  • 5d8bd25: Fixes nested ordered files not using a unique key causing them to be filtered.

  • dc323ab: Closes WebSocket connections with a code allowing the Node process to properly exit. More info here.

  • 679da2c: Fixes Directory#getFile not considering file name modifiers.

    const directory = new Directory({ path: 'components' })
    const file = await directory.getFileOrThrow(['APIReference', 'examples'])
    
    file.getAbsolutePath() // '/APIReference.examples.tsx'
  • 5b558c1: Fixes Directory#getFile not prioritizing base files over files with modifiers e.g. Button.tsx over Button.examples.tsx.

  • Updated dependencies [ece3cc2]

  • Updated dependencies [97bc268]

  • Updated dependencies [df4d29d]

Copy link

vercel bot commented Dec 8, 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 Dec 30, 2024 10:19pm

@github-actions github-actions bot force-pushed the changeset-release/main branch from 5b6ddfe to cda8a63 Compare December 9, 2024 05:26
@github-actions github-actions bot force-pushed the changeset-release/main branch from cda8a63 to 5c247d9 Compare December 9, 2024 05:30
@github-actions github-actions bot force-pushed the changeset-release/main branch from 5c247d9 to 437d269 Compare December 9, 2024 08:29
@github-actions github-actions bot force-pushed the changeset-release/main branch from 437d269 to f8723b0 Compare December 9, 2024 08:35
@github-actions github-actions bot force-pushed the changeset-release/main branch from f8723b0 to d27aef9 Compare December 9, 2024 22:58
@github-actions github-actions bot force-pushed the changeset-release/main branch from d27aef9 to 83c012e Compare December 10, 2024 07:39
@github-actions github-actions bot force-pushed the changeset-release/main branch from 83c012e to 5310840 Compare December 10, 2024 09:01
@github-actions github-actions bot force-pushed the changeset-release/main branch from 5310840 to c0922bb Compare December 10, 2024 20:04
@github-actions github-actions bot force-pushed the changeset-release/main branch from c0922bb to 3453a5b Compare December 10, 2024 20:29
@github-actions github-actions bot force-pushed the changeset-release/main branch from 3453a5b to 7ea0ec9 Compare December 10, 2024 21:03
@github-actions github-actions bot force-pushed the changeset-release/main branch from 7ea0ec9 to cca9cda Compare December 10, 2024 21:48
@github-actions github-actions bot force-pushed the changeset-release/main branch from cca9cda to 351d03e Compare December 30, 2024 20:39
@github-actions github-actions bot force-pushed the changeset-release/main branch from 351d03e to e4d78ed Compare December 30, 2024 20:44
@github-actions github-actions bot force-pushed the changeset-release/main branch from e4d78ed to 1198676 Compare December 30, 2024 20:51
@github-actions github-actions bot force-pushed the changeset-release/main branch from 56134eb to 75900ca Compare December 30, 2024 22:15
@souporserious souporserious merged commit 3eff7f9 into main Dec 30, 2024
2 checks passed
@souporserious souporserious deleted the changeset-release/main branch December 30, 2024 22:21
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.

1 participant