@alauda/doom 1.9.1 → 1.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cli/export.js +2 -2
- package/lib/cli/index.js +1 -1
- package/lib/cli/lint.js +1 -1
- package/lib/cli/load-config.d.ts +1 -1
- package/lib/cli/load-config.js +2 -7
- package/lib/cli/translate.js +1 -1
- package/lib/config.d.ts +1 -1
- package/lib/global/SiteOverrides/index.js +1 -1
- package/lib/global/VersionsNav/NavMenuGroup.js +1 -1
- package/lib/global/VersionsNav/NavMenuSingleItem.js +1 -1
- package/lib/global/VersionsNav/index.js +1 -1
- package/lib/plugins/api/index.d.ts +1 -1
- package/lib/plugins/attributes/index.d.ts +2 -2
- package/lib/plugins/auto-sidebar/index.d.ts +1 -1
- package/lib/plugins/auto-sidebar/index.js +1 -1
- package/lib/plugins/auto-sidebar/utils.js +1 -1
- package/lib/plugins/auto-sidebar/walk.js +1 -1
- package/lib/plugins/auto-toc/index.d.ts +1 -1
- package/lib/plugins/directives/index.d.ts +2 -2
- package/lib/plugins/global/index.d.ts +1 -1
- package/lib/plugins/global/index.js +1 -1
- package/lib/plugins/mermaid/index.d.ts +2 -2
- package/lib/plugins/permission/index.d.ts +1 -1
- package/lib/plugins/replace/index.d.ts +1 -1
- package/lib/plugins/replace/index.js +1 -1
- package/lib/plugins/replace/normalize-img-src.js +1 -1
- package/lib/plugins/replace/rehype-normalize-link.js +1 -1
- package/lib/plugins/replace/remark-replace.js +2 -2
- package/lib/plugins/replace/resolve-reference.js +2 -2
- package/lib/plugins/replace/resolve-release.js +1 -1
- package/lib/plugins/replace/utils.js +1 -1
- package/lib/plugins/sitemap/index.js +1 -1
- package/lib/runtime/components/Badge.d.ts +1 -1
- package/lib/runtime/components/Badge.js +1 -1
- package/lib/runtime/components/Card.d.ts +1 -1
- package/lib/runtime/components/Card.js +1 -1
- package/lib/runtime/components/ExternalSiteLink.js +1 -1
- package/lib/runtime/components/JsonViewer.js +1 -1
- package/lib/runtime/components/K8sCrd.js +1 -1
- package/lib/runtime/components/K8sPermissionTable.js +1 -1
- package/lib/runtime/components/LinkCard.d.ts +1 -1
- package/lib/runtime/components/LinkCard.js +1 -1
- package/lib/runtime/components/Mermaid.js +1 -1
- package/lib/runtime/components/OpenAPIPath.js +2 -2
- package/lib/runtime/components/OpenAPIRef.js +1 -1
- package/lib/runtime/components/Overview.js +1 -1
- package/lib/runtime/components/PackageManagerTabs.d.ts +1 -1
- package/lib/runtime/components/PackageManagerTabs.js +1 -1
- package/lib/runtime/components/Steps.d.ts +1 -1
- package/lib/runtime/components/Steps.js +1 -1
- package/lib/runtime/components/Tab.d.ts +1 -1
- package/lib/runtime/components/Tab.js +1 -1
- package/lib/runtime/components/Tabs.d.ts +1 -1
- package/lib/runtime/components/Tabs.js +1 -1
- package/lib/runtime/components/Toc.d.ts +1 -1
- package/lib/runtime/components/Toc.js +1 -1
- package/lib/runtime/components/_ExternalSiteBase.js +1 -1
- package/lib/runtime/components/_X.js +1 -1
- package/lib/runtime/components/_utils.js +2 -8
- package/lib/runtime/hooks/useSiteOverrides.js +4 -5
- package/lib/runtime/hooks/useTranslation.js +1 -1
- package/lib/theme.d.ts +1 -1
- package/lib/theme.js +3 -3
- package/lib/types.d.ts +1 -1
- package/lib/utils/git.js +1 -1
- package/package.json +15 -14
package/lib/cli/export.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import fs from 'node:fs/promises';
|
|
2
2
|
import path from 'node:path';
|
|
3
|
-
import { removeLeadingSlash
|
|
4
|
-
import { logger } from '@rspress/shared/logger';
|
|
3
|
+
import { removeLeadingSlash } from '@rspress/shared';
|
|
5
4
|
import { Command } from 'commander';
|
|
5
|
+
import { logger, serve } from 'rspress/core';
|
|
6
6
|
import { cyan, yellow } from 'yoctocolors';
|
|
7
7
|
import { autoSidebar, } from '../plugins/index.js';
|
|
8
8
|
import { getPdfName } from '../shared/index.js';
|
package/lib/cli/index.js
CHANGED
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
import module from 'node:module';
|
|
6
6
|
import path from 'node:path';
|
|
7
7
|
import { logger } from '@rsbuild/core';
|
|
8
|
-
import { build, dev, serve } from '@rspress/core';
|
|
9
8
|
import { watch } from 'chokidar';
|
|
10
9
|
import { program } from 'commander';
|
|
10
|
+
import { build, dev, serve } from 'rspress/core';
|
|
11
11
|
import { green } from 'yoctocolors';
|
|
12
12
|
import { setNodeEnv } from '../utils/index.js';
|
|
13
13
|
import { CWD, DEFAULT_CONFIGS, SITES_FILE } from './constants.js';
|
package/lib/cli/lint.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
|
-
import { logger } from '@rspress/shared/logger';
|
|
3
2
|
import { Command } from 'commander';
|
|
4
3
|
import { ESLint } from 'eslint';
|
|
4
|
+
import { logger } from 'rspress/core';
|
|
5
5
|
import { cyan } from 'yoctocolors';
|
|
6
6
|
import doom from '../eslint.js';
|
|
7
7
|
import { loadConfig } from './load-config.js';
|
package/lib/cli/load-config.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type UserConfig } from '@rspress/
|
|
1
|
+
import { type UserConfig } from '@rspress/shared';
|
|
2
2
|
import type { GlobalCliOptions } from '../types.js';
|
|
3
3
|
export declare function loadConfig(root?: string | URL, { config: configFile, base, prefix, v: version, download, export: export_, ignore, force, open, lazy, include, exclude, outDir, redirect, editRepo, algolia, siteUrl, }?: GlobalCliOptions): Promise<{
|
|
4
4
|
config: UserConfig;
|
package/lib/cli/load-config.js
CHANGED
|
@@ -5,12 +5,12 @@ import { pluginReact } from '@rsbuild/plugin-react';
|
|
|
5
5
|
import { pluginSass } from '@rsbuild/plugin-sass';
|
|
6
6
|
import { pluginSvgr } from '@rsbuild/plugin-svgr';
|
|
7
7
|
import { pluginYaml } from '@rsbuild/plugin-yaml';
|
|
8
|
-
import { addLeadingSlash, addTrailingSlash, normalizeSlash, removeLeadingSlash, } from '@rspress/core';
|
|
9
8
|
import { pluginAlgolia } from '@rspress/plugin-algolia';
|
|
10
9
|
import { pluginLlms } from '@rspress/plugin-llms';
|
|
11
|
-
import {
|
|
10
|
+
import { addLeadingSlash, addTrailingSlash, normalizeSlash, removeLeadingSlash, } from '@rspress/shared';
|
|
12
11
|
import { transformerMetaHighlight, transformerMetaWordHighlight, transformerNotationDiff, transformerNotationErrorLevel, transformerNotationFocus, transformerNotationHighlight, transformerNotationWordHighlight, transformerRemoveNotationEscape, } from '@shikijs/transformers';
|
|
13
12
|
import { difference } from 'es-toolkit';
|
|
13
|
+
import { logger } from 'rspress/core';
|
|
14
14
|
import { glob } from 'tinyglobby';
|
|
15
15
|
import { cyan } from 'yoctocolors';
|
|
16
16
|
import { attributesPlugin } from '../plugins/attributes/index.js';
|
|
@@ -216,11 +216,6 @@ const getCommonConfig = async ({ config, root, configFilePath, base, version, do
|
|
|
216
216
|
server: {
|
|
217
217
|
open,
|
|
218
218
|
},
|
|
219
|
-
performance: {
|
|
220
|
-
buildCache: {
|
|
221
|
-
cacheDigest: [root, configFilePath, base, version],
|
|
222
|
-
},
|
|
223
|
-
},
|
|
224
219
|
tools: {
|
|
225
220
|
rspack(rspackConfig, { mergeConfig, rspack }) {
|
|
226
221
|
return mergeConfig(rspackConfig, {
|
package/lib/cli/translate.js
CHANGED
|
@@ -4,12 +4,12 @@ import path from 'node:path';
|
|
|
4
4
|
import { setTimeout } from 'node:timers/promises';
|
|
5
5
|
import { isDeepStrictEqual } from 'node:util';
|
|
6
6
|
import { removeLeadingSlash } from '@rspress/shared';
|
|
7
|
-
import { logger } from '@rspress/shared/logger';
|
|
8
7
|
import { Command } from 'commander';
|
|
9
8
|
import { render } from 'ejs';
|
|
10
9
|
import matter from 'gray-matter';
|
|
11
10
|
import { AzureOpenAI, RateLimitError } from 'openai';
|
|
12
11
|
import { pRateLimit } from 'p-ratelimit';
|
|
12
|
+
import { logger } from 'rspress/core';
|
|
13
13
|
import { glob } from 'tinyglobby';
|
|
14
14
|
import { cyan, red } from 'yoctocolors';
|
|
15
15
|
import { mdProcessor, mdxProcessor, normalizeImgSrc, } from '../plugins/index.js';
|
package/lib/config.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { Config } from '@rspress/
|
|
1
|
+
import type { Config } from '@rspress/shared';
|
|
2
2
|
export declare const defineConfig: (config: Config) => Config;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { usePageData } from '@rspress/core/runtime';
|
|
2
1
|
import { useEffect } from 'react';
|
|
2
|
+
import { usePageData } from 'rspress/runtime';
|
|
3
3
|
import { useSiteOverrides } from '@alauda/doom/runtime';
|
|
4
4
|
const setNavBarSpans = (logoText) => {
|
|
5
5
|
const navBarLinks = document.querySelectorAll('[class^=navBarTitle] > a');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { Tag } from '@rspress/core/theme';
|
|
3
2
|
import { isExternalUrl, } from '@rspress/shared';
|
|
4
3
|
import { useRef, useState } from 'react';
|
|
4
|
+
import { Tag } from 'rspress/theme';
|
|
5
5
|
import { matchNavbar } from '../../shared/index.js';
|
|
6
6
|
import { Down } from './Down.js';
|
|
7
7
|
import { NavMenuSingleItem, } from './NavMenuSingleItem.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Tag } from '@rspress/core/theme';
|
|
3
2
|
import { isExternalUrl } from '@rspress/shared';
|
|
4
3
|
import { useMemo } from 'react';
|
|
4
|
+
import { Tag } from 'rspress/theme';
|
|
5
5
|
import styles from '../../../styles/versions-nav.module.scss';
|
|
6
6
|
import { withoutBase } from '../../shared/index.js';
|
|
7
7
|
export function NavMenuSingleItem({ activeMatch, base, compact, download, link, pathname, rightIcon, text, tag, }) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { isProduction, NoSSR, usePageData, withBase, } from '@rspress/core/runtime';
|
|
3
2
|
import {} from '@rspress/shared';
|
|
4
3
|
import virtual from 'doom-@global-virtual';
|
|
5
4
|
import { noop } from 'es-toolkit';
|
|
6
5
|
import { useEffect, useMemo, useState } from 'react';
|
|
7
6
|
import { createPortal } from 'react-dom';
|
|
7
|
+
import { isProduction, NoSSR, usePageData, withBase } from 'rspress/runtime';
|
|
8
8
|
import { base } from 'virtual-runtime-config';
|
|
9
9
|
import { parse } from 'yaml';
|
|
10
10
|
import { ACP_BASE, getPdfName, getUnversionedVersion, isExplicitlyUnversioned, } from '../../shared/index.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RspressPlugin } from '
|
|
1
|
+
import type { RspressPlugin } from 'rspress/core';
|
|
2
2
|
import type { ApiPluginOptions } from './types.js';
|
|
3
3
|
export type * from './types.js';
|
|
4
4
|
export declare const apiPlugin: ({ localBasePath, }: ApiPluginOptions) => RspressPlugin;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const attributesPlugin: () =>
|
|
1
|
+
import type { RspressPlugin } from 'rspress/core';
|
|
2
|
+
export declare const attributesPlugin: () => RspressPlugin;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
|
-
import { addTrailingSlash, } from '@rspress/
|
|
2
|
+
import { addTrailingSlash, } from '@rspress/shared';
|
|
3
3
|
import { APIS_ROUTES } from '../../shared/index.js';
|
|
4
4
|
import { combineWalkResult } from './utils.js';
|
|
5
5
|
import { walk } from './walk.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import fs from 'node:fs/promises';
|
|
2
2
|
import path from 'node:path';
|
|
3
|
-
import { logger } from '@rspress/shared/logger';
|
|
4
3
|
import { loadFrontMatter } from '@rspress/shared/node-utils';
|
|
4
|
+
import { logger } from 'rspress/core';
|
|
5
5
|
import { extractTextAndId } from '../../shared/index.js';
|
|
6
6
|
import { pathExists } from '../../utils/index.js';
|
|
7
7
|
export async function detectFilePath(rawPath, extensions) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import fs from 'node:fs/promises';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import { isExternalUrl, removeLeadingSlash, removeTrailingSlash, slash, withBase, } from '@rspress/shared';
|
|
4
|
-
import { logger } from '@rspress/shared/logger';
|
|
5
4
|
import { unset } from 'es-toolkit/compat';
|
|
6
5
|
import picomatch from 'picomatch';
|
|
6
|
+
import { logger } from 'rspress/core';
|
|
7
7
|
import { pathExists, readJson } from '../../utils/index.js';
|
|
8
8
|
import { detectFilePath, extractInfoFromFrontmatter } from './utils.js';
|
|
9
9
|
const sidebarSorter = (a, b) => {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { RspressPlugin } from '
|
|
1
|
+
import type { RspressPlugin } from 'rspress/core';
|
|
2
2
|
export declare const autoTocPlugin: () => RspressPlugin;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const directivesPlugin: () =>
|
|
1
|
+
import type { RspressPlugin } from 'rspress/core';
|
|
2
|
+
export declare const directivesPlugin: () => RspressPlugin;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
|
-
import { addTrailingSlash } from '@rspress/
|
|
3
|
+
import { addTrailingSlash } from '@rspress/shared';
|
|
4
4
|
import { ACP_BASE } from '../../shared/index.js';
|
|
5
5
|
import { baseResolve, pkgResolve } from '../../utils/index.js';
|
|
6
6
|
const globalComponentsDir = baseResolve('global');
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const mermaidPlugin: () =>
|
|
1
|
+
import type { RspressPlugin } from 'rspress/core';
|
|
2
|
+
export declare const mermaidPlugin: () => RspressPlugin;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RspressPlugin } from '
|
|
1
|
+
import type { RspressPlugin } from 'rspress/core';
|
|
2
2
|
import type { PermissionPluginOptions } from './types.js';
|
|
3
3
|
export type * from './types.js';
|
|
4
4
|
export declare const permissionPlugin: ({ localBasePath, }: PermissionPluginOptions) => RspressPlugin;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import fs from 'node:fs/promises';
|
|
2
|
-
import { logger } from '
|
|
2
|
+
import { logger } from 'rspress/core';
|
|
3
3
|
import { rehypeNormalizeLink } from './rehype-normalize-link.js';
|
|
4
4
|
import { remarkExplicitJsx } from './remark-explicit-jsx.js';
|
|
5
5
|
import { MD_RELEASE_COMMENT_PATTERN, MDX_RELEASE_COMMENT_PATTERN, remarkReplace, } from './remark-replace.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
|
-
import { isExternalUrl, removeLeadingSlash } from '@rspress/
|
|
3
|
+
import { isExternalUrl, removeLeadingSlash } from '@rspress/shared';
|
|
4
4
|
import { cloneDeep } from 'es-toolkit';
|
|
5
5
|
import { visit } from 'unist-util-visit';
|
|
6
6
|
import { RELATIVE_URL_PATTERN } from './utils.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/* eslint-disable regexp/optimal-quantifier-concatenation, regexp/no-misleading-capturing-group, regexp/no-super-linear-backtracking */
|
|
2
2
|
import fs from 'node:fs/promises';
|
|
3
3
|
import path from 'node:path';
|
|
4
|
-
import { isProduction } from '@rspress/
|
|
5
|
-
import { logger } from '
|
|
4
|
+
import { isProduction } from '@rspress/shared';
|
|
5
|
+
import { logger } from 'rspress/core';
|
|
6
6
|
import { parse, stringify } from 'yaml';
|
|
7
7
|
import { cyan, red } from 'yoctocolors';
|
|
8
8
|
import { normalizeImgSrc } from './normalize-img-src.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import fs from 'node:fs/promises';
|
|
2
2
|
import path from 'node:path';
|
|
3
|
-
import { isProduction } from '@rspress/
|
|
4
|
-
import { logger } from '@rspress/shared/logger';
|
|
3
|
+
import { isProduction } from '@rspress/shared';
|
|
5
4
|
import { render } from 'ejs';
|
|
5
|
+
import { logger } from 'rspress/core';
|
|
6
6
|
import { red } from 'yoctocolors';
|
|
7
7
|
import { resolveRepo } from '../../utils/index.js';
|
|
8
8
|
import { parseToc } from './parse-toc.js';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { logger } from '@rspress/shared/logger';
|
|
2
1
|
import remarkFrontmatter from 'remark-frontmatter';
|
|
3
2
|
import remarkGfm from 'remark-gfm';
|
|
4
3
|
import remarkMdx from 'remark-mdx';
|
|
5
4
|
import remarkParse from 'remark-parse';
|
|
6
5
|
import remarkStringify, {} from 'remark-stringify';
|
|
6
|
+
import { logger } from 'rspress/core';
|
|
7
7
|
import { unified } from 'unified';
|
|
8
8
|
import { red } from 'yoctocolors';
|
|
9
9
|
export const RELATIVE_URL_PATTERN = /^\.\.?\//;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// based on https://github.com/jl917/rspress-plugin-sitemap/blob/master/src/index.ts
|
|
2
2
|
import fs from 'node:fs';
|
|
3
3
|
import { dirname } from 'node:path';
|
|
4
|
-
import { logger } from '
|
|
4
|
+
import { logger } from 'rspress/core';
|
|
5
5
|
const generateNode = (sitemap) => {
|
|
6
6
|
let result = '<url>';
|
|
7
7
|
for (const [tag, value] of Object.entries(sitemap)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Badge, Badge as default } from '
|
|
1
|
+
export { Badge, Badge as default } from 'rspress/theme';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Badge, Badge as default } from '
|
|
1
|
+
export { Badge, Badge as default } from 'rspress/theme';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Card, Card as default } from '
|
|
1
|
+
export { Card, Card as default } from 'rspress/theme';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Card, Card as default } from '
|
|
1
|
+
export { Card, Card as default } from 'rspress/theme';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { NoSSR, useLang, usePageData } from '@rspress/core/runtime';
|
|
3
2
|
import { addTrailingSlash, isExternalUrl, normalizeHref, parseUrl, removeLeadingSlash, } from '@rspress/shared';
|
|
4
3
|
import { DEFAULT_PAGE_EXTENSIONS } from '@rspress/shared/constants';
|
|
5
4
|
import { clsx } from 'clsx';
|
|
6
5
|
import virtual from 'doom-@global-virtual';
|
|
7
6
|
import { useMemo } from 'react';
|
|
7
|
+
import { NoSSR, useLang, usePageData } from 'rspress/runtime';
|
|
8
8
|
import classes from '../../../styles/link.module.scss';
|
|
9
9
|
import { isUnversioned } from '../../shared/helpers.js';
|
|
10
10
|
import { useIsPrint } from '../hooks/index.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { CodeBlockRuntime, Tab, Tabs } from '
|
|
2
|
+
import { CodeBlockRuntime, Tab, Tabs } from 'rspress/theme';
|
|
3
3
|
import { stringify } from 'yaml';
|
|
4
4
|
export const JsonViewer = ({ value }) => {
|
|
5
5
|
return (_jsxs(Tabs, { children: [_jsx(Tab, { label: "yaml", children: _jsx(CodeBlockRuntime, { lang: "yaml", code: stringify(value) }) }), _jsx(Tab, { label: "json", children: _jsx(CodeBlockRuntime, { lang: "json", code: JSON.stringify(value, null, 2) }) })] }));
|
|
@@ -2,9 +2,9 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
2
2
|
/**
|
|
3
3
|
* modified based on @see https://github.com/crdsdev/doc/blob/main/template/doc.html
|
|
4
4
|
*/
|
|
5
|
-
import { Badge, Button } from '@rspress/core/theme';
|
|
6
5
|
import crdsMap from 'doom-@api-crdsMap';
|
|
7
6
|
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
7
|
+
import { Badge, Button } from 'rspress/theme';
|
|
8
8
|
import { useIsPrint, useTranslation } from '../hooks/index.js';
|
|
9
9
|
import { Directive } from './Directive.js';
|
|
10
10
|
import { Markdown } from './Markdown.js';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useLang } from '@rspress/core/runtime';
|
|
3
2
|
import functionResourcesMap from 'doom-@permission-functionResourcesMap';
|
|
4
3
|
import roleTemplatesMap from 'doom-@permission-roleTemplatesMap';
|
|
5
4
|
import { intersection, sortBy } from 'es-toolkit';
|
|
6
5
|
import { Fragment, useMemo } from 'react';
|
|
6
|
+
import { useLang } from 'rspress/runtime';
|
|
7
7
|
import { useTranslation } from '../hooks/index.js';
|
|
8
8
|
import { X } from './_X.js';
|
|
9
9
|
export const VerbsMap = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { LinkCard, LinkCard as default } from '
|
|
1
|
+
export { LinkCard, LinkCard as default } from 'rspress/theme';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { LinkCard, LinkCard as default } from '
|
|
1
|
+
export { LinkCard, LinkCard as default } from 'rspress/theme';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useDark } from '@rspress/core/runtime';
|
|
3
2
|
import { clsx } from 'clsx';
|
|
4
3
|
import mermaid from 'mermaid';
|
|
5
4
|
import { useEffect, useId, useRef } from 'react';
|
|
5
|
+
import { useDark } from 'rspress/runtime';
|
|
6
6
|
export const Mermaid = ({ className, children }) => {
|
|
7
7
|
const id = useId();
|
|
8
8
|
const isDark = useDark();
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { usePageData } from '@rspress/core/runtime';
|
|
3
|
-
import { Badge } from '@rspress/core/theme';
|
|
4
2
|
import openapisMap from 'doom-@api-openapisMap';
|
|
5
3
|
import virtual from 'doom-@api-virtual';
|
|
6
4
|
import BananaSlug from 'github-slugger';
|
|
7
5
|
import { OpenAPIV3 } from 'openapi-types';
|
|
8
6
|
import { Fragment, useId, useMemo } from 'react';
|
|
7
|
+
import { usePageData } from 'rspress/runtime';
|
|
8
|
+
import { Badge } from 'rspress/theme';
|
|
9
9
|
import { omitRoutePathRefs, resolveRef } from '../utils.js';
|
|
10
10
|
import { Markdown } from './Markdown.js';
|
|
11
11
|
import { OpenAPIProperties, OpenAPIProperty, OpenAPIRef } from './OpenAPIRef.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { usePageData } from '@rspress/core/runtime';
|
|
3
2
|
import openapisMap from 'doom-@api-openapisMap';
|
|
4
3
|
import { useId, useMemo } from 'react';
|
|
4
|
+
import { usePageData } from 'rspress/runtime';
|
|
5
5
|
import { modelName, omitRoutePathRefs, resolveRef } from '../utils.js';
|
|
6
6
|
import { Markdown } from './Markdown.js';
|
|
7
7
|
import { HeadingTitle } from './_HeadingTitle.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Link, renderInlineMarkdown, useSidebarData } from '@rspress/core/theme';
|
|
3
2
|
import { isEqualPath, normalizeHrefInRuntime as normalizeHref, usePageData, } from '@rspress/runtime';
|
|
4
3
|
import { Fragment, useCallback, useMemo } from 'react';
|
|
4
|
+
import { Link, renderInlineMarkdown, useSidebarData } from 'rspress/theme';
|
|
5
5
|
import classes from '../../../styles/overview.module.scss';
|
|
6
6
|
import { findItemByRoutePath, isSidebarDivider, isSidebarSectionHeader, isSingleFile, } from './_utils.js';
|
|
7
7
|
const getChildLink = (traverseItem) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { PackageManagerTabs, PackageManagerTabs as default, } from '
|
|
1
|
+
export { PackageManagerTabs, PackageManagerTabs as default, } from 'rspress/theme';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { PackageManagerTabs, PackageManagerTabs as default, } from '
|
|
1
|
+
export { PackageManagerTabs, PackageManagerTabs as default, } from 'rspress/theme';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Steps, Steps as default } from '
|
|
1
|
+
export { Steps, Steps as default } from 'rspress/theme';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Steps, Steps as default } from '
|
|
1
|
+
export { Steps, Steps as default } from 'rspress/theme';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Tab, Tab as default } from '
|
|
1
|
+
export { Tab, Tab as default } from 'rspress/theme';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Tab, Tab as default } from '
|
|
1
|
+
export { Tab, Tab as default } from 'rspress/theme';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Tabs as Tabs_ } from '@rspress/core/theme';
|
|
2
1
|
import { type RefAttributes } from 'react';
|
|
2
|
+
import { Tabs as Tabs_ } from 'rspress/theme';
|
|
3
3
|
export type TabsProps = Parameters<typeof Tabs_>[0] & RefAttributes<HTMLDivElement>;
|
|
4
4
|
export declare const Tabs: ({ ref, children, ...props }: TabsProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
export default Tabs;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Tabs as Tabs_ } from '@rspress/core/theme';
|
|
3
2
|
import { Children } from 'react';
|
|
3
|
+
import { Tabs as Tabs_ } from 'rspress/theme';
|
|
4
4
|
import { useIsPrint } from '../hooks/index.js';
|
|
5
5
|
export const Tabs = ({ ref, children, ...props }) => {
|
|
6
6
|
const isPrint = useIsPrint();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Toc, Toc as default } from '
|
|
1
|
+
export { Toc, Toc as default } from 'rspress/theme';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Toc, Toc as default } from '
|
|
1
|
+
export { Toc, Toc as default } from 'rspress/theme';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useLang } from '@rspress/core/runtime';
|
|
3
2
|
import virtual from 'doom-@global-virtual';
|
|
4
3
|
import { useMemo } from 'react';
|
|
4
|
+
import { useLang } from 'rspress/runtime';
|
|
5
5
|
import { handleCJKWhitespaces } from '../utils.js';
|
|
6
6
|
import { Directive } from './Directive.js';
|
|
7
7
|
import { ExternalSiteLink } from './ExternalSiteLink.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { getCustomMDXComponent } from '
|
|
1
|
+
import { getCustomMDXComponent } from 'rspress/theme';
|
|
2
2
|
export const X = getCustomMDXComponent();
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { withBase } from '@rspress/core/runtime';
|
|
2
1
|
function removeIndex(link) {
|
|
3
2
|
if (link.endsWith('/index')) {
|
|
4
3
|
return link.slice(0, -5);
|
|
@@ -21,14 +20,9 @@ export function findItemByRoutePath(items, routePath) {
|
|
|
21
20
|
if (isSidebarDivider(item) || isSidebarSectionHeader(item)) {
|
|
22
21
|
return false;
|
|
23
22
|
}
|
|
24
|
-
const
|
|
25
|
-
const removeIndexUrl = removeIndex(withBaseUrl);
|
|
23
|
+
const removeIndexUrl = removeIndex(item.link || '/');
|
|
26
24
|
const removeBackSlashedRoutePath = routePath.replace(/\/$/, '');
|
|
27
|
-
return (
|
|
28
|
-
// FIXME: 😅 we should refactor all the path logic, /index.html / or no /, l
|
|
29
|
-
withBaseUrl === routePath ||
|
|
30
|
-
removeIndexUrl === routePath ||
|
|
31
|
-
withBaseUrl === removeBackSlashedRoutePath ||
|
|
25
|
+
return (removeIndexUrl === routePath ||
|
|
32
26
|
removeIndexUrl === removeBackSlashedRoutePath);
|
|
33
27
|
}
|
|
34
28
|
const matchRoutePathItemIndex = items.findIndex((item) => {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { isProduction } from '@rspress/core/runtime';
|
|
2
1
|
import virtual from 'doom-@global-virtual';
|
|
3
2
|
import { merge } from 'es-toolkit/compat';
|
|
4
3
|
import { useEffect, useMemo, useState } from 'react';
|
|
5
|
-
import {
|
|
4
|
+
import { isProduction, withBase } from 'rspress/runtime';
|
|
6
5
|
import { parse } from 'yaml';
|
|
7
6
|
import { isUnversioned } from '../../shared/index.js';
|
|
8
7
|
import { namedTerms } from '../../terms.js';
|
|
@@ -20,14 +19,14 @@ const normalizeOverrides = (origin) => Object.keys(origin).reduce((acc, key_) =>
|
|
|
20
19
|
}, { en: {}, zh: {}, ru: {} });
|
|
21
20
|
let normalizedSiteOverrides;
|
|
22
21
|
let promise;
|
|
23
|
-
const fetchSiteOverrides = async (
|
|
22
|
+
const fetchSiteOverrides = async (version, acpSite) => {
|
|
24
23
|
if (promise) {
|
|
25
24
|
return promise;
|
|
26
25
|
}
|
|
27
26
|
const acpSiteOverridesUrl = acpSite && isProduction()
|
|
28
27
|
? `${(virtual.prefix || '') + acpSite.base}${isUnversioned(version) ? '' : acpSite.version + '/'}overrides.yaml`
|
|
29
28
|
: null;
|
|
30
|
-
const siteOverridesUrl =
|
|
29
|
+
const siteOverridesUrl = withBase('overrides.yaml');
|
|
31
30
|
const urls = [acpSiteOverridesUrl];
|
|
32
31
|
if (acpSiteOverridesUrl !== siteOverridesUrl) {
|
|
33
32
|
urls.push(siteOverridesUrl);
|
|
@@ -70,7 +69,7 @@ export const useSiteOverrides = () => {
|
|
|
70
69
|
if (normalizedSiteOverrides) {
|
|
71
70
|
return;
|
|
72
71
|
}
|
|
73
|
-
void fetchSiteOverrides(
|
|
72
|
+
void fetchSiteOverrides(virtual.version, acpSite).then(setSiteOverrides);
|
|
74
73
|
}, [acpSite]);
|
|
75
74
|
return siteOverrides?.[lang] || {};
|
|
76
75
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useLang as useLang_ } from '@rspress/core/runtime';
|
|
2
1
|
import { useCallback } from 'react';
|
|
2
|
+
import { useLang as useLang_ } from 'rspress/runtime';
|
|
3
3
|
import { TRANSLATIONS } from '../translation.js';
|
|
4
4
|
export const useLang = () => useLang_();
|
|
5
5
|
export const useTranslation = () => {
|
package/lib/theme.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { DoomSidebarGroup, DoomSidebarItem } from './plugins/index.js';
|
|
2
2
|
import type { ExportItem } from './types.js';
|
|
3
|
-
export * from '
|
|
3
|
+
export * from 'rspress/theme';
|
|
4
4
|
export interface MatchedSidebar {
|
|
5
5
|
sidebar: DoomSidebarGroup | DoomSidebarItem;
|
|
6
6
|
exportItem: ExportItem;
|
package/lib/theme.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useLang, usePageData, withBase } from '@rspress/core/runtime';
|
|
3
|
-
import { Search as OriginalSearch, Layout as OriginalLayout, getCustomMDXComponent, } from '@rspress/core/theme';
|
|
4
2
|
import { Search as AlgoliaSearch, ZH_LOCALES, } from '@rspress/plugin-algolia/runtime';
|
|
5
3
|
import virtual from 'doom-@global-virtual';
|
|
6
4
|
import { useMemo } from 'react';
|
|
7
5
|
import { useLocation } from 'react-router';
|
|
6
|
+
import { useLang, usePageData, withBase } from 'rspress/runtime';
|
|
7
|
+
import { Search as OriginalSearch, Layout as OriginalLayout, getCustomMDXComponent, } from 'rspress/theme';
|
|
8
8
|
import classes from '../styles/link.module.scss';
|
|
9
9
|
import { useTranslation } from './runtime/index.js';
|
|
10
10
|
// eslint-disable-next-line import-x/export
|
|
11
|
-
export * from '
|
|
11
|
+
export * from 'rspress/theme';
|
|
12
12
|
const X = getCustomMDXComponent();
|
|
13
13
|
const getClosestSidebar_ = (sidebarItems, pathname, exportItem, matched, depth = 0) => {
|
|
14
14
|
for (const sidebar of sidebarItems) {
|
package/lib/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Options } from '@cspell/eslint-plugin';
|
|
2
|
-
import type { serve } from '
|
|
2
|
+
import type { serve } from 'rspress/core';
|
|
3
3
|
import type { ApiPluginOptions, AutoSidebarPluginOptions, PermissionPluginOptions, ReferenceItem, ReleaseNotesOptions } from './plugins/index.js';
|
|
4
4
|
import type { DoomSite } from './shared/index.js';
|
|
5
5
|
export type BaseServeOptions = Parameters<typeof serve>[0];
|
package/lib/utils/git.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import fs from 'node:fs/promises';
|
|
2
2
|
import os from 'node:os';
|
|
3
3
|
import path from 'node:path';
|
|
4
|
-
import { logger } from '
|
|
4
|
+
import { logger } from 'rspress/core';
|
|
5
5
|
import { simpleGit } from 'simple-git';
|
|
6
6
|
import { cyan, red } from 'yoctocolors';
|
|
7
7
|
const remotesFolder = path.resolve(os.homedir(), '.doom/remotes');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alauda/doom",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Doctor Doom making docs.",
|
|
6
6
|
"repository": "git+https://github.com/alauda/doom.git",
|
|
@@ -36,19 +36,19 @@
|
|
|
36
36
|
"rspress-plugins"
|
|
37
37
|
],
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@cspell/eslint-plugin": "^8.19.4 || ^9.1.
|
|
40
|
-
"@eslint-react/eslint-plugin": "^1.52.
|
|
39
|
+
"@cspell/eslint-plugin": "^8.19.4 || ^9.1.5",
|
|
40
|
+
"@eslint-react/eslint-plugin": "^1.52.3",
|
|
41
41
|
"@inquirer/prompts": "^7.6.0",
|
|
42
42
|
"@openapi-contrib/openapi-schema-to-json-schema": "^5.1.0",
|
|
43
|
-
"@playwright/browser-chromium": "^1.
|
|
43
|
+
"@playwright/browser-chromium": "^1.54.1",
|
|
44
44
|
"@rsbuild/plugin-react": "^1.3.4",
|
|
45
45
|
"@rsbuild/plugin-sass": "^1.3.3",
|
|
46
46
|
"@rsbuild/plugin-svgr": "^1.2.1",
|
|
47
47
|
"@rsbuild/plugin-yaml": "^1.0.2",
|
|
48
|
-
"@rspress/
|
|
49
|
-
"@rspress/plugin-
|
|
50
|
-
"@rspress/
|
|
51
|
-
"@shikijs/transformers": "^3.
|
|
48
|
+
"@rspress/plugin-algolia": "2.0.0-beta.21",
|
|
49
|
+
"@rspress/plugin-llms": "2.0.0-beta.21",
|
|
50
|
+
"@rspress/shared": "2.0.0-beta.21",
|
|
51
|
+
"@shikijs/transformers": "^3.8.0",
|
|
52
52
|
"@total-typescript/ts-reset": "^0.6.1",
|
|
53
53
|
"chokidar": "^4.0.3",
|
|
54
54
|
"cli-progress": "^3.12.0",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"commander": "^13.1.0 || ^14.0.0",
|
|
57
57
|
"ejs": "^3.1.10",
|
|
58
58
|
"es-toolkit": "^1.39.7",
|
|
59
|
-
"eslint": "^9.
|
|
59
|
+
"eslint": "^9.31.0",
|
|
60
60
|
"eslint-plugin-mdx": "^3.6.2",
|
|
61
61
|
"globals": "^16.3.0",
|
|
62
62
|
"html-tag-names": "^2.1.0",
|
|
@@ -66,13 +66,13 @@
|
|
|
66
66
|
"mdast-util-phrasing": "^4.1.0",
|
|
67
67
|
"mdast-util-to-string": "^4.0.0",
|
|
68
68
|
"mermaid": "^11.8.1",
|
|
69
|
-
"openai": "^5.
|
|
69
|
+
"openai": "^5.9.2",
|
|
70
70
|
"openapi-types": "^12.1.3",
|
|
71
71
|
"p-ratelimit": "^1.0.1",
|
|
72
72
|
"pdf-lib": "^1.17.1",
|
|
73
73
|
"pdf-merger-js": "^5.1.2",
|
|
74
|
-
"picomatch": "^4.0.
|
|
75
|
-
"playwright": "^1.
|
|
74
|
+
"picomatch": "^4.0.3",
|
|
75
|
+
"playwright": "^1.54.1",
|
|
76
76
|
"pluralize": "^8.0.0",
|
|
77
77
|
"react-markdown": "^10.1.0",
|
|
78
78
|
"rehype-raw": "^7.0.0",
|
|
@@ -92,14 +92,15 @@
|
|
|
92
92
|
"remark-mdx": "^3.1.0",
|
|
93
93
|
"remark-message-control": "^8.0.0",
|
|
94
94
|
"remark-stringify": "^11.0.0",
|
|
95
|
-
"
|
|
95
|
+
"rspress": "2.0.0-beta.21",
|
|
96
|
+
"shiki": "^3.8.0",
|
|
96
97
|
"simple-git": "^3.28.0",
|
|
97
98
|
"string-width": "^7.2.0",
|
|
98
99
|
"swagger2openapi": "^7.0.8",
|
|
99
100
|
"tinyglobby": "^0.2.14",
|
|
100
101
|
"type-fest": "^4.41.0",
|
|
101
102
|
"typescript": "^5.8.3",
|
|
102
|
-
"typescript-eslint": "^8.
|
|
103
|
+
"typescript-eslint": "^8.37.0",
|
|
103
104
|
"unified": "^11.0.5",
|
|
104
105
|
"unified-lint-rule": "^3.0.1",
|
|
105
106
|
"unist-util-position": "^5.0.0",
|