@alauda/doom 1.18.1 → 1.18.3

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.
@@ -6,7 +6,7 @@ export interface GlobalPluginOptions {
6
6
  download?: boolean;
7
7
  }
8
8
  export interface GlobalVirtual extends GlobalPluginOptions {
9
- userBase?: string;
9
+ userBase: string;
10
10
  prefix?: string;
11
11
  sites?: DoomSite[];
12
12
  export?: ExportItem[];
@@ -12,6 +12,7 @@ export * from './no-heading-punctuation.ts';
12
12
  export * from './no-heading-special-characters.ts';
13
13
  export * from './no-heading-sup-sub.ts';
14
14
  export * from './no-paragraph-indent.ts';
15
+ export * from './site.ts';
15
16
  export * from './table-size.ts';
16
17
  export * from './unit-case.ts';
17
18
  declare const doomLint: Plugin<[], Root>;
@@ -11,6 +11,7 @@ export * from "./no-heading-punctuation.js";
11
11
  export * from "./no-heading-special-characters.js";
12
12
  export * from "./no-heading-sup-sub.js";
13
13
  export * from "./no-paragraph-indent.js";
14
+ export * from "./site.js";
14
15
  export * from "./table-size.js";
15
16
  export * from "./unit-case.js";
16
17
  const doomLint = function () {
@@ -0,0 +1,2 @@
1
+ import type { Root } from 'mdast';
2
+ export declare const site: import("unified-lint-rule").Plugin<Root, unknown>;
@@ -0,0 +1,38 @@
1
+ import path from 'node:path';
2
+ import { lintRule } from 'unified-lint-rule';
3
+ import { visitParents } from 'unist-util-visit-parents';
4
+ import { SITES_FILE } from "../cli/constants.js";
5
+ import { pathExists } from "../utils/fs.js";
6
+ import { resolveStaticConfig } from "../utils/helpers.js";
7
+ const SITE_ELEMENTS = new Set([
8
+ 'ExternalApisOverview',
9
+ 'ExternalSite',
10
+ 'ExternalSiteLink',
11
+ ]);
12
+ const sitesConfigFilePath = path.resolve(SITES_FILE);
13
+ let sites;
14
+ export const site = lintRule('doom:lint-site', async (root, vfile) => {
15
+ if (!sites) {
16
+ if (await pathExists(sitesConfigFilePath, 'file')) {
17
+ sites = await resolveStaticConfig(sitesConfigFilePath);
18
+ }
19
+ else {
20
+ sites = [];
21
+ }
22
+ }
23
+ visitParents(root, 'mdxJsxFlowElement', (element, parents) => {
24
+ if (!sites?.length || !element.name || !SITE_ELEMENTS.has(element.name)) {
25
+ return;
26
+ }
27
+ const nameAttr = element.attributes.find((attr) => attr.type === 'mdxJsxAttribute' && attr.name === 'name');
28
+ const nameVal = nameAttr?.value;
29
+ if (typeof nameVal === 'string' &&
30
+ sites.some((site) => site.name === nameVal)) {
31
+ return;
32
+ }
33
+ vfile.message(`Invalid site \`name\` property value \`${typeof nameVal === 'string' ? nameVal : nameVal?.value}\` which should be static string matching a site name from \`${SITES_FILE}\` config.`, {
34
+ ancestors: [...parents, element],
35
+ place: (nameAttr ?? element).position,
36
+ });
37
+ });
38
+ });
package/lib/remarkrc.js CHANGED
@@ -10,7 +10,7 @@ import remarkLintLintMatchPunctuation from 'remark-lint-match-punctuation';
10
10
  import remarkLintNoChinesePunctuationInNumber from 'remark-lint-no-chinese-punctuation-in-number';
11
11
  import remarkLintNoDuplicateHeadingsInSection from 'remark-lint-no-duplicate-headings-in-section';
12
12
  import remarkLintNoHiddenTableCell from 'remark-lint-no-hidden-table-cell';
13
- import doomLint, { checkDeadLinks, noDeepHeading, noDeepList, noParagraphIndent, tableSize, unitCase, } from "./remark-lint/index.js";
13
+ import doomLint, { checkDeadLinks, noDeepHeading, noDeepList, noParagraphIndent, site, tableSize, unitCase, } from "./remark-lint/index.js";
14
14
  export default {
15
15
  plugins: [
16
16
  remarkDirective,
@@ -27,6 +27,7 @@ export default {
27
27
  noDeepHeading,
28
28
  noDeepList,
29
29
  noParagraphIndent,
30
+ site,
30
31
  tableSize,
31
32
  unitCase,
32
33
  ],
@@ -1,5 +1,5 @@
1
- import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
- import { NoSSR, useLang, useSite } from '@rspress/core/runtime';
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useLang, useSite } from '@rspress/core/runtime';
3
3
  import { addTrailingSlash, isExternalUrl, normalizeHref, parseUrl, removeLeadingSlash, } from '@rspress/shared';
4
4
  import { DEFAULT_PAGE_EXTENSIONS } from '@rspress/shared/constants';
5
5
  import { clsx } from 'clsx';
@@ -7,17 +7,16 @@ import virtual from 'doom-@global-virtual';
7
7
  import { useMemo } from 'react';
8
8
  import { isUnversioned } from '../../shared/helpers.js';
9
9
  import { useIsPrint } from '../hooks/index.js';
10
- import { Directive } from './Directive.js';
11
10
  const ExternalSiteLink_ = ({ name, href = '', className, ...props }) => {
12
11
  const isPrint = useIsPrint();
13
12
  const { site: siteData } = useSite();
14
13
  const site = useMemo(() => virtual.sites?.find((s) => s.name === name), [name]);
15
14
  const lang = useLang();
16
15
  if (!site) {
17
- return (_jsxs(Directive, { type: "danger", children: ["No site with name `", name, "` found, please ensure it's already defined at `sites.yaml`"] }));
16
+ throw new Error(`No site with name \`${name}\` found, please ensure it's already defined at \`sites.yaml\``);
18
17
  }
19
18
  if (isExternalUrl(href)) {
20
- return _jsxs(Directive, { type: "danger", children: ["Invalid href `", href, "` found"] });
19
+ throw new Error(`Invalid href \`${href}\` found`);
21
20
  }
22
21
  let { url, hash } = parseUrl(href);
23
22
  const extname = url.split('.').at(-1);
@@ -35,5 +34,5 @@ const ExternalSiteLink_ = ({ name, href = '', className, ...props }) => {
35
34
  (lang && lang !== siteData.lang ? addTrailingSlash(lang) : '') +
36
35
  (hash ? `${url}#${hash}` : url), target: "_blank", rel: "noopener noreferrer", className: clsx('rp-link', className), ...props }));
37
36
  };
38
- export const ExternalSiteLink = (props) => (_jsx(NoSSR, { children: _jsx(ExternalSiteLink_, { ...props }) }));
37
+ export const ExternalSiteLink = (props) => (_jsx(ExternalSiteLink_, { ...props }));
39
38
  export default ExternalSiteLink;
@@ -1,20 +1,21 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { useLayoutEffect, useRef } from 'react';
3
- let MasonryLayout;
4
- if (typeof window !== 'undefined') {
5
- MasonryLayout = (await import('masonry-layout')).default;
6
- }
7
- export const Masonry = ({ options, ...props }) => {
8
- const ref = useRef(null);
9
- useLayoutEffect(() => {
10
- if (!ref.current) {
11
- return;
12
- }
13
- const masonry = new MasonryLayout(ref.current, options);
14
- return () => {
15
- masonry.destroy?.();
16
- };
17
- }, [options]);
18
- return _jsx("div", { ref: ref, ...props });
19
- };
2
+ import { NoSSR } from '@rspress/core/runtime';
3
+ import { lazy, Suspense, useLayoutEffect, useRef, } from 'react';
4
+ const LazyMasonry = lazy(() => import('masonry-layout').then(({ default: MasonryLayout }) => {
5
+ const Masonry = ({ options, ...props }) => {
6
+ const ref = useRef(null);
7
+ useLayoutEffect(() => {
8
+ if (!ref.current) {
9
+ return;
10
+ }
11
+ const masonry = new MasonryLayout(ref.current, options);
12
+ return () => {
13
+ masonry.destroy?.();
14
+ };
15
+ }, [options]);
16
+ return _jsx("div", { ref: ref, ...props });
17
+ };
18
+ return { default: Masonry };
19
+ }));
20
+ export const Masonry = ({ options, ...props }) => (_jsx(NoSSR, { children: _jsx(Suspense, { children: _jsx(LazyMasonry, { options: options, ...props }) }) }));
20
21
  export default Masonry;
@@ -56,7 +56,7 @@ export const OpenAPIResponses = ({ responses, openapi, }) => {
56
56
  else if (type && '$ref' in type) {
57
57
  typeNode = _jsx(RefLink, { "$ref": type.$ref });
58
58
  }
59
- return (_jsxs(X.li, { children: [_jsx("code", { children: code }), typeNode, ": ", responseObj.description, extraNode] }, code));
59
+ return (_jsxs(X.li, { children: [_jsx("code", { children: code }), " ", typeNode, ": ", responseObj.description, extraNode] }, code));
60
60
  }) }));
