@alauda/doom 1.0.1 → 1.0.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.
package/lib/cli/new.js CHANGED
@@ -107,7 +107,7 @@ export const newCommand = new Command('new')
107
107
  const source = path.resolve(base, render(layout.source, { parameters }));
108
108
  const target = path.resolve(render(layout.target, { parameters }));
109
109
  const when = layout.when && render(layout.when, { parameters });
110
- if (JS_STR_FALSY_VALUES.has(when)) {
110
+ if (when != null && JS_STR_FALSY_VALUES.has(when)) {
111
111
  continue;
112
112
  }
113
113
  switch (layout.type) {
@@ -247,6 +247,9 @@ export const translateCommand = new Command('translate')
247
247
  if (sourceFrontmatter.i18n?.title?.[target]) {
248
248
  newFrontmatter.title = sourceFrontmatter.i18n.title[target];
249
249
  }
250
+ if (typeof newFrontmatter.title !== 'string') {
251
+ delete newFrontmatter.title;
252
+ }
250
253
  targetContent = matter.stringify(content.startsWith('\n') ? content : '\n' + content, newFrontmatter);
251
254
  await fs.mkdir(targetBase, { recursive: true });
252
255
  await fs.writeFile(targetFilePath, targetContent);
@@ -33,7 +33,7 @@ const ExternalSiteLink_ = ({ name, href = '', className, ...props }) => {
33
33
  ? site.base
34
34
  : addTrailingSlash(site.base + site.version)) +
35
35
  (lang ? addTrailingSlash(lang) : '') +
36
- (hash ? `${url}#${hash}` : url), target: "_blank", rel: "noopener noreferrer", className: clsx(classes.link, 'cursor-pointer', className), ...props }));
36
+ (hash ? `${url}#${hash}` : url), target: "_blank", rel: "noopener noreferrer", className: clsx(classes.link, 'rp-cursor-pointer', className), ...props }));
37
37
  };
38
38
  export const ExternalSiteLink = (props) => (_jsx(NoSSR, { children: _jsx(ExternalSiteLink_, { ...props }) }));
39
39
  export default ExternalSiteLink;
@@ -51,7 +51,7 @@ export const K8sCrdSchema = ({ schema, version, }) => {
51
51
  const toggleExpandAll = useCallback(() => {
52
52
  setExpandAll((all) => !all);
53
53
  }, []);
54
- return (_jsxs(_Fragment, { children: [_jsx(Markdown, { children: description }), _jsxs("div", { className: "flex items-center", children: [_jsxs("span", { children: [_jsx("code", { children: version }), " ", _jsx(Badge, { children: "version" })] }), !isPrint && properties != null && (_jsx(Button, { className: "ml-auto doom-btn", type: "button", text: _jsxs("span", { onClick: toggleExpandAll, children: [expandAll ? '-' : '+', ' ', t(expandAll ? 'collapse_all' : 'expand_all')] }), size: "medium", theme: "alt" }))] }), properties == null ? (_jsx(Directive, { type: "warning", children: t('crd_no_schema') })) : (_jsx("div", { className: "doom-collapse-group", children: Object.entries(properties).map(([name, subSchema]) => SKIPPED_PROPERTIES.includes(name) || (_jsx(K8sCrdSchemaPart, { name: name, parent: schema, schema: subSchema, expandAll: expandAll }, name))) }))] }));
54
+ return (_jsxs(_Fragment, { children: [_jsx(Markdown, { children: description }), _jsxs("div", { className: "rp-flex rp-items-center", children: [_jsxs("span", { children: [_jsx("code", { children: version }), " ", _jsx(Badge, { children: "version" })] }), !isPrint && properties != null && (_jsx(Button, { className: "rp-ml-auto doom-btn", type: "button", size: "medium", theme: "alt", children: _jsxs("span", { onClick: toggleExpandAll, children: [expandAll ? '-' : '+', ' ', t(expandAll ? 'collapse_all' : 'expand_all')] }) }))] }), properties == null ? (_jsx(Directive, { type: "warning", children: t('crd_no_schema') })) : (_jsx("div", { className: "doom-collapse-group", children: Object.entries(properties).map(([name, subSchema]) => SKIPPED_PROPERTIES.includes(name) || (_jsx(K8sCrdSchemaPart, { name: name, parent: schema, schema: subSchema, expandAll: expandAll }, name))) }))] }));
55
55
  };
