@min98/ui 1.3.57 → 1.3.59
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.mjs +503 -0
- package/lib/index.cjs +8 -8
- package/lib/index.d.cts +2 -2
- package/lib/index.d.ts +2 -2
- package/lib/index.js +8 -8
- package/lib/min98-ui-catalog.json +5701 -0
- package/lib/min98-ui-mcp.mjs +481 -0
- package/package.json +5 -2
|
@@ -0,0 +1,481 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import fs from "node:fs";
|
|
3
|
+
import http from "node:http";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import readline from "node:readline";
|
|
6
|
+
import { fileURLToPath } from "node:url";
|
|
7
|
+
|
|
8
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
9
|
+
const CATALOG_PATH = path.join(__dirname, "min98-ui-catalog.json");
|
|
10
|
+
const CORS_HEADERS = {
|
|
11
|
+
"Access-Control-Allow-Origin": "*",
|
|
12
|
+
"Access-Control-Allow-Methods": "GET, POST, OPTIONS",
|
|
13
|
+
"Access-Control-Allow-Headers": "Content-Type, Accept, Mcp-Session-Id",
|
|
14
|
+
};
|
|
15
|
+
const MAX_HTTP_BODY_BYTES = 1024 * 1024;
|
|
16
|
+
|
|
17
|
+
function loadCatalog() {
|
|
18
|
+
if (!fs.existsSync(CATALOG_PATH)) {
|
|
19
|
+
return {
|
|
20
|
+
serverInfo: { name: "min98-ui-docs-mcp", version: "1.3.59" },
|
|
21
|
+
tools: [],
|
|
22
|
+
resources: [],
|
|
23
|
+
components: [],
|
|
24
|
+
llmsTxt: "# @min98/ui\nCatalog file min98-ui-catalog.json not found.",
|
|
25
|
+
llmsFullTxt: "# @min98/ui\nCatalog file min98-ui-catalog.json not found.",
|
|
26
|
+
skillMd: "# min98-ui\nCatalog file min98-ui-catalog.json not found.",
|
|
27
|
+
guides: {},
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
return JSON.parse(fs.readFileSync(CATALOG_PATH, "utf8"));
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export const catalog = loadCatalog();
|
|
34
|
+
|
|
35
|
+
export function formatComponentMarkdown(item) {
|
|
36
|
+
const lines = [
|
|
37
|
+
`# ${item.name} (\`/docs/${item.slug}\`)`,
|
|
38
|
+
``,
|
|
39
|
+
`- **Category**: \`${item.category}\``,
|
|
40
|
+
`- **Exports**: ${item.exports.map((e) => `\`${e}\``).join(", ")}`,
|
|
41
|
+
item.variants.length > 0
|
|
42
|
+
? `- **Variants**: ${item.variants.map((v) => `\`${v}\``).join(", ")}`
|
|
43
|
+
: `- **Variants**: none`,
|
|
44
|
+
item.colors.length > 0
|
|
45
|
+
? `- **Colors**: ${item.colors.map((c) => `\`${c}\``).join(", ")}`
|
|
46
|
+
: `- **Colors**: inherits theme tokens`,
|
|
47
|
+
item.sizes.length > 0
|
|
48
|
+
? `- **Sizes**: ${item.sizes.map((s) => `\`${s}\``).join(", ")}`
|
|
49
|
+
: `- **Sizes**: default`,
|
|
50
|
+
``,
|
|
51
|
+
`## Summary`,
|
|
52
|
+
item.summaryEn,
|
|
53
|
+
``,
|
|
54
|
+
`## Import`,
|
|
55
|
+
"```tsx",
|
|
56
|
+
item.importCode,
|
|
57
|
+
"```",
|
|
58
|
+
``,
|
|
59
|
+
`## Example`,
|
|
60
|
+
"```tsx",
|
|
61
|
+
item.usageCode,
|
|
62
|
+
"```",
|
|
63
|
+
];
|
|
64
|
+
|
|
65
|
+
if (Array.isArray(item.props) && item.props.length > 0) {
|
|
66
|
+
lines.push(
|
|
67
|
+
``,
|
|
68
|
+
`## Props API`,
|
|
69
|
+
`| Prop | Type | Default | Required | Description |`,
|
|
70
|
+
`| --- | --- | --- | --- | --- |`,
|
|
71
|
+
...item.props.map(
|
|
72
|
+
(p) =>
|
|
73
|
+
`| \`${p.propName}\` | \`${String(p.type).replace(/\|/g, "\\|")}\` | \`${p.defaultValue}\` | ${p.required ? "Yes" : "No"} | ${p.descriptionEn} |`
|
|
74
|
+
)
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
return lines.join("\n");
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export function callTool(name, args = {}) {
|
|
81
|
+
const components = catalog.components || [];
|
|
82
|
+
|
|
83
|
+
switch (name) {
|
|
84
|
+
case "min98_ui_list_components": {
|
|
85
|
+
const category = typeof args.category === "string" ? args.category : "all";
|
|
86
|
+
const onlyWithColors = Boolean(args.onlyWithColors);
|
|
87
|
+
const onlyWithVariants = Boolean(args.onlyWithVariants);
|
|
88
|
+
|
|
89
|
+
const list = components
|
|
90
|
+
.filter((item) => {
|
|
91
|
+
if (category !== "all" && item.category !== category) return false;
|
|
92
|
+
if (onlyWithColors && (!item.colors || item.colors.length === 0)) return false;
|
|
93
|
+
if (onlyWithVariants && (!item.variants || item.variants.length <= 1)) return false;
|
|
94
|
+
return true;
|
|
95
|
+
})
|
|
96
|
+
.map((item) => ({
|
|
97
|
+
slug: item.slug,
|
|
98
|
+
name: item.name,
|
|
99
|
+
category: item.category,
|
|
100
|
+
exports: item.exports,
|
|
101
|
+
variants: item.variants,
|
|
102
|
+
colors: item.colors,
|
|
103
|
+
sizes: item.sizes,
|
|
104
|
+
}));
|
|
105
|
+
|
|
106
|
+
return {
|
|
107
|
+
content: [
|
|
108
|
+
{
|
|
109
|
+
type: "text",
|
|
110
|
+
text: JSON.stringify({ count: list.length, components: list }, null, 2),
|
|
111
|
+
},
|
|
112
|
+
],
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
case "min98_ui_get_component": {
|
|
117
|
+
const slug = typeof args.slug === "string" ? args.slug.trim() : "";
|
|
118
|
+
if (!slug) {
|
|
119
|
+
return {
|
|
120
|
+
isError: true,
|
|
121
|
+
content: [{ type: "text", text: "Missing required argument: slug" }],
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
const lower = slug.toLowerCase();
|
|
125
|
+
const found = components.find(
|
|
126
|
+
(c) =>
|
|
127
|
+
c.slug.toLowerCase() === lower ||
|
|
128
|
+
c.name.toLowerCase() === lower ||
|
|
129
|
+
c.exports.some((e) => e.toLowerCase() === lower)
|
|
130
|
+
);
|
|
131
|
+
if (!found) {
|
|
132
|
+
return {
|
|
133
|
+
isError: true,
|
|
134
|
+
content: [{ type: "text", text: `Component "${slug}" not found.` }],
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
return {
|
|
138
|
+
content: [{ type: "text", text: formatComponentMarkdown(found) }],
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
case "min98_ui_search_components": {
|
|
143
|
+
const query = typeof args.query === "string" ? args.query.trim().toLowerCase() : "";
|
|
144
|
+
const limit =
|
|
145
|
+
typeof args.limit === "number" && args.limit > 0 ? Math.min(args.limit, 50) : 15;
|
|
146
|
+
const tokens = query ? query.split(/\s+/).filter(Boolean) : [];
|
|
147
|
+
const scored = [];
|
|
148
|
+
|
|
149
|
+
for (const item of components) {
|
|
150
|
+
const haystack = [
|
|
151
|
+
item.slug,
|
|
152
|
+
item.name,
|
|
153
|
+
item.category,
|
|
154
|
+
item.summaryEn,
|
|
155
|
+
item.summaryVi,
|
|
156
|
+
...item.exports,
|
|
157
|
+
...item.variants,
|
|
158
|
+
...item.colors,
|
|
159
|
+
...item.sizes,
|
|
160
|
+
...item.tags,
|
|
161
|
+
...(item.props || []).map((p) => `${p.propName} ${p.descriptionEn}`),
|
|
162
|
+
]
|
|
163
|
+
.join(" ")
|
|
164
|
+
.toLowerCase();
|
|
165
|
+
|
|
166
|
+
if (!tokens.every((tok) => haystack.includes(tok))) continue;
|
|
167
|
+
const exactBonus =
|
|
168
|
+
item.slug.toLowerCase() === query || item.name.toLowerCase() === query ? 100 : 10;
|
|
169
|
+
scored.push({ item, score: exactBonus });
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
scored.sort((a, b) => b.score - a.score);
|
|
173
|
+
const results = scored.slice(0, limit).map((r) => ({
|
|
174
|
+
slug: r.item.slug,
|
|
175
|
+
name: r.item.name,
|
|
176
|
+
category: r.item.category,
|
|
177
|
+
exports: r.item.exports,
|
|
178
|
+
summary: r.item.summaryEn,
|
|
179
|
+
}));
|
|
180
|
+
|
|
181
|
+
return {
|
|
182
|
+
content: [
|
|
183
|
+
{
|
|
184
|
+
type: "text",
|
|
185
|
+
text: JSON.stringify({ query, count: results.length, results }, null, 2),
|
|
186
|
+
},
|
|
187
|
+
],
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
case "min98_ui_get_setup_guide": {
|
|
192
|
+
const topic = typeof args.topic === "string" ? args.topic : "all";
|
|
193
|
+
const text = (catalog.guides && catalog.guides[topic]) || catalog.guides?.all || "";
|
|
194
|
+
return { content: [{ type: "text", text }] };
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
case "min98_ui_get_skill_markdown": {
|
|
198
|
+
return { content: [{ type: "text", text: catalog.skillMd || "" }] };
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
default:
|
|
202
|
+
return {
|
|
203
|
+
isError: true,
|
|
204
|
+
content: [{ type: "text", text: `Unknown tool: ${name}` }],
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
export function handleMessage(msg) {
|
|
210
|
+
const id = msg.id !== undefined ? msg.id : null;
|
|
211
|
+
if (msg.jsonrpc !== "2.0" || typeof msg.method !== "string") {
|
|
212
|
+
return {
|
|
213
|
+
jsonrpc: "2.0",
|
|
214
|
+
id,
|
|
215
|
+
error: { code: -32600, message: "Invalid Request" },
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
const params = msg.params && typeof msg.params === "object" ? msg.params : {};
|
|
220
|
+
|
|
221
|
+
switch (msg.method) {
|
|
222
|
+
case "initialize":
|
|
223
|
+
return {
|
|
224
|
+
jsonrpc: "2.0",
|
|
225
|
+
id,
|
|
226
|
+
result: {
|
|
227
|
+
protocolVersion: "2024-11-05",
|
|
228
|
+
capabilities: {
|
|
229
|
+
tools: { listChanged: false },
|
|
230
|
+
resources: { subscribe: false, listChanged: false },
|
|
231
|
+
},
|
|
232
|
+
serverInfo: catalog.serverInfo || {
|
|
233
|
+
name: "min98-ui-docs-mcp",
|
|
234
|
+
version: "1.3.59",
|
|
235
|
+
},
|
|
236
|
+
},
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
case "notifications/initialized":
|
|
240
|
+
case "ping":
|
|
241
|
+
return msg.id === undefined ? null : { jsonrpc: "2.0", id, result: {} };
|
|
242
|
+
|
|
243
|
+
case "tools/list":
|
|
244
|
+
return {
|
|
245
|
+
jsonrpc: "2.0",
|
|
246
|
+
id,
|
|
247
|
+
result: { tools: catalog.tools || [] },
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
case "tools/call": {
|
|
251
|
+
const toolName = typeof params.name === "string" ? params.name : "";
|
|
252
|
+
if (!toolName) {
|
|
253
|
+
return {
|
|
254
|
+
jsonrpc: "2.0",
|
|
255
|
+
id,
|
|
256
|
+
error: { code: -32602, message: "Missing tool name" },
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
return {
|
|
260
|
+
jsonrpc: "2.0",
|
|
261
|
+
id,
|
|
262
|
+
result: callTool(toolName, params.arguments || {}),
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
case "resources/list":
|
|
267
|
+
return {
|
|
268
|
+
jsonrpc: "2.0",
|
|
269
|
+
id,
|
|
270
|
+
result: { resources: catalog.resources || [] },
|
|
271
|
+
};
|
|
272
|
+
|
|
273
|
+
case "resources/read": {
|
|
274
|
+
const uri = typeof params.uri === "string" ? params.uri : "";
|
|
275
|
+
if (uri === "ui://min98/llms.txt") {
|
|
276
|
+
return {
|
|
277
|
+
jsonrpc: "2.0",
|
|
278
|
+
id,
|
|
279
|
+
result: {
|
|
280
|
+
contents: [{ uri, mimeType: "text/plain", text: catalog.llmsTxt }],
|
|
281
|
+
},
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
if (uri === "ui://min98/llms-full.txt") {
|
|
285
|
+
return {
|
|
286
|
+
jsonrpc: "2.0",
|
|
287
|
+
id,
|
|
288
|
+
result: {
|
|
289
|
+
contents: [{ uri, mimeType: "text/plain", text: catalog.llmsFullTxt }],
|
|
290
|
+
},
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
if (uri === "ui://min98/skill.md") {
|
|
294
|
+
return {
|
|
295
|
+
jsonrpc: "2.0",
|
|
296
|
+
id,
|
|
297
|
+
result: {
|
|
298
|
+
contents: [{ uri, mimeType: "text/markdown", text: catalog.skillMd }],
|
|
299
|
+
},
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
return {
|
|
303
|
+
jsonrpc: "2.0",
|
|
304
|
+
id,
|
|
305
|
+
error: { code: -32602, message: `Resource not found: ${uri}` },
|
|
306
|
+
};
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
default:
|
|
310
|
+
return {
|
|
311
|
+
jsonrpc: "2.0",
|
|
312
|
+
id,
|
|
313
|
+
error: { code: -32601, message: `Method not found: ${msg.method}` },
|
|
314
|
+
};
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
export function startStdioServer() {
|
|
319
|
+
const rl = readline.createInterface({
|
|
320
|
+
input: process.stdin,
|
|
321
|
+
crlfDelay: Infinity,
|
|
322
|
+
});
|
|
323
|
+
|
|
324
|
+
rl.on("line", (line) => {
|
|
325
|
+
const trimmed = line.trim();
|
|
326
|
+
if (!trimmed) return;
|
|
327
|
+
try {
|
|
328
|
+
const req = JSON.parse(trimmed);
|
|
329
|
+
const res = handleMessage(req);
|
|
330
|
+
if (res !== null) {
|
|
331
|
+
process.stdout.write(`${JSON.stringify(res)}\n`);
|
|
332
|
+
}
|
|
333
|
+
} catch {
|
|
334
|
+
process.stdout.write(
|
|
335
|
+
`${JSON.stringify({
|
|
336
|
+
jsonrpc: "2.0",
|
|
337
|
+
id: null,
|
|
338
|
+
error: { code: -32700, message: "Parse error" },
|
|
339
|
+
})}\n`
|
|
340
|
+
);
|
|
341
|
+
}
|
|
342
|
+
});
|
|
343
|
+
return rl;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
function sendJson(res, statusCode, payload) {
|
|
347
|
+
res.writeHead(statusCode, {
|
|
348
|
+
...CORS_HEADERS,
|
|
349
|
+
"Content-Type": "application/json; charset=utf-8",
|
|
350
|
+
});
|
|
351
|
+
res.end(payload === null ? "" : JSON.stringify(payload));
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
function readJsonBody(req) {
|
|
355
|
+
return new Promise((resolve, reject) => {
|
|
356
|
+
const chunks = [];
|
|
357
|
+
let total = 0;
|
|
358
|
+
req.on("data", (chunk) => {
|
|
359
|
+
total += chunk.length;
|
|
360
|
+
if (total > MAX_HTTP_BODY_BYTES) {
|
|
361
|
+
reject(new Error("Request payload too large"));
|
|
362
|
+
req.destroy();
|
|
363
|
+
return;
|
|
364
|
+
}
|
|
365
|
+
chunks.push(chunk);
|
|
366
|
+
});
|
|
367
|
+
req.on("end", () => {
|
|
368
|
+
try {
|
|
369
|
+
resolve(JSON.parse(Buffer.concat(chunks).toString("utf8")));
|
|
370
|
+
} catch {
|
|
371
|
+
reject(new Error("Parse error"));
|
|
372
|
+
}
|
|
373
|
+
});
|
|
374
|
+
req.on("error", reject);
|
|
375
|
+
});
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
function handleHttpRpcPayload(payload) {
|
|
379
|
+
if (Array.isArray(payload)) {
|
|
380
|
+
if (payload.length === 0) {
|
|
381
|
+
return { status: 400, body: { jsonrpc: "2.0", id: null, error: { code: -32600, message: "Invalid Request" } } };
|
|
382
|
+
}
|
|
383
|
+
const items = payload
|
|
384
|
+
.map((item) =>
|
|
385
|
+
item && typeof item === "object"
|
|
386
|
+
? handleMessage(item)
|
|
387
|
+
: { jsonrpc: "2.0", id: null, error: { code: -32600, message: "Invalid Request" } }
|
|
388
|
+
)
|
|
389
|
+
.filter((r) => r !== null);
|
|
390
|
+
return items.length === 0 ? { status: 202, body: null } : { status: 200, body: items };
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
if (!payload || typeof payload !== "object") {
|
|
394
|
+
return { status: 400, body: { jsonrpc: "2.0", id: null, error: { code: -32600, message: "Invalid Request" } } };
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
const response = handleMessage(payload);
|
|
398
|
+
return response === null ? { status: 202, body: null } : { status: 200, body: response };
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
export function startHttpServer({ port = 3333, host = "127.0.0.1" } = {}) {
|
|
402
|
+
const server = http.createServer(async (req, res) => {
|
|
403
|
+
const reqUrl = new URL(req.url || "/", `http://${host}:${port}`);
|
|
404
|
+
if (reqUrl.pathname !== "/api/mcp" && reqUrl.pathname !== "/") {
|
|
405
|
+
sendJson(res, 404, { error: "Not found. Use POST /api/mcp" });
|
|
406
|
+
return;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
if (req.method === "OPTIONS") {
|
|
410
|
+
res.writeHead(204, CORS_HEADERS);
|
|
411
|
+
res.end();
|
|
412
|
+
return;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
if (req.method === "GET") {
|
|
416
|
+
sendJson(res, 200, {
|
|
417
|
+
serverInfo: catalog.serverInfo || { name: "min98-ui-docs-mcp", version: "1.3.59" },
|
|
418
|
+
protocolVersion: "2024-11-05",
|
|
419
|
+
transport: "streamable-http",
|
|
420
|
+
capabilities: {
|
|
421
|
+
tools: { listChanged: false },
|
|
422
|
+
resources: { subscribe: false, listChanged: false },
|
|
423
|
+
},
|
|
424
|
+
tools: catalog.tools || [],
|
|
425
|
+
resources: catalog.resources || [],
|
|
426
|
+
endpoints: { mcp: "/api/mcp" },
|
|
427
|
+
});
|
|
428
|
+
return;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
if (req.method !== "POST") {
|
|
432
|
+
sendJson(res, 405, { error: "Method not allowed" });
|
|
433
|
+
return;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
let payload;
|
|
437
|
+
try {
|
|
438
|
+
payload = await readJsonBody(req);
|
|
439
|
+
} catch (err) {
|
|
440
|
+
const message = err instanceof Error ? err.message : "Parse error";
|
|
441
|
+
const code = message === "Request payload too large" ? -32600 : -32700;
|
|
442
|
+
sendJson(res, 400, { jsonrpc: "2.0", id: null, error: { code, message } });
|
|
443
|
+
return;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
const out = handleHttpRpcPayload(payload);
|
|
447
|
+
if (out.body === null) {
|
|
448
|
+
res.writeHead(out.status, CORS_HEADERS);
|
|
449
|
+
res.end();
|
|
450
|
+
return;
|
|
451
|
+
}
|
|
452
|
+
sendJson(res, out.status, out.body);
|
|
453
|
+
});
|
|
454
|
+
|
|
455
|
+
server.listen(port, host, () => {
|
|
456
|
+
process.stderr.write(`min98-ui MCP HTTP server listening on http://${host}:${port}/api/mcp\n`);
|
|
457
|
+
});
|
|
458
|
+
return server;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
function isDirectEntry() {
|
|
462
|
+
if (!process.argv[1]) return false;
|
|
463
|
+
try {
|
|
464
|
+
return fs.realpathSync(process.argv[1]) === fs.realpathSync(fileURLToPath(import.meta.url));
|
|
465
|
+
} catch {
|
|
466
|
+
return path.resolve(process.argv[1]) === path.resolve(fileURLToPath(import.meta.url));
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
if (isDirectEntry()) {
|
|
471
|
+
const argv = process.argv.slice(2);
|
|
472
|
+
if (argv.includes("--http")) {
|
|
473
|
+
const portIdx = argv.indexOf("--port");
|
|
474
|
+
const hostIdx = argv.indexOf("--host");
|
|
475
|
+
const port = portIdx !== -1 && argv[portIdx + 1] ? Number(argv[portIdx + 1]) || 3333 : 3333;
|
|
476
|
+
const host = hostIdx !== -1 && argv[hostIdx + 1] ? argv[hostIdx + 1] : "127.0.0.1";
|
|
477
|
+
startHttpServer({ port, host });
|
|
478
|
+
} else {
|
|
479
|
+
startStdioServer();
|
|
480
|
+
}
|
|
481
|
+
}
|
package/package.json
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@min98/ui",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.59",
|
|
4
4
|
"description": "Package UI using shadcn/ui",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
7
|
+
"bin": {
|
|
8
|
+
"min98-ui": "./lib/cli.mjs"
|
|
9
|
+
},
|
|
7
10
|
"type": "module",
|
|
8
11
|
"private": false,
|
|
9
12
|
"files": [
|
|
@@ -21,7 +24,7 @@
|
|
|
21
24
|
},
|
|
22
25
|
"scripts": {
|
|
23
26
|
"dev": "tsup --watch",
|
|
24
|
-
"build": "tsup && node -e \"import('node:fs').then(fs => fs.cpSync('src/styles', 'lib', { recursive: true }))\""
|
|
27
|
+
"build": "tsup && node -e \"import('node:fs').then(fs => { fs.cpSync('src/styles', 'lib', { recursive: true }); fs.cpSync('src/cli', 'lib', { recursive: true }); })\""
|
|
25
28
|
},
|
|
26
29
|
"keywords": [
|
|
27
30
|
"ui",
|