@alauda/doom 1.2.2 → 1.3.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/index.js CHANGED
@@ -45,13 +45,14 @@ program
45
45
  .option('-R, --edit-repo [boolean|url]', 'Whether to enable or override the `editRepoBaseUrl` config feature, `https://github.com/` prefix could be omitted', parseBooleanOrString, false)
46
46
  .option('-a, --algolia [boolean|alauda]', 'Whether to enable or use the alauda (docs.alauda.io) preset for Algolia search', parseBooleanOrString, false)
47
47
  .option('-S, --site-url', 'Whether to enable the siteUrl for sitemap generation', parseBoolean, false)
48
- .option('-n, --no-open [boolean]', 'Do not open the browser after starting the server')
48
+ .option('-n, --no-open', 'Do not open the browser after starting the server')
49
49
  .command('dev', { isDefault: true })
50
50
  .description('Start the development server')
51
51
  .argument('[root]', 'Root directory of the documentation')
52
52
  .option('-H, --host [host]', 'Dev server host name')
53
53
  .option('-P, --port [port]', 'Dev server port number')
54
- .option('-l, --lazy [boolean]', 'Whether to enable `lazyCompilation` which could improve the compilation performance', parseBoolean, false)
54
+ .option('-l, --lazy [boolean]', 'Whether to enable `lazyCompilation` which could improve the compilation performance', parseBoolean, true)
55
+ .option('--no-lazy', 'Do not enable `lazyCompilation`')
55
56
  .action(async function (root) {
56
57
  setNodeEnv('development');
57
58
  let devServer;
@@ -7,7 +7,7 @@ import crdsMap from 'doom-@api-crdsMap';
7
7
  import { useCallback, useEffect, useMemo, useState } from 'react';
8
8
  import { useIsPrint, useTranslation } from '../hooks/index.js';
9
9
  import { Directive } from './Directive.js';
10
- import { Markdown } from './_Markdown.js';
10
+ import { Markdown } from './Markdown.js';
11
11
  import { X } from './_X.js';
12
12
  export const K8sCrdSchemaPart = ({ name, parent, schema: property, expandAll, }) => {
13
13
  const [open, setOpen] = useState(expandAll);
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import {} from 'react';
3
+ import ReactMarkdown from 'react-markdown';
4
+ import rehypeRaw from 'rehype-raw';
5
+ import rehypeSanitize from 'rehype-sanitize';
6
+ import remarkGfm from 'remark-gfm';
7
+ import { X } from './_X.js';
8
+ const remarkPlugins = [remarkGfm];
9
+ const rehypePlugins = [rehypeRaw, rehypeSanitize];
10
+ export const Markdown = ({ children }) => children && (_jsx(ReactMarkdown, { remarkPlugins: remarkPlugins, rehypePlugins: rehypePlugins, components: X, children: children }));
@@ -7,9 +7,9 @@ import BananaSlug from 'github-slugger';
7
7
  import { OpenAPIV3 } from 'openapi-types';
8
8
  import { Fragment, useId, useMemo } from 'react';
9
9
  import { omitRoutePathRefs, resolveRef } from '../utils.js';
10
+ import { Markdown } from './Markdown.js';
10
11
  import { OpenAPIProperties, OpenAPIProperty, OpenAPIRef } from './OpenAPIRef.js';
11
12
  import { HeadingTitle } from './_HeadingTitle.js';
12
- import { Markdown } from './_Markdown.js';
13
13
  import { RefLink } from './_RefLink.js';
14
14
  import { X } from './_X.js';
15
15
  export const OpenAPIParameters = ({ parameters, openapi, }) => {
@@ -3,8 +3,8 @@ import { usePageData } from '@rspress/core/runtime';
3
3
  import openapisMap from 'doom-@api-openapisMap';
4
4
  import { useId, useMemo } from 'react';
5
5
  import { modelName, omitRoutePathRefs, resolveRef } from '../utils.js';
6
+ import { Markdown } from './Markdown.js';
6
7
  import { HeadingTitle } from './_HeadingTitle.js';
7
- import { Markdown } from './_Markdown.js';
8
8
  import { RefLink } from './_RefLink.js';
9
9
  import { X } from './_X.js';
10
10
  export const OpenAPIProperty = ({ name, property, openapi, }) => {
@@ -10,6 +10,7 @@ export * from './JsonViewer.js';
10
10
  export * from './K8sCrd.js';
11
11
  export * from './K8sPermissionTable.js';
12
12
  export * from './LinkCard.js';
13
+ export * from './Markdown.js';
13
14
  export * from './Mermaid.js';
14
15
  export * from './OpenAPIPath.js';
15
16
  export * from './OpenAPIRef.js';
@@ -10,6 +10,7 @@ export * from './JsonViewer.js';
10
10
  export * from './K8sCrd.js';
11
11
  export * from './K8sPermissionTable.js';
12
12
  export * from './LinkCard.js';
13
+ export * from './Markdown.js';
13
14
  export * from './Mermaid.js';
14
15
  export * from './OpenAPIPath.js';
15
16
  export * from './OpenAPIRef.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alauda/doom",
3
- "version": "1.2.2",
3
+ "version": "1.3.0",
4
4
  "type": "module",
5
5
  "description": "Doctor Doom making docs.",
6
6
  "repository": "git+https://github.com/alauda/doom.git",
@@ -35,7 +35,7 @@
35
35
  ],
36
36
  "dependencies": {
37
37
  "@cspell/eslint-plugin": "^8.19.4 || ^9.0.2",
38
- "@eslint-react/eslint-plugin": "^1.51.3",
38
+ "@eslint-react/eslint-plugin": "^1.52.1",
39
39
  "@inquirer/prompts": "^7.5.3",
40
40
  "@openapi-contrib/openapi-schema-to-json-schema": "^5.1.0",
41
41
  "@playwright/browser-chromium": "^1.53.0",
@@ -43,9 +43,9 @@
43
43
  "@rsbuild/plugin-sass": "^1.3.2",
44
44
  "@rsbuild/plugin-svgr": "^1.2.0",
45
45
  "@rsbuild/plugin-yaml": "^1.0.2",
46
- "@rspress/core": "2.0.0-beta.13",
47
- "@rspress/plugin-algolia": "2.0.0-beta.13",
48
- "@rspress/plugin-llms": "2.0.0-beta.13",
46
+ "@rspress/core": "2.0.0-beta.14",
47
+ "@rspress/plugin-algolia": "2.0.0-beta.14",
48
+ "@rspress/plugin-llms": "2.0.0-beta.14",
49
49
  "@shikijs/transformers": "^3.6.0",
50
50
  "@total-typescript/ts-reset": "^0.6.1",
51
51
  "chokidar": "^4.0.3",
@@ -68,6 +68,8 @@
68
68
  "picomatch": "^4.0.2",
69
69
  "playwright": "^1.53.0",
70
70
  "react-markdown": "^10.1.0",
71
+ "rehype-raw": "^7.0.0",
72
+ "rehype-sanitize": "^6.0.0",
71
73
  "remark-directive": "^4.0.0",
72
74
  "remark-frontmatter": "^5.0.0",
73
75
  "remark-gfm": "^4.0.1",
@@ -1,6 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import {} from 'react';
3
- import ReactMarkdown from 'react-markdown';
4
- import remarkGfm from 'remark-gfm';
5
- import { X } from './_X.js';
6
- export const Markdown = ({ children }) => children && (_jsx(ReactMarkdown, { remarkPlugins: [[remarkGfm]], components: X, skipHtml: true, children: children }));