Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/smooth-bobcats-admire.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@alauda/doom": patch
---

feat: support exporting APIs documents manually
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ jobs:
strategy:
matrix:
node:
- 20
# https://github.com/web-infra-dev/rspress/pull/2923
# - 20
- 22
- 24
os:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"@changesets/cli": "^2.29.8",
"@eslint/js": "^9.39.2",
"@swc-node/register": "^1.11.1",
"@swc/core": "^1.15.4",
"@swc/core": "^1.15.7",
"@types/cli-progress": "^3.11.6",
"@types/ejs": "^3.1.5",
"@types/mdast": "^4.0.4",
Expand Down
15 changes: 7 additions & 8 deletions packages/doom/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,17 @@
"dependencies": {
"@alauda/doom-export": "^0.3.1",
"@cspell/eslint-plugin": "^9.4.0",
"@eslint-react/eslint-plugin": "^2.3.13",
"@eslint-react/eslint-plugin": "^2.4.0",
"@inquirer/prompts": "^8.1.0",
"@openapi-contrib/openapi-schema-to-json-schema": "^5.1.0",
"@rsbuild/plugin-react": "^1.4.2",
"@rsbuild/plugin-sass": "^1.4.0",
"@rsbuild/plugin-svgr": "^1.2.3",
"@rsbuild/plugin-yaml": "^1.0.3",
"@rspress/core": "2.0.0-rc.2",
"@rspress/plugin-algolia": "2.0.0-rc.2",
"@rspress/plugin-llms": "2.0.0-rc.2",
"@rspress/plugin-sitemap": "2.0.0-rc.2",
"@rspress/shared": "2.0.0-rc.2",
"@rspress/core": "2.0.0-rc.3",
"@rspress/plugin-algolia": "2.0.0-rc.3",
"@rspress/plugin-sitemap": "2.0.0-rc.3",
"@rspress/shared": "2.0.0-rc.3",
"@shikijs/transformers": "^3.20.0",
"@total-typescript/ts-reset": "^0.6.1",
"@types/react": "^19.2.7",
Expand All @@ -74,7 +73,7 @@
"mdast-util-to-markdown": "^2.1.2",
"mdast-util-to-string": "^4.0.0",
"mermaid": "^11.12.2",
"openai": "^6.10.0",
"openai": "^6.15.0",
"openapi-types": "^12.1.3",
"p-ratelimit": "^1.0.1",
"picomatch": "^4.0.3",
Expand Down Expand Up @@ -102,7 +101,7 @@
"tinyglobby": "^0.2.15",
"type-fest": "^5.3.1",
"typescript": "^5.9.3",
"typescript-eslint": "^8.49.0",
"typescript-eslint": "^8.50.1",
"unified": "^11.0.5",
"unified-lint-rule": "^3.0.1",
"unist-util-position": "^5.0.0",
Expand Down
5 changes: 1 addition & 4 deletions packages/doom/src/cli/load-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { pluginSvgr } from '@rsbuild/plugin-svgr'
import { pluginYaml } from '@rsbuild/plugin-yaml'
import { logger, type UserConfig } from '@rspress/core'
import { pluginAlgolia } from '@rspress/plugin-algolia'
import { pluginLlms } from '@rspress/plugin-llms'
import { pluginSitemap } from '@rspress/plugin-sitemap'
import {
addLeadingSlash,
Expand Down Expand Up @@ -276,7 +275,6 @@ const getCommonConfig = async ({
},
plugins: [
algoliaOptions && pluginAlgolia(),
pluginLlms(),
siteUrl &&
config.siteUrl &&
pluginSitemap({
Expand Down Expand Up @@ -353,8 +351,7 @@ const getCommonConfig = async ({
ssg: {
experimentalWorker: true,
},
// https://github.com/web-infra-dev/rspress/issues/2894
// llms: true,
llms: true,
}
}

Expand Down
1 change: 1 addition & 0 deletions packages/doom/src/global/SiteOverrides/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export const SiteOverrides = () => {
pageType,
// Inject by remark-plugin-toc
title: articleTitle,
// eslint-disable-next-line @typescript-eslint/no-useless-default-assignment
frontmatter = {},
} = page

Expand Down
7 changes: 6 additions & 1 deletion packages/doom/src/plugins/auto-sidebar/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,12 @@ export const autoSidebar = async (
const exclude = (route.exclude ??= [])
exclude.push(...excludeRoutes)
// only exclude apis routes for sidebar but not site data to avoid dead links
if (export_) {
if (
export_ &&
!onlyIncludeRoutes.some(
(route) => route.startsWith('apis/') || route.startsWith('*/apis/'),
)
) {
excludeRoutes.push(...APIS_ROUTES)
}
}
Expand Down
1 change: 1 addition & 0 deletions packages/doom/src/plugins/auto-sidebar/walk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ export async function scanSideMeta(
}

const {
// eslint-disable-next-line @typescript-eslint/no-useless-default-assignment
type = 'file',
name,
label = '',
Expand Down
10 changes: 8 additions & 2 deletions packages/doom/src/plugins/global/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,18 @@ export const globalPlugin = ({
}
},
addPages(config) {
const loginPath = baseResolve('login')
let loginPath: string
for (const ext of ['.js', '.tsx']) {
loginPath = baseResolve(`login/index${ext}`)
if (fs.existsSync(loginPath)) {
break
}
}
if ((config.themeConfig?.locales?.length ?? 0) < 1) {
return [
{
routePath: '/login',
filepath: loginPath,
filepath: loginPath!,
},
]
}
Expand Down
2 changes: 0 additions & 2 deletions packages/doom/styles/global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,6 @@ td {

&-doc-layout__doc-container {
padding: 0;
// https://github.com/web-infra-dev/rspress/issues/2909
min-height: unset;
}

&-toc-item--active .rp-toc-item__text {
Expand Down
Loading
Loading