61
61
  };
62
62
  const getRefsForPath = (openapi, path, knownRefs) => {
@@ -133,7 +133,7 @@ export const OpenAPIPath = ({ path, openapiPath: openapiPath_, pathPrefix: pathP
133
133
  const requestBodySchema = requestBodyRef
134
134
  ? resolveRef(openapi, requestBodyRef)
135
135
  : undefined;
136
- return (_jsxs(Fragment, { children: [_jsxs(HeadingTitle, { slugger: slugger, level: 3, children: [_jsx("code", { children: method }), summary] }), _jsx(Markdown, { children: description }), parameters && (_jsxs(_Fragment, { children: [_jsx(HeadingTitle, { slugger: slugger, level: 4, children: "Parameters" }), _jsx(OpenAPIParameters, { parameters: parameters, openapi: openapi })] })), requestBodySchema && (_jsxs(_Fragment, { children: [_jsx(HeadingTitle, { slugger: slugger, level: 4, children: "Request Body" }), _jsxs(X.p, { children: [_jsx(RefLink, { "$ref": requestBodyRef }), requestBodySchema.required && _jsx(Badge, { children: "required" })] })] })), responses && (_jsxs(_Fragment, { children: [_jsx(HeadingTitle, { slugger: slugger, level: 4, children: "Response" }), _jsx(OpenAPIResponses, { responses: responses, openapi: openapi })] }))] }, method));
136
+ return (_jsxs(Fragment, { children: [_jsxs(HeadingTitle, { slugger: slugger, level: 3, children: [_jsx("code", { children: method }), " ", summary] }), _jsx(Markdown, { children: description }), parameters && (_jsxs(_Fragment, { children: [_jsx(HeadingTitle, { slugger: slugger, level: 4, children: "Parameters" }), _jsx(OpenAPIParameters, { parameters: parameters, openapi: openapi })] })), requestBodySchema && (_jsxs(_Fragment, { children: [_jsx(HeadingTitle, { slugger: slugger, level: 4, children: "Request Body" }), _jsxs(X.p, { children: [_jsx(RefLink, { "$ref": requestBodyRef }), requestBodySchema.required && _jsx(Badge, { children: "required" })] })] })), responses && (_jsxs(_Fragment, { children: [_jsx(HeadingTitle, { slugger: slugger, level: 4, children: "Response" }), _jsx(OpenAPIResponses, { responses: responses, openapi: openapi })] }))] }, method));
137
137
  }), refs?.map((ref) => {
138
138
  return (_jsx(OpenAPIRef, { schema: ref, openapiPath: openapiPath, isCommonRef: false, collectRefs: false }, ref));
139
139
  })] }));
