@alauda/doom 1.18.0 → 1.18.1

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.
@@ -1,10 +1,11 @@
1
1
  export interface K8sAPIProps {
2
2
  name: string;
3
+ namespaced?: boolean;
3
4
  pathPrefix?: string;
4
5
  filepath?: string;
5
6
  apiGroup?: string;
6
7
  apiVersion?: string;
7
8
  apiKind?: string;
8
9
  }
9
- export declare const K8sAPI: ({ name, pathPrefix, filepath, apiGroup, apiVersion, apiKind, }: K8sAPIProps) => import("react/jsx-runtime").JSX.Element | null;
10
+ export declare const K8sAPI: ({ name, namespaced, pathPrefix, filepath, apiGroup, apiVersion, apiKind, }: K8sAPIProps) => import("react/jsx-runtime").JSX.Element | null;
10
11
  export default K8sAPI;
@@ -5,7 +5,7 @@ import { useMemo } from 'react';
5
5
  import { resolveRef } from '../utils.js';
6
6
  import { K8sAPIEndpoints } from './_K8sAPIEndpoints.js';
7
7
  import { K8sAPISchema } from './_K8sAPISchema.js';
8
- export const K8sAPI = ({ name, pathPrefix, filepath, apiGroup, apiVersion, apiKind, }) => {
8
+ export const K8sAPI = ({ name, namespaced, pathPrefix, filepath, apiGroup, apiVersion, apiKind, }) => {
9
9
  const [, openapi] = useMemo(() => Object.entries(openapisMap).find(([pathname, openapi]) => {
10
10
  if (filepath && pathname !== filepath) {
11
11
  return;
@@ -56,6 +56,6 @@ export const K8sAPI = ({ name, pathPrefix, filepath, apiGroup, apiVersion, apiKi
56
56
  console.error(`No OpenAPI nor CustomResourceDefinition schema found for ${name}`);
57
57
  return null;
58
58
  }
59
- return schema ? (_jsxs(_Fragment, { children: [_jsx(K8sAPISchema, { schema: schema, fullSchema: openapi }), _jsx(K8sAPIEndpoints, { hasStatus: !!schema.properties?.status, group: apiGroup ?? k8sApiDef?.group, version: apiVersion ?? k8sApiDef?.version ?? '', kind: apiKind ?? k8sApiDef?.kind ?? '', pathPrefix: pathPrefix })] })) : null;
59
+ return schema ? (_jsxs(_Fragment, { children: [_jsx(K8sAPISchema, { schema: schema, fullSchema: openapi }), _jsx(K8sAPIEndpoints, { hasStatus: !!schema.properties?.status, group: apiGroup ?? k8sApiDef?.group, version: apiVersion ?? k8sApiDef?.version ?? '', kind: apiKind ?? k8sApiDef?.kind ?? '', pathPrefix: pathPrefix, namespaced: namespaced })] })) : null;
60
60
  };
61
61
  export default K8sAPI;
@@ -4,7 +4,8 @@ export interface K8sAPIDefinition {
4
4
  kind: string;
5
5
  }
6
6
  export interface K8sAPIEndpointsProps extends K8sAPIDefinition {
7
+ namespaced?: boolean;
7
8
  hasStatus?: boolean;
8
9
  pathPrefix?: string;
9
10
  }
10
- export declare const K8sAPIEndpoints: ({ hasStatus, group, version, kind, pathPrefix: pathPrefix_, }: K8sAPIEndpointsProps) => import("react/jsx-runtime").JSX.Element;
11
+ export declare const K8sAPIEndpoints: ({ hasStatus, group, version, kind, pathPrefix: pathPrefix_, namespaced, }: K8sAPIEndpointsProps) => import("react/jsx-runtime").JSX.Element;
@@ -12,8 +12,8 @@ const BodyParameters = ({ kind }) => {
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
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" })] })] })] })] }));
14
14
  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
- export const K8sAPIEndpoints = ({ hasStatus, group, version, kind, pathPrefix: pathPrefix_, }) => {
15
+ export const K8sAPIEndpoints = ({ hasStatus, group, version, kind, pathPrefix: pathPrefix_, namespaced = true, }) => {
16
16
  const pathPrefix = pathPrefix_ ?? (virtual.pathPrefix || '');
17
- const apiPath = `${pathPrefix}/${group ? `apis/${group}` : 'api'}/${version}/namespaces/{namespace}/${plural(kind).toLocaleLowerCase()}`;
17
+ const apiPath = `${pathPrefix}/${group ? `apis/${group}` : 'api'}/${version}/${namespaced ? `namespaces/{namespace}/` : ''}${plural(kind).toLocaleLowerCase()}`;
18
18
  return (_jsxs(_Fragment, { children: [_jsx(FallbackHeading, { level: 2, title: "API Endpoints" }), _jsx(X.p, { children: "The following API endpoints are available:" }), _jsxs(X.ul, { children: [_jsxs(X.li, { children: [_jsx("code", { children: apiPath }), _jsxs(X.ul, { children: [_jsxs(X.li, { children: [_jsx("code", { children: "DELETE" }), ": delete collection of ", kind] }), _jsxs(X.li, { children: [_jsx("code", { children: "GET" }), ": list objects of kind ", kind] }), _jsxs(X.li, { children: [_jsx("code", { children: "POST" }), ": create a new ", kind] })] })] }), _jsxs(X.li, { children: [_jsx("code", { children: `${apiPath}/{name}` }), _jsxs(X.ul, { children: [_jsxs(X.li, { children: [_jsx("code", { children: "DELETE" }), ": delete the specified ", kind] }), _jsxs(X.li, { children: [_jsx("code", { children: "GET" }), ": read the specified ", kind] }), _jsxs(X.li, { children: [_jsx("code", { children: "PATCH" }), ": partially update the specified ", kind] }), _jsxs(X.li, { children: [_jsx("code", { children: "PUT" }), ": replace the specified ", kind] })] })] }), hasStatus && (_jsxs(X.li, { children: [_jsx("code", { children: `${apiPath}/{name}/status` }), _jsxs(X.ul, { children: [_jsxs(X.li, { children: [_jsx("code", { children: "GET" }), ": read status of the specified ", kind] }), _jsxs(X.li, { children: [_jsx("code", { children: "PATCH" }), ": partially update status of the specified", ' ', kind] }), _jsxs(X.li, { children: [_jsx("code", { children: "PUT" }), ": replace status of the specified ", kind] })] })] }))] }), _jsx("div", { className: "rp-toc-exclude", children: _jsx(FallbackHeading, { level: 3, title: apiPath }) }), _jsx(K8sAPIListEndpoint, { kind: kind }), _jsx("div", { className: "rp-toc-exclude", children: _jsx(FallbackHeading, { level: 3, title: `${apiPath}/{name}` }) }), _jsx(K8sAPIItemEndpoint, { kind: kind }), hasStatus && (_jsxs(_Fragment, { children: [_jsx("div", { className: "rp-toc-exclude", children: _jsx(FallbackHeading, { level: 3, title: `${apiPath}/{name}/status` }) }), _jsx(K8sAPIStatusEndpoint, { kind: kind })] }))] }));
19
19
  };
@@ -1,4 +1,4 @@
1
- import { useSearchParams } from '@rspress/core/dist/runtime.js';
1
+ import { useSearchParams } from '@rspress/core/runtime';
2
2
  import { useState, useEffect, useCallback } from 'react';
3
3
  import { FALSY_VALUES } from '../../shared/index.js';
4
4
  export function useIsPrintQuery() {
@@ -13,7 +13,6 @@ const getPrintMediaQuery = () => {
13
13
  return matchMedia('print');
14
14
  };
15
15
  export function useIsPrintMedia() {
16
- // eslint-disable-next-line @eslint-react/naming-convention/use-state
17
16
  const [printMediaQuery] = useState(getPrintMediaQuery);
18
17
  const [isPrint, setIsPrint] = useState(!!printMediaQuery?.matches);
19
18
  const onChange = useCallback((mqList) => {
@@ -1,4 +1,4 @@
1
- import { useI18n, usePageData } from '@rspress/runtime';
1
+ import { useI18n, usePageData } from '@rspress/core/runtime';
2
2
  export function useEditLink() {
3
3
  const { siteData, page } = usePageData();
4
4
  const editLink = siteData.themeConfig.editLink;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alauda/doom",
3
- "version": "1.18.0",
3
+ "version": "1.18.1",
4
4
  "type": "module",
5
5
  "description": "Doctor Doom making docs.",
6
6
  "repository": {
@@ -42,20 +42,20 @@
42
42
  "dependencies": {
43
43
  "@alauda/doom-export": "^0.3.1",
44
44
  "@cspell/eslint-plugin": "^9.4.0",
45
- "@eslint-react/eslint-plugin": "^2.5.0",
46
- "@inquirer/prompts": "^8.1.0",
45
+ "@eslint-react/eslint-plugin": "^2.5.5",
46
+ "@inquirer/prompts": "^8.2.0",
47
47
  "@openapi-contrib/openapi-schema-to-json-schema": "^5.1.0",
48
48
  "@rsbuild/plugin-react": "^1.4.2",
49
49
  "@rsbuild/plugin-sass": "^1.4.0",
50
50
  "@rsbuild/plugin-svgr": "^1.2.3",
51
51
  "@rsbuild/plugin-yaml": "^1.0.3",
52
- "@rspress/core": "2.0.0-rc.4",
53
- "@rspress/plugin-algolia": "2.0.0-rc.4",
54
- "@rspress/plugin-sitemap": "2.0.0-rc.4",
55
- "@rspress/shared": "2.0.0-rc.4",
56
- "@shikijs/transformers": "^3.20.0",
52
+ "@rspress/core": "2.0.0-rc.5",
53
+ "@rspress/plugin-algolia": "2.0.0-rc.5",
54
+ "@rspress/plugin-sitemap": "2.0.0-rc.5",
55
+ "@rspress/shared": "2.0.0-rc.5",
56
+ "@shikijs/transformers": "^3.21.0",
57
57
  "@total-typescript/ts-reset": "^0.6.1",
58
- "@types/react": "^19.2.7",
58
+ "@types/react": "^19.2.8",
59
59
  "ab64": "^0.1.6",
60
60
  "chokidar": "^5.0.0",
61
61
  "clsx": "^2.1.1",
@@ -64,7 +64,7 @@
64
64
  "es-toolkit": "^1.43.0",
65
65
  "eslint": "^9.39.2",
66
66
  "eslint-plugin-mdx": "^3.6.2",
67
- "globals": "^16.5.0",
67
+ "globals": "^17.0.0",
68
68
  "html-tag-names": "^2.1.0",
69
69
  "jsencrypt": "^3.5.4",
70
70
  "masonry-layout": "^4.2.2",
@@ -74,7 +74,7 @@
74
74
  "mdast-util-to-markdown": "^2.1.2",
75
75
  "mdast-util-to-string": "^4.0.0",
76
76
  "mermaid": "^11.12.2",
77
- "openai": "^6.15.0",
77
+ "openai": "^6.16.0",
78
78
  "openapi-types": "^12.1.3",
79
79
  "p-ratelimit": "^1.0.1",
80
80
  "picomatch": "^4.0.3",
@@ -95,14 +95,14 @@
95
95
  "remark-mdx": "^3.1.1",
96
96
  "remark-message-control": "^8.0.0",
97
97
  "remark-stringify": "^11.0.0",
98
- "shiki": "^3.20.0",
98
+ "shiki": "^3.21.0",
99
99
  "simple-git": "^3.30.0",
100
100
  "string-width": "^8.1.0",
101
101
  "swagger2openapi": "^7.0.8",
102
102
  "tinyglobby": "^0.2.15",
103
103
  "type-fest": "^5.3.1",
104
104
  "typescript": "^5.9.3",
105
- "typescript-eslint": "^8.51.0",
105
+ "typescript-eslint": "^8.52.0",
106
106
  "unified": "^11.0.5",
107
107
  "unified-lint-rule": "^3.0.1",
108
108
  "unist-util-position": "^5.0.0",
@@ -130,10 +130,43 @@ td {
130
130
  --rp-code-block-bg: #{color.adjust($color: #242424, $lightness: 5%)};
131
131
  }
132
132
 
133
- .rspress {
133
+ .rp {
134
134
  &-sidebar-item {
135
135
  word-break: break-word;
136
136
  }
137
+
138
+ &-doc {
139
+ dl {
140
+ margin: 1rem 0;
141
+
142
+ dt {
143
+ font-weight: 600;
144
+ margin: 0.5rem 0;
145
+ }
146
+
147
+ dd {
148
+ display: flex;
149
+ flex-wrap: wrap;
150
+ gap: 0.5rem;
151
+ margin: 0.5rem 0 0.5rem 1rem;
152
+
153
+ > p {
154
+ margin: 0.5rem 0;
155
+ }
156
+ }
157
+ }
158
+ }
159
+
160
+ &-list-decimal:not(:has(p)) {
161
+ list-style: none;
162
+ counter-reset: section;
163
+ padding-left: 20px;
164
+
165
+ > li:before {
166
+ counter-increment: section;
167
+ content: counters(section, '.') '. ';
168
+ }
169
+ }
137
170
  }
138
171
 
139
172
  @mixin print {
@@ -163,37 +196,4 @@ td {
163
196
  @include print;
164
197
  }
165
198
 
166
- .rp-list-decimal:not(:has(p)) {
167
- list-style: none;
168
- counter-reset: section;
169
- padding-left: 20px;
170
-
171
- > li:before {
172
- counter-increment: section;
173
- content: counters(section, '.') '. ';
174
- }
175
- }
176
-
177
- .rp-doc {
178
- dl {
179
- margin: 1rem 0;
180
-
181
- dt {
182
- font-weight: 600;
183
- margin: 0.5rem 0;
184
- }
185
-
186
- dd {
187
- display: flex;
188
- flex-wrap: wrap;
189
- gap: 0.5rem;
190
- margin: 0.5rem 0 0.5rem 1rem;
191
-
192
- > p {
193
- margin: 0.5rem 0;
194
- }
195
- }
196
- }
197
- }
198
-
199
199
  @import 'intelligence.scss';