@wot-ui/cli 0.0.1-beta.7 → 0.0.1-beta.9
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
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as resolveVersion, i as listComponents, n as lintProject, o as loadMetadataFile, r as findComponent, s as version, t as analyzeUsage } from "./scanner-
|
|
2
|
+
import { a as resolveVersion, i as listComponents, n as lintProject, o as loadMetadataFile, r as findComponent, s as version, t as analyzeUsage } from "./scanner-L5XVf4jh.mjs";
|
|
3
3
|
import process from "node:process";
|
|
4
4
|
import { Command } from "commander";
|
|
5
5
|
import { existsSync, readFileSync } from "node:fs";
|
|
@@ -166,14 +166,8 @@ function getDependencyVersion(pkg, name) {
|
|
|
166
166
|
return pkg?.dependencies?.[name] ?? pkg?.devDependencies?.[name];
|
|
167
167
|
}
|
|
168
168
|
function detectWotDependency(pkg) {
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
if (version$1) return `${name}@${version$1}`;
|
|
172
|
-
}
|
|
173
|
-
if (pkg?.dependencies) {
|
|
174
|
-
const scoped = Object.keys(pkg.dependencies).find((name) => name.includes("wot"));
|
|
175
|
-
if (scoped) return `${scoped}@${pkg.dependencies[scoped]}`;
|
|
176
|
-
}
|
|
169
|
+
const version$1 = getDependencyVersion(pkg, "@wot-ui/ui");
|
|
170
|
+
return version$1 ? `@wot-ui/ui@${version$1}` : void 0;
|
|
177
171
|
}
|
|
178
172
|
function createCheck(name, status, message, suggestion) {
|
|
179
173
|
if (status === "pass") return {
|
|
@@ -203,7 +197,7 @@ function diagnoseProject(targetDir) {
|
|
|
203
197
|
checks.push(createCheck("package-json", "pass", "package.json found."));
|
|
204
198
|
const wotVersion = detectWotDependency(pkg);
|
|
205
199
|
if (wotVersion) checks.push(createCheck("wot-ui-installed", "pass", `Detected ${wotVersion}.`));
|
|
206
|
-
else checks.push(createCheck("wot-ui-installed", "fail", "No wot-ui dependency detected.", "Add wot-ui
|
|
200
|
+
else checks.push(createCheck("wot-ui-installed", "fail", "No @wot-ui/ui dependency detected.", "Add @wot-ui/ui to dependencies before using doctor, usage, and lint."));
|
|
207
201
|
const vueVersion = getDependencyVersion(pkg, "vue");
|
|
208
202
|
if (vueVersion) checks.push(createCheck("vue-version", vueVersion.includes("3") ? "pass" : "warn", `Detected vue ${vueVersion}.`, vueVersion.includes("3") ? void 0 : "wot-ui v2 is designed for Vue 3 based projects."));
|
|
209
203
|
else checks.push(createCheck("vue-version", "warn", "Vue dependency not found.", "Add vue@3 to align with wot-ui v2 expectations."));
|
|
@@ -328,7 +322,7 @@ function registerListCommand(program) {
|
|
|
328
322
|
//#region src/commands/mcp.ts
|
|
329
323
|
function registerMcpCommand(program) {
|
|
330
324
|
program.command("mcp").description("Start the wot-ui MCP server").action(async () => {
|
|
331
|
-
const { startMcpServer } = await import("./server-
|
|
325
|
+
const { startMcpServer } = await import("./server-BIz6B24d.mjs");
|
|
332
326
|
await startMcpServer();
|
|
333
327
|
});
|
|
334
328
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as resolveVersion, i as listComponents, n as lintProject, o as loadMetadataFile, r as findComponent, s as version } from "./scanner-
|
|
1
|
+
import { a as resolveVersion, i as listComponents, n as lintProject, o as loadMetadataFile, r as findComponent, s as version } from "./scanner-L5XVf4jh.mjs";
|
|
2
2
|
import process from "node:process";
|
|
3
3
|
import { McpServer, StdioServerTransport } from "@modelcontextprotocol/server";
|
|
4
4
|
import * as z from "zod/v4";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wot-ui/cli",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.1-beta.
|
|
4
|
+
"version": "0.0.1-beta.9",
|
|
5
5
|
"description": "面向 wot-ui 的 CLI、MCP 与数据提取工具集",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"funding": "https://github.com/sponsors/antfu",
|
|
@@ -42,6 +42,8 @@
|
|
|
42
42
|
"@antfu/ni": "^28.0.0",
|
|
43
43
|
"@antfu/utils": "^9.3.0",
|
|
44
44
|
"@types/node": "^25.0.1",
|
|
45
|
+
"@vitest/coverage-v8": "4.0.15",
|
|
46
|
+
"baseline-browser-mapping": "^2.10.18",
|
|
45
47
|
"bumpp": "^10.3.2",
|
|
46
48
|
"eslint": "^9.39.2",
|
|
47
49
|
"lint-staged": "^16.2.7",
|
|
@@ -59,7 +61,7 @@
|
|
|
59
61
|
"pre-commit": "pnpm i --frozen-lockfile --ignore-scripts --offline && npx lint-staged"
|
|
60
62
|
},
|
|
61
63
|
"lint-staged": {
|
|
62
|
-
"*": "eslint --fix"
|
|
64
|
+
"*": "eslint --fix --no-warn-ignored"
|
|
63
65
|
},
|
|
64
66
|
"scripts": {
|
|
65
67
|
"build": "tsdown",
|
|
@@ -71,8 +73,7 @@
|
|
|
71
73
|
"release": "bumpp",
|
|
72
74
|
"start": "tsx src/index.ts",
|
|
73
75
|
"test": "vitest run",
|
|
74
|
-
"test:
|
|
75
|
-
"test:cli": "pnpm test",
|
|
76
|
+
"test:coverage": "vitest run --coverage --coverage.reporter=lcov --coverage.reporter=text",
|
|
76
77
|
"test:watch": "vitest",
|
|
77
78
|
"typecheck": "tsc --noEmit",
|
|
78
79
|
"typecheck:all": "pnpm typecheck",
|