@alauda/doom 0.0.0-alpha.1 → 0.0.0-alpha.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/index.js +3 -1
- package/lib/plugins/auto-sidebar/index.js +2 -2
- package/lib/plugins/auto-sidebar/type.js +1 -0
- package/lib/plugins/auto-sidebar/utils.d.ts +1 -1
- package/lib/plugins/auto-sidebar/walk.js +1 -1
- package/lib/plugins/index.d.ts +2 -2
- package/lib/plugins/index.js +2 -2
- package/lib/runtime/components/Overview.js +2 -2
- package/lib/runtime/components/QuickNav.js +1 -1
- package/lib/runtime/components/index.d.ts +2 -2
- package/lib/runtime/components/index.js +2 -2
- package/lib/runtime/index.d.ts +1 -1
- package/lib/runtime/index.js +1 -1
- package/package.json +2 -1
package/lib/cli/index.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Adopted from @see https://github.com/web-infra-dev/rspress/blob/main/packages/cli/src/index.ts
|
|
4
4
|
*/
|
|
5
5
|
import path from 'node:path';
|
|
6
|
+
import { logger } from '@rsbuild/core';
|
|
6
7
|
import { build, dev, serve } from '@rspress/core';
|
|
7
8
|
import { watch } from 'chokidar';
|
|
8
9
|
import { program } from 'commander';
|
|
@@ -48,7 +49,8 @@ program
|
|
|
48
49
|
},
|
|
49
50
|
});
|
|
50
51
|
}
|
|
51
|
-
catch {
|
|
52
|
+
catch (err) {
|
|
53
|
+
logger.error(err);
|
|
52
54
|
devServer = undefined;
|
|
53
55
|
}
|
|
54
56
|
cliWatcher = watch(filepath ? [filepath, docDirectory] : [...CONFIG_FILES, docDirectory], {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { addTrailingSlash } from '@rspress/core';
|
|
2
2
|
import { logger } from '@rspress/shared/logger';
|
|
3
3
|
import path from 'node:path';
|
|
4
|
-
import { combineWalkResult } from './utils';
|
|
5
|
-
import { walk } from './walk';
|
|
4
|
+
import { combineWalkResult } from './utils.js';
|
|
5
|
+
import { walk } from './walk.js';
|
|
6
6
|
// Scan all the directories and files in the work directory(such as `docs`), and then generate the nav and sidebar configuration according to the directory structure.
|
|
7
7
|
// We will do as follows:
|
|
8
8
|
// 1. scan the directory structure, and extract all the `_meta.json` files.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { NavItem } from '@rspress/shared';
|
|
2
|
-
import { DoomSidebar } from './walk';
|
|
2
|
+
import { DoomSidebar } from './walk.js';
|
|
3
3
|
export declare function detectFilePath(rawPath: string, extensions: string[]): Promise<string | undefined>;
|
|
4
4
|
export declare function extractInfoFromFrontmatter(filePath: string, rootDir: string, extensions: string[]): Promise<{
|
|
5
5
|
realPath: string | undefined;
|
|
@@ -2,7 +2,7 @@ import { isExternalUrl, removeTrailingSlash, slash, withBase, } from '@rspress/s
|
|
|
2
2
|
import fs from '@rspress/shared/fs-extra';
|
|
3
3
|
import { logger } from '@rspress/shared/logger';
|
|
4
4
|
import path from 'node:path';
|
|
5
|
-
import { detectFilePath, extractInfoFromFrontmatter } from './utils';
|
|
5
|
+
import { detectFilePath, extractInfoFromFrontmatter } from './utils.js';
|
|
6
6
|
const sidebarSorter = (a, b) => {
|
|
7
7
|
if ('weight' in a && 'weight' in b) {
|
|
8
8
|
return a.weight - b.weight;
|
package/lib/plugins/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './auto-sidebar';
|
|
2
|
-
export * from './global';
|
|
1
|
+
export * from './auto-sidebar/index.js';
|
|
2
|
+
export * from './global/index.js';
|
package/lib/plugins/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './auto-sidebar';
|
|
2
|
-
export * from './global';
|
|
1
|
+
export * from './auto-sidebar/index.js';
|
|
2
|
+
export * from './global/index.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Fragment, useMemo } from 'react';
|
|
3
|
-
import { usePageData, normalizeHrefInRuntime as normalizeHref, withBase, isEqualPath, } from '@rspress/runtime';
|
|
4
2
|
import { Link, renderInlineMarkdown, useSidebarData } from '@rspress/core/theme';
|
|
3
|
+
import { isEqualPath, normalizeHrefInRuntime as normalizeHref, usePageData, withBase, } from '@rspress/runtime';
|
|
4
|
+
import { Fragment, useMemo } from 'react';
|
|
5
5
|
import classes from '../../../styles/overview.module.scss';
|
|
6
6
|
// The sidebar data include two types: sidebar item and sidebar group.
|
|
7
7
|
// In overpage page, we select all the related sidebar groups and show the groups in the page.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Link } from '@rspress/core/theme';
|
|
3
|
-
import classes from '../../../styles/quick-nav.module.scss';
|
|
4
3
|
import { normalizeImagePath } from '@rspress/core/runtime';
|
|
4
|
+
import classes from '../../../styles/quick-nav.module.scss';
|
|
5
5
|
export const QuickNav = ({ items }) => {
|
|
6
6
|
return (_jsx("ul", { className: classes.container, children: items.map((item, index) => (_jsxs("li", { className: classes.item, children: [_jsxs("div", { className: classes.title, title: item.title, children: [_jsx("img", { src: normalizeImagePath(item.icon), alt: item.title }), item.title] }), _jsx("hr", { className: classes.divider }), _jsx("ul", { className: classes.links, children: item.links.map((link, index) => (_jsx("li", { children: _jsx(Link, { href: link.href, title: link.title, children: link.title }) }, index))) })] }, index))) }));
|
|
7
7
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './Overview';
|
|
2
|
-
export * from './QuickNav';
|
|
1
|
+
export * from './Overview.js';
|
|
2
|
+
export * from './QuickNav.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './Overview';
|
|
2
|
-
export * from './QuickNav';
|
|
1
|
+
export * from './Overview.js';
|
|
2
|
+
export * from './QuickNav.js';
|
package/lib/runtime/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './components';
|
|
1
|
+
export * from './components/index.js';
|
package/lib/runtime/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alauda/doom",
|
|
3
|
-
"version": "0.0.0-alpha.
|
|
3
|
+
"version": "0.0.0-alpha.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Doctor Doom making docs.",
|
|
6
6
|
"repository": "https://gitlab-ce.alauda.cn/idp/Doom",
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
"lint:es": "eslint .",
|
|
29
29
|
"lint:tsc": "tsc -b --noEmit",
|
|
30
30
|
"prepare": "simple-git-hooks",
|
|
31
|
+
"prepublishOnly": "yarn build",
|
|
31
32
|
"swc-node": "node --enable-source-maps --import @swc-node/register/esm-register"
|
|
32
33
|
},
|
|
33
34
|
"dependencies": {
|