renoun
10.10.0
Minor Changes
-
15c9613: Filters
@internalexports and entries based onstripInternalin the related TypeScript configuration. -
100ce06: Add git metadata support to
GitHostFileSystemand teach the file system helpers to use commit information provided by remote hosts. -
647fdcc: Improves the
Referencecomponent’s type expression renderers to surface resolved metadata for tuples, unions, type literals, and references while presenting constructor signatures in a concise format. -
2b86fa3: Adds a
shouldValidateprop to theCommandcomponent that validates the npm packages exist.
Patch Changes
-
aeab8b6: Relaxes
withSchemaruntime-only overloads to allowunknownloader return types. This better enables loaders sourced from patterns likeimport.meta.globto type-check, while still encouraging typed loaders when available. -
770fe7b: Fixes
Collection#getEntries({ recursive: true })when using a shallow glob. TheCollectionutility now proactively checks each childDirectory’s filter kind viagetFilterPatternKind()and disables recursion for directories with single‑level filter patterns. - cc11165: Fixes export positions to the declaration name instead of modifiers/comments.
-
3311481: Fixes
Tokenscomponent regression causing valid source code errors to not throw. - 15bda5c: Handles missing files in the project watcher without leaving refresh tracking stuck.
-
6f35451: Prevents the
TableOfContentsfrom forcing the page to scroll when the scroll container is the document body. -
507cb31: Fixes the
CodeBlockcomponent not passing downallowErrorsandshowErrorsprops to theTokenscomponent. -
7a6a014: Improves file system
DirectoryandJavaScriptFileperformance by speeding up simple lookups and headings analysis. - d7150e1: Fixes import with type json error when using multiple themes by moving to require.
- 4353095: Improve parameter resolution when falling back to TypeScript metadata after preferring JSDoc tags.
-
97ed262: Stabilizes
workspace:scheme resolution.Directorynow stores absolute workspace‑anchored paths when resolvingworkspace:to avoid cwd coupling. -
8ccea91: Improves
Directory#getEntries({ recursive: true })error when attempting to use therecursiveoption when a shallow file pattern filter is configured. - Updated dependencies [b2a14cb]
-
Updated dependencies [f1dfed0]
- @renoun/mdx@3.4.1
10.9.1
Patch Changes
-
ac3ece9: Implements actual streaming for
readFileStreamandwriteFileStreammethods inMemoryFileSystem. -
47a533a: Fixes the
CodeBlockcomponent’s Suspense fallback missing bottom padding. -
5f17344: Improves contextual parameter type resolution in
JavaScriptModuleExport#getTypewhen declarations are unavailable by inferring metadata from symbol flags. -
63804b6: The
Imagecomponent now throws clear errors for unknown or misconfigured custom source schemes. -
04d1ba0: Improves JSDoc support in
JavaScriptModuleExport#getType. -
455c9b6: Fixes
RootProviderconfig not being applied in dynamic applications. NowglobalThisis exclusively used instead ofReact.cache. -
24cbe39: Refactors the tokenizer used in the
Tokenscomponent to process multiple themes concurrently to improve performance. -
43870ad: Refactors the
Tokenscomponent to run TypeScript analysis and syntax highlighting concurrently. -
0fa840a: Fixes
MemoryFileSystemandGitHostFileSystemso the file system methods work cross-platform. -
f0ac1c5: Adds
Suspenseboundary around theNavigationcomponent to improve performance during local development. -
Updated dependencies [afcfb23]
- @renoun/mdx@3.4.0
10.9.0
Minor Changes
-
c703686:
RootProvidernow automatically derivessiteUrlfrom the nearestpackage.jsonhomepagewhen thesiteUrlprop is not provided. -
7be68d7: Adds support for loader factories and globbed modules when defining a
Directoryloader:import { , } from 'renoun' interface { : { : string : } } const = new ({ : 'posts', : () => { const = import..('./posts/**/*.mdx') return { : <>(() => [`./posts/${}.mdx`]), } }, }) -
387a689: Improves
Referencecomponent type renderer coverage and will now render complex type aliases with call signatures and type parameters. -
543774c: Adds a
validateCLI command and exposes MDX link utilities for validating links in MDX content as well as links for a live site. -
46497f6: Improves workspace root detection and error diagnostics in the internal
getRootDirectoryutility.
Patch Changes
-
60446c7: Adds support for binary, streaming, writing, and deletion operations for both
NodeFileSystemandMemoryFileSystemutilities. -
c82b042: Fixes file resolution when a directory shares the same base name as the
requested file and an extension is specified. The resolver now prefers the
exact file match (e.g.
package.json) over a same‑named directory (e.g.package/). - 696f1a0: Ensures custom JSON theme edits invalidate the cache so local development picks up changes immediately.
-
b929b97: Adds more actionable
FileNotFoundErrordetails. -
f9c90fe: Add a
renoun themeCLI command that prunes theme JSON files in place so users can trim or minify their own themes. -
Updated dependencies [543774c]
- @renoun/mdx@3.3.0
10.8.0
Minor Changes
-
910fdd6: Adds configurable
sourcesprop toRootProviderin place of thefigmaoption:-
RootProvider: The newsourcesprop allows defining custom sources, e.g.sources={{ icons: { type: 'figma', fileId }, illustration: { type: 'figma', fileId, basePathname: 'illustration' } }}. -
Image: Can use these sources, e.g.icons:arrow-uporillustration:marketing. Names are resolved by components first, then frames/groups. IfbasePathnameis provided, it also matches names likeillustration/<path>.
-
-
d2c1a02: Adds the ability for
Tokensto load file contents itself when used insideCodeBlock:<CodeBlock path="./counter/Counter.tsx" baseDirectory={import.meta.url}> <pre> <Tokens /> </pre> </CodeBlock>
Patch Changes
-
6954981: Throws a helpful error when
shouldFormatis explicitly enabled but no formatter is installed. -
2fd4509: Fixes
CodeBlockscrollbar corner styling so the bottom-right intersection of vertical and horizontal scrollbars never shows a white gap. -
6169864: Adds support for loading files into
CodeBlockwhen only apathis provided. -
d15023c: Adds a
reordercommand to the CLI that reorders numbered entries while preserving the last modified duplicate. -
7daa21d: Fixes the
Imagecomponent not respecting theformatprop when exporting from Figma. -
e36b3ad: Scopes Figma SVG ids during conversion in
Imagecomponent and rewritesurl(#...)/#idreferences to prevent ID collisions. This fixes cases where clipping, masks, filters, or gradients from Figma exports spilled outside their containers when multiple SVGs shared the same ids. -
eb1f5bb: Uses stable scrollbar gutters for
CodeBlockandCodeInline. This fixes situations where large scrollbars would appear when padding is large.
10.7.0
Minor Changes
-
bde10dd: Introduces a new
<Image>component that is able to fetch component frames, names, and descriptions directly from configured Figma files:import { Image } from 'renoun' export function Page() { return <Image source="figma:icons/arrow-down" /> } -
719baaf: Adds
labelandtitleprops toReference’sSectionHeadingcomponent slot.
Patch Changes
-
d8b72e2: Default
allowErrorstotruewhenshowErrorsis enabled inCodeBlockandTokens, so consumers only need to setshowErrorsin most cases. -
9f71b70: Fixes a bug where the provided
Tokenscode could concatenate a template literal and a followingimportwithout a separating newline, causing the formatter to throw. -
726c072: Ensures
Tokensquick info popovers attach scroll listeners to all scroll ancestors to ensure they always close on scroll. -
2e9fee1: Renders diagnostics on subsequent lines in
Tokensand keeps symbol quick info tooltips focused on type information. -
50fd3cb: Improves conditional type rendering in the
Referencecomponent::- Builds decision-tree branches and computes a properties table.
-
Prefer alias names in guards (e.g.
Variant extends LinkVariant). -
Adds support for top-level
ConditionalTypein type aliases.
-
c4a2b12: Fixes theme normalization regression when using a custom theme. If a theme does not declare a
type, light/dark is inferred from the background color.
10.6.0
Minor Changes
-
5be3fbe: Adds Cursor to the supported editor URI schemes and allows configuring the editor through
RootProvider.
10.5.4
Patch Changes
-
8feaf50: Fixes
ts-morpherroring in Vite builds by loading the package dynamically to resolve the CommonJS module at runtime.
10.5.3
Patch Changes
- 5525a52: Fixes the default theme not getting included in the published build.
-
5af6878: Fixes the
CodeBlockcomponent’sSuspensefallback layout shift. -
Updated dependencies [e23c119]
- @renoun/mdx@3.2.1
10.5.2
Patch Changes
-
4927f10: Improves
JavaScriptModuleExport#getTypeby using the compiler type id to cache free type parameter checks. - b98dded: Skips formatting when a requested code block language is unsupported.
-
0ac9a44: Queues
QuickInfopopover rendering behindSuspensewith a fallback to prevent overwhelming symbol analysis.
10.5.1
Patch Changes
-
b3899fe: Fixes
CodeBlockannotationsprop cutting off source text in some cases. - c606c62: Minifies default grammars by stripping whitespace and newlines.
-
413c915: Allows the
RootProvidercomponent to be optional by loading a default theme. - 12eb5e3: Adds LRU cache for quick info to prevent unbounded growth.
-
c338705: Improves annotation candidate detection and parsing heuristics to avoid unnecessary work in the
CodeBlockcomponent when using theannotationsprop. -
6780b25: Fixes
RootProviderconfiguration erroring when not provided.
10.5.0
Minor Changes
-
912bab3: Adds tarball support to
GitHostFileSystem. This streamlines fetching an entire repository instead of requesting every individual file and directory. This also addsincludeandexcludeoptions to allow fetching a subset of entries using raw URLs. -
a734171: Adds protocol-aware path resolution to the file system
DirectoryandFileutilities starting with aworkspace:protocol. This will change the working directory to start from the root workspace directory:import { Directory } from 'renoun' const examples = new Directory({ path: 'workspace:examples' }) -
019ebce: Adds binary asset storage and base64 read support in
MemoryFileSystem. -
05cd0c3: Adds an
annotationsprop to theCodeBlockandTokenscomponents to render inline, inline comment-based annotations. Highlights and ranges are authored directly in the source using inline comments and mapped back after formatting:<CodeBlock language="ts" annotations={{ mark: ({ children, color }) => ( <mark style={{ backgroundColor: color }}>{children}</mark> ), }} > {`const count = /*mark color='yellow'*/0/**mark*/`} </CodeBlock>-
Paired markers wrap a range:
/*tag ...*/ … /*tag*/. -
Self‑closing markers wrap the next token only:
/*tag ...**/identifier.
-
Paired markers wrap a range:
Patch Changes
- 9932576: Improves git file URL handling by checking fragments are formatted correctly and pointing to the specific documentation when git source is not configured.
-
fbb54ff: Fixes default
Sectioncomponentidnot being applied in theReferencecomponent. -
0fd7151: Adds a
getHeadingsmethod to theJavaScriptFileutility that returns the exports formatted as headings for theTableOfContentscomponent. -
c58d20a: Fixes
getFileExportsTextto preserve inline annotation comments when including dependencies. Previously, we stripped all JSDoc blocks with a global regex which inadvertently removed valid inline comments. -
f022e39: Switches gitignore handling to the
fast-ignorepackage for improved speed.
10.4.0
Minor Changes
-
4a282e9: Adds
JSONFileutility to parse and access JSON data files.
Patch Changes
-
dd36fd4: Improves
Tokenscomponent by applying necessary theme styles through theRootProvidercomponent. This avoids the immediate container having to specify anything and decouples the responsibility. -
f3f6c92: Fixes the
TableOfContentscomponent clearing the active entry state when the same entry is activated again. - 0fd2e28: Fixes system theme preference toggling.
10.3.0
Minor Changes
-
5b7593a: Strictly requires Node.js 22 now since utilities rely on a
WebSocketclient. This was erroring in version 20 already since theWebSocketclient was still behind a flag. -
6d08669: Removes
gitHostvariant fromLinkcomponent since it doesn’t add value and was easy to confuse with therepositoryvariant. -
19ecf70: Makes the
Linkcomponentvariantprop optional and defaults it tosource. -
1760984: Replaces the
wspackage with a focused WebSocket implementation for the renoun RPC server.
Patch Changes
-
0bca712: Fixes
TableOfContentsscroll section into view. -
a22f83f: Runs dispose function to disconnect observer between registering links in the
TableOfContentscomponent. -
4d14c25: Fixes duplicate descriptions in
Referencecomponent when a function declaration has multiple overloads.
10.2.0
Minor Changes
-
b1da640: Improves module export analysis support for default exports (e.g.
export default () => {}). -
063d163: The
Referencecomponent now passes akindprop to itsSectionandDetailsubcomponents for better context-aware rendering. -
696f837: Removes
useSectionObserverhook in favor of theTableOfContentscomponent which ensures there is no flicker on load. -
0d8a28c: Adds a
Scriptcomponent that lets you author a client-side script using a normal source file that is then injected into HTML either inline, deferred, or as a hoisted data URL. This is useful for small scripts like analytics snippets, theme preferences, feature flags, or bootstrapping navigation active states.app/page.tsximport { Script } from 'renoun' export default function RootLayout({ children, }: { children: React.ReactNode }) { return ( <html> <head> <Script>{import('./table-of-contents-script.ts')}</Script> </head> <body>{children}</body> </html> ) } -
5bb3459: Adds a
MarkdownFileutility with a default markdown loader plus matchinggetContentandgetHeadingsmethods. -
cfcaaed: Renames
MDXHeadingstype toHeadingsto better reflect that it’s not exclusively tied to MDX. -
c5e14c1: Adds
getContentandgetHeadingsmethods to theMDXFileutility. -
f822446: Consolidates Markdown/MDX utilities and dependencies into
@renoun/mdxand updatesrenounto use them.
Patch Changes
-
a994bfc: Fixes flickering in the
TableOfContentscomponent on page load. - 69aebaa: Adds debug information for the current project context.
-
ebfcca2: Improves the
Referencecomponent by exposing constructors, member modifiers, and call signature metadata. - Updated dependencies [5ff7c78]
- Updated dependencies [cfcaaed]
-
Updated dependencies [f822446]
- @renoun/mdx@3.2.0
10.1.2
Patch Changes
-
5aa706e: Prevents
undefinedinReferencecomponent section heading aria label. -
642ef14: Uses the type alias type text instead of repeating the type alias name in
Reference. -
d94a2f8: Fixes default state and keyboard focus for
Commandcomponent. -
973ac4e: Fixes default
Navigationhtml elements. -
4f4fb40: Fixes
depthcalculation forNavigationcomponent. -
694fe5c: Fixes stale configuration in
RootProviderwhen value is async.
10.1.1
Patch Changes
-
07e22de: Fixes resolving JSDoc callback signature types in
JavaScriptModuleExport#getType. -
592618d: Improves missing git configuration error handling in
Linkcomponent.
10.1.0
Minor Changes
-
996e729: Adds a
TableOfContentscomponent to render a list of headings for a document. This can be used with the headings MDX plugin to generate a table of contents for a page.import { TableOfContents } from 'renoun' import Content, { headings } from './content.mdx' export default function Page() { return ( <main style={{ display: 'grid', gridTemplateColumns: '1fr 16rem', gap: '2rem', }} > <article> <Content /> </article> <aside> <TableOfContents items={headings} /> </aside> </main> ) } -
6433c37: Renames
PackageInstallcomponent toCommandand switches to usingchildrenprop for providing package commands instead of apackagesprop. This also addsdefaultPackageManagerandincludeInstallScriptconfiguration props toRootProvider.
This also introduces new variants:- <PackageInstall>renoun</PackageInstall> + <Command variant="install">renoun</Command>-
install- for install commands -
install-dev- for install dev commands -
run- for run commands -
exec- for exec commands -
create- for create commands
Breaking Changes
RenamePackageInstallcall sites toCommandwithvariant="install"and remove thepackagesprop and pass aschildrendirectly. -
-
2f63e80: Adds a
Navigationcomponent that takes asourcewhich can be aFileSystemEntryor aCollectionand renders the entries recursively.import { Navigation } from 'renoun' export default function Sidebar({ source, }: { source: FileSystemEntry | Collection }) { return ( <aside> <Navigation source={source} /> </aside> ) } -
dfd56e2: Adds the ability to override the value type for the
JavaScriptFile#getExportValuemethod. This is helpful for building strongly typed utilities.const metadata = await entry.getExportValue<{ title: string date: Date }>('metadata') metadata.title // string metadata.date // Date -
cdda586: Replaces
html-url-attributespackage with hardcoded version.
Patch Changes
- a59ae29: Fixes project watcher erroring after rename.
-
557177d: Fixes
No return type founderror inJavaScriptModuleExport#getTypewhen resolving empty object literal return types.
10.0.0
Major Changes
-
2a93fde: Removes
GitProviderLinkin favor of<Link variant="repository">. This also removesGitProviderLogoin favor of a newLogocomponent. Now<Logo variant="gitHost">can be used for rendering git host logos. -
a66d8eb: Renames
gitProviderconfiguration and component variants togitHost. This also renamesGitProviderFileSystemtoGitHostFileSystem.
Minor Changes
-
b6a5da2: Adds a
Referencecomponent renderer for aTypeAliasthat hasIntersectionType. -
6885c72: Adds a new
Linkcomponent that helps generate links for directories, files, module exports, and the configured git provider inRootProvider.import { JavaScriptFile, Link } from 'renoun' const file = new JavaScriptFile({ path: 'components/Button.tsx', }) function App() { return ( <Link source={file} variant="source"> View Source </Link> ) } -
11f9692: Renames
Directory.includeoption toDirectory.filter.Breaking Changes
Rename allDirectory.includecall sites to useDirectory.filter. -
92f0416: Improves
Repositoryconfiguration typing, URL generation, and error handling.RepositoryConfignow supportsowner,repository,branch, andpathfields explicitly. - 45126b4: Adds support for fast refresh updates in Waku.
-
138507e: Replaces the
renoun.jsonconfiguration file with aRootProvidercomponent. This also removes the need to configure theRefreshandThemeStylescomponents.Breaking Changes
Therenoun.jsonconfiguration file is no longer used to configure renoun. Please refactor to theRootProvidercomponent:import { RootProvider } from 'renoun' export default function RootLayout({ children, }: { children: React.ReactNode }) { return ( <RootProvider git="souporserious/renoun" siteUrl="https://renoun.dev" theme="theme.json" > <html> <body>{children}</body> </html> </RootProvider> ) }
Patch Changes
-
ab76c5e: Fixes
Directory#getFilefrom filtering out entries when querying a specific entry. -
9be5e29: Fixes resolving conditional extends branches to keep imported types as references in
JavaScriptModuleExport#getType. -
5471648: - Prefers base files over modifier files when selecting a directory representative (e.g.
Link.tsxoverLink.examples.tsx).-
Normalizes
MemoryFileSystem.getRelativePathToWorkspaceto strip leading./so repository URLs do not contain/./.
-
Normalizes
-
a4ce50a: Makes sure to consider searching subdirectory entries with matching file extensions in
Directory#getFile. -
989c7e7: Fixes substituted types not resolving in
JavaScriptModuleExport#getTypeand causing an error. -
2a895c2: The
Directory#getEntrymethod now prefers a directory representative file (index/readme/same-name), otherwise it returns the directory. If no directory exists at the path, it returns a matching file in the immediate entries.// components/Button/Button.tsx await new Directory({ path: 'components' }).getEntry('button') // JavaScriptFile -
01dc8e4: Improves performance for
Directory#getEntrieswhen using a simpleincludefilter. -
ca01d64: Fixes recursive
Directory#getEntriestraversal not respecting theincludefilter when descending. Previously, child entries from excluded directories could leak into results, causing invalid slugs to be generated.
9.5.1
Patch Changes
- e151303: Fixes vite being unable to load textmate grammars and themes.
- 98482a0: Fixes error when locating the vite bin file when using the renoun cli.
-
Updated dependencies [e664e81]
- @renoun/mdx@3.1.1
9.5.0
Minor Changes
-
f059b18: Switches the
renounCLI to spawn framework CLIs from Node directly, removing command-injection risk. This also addsvitesupport sorenoun vite <args>works now. -
3fea115: Moves
JavaScriptFile#getExportValueandMDXFile#getExportValueto utilize the export’sgetValuemethod so static analysis will be preferred. -
061548a: Adds a
Sponsorscomponent for rendering GitHub sponsors related to a specific user account. -
75f4edc: Renames
JavaScriptFileExporttoJavaScriptModuleExport,MDXFileExporttoMDXModuleExport, andFileExportNotFoundErrortoModuleExportNotFoundErrorfor improved clarity and to better reflect the functionality of the utilities.Breaking Changes
Rename all call sites forJavaScriptFileExport,MDXFileExport, andFileExportNotFoundErrorto useModuleinstead ofFile. -
6e257de: Adds root exports for the
renounpackage e.g.import { CodeBlock } from 'renoun'. - 2187b3b: Adds a default theme based on renoun’s theme.
-
8de2d2a: Allows initializing the
Repositoryclass using a shorthand git specifier e.g.new Repository('souporserious/renoun').
Patch Changes
-
d760dde: Fixes
JavaScriptModuleExport#getTypecausing maximum call stack exceeded errors when resolving recursive array types (e.g.type A = A[]). - dd141f9: Fixes renoun CLI not forwarding error messages.
-
79a208c: Improves
getLocalGitFileMetadatasecurity by preventing injection from the providedfilePathby switching toexecFileand passing explicit arguments when parsing git history.
9.4.1
Patch Changes
-
403e979: Fixes infinite recursion in
JavaScriptFileExport#getTypewhen resolving a union type that references itself. -
b688b1e: Fixes missing
moduleSpecifiermetadata inJavaScriptFileExport#getTypewhen resolving a union type reference without a concreteTypeReferenceNode. -
a2f2f78: Improves performance for simple glob patterns (e.g.
*.<extension>and**/*.<extension>) by building a predicate filter instead of using Minimatch.
9.4.0
Minor Changes
- fe6a1e0: Adds caching in production builds when resolving file export values.
-
124afd1: Adds
MDXFileExport#getStaticValuemethod that will attempt to get a statically analyzable literal value for an MDX file export. -
3b3e865: Adds
JavaScriptFileExport#getValueandMDXFileExport#getValuemethods that will attempt to get a statically analyzed literal value and fall back to a runtime value if a loader is defined. - c960bea: When sorting file system entries by an export value the built-in sort function will attempt to use the static value first before trying to resolve the runtime value.
-
9b8345e: Adds
JavaScriptFileExport#getStaticValuemethod that will attempt to get a statically analyzable literal value for a file export.
Patch Changes
- f3b6551: Improves renoun CLI WebSocket client resilience to transient disconnects and CI flakiness.
- a9f8bfc: Fixes default export not being indexed correctly during static analysis.
-
19ac8e1: Improves
Directory#getEntriesperformance by parallelizing recursive entries. -
b72f6e6: Fixes source files not being created correctly for
MemoryFileSystem.
9.3.0
Minor Changes
-
9f96184: Adds streaming to
renounCLI WebSocket server. -
9a84d3b: Adds backpressure handling to
renounCLI WebSocket server.
Patch Changes
- a05f7b7: Throws a more helpful error now when trying to target a path outside of the root workspace.
-
f2b1ad6: Fixes the
CodeBlockandCodeInlinecomponent’s internalSuspensefallback triggering in production. This is used to speed up local development so it should never show in production. -
Updated dependencies [ea9cccc]
- @renoun/mdx@3.1.0
9.2.0
Minor Changes
-
35306d2: Adds debug system through a
RENOUN_DEBUGflag for troubleshooting timeout and performance issues. This includes WebSocket client/server logging for therenouncli, type resolution tracking, cache monitoring, and configurable output formatting throughrenoun.json. -
30c5266: Adds a
GitProviderFileSystemutility that extendsMemoryFileSystemby fetching a git provider repository using the respective provider’s API to allow enumeration of the repository’s contents. -
446173f: Adds an LRU cache implementation to the
renouncli WebSocket server to de-duplicate incoming client requests. This is especially useful during builds that are parallelized and can cause many duplicate client requests.
Patch Changes
- b2c741e: Fixes Windows file paths by normalizing all incoming file paths.
-
e73993b: Improves the
renounWebSocket server and client error handling with better error classification and detailed diagnostics information.
9.1.0
Minor Changes
-
e36c18f: Only a subset of language grammars for
tsx,mdx,css,html,shell, andjsonare now included by default. The default themes have also been removed. This greatly reduces the overall install size and focuses on renoun’s core offering. Additional languages and themes are still supported and now require installing thetm-grammarsortm-themespackages separately. For languages with similar grammars, likejsortsfiles, these will be mapped to thetsxgrammar, andmdmapped to themdxgrammar. While these grammars are not exactly the same, it aims to balance install size and good defaults.Breaking Changes
If you have configured a language besidests(x),md(x),css,html,shell, orjson, you will need to install thetm-grammarspackage. Additionally, if you are using a non-local theme, you will need to install thetm-themespackage. -
95f43dc: Adds a
devprop to thePackageInstallcomponent that will append the package manager’s dev dependency flag. -
2179ae3: Adds parsing of
tsconfig.jsonfiles with comments toFileSystem. -
4eb6278: Removes the
PackageInstallScriptcomponent in favor of a hoisted script element. This removes the need to render this component in the layout file manually and will now be automatically be hoisted the first time thePackageInstallcomponent is rendered. -
cdba1f7: Prevents the
FileSystemutility from silently erroring when attempting to parse atsconfig.jsonfile.
Patch Changes
-
44c24f8: Improves
Directory#getFilequerying by allowing to pass a path with a modifier and a separate extension e.g.getFile('button.examples', ['ts', 'tsx']). -
1c106d4: Fixes
JavaScriptFileExport#getTyperesolving prototype methods innode_modules. -
60326d6: Fixes
MethodSignaturetype resolution inJavaScriptFileExport#getType. This was previously being treated as aPropertySignaturewhich errored when multiple signatures existed. -
c2e5021: Fixes
JavaScriptFileExport#getTypenot resolving instantiated mapped types correctly. The resolver now considers if the mapped type has a string or number index signature defined. -
9e2735b: Uses
localhostinstead of hardcoded127.0.0.1IP for dev server to improve portability and avoid linter warnings. -
71d894e: Unwraps
ParenthesizedTypenodes inJavaScriptFileExport#getTypeto capture better information.
9.0.0
Major Changes
-
7e38b82: Updates the
renounlicense fromAGPLv3to therenoun Non-Commercial License 1.0license. The renoun source code is now provided under the non-commercial renoun license ideal for blogs, documentation sites, and educational content. If you plan to integrate renoun into a commercial product or service, reach out to sales@souporserious.com to discuss options. -
d13c7e0: Removes
RenderedHTMLcomponent as it was not used anywhere and is simple enough to implement if needed for a specific use case. -
f54b73b: Renames the
MDXRenderercomponent toMDX. This is to better align with the newMarkdowncomponent.Breaking Changes
-
Rename any
MDXRenderercomponent references imported fromrenoun/componentstoMDX.
-
Rename any
-
499dccf: Renames the
APIReferencecomponent toReference, this rename is in anticipation of providing support for generating references for multiple sources in the near future. The component and theJavaScriptFileExport#getTypemethod have also been fully refactored to support more granular type inference and rendering. Notably, theReferencecomponent now accepts acomponentsprop that allows overriding every component within the tree:
For complete customization, the<Reference source="components/Button.tsx" components={{ SectionHeading: (props) => ( <h3 {...props} css={{ fontSize: 'var(--font-size-heading-2)', lineHeight: 'var(--line-height-heading-2)', fontWeight: 'var(--font-weight-heading)', }} /> ), Detail: (props) => ( <div {...props} css={{ display: 'flex', flexDirection: 'column', gap: '0.5rem', marginBottom: '1rem', }} /> ), Code: (props) => ( <code {...props} css={{ fontFamily: 'var(--font-family-code)', }} /> ), }} />JavaScriptFileExport#getTypemethod can be used directly. -
485809e: Updates the
Directoryconstructorsortoption to now accept either a string or a sort descriptor using a newcreateSortutility. This new API makes it easier to sort entries while ensuring sorting stays performant by calculating asynchronous keys upfront and then comparing them synchronously. This also fixes a bug when usingDirectory#getEntries({ recursive: true })where the results were not being sorted at each depth.Breaking Changes
TheDirectoryconstructorsortoption now requires either a string or a sort descriptor using the newcreateSortutility. Previously, sorting was defined in one function:
Now, a sort descriptor requires defining aimport { Directory } from 'renoun/file-system' const directory = new Directory<{ mdx: { frontmatter: { date: Date } } }>({ include: '*.mdx', sort: async (a, b) => { const aFrontmatter = await a.getExportValue('frontmatter') const bFrontmatter = await b.getExportValue('frontmatter') return bFrontmatter.date.getTime() - aFrontmatter.date.getTime() }, })keyresolver andcomparefunction:
For common use cases, this can be further simplified by defining a valid sort key directly:import { Directory, createSort } from 'renoun/file-system' const directory = new Directory<{ mdx: { frontmatter: { date: Date } } }>({ include: '*.mdx', sort: createSort( (entry) => { return entry .getExportValue('frontmatter') .then((frontmatter) => frontmatter.date) }, (a, b) => a - b ), })
Note, the value being sorted is taken into consideration. Dates will be sorted descending, while other values will default to ascending. If you need further control, but do not want to fully customize the sort descriptor usingimport { Directory } from 'renoun/file-system' const directory = new Directory<{ mdx: { frontmatter: { date: Date } } }>({ include: '*.mdx', sort: 'frontmatter.date', })createSort, adirectioncan be provided as well:import { Directory } from 'renoun/file-system' const directory = new Directory<{ mdx: { frontmatter: { date: Date } } }>({ include: '*.mdx', sort: { key: 'frontmatter.date', direction: 'ascending', }, })
Minor Changes
-
23f3501: Adds
renoun/utilspackage export. To start, this will include utilities for working with theReferencecomponent. -
a487bcd: Adds
useSectionObserverhook for tracking the active section currently in view:import React from 'react' import { useSectionObserver } from 'renoun/hooks' export function TableOfContents() { const observer = useSectionObserver() return ( <div style={{ display: 'flex', gap: '2rem' }}> <aside style={{ position: 'sticky', top: '1rem' }}> <ul style={{ listStyle: 'none', padding: 0, margin: 0 }}> {[ { id: 'intro', label: 'Introduction' }, { id: 'usage', label: 'Usage' }, { id: 'api', label: 'API Reference' }, ].map(({ id, label }) => ( <SectionLink key={id} id={id} label={label} observer={observer} /> ))} </ul> </aside> <main> <section id="intro"> <h2>Introduction</h2> <p>…</p> </section> <section id="usage"> <h2>Usage</h2> <p>…</p> </section> <section id="api"> <h2>API Reference</h2> <p>…</p> </section> </main> </div> ) } function SectionLink({ id, label, observer, }: { id: string label: string observer: ReturnType<typeof useSectionObserver> }) { const [isActive, linkProps] = observer.useLink(id) return ( <li style={{ marginBottom: '0.5rem' }}> <a href={`#${id}`} {...linkProps} style={{ color: isActive ? 'crimson' : 'black', fontWeight: isActive ? 'bold' : 'normal', textDecoration: 'none', }} > {label} </a> </li> ) } -
6b99a18: Updates
Directoryto now load the closesttsconfig.jsonrelative to the providedpathwhen instantiated. -
2395c7f: Renames the
Directoryconstructor option fromloaderstoloader. This prepares for upcoming support for specifying a single loader.Breaking Changes
Update allDirectoryconstructorloadersoption call sites to use the singularloader. -
49a913c: Renames
Directory#getEntriesoptionincludeIndexAndReadmetoincludeIndexAndReadmeFilesto better align with the other options.Breaking Changes
Rename anyDirectory#getEntriescall sites that use theincludeIndexAndReadmeand update the option name toincludeIndexAndReadmeFiles. -
4a12c50: Renames the
DirectoryandFilepath methods to better align with their intended use. ThebasePathconstructor option has also been renamed tobasePathnameto match the new naming convention. Additionally, thebasePathnameoption now defaults to the root directory’s slug since this is the most common use case.Breaking Changes
Rename any call sites that use the followingDirectoryandFilemethods:-
getPathtogetPathname -
getPathSegmentstogetPathnameSegments
basePathnameoption from your code if you were using it to set the base path for a directory. It now defaults to the root directory’s slug:import { Directory } from 'renoun/file-system'; const directory = new Directory({ path: 'components', -- basePath: 'components' }); const file = await directory.getFile('button') file.getPathname() // '/components/button' -
-
7e16818: Renames
EntryGrouptoCollectionto better describe a set of directories. Since renoun is lower-level, this makes it easier to describe in documentation e.g. create acollections.tsfile that encapsulates all directory definitions. -
3f2b8fa:
JavaScriptFile#getExportsnow sorts exports by their position. Previously, the order was determined by the TypeScript compiler which will hoist function declarations to the top of the file. This change ensures that the order of exports is consistent with the source file. -
0dfbfc5: Allow passing relative
baseDirectorytoCodeBlockcomponent, this allows more easily creating virtual files in a specific directory relative to the current working directory:import { CodeBlock } from 'renoun/components' export default function Example() { return ( <CodeBlock baseDirectory="src/components" children={` import { Button } from './Button'; export default function Example() { return <Button>Click me</Button>; } `} /> ) } -
24cb8ce: Adds analysis for mapped types to
JavaScriptFileExport#getTypeby introducing a newMappedkind. This will now capture mapped types instead of always expanding them fully which would result in large and repetitive types. -
65a3911: Trims index and readme from
File#getPathmethod. -
d3c6019: Updates how to use the
CodeBlockcomponent in MDX. When usingrenoun/mdx, a newaddCodeBlockrehype plugin rewrites thepreelement to aCodeBlockelement. This is more explicit and requires defining aCodeBlockcomponent now.Breaking Changes
If you are using therenoun/mdxplugins, wherever you pass additional MDX components needs to be updated to provide aCodeBlockcomponent now:
If you are not usingimport { CodeBlock, -- parsePreProps } from 'renoun/components' function useMDXComponents() { return { -- pre: (props) => <CodeBlock {...parsePreProps(props)} />, ++ CodeBlock, } }renoun/mdxpluginsparsePrePropsis still required. -
d9c0939: Adds a
resolveFileFromEntryfile system utility that will attempt to load the entry from either theindexorreadmewhen the entry is a directory. This makes it simpler to parse exports from entries since they include files and directories.await new Directory<{ mdx: { metadata: { title: string } } }>({ path: 'docs', }) .getEntries({ recursive: true }) .then((entries) => Promise.all( entries.map(async (doc) => { const file = await resolveFileFromEntry(doc, 'mdx') const { title } = await file.getExportValue('metadata') // ... }) ) ) -
2324815: Filters
undefinedunion members from optional properties inJavaScriptFileExport#getType. When usingstrictNullChecks, optional properties would previously add anundefinedmember to the union type. However, this is not necessary for the generated metadata and adds noise to the type text. -
e27f026: Renames the
CodeBlockcomponentworkingDirectoryprop tobaseDirectoryto better reflect how it is used. -
4b15a54: Directory entries are now included in the
Directory#getEntriesresult when a recursiveincludefile pattern is configured e.g.new Directory({ include: '**/*.mdx' }). This allows easier access to directories when building navigations. -
d537e64: Adds a
Markdowncomponent. This should be used when rendering markdown content and is now used to render JS Doc quick info content in theCodeBlockcomponent to ensure that the intended markdown is rendered correctly. This is also safer since we do not need to evaluate anything and return JSX elements directly.
Patch Changes
- ca8c010: Updates source files without a file path to use a FNV‑1a hashing algorithm based on the file contents to generate a smaller hash.
-
68a52eb: Fixes
isOptionalfor properties inJavaScriptFileExport#getTypenot considering symbol optionality as well as checking if the default value is explicitlyundefined. -
b0f69a7: Fixes
CodeBlockthrowing type errors about missing imports for JSX-only source code. It now attempts to auto-fix the missing imports. -
06349d6: Adds both runtime and type-level safety to prevent using the
recursiveoption with single-levelincludefilters (*.mdx) in theDirectory#getEntriesmethod, while still allowing it with multi-level patterns (**/*.mdx). This ensures thatincludefilters targeting a single directory level cannot be used recursively, which could lead to unexpected behavior. -
d9d5057: Adds
isOptionalfor class properties inJavaScriptFileExport#getType. -
846d4c1: Fixes
JavaScriptFileExport#getTypereferences being collapsed whenstrictNullChecksis configured in the project’s compiler options. The presence of generic type arguments are now considered before further resolving parameter and property types. -
8ec38b0: Fixes
JavaScriptFileExport#getTypeunion member references that point to external unions from resolving to their intrinsic type. References are now preserved correctly for all union members even when the member itself a union. An example of where this was previously broken could be seen in theCodeBlocklanguageprop that used an externalLanguagestype. This would previously resolve to flat union membersjsx | tsx | mdxinstead ofLanguages | 'mdx'. This is now fixed and the type will resolve toLanguages | 'mdx'as expected. -
ebb8faf: Fixes
Directory#getFilenot finding nested files when providing a path created withgetPath. - 8846cde: Fixes the internal server context not propagating the value correctly when used in a loop.
-
9b90ead: Improves the error message for
getFileExportTextto provide more information about where the error occurred and what the kind name was expected to be. -
7e4857f: Fixes source text not preserving
typein import declarations when usingincludeDependenciesoption inJavaScriptFileExport#getText. - c05b896: Adds security improvements to the RPC server to prevent unauthorized access by checking the origin of the request and verifying a valid token is present.
-
333d36d: Fixes component handling in
JavaScriptFileExport#getTypeby considering all union members. -
7dfd791: Improves
MDXcomponent compiler error message to show line and column of each error. -
1f95459: Fixes
CodeInlinenot wrapping correctly when used in paragraph. -
bf0e5e1: Fixes
JavaScriptFileExport#getTypenot capturing all signature parameters. -
a7f9509: Fixes
getFileExportsTextto use the correct node position across subsequent calls by removing AST node mutations which avoids the position from being changed. - Updated dependencies [7e38b82]
- Updated dependencies [d3c6019]
-
Updated dependencies [d537e64]
- @renoun/mdx@3.0.0
8.14.0
Minor Changes
-
f83d4f5: Moves
useThemePickerfromrenoun/componentstorenoun/hooks. -
91dc372: Adds
isDeprecatedfield to symbol tokens using suggestion diagnostics. This also adds text strikethrough styling for deprecated symbols in theTokenscomponent. -
ed4838a: Disables CSS transitions to prevent flashing when switching themes with
useThemePicker.
Patch Changes
-
9e66320: Prevents scrollbar showing along vertical axis for
CodeInline. - fd7a1b1: Fixes strikethrough styles not being accounted for if set in the textmate theme.
-
affc0c0: Adds
node.enginespackage.jsonfield for minimum required Node.js version. -
d00da22: Fixes
Refreshcomponent erroring during development when no server is present. This allows more easily testing synchronous behavior.
8.13.1
Patch Changes
-
9e0dce6: Fixes a bug in
Directory#getFilewhere a file name modifier (e.g.examplesinButton.examples.tsx) for the provided path was not being considered when checking if a file exists.
8.13.0
Minor Changes
-
6bf096d: Updates exported
headingsvariable from theaddHeadingsremark plugin to include a newchildrenproperty to allow rendering the JSX children of the heading element. For example, headings with inline code or links:
Roughly yields:# Heading with `code`export const headings = [ { level: 1, id: 'heading-with-code', text: 'Heading with code', children: ( <> Heading with <code>code</code> </> ), }, ] # Heading with `code`Breaking Changes
Thedepthproperty of the heading metadata object was renamed tolevelto better reflect HTML nomenclature. -
899fb08: Adds back
getDefaultExportandgetNamedExportfor bothJavaScriptFileandMDXFileclasses. These methods are useful as type guards to narrow types when building utilities that work with both JavaScript and MDX files. -
f96a2be: Adds a first-class
Refreshcomponent for refreshing the server during development when a source file changes:
This was previously automated forimport { Refresh } from 'renoun/components' export default function RootLayout({ children, }: { children: React.ReactNode }) { return ( <html lang="en"> <body> {children} <Refresh /> </body> </html> ) }JavaScriptFile/MDXFilecomponent exports. However, it did not provide a robust enough solution for all use cases. This new component ensures that only one listener will ever be added. -
af2a21a: Includes
MDXContenttype by default now when usingMDXFile. Previously,{ default: MDXContent }had to be defined explicitly. Now, it is merged in automatically with optional export types:import { MDXFile } from 'renoun/file-system' const file = new MDXFile<{ frontmatter: { title: string; date: Date } }>({ path: 'path/to/file.mdx', })
Patch Changes
-
36d62b6: Removes default
hrmargin inQuickInfomarkdown container. -
Updated dependencies [6bf096d]
- @renoun/mdx@2.1.0
8.12.0
Minor Changes
- a862ea2: Updates all dependencies to latest version.
Patch Changes
- Updated dependencies [d7d15f7]
- Updated dependencies [b33e5ca]
-
Updated dependencies [6d6684f]
- @renoun/mdx@2.0.0
8.11.0
Minor Changes
-
a0c78fd: Exports the
ThemeStylescomponent for more granular control of managing multiple themes. -
50f816b: Adds back the
workingDirectoryprop to theCodeBlockcomponent for targeting local files. When defined, this will be joined with thepathprop to load a source file located within the file system instead of creating a virtual file which allows imports and types to be resolved correctly. -
7107876: Fixes
parsePrePropstypes to includechildren. -
a4c6205: Optimizes the
JavaScriptFile#getText({ includeDependencies: true })method to be more performant. -
a7e75c3: Cleans up default styles for
Tokensquick info popover.
Patch Changes
- 0b0e28f: Fixes cached package dependency check causing missing formatting on initial load during development.
- bce883d: Fix theme CSS variable collisions by prefixing theme variable names.
-
a0e39d8: Improves default colors for
QuickInfoacross themes. -
04421e0: Removes duplicate code text for functions and components in
APIReference. -
23604c6: Fixes the
CodeBlockcomponent server context not restoring the previous value which causes theToolbarcomponent to receive the incorrect value.
8.10.0
Minor Changes
-
41d7551: Renames
CodeBlockfilenameprop topathto better reflect its purpose since a nested file path can be defined.Breaking Changes
Thefilenameprop in theCodeBlockcomponent has been renamed topath. Update any references to thefilenameprop in components or MDX pages that use theCodeBlockcomponent for rendering code fences. -
78e5234: Adds a
shouldAnalyzeprop toCodeBlock,CodeInline, andTokenscomponents for controlling whether or not to analyze and type-check source code. -
5c966d1: Uses the
Tokenscomponent withinCodeInlinewhen alanguageis provided. -
e3e2dea: Removes
sourceandworkingDirectoryprops fromCodeBlockcomponent since these can be calculated usingreadFileexplicitly.Breaking Changes
ThesourceandworkingDirectoryprops fromCodeBlockcomponent have been removed. UsereadFileto read the source file contents:import { CodeBlock } from 'renoun/components' import { readFile } from 'node:fs/promises' export function CodeBlock() { return ( <CodeBlock language="tsx"> {readFile('src/components/Button.tsx', 'utf-8')} </CodeBlock> ) }
Patch Changes
-
8d232ac: Fixes
LineNumbersnot awaiting the text value fromTokens. -
417155e: Fixes duplicate key warning in development for
Tokenscomponent. -
bdbc887: Fixes
CodeInlinefallback state causing layout shift. -
120e0eb: Fixes
CodeBlockerroring fortextandtxtlanguages.
8.9.0
Minor Changes
-
49f6179: Adds
copyButtonproperty toCodeBlockcss,className, andstyleprops for overridingCopyButtonstyles. -
90417e5: Improves composition for
CodeBlockby allowingTokensto accept string children to be tokenized and highlighted:
This removes the need to pass aimport { Tokens } from 'renoun/components' export function App() { return <Tokens>const foo = 'bar';</Tokens> }valueprop toCodeBlock.Breaking Changes
TheCodeBlockvalueprop should now be passed as a child to theTokenscomponent:-<CodeBlock language="ts" value="const foo = 'bar';" /> +<CodeBlock language="ts">const foo = 'bar';</CodeBlock> -
72567ea: Renames the
MDXRenderervalueprop tochildrento be consistent with other components.Breaking Changes
TheMDXRenderervalueprop has been renamed tochildren:-<MDXRenderer value="# Hello World" /> +<MDXRenderer># Hello World</MDXRenderer> -
24a31df: Allows passing a string to
allowCopyfor bothCodeBlockandCodeInlinecomponents:<CodeInline allowCopy="npx create-renoun@latest" language="bash"> npx create-renoun </CodeInline> -
89ce87f: Optimizes calculating whether or not to apply the base color for a token by moving the calculation to the
Tokenizerclass. -
e67e284: Moves inline code
languageparsing toparseCodePropsutility. -
ff7f63d: Renames the
CodeInlinevalueprop tochildrento better integrate with Markdown and MDX renderers.Breaking Changes
TheCodeInlinevalueprop has been renamed tochildren:-<CodeInline language="js" value="const foo = 'bar';" /> +<CodeInline language="js">const foo = 'bar';</CodeInline>
Patch Changes
-
7d9b83a: Fixes parsing language from Markdown and MDX when using filenames:
```use-hover.ts export function useHover() { // ... } ``` - Updated dependencies [3dac737]
-
Updated dependencies [e67e284]
- @renoun/mdx@1.6.0
8.8.0
Minor Changes
-
3ef7096: Removes initial symbol highlighting styles that were triggered when the pointer entered the
CodeBlockcomponent. These styles are too opinionated and should be left for the user to define. - 22eec86: Improves the fallback theme colors used throughout components to better match the theme author’s intent.
-
836a6b3: Adds a new
useThemePickerhook for selecting a theme from the configured themes:
The theme can be toggled or set explicitly using the'use client' import { useThemePicker } from 'renoun/components' export function ThemePicker() { const [theme, setTheme] = useThemePicker() return ( <select value={theme} onChange={(event) => setTheme(event.target.value)}> <option value="light">Light</option> <option value="dark">Dark</option> </select> ) }setThemefunction. Note, thatthemeis always initially set toundefinedsince it cannot be known until the React tree is hydrated. Use thedata-themeattribute to style the app based on the selected theme. -
bed53d7: Replaces
shiki
with an internal
createTokenizerutility that uses oniguruma-to-es and vscode-textmate directly. This implementation is based on both textmate-highlighter andshikito provide a smaller, focused highlighter that allows for more granular control.
Patch Changes
- da9b603: Fixes a regression from when multiple themes were introduced that had removed token rendering optimizations. Now tokens across themes that are not a symbol and match the foreground color will not be wrapped in an element.
- bed53d7: Fixes an issue when highlighting multiple themes where tokens were only generated correctly for the first theme.
-
970102c: Fixes
QuickInfopopover not staying contained within the viewport for smaller screens. -
2100b91: Fixes
CopyButtonicon size filling the entire container. -
Updated dependencies [a5c470c]
- @renoun/mdx@1.5.0
8.7.0
Minor Changes
-
e6ad215: Adds
MDXFile,MDXFileExport, andisMDXFileclasses and utilities to better differentiate between specific MDX and JavaScript file methods. This also helps with performance since we should never attempt to analyze an MDX file using the TypeScript compiler and allows for future MDX-specific methods to be added.Breaking Changes
In some cases there may be breaking changes if you were loading mdx files and targetingJavaScriptFilerelated classes or types. These should be transitioned to the newMDXFile,MDXFileExport, andisMDXFilerespectively. -
073b6d1: Adds a cache for
Directory#getEntriesandJavaScriptFile#getFileExportsduring production builds to help with performance since these methods can be called multiple times during a build.
Patch Changes
- 29e19e5: Fixes default MDX file system loader not including all exports.
-
f1d6b47: Improves
excludefiltering performance by caching the minimatch pattern. - 5c4e0ec: Fixes default MDX loader to parse inline code props.
-
Updated dependencies [b325412]
- @renoun/mdx@1.4.1
8.6.0
Minor Changes
-
edbee62: Adds
Pierre
as a git provider option that can be configured in the
renoun.jsonfile:{ "git": { "source": "https://pierre.co/souporserious/renoun" } }
Patch Changes
- 7b13d1e: Throws better error message when missing git configuration.
8.5.0
Minor Changes
-
720e101: Adds the ability to override specific theme values. You can now provide a tuple when configuring themes that specifies the specific theme values to override:
This accepts a subset of a VS Code theme to override, specifically the{ "theme": { "light": "vitesse-light", "dark": [ "vitesse-dark", { "colors": { "editor.background": "#000000", "panel.border": "#666666" } } ] } }colors,tokenColors, andsemanticTokenColorsproperties.
Patch Changes
- abaa0f9: Fixes font styles when using multiple themes.
- 6abb6ad: Fixes error when tokens are different among multiple themes.
-
0e884db: Fixes
QuickInfosyntax highlighting when using multiple themes. -
9e97dc7: Fixes forced theme on
CodeBlock. - f056a45: Uses correct CSS style selector for theme token variables.
- 17b33f0: Fixes loading local theme when using multiple themes.
-
31f7f4e: Updates
CodeInlinebackground color to be consistent withCodeBlock.
8.4.0
Minor Changes
-
4079759: Allows
CodeBlockvalueprop to accept a promise that will resolve within the Suspense boundary. - 5f524f5: Updates all dependencies to their latest version.
-
fba9490: Adds support for defining multiple syntax highlighting themes in
renoun.json:
This requires using a new{ "theme": { "light": "vitesse-light", "dark": "vitesse-dark" } }ThemeProvidercomponent that will inject the proper CSS Variables in the head of the document:
To use a specific theme, append aimport { ThemeProvider } from 'renoun/components' export default function RootLayout({ children, }: { children: React.ReactNode }) { return ( <html lang="en"> <body> <ThemeProvider /> {children} </body> </html> ) }data-themeattribute to thehtmlelement or another parent element:<html data-theme="dark" lang="en"> ... </html> -
26757a9: Adds
includeDependenciesoption toJavaScriptFileExport#getTextmethod. When enabled, this will include all dependencies of the export declaration in the returned text. -
c831cb6: Updates a project’s default compiler options to only be set when using
MemoryFileSystem. This makes sure to respect the localtsconfig.jsonfile without any implicit overrides when usingNodeFileSystem.
Patch Changes
-
33b0adb: Exports
DefaultModuleTypesto ensure all types used in public API declarations are explicitly available. -
b55efb0: Fixes
File#getSlugappending an extension. -
0a2f85c: Fixes Next.js warning for wrong
NODE_ENVset to production during development. -
Updated dependencies [5f524f5]
- @renoun/mdx@1.4.0
8.3.2
Patch Changes
-
076403c: Update
restyledependency to latest version.
8.3.1
Patch Changes
-
ae38994: Update
shikidependency to latest version. -
Updated dependencies [ae38994]
- @renoun/mdx@1.3.2
8.3.0
Minor Changes
-
b7895d2: Renames file system
pathCasingoption toslugCasingto better reflect its purpose. This also adds an option for configuring the casing used forJavaScriptFileExport. -
03d7591: Exports a
parseCodePropsutility for theCodeInlinecomponent to makie it easier to parse and type custom MDX components correctly:import { CodeInline, parseCodeProps } from 'renoun/components' import type { MDXComponents } from 'renoun/mdx' export function useMDXComponents() { return { code: (props) => { return <CodeInline {...parseCodeProps(props)} /> }, } satisfies MDXComponents } -
3547b64: Exports the
parsePrePropsutility for theCodeBlockcomponent instead of attaching it to the component itself:import { CodeBlock, parsePreProps } from 'renoun/components' import type { MDXComponents } from 'renoun/mdx' export function useMDXComponents() { return { pre: (props) => { return <CodeBlock {...parsePreProps(props)} /> }, } satisfies MDXComponents }
Patch Changes
-
1555cca: Fixes return type in
APIReferencealways spanning entire width.
8.2.0
Minor Changes
-
2af679d: Adds
createFilemethod toMemoryFileSystem. -
dec8620: Removes predefined
MDXComponentscomponents since it’s easy to instantiate yourself which allows overriding defaults. The same functionality can be achieved by defining the components directly:import { CodeBlock, CodeInline } from 'renoun/components' import type { MDXComponents } from 'renoun/mdx' const mdxComponents = { pre: (props) => { const { value, language } = CodeBlock.parsePreProps(props) return <CodeBlock value={value} language={language} /> }, code: (props) => { return <CodeInline value={props.children} language="typescript" /> }, } satisfies MDXComponents -
2b4aa82: Renames
File#getModifiertoFile#getModifierNameto be more descriptive and avoid confusion.
Patch Changes
-
f05656d: Fixes missing JS Doc metadata for overloads in
JavaScriptFileExport#getType. -
f47bd21: Fixes type aliases being inferred as components in
JavaScriptFileExport#getType. -
38a8ae1: Exports
DirectoryOptionsinterface. -
72b8e58: Fixes
APIReferencedocumentation for overloads.
8.1.0
Minor Changes
-
339ef75: Aligns
CodeBlockscroll container styles withCodeInline.
Patch Changes
- 5390d03: Fixes Standard Schema types not working by copying them directly into the project.
-
94f53da: Fixes
CodeBlockfallback layout shift during development. -
5a641b3: Fixes collapsed right padding for
CodeInlinewhen container is scrolled to the end. -
ca25cd3: Fixes missing bottom padding for
CodeInlinein iOS Safari.
8.0.0
Major Changes
-
02facb1: Removes
renoun/collectionspackage export and all related types and utilities that were deprecated in v7.8.0 .Breaking Changes
Therenoun/collectionspackage was removed. To upgrade, move to therenoun/file-systempackage and use theDirectoryclass instead. In most cases, you can replaceCollectionwithDirectoryandCompositeCollectionwithEntryGroup.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
*OrThrowmethods fromDirectoryandEntryGroup. This also exports two new custom errors,FileNotFoundErrorandFileExportNotFoundErrorto handle missing files and exports.Breaking Changes
DirectoryandEntryGroupno longer have*OrThrowmethods, use the respective methods instead. To get the same functionality as before, you can catch the error and handle it accordingly:import { Directory, FileNotFoundError } 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#getParentthrows when called for the root directory. This makes the method easier to work with and aligns better withFile#getParentalways returning aDirectoryinstance. -
71aa01f: Adds a default
mdxloader toJavaScriptFilethat uses theMDXRenderercomponent. 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#getTextmethod for retrieving the text contents of the file. -
e107c2f: Allows instantiating
FileandJavaScriptFilemore easily using only apath:import { JavaScriptFile } from 'renoun/file-system' const indexFile = new JavaScriptFile({ path: 'src/index.ts' }) const indexFileExports = await indexFile.getExports() -
3298b6b: Refactors
Generickind that can be returned fromJavaScriptFileExport#getTypeinto two separateUtilityandUtilityReferencekinds. This is more explicit in how types are resolved based on where the type resolution starts from.// "Partial" is resolved as a "Utility" kind when starting from the type alias type Partial<Type> = { [Key in keyof Type]?: Type[Key] } // Whereas "Partial" here is resolved as a "UtilityReference" kind when resolved from within a type interface Props<Type> { options: Partial<Type> } -
a470c98: Adds an overload to
Directory#getFilethat allows for querying files by their path including the extension instead of needing to provide the extension separately:const rootDirectory = new Directory() const file = await rootDirectory.getFile('tsconfig.json') -
919b73d: Configures the
JavaScript RegExp Engine
for
shiki. -
eb6a7f2: The WebSocket server now uses
.gitignoreto ignore watching files instead of a hardcoded array. -
213cc11: Adds an option for specifying the
portnumber when usingcreateServerfromrenoun/server:import { createServer } from 'renoun/server' createServer({ port: 3001 }) -
b82df87: Allows File System type guards (
isDirectory,isFile,isJavaScriptFile) to acceptundefined. This saves from having to check if a file exists before checking its type. -
37cb7bb: Fixes running multiple renoun WebSocket servers by setting the port to
0by default. This allows the OS to assign an available port. -
446effc: Exports
FileSystem,MemoryFileSystem, andNodeFileSystemclasses for creating custom file systems as well asRepositoryfor 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
- 8f64055: Fixes error when adding a file at a previously deleted path by flushing the file deletion immediately.
-
334f859: Fixes duplicate unions appearing in
JavaScriptFileExport#getType. - 438dc94: Avoids creating duplicate watchers for the same directory.
- 1cc52b8: Fixes Webpack cache warning from dynamic prettier import by moving to require.
- ce751f1: Fixes non-exported types not being resolved.
-
7b90440: Fixes
getTypeerroring when inferring a re-exported type. - 54eeb9e: Fixes duplicate exports when there are overloads.
-
Updated dependencies [c394b9c]
- @renoun/mdx@1.3.1
7.9.0
Minor Changes
-
3022d63: Renames
DirectoryandFilegetParentDirectorymethods togetParentto better align withgetSiblings. This also aligns more closely with the web File System API’s getParent method.Breaking Changes
-
Directory.getParentDirectoryis nowDirectory.getParent -
File.getParentDirectoryis nowFile.getParent
-
-
ba2d5e1: Adds
pathCasingoption toDirectoryfor 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 { } from 'renoun/file-system' const = new ({ : 'components', : 'kebab', }) const = await .('button') .() // '/button' const = await .('card') .() // '/card' -
87e380b: Renames the
MDXContentcomponent toMDXRenderer. This was causing confusion with theMDXContenttype exported fromrenoun/mdxand better reflects the purpose of the component.Breaking Changes
-
Rename any
MDXContentcomponent references fromrenoun/componentstoMDXRenderer.
-
Rename any
-
4149b39: Refactors the
Directorybuilder pattern to move back to an object configuration with the addition of a newwithSchemahelper, allowing strong type inference and colocated file export type definitions:
Note, some additional changes have also been made:import { , } from 'renoun/file-system' import { } from 'zod' export const = new ({ : 'posts', : '*.mdx', : { : ( { : .({ : .(), : .(), : .(), : .(.()).(), }), }, () => import(`@/posts/${}.mdx`) ), }, })-
withModulehas been replaced in favor of aloadersoption. -
withFilterhas been replaced by anincludeoption to better align with TypeScript’s configuration naming. -
The new
includefilter 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
MDXContenttype is now included by default for MDX filedefaultexports. -
Internally, the
JavaScriptFileWithRuntimeclass was collapsed intoJavaScriptFile. 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 forDirectoryhas been refactored to use an object configuration with the addition of a newwithSchemahelper. This change is breaking for any existing code that uses theDirectorybuilder pattern. ThewithSchemahelper is now required to provide strong type inference and colocated file export type definitions.Before
import { } from 'renoun/file-system' interface { : { : } } const = new <>('posts').( () => import(`./posts/${}`) )After
import { } from 'renoun/file-system' const = new <>({ : 'posts', : { : () => import(`./posts/${}.mdx`), }, }) -
-
80ae7f2: Marks the
Directory#duplicatemethod as private since this was previously only exposed forEntryGroupwhich no longer requires a new instance to be created. -
1f6603d: Removes
getEditPathin favor ofgetEditUrlandgetEditorUrifor a more explicit API. Prior, thegetEditPathmethod 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
ThegetEditPathmethod has been removed. UsegetEditUrlandgetEditorUriinstead. To get the same behavior asgetEditPathyou can use bothgetEditUrlandgetEditorUritogether:import { } from 'renoun/file-system' const = new ('src/components') const = .('Button', 'tsx') const = .. === 'development' ? .() : .() -
97bc268: Renames
@renoun/mdxHeadingstype toMDXHeadings. This adds better clarity and consistency with the otherMDXprefixed types.Breaking Changes
-
Rename any
Headingsreferences from@renoun/mdxtoMDXHeadings.
-
Rename any
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#getFilenot 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#getFilenot prioritizing base files over files with modifiers e.g.Button.tsxoverButton.examples.tsx. - Updated dependencies [ece3cc2]
- Updated dependencies [97bc268]
-
Updated dependencies [df4d29d]
- @renoun/mdx@1.3.0
7.8.0
Minor Changes
-
0f069c5: Implements
JavaScriptFile#getExportas an async method that now resolves the metadata of the export when it is initialized. This removes the need toawaitall methods likegetName,getDescription, andgetTags. Additionally, this adds a newJavaScriptFile#hasExportmethod for checking if the file has a specific export. -
9cf4499: Deprecates
Collection,CompositeCollection,isExportSource,isFileSystemSource, andisCollectionSource. These will be removed in the next major version.Updating to File System utilities
TheCollectionandCompositeCollectionclasses have been deprecated in favor of the newrenoun/file-systemutilities. TheisExportSource,isFileSystemSource, andisCollectionSourcefunctions have also been deprecated. To update your code, replace any instances ofCollectionwithDirectoryandCompositeCollectionwithEntryGroup. For example, the following code:
should be replaced with: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)import { Directory, EntryGroup, isFile } from 'renoun/file-system' const docs = new Directory({ path: 'docs' }).filter((entry) => isFile(entry, 'mdx') ) const components = new Directory({ path: 'src/components' }).filter((entry) => isFile(entry, ['ts', 'tsx']) ) const entryGroup = new EntryGroup({ entries: [docs, components] }) -
95e56e2: Adds
includeDuplicatesoption toDirectory#getEntriesthat is set tofalseby default. This option allows control over deduplicating entries with the same base name e.g.Button.mdxandButton.tsx. -
7d56e9a: Adds
getSlugmethod toDirectory,File, andJavaScriptExport. -
3419623: Adds
getExportValueandgetExportValueOrThrowmethods toJavaScriptFileas a shortcut to getting an export’s runtime value since this is a common use case. -
91d9b51: Removes
isFileWithExtensionand reimplements it withinisFilewhich now allows an optional secondextensionargument.Breaking Changes
To upgrade, replace all instances ofisFileWithExtensionwithisFile. Previous usage ofisFilewill still work as expected. -
4279d19: Adds
includeDuplicateSegmentsconfiguration option forFile#getPathmethod that is set tofalseby default. This option allows including consecutive duplicate segments in the returned path. -
92c5dee: Enables passing
tsConfigPathoption toDirectory. -
4f843e4: Adds
isJavaScriptFileandisJavaScriptFileWithRuntimetype guards for JavaScript-like files. -
50e094b: Adds
getPositionandgetTextmethods toJavaScriptExport. -
c4d274c: Moves the
DirectorygetImportoption toDirectory#withModule. This provides stronger types for inferring thegetRuntimeValuemethod.Breaking Changes
Update thegetImportoption towithModule:export const posts = new Directory<{ mdx: PostType }>({ path: 'posts', schema: { mdx: { frontmatter: frontmatterSchema.parse } }, -- getImport: (path) => import(`./posts/${path}`), }) ++ .withModule((path) => import(`./posts/${path}`)) -
87ce75d: Moves the
Directoryschemaoption toDirectory#withSchema. This aligns with the other recent refactor ofDirectoryoptions.Breaking Changes
Update theschemaoption towithSchema:export const posts = new Directory<{ mdx: PostType }>({ path: 'posts', -- schema: { mdx: { frontmatter: frontmatterSchema.parse } }, }) ++ .withSchema('mdx', { frontmatter: frontmatterSchema.parse }) -
46f0807: Moves the
DirectorybasePathoption toDirectory#withBasePath. This aligns with the recent refactor of otherDirectoryoptions.Breaking Changes
Update thebasePathoption towithBasePath:export const posts = new Directory<{ mdx: PostType }>({ path: 'posts', -- basePath: 'blog', }) ++ .withBasePath('blog') -
8252c4b: Adds
getTitlemethod toDirectoryandFileNameclasses. -
2e7f458: Adds an
EntryGrouputility torenoun/file-systemthat provides an interface for querying and navigating a group of entries:
Sibling entries can be queried using theimport { Directory, EntryGroup } from 'renoun/file-system' interface FrontMatter { title: string description?: string date: string tags?: string[] } interface MDXType { frontmatter: FrontMatter } const posts = new Directory<{ mdx: MDXType }>({ path: 'posts', }) const docs = new Directory<{ mdx: MDXType }>({ path: 'docs', }) const group = new EntryGroup({ entries: [posts, docs], }) const entries = await group.getEntries()getSiblingsmethod and passing theEntryGroupinstance to get the siblings for. This is useful for querying siblings across sets of entries:
This also addsconst entry = await group.getEntryOrThrow('Button') const siblings = await entry.getSiblings({ entryGroup: group })hasEntryandhasFilemethods toDirectorywhich can be used to check if an entry or file exists in anEntryGroup:type MDXTypes = { metadata: { title: string } } type TSXTypes = { title: string } const directoryA = new Directory<{ mdx: MDXTypes }>({ fileSystem: new VirtualFileSystem({ 'Button.mdx': '' }), }) const directoryB = new Directory<{ tsx: TSXTypes }>({ path: 'fixtures/components', }) const group = new EntryGroup({ entries: [directoryA, directoryB], }) const entry = await group.getEntryOrThrow('Button') if (directoryA.hasFile(entry, 'mdx')) { entry // JavaScriptFile<MDXTypes> } -
da0ca4a: Adds
getDepthmethod toDirectoryandFile. - 1d62855: Fixes ts config exclude paths not being respected when using a relative path.
-
be4c6ae: Normalizes the
File#getDirectorymethod to return an async value similar toDirectory. -
155f2e7: Renames file system methods
filtertowithFilterandsorttowithSortfor better clarity since they are not immediately applied.Breaking Changes
-
Directory#filtermethod is nowDirectory#withFilter -
Directory#sortmethod is nowDirectory#withSort
-
-
6e599bb: Adds
includeGitIgnoredFilesandincludeTsConfigIgnoredFilesoptions toDirectory#getEntries. These options allow you to include files that are ignored by.gitignoreandtsconfig.jsonrespectively. -
66f8289: Adds the ability to specify only the
pathwhen initializing aDirectoryinstance since this is the most common use case:
For more advanced use cases, you can still specify theimport { Directory } from 'renoun/file-system' const directory = new Directory('path/to/directory')options:import { Directory, MemoryFileSystem } from 'renoun/file-system' const fileSystem = new MemoryFileSystem({ 'Button.tsx': 'export const Button = () => {}', }) const directory = new Directory({ path: 'path/to/directory', fileSystem, })
Patch Changes
-
20d3bc5: Fixes an issue in the
Directory#getFilemethod where theentryvariable was not reset in each iteration of the while loop. This caused incorrect file resolutions when searching for nested files. -
c29192b: Fixes nested files being ordered before directory when using
Directory#getEntries. Now the directory will be ordered first by default before its descendants. - ce32d36: Fixes analyzing barrel file exports.
-
bb20d7e: Fixes duplicate file exports being returned. This was specifically happening when a file export attached a member to the function implementation:
export function CodeBlock() { // ... } CodeBlock.displayName = 'CodeBlock' // This caused the file to be exported twice -
76b2c80: Fixes package import error if
prettieris not installed. -
23aba08: Fixes
DirectoryandFilegetSiblingsmethod not using a unique identifier to find a matching entry. -
97799b3: Fixes
Directory#getFilenot considering extensions. -
f2326fd: Fixes
Directory#getFilenot considering extension when provided and matching a directory. -
50d8760: Fixes
VirtualFileSystemnot respecting provided files order. -
f011668: Fixes
isDirectorytype guard inference. -
3da8602: Fixes not being able to set tsconfig
compilerOptionsto useverbatimModuleSyntax. -
c160fba: Fixes filtering of
Directoryentries based on tsconfigexcludefield.
7.7.0
Minor Changes
- a1aa042: Removes managing of auto-generated dynamic imports for collections as this was causing issues with build processes.
Patch Changes
-
f2e5608: Fixes
getAbsolutePathandgetEditPathforDirectory. -
c59cd9c: Normalizes
pathSegmentsto remove order prefix. -
784945a: Normalizes incoming
pathforreadDirectoryinVirtualFileSystemto match Node.js behavior.
7.6.0
Minor Changes
-
0c67c7c: Removes
isJavaScriptFiletype guard in favor ofisFileWithExtensionthat narrows types better. -
bf56af0: Adds support for passing
JavaScriptFileandJavaScriptFileExportto theAPIReferencecomponent. -
4fc9781: Returns a
JavaScriptExportinstance now fromgetExportsto align withgetExport. -
73bb769: Adds Fast Refresh to
<JavaScriptExport>.getRuntimeValuefor Next.js. -
3eec7ff: Removes
getDirectoriesandgetFilesfromDirectorynow that thefiltermethod is available:import { Directory, isFileWithExtension } from 'renoun/file-system' const directory = new Directory() const files = directory .filter((entry) => isFileWithExtension(entry, ['ts', 'tsx'])) .getEntries() -
5390b16: Removes
File#hasExtensionmethod in favor of theisFileWithExtensiontype guard to consolidate the API.
Patch Changes
-
8d2b7f3: Fixes the
Directory#getEntriesmethodrecursiveoption not considering nested entries.
7.5.0
Minor Changes
-
abb441d: Improves error handling for the
CodeBlockcomponent when falsey values are provided. -
0b6e426: Adds
sortmethod toDirectoryto allow sorting all entries within each directory:import { Directory, isFileWithExtension } from 'renoun' type PostType = { frontmatter: { title: string } } const posts = new Directory<{ mdx: PostType }>({ path: 'posts' }) .filter((entry) => isFileWithExtension(entry, 'mdx')) .sort(async (a, b) => { const aFrontmatter = await a.getExport('frontmatter').getRuntimeValue() const bFrontmatter = await b.getExport('frontmatter').getRuntimeValue() return aFrontmatter.title.localeCompare(bFrontmatter.title) }) const files = await posts.getEntries() // JavaScriptFile<PostType>[] sorted by front matter title -
cac71c1: Improves
<VirtualFileSystem>.transpileFileerror handling. -
2c55b51: Adds
filtermethod toDirectoryto allow filtering all entries within each directory:import { Directory, isFileWithExtension } from 'renoun' type PostType = { frontmatter: { title: string } } const posts = new Directory<{ mdx: PostType }>({ path: 'posts' }).filter( (entry) => isFileWithExtension(entry, 'mdx') ) const files = await posts.getEntries() // JavaScriptFile<PostType>[] -
40c6cdd: Scopes
VirtualFileSystemusing aprojectIdadded to the baseFileSystemclass. This ensures the TypeScript project is unique to the virtual file system it is instantiated with.
Patch Changes
-
1c77620: Fixes the
Directory#getEntriesmethodrecursiveoption to only recurse ingetEntriesinstead of the file system.
7.4.0
Minor Changes
-
e71de2f: Adds
shouldFormatprop toCodeBlockcomponent to allow disabling code formatting. This is useful for MDX code blocks that are already formatted by an IDE or CI environment.export function useMDXComponents() { return { pre: (props) => { return <CodeBlock shouldFormat={false} {...restProps} /> }, } } -
f44b9c5: Adds support for passing an array to
isFileWithExtensionandFile#hasExtension.
Patch Changes
-
bf0c510: Fixes File System
recursiveoptions not calculating the appropriate relative paths. -
eab583f: Explicitly sets the prettier
parseroption instead of relying on inference fromfilepathto avoid false-positive errors when parsing code blocks without a providedfilename.
7.3.0
Minor Changes
-
4c1f7d5: Adds
recursiveoption togetEntries,getDirectories, andgetFiles. -
ff8d9ae: Implements
getTypeforJavaScriptFileExport.
Patch Changes
-
51506d8: Fixes internal
resolveTypeutility trimming thefilePathingetTypeincorrectly. -
d83d265: Fixes order prefixes being added to File System
getPathmethods.
7.2.0
Minor Changes
-
9d67bdf: Add
getFilesandgetDirectoriestoDirectory. -
1bd1de3: Adds
hasExtensionmethod toFileto help constrain the type:import { Directory } from 'renoun/file-system' const posts = new Directory<{ mdx: { frontmatter: { title: string } } }>({ path: 'posts', }) const mdxFiles = await posts .getFiles() .filter((post) => post.hasExtension('mdx')) -
4d263fe: Add
includeIndexAndReadmeoption togetEntriesfor controlling default filtering ofindexandreadmefiles. -
e09a837: Adds
isFileWithExtensionutility:const fileSystem = new VirtualFileSystem({ 'Button.tsx': '', }) const directory = new Directory<{ tsx: { metadata: {} } }>({ fileSystem, }) const file = await directory.getFileOrThrow('Button') if (isFileWithExtension(file, 'tsx')) { // file is typed as File<{ tsx: { metadata: {} } }> } -
a36058f: Add
getEditPathmethod toJavaScriptFileExport.
7.1.0
Minor Changes
-
16a475f: Adds javascript file export metadata to
renoun/file-system:import { VirtualFileSystem, Directory } from 'renoun/file-system' const fileSystem = new VirtualFileSystem({ 'index.ts': `/**\n * Say hello.\n * @category greetings\n */\nexport default function hello() {}`, }) const directory = new Directory({ fileSystem }) const file = await directory.getFileOrThrow('index', 'ts') const fileExport = file.getExport('default') await fileExport.getName() // 'hello' await fileExport.getDescription() // 'Say hello.' await fileExport.getTags() // [{ name: 'category', value: 'greetings' }]
Patch Changes
-
e1b908e: Removes
asyncmodifier forCodeInlinecomponent to prevent type errors.
7.0.0
Major Changes
-
90bbe5b: Simplifies how
baseDirectoryworks forCollection. This was from a legacy implementation that was not well thought out and caused confusion. This change makes it more explicit and easier to understand.Breaking Changes
ThebaseDirectoryoption forCollectionis now required to be separate fromfilePattern:import { Collection } from 'renoun/collections' const components = new Collection({ -- filePattern: 'src/components/**/*.ts', ++ filePattern: '**/*.ts', -- baseDirectory: 'components', ++ baseDirectory: 'src/components', }) -
93da61f: Introduces more performant, type-safe file system from utilities exported from
renoun/file-systemto replace therenoun/collectionsAPI, which will be removed in a future major release.-
New Classes:
-
NodeFileSystem,VirtualFileSystem,Directory,File,JavaScriptFile, andJavaScriptFileExport.
-
-
Improvements:
-
Optimized performance, stronger TypeScript support, and in-memory support with
VirtualFileSystem.
-
Optimized performance, stronger TypeScript support, and in-memory support with
Migration Example
Before:
After:const collection = new Collection({ filePattern: 'src/**/*.{ts,tsx}', baseDirectory: 'src', }) const sources = await collection.getSources()
The new file system utilities offer clearer APIs, better performance, and improved developer experience. This is still experimental and API parity with the old collections API is still in progress. Please report any issues you encounter.const directory = new Directory({ path: 'src' }) const entries = await directory.getEntries() -
New Classes:
-
7cbb112: Updates the
<Collection>.getSourcemethod to be asynchronous and return aPromisethat resolves to the source. This allows for more flexibility for a source to communicate with the web socket server.Breaking Changes
ThegetSourcemethod for aCollectionandCompositeCollectionnow returns aPromisethat resolves to the source. This means that you will need toawaitthe result when calling this method:import { Collection } from 'renoun/collections' const posts = new Collection({ filePattern: 'posts/*.mdx', }) export default async function Page({ params }: { params: Promise<{ slug: string }> }) { -- const post = posts.getSource(params.slug) ++ const post = await posts.getSource(params.slug) if (!post) { return <div>Post not found</div> } const Content = await post.getExport('default').getValue() return <Content /> }
Minor Changes
-
b2ba1e4: Adds
renoun/serverexport for more control of running the WebSocket server. For example, in Next.js this can be used with theinstrumentation.tsfile:import { createServer } from 'renoun/server' export async function register() { if ( process.env.NODE_ENV === 'development' && process.env.NEXT_RUNTIME === 'nodejs' ) { createServer() } }
Patch Changes
-
359e5e7: Fixes
APIReferencecomponent not allowingFileSystemSource. - ef4448e: Fixes client and server collections getting out of sync causing an error when resolving types from updated files.
- 7020585: Updates all dependencies to latest version.
-
Updated dependencies [7020585]
- @renoun/mdx@1.2.1
6.1.0
Minor Changes
- cd963a0: Marks pseudo-private methods in collection classes as these are not meant to be used publicly and will not adhere to semver.
-
7642f56: Filters out private class members that start with
#or_when using<Export>.getType().
Patch Changes
-
72a2e98: Fixes specifying a
languagefor inline MDX code. - eca091b: Fixes constraint text in generated generics text.
- 6753e12: Waits for any active refreshing source files before resolving types.
-
9ac5434: Fixes bug in
CodeBlockwhen targeting renoun filenames. TheCodeBlocksource files now use a unique identifier that does not clash with renoun exports. - 619abd9: Fixes class type resolution not accounting for filter and file dependencies.
-
Updated dependencies [72a2e98]
- @renoun/mdx@1.2.0
6.0.0
Major Changes
-
0e6279a: Removes the deprecated
collectionfunction.Breaking Changes
Thecollectionfunction has been removed. You can now use theCollectionclass directly to create a collection:import { Collection } from 'renoun/collections' const posts = new Collection({ filePattern: 'posts/*.mdx', })
Minor Changes
-
ebdfb16: Adds
getFileSystemPathmethod toFileSystemSourceandExportSourceto allow getting types for a file inAPIReference. -
489960a: Adds the ability to specify the set of languages loaded for syntax highlighting using the
languagesfield in therenoun.jsonconfiguration file. This allows you to reduce the bundle size by only loading the languages you need:{ "languages": ["sh", "ts", "tsx"] } -
ed8fb6a: Adds support for formatting the
CodeBlockcomponent source text usingprettierif it is available to the workspace.
Patch Changes
-
cab837b: Fixes issue with trying to format dynamic imports added to collections from CLI causing issues with linters. Now, formatting will only occur if the workspace has access to
prettier.
5.5.0
Minor Changes
-
555815e: Adds a cache to the
<ExportSource>.getTypemethod to prevent unnecessary processing of types since this is an expensive operation. Types will now only be resolved the first time they are requested and then cached for subsequent requests unless one of the file dependencies has changed.
Patch Changes
- c8760f7: Runs initial script to write collections in parallel when starting the dev server. This needed to run synchronously in a previous implementation.
- d6c374b: Handles CLI sub-process clean up better if an error in the WebSocket server occurs.
5.4.0
Minor Changes
- f37e6e1: Adds support for analyzing generic parameters.
- 09e4efd: Adds initial support for analyzing class member decorators.
Patch Changes
-
72697ee: Makes sure to update
Collectionnew expressions with the related dynamic import. - 00d64e2: Improves errors that can occur during type resolution.
- 9c86e10: Fixes collection exports generic parameter to not be overconstrained.
5.3.0
Minor Changes
-
6a74c71: Deprecates the
collectionutility in favor of using theCollectionclass directly:-- import { collection } from 'renoun/collections' ++ import { Collection } from 'renoun/collections' -- export const PostsCollection = collection({ ++ export const PostsCollection = new Collection({ filePattern: 'posts/*.mdx', baseDirectory: 'posts', basePath: 'posts', }) -
ad250de: Introduces a new
CompositeCollectionclass. This allows grouping a set of collections to treat them as a single collection:
When getting a source from a composite collection, theimport { Collection, CompositeCollection } from 'renoun/collections' const CollectionsCollection = new Collection({ filePattern: 'src/collections/index.tsx', baseDirectory: 'collections', }) const ComponentsCollection = new Collection({ filePattern: 'src/components/**/*.{ts,tsx}', baseDirectory: 'components', }) const AllCollections = new CompositeCollection( CollectionsCollection, ComponentsCollection )<FileSystemSource>.getSiblingsmethod will account for all collections in the composite collection:
A newconst source = AllCollections.getSource('collections/index')! const [previousSource, nextSource] = await source.getSiblings()<Collection>.hasSourcetype guard is also available to help constrain the type of the source when working with composite collections:if (ComponentsCollection.hasSource(nextSource)) { // nextSource is now typed as a ComponentsCollection source } -
f499a2b: Adds support to
<ExportSource>.getType()for capturing API references that use index types. -
8822ce6: Adds an initial highlight animation of all symbols when the pointer enters the
CodeBlock. -
fc1e9a6: Adds support for passing a file path to the
APIReference.sourceprop:import { APIReference } from 'renoun/components' export function FilePath() { return ( <APIReference source="./GitProvider.tsx" workingDirectory={import.meta.url} /> ) }
Patch Changes
-
53ad975: Moves image mask to code element when using
CodeBlock.focusedLinesprop to prevent dimming the border and copy button. - c35be54: Fixes CLI errors not bubbling correctly during local development.
-
508d086: This update resolves several issues with API references, particularly recursion bugs in the internal
resolveTypeutility. The key changes involve an updated algorithm for computing component types, which affects the following case:- Named functions with a capitalized first letter and a single non-object argument are now interpreted as components when they should be functions. This is an unintended behavior change and will be corrected in an upcoming update.
Type References
Type references are now split into two maps that serve the following use cases:- Prevent Infinite Recursion : A map of type references is maintained during type iteration of the root type to prevent infinite recursion.
-
Optimized Type Handling for Exported Declarations
:
- Adds an explicit map for tracking exported declarations to avoid type duplication.
- Improves performance and establishes a link between types.
-
a8b77df: Updates
renoun/assetswith the latest logos. -
fc2cc02: Allows
CodeInlineto stretch by anchoring theCopyButtonto the end. -
2e75254: Adds better error messaging with actions to take when
CodeBlockorCodeInlinehas diagnostic errors.
5.2.0
Minor Changes
-
6fc89d2: Adds
filterprop toAPIReferencecomponent. - d6cdba2: Adds declaration file path to symbol metadata for use when filtering API references.
Patch Changes
- a753254: Fixes filtered types being treated as reference types when generating API references.
5.1.0
Minor Changes
-
7b6dc4a: Moves type reference resolution to the
renouncli process. This offers a few benefits:-
Faster page loads in development where the
APIReferencecomponent is used since it now utilizes aSuspenseboundary - Cross-references between types are now supported which will allow linking type references across pages
-
Faster page loads in development where the
Patch Changes
-
6b321e3: Fixes excessive
CodeBlockvertical scroll area on mobile Safari. - dd1db4c: Improve readability for WebSocket params in error messages.
- ca95e54: Adds named functions to web socket methods for better debuggability.
5.0.0
Major Changes
-
1c4c390: Moves
MDXContentandMDXComponentstype exports to@renoun/mdxpackage. -
5fa1a9e: Renames
createCollectiontocollection.Breaking Changes
Replace all instances ofcreateCollectionwithcollection:-import { createCollection } from 'renoun/collections' +import { collection } from 'renoun/collections' -const PostsCollection = createCollection({ +const PostsCollection = collection({ filePattern: 'posts/*.mdx', }) -
f5ecc15: Removes
getDefaultExportandgetNamedExportfrom collection export sources in favor of a newgetExportmethod. This method works exactly the same as the previousgetNamedExportmethod with the addition of acceptingdefaultas an export. This simplifies the API and reduces the number of methods needed to query an export source.Breaking Changes
Update any usage ofgetDefaultExportandgetNamedExportto use the newgetExportmethod:-
getDefaultExport()->getExport('default') -
getNamedExport('metadata')->getExport('metadata')
-
Minor Changes
-
5cdff4d: Adds
@renoun/mdxto corerenounpackage as arenoun/mdxexport. The@renoun/mdxpackage was initially split off to make maintenance easier. Since renoun is catering to content authoring, the MDX features should be as easy as possible to use.
Patch Changes
- 482e1e4: Fixes fast refresh when using a custom JSX pragma.
- 78080ed: Fixes fast refresh for collections targeting files outside of workspace.
- abca1f8: Fixes package manager tab panel layout shift on page load.
-
7e58c6d: Adds better error handling to internal CLI
WebSocketClient. - 5da3781: Fixes watch command running during deployments.
- Updated dependencies [1c4c390]
-
Updated dependencies [b9d52a3]
- @renoun/mdx@1.1.0
4.3.0
Minor Changes
-
ff7665e: Moves import map generation from the
.renoundirectory to the second argument of thecreateCollectioncall expression. This will automatically be updated to the newfilePatternargument and generate the import getter for each collection:
This reduces a lot of boilerplate and configuration. Previously, theimport { createCollection } from 'renoun/collections' export const DocsCollection = createCollection( { filePattern: 'docs/**/*.mdx', baseDirectory: 'docs', basePath: 'docs', }, (slug) => import(`docs/${slug}.mdx`) ).renoundirectory needed to be generated, added to.gitignore, and then the server needed to be restarted after the first initialization. Now, import maps are colocated with their respective collection configuration. -
a484f7e: Adds support for Vite by utilizing the package.json
importsfield when the workspace is a module.
Patch Changes
-
2f4837b: Prevents error when tsconfig
excludefield is not defined. -
d49606d: Adds
baseUrlfield if it does not exist when code-modding tsconfig to add the path alias. -
46e463f: Fixes
PackageInstallcomponent warning showing when not being used. -
8621338: Uses CJS compatible imports to fix bundlers like Vite that will end up with
undefinedimports.
4.2.0
Minor Changes
-
2d64da1: Adds a
PackageInstallcomponent for displaying a list of package manager install commands that can be copied.
Patch Changes
-
2ad1db1: Removes unused
createCollectiontitleandlabeloptions. - 779df0a: Adds better error when trying to create a collection within a route group file pattern that needs to be escaped properly.
-
170d382: Fixes error when collection
baseDirectorydoes not have any additional segments after normalizing file paths.
4.1.0
Minor Changes
-
9f6c0f2: Moves config from
.renoun/config.jsontorenoun.json. See configuration docs for more information. -
1a71061: Moves
renounpackage to ESM only. To upgrade in Next.js projects, modify thenext.config.jsfile to include the following in the webpackextensionAliasconfiguration:export default { webpack(config) { config.resolve.extensionAlias = { '.js': ['.ts', '.tsx', '.js'], } // ... return config }, } -
3c78b3e: Adds the ability to filter export sources when creating a collection:
import { createCollection, isFileSystemSource, isExportSource, } from 'renoun/collections' export const ComponentsCollection = createCollection< Record<string, React.ComponentType> >('src/components/**/*.{ts,tsx}', { baseDirectory: 'components', basePath: 'components', filter: (source) => { if (isFileSystemSource(source)) { if (source.isFile()) { const allInternal = source .getExports() .every((exportSource) => exportSource.getTags()?.every((tag) => tag.tagName === 'internal') ) if (allInternal) { return false } } } if (isExportSource(source)) { if (source.getTags()?.find((tag) => tag.tagName === 'internal')) { return false } } return true }, })
Patch Changes
-
aaf965c: Collections now respect the tsconfig
ignorefield if defined and will filter out sources that should be ignored. - e40258a: Fixes large font sizes on mobile devices. See this article for more info.
- bf684ca: Fixes svg warning for logo asset.
-
af07785: Uses css container padding for
CodeBlockinternal padding if defined. -
d207ecc: Fixes
CodeBlockhighlightedLinesregression. - cb3843c: Fixes suspense fallback layout shift during local development.
-
700969a: Normalizes custom
CodeBlockpadding values to offsetCopyButtoncorrectly.
4.0.0
Major Changes
-
8e1a7e1: Renames the package from
omnidoctorenoun.
3.2.1
Patch Changes
- 677d117: Clean up formatting for source export errors.
- 830724b: Prevents exiting the process in development when the collection does not target valid directories or source files to allow fixing without restarting the server.
3.2.0
Minor Changes
-
c017f16: Adds
@renoun/mdxpackage that includes pre-configured and customremarkandrehypeplugins. -
a2f85cb: Adds
filteroption tocreateCollectionfor filtering by specific file system sources.
Patch Changes
- 8267207: Adds better error handling when trying to update the project based on a file system change.
3.1.1
Patch Changes
- 622c1c4: Use newer version of pnpm to fix catalog on publish.
3.1.0
Minor Changes
-
4c29cdc: Removes
getTitlemethod for collection source. -
9b4fe41: Adds
getTagsmethod to collection export source that returns the relative JS Doc tags if they exist.
Patch Changes
- ac6ce1c: Always clean up sub-process in close event when using cli.
-
365a2c3: The
getTextmethod for a collection export source now includes the full context of everything used within the export. - 1b6d65a: Adds better title parsing for file system and export source names.
-
43e379c: Adds
.gitto default ignored list for projects. -
1a4888b: Removes the
sourcePathprop from theCodeBlockcomponent which was previously only used with the MDX plugins and Webpack loader. -
0b00c1a: Fixes
getEditPathnot trimming the working directory in production.
3.0.1
Patch Changes
-
d964f0f: Fixes
getRootDirectorynot accounting for non-monorepos and returns the first directory where apackage.jsonfile was found. -
d50ff0d: Reverts
fixMissingImportsas it is causing incorrect imports to be added.
3.0.0
Major Changes
-
eb8d77e: Renames the package from
mdxtstorenoun.
2.0.1
Patch Changes
-
39be366: Fixes
MDXContentcomponent causing_jsx is not a functionduring development. -
5504a76: Replaces
@manypkg/find-rootwith simplified utility for getting the root directory. -
b7b664c: Adds
allowErrorsprop toCodeInline. - 31e00c5: Trims empty export from copy value.
-
08d47ec: Fix imports in
CodeBlockto capture correct types.
2.0.0
Major Changes
-
98c68a3: Removes
mdxts/nextpackage export. This is an effort to simplify the core package and reduce the number of dependencies. This functionality will be available in a separate package in the future.Breaking Changes
If using Next.js, this is a breaking change for users who are importingmdxts/nextdirectly. The following configuration can be used to enable MDX support and silence warnings from thets-morphdependency:
Then add or update theimport createMDXPlugin from '@next/mdx' import remarkFrontmatter from 'remark-frontmatter' import remarkMdxFrontmatter from 'remark-mdx-frontmatter' import webpack from 'webpack' const withMDX = createMDXPlugin({ extension: /\.mdx?$/, options: { remarkPlugins: [remarkFrontmatter, remarkMdxFrontmatter], }, }) export default withMDX({ pageExtensions: ['js', 'jsx', 'ts', 'tsx', 'md', 'mdx'], webpack(config) { config.plugins.push( new webpack.ContextReplacementPlugin( /\/(@ts-morph\/common)\//, (data) => { for (const dependency of data.dependencies) { delete dependency.critical } return data } ) ) return config }, })mdx-components.tsxfile in the root of the project to set up the code components:import { MDXComponents } from 'mdx/types' import { CodeBlock, CodeInline } from 'mdxts/components' export function useMDXComponents() { return { code: (props) => { return ( <CodeInline value={props.children as string} language="typescript" /> ) }, pre: (props) => { const { value, language } = CodeBlock.parsePreProps(props) return <CodeBlock allowErrors value={value} language={language} /> }, } satisfies MDXComponents } -
98c68a3: Removes
createSourcein favor of usingcreateCollectionfrommdxts/collections.Breaking Changes
UsecreateCollectionto generate sources:import { createCollection, type FileSystemSource } from 'mdxts/collections' type ComponentSchema = Record<string, React.ComponentType> export type ComponentSource = FileSystemSource<ComponentSchema> export const ComponentsCollection = createCollection<ComponentSchema>( 'src/components/**/*.{ts,tsx}', { baseDirectory: 'components', basePath: 'components', tsConfigFilePath: '../../packages/mdxts/tsconfig.json', } ) -
98c68a3: Removes
Navigationcomponent in favor of usingcreateCollectiondirectly.Breaking Changes
UsecreateCollectionto generate navigations:List Navigation
UsegetSourcesto render a list of the immediate sources in the collection:app/posts/page.tsxexport default async function Page() { return ( <> <h1>All Posts</h1> <ul> {PostsCollection.getSources().map((source) => ( <Post key={source.getPath()} source={source} /> ))} </ul> </> ) }Tree Navigation
Similar to list navigation, we can usegetSourcesrecursively to render a tree of links:app/posts/layout.tsximport { PostsCollection } from '@/collections' export default async function Layout() { return ( <nav> <ul> <TreeNavigation Source={PostsCollection} /> </ul> </nav> ) } async function TreeNavigation({ source }: { source: PostSource }) { const sources = source.getSources({ depth: 1 }) const path = source.getPath() const depth = source.getDepth() const frontmatter = await source.getNamedExport('frontmatter').getValue() if (sources.length === 0) { return ( <li style={{ paddingLeft: `${depth}rem` }}> <Link href={path} style={{ color: 'white' }}> {frontmatter.title} </Link> </li> ) } const childrenSources = sources.map((childSource) => ( <TreeNavigation key={childSource.getPath()} source={childSource} /> )) if (depth > 0) { return ( <li style={{ paddingLeft: `${depth}rem` }}> <Link href={path} style={{ color: 'white' }}> {frontmatter.title} </Link> <ul>{childrenSources}</ul> </li> ) } return <ul>{childrenSources}</ul> }Sibling Navigation
UsegetSiblingsto get the previous and next sources in the collection:app/posts/[slug]/page.tsxexport default async function Page({ params }) { const postSource = Posts.getSource(params.slug) if (!postSource) notFound() const Post = await postSource.getDefaultExport().getValue() const frontmatter = await postSource .getNamedExport('frontmatter') .getValue() const [previous, next] = postSource.getSiblings() return ( <> <h1>{frontmatter.title}</h1> <p>{frontmatter.description}</p> <Post /> {previous ? <Sibling source={previous} direction="previous" /> : null} {next ? <Sibling source={next} direction="next" /> : null} </> ) } function Sibling({ source, direction, }: { source: ReturnType<typeof Posts.getSource> direction: 'previous' | 'next' }) { const frontmatter = await source.getNamedExport('frontmatter').getValue() return ( <a href={source.getPath()}> <span>{direction === 'previous' ? 'Previous' : 'Next'}</span> {frontmatter.title} </a> ) }
Minor Changes
-
98c68a3: Adds remaining configuration options from
next/pluginto JSON config. -
98c68a3: Adds
getSiblingsmethod to collection export source. -
98c68a3: Adds
getTypemethod to collection export source for retrieving type metadata for an export. -
98c68a3: Adds
APIReferencecomponent. This replaces the previousExportedTypescomponent and is used to document the API of module exports using collections:import { APIReference } from 'mdxts/components' import { createCollection } from 'mdxts/collections' const ComponentsCollection = createCollection('components/**/*.{ts,tsx}', { baseDirectory: 'components', basePath: 'components', }) export default function Component({ params }) { return ComponentsCollection.getSource(params.slug) .getExports() .map((exportSource) => ( <APIReference key={exportSource.name} source={exportSource} /> )) } -
98c68a3:
CodeBlocknow tries to parseworkingDirectoryas aURLand gets the pathname directory. This allows usingimport.meta.urldirectly in theworkingDirectoryprop:<CodeBlock source="./counter/useCounter.ts" workingDirectory={import.meta.url} /> -
98c68a3: Adds
getMainExportfor file system source andisMainExportfor export source.
Patch Changes
- 98c68a3: Fixes collection file system source name parsing not accounting for filename segments.
-
98c68a3: Fixes missing bottom padding in
CodeInline. - 98c68a3: Fixes syncing project files during development.
- 98c68a3: Fixes import map generation race condition causing imports to not be found during production builds.
-
98c68a3: Fixes export source
getPathto construct the url path from the file system. -
98c68a3: Defaults collection
getSourceto returnindexsource if it exists. - 98c68a3: Fixes file patterns based on relative tsconfig directory.
-
98c68a3: Fixes duplicate sources returned from collection
getSourcesand file system sourcegetSiblings.
1.8.0
Minor Changes
-
3378b26: Adds support for defining schemas for collections:
import { , type } from 'mdxts/collections' import { } from 'zod' const = .({ : .(), : ..(), : .().(), : .(.()).(), }) export const = <{ : : .<typeof > }>('posts/*.mdx', { : 'posts', : { : ., }, }) -
53bfeb8: Moves all
CodeBlockcomponents to userestyleand exposes acssprop for each component to allow overriding styles.
Patch Changes
- 361b420: Improves error messaging when working with collection utilities.
-
3207ce0: Adds export for
frontmatterfrom MDX files when usingmdx-plugins. -
598bd9c: Fixes
getEditPathfor export source in local development. - 38b7b4b: Fixes caching implementation for shiki highlighter.
- e401fe0: Updates collection import map during development when adding, removing, or editing collections.
-
400384a: Inherit background color in code element in
CodeBlockto prevent global styles leaking in.
1.7.1
Patch Changes
- f7c488d: Fix fast refresh for all component exports.
- b7e68af: Fixes relative collection file patterns and ts config paths causing incorrect import map path generation.
- 0dad0d3: Fixes error when trying to refresh file that hasn’t been loaded into the project yet.
-
4db37c9: Generates
tsfile instead ofjsfile for aliased collection import map.
1.7.0
Minor Changes
-
abe2d84: Add
deprecatedtag tocreateSourcein favor ofcreateCollection. -
71384b3: Generates import map in
.mdxtsdirectory when initially running Next.js plugin. -
9dca168: Remove
CodeBlocksyntax formatting until a better solution can be implemented that doesn’t throw console warnings.
Patch Changes
-
c545243: Updates shiki from deprecated
getHighlightertocreateHighlighter. - b76908a: Fixes missing directory error when removing directory and regenerating the import map.
- 5628c89: Retry connecting to the WebSocket server from the client if it gets disconnected.
- ac4006a: Keeps project files for code blocks in sync with changes to the file system.
- d0a285f: Throw more helpful error if both the cli and Next.js plugin are being used together.
1.6.4
Patch Changes
- b350e9f: Remove unused dependencies and fix rehype types.
- d0ab9a3: Update dependencies.
1.6.3
Patch Changes
-
732799f: Upgrade restyle to
2.0.2. -
4ecd7b5: Adds
getDescriptionmethod to export source. -
e5fc9bf: Adds
isFileandisDirectoryhelper methods to collection source. -
7e461f0: Removes
getPathSegmentsfrom collection in favor of using sourcegetPathSegments.
1.6.2
Patch Changes
-
2ad7cee: Moves to an options object for
getSourcesandgetSiblings.- source.getSources(1); + source.getSources({ depth: 1 }); - source.getSiblings(0); + source.getSiblings({ depth: 0 }); - 6b52578: Uses directory name for collection source if it is an index or readme file.
-
ff66a21: Returns entire variable declaration for
getTextmethod. -
c0d7a2d: Adds
getPathSegmentsto collections. -
699218b: Allow passing
indexorreadmetogetSourcefor collections. -
1db78ec: Renames
getNamedExportstogetExportsto better reflect that the default export is included.
1.6.1
Patch Changes
-
85f528d: Fixes constraint type error when using an interface with
FileSystemSourceorcreateCollection.
1.6.0
Minor Changes
-
252f4c4: This adds an
mdxtscli 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 themdxtsprocess prior to starting the Next.js server simply prepend themdxtscommand:
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": "mdxts next", "build": "mdxts next build" } }{ "scripts": { "dev": "concurrently \"mdxts watch\" \"next\"", "build": "mdxts && next build" } }Collections
This also introduces a newcreateCollectionutility:
Collections will soon replace theimport { 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', } )createSourceutility 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
CodeBlocktype 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
baseDirectoryexists multiple times in thefilePath. Previously having a file path likecontent/content_1/path/file.mdxand usingcontentas base directory results in an invalid pathname likecontent-1path/file. Now we get the correct path name like/content-1/path/file.
1.5.0
Minor Changes
-
35b05bd: Adds
cssprop forCodeInlineto allow merging css styles. -
9457424: Adds
CopyButtonto be used with customCodeBlockcomponents. -
801b9c3: Moves
GitProviderLinkto use css throughrestyleinstead of inline styles.
Patch Changes
-
511d768: Normalizes
CopyButtonforeground 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
CodeBlockinline copy button. -
6a05a2a: Uses activity bar foreground color from theme to color source link and copy button icons in
CodeBlockcomponent. -
16e6f26: Adds better contrast for
CodeBlockinline copy button by adding a stroke based ontheme.panel.border.
1.4.0
Minor Changes
-
5e3a2b8: Adds a
gitProvideroption to themdxts/nextplugin. -
96a02e4: Removes the
fixImportsprop 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 themodulefield intsconfig.json. More info here .
Patch Changes
-
b47d846: Remove browser default
premargin inCodeBlockcomponent. -
7d6cb22: Fixes
getGitFileUrlerroring when nogitSourceis set. -
52de5b1: Fixes theme erroring on missing tokens by adding defaults for every theme token used in
mdxts/components.
1.3.0
Minor Changes
-
d36ef90: Adds a
loadHighlighterLanguageutility for adding custom languages toCodeBlockandCodeInline. -
02b3f80: Adds
RenderedHTMLcomponent for renderingchildrenas 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> ) }
1.2.0
Minor Changes
-
e5b2b81: Renders
CodeBlockandCodeInlinetokens using CSS now through restyle .
Patch Changes
-
a83ed0e: Normalizes
createSourceimport paths to posix for Windows. -
ced3036: Fixes
CodeInlineoverflow breaking from adding display flex. -
d8d5e6e: Adds export for
Copyrightcomponent from top-level exports.
1.1.0
Minor Changes
-
e38535a: Uses
posix.sepand normalizescreateSourceglob patterns. -
301629b: Fixes scrollbars for
CodeInlinecomponents that overflow while also moving inline styles to use restyle . -
ac9118e: Adds
allowCopyprop toCodeInlinefor rendering a persistent copy button. -
3cc2642: Moves
@typespackages from dependencies to dev dependencies to reduce npm install size. These should be included in the projectmdxtsis used in now e.g.npm install @types/react.
Patch Changes
- 1ccb33c: Fixes detection of deeply nested package.json exports.
-
35c4b29: Allows setting the fill color for the
MdxtsLogoandMdxtsMarkcomponents. -
1ff3252: Fixes trimming
CodeBlocksource file comments. -
770c7f5: Sets foreground color for
Toolbaricons inCodeBlock.
1.0.0
Major Changes
- 05d31e7: MDXTS v1 is released! 🎉 Check out the announcement post for more details.
Patch Changes
- 15ffbfb: Configure plain markdown files in addition to mdx files for loader.
-
76ede2b: Treat
diffasplaintextwhen attempting to tokenize. - dfc73a1: Removes code blocks before searching for headings when calculating the data item title to prevent bad heading parsing.
0.19.0
Minor Changes
-
00f6547: Uses a slightly smaller filename font size for the
CodeBlocktoolbar by default. -
87ee6c4: Adds
Copyrightcomponent to render copyright notices. -
8558c3f: Adds
GitProviderLinkandGitProviderLogocomponents to render links and graphics for the configured git provider. -
999446c: Adds MDXTS assets for linking back to the MDXTS site:
import { BuiltWithMdxts } from 'mdxts/assets' export function Footer() { return ( <footer> <BuiltWithMdxts /> </footer> ) } -
b7c7f0d: Removes default vertical padding for
CodeInlinecomponent. -
fcb0a03: Now infers
gitSourceandsiteUrlinmdxts/nextusing Vercel environment variables if available.
Patch Changes
-
9a9d33a: Fixes using the initial value rather than the possibly transformed value in
CodeBlock. - de7bad8: Fixes line numbers highlight styles.
- 759bb79: Fixes interaction when copy button covers code block text by hiding the copy button on the first pointer down until entering the code block area again.
- 2e384bb: Closes symbol popover on pointer down to allow selecting code block text.
- ef4b03a: Fixes unnecessarily rendering token when it is whitespace.
-
308c709: Normalizes
CopyButtonsizes across code components.
0.18.0
Minor Changes
-
b796c3f: Removes
LineHighlightscomponent in favor of simpler CSS approach for highlighting lines. -
cccf278: Renames
CodeBlocklineHighlightsprop tohighlightedLines.Breaking Changes
-
CodeBlocklineHighlightsprop has been renamed tohighlightedLines.
-
-
044d1ca: Renames
CodeBlocktoolbarprop toshowToolbar.Breaking Changes
-
CodeBlocktoolbarprop has been renamed toshowToolbar.
-
-
dfa9384: Fixes
CodeBlockaccessibility and markup by swappingdivs withspans and using acodeelement around tokens. -
564806a: Renames
CodeBlocklineNumbersprop toshowLineNumbers.Breaking Changes
-
CodeBlocklineNumbersprop has been renamed toshowLineNumbers.
-
-
bd646c4: Adds
focusedLinesandunfocusedLinesOpacityprops to theCodeBlockcomponent to control focusing a set of lines and dimming the other lines. It uses an image mask to dim out the lines which can be controlled usingunfocusedLinesOpacity:```tsx focusedLines="3-4" const a = 1 const b = 2 const result = a + b console.log(result) // 3 ```<CodeBlock value={`const a = 1;\nconst b = 2;\n\nconst add = a + b\nconst subtract = a - b`} focusedLines="2, 4" />
Patch Changes
-
a02b1d8: Fixes copy button overlapping
CodeBlockcontent by only showing the button when hovering the code block. The button now also sticks to the top right of the code block when scrolling.
0.17.0
Minor Changes
-
e493fbd: Refines
pathsreturned fromcreateSourceandmergeSources. Based on the glob pattern provided, either a one-dimensional or two-dimensional array of paths will be returned:
Likewise theimport { 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[][]getmethod will be narrowed to only accept a single pathname or an array of pathname segments:allPosts.get('building-a-button-component-in-react') allDocs.get(['examples', 'authoring'])Breaking Changes
-
The
pathsmethod 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
getmethod now only accepts a single pathname or an array of pathname segments.
export function generateStaticParams() { -- return allPosts.paths().map((pathname) => ({ slug: pathname.at(-1) })) ++ return allPosts.paths().map((pathname) => ({ slug: pathname })) } -
The
-
7444586: Now
createSource.getattempts to prepend the incoming pathname withbasePathnameif 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
-
469b021: Enables type-checking for the
CodeBlockcomponent. To opt-out of type-checking, use theallowErrorsprop on the code block:
This will disable type-checking for the code block and prevent erroring. To show the errors, usually for educational purposes, use theconst a = 1 a + bshowErrorsprop:const a = 1 a + b Cannot find name 'b'. (2304)Breaking Changes
CodeBlocknow throws an error if the code block is not valid TypeScript. This is to ensure that all code blocks are type-checked and work as expected. -
bb372a8: Normalizes passing
CodeBlockandCodeInlineprops topreandcodeelements in the rehype plugin. -
0f49ee9: Adds
previousandnextexamples metadata to data source. -
f05b552: Normalizes the internal
getEntrySourceFilesutility that is responsible for determining what TypeScript data sources are public based onpackage.jsonexports, index files, and top-level directories. To determine what source files should be considered public when dealing with package exports,createSourcegets two new options used to remappackage.jsonexports to their original source files:
Using a subset of theimport { createSource } from 'mdxts' const allPackages = createSource('../packages/mdxts/src/**/*.{ts,tsx}', { sourceDirectory: 'src', outputDirectory: 'dist', })mdxtspackage.jsonexports as an example:
These would be remapped to their original source files, filtering out any paths gathered from the{ "exports": { ".": { "types": "./dist/src/index.d.ts", "import": "./dist/src/index.js", "require": "./dist/cjs/index.js" }, "./components": { "types": "./dist/src/components/index.d.ts", "import": "./dist/src/components/index.js", "require": "./dist/cjs/components/index.js" } } }createSourcepattern not explicitly exported:[ "../packages/mdxts/src/index.ts", "../packages/mdxts/src/components/index.ts" ] -
0a4bde2: Moves
CodeBlock:sourcePathto a public prop and addssourcePathto the code meta in the remark plugin. -
9cf1577: Cleans up type errors to be more understandable and adds a configuration to highlight errors in the terminal:
import { createMdxtsPlugin } from 'mdxts' const withMdxtsPlugin = createMdxtsPlugin({ highlightErrors: true }) export default withMdxtsPlugin() -
2af35d0: Converts theme to object syntax and moves colors to top-level:
theme.colors['panel.border']->theme.panel.border -
7726268: Adds a new
sortoption tocreateSource:import { createSource } from 'mdxts' const allPosts = createSource<{ frontMatter: { date: Date } }>('**/*.mdx', { sort: (a, b) => a.frontMatter.date - b.frontMatter.date, }) -
c42eb88: Removes panel border modifications which decreased the alpha channel of the
panel.bordertheme color. This should now be modified in a custom theme. -
2af35d0: Rewrites the
CodeBlockcomponent to use the latest version of shiki as well as allows for better composition using newly exposedTokens,Toolbar,LineNumbers, andLineHighlightscomponents:
Individualimport { getTheme } from 'mdxts' import { CodeBlock, Toolbar, Tokens } from 'mdxts/components' function CodeBlockWithToolbar() { const theme = getTheme() return ( <CodeBlock source="./counter/Counter.tsx"> <div style={{ backgroundColor: theme.background, color: theme.foreground, }} > <Toolbar allowCopy style={{ padding: '0.5rem 1rem' }} /> <pre style={{ whiteSpace: 'pre', wordWrap: 'break-word', overflow: 'auto', }} > <Tokens /> </pre> </div> </CodeBlock> ) }CodeBlockelements can be styled now for simple overriding:<CodeBlock className={{ container: GeistMono.className, }} style={{ container: { fontSize: 'var(--font-size-body-2)', lineHeight: 'var(--line-height-body-2)', padding: '1rem', }, toolbar: { padding: '0.5rem 1rem', }, }} language="tsx" value="..." />Breaking Changes
CodeBlocknow uses a keyedclassNameandstyleobject to allow for more granular control over the styling of theCodeBlockcomponents. To upgrade, move theclassNameandstyledefinitions to target thecontainer:<CodeBlock -- className={GeistMono.className} ++ className={{ container: GeistMono.className }} style={{ ++ container: { padding: '1rem' ++ }, }} -
0b80bf5: Adds a
fixImportsprop toCodeBlockto allow fixing imports when the source code references files outside the project and can’t resolve correctly:
An example of this is when rendering a source file that imports a module from a package that is not in the immediate project. Theimport { CodeBlock } from 'mdxts/components' const source = ` import { Button } from './Button' export function BasicUsage() { return <Button>Click Me</Button> } ` export default function Page() { return <CodeBlock fixImports value={source} /> }fixImportsprop will attempt to fix these broken imports using installed packages if a match is found:--import { Button } from './Button' ++import { Button } from 'design-system' export function BasicUsage() { return <Button>Click Me</Button> } -
2af35d0: Rewrites relative import specifiers pointing outside of the project to use the package name if possible:
import { getTheme } from '../../mdxts/src/components'->import { getTheme } from 'mdxts/components' -
0e2cc45: Adds a
renumberFilenamesoption to the next plugin for configuring whether or not to renumber filenames when adding/removing/modifying ordered content. -
ad8b17f: ### Breaking Changes
The
CodeBlockhighlightprop has been renamed tolineHighlightsto better match theLineHighlightscomponent nomenclature. -
7c5df2f: Fixes data source ordering to use strings instead of
parseIntto ensure that the items are always ordered correctly.Breaking Changes
Theorderproperty for a data source item is now a padded string instead of a number.
Patch Changes
-
8802a57: Fixes hardcoded CSS properties in
Toolbarcopy button by usingemvalues andcurrentColor. -
91e87c4: Renames
getThemeutility togetThemeColors. - 85722e3: Fixes MDX code block meta values with an equals sign from being parsed incorrectly.
-
f21cf8d: Allows omitting
CodeBlockfilename extension and useslanguageif provided. - 2af35d0: Fixes splitting tokens when multiple symbols exist in a single token.
- 58b9bd3: Fixes source links to direct line and column in GitHub.
-
885a6cc: Fixes polluting
CodeBlockglobals by always adding aexport { }declaration to the AST and only removing it from the rendered tokens. - c57b51f: Speeds up build by lazily executing dynamic imports.
0.15.3
Patch Changes
-
31c1dbc: Handle monorepos when checking if git repository in
getGitMetadata.
0.15.2
Patch Changes
-
d3520da: Prevent fatal git error in console by checking for
.gitdirectory ingetGitMetadata.
0.15.1
Patch Changes
-
bf65891: Fixes inferred front matter for
createSource.getmethod. -
94fd7fe: Silence
jjuwarnings used by@manypkg/find-root. - a79d453: Handles nested fields when type checking front matter.
- 635de6c: Bail early if not a git repository to avoid printing git errors when not initialized yet.
0.15.0
Minor Changes
-
435c5e8: Allow overriding
frontMattertype throughcreateSourcegeneric.import { createSource } from 'mdxts' export const allDocs = createSource<{ frontMatter: { title: string description: string date: string tags?: string[] } }>('docs/*.mdx') -
fac626b: Adds front matter type validation using the generic passed to
createSource:import { createSource } from 'mdxts' export const allPosts = createSource<{ frontMatter: { title: string date: Date summary: string tags?: string[] } }>('posts/**/*.mdx', { baseDirectory: 'posts' })Results in the following type error:posts/markdown-guide.mdx--- title: Hello World date: 2021-01-01 --- # Hello World This is a post.Error: Front matter data is incorrect or missing [/posts/markdown-guide.mdx] Type '{}' does not satisfy the expected type 'frontMatter'. Type '{}' is missing the following properties from type 'frontMatter': summary
Patch Changes
-
7327000: Fixes WebSocket error during local development when first loading the page:
InvalidStateError: Failed to execute 'send' on 'WebSocket': Still in CONNECTING state.
0.14.0
Minor Changes
-
32c9686: Removes private
EditorandPreviewcomponents and related dependencies to reduce bundle size. - 6fcd390: Adds initial support for Next.js Turbopack locally.
Patch Changes
-
9feac19: Removes processing MDX files with Webpack loader since it is now handled through remark and
getAllData.
0.13.0
Minor Changes
-
88b9e10: Simplify
MDXContentto not include plugins by default and instead expose newremarkPlugins,rehypePlugins, andbaseUrlprops. -
ad09ddb: Moves
frontMatterfrom Webpack loader to staticgetAllDatautility so front matter metadata is available when using thecreateSource.allmethod. -
b42a275: Removes
ShouldRenderTitletransformation from Webpack loader and now adds it through a remark plugin.
Patch Changes
- e76e18e: Fixes headings getting incremented ids when duplicates do not exist.
0.12.1
Patch Changes
-
f35df99: Fixes the
getGitMetadatautility erroring when running MDXTS in a project that does not have git instantiated. -
fa4d329: Fixes the Webpack loader not updating dynamic imports when the
createSourcefile pattern directory changes. -
d651cd0: Filter empty lines from git log to avoid
getGitMetadataerroring related to #81. - d3fc5ac: Throw more helpful error if MDX code block is empty.
0.12.0
Minor Changes
-
a7bae02: Reformat
createSource.allmethod to return an array instead of an object.const allDocs = createSource('docs/*.mdx') ---Object.values(allDocs.all()).map((doc) => ...) +++allDocs.all().map((doc) => ...) -
7942259: Move source item
gitMetadatato top-level fields.import { MetadataRoute } from 'next' import { allData } from 'data' export default function sitemap(): MetadataRoute.Sitemap { return Object.values(allData.all()).map((data) => ({ url: `https://mdxts.dev/${data.pathname}`, --- lastModified: data.gitMetadata.updatedAt, +++ lastModified: data.updatedAt, })) } - 305d1a4: Throw error if attempting to use git metadata and repo is shallowly cloned.
-
ba37a05: Adds
urlfield to source item that concatenatessiteUrlwithpathname. -
e487e1f: Adds a remark plugin to transform relative ordered links:
--- [./02.rendering.mdx] +++ [./rendering]
Patch Changes
-
fc74fb9: Fixes
CodeBlockallowCopyprop still showing copy button when set tofalse. -
b7da458: Fixes code blocks being transformed when wrapping headings in
ShouldRenderTitle.
0.11.0
Minor Changes
-
90863ba: Adds RSS feed helper for
createSourceandmergeSources:// app/rss.xml/route.js import { allData } from 'data' export async function GET() { const feed = allData.rss({ title: 'MDXTS - The Content & Documentation SDK for React', description: 'Type-safe content and documentation.', copyright: `©${new Date().getFullYear()} @souporserious`, }) return new Response(feed, { headers: { 'Content-Type': 'application/rss+xml', }, }) } -
4121eb9: Replaces
remark-typographywith the more popularremark-smartypantspackage. -
7367b1d: Adds ISO 8601 duration to
readingTimemetadata for easier use withtimeHTML element. -
e04f4f6: Adds
createdAt,updatedAt, andauthorsfields tocreateSourceitem. This implementation is inspired by unified-infer-git-meta . -
9c6d65a: Adds
readingTimefield tocreateSourceitem using rehype-infer-reading-time-meta . - fb0299d: Adds support for Codesandbox embeds in MDX.
Patch Changes
- 6e68e11: Fixes an issue where saving content did not trigger a fast refresh locally. This adds a web socket server component to the Content component to ensure a refresh is always triggered.
-
fafdcc6: Adds default
feedLinks.rssoption when creating rss feeds. -
df41a98: Fixes empty
createSourcewhen targeting JavaScript/TypeScript without anindexfile.
0.10.1
Patch Changes
-
d16f84d: Reverts 06e5c20 which merged default
MDXComponentsintoMDXContentcomponents as it causes an infinite loop.
0.10.0
Minor Changes
-
2b60fa0: Add same
remarkandrehypeplugins used inmdxts/nexttoMDXContentcomponent. -
06e5c20: Merge default
MDXComponentsintoMDXContentcomponents. -
2bf8b02: Allow passing a language to inline code in MDX like
js const a = '1'.
Patch Changes
- ae3d6a3: Fix metadata analysis to account for MDX syntax.
- 1b2b057: Fix example names not being parsed as a title.
-
4b9314c: Fix missing theme for
MDXContentin examples.
0.9.1
Patch Changes
- 29a923d: Fixes heading level one not being rendered as markdown.
- 16eabd2: Fix remark plugins not being initialized correctly.
- 05106f3: Merge data title into metadata if not explicitly defined.
0.9.0
Minor Changes
-
16031d0: Adds a
renderTitleprop to theContentcomponent returned fromcreateSourceto allow overriding the default title for an MDX file. -
5707439: Add
classNameandstyletoCopyButton. -
c673a16: Add
fontSizeandlineHeightprops toCodeBlock. -
849dd1c: Replace
isServerOnlyfield withexecutionEnvironmentthat can be eitherserver,client, orisomorphic. - 87026e9: Only use inferred description from MDX for metadata.
-
78fbfbb: Add separate
PackageStylesAndScriptcomponent forPackageInstallClientstyles and local storage hydration. - 758ab24: Sync package manager state across other component instances and windows.
Patch Changes
-
c753d53: Fix headings below level one getting wrapped with
ShouldRenderTitle. -
ddf8870: Add
namesupport for type aliases, interfaces, and enum declarations. -
000acf3: Fix default
Symbolhighlight color to be a transparent version of the themehoverHighlightBackground. -
71f5545: Fix
isMainExportfield forexportedTypesto correctly interpret which export declaration is the main export based on a matching name. -
65824b9: Fix JavaScript code blocks erroring with
cannot read undefined reading flags, escapedNameby setting ts-morph project config toallowJs.
0.8.2
Patch Changes
-
5fd018d: Use better theme variables that work across various themes for
CodeBlockcomponent. -
50e47bc: Fix
@internalJSDoc tag analysis for variable declarations. -
23e6ab9: Add
workingDirectoryprop through loader ifCodeBlock,CodeInline, orExportedTypesare imported. -
8efe0e0: Clean up
ExportedTypesdeclaration type default value. -
4a5aa29: Add theme container styles to
CodeInline.
0.8.1
Patch Changes
-
57f1e39: Fix
QuickInfofont-family and foreground color styles. - d34d877: Fix multline jsx only code blocks.
- a761181: Fix devtools server action from erroring when using static export.
- c261e18: Allow default MDX components to be overridden at the component level.
-
3a86f90: Move theme configuration to the end of the source in the webpack loader to avoid overwriting
use clientdirectives. - 1963ce6: Fix incorrect jsx-only code block token start/end positions.
0.8.0
Minor Changes
- 69e8dc8: Don’t remove level one heading from content.
Patch Changes
-
9379847: Gracefully handle undefined
gitSourceoption.
0.7.0
Minor Changes
-
19d82bd: Move
gitSourceurl codemod to the CLI and add support for other git providers.
Patch Changes
-
ba56adc: Add try/catch around CodeBlock
createSourceFileas temporary fix when virtual files cannot be created. -
2b1628c: Fixes load order for MDX components to load before the
@mdx-js/reactpackage.`
0.6.2
Patch Changes
-
71f9cc2: Remove
@typescript/atasince it isn’t currently being used and causes package version issues with newer TypeScript versions. -
9a0ed54: Move
prettierandshikito peer dependencies.
0.6.1
Patch Changes
-
577d4b7: Remove public files in
mdxts/nextfor now. These are generated for syntax highlighting and type checking on the client for the unreleasedEditorcomponent.
0.6.0
Minor Changes
- dfea828: Use stable generated filename based on Code value.
-
47c8ee1: Replaces
summaryexport from remark plugin withdescriptionwhich is now used to calculate datadescriptionfield. -
b2d9324: Account for standard
@internalJSDoc tag instead of@privateingetExportedSourceFiles. -
d7ac97a: Pass processed entry declarations to determine implicit internal exports in
getAllData. -
e89116e: Reduces the number of times the shiki highlighter is initialized to prevent
memory access out of boundserrors. -
4303ce5: Add support for
examplesdirectory. -
3fff302: Add default MDX components to
nextplugin forcodeandpreelements. -
f66aaa2: Adds
ExportedTypescomponent for gathering types from a file or source code. - 3a6fe9b: Add support for following index file exports when gathering exported types.
-
8671ff8: Add global timer to
QuickInfofor better hover interactions. -
66edade: Add support for ordered
Codeblocks using a numbered filename prefix. -
57d8a29: Rename
MDXtoMDXContentandmdxComponentstoMDXComponents. -
f66aaa2: Use smaller generated
filenameforCodeBlock. UsingBuffer.from(props.value).toString('base64')was causing anENAMETOOLONGerror. -
e5fe316: Fixes
QuickInfotooltip by keeping it in view and accounting for scroll offset. - 97c0861: Introduces preconfigured examples starting with a blog example.
-
3109b2d: Remove
PackageExportscomponent, this information is accessible from the data returned increateSource. -
b948305: Split up
Codecomponent intoCodeBlockandCodeInlinecomponents. -
cc3b831: Add
styleprop toPackageInstall. -
5c0c635: Account for
@internalJSDoc tag ingetExportedTypes. - 8c13479: Always split highlighter tokens by identifier.
Patch Changes
-
1f3875d: Fix
Symbolhighlighted state when hoveringQuickInfo. -
3dd1cf3: Fix
QuickInfoparagraph color. -
0465092: Fix relative
createSourcepaths by using absolute paths for imports and adding webpack file dependencies. -
204bba5: Use cross-platform file path separator in
Code. -
1f45a78: Fix
QuickInfoerroring when parsing documentation by handling links properly. -
a272add: Fix
CodeBlockfilename label when complex filename. The regex was only accounting for strings that begin with numbers. -
daf9550: Handle all exported declarations in
getExportedTypes. -
eac632c: Add text-wrap pretty to
QuickInfoparagraphs. -
f9d8e48: Compute
Moduletype so quick info is cleaner. - 1fd91d3: Fix metadata erroring when front matter is available.
0.5.0
Minor Changes
- f8b71d6: Implement specific allowed errors.
-
2f1cdbe: Add
toolbarprop toCodefor controlling rendering of toolbar. -
63939ac: Improve
NavigationrenderItemprop types. - 20182d4: Default to common root for now when no exports field found.
-
0d91905: Add
styleprop toCode. -
515d727: Add diagnostic error code in
QuickInfotooltip. - bfc8b40: Add plaintext language option to highlighter.
- b501e32: Add example source text to examples metadata.
-
86c32e3: Rename
getMetadataFromClassName->getClassNameMetadata. - ad4fd02: Use package json path when calculating entry source files.
-
61e72cd: Add
MDXcomponent for rendering mdx source code. -
d77a29a: Use box shadow instead of border in
Codeto prevent adding to layout. - 606c25d: Render quick info documentation text as MDX.
-
50dc93d: Only require working directory in
Codewhen using relative paths. -
79e7e5d: Fix file path to pathname slugs for all caps e.g.
MDX.tsx->mdxandMDXProvider.tsx->mdx-provider. - ffd4512: Add exhaustive type documentation generation accounting for template literal and call expressions.
Patch Changes
- cf73027: Fix navigation order by filtering out private files.
-
5f30ed1: Collapse
Codetoolbar grid row when not used. - a4cc4c3: Fixes code blocks being treated as global scope when no imports or exports are present.
- 2876946: Improve quick info tooltip type wrapping instead of overflowing.
-
e392e3c: Infer
Codelanguage from filename if provided. - 42eea84: Fix parsing directory base name to title.
0.4.1
Patch Changes
-
6c64d70: Throw error when no files found for
createSourcefile pattern.
0.4.0
Minor Changes
- 913fc68: Add Node polyfill plugin for Editor.
-
e3ed63f: Rename
createDataSource->createSourceandmergeDataSources->mergeSources -
4bbb048: Add
allowCopyCodeprop for controlling the rendering of the copy button. - cb95470: Add cli tool to scaffold initial project.
Patch Changes
- 576b808: Fix loading shiki themes.
0.3.0
Minor Changes
- 7b3a555: Fix data source item order not taking directory into account.
-
329ed73: Add
depthproperty to data item. - 3fb551f: Fix hydration issue by rendering spans instead of divs.
- 3e7e3a4: Use a root relative pathname as the data key.
-
445c961: Link to the first immediate page with data in
treeutility. -
038ac17: Add
mergeDataSourcesfunction to merge multiple sources returned fromcreateDataSource. - c17d469: Fix previous/next sort order.
-
df9c8ee: Adds a
getExamplehelper attached to the data source. - 10d66a4: Add support for examples extension.
- 3d4105a: Add pathname and slug to example items.
-
e4a68eb: Pass
workingDirectoryto Code component used in examples.
Patch Changes
- 6fe9356: Fix type table of contents slug.
- e15d50e: Expand type documentation if it is not publicly linkable.
-
53cbf75: Fix
createDataSourceloader transform not working when other imports are present. - 500d3ca: Remove leading numbers from title generated from filename.
- 66b8629: Fix camel case filename to pathname conversion.
0.2.0
Minor Changes
-
070c2f2: Partial rewrite to remove the
bundlepackage in favor of the framework’s bundler.
Patch Changes
- 353140d: Add Editor based on starry-night highlighter.
- cc81cfb: Add remark-typography plugin.
- 27366fd: Replace starry-night with shiki.
- d435839: Adds initial format handling using dprint-node on the server and prettier on the client. The different formatters is required until prettier works with Server Components.
0.1.5
Patch Changes
- 27fa51d: Use config theme for shiki highlighting.
- e4ba8ba: Initial Editor component.
- 3d536d7: Transform code when JavaScript or TypeScript code block.
- 33f93b9: Fix multiple watchers being created.
- a63b352: Better error message for meta props transform.
- f0ca3b7: Load theme through next config.
- 0a5de46: Fix meta props.
0.1.4
Patch Changes
- 4ee1325: Map meta string to props.
0.1.3
Patch Changes
- ac2703b: Initial Example component implementation.
- 6aeba9c: Fix symbolic links transform cutting off content.
-
32ac2bb: Change
getExamplesFromDirectorysignature to accept a directory. - e86ce2b: Remove @mdx-js/react and ts-morph peer dependencies.
0.1.2
Patch Changes
- ae87fdc: Fix bundling JavaScript/TypeScript files.
- ae87fdc: Render index pages.
- a5ef955: Add data from source files automatically and make loader optional.
-
ae87fdc: Pass
Projectto loader. - 714df88: Ignore build files in watcher.
0.1.1
Patch Changes
- a37c08e: Fix types
0.1.0
Minor Changes
- 56fca96: Initial release