@@ -0,0 +1,4 @@
1
+ export interface ReferenceLinkProps {
2
+ name: string;
3
+ }
4
+ export declare const APIReferenceLink: ({ name }: ReferenceLinkProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import virtual from 'doom-@global-virtual';
3
+ import { ACP_BASE } from '../../shared/constants.js';
4
+ import { ExternalSiteLink } from './ExternalSiteLink.js';
5
+ import { X } from './_X.js';
6
+ const SELF_REFERENCE_BASES = new Set(['/', ACP_BASE]);
7
+ export const APIReferenceLink = ({ name }) => {
8
+ const href = `/apis/references/${name}.html`;
9
+ if (SELF_REFERENCE_BASES.has(virtual.userBase)) {
10
+ return _jsx(X.a, { href: href, children: name });
11
+ }
12
+ return (_jsx(ExternalSiteLink, { name: "acp", href: href, children: name }));
13
+ };
@@ -34,7 +34,7 @@ export const ExternalSiteBase = ({ name, template }) => {
34
34
  const lang = useLang();
35
35
  const displayName = useMemo(() => site?.displayName?.[lang] || site?.displayName?.en || name.toUpperCase(), [lang, name, site?.displayName]);
36
36
  if (!site) {
37
- return (_jsxs(Directive, { type: "danger", children: ["No site with name `", name, "` found, please ensure it's already defined at `sites.yaml`"] }));
37
+ throw new Error(`No site with name \`${name}\` found, please ensure it's already defined at \`sites.yaml\``);
38
38
  }
39
39
  const Notes = template === 'apisOverview' ? ApisOverviewNotes : SiteNotes;
40
40
  const Note = Notes[lang] || Notes.en;
@@ -2,6 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
2
2
  import { FallbackHeading } from '@rspress/core/theme';
3
3
  import virtual from 'doom-@api-virtual';
4
4
  import { plural } from 'pluralize';
5
+ import { APIReferenceLink } from './_APIReferenceLink.js';
5
6
  import { X } from './_X.js';
6
7
  const QueryParameters = ({ fieldValidation = true, }) => {
7
8
  return (_jsxs(_Fragment, { children: [_jsx("dl", { children: _jsx("dt", { children: "Query parameters" }) }), _jsxs(X.table, { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "Parameter" }), _jsx("th", { children: "Type" }), _jsx("th", { children: "Description" })] }) }), _jsxs("tbody", { children: [_jsxs("tr", { children: [_jsx("td", { children: _jsx("code", { children: "dryRun" }) }), _jsx("td", { children: _jsx("code", { children: "string" }) }), _jsx("td", { children: "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed" })] }), fieldValidation && (_jsxs("tr", { children: [_jsx("td", { children: _jsx("code", { children: "fieldValidation" }) }), _jsx("td", { children: _jsx("code", { children: "string" }) }), _jsx("td", { children: "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered." })] }))] })] })] }));
