fangguo-component 1.2.1 → 1.2.2

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.
Files changed (3) hide show
  1. package/CHANGELOG.md +28 -5
  2. package/README.md +11 -0
  3. package/package.json +97 -92
package/CHANGELOG.md CHANGED
@@ -1,10 +1,33 @@
1
1
  # 更新日志
2
2
 
3
- 本文件记录 **fangguo-component** 各 npm 版本变更;文档站通过 `@include` 同步展示。
4
-
5
- ## [1.1.0] - 2026-05-20
6
-
7
- ### 破坏性变更
3
+ 本文件记录 **fangguo-component** 各 npm 版本变更;文档站通过 `@include` 同步展示。
4
+
5
+ ## [1.2.1] - 2026-07-09
6
+
7
+ ### 新增
8
+
9
+ - ✨ **MCP 服务**:新增 `fangguo-component-mcp-server`,支持在 AI 客户端中按自然语言搜索组件、推荐用法、查询 Props / Events / Slots、读取真实 demo,并生成 Vue 使用片段。
10
+ - ✨ **MCP 工具集**:提供 `fangguo_recommend_usage`、`fangguo_generate_usage_snippet`、`fangguo_get_entry`、`fangguo_get_demo_code`、`fangguo_search_entries` 等工具,方便 AI 基于组件库真实文档写业务代码。
11
+ - ✨ **Catalog 索引**:新增组件、工具函数、指令和 Hook 的结构化索引,支持从线上 catalog、本地 JSON、本地源码或内置 catalog 加载。
12
+
13
+ ### 优化
14
+
15
+ - ♻️ **MCP 搜索**:使用中文分词、catalog 动态短语和文档频率权重优化自然语言检索,降低“数据、选择、接口”等泛词噪音,提升不同组件场景下的推荐稳定性。
16
+ - ♻️ **MCP 运行方式**:支持 stdio 与 HTTP 两种传输方式,并提供 catalog 缓存刷新能力,便于本地调试和多客户端接入。
17
+
18
+ ### 文档
19
+
20
+ - 📝 **MCP README**:补充业务项目快速接入、Codex 推荐配置、环境变量、本地调试、HTTP 接入和组件库开发者安装 / 构建 / 发布流程。
21
+ - 📝 **MCP 架构文档**:补充 MCP 数据来源、工具调用链路、搜索打分逻辑和具体查询示例,说明 catalog 与普通 JSON、向量数据库的区别。
22
+
23
+ ### 构建与工程
24
+
25
+ - 🔧 **MCP 构建脚本**:新增根项目 `build:mcp`、`publish:mcp`、`start:mcp`、`start:mcp:http` 等脚本,并在文档构建流程中生成线上 `catalog.json`。
26
+ - 🔧 **MCP 子包发布准备**:补充 `@node-rs/jieba` 分词依赖和 MCP 子项目构建配置,当前 MCP 子包版本为 `0.1.12`。
27
+
28
+ ## [1.1.0] - 2026-05-20
29
+
30
+ ### 破坏性变更
8
31
 
9
32
  - 💥 移除 **`SortTransfer`**、**`TipInput`** 组件及导出。
10
33
 
package/README.md CHANGED
@@ -152,6 +152,17 @@ npm 不支持 `link:` 协议的 `overrides`,本地调试可用以下任一方
152
152
 
153
153
  典型流程:改完组件、工具、指令、Hooks 源码或手写 md 后执行 `pnpm docs:gen`,再 `pnpm docs:dev` 查看效果;发布文档前执行 `pnpm docs:build`。
154
154
 
155
+ ## AI 组件检索 MCP
156
+
157
+ 仓库内置 `mcp/fangguo-component-mcp-server`,用于让 Cursor、Codex、Claude 等 AI 工具按需求快速检索组件库,而不是让 AI 从在线文档首页逐页阅读。MCP 会扫描 `src/docConfig.ts`、组件/工具/指令/Hook 文档、`demos/*.vue` 与各模块 `index.ts`,提供“搜索组件”“推荐用法”“读取 API”“读取 demo 源码”等工具。
158
+
159
+ ```bash
160
+ pnpm build:mcp
161
+ pnpm start:mcp
162
+ ```
163
+
164
+ 接入配置、HTTP 部署方式与工具说明见 [mcp/fangguo-component-mcp-server/README.md](mcp/fangguo-component-mcp-server/README.md)。
165
+
155
166
  ## 文档生成说明(`pnpm docs:gen`)
156
167
 
