Skip to content

Commit

Permalink
Version Packages (#110)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] and github-actions[bot] committed May 8, 2024
1 parent 7444586 commit 20d2cde
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 45 deletions.
34 changes: 0 additions & 34 deletions .changeset/blue-phones-tan.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/loud-years-lay.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/tough-goats-hang.md

This file was deleted.

41 changes: 41 additions & 0 deletions packages/mdxts/CHANGELOG.md
@@ -1,5 +1,46 @@
# mdxts

## 0.17.0

### Minor Changes

- e493fbd: Refines `paths` returned from `createSource` and `mergeSources`. Based on the glob pattern provided, either a one-dimensional or two-dimensional array of paths will be returned:

```ts
import { createSource, mergeSources } from "mdxts";

const allPosts = createSource("posts/*.mdx").paths(); // string[]
const allDocs = createSource("docs/**/*.mdx").paths(); // string[][]
const allPaths = mergeSources(allDocs, allPosts).paths(); // string[] | string[][]
```

Likewise the `get` method will be narrowed to only accept a single pathname or an array of pathname segments:

```ts
allPosts.get("building-a-button-component-in-react");
allDocs.get(["examples", "authoring"]);
```

### Breaking Changes

- The `paths` method now returns a one-dimensional array of paths for a single glob pattern and a two-dimensional array of paths for multiple glob patterns.
- The `get` method now only accepts a single pathname or an array of pathname segments.

You may need to update your code to accommodate these changes:

```diff
export function generateStaticParams() {
-- return allPosts.paths().map((pathname) => ({ slug: pathname.at(-1) }))
++ return allPosts.paths().map((pathname) => ({ slug: pathname }))
}
```

- 7444586: Now `createSource.get` attempts to prepend the incoming pathname with `basePathname` if defined and no data was found.

### Patch Changes

- 6d338a6: Handles null values and throws an error for undefined values when formatting front matter for type checking.

## 0.16.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/mdxts/package.json
@@ -1,6 +1,6 @@
{
"name": "mdxts",
"version": "0.16.0",
"version": "0.17.0",
"description": "The Content & Documentation SDK for React",
"author": "Travis Arnold",
"license": "MIT",
Expand Down

0 comments on commit 20d2cde

Please sign in to comment.