@@ -9,8 +10,8 @@ const QueryParameters = ({ fieldValidation = true, }) => {
9
10
  const BodyParameters = ({ kind }) => {
10
11
  return (_jsxs(_Fragment, { children: [_jsx("dl", { children: _jsx("dt", { children: "Body parameters" }) }), _jsxs(X.table, { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "Parameter" }), _jsx("th", { children: "Type" }), _jsx("th", { children: "Description" })] }) }), _jsx("tbody", { children: _jsxs("tr", { children: [_jsx("td", { children: _jsx("code", { children: "body" }) }), _jsxs("td", { children: [_jsx("code", { children: kind }), " schema"] }), _jsxs("td", { children: [_jsx("code", { children: "application/json" }), " formatted"] })] }) })] })] }));
11
12
  };
12
- const K8sAPIListEndpoint = ({ kind }) => (_jsxs(_Fragment, { children: [_jsxs("dl", { children: [_jsx("dt", { children: "HTTP method" }), _jsx("dd", { children: _jsx("code", { children: "DELETE" }) }), _jsx("dt", { children: "Description" }), _jsxs("dd", { children: ["delete collection of ", kind] }), _jsx("dt", { children: "HTTP responses" })] }), _jsxs(X.table, { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "HTTP code" }), _jsx("th", { children: "Response body" })] }) }), _jsxs("tbody", { children: [_jsxs("tr", { children: [_jsx("td", { children: "200 - OK" }), _jsxs("td", { children: [_jsx("code", { children: _jsx(X.a, { href: "#status", children: "Status" }) }), ' ', "schema"] })] }), _jsxs("tr", { children: [_jsx("td", { children: "401 - Unauthorized" }), _jsx("td", { children: "Empty" })] })] })] }), _jsxs("dl", { children: [_jsx("dt", { children: "HTTP method" }), _jsx("dd", { children: _jsx("code", { children: "GET" }) }), _jsx("dt", { children: "Description" }), _jsxs("dd", { children: ["list objects of kind ", kind] }), _jsx("dt", { children: "HTTP responses" })] }), _jsxs(X.table, { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "HTTP code" }), _jsx("th", { children: "Response body" })] }) }), _jsxs("tbody", { children: [_jsxs("tr", { children: [_jsx("td", { children: "200 - OK" }), _jsxs("td", { children: [_jsxs("code", { children: [kind, "List"] }), " schema"] })] }), _jsxs("tr", { children: [_jsx("td", { children: "401 - Unauthorized" }), _jsx("td", { children: "Empty" })] })] })] }), _jsxs("dl", { children: [_jsx("dt", { children: "HTTP method" }), _jsx("dd", { children: _jsx("code", { children: "POST" }) }), _jsx("dt", { children: "Description" }), _jsxs("dd", { children: ["create a new ", kind] })] }), _jsx(QueryParameters, {}), _jsx(BodyParameters, { kind: kind }), _jsx("dl", { children: _jsx("dt", { children: "HTTP responses" }) }), _jsxs(X.table, { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "HTTP code" }), _jsx("th", { children: "Response body" })] }) }), _jsxs("tbody", { children: [_jsxs("tr", { children: [_jsx("td", { children: "200 - OK" }), _jsxs("td", { children: [_jsx("code", { children: kind }), " schema"] })] }), _jsxs("tr", { children: [_jsx("td", { children: "201 - Created" }), _jsxs("td", { children: [_jsx("code", { children: kind }), " schema"] })] }), _jsxs("tr", { children: [_jsx("td", { children: "202 - Accepted" }), _jsxs("td", { children: [_jsx("code", { children: kind }), " schema"] })] }), _jsxs("tr", { children: [_jsx("td", { children: "401 - Unauthorized" }), _jsx("td", { children: "Empty" })] })] })] })] }));
13
- const K8sAPIItemEndpoint = ({ kind }) => (_jsxs(_Fragment, { children: [_jsxs("dl", { children: [_jsx("dt", { children: "HTTP method" }), _jsx("dd", { children: _jsx("code", { children: "DELETE" }) }), _jsx("dt", { children: "Description" }), _jsxs("dd", { children: ["delete the specified ", kind] })] }), _jsx(QueryParameters, { fieldValidation: false }), _jsx("dl", { children: _jsx("dt", { children: "HTTP responses" }) }), _jsxs(X.table, { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "HTTP code" }), _jsx("th", { children: "Response body" })] }) }), _jsxs("tbody", { children: [_jsxs("tr", { children: [_jsx("td", { children: "200 - OK" }), _jsxs("td", { children: [_jsx("code", { children: _jsx(X.a, { href: "#status", children: "Status" }) }), ' ', "schema"] })] }), _jsxs("tr", { children: [_jsx("td", { children: "202 - Accepted" }), _jsxs("td", { children: [_jsx("code", { children: _jsx(X.a, { href: "#status", children: "Status" }) }), ' ', "schema"] })] }), _jsxs("tr", { children: [_jsx("td", { children: "401 - Unauthorized" }), _jsx("td", { children: "Empty" })] })] })] }), _jsxs("dl", { children: [_jsx("dt", { children: "HTTP method" }), _jsx("dd", { children: _jsx("code", { children: "GET" }) }), _jsx("dt", { children: "Description" }), _jsxs("dd", { children: ["read the specified ", kind] }), _jsx("dt", { children: "HTTP responses" })] }), _jsxs(X.table, { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "HTTP code" }), _jsx("th", { children: "Response body" })] }) }), _jsxs("tbody", { children: [_jsxs("tr", { children: [_jsx("td", { children: "200 - OK" }), _jsxs("td", { children: [_jsx("code", { children: kind }), " schema"] })] }), _jsxs("tr", { children: [_jsx("td", { children: "401 - Unauthorized" }), _jsx("td", { children: "Empty" })] })] })] }), _jsxs("dl", { children: [_jsx("dt", { children: "HTTP method" }), _jsx("dd", { children: _jsx("code", { children: "PATCH" }) }), _jsx("dt", { children: "Description" }), _jsxs("dd", { children: ["partially update the specified ", kind] })] }), _jsx(QueryParameters, {}), _jsx("dl", { children: _jsx("dt", { children: "HTTP responses" }) }), _jsxs(X.table, { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "HTTP code" }), _jsx("th", { children: "Response body" })] }) }), _jsxs("tbody", { children: [_jsxs("tr", { children: [_jsx("td", { children: "200 - OK" }), _jsxs("td", { children: [_jsx("code", { children: kind }), " schema"] })] }), _jsxs("tr", { children: [_jsx("td", { children: "401 - Unauthorized" }), _jsx("td", { children: "Empty" })] })] })] }), _jsxs("dl", { children: [_jsx("dt", { children: "HTTP method" }), _jsx("dd", { children: _jsx("code", { children: "PUT" }) }), _jsx("dt", { children: "Description" }), _jsxs("dd", { children: ["replace the specified ", kind] })] }), _jsx(QueryParameters, {}), _jsx(BodyParameters, { kind: kind }), _jsx("dl", { children: _jsx("dt", { children: "HTTP responses" }) }), _jsxs(X.table, { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "HTTP code" }), _jsx("th", { children: "Response body" })] }) }), _jsxs("tbody", { children: [_jsxs("tr", { children: [_jsx("td", { children: "200 - OK" }), _jsxs("td", { children: [_jsx("code", { children: kind }), " schema"] })] }), _jsxs("tr", { children: [_jsx("td", { children: "201 - Created" }), _jsxs("td", { children: [_jsx("code", { children: kind }), " schema"] })] }), _jsxs("tr", { children: [_jsx("td", { children: "401 - Unauthorized" }), _jsx("td", { children: "Empty" })] })] })] })] }));
13
+ const K8sAPIListEndpoint = ({ kind }) => (_jsxs(_Fragment, { children: [_jsxs("dl", { children: [_jsx("dt", { children: "HTTP method" }), _jsx("dd", { children: _jsx("code", { children: "DELETE" }) }), _jsx("dt", { children: "Description" }), _jsxs("dd", { children: ["delete collection of ", kind] }), _jsx("dt", { children: "HTTP responses" })] }), _jsxs(X.table, { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "HTTP code" }), _jsx("th", { children: "Response body" })] }) }), _jsxs("tbody", { children: [_jsxs("tr", { children: [_jsx("td", { children: "200 - OK" }), _jsxs("td", { children: [_jsx("code", { children: _jsx(APIReferenceLink, { name: "Status" }) }), ' ', "schema"] })] }), _jsxs("tr", { children: [_jsx("td", { children: "401 - Unauthorized" }), _jsx("td", { children: "Empty" })] })] })] }), _jsxs("dl", { children: [_jsx("dt", { children: "HTTP method" }), _jsx("dd", { children: _jsx("code", { children: "GET" }) }), _jsx("dt", { children: "Description" }), _jsxs("dd", { children: ["list objects of kind ", kind] }), _jsx("dt", { children: "HTTP responses" })] }), _jsxs(X.table, { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "HTTP code" }), _jsx("th", { children: "Response body" })] }) }), _jsxs("tbody", { children: [_jsxs("tr", { children: [_jsx("td", { children: "200 - OK" }), _jsxs("td", { children: [_jsxs("code", { children: [kind, "List"] }), " schema"] })] }), _jsxs("tr", { children: [_jsx("td", { children: "401 - Unauthorized" }), _jsx("td", { children: "Empty" })] })] })] }), _jsxs("dl", { children: [_jsx("dt", { children: "HTTP method" }), _jsx("dd", { children: _jsx("code", { children: "POST" }) }), _jsx("dt", { children: "Description" }), _jsxs("dd", { children: ["create a new ", kind] })] }), _jsx(QueryParameters, {}), _jsx(BodyParameters, { kind: kind }), _jsx("dl", { children: _jsx("dt", { children: "HTTP responses" }) }), _jsxs(X.table, { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "HTTP code" }), _jsx("th", { children: "Response body" })] }) }), _jsxs("tbody", { children: [_jsxs("tr", { children: [_jsx("td", { children: "200 - OK" }), _jsxs("td", { children: [_jsx("code", { children: kind }), " schema"] })] }), _jsxs("tr", { children: [_jsx("td", { children: "201 - Created" }), _jsxs("td", { children: [_jsx("code", { children: kind }), " schema"] })] }), _jsxs("tr", { children: [_jsx("td", { children: "202 - Accepted" }), _jsxs("td", { children: [_jsx("code", { children: kind }), " schema"] })] }), _jsxs("tr", { children: [_jsx("td", { children: "401 - Unauthorized" }), _jsx("td", { children: "Empty" })] })] })] })] }));
14
+ const K8sAPIItemEndpoint = ({ kind }) => (_jsxs(_Fragment, { children: [_jsxs("dl", { children: [_jsx("dt", { children: "HTTP method" }), _jsx("dd", { children: _jsx("code", { children: "DELETE" }) }), _jsx("dt", { children: "Description" }), _jsxs("dd", { children: ["delete the specified ", kind] })] }), _jsx(QueryParameters, { fieldValidation: false }), _jsx("dl", { children: _jsx("dt", { children: "HTTP responses" }) }), _jsxs(X.table, { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "HTTP code" }), _jsx("th", { children: "Response body" })] }) }), _jsxs("tbody", { children: [_jsxs("tr", { children: [_jsx("td", { children: "200 - OK" }), _jsxs("td", { children: [_jsx("code", { children: _jsx(APIReferenceLink, { name: "Status" }) }), ' ', "schema"] })] }), _jsxs("tr", { children: [_jsx("td", { children: "202 - Accepted" }), _jsxs("td", { children: [_jsx("code", { children: _jsx(APIReferenceLink, { name: "Status" }) }), ' ', "schema"] })] }), _jsxs("tr", { children: [_jsx("td", { children: "401 - Unauthorized" }), _jsx("td", { children: "Empty" })] })] })] }), _jsxs("dl", { children: [_jsx("dt", { children: "HTTP method" }), _jsx("dd", { children: _jsx("code", { children: "GET" }) }), _jsx("dt", { children: "Description" }), _jsxs("dd", { children: ["read the specified ", kind] }), _jsx("dt", { children: "HTTP responses" })] }), _jsxs(X.table, { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "HTTP code" }), _jsx("th", { children: "Response body" })] }) }), _jsxs("tbody", { children: [_jsxs("tr", { children: [_jsx("td", { children: "200 - OK" }), _jsxs("td", { children: [_jsx("code", { children: kind }), " schema"] })] }), _jsxs("tr", { children: [_jsx("td", { children: "401 - Unauthorized" }), _jsx("td", { children: "Empty" })] })] })] }), _jsxs("dl", { children: [_jsx("dt", { children: "HTTP method" }), _jsx("dd", { children: _jsx("code", { children: "PATCH" }) }), _jsx("dt", { children: "Description" }), _jsxs("dd", { children: ["partially update the specified ", kind] })] }), _jsx(QueryParameters, {}), _jsx("dl", { children: _jsx("dt", { children: "HTTP responses" }) }), _jsxs(X.table, { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "HTTP code" }), _jsx("th", { children: "Response body" })] }) }), _jsxs("tbody", { children: [_jsxs("tr", { children: [_jsx("td", { children: "200 - OK" }), _jsxs("td", { children: [_jsx("code", { children: kind }), " schema"] })] }), _jsxs("tr", { children: [_jsx("td", { children: "401 - Unauthorized" }), _jsx("td", { children: "Empty" })] })] })] }), _jsxs("dl", { children: [_jsx("dt", { children: "HTTP method" }), _jsx("dd", { children: _jsx("code", { children: "PUT" }) }), _jsx("dt", { children: "Description" }), _jsxs("dd", { children: ["replace the specified ", kind] })] }), _jsx(QueryParameters, {}), _jsx(BodyParameters, { kind: kind }), _jsx("dl", { children: _jsx("dt", { children: "HTTP responses" }) }), _jsxs(X.table, { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "HTTP code" }), _jsx("th", { children: "Response body" })] }) }), _jsxs("tbody", { children: [_jsxs("tr", { children: [_jsx("td", { children: "200 - OK" }), _jsxs("td", { children: [_jsx("code", { children: kind }), " schema"] })] }), _jsxs("tr", { children: [_jsx("td", { children: "201 - Created" }), _jsxs("td", { children: [_jsx("code", { children: kind }), " schema"] })] }), _jsxs("tr", { children: [_jsx("td", { children: "401 - Unauthorized" }), _jsx("td", { children: "Empty" })] })] })] })] }));
14
15
  const K8sAPIStatusEndpoint = ({ kind }) => (_jsxs(_Fragment, { children: [_jsxs("dl", { children: [_jsx("dt", { children: "HTTP method" }), _jsx("dd", { children: _jsx("code", { children: "GET" }) }), _jsx("dt", { children: "Description" }), _jsxs("dd", { children: ["read status of the specified ", kind] }), _jsx("dt", { children: "HTTP responses" })] }), _jsxs(X.table, { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "HTTP code" }), _jsx("th", { children: "Response body" })] }) }), _jsxs("tbody", { children: [_jsxs("tr", { children: [_jsx("td", { children: "200 - OK" }), _jsxs("td", { children: [_jsx("code", { children: kind }), " schema"] })] }), _jsxs("tr", { children: [_jsx("td", { children: "401 - Unauthorized" }), _jsx("td", { children: "Empty" })] })] })] }), _jsxs("dl", { children: [_jsx("dt", { children: "HTTP method" }), _jsx("dd", { children: _jsx("code", { children: "PATCH" }) }), _jsx("dt", { children: "Description" }), _jsxs("dd", { children: ["partially update status of the specified ", kind] })] }), _jsx(QueryParameters, {}), _jsx("dl", { children: _jsx("dt", { children: "HTTP responses" }) }), _jsxs(X.table, { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "HTTP code" }), _jsx("th", { children: "Response body" })] }) }), _jsxs("tbody", { children: [_jsxs("tr", { children: [_jsx("td", { children: "200 - OK" }), _jsxs("td", { children: [_jsx("code", { children: kind }), " schema"] })] }), _jsxs("tr", { children: [_jsx("td", { children: "401 - Unauthorized" }), _jsx("td", { children: "Empty" })] })] })] }), _jsxs("dl", { children: [_jsx("dt", { children: "HTTP method" }), _jsx("dd", { children: _jsx("code", { children: "PUT" }) }), _jsx("dt", { children: "Description" }), _jsxs("dd", { children: ["replace status of the specified ", kind] })] }), _jsx(QueryParameters, {}), _jsx(BodyParameters, { kind: kind }), _jsx("dl", { children: _jsx("dt", { children: "HTTP responses" }) }), _jsxs(X.table, { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "HTTP code" }), _jsx("th", { children: "Response body" })] }) }), _jsxs("tbody", { children: [_jsxs("tr", { children: [_jsx("td", { children: "200 - OK" }), _jsxs("td", { children: [_jsx("code", { children: kind }), " schema"] })] }), _jsxs("tr", { children: [_jsx("td", { children: "201 - Created" }), _jsxs("td", { children: [_jsx("code", { children: kind }), " schema"] })] }), _jsxs("tr", { children: [_jsx("td", { children: "401 - Unauthorized" }), _jsx("td", { children: "Empty" })] })] })] })] }));