157
168
  脚本入口:`scripts/gen-docs.ts`。在 `docs/components/`、`docs/tools/`、`docs/directives/`、`docs/hooks/` 下写入或更新各条目的 `@include` 或(工具无手写 md 时)自动生成 API 式 Markdown;**不再**生成上述目录下的 `index.md` 聚合页;并更新首页 `docs/index.md` 中 `features` 的链接,使其指向各分类**按目录名排序后的第一篇**文档。**不**修改 `docs/.vitepress/config.ts` 与 `src/docConfig.ts`。
package/package.json CHANGED
@@ -1,93 +1,98 @@
1
- {
2
- "name": "fangguo-component",
3
- "version": "1.2.1",
4
- "description": "",
5
- "type": "module",
6
- "main": "dist/index.js",
7
- "module": "dist/index.js",
8
- "types": "dist/index.d.ts",
9
- "exports": {
10
- ".": {
11
- "types": "./dist/index.d.ts",
12
- "import": "./dist/index.js"
13
- },
14
- "./dist/*": "./dist/*"
15
- },
16
- "sideEffects": [
17
- "**/*.css"
18
- ],
19
- "keywords": [],
20
- "files": [
21
- "dist",
22
- "LICENSE",
23
- "CHANGELOG.md",
24
- "package.json"
25
- ],
26
- "author": "yeshen",
27
- "license": "ISC",
28
- "scripts": {
29
- "dev": "vite",
30
- "preview": "vite preview",
31
- "fmt": "oxfmt",
32
- "lint": "oxlint",
33
- "lint:fix": "oxlint --fix",
34
- "typecheck": "vue-tsc --noEmit -p tsconfig.check-src.json",
35
- "build:npm": "vite build --mode npm",
36
- "docs:gen": "npx tsx scripts/gen-docs.ts",
37
- "docs:dev": "vitepress dev docs",
38
- "docs:build": "vitepress build docs",
39
- "docs:preview": "vitepress preview docs",
40
- "prepare": "husky"
41
- },
42
- "dependencies": {
43
- "ag-psd": "^28.4.1",
44
- "crypto-js": "^4.2.0",
45
- "fingerprintjs2": "^2.1.4",
46
- "js-sha1": "^0.7.0",
47
- "lodash-unified": "^1.0.3",
48
- "utif2": "^4.1.0",
49
- "vue-virtual-scroller": "2.0.0-beta.8"
50
- },
51
- "peerDependencies": {
52
- "@element-plus/icons-vue": "^2.3.2",
53
- "element-plus": "2.13.7",
54
- "sass": "^1.53.0",
55
- "tailwindcss": "^3.3.1",
56
- "vue": "^3.5.3"
57
- },
58
- "devDependencies": {
59
- "@commitlint/cli": "^21.0.0",
60
- "@commitlint/config-conventional": "^21.0.0",
61
- "@element-plus/icons-vue": "^2.3.2",
62
- "@types/node": "^25.6.2",
63
- "@vitejs/plugin-vue": "^6.0.3",
64
- "@vue/shared": "^3.5.27",
65
- "@vue/tsconfig": "^0.8.1",
66
- "@vueuse/core": "^14.1.0",
67
- "address-parse": "^1.2.19",
68
- "element-plus": "2.13.7",
69
- "husky": "^9.1.7",
70
- "lint-staged": "^17.0.4",
71
- "lodash-es": "^4.18.1",
72
- "oxfmt": "^0.27.0",
73
- "oxlint": "^1.42.0",
74
- "sass": "^1.53.0",
75
- "tailwindcss": "^3.3.1",
76
- "typescript": "^5.9.3",
77
- "unplugin-auto-import": "^21.0.0",
78
- "unplugin-vue-components": "^31.0.0",
79
- "vite": "^7.3.1",
80
- "vite-plugin-dts": "4.5.4",
81
- "vite-plugin-lib-inject-css": "^2.2.2",
82
- "vite-plugin-node-polyfills": "^0.26.0",
83
- "vitepress": "^1.6.4",
84
- "vitepress-demo-plugin": "^1.5.1",
85
- "vue": "^3.5.3",
86
- "vue-tsc": "^3.2.4",
87
- "vue-virtual-scroller": "2.0.0-beta.8",
88
- "@vitejs/plugin-vue-jsx": "^5.1.1"
89
- },
90
- "lint-staged": {
91
- "*.{ts,vue,js}": "node scripts/lint-staged-oxlint.mjs"
92
- }
1
+ {
2
+ "name": "fangguo-component",
3
+ "version": "1.2.2",
4
+ "description": "",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "module": "dist/index.js",
8
+ "types": "dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.js"
13
+ },
14
+ "./dist/*": "./dist/*"
15
+ },
16
+ "sideEffects": [
17
+ "**/*.css"
18
+ ],
19
+ "keywords": [],
20
+ "files": [
21
+ "dist",
22
+ "LICENSE",
23
+ "CHANGELOG.md",
24
+ "package.json"
25
+ ],
26
+ "author": "yeshen",
27
+ "license": "ISC",
28
+ "dependencies": {
29
+ "ag-psd": "^28.4.1",
30
+ "crypto-js": "^4.2.0",
31
+ "fingerprintjs2": "^2.1.4",
32
+ "js-sha1": "^0.7.0",
33
+ "lodash-unified": "^1.0.3",
34
+ "utif2": "^4.1.0",
35
+ "vue-virtual-scroller": "2.0.0-beta.8"
36
+ },
37
+ "peerDependencies": {
38
+ "@element-plus/icons-vue": "^2.3.2",
39
+ "element-plus": "2.13.7",
40
+ "sass": "^1.53.0",
41
+ "tailwindcss": "^3.3.1",
42
+ "vue": "^3.5.3"
43
+ },
44
+ "devDependencies": {
45
+ "@commitlint/cli": "^21.0.0",
46
+ "@commitlint/config-conventional": "^21.0.0",
47
+ "@element-plus/icons-vue": "^2.3.2",
48
+ "@types/node": "^25.6.2",
49
+ "@vitejs/plugin-vue": "^6.0.3",
50
+ "@vue/shared": "^3.5.27",
51
+ "@vue/tsconfig": "^0.8.1",
52
+ "@vueuse/core": "^14.1.0",
53
+ "address-parse": "^1.2.19",
54
+ "element-plus": "2.13.7",
55
+ "husky": "^9.1.7",
56
+ "lint-staged": "^17.0.4",
57
+ "lodash-es": "^4.18.1",
58
+ "oxfmt": "^0.27.0",
59
+ "oxlint": "^1.42.0",
60
+ "sass": "^1.53.0",
61
+ "tailwindcss": "^3.3.1",
62
+ "typescript": "^5.9.3",
63
+ "unplugin-auto-import": "^21.0.0",
64
+ "unplugin-vue-components": "^31.0.0",
65
+ "vite": "^7.3.1",
66
+ "vite-plugin-dts": "4.5.4",
67
+ "vite-plugin-lib-inject-css": "^2.2.2",
68
+ "vite-plugin-node-polyfills": "^0.26.0",
69
+ "vitepress": "^1.6.4",
70
+ "vitepress-demo-plugin": "^1.5.1",
71
+ "vue": "^3.5.3",
72
+ "vue-tsc": "^3.2.4",
73
+ "vue-virtual-scroller": "2.0.0-beta.8",
74
+ "@vitejs/plugin-vue-jsx": "^5.1.1"
75
+ },
76
+ "lint-staged": {
77
+ "*.{ts,vue,js}": "node scripts/lint-staged-oxlint.mjs"
78
+ },
79
+ "scripts": {
80
+ "dev": "vite",
81
+ "preview": "vite preview",
82
+ "fmt": "oxfmt",
83
+ "lint": "oxlint",
84
+ "lint:fix": "oxlint --fix",
85
+ "typecheck": "vue-tsc --noEmit -p tsconfig.check-src.json",
86
+ "build:npm": "vite build --mode npm",
87
+ "publish:npm": "pnpm publish --no-git-checks",
88
+ "docs:gen": "npx tsx scripts/gen-docs.ts",
89
+ "docs:dev": "vitepress dev docs",
90
+ "docs:build": "vitepress build docs && pnpm --dir mcp/fangguo-component-mcp-server exec tsx src/generateCatalog.ts --out ../../docs/.vitepress/dist/catalog.json",
91
+ "docs:preview": "vitepress preview docs",
92
+ "build:mcp": "pnpm --dir mcp/fangguo-component-mcp-server build",
93
+ "publish:mcp": "pnpm --dir mcp/fangguo-component-mcp-server run publish:npm",
94
+ "start:mcp": "pnpm --dir mcp/fangguo-component-mcp-server start",
95
+ "start:mcp:http": "pnpm --dir mcp/fangguo-component-mcp-server start:http",
96
+ "debug:tools": "pnpm --dir mcp/fangguo-component-mcp-server debug:tools"
97
+ }
93
98
  }