Releases: souporserious/renoun
[email protected]
Patch Changes
- 85f528d: Fixes constraint type error when using an interface with
FileSystemSource
orcreateCollection
.
[email protected]
Minor Changes
-
252f4c4: This adds an
mdxts
cli command to allow running the project analysis in a separate process to improve overall performance during local development.CLI
This can be prepended to your framework's development process e.g.
next dev
. For example, to start themdxts
process prior to starting the Next.js server simply prepend themdxts
command:{ "scripts": { "dev": "mdxts next", "build": "mdxts next build" } }
This ensures the server starts and allows decoupling the code block analysis and syntax highlighting from Next.js.
Alternatively, the process can be managed yourself using a library like concurrently:
{ "scripts": { "dev": "concurrently \"mdxts watch\" \"next\"", "build": "mdxts && next build" } }
Collections
This also introduces a new
createCollection
utility:import { createCollection, type MDXContent, type FileSystemSource, } from 'mdxts/collections' export type PostSchema = { default: MDXContent frontmatter?: { title: string description: string } } export type PostSource = FileSystemSource<PostSchema> export const PostsCollection = createCollection<PostSchema>( '@/posts/**/*.{ts,mdx}', { title: 'Posts', baseDirectory: 'posts', basePath: 'posts', } )
Collections will soon replace the
createSource
utility and provide a more performant and flexible way to query file system information and render module exports. They focus primarily on querying source files and providing a way to analyze and render file exports. -
64eeaf0: Updates license from MIT to AGPL-3.0. This ensures that modifications and improvements to the code remain open source and accessible to the community.
Patch Changes
-
22a4617: Improves error messages for
CodeBlock
type errors to show exactly where each diagnostic occurs. -
6095e9d: Loads proper lib declarations for in memory file system when type checking front matter.
-
abaa320: Fix pathname generation in case the
baseDirectory
exists multiple times in thefilePath
.Previously having a file path like
content/content_1/path/file.mdx
and usingcontent
as base directory results in an invalid pathname likecontent-1path/file
.Now we get the correct path name like
/content-1/path/file
.
[email protected]
Minor Changes
- 64eeaf0: Updates license from MIT to AGPL-3.0. This ensures that modifications and improvements to the code remain open source and accessible to the community.
[email protected]
Minor Changes
- 35b05bd: Adds
css
prop forCodeInline
to allow merging css styles. - 9457424: Adds
CopyButton
to be used with customCodeBlock
components. - 801b9c3: Moves
GitProviderLink
to use css throughrestyle
instead of inline styles.
Patch Changes
- 511d768: Normalizes
CopyButton
foreground and background colors. - 2198401: Updates restyle to
1.4.0
. - bc2ef5e: Doesn't override user-defined pre margin in
CodeBlock
. - 1236bcc: Fixes keyboard accessibility for
CodeBlock
inline copy button. - 6a05a2a: Uses activity bar foreground color from theme to color source link and copy button icons in
CodeBlock
component. - 16e6f26: Adds better contrast for
CodeBlock
inline copy button by adding a stroke based ontheme.panel.border
.
[email protected]
Minor Changes
- 5e3a2b8: Adds a
gitProvider
option to themdxts/next
plugin. - 96a02e4: Removes the
fixImports
prop fromCodeBlock
. This prop fixed imports specifically for situtations like examples that are located in a different project and used relative imports. However, examples should use the library import path instead of relative paths by configuring themodule
field intsconfig.json
. More info here.
Patch Changes
[email protected]
Minor Changes
-
d36ef90: Adds a
loadHighlighterLanguage
utility for adding custom languages toCodeBlock
andCodeInline
. -
02b3f80: Adds
RenderedHTML
component for renderingchildren
as a highlighted HTML string in aCodeBlock
:import { CodeBlock, RenderedHTML } from 'mdxts' export function Basic() { return ( <div style={{ display: 'grid', gap: '2rem' }}> <div style={{ display: 'grid', gap: '1rem' }}> <h2>Input</h2> <CodeBlock language="jsx" value="<h1 style={{ fontSize: '6rem' }}>Hello World</h1>" /> </div> <div style={{ display: 'grid', gap: '1rem' }}> <h2>Output</h2> <RenderedHTML includeHtml={false}> <h1 style={{ fontSize: '6rem' }}>Hello World</h1> </RenderedHTML> </div> </div> ) }
[email protected]
Minor Changes
Patch Changes
[email protected]
Minor Changes
- e38535a: Uses
posix.sep
and normalizescreateSource
glob patterns. - 301629b: Fixes scrollbars for
CodeInline
components that overflow while also moving inline styles to use restyle. - ac9118e: Adds
allowCopy
prop toCodeInline
for rendering a persistent copy button. - 3cc2642: Moves
@types
packages from dependencies to dev dependencies to reduce npm install size. These should be included in the projectmdxts
is used in now e.g.npm install @types/react
.
Patch Changes
[email protected]
Patch Changes
- b35373c: Fixes error when trying to find previous version cache that doesn't exist yet.
[email protected]
Major Changes
- 05d31e7: MDXTS v1 is released! 🎉 Check out the announcement post for more details.