15
16
  export const K8sAPIEndpoints = ({ hasStatus, group, version, kind, pathPrefix: pathPrefix_, namespaced = true, }) => {
16
17
  const pathPrefix = pathPrefix_ ?? (virtual.pathPrefix || '');
@@ -3,6 +3,7 @@ import { FallbackHeading } from '@rspress/core/theme';
3
3
  import { Fragment, useMemo } from 'react';
4
4
  import { resolveRef } from '../utils.js';
5
5
  import { Markdown } from './Markdown.js';
6
+ import { APIReferenceLink } from './_APIReferenceLink.js';
6
7
  import { X } from './_X.js';
7
8
  const getSchemaValue = (schema, key = 'type') => {
8
9
  if (schema[key]) {
@@ -48,7 +49,7 @@ export const K8sAPISchemaItem = ({ schema, fullSchema, propertyPath = '', }) =>
48
49
  return (_jsxs(_Fragment, { children: [_jsx(K8sAPISchemaItemBasic, { schema: schema }), !propertyPath && _jsx(FallbackHeading, { level: 2, title: "Specification" }), isArraySchema && (_jsxs(_Fragment, { children: [_jsx("div", { className: "rp-toc-exclude", children: _jsx(FallbackHeading, { level: 3, title: `${propertyPath}[]` }) }), _jsx(K8sAPISchemaItemBasic, { schema: nestedSchema })] })), propertiesEntry && (_jsxs(_Fragment, { children: [_jsxs(X.table, { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "Property" }), _jsx("th", { children: "Type" }), _jsx("th", { children: "Description" })] }) }), _jsx("tbody", { children: propertiesEntry.map(([key, value]) => {
49
50
  const description = getSchemaValue(value, 'description');
50
51
  const isMetadata = key === METADATA;
51
- return (_jsxs("tr", { children: [_jsx("td", { children: _jsx("code", { children: key }) }), _jsx("td", { children: isMetadata ? (_jsx("code", { children: _jsx(X.a, { href: "/apis/references/ObjectMeta.html", children: "ObjectMeta" }) })) : (typeCode(getSchemaValue(value))) }), _jsx("td", { children: _jsx(Markdown, { children: description ||
52
+ return (_jsxs("tr", { children: [_jsx("td", { children: _jsx("code", { children: key }) }), _jsx("td", { children: isMetadata ? (_jsx("code", { children: _jsx(APIReferenceLink, { name: "ObjectMeta" }) })) : (typeCode(getSchemaValue(value))) }), _jsx("td", { children: _jsx(Markdown, { children: description ||
52
53
  (isMetadata ? DEFAULT_METADATA_DESCRIPTION : '') }) })] }, key));
53
54
  }) })] }), propertiesEntry.map(([key, value]) => {
54
55
  const type = getSchemaValue(value);
@@ -1,5 +1,4 @@
1
1
  export * from '@rspress/core/theme-original';
2
- export { EditLink } from './EditLink.tsx';
3
- export { Layout } from './Layout.tsx';
4
- export { Link } from './Link.tsx';
5
- export { Search } from './Search.tsx';
2
+ export { EditLink } from './EditLink.js';
3
+ export { Layout } from './Layout.js';
4
+ export { Search } from './Search.js';
@@ -1,6 +1,5 @@
1
1
  /* eslint-disable import-x/export */
2
2
  export * from '@rspress/core/theme-original';
3
- export { EditLink } from "./EditLink.js";
4
- export { Layout } from "./Layout.js";
5
- export { Link } from "./Link.js";
6
- export { Search } from "./Search.js";
3
+ export { EditLink } from './EditLink.js';
4
+ export { Layout } from './Layout.js';
5
+ export { Search } from './Search.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alauda/doom",
3
- "version": "1.18.1",
3
+ "version": "1.18.3",
4
4
  "type": "module",
5
5
  "description": "Doctor Doom making docs.",
6
6
  "repository": {
@@ -155,6 +155,10 @@ td {
155
155
  }
156
156
  }
157
157
  }
158
+
159
+ code .rp-link[target='_blank'] {
160
+ white-space: nowrap;
161
+ }
158
162
  }
159
163
 
160
164
  &-list-decimal:not(:has(p)) {
@@ -1,2 +0,0 @@
1
- import { type LinkProps } from '@rspress/core/theme-original';
2
- export declare const Link: (props: LinkProps) => import("react/jsx-runtime").JSX.Element;
package/lib/theme/Link.js DELETED
@@ -1,14 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { Link as OriginalLink, } from '@rspress/core/theme-original';
3
- export const Link = (props) => {
4
- if (typeof location !== 'undefined' &&
5
- props.href?.startsWith(`${location.protocol}//${location.host}`)) {
6
- return _jsx("a", { ...props });
7
- }
8
- return (_jsx(OriginalLink, { ...props, download:
9
- // type-coverage:ignore-next-line -- out of control
10
- props.download == null
11
- ? props.href?.endsWith('.pdf')
12
- : // type-coverage:ignore-next-line -- out of control
13
- props.download }));
14
- };