56
56
  export const K8sCrd = ({ name, crdPath }) => {
57
57
  const [, crd] = useMemo(() => Object.entries(crdsMap).find(([pathname, crd]) => {
@@ -112,7 +112,7 @@ export function Overview(props) {
112
112
  return [];
113
113
  }, [getGroup, overviewSidebarGroups]);
114
114
  const groups = customGroups ?? defaultGroups;
115
- return (_jsxs("div", { className: "overview-index doom-overview-index mx-auto", children: [content, groups.map((group) => (_jsxs(Fragment, { children: [(!title || [title, defaultGroupTitle].includes(group.name)) &&
116
- groups.length === 1 ? (_jsx("h2", { style: { paddingTop: 0 } })) : (_jsx("h2", { children: renderInlineMarkdown(group.name) })), _jsx("div", { className: classes.overviewGroups, children: group.items.map((item) => (_jsxs("div", { className: classes.overviewGroup, children: [_jsx("h3", { style: { marginBottom: 8 }, children: _jsx(Link, { href: normalizeHref(item.link), children: renderInlineMarkdown(item.text) }) }), _jsx("div", { className: classes.overviewDescription, children: item.description }), _jsx("ul", { className: "list-none", children: item.headers?.map((header) => (_jsx("li", { className: `${classes.overviewGroupLi} ${classes[`level${header.depth}`]} first:mt-2`, children: _jsx(Link, { href: `${normalizeHref(item.link)}#${header.id}`, children: renderInlineMarkdown(header.text) }) }, header.id))) })] }, item.link))) })] }, group.name)))] }));
115
+ return (_jsxs("div", { className: "overview-index doom-overview-index rp-mx-auto", children: [content, groups.map((group) => (_jsxs(Fragment, { children: [(!title || [title, defaultGroupTitle].includes(group.name)) &&
116
+ groups.length === 1 ? (_jsx("h2", { style: { paddingTop: 0 } })) : (_jsx("h2", { ...renderInlineMarkdown(group.name) })), _jsx("div", { className: classes.overviewGroups, children: group.items.map((item) => (_jsxs("div", { className: classes.overviewGroup, children: [_jsx("h3", { style: { marginBottom: 8 }, children: _jsx(Link, { href: normalizeHref(item.link), ...renderInlineMarkdown(item.text) }) }), _jsx("div", { className: classes.overviewDescription, children: item.description }), _jsx("ul", { className: "rp-list-none", children: item.headers?.map((header) => (_jsx("li", { className: `${classes.overviewGroupLi} ${classes[`level${header.depth}`]} first:rp-mt-2`, children: _jsx(Link, { href: `${normalizeHref(item.link)}#${header.id}`, ...renderInlineMarkdown(header.text) }) }, header.id))) })] }, item.link))) })] }, group.name)))] }));
117
117
  }
118
118
  export default Overview;
@@ -17,7 +17,7 @@ export declare const X: {
17
17
  blockquote: (props: import("react").ComponentProps<"blockquote">) => import("react/jsx-runtime").JSX.Element;
18
18
  strong: (props: import("react").ComponentProps<"strong">) => import("react/jsx-runtime").JSX.Element;
19
19
  a: (props: import("react").ComponentProps<"a">) => import("react/jsx-runtime").JSX.Element;
20
- code: (props: import("react").HTMLProps<HTMLElement>) => import("react/jsx-runtime").JSX.Element;
21
- pre: ({ containerElementClassName, children, className, title, codeButtonGroupProps, ...otherProps }: import("@rspress/theme-default").PreWithCodeButtonGroupProps) => import("react/jsx-runtime").JSX.Element | null;
20
+ code: typeof import("@rspress/theme-default").Code;
21
+ pre: typeof import("@rspress/theme-default").PreWithCodeButtonGroup;
22
22
  img: (props: import("react").ComponentProps<"img">) => import("react/jsx-runtime").JSX.Element;
23
23
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alauda/doom",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "type": "module",
5
5
  "description": "Doctor Doom making docs.",
6
6
  "repository": "git+https://github.com/alauda/doom.git",
@@ -34,30 +34,30 @@
34
34
  "rspress-plugins"
35
35
  ],
36
36
  "dependencies": {
37
- "@cspell/eslint-plugin": "^9.0.2",
38
- "@eslint-react/eslint-plugin": "^1.51.0",
37
+ "@cspell/eslint-plugin": "^8.19.4 || ^9.0.2",
38
+ "@eslint-react/eslint-plugin": "^1.51.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.52.0",
42
42
  "@rsbuild/plugin-sass": "^1.3.2",
43
43
  "@rsbuild/plugin-yaml": "^1.0.2",
44
- "@rspress/core": "2.0.0-beta.10",
45
- "@rspress/plugin-algolia": "2.0.0-beta.10",
46
- "@rspress/plugin-llms": "^2.0.0-beta.10",
47
- "@shikijs/transformers": "^3.5.0",
44
+ "@rspress/core": "2.0.0-beta.11",
45
+ "@rspress/plugin-algolia": "2.0.0-beta.11",
46
+ "@rspress/plugin-llms": "^2.0.0-beta.11",
47
+ "@shikijs/transformers": "^3.6.0",
48
48
  "chokidar": "^4.0.3",
49
49
  "cli-progress": "^3.12.0",
50
50
  "clsx": "^2.1.1",
51
- "commander": "^13.1.0",
51
+ "commander": "^13.1.0 || ^14.0.0",
52
52
  "ejs": "^3.1.10",
53
- "es-toolkit": "^1.38.0",
53
+ "es-toolkit": "^1.39.1",
54
54
  "eslint": "^9.28.0",
55
55
  "eslint-plugin-mdx": "^3.4.2",
56
56
  "html-tag-names": "^2.1.0",
57
57
  "mdast-util-mdx": "^3.0.0",
58
58
  "mdast-util-mdx-jsx": "^3.2.0",
59
59
  "mermaid": "^11.6.0",
60
- "openai": "^5.1.0",
60
+ "openai": "^5.1.1",
61
61
  "openapi-types": "^12.1.3",
62
62
  "p-ratelimit": "^1.0.1",
63
63
  "pdf-lib": "^1.17.1",
@@ -70,11 +70,12 @@
70
70
  "remark-gfm": "^4.0.1",
71
71
  "remark-mdx": "^3.1.0",
72
72
  "remark-stringify": "^11.0.0",
73
- "shiki": "^3.5.0",
74
- "simple-git": "^3.27.0",
73
+ "shiki": "^3.6.0",
74
+ "simple-git": "^3.28.0",
75
75
  "swagger2openapi": "^7.0.8",
76
76
  "tinyglobby": "^0.2.14",
77
77
  "type-fest": "^4.41.0",
78
+ "typescript": "^5.8.3",
78
79
  "typescript-eslint": "^8.33.1",
79
80
  "x-fetch": "^0.2.6",
80
81
  "yaml": "^2.8.0",