Skip to content

Commit e38b0e9

Browse files
committed
refactor: export Rolldown
1 parent 8f997ee commit e38b0e9

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed

docs/.vitepress/config/theme.ts

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,15 @@ function getTypedocSidebar() {
2222
}
2323

2424
const typedocSidebar = getTypedocSidebar()
25+
const rolldownSidebar: { items: DefaultTheme.SidebarItem[]; base: string } = {
26+
items: typedocSidebar[0]
27+
.items![0].items!.filter(
28+
(item) => item.text === 'Interfaces' || item.text === 'Type Aliases',
29+
)!
30+
.flatMap((item) => item.items!)
31+
.toSorted((a, b) => a.text!.localeCompare(b.text!)),
32+
base: '/reference',
33+
}
2534

2635
export function getLocaleConfig(lang: string) {
2736
const t = createTranslate(lang)
@@ -131,9 +140,13 @@ export function getLocaleConfig(lang: string) {
131140
},
132141
{
133142
text: t('Type Definitions'),
134-
items: typedocSidebar
135-
.flatMap((i) => i.items!)
136-
.filter((i) => i.text !== 'Options'),
143+
items: [
144+
{ text: 'Rolldown', link: '/api/rolldown.md' },
145+
...typedocSidebar
146+
.flatMap((i) => i.items!)
147+
.filter((i) => i.text !== 'Options' && i.text !== 'rolldown')
148+
.toSorted((a, b) => a.text!.localeCompare(b.text!)),
149+
],
137150
collapsed: true,
138151
},
139152
],
@@ -143,7 +156,10 @@ export function getLocaleConfig(lang: string) {
143156
const themeConfig: DefaultTheme.Config = {
144157
logo: { src: '/tsdown.svg', width: 24, height: 24 },
145158
nav,
146-
sidebar,
159+
sidebar: {
160+
'/reference/api/rolldown': rolldownSidebar,
161+
'/': sidebar,
162+
},
147163
outline: 'deep',
148164
socialLinks: [
149165
{ icon: 'github', link: 'https://github.com/rolldown/tsdown' },

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,3 +298,4 @@ export const shimFile: string = path.resolve(pkgRoot, 'esm-shims.js')
298298
export { defineConfig } from './config.ts'
299299
export * from './config/types.ts'
300300
export { globalLogger, type Logger } from './utils/logger.ts'
301+
export * as Rolldown from 'rolldown'

0 commit comments

Comments
 (0)