doc-render-sdk 0.0.6 → 0.0.8

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/README.md CHANGED
@@ -13,55 +13,30 @@
13
13
  - 🎯 **插件系统** - 支持自定义插件扩展功能
14
14
  - 📦 **零配置** - 开箱即用,同时支持深度定制
15
15
 
16
- ## 快速开始
16
+ ## 🚀 快速开始
17
17
 
18
- ### 安装
18
+ ### 1. CLI 工具
19
19
 
20
20
  ```bash
21
- npm install doc-render-sdk
22
- ```
23
-
24
- ### 基本使用
21
+ # 创建新项目
22
+ npx doc-render-sdk create my-docs
25
23
 
26
- ```javascript
27
- import DocSDK from 'doc-render-sdk';
24
+ # 启动开发服务器
25
+ npx doc-render-sdk dev
28
26
 
29
- const docSdk = new DocSDK({
30
- title: '我的组件库文档',
31
- theme: 'default',
32
- components: {
33
- 'my-component': {
34
- label: '我的组件',
35
- demos: [
36
- {
37
- title: '基础用法',
38
- desc: '组件的基础使用方式',
39
- source: 'basic'
40
- }
41
- ],
42
- apis: [
43
- {
44
- title: 'MyComponent',
45
- apiKey: 'my-component'
46
- }
47
- ]
48
- }
49
- }
50
- });
27
+ # 构建项目
28
+ npx doc-render-sdk build
51
29
 
52
- docSdk.render('#app');
30
+ # 迁移旧项目
31
+ npx doc-render-sdk migrate --source ./doc --target ./docs-new
53
32
  ```
54
33
 
55
- ## 🚀 快速开始
56
-
57
- ### 安装
34
+ ### 2. 安装
58
35
 
59
36
  ```bash
60
37
  npm install doc-render-sdk
61
38
  ```
62
39
 
63
- ### 基本使用
64
-
65
40
  ```javascript
66
41
  import DocSDK from 'doc-render-sdk';
67
42
 
@@ -90,21 +65,6 @@ const docSdk = new DocSDK({
90
65
  docSdk.render('#app');
91
66
  ```
92
67
 
93
- ### CLI 工具 (待支持)
94
-
95
- ```bash
96
- # 创建新项目
97
- npx doc-render-sdk create my-docs
98
-
99
- # 启动开发服务器
100
- npx doc-render-sdk dev
101
-
102
- # 构建项目
103
- npx doc-render-sdk build
104
-
105
- # 迁移旧项目
106
- npx doc-render-sdk migrate --source ./doc --target ./docs-new
107
- ```
108
68
 
109
69
  ## 📚 详细文档
110
70
 
@@ -103,14 +103,17 @@ async function createProject(projectDir, template) {
103
103
  name: path.basename(projectDir),
104
104
  version: '1.0.0',
105
105
  description: 'Documentation site built with Doc SDK',
106
- main: 'index.js',
106
+ main: 'index.jsx',
107
107
  scripts: {
108
108
  dev: 'doc-render-sdk dev',
109
109
  build: 'doc-render-sdk build',
110
- preview: 'doc-render-sdk preview'
110
+ // TODO
111
+ // preview: 'doc-render-sdk preview'
111
112
  },
112
113
  dependencies: {
113
- 'doc-render-sdk': sdkVersion
114
+ 'doc-render-sdk': sdkVersion,
115
+ "react": "^18.2.0",
116
+ "react-dom": "^18.2.0"
114
117
  },
115
118
  devDependencies: {
116
119
  vite: '^5.0.0',
@@ -207,7 +210,7 @@ const docSdk = new DocSDK(config);
207
210
  docSdk.render('#app');
208
211
  `;
209
212
 
210
- fs.writeFileSync(path.join(projectDir, 'index.js'), indexJs);
213
+ fs.writeFileSync(path.join(projectDir, 'index.jsx'), indexJs);
211
214
 
212
215
  // 生成HTML文件
213
216
  const indexHtml = `<!DOCTYPE html>
@@ -221,7 +224,7 @@ docSdk.render('#app');
221
224
  </head>
222
225
  <body>
223
226
  <div id="app"></div>
224
- <script src="index.js"></script>
227
+ <script src="index.jsx"></script>
225
228
  </body>
226
229
  </html>`;
227
230
 
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { ComponentType, ReactNode } from "react";
2
- import * as react_jsx_runtime1 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/core/PluginManager.d.ts
5
5
  /**
@@ -572,7 +572,7 @@ declare const Layout: ({
572
572
  routerManager: any;
573
573
  componentRegistry: any;
574
574
  onRouteChange: any;
575
- }) => react_jsx_runtime1.JSX.Element;
575
+ }) => react_jsx_runtime0.JSX.Element;
576
576
  //#endregion
577
577
  //#region src/components/Navigation.d.ts
578
578
  /**
@@ -592,7 +592,7 @@ declare const Navigation: ({
592
592
  componentRegistry: any;
593
593
  onNavigate: any;
594
594
  compact?: boolean | undefined;
595
- }) => react_jsx_runtime1.JSX.Element;
595
+ }) => react_jsx_runtime0.JSX.Element;
596
596
  //#endregion
597
597
  //#region src/components/Demo.d.ts
598
598
  /**
@@ -610,7 +610,7 @@ declare const Demo: ({
610
610
  config: any;
611
611
  theme: any;
612
612
  renderer: any;
613
- }) => react_jsx_runtime1.JSX.Element;
613
+ }) => react_jsx_runtime0.JSX.Element;
614
614
  //#endregion
615
615
  //#region src/components/ApiDoc.d.ts
616
616
  /**
@@ -626,7 +626,7 @@ declare const ApiDoc: ({
626
626
  componentId: any;
627
627
  config: any;
628
628
  theme: any;
629
- }) => react_jsx_runtime1.JSX.Element;
629
+ }) => react_jsx_runtime0.JSX.Element;
630
630
  //#endregion
631
631
  //#region src/components/CodeBlock.d.ts
632
632
  /**
@@ -646,7 +646,7 @@ declare const CodeBlock: ({
646
646
  showLineNumbers?: boolean | undefined;
647
647
  highlightLines?: never[] | undefined;
648
648
  className?: string | undefined;
649
- }) => react_jsx_runtime1.JSX.Element;
649
+ }) => react_jsx_runtime0.JSX.Element;
650
650
  //#endregion
651
651
  //#region src/index.d.ts
652
652
  declare class DocSDK {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "doc-render-sdk",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "description": "A powerful documentation rendering SDK for component libraries",
5
5
  "main": "dist/index.mjs",
6
6
  "module": "dist/index.mjs",