Skip to content

Commit

Permalink
Version Packages
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Dec 30, 2024
1 parent c15611a commit 1198676
Show file tree
Hide file tree
Showing 13 changed files with 141 additions and 158 deletions.
10 changes: 0 additions & 10 deletions .changeset/chatty-fireants-repeat.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/cuddly-news-kneel.md

This file was deleted.

21 changes: 0 additions & 21 deletions .changeset/dirty-poems-kneel.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/fair-goats-thank.md

This file was deleted.

71 changes: 0 additions & 71 deletions .changeset/hungry-birds-attack.md

This file was deleted.

12 changes: 0 additions & 12 deletions .changeset/hungry-taxis-learn.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/long-walls-kneel.md

This file was deleted.

22 changes: 0 additions & 22 deletions .changeset/loud-pans-sit.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/twenty-ears-report.md

This file was deleted.

6 changes: 6 additions & 0 deletions packages/mdx/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @renoun/mdx

## 1.2.2

### Patch Changes

- ece3cc2: Fixes inline code language inference by considering language aliases.

## 1.2.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/mdx/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@renoun/mdx",
"version": "1.2.1",
"version": "1.2.2",
"description": "MDX plugins for renoun",
"author": "Travis Arnold",
"license": "MIT",
Expand Down
133 changes: 133 additions & 0 deletions packages/renoun/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,138 @@
# renoun

## 7.9.0

### 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](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemEntry/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.

```ts
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'
```

- 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:

```ts
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](https://github.com/standard-schema/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

```ts
import { Directory } from 'renoun/file-system'

interface PostTypes {
mdx: {
default: MDXContent
}
}

const posts = new Directory<PostTypes>('posts').withModule(
(path) => import(`./posts/${path}`)
)
```

#### After

```ts
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 `getRepositoryUrl` 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 `getRepositoryUrl` and `getEditorUri` instead.

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

```ts
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.getRepositoryUrl({ type: 'edit' })
```

### Patch Changes

- 5d8bd25: Fixes nested ordered files not using a unique key causing them to be filtered.
- 679da2c: Fixes `Directory#getFile` not considering file name modifiers.

```ts
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]
- @renoun/mdx@1.2.2

## 7.8.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/renoun/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "renoun",
"version": "7.8.0",
"version": "7.9.0",
"description": "The Technical Content Toolkit for React",
"author": "Travis Arnold",
"license": "AGPL-3.0-or-later",
Expand Down

0 comments on commit 1198676

Please sign in to comment.