create-done-coding 0.11.24-alpha.5 → 0.11.24-alpha.7
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/es/cli.mjs +1 -2
- package/es/{main-3641f957.js → index-722e0050.js} +10 -13
- package/es/index.mjs +12 -128
- package/package.json +7 -9
- package/types/index.d.ts +2 -6
- package/types/mcp/server-config.d.ts +7 -0
- package/types/mcp/server.d.ts +2 -0
- package/types/mcp-server.d.ts +1 -1
- package/es/mcp-server.mjs +0 -3
package/es/cli.mjs
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { c as m } from "./
|
|
2
|
+
import { c as m } from "./index-722e0050.js";
|
|
3
3
|
import "@done-coding/cli-utils";
|
|
4
4
|
import "node:fs";
|
|
5
5
|
import "node:path";
|
|
6
6
|
import "@done-coding/cli-template";
|
|
7
7
|
import "@done-coding/cli-git";
|
|
8
|
-
import "node:child_process";
|
|
9
8
|
m();
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { readCliModuleAssetsConfig as $o, outputConsole as _, chalk as ut, HooksNameEnum as T, createSubcommand as At, getRootScriptName as Wn, xPrompts as K, getConfigFileCommonOptions as Nt, addHuskyHooks as Po, initHandlerCommon as Io, readConfigFile as ye, lookForParentTarget as zn, decryptAES as Mo, encryptAES as jo, getCurrentBranchName as Uo, getCommitByHookName as Lo, resolveMergeInfoByGitReflogAction as Bo, checkCurrentIsRebasing as xo, resolveMergeInfoByCommitMsg as Do, getCurrentBranchLastCommitList as Fo, getLastReflogList as ko, generateGetAnswerSwiftFn as Ho, getSafePath as Go, rmGitCtrlAsync as cn, isHttpGitUrl as qo, http2sshGitUrl as Ko, createMainCommand as Jo } from "@done-coding/cli-utils";
|
|
2
|
+
import { readCliModuleAssetsConfig as $o, outputConsole as _, chalk as ut, HooksNameEnum as T, execSyncHijack as F, createSubcommand as At, getRootScriptName as Wn, xPrompts as K, getConfigFileCommonOptions as Nt, addHuskyHooks as Po, initHandlerCommon as Io, readConfigFile as ye, lookForParentTarget as zn, decryptAES as Mo, encryptAES as jo, getCurrentBranchName as Uo, getCommitByHookName as Lo, resolveMergeInfoByGitReflogAction as Bo, checkCurrentIsRebasing as xo, resolveMergeInfoByCommitMsg as Do, getCurrentBranchLastCommitList as Fo, getLastReflogList as ko, generateGetAnswerSwiftFn as Ho, getSafePath as Go, rmGitCtrlAsync as cn, isHttpGitUrl as qo, http2sshGitUrl as Ko, createMainCommand as Jo } from "@done-coding/cli-utils";
|
|
3
3
|
import Et, { existsSync as un, rmSync as lt } from "node:fs";
|
|
4
4
|
import Be, { resolve as Wo } from "node:path";
|
|
5
5
|
import { getConfigPath as zo, batchCompileHandler as Vo, MODULE_DEFAULT_CONFIG_RELATIVE_PATH as Xo } from "@done-coding/cli-template";
|
|
6
6
|
import { getTargetRepoUrl as Qo } from "@done-coding/cli-git";
|
|
7
|
-
import { execSync as F } from "node:child_process";
|
|
8
7
|
const ie = {
|
|
9
8
|
name: "create-done-coding",
|
|
10
|
-
version: "0.11.24-alpha.
|
|
9
|
+
version: "0.11.24-alpha.7",
|
|
11
10
|
description: "项目创建命令行工具",
|
|
12
11
|
bin: {
|
|
13
|
-
"create-done-coding": "es/cli.mjs"
|
|
14
|
-
"mcp-server": "es/mcp-server.mjs"
|
|
12
|
+
"create-done-coding": "es/cli.mjs"
|
|
15
13
|
},
|
|
16
14
|
cliConfig: {
|
|
17
15
|
namespaceDir: ".done-coding",
|
|
@@ -3609,7 +3607,7 @@ const lp = 3e4, Kn = Math.random(), Ro = {
|
|
|
3609
3607
|
}
|
|
3610
3608
|
}), tn = {
|
|
3611
3609
|
name: "@done-coding/cli-git",
|
|
3612
|
-
version: "0.6.14-alpha.
|
|
3610
|
+
version: "0.6.14-alpha.3",
|
|
3613
3611
|
description: "git跨平台操作命令行工具",
|
|
3614
3612
|
bin: {
|
|
3615
3613
|
"dc-git": "es/cli.mjs"
|
|
@@ -4348,7 +4346,7 @@ const Wp = async (e) => {
|
|
|
4348
4346
|
options: zp(),
|
|
4349
4347
|
// positionals: getPositionals(),
|
|
4350
4348
|
handler: Co
|
|
4351
|
-
},
|
|
4349
|
+
}, oh = async (e, t) => {
|
|
4352
4350
|
switch (e) {
|
|
4353
4351
|
case Qn.CREATE:
|
|
4354
4352
|
default:
|
|
@@ -4365,10 +4363,10 @@ const Wp = async (e) => {
|
|
|
4365
4363
|
} = ie, No = (e = !1) => {
|
|
4366
4364
|
const t = `${e ? `${Yp} ` : ""}[projectName]`, n = `$0 ${t.trim()}`;
|
|
4367
4365
|
return { command: t, usage: n };
|
|
4368
|
-
},
|
|
4366
|
+
}, sh = async () => Jo({
|
|
4369
4367
|
...Ao,
|
|
4370
4368
|
...No()
|
|
4371
|
-
}),
|
|
4369
|
+
}), ih = () => At({
|
|
4372
4370
|
...Ao,
|
|
4373
4371
|
...No(!0)
|
|
4374
4372
|
});
|
|
@@ -4376,12 +4374,11 @@ export {
|
|
|
4376
4374
|
O as F,
|
|
4377
4375
|
Ie as G,
|
|
4378
4376
|
Qn as S,
|
|
4379
|
-
|
|
4377
|
+
ih as a,
|
|
4380
4378
|
Vp as b,
|
|
4381
|
-
|
|
4382
|
-
|
|
4379
|
+
sh as c,
|
|
4380
|
+
oh as d,
|
|
4383
4381
|
Ao as e,
|
|
4384
|
-
Yo as g,
|
|
4385
4382
|
Co as h,
|
|
4386
4383
|
ie as i
|
|
4387
4384
|
};
|
package/es/index.mjs
CHANGED
|
@@ -1,134 +1,18 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import { outputConsole as i, hijackChildProcess as l, params2cliParams as p, updateEnvConfig as u } from "@done-coding/cli-utils";
|
|
5
|
-
import { createServer as d } from "@done-coding/mcp-utils";
|
|
6
|
-
import { fileURLToPath as g } from "node:url";
|
|
7
|
-
import a from "node:path";
|
|
2
|
+
import { F as s, G as t, S as d, e as c, a as p, b as u, h as l, d as b, i as f } from "./index-722e0050.js";
|
|
3
|
+
import "@done-coding/cli-utils";
|
|
8
4
|
import "node:fs";
|
|
5
|
+
import "node:path";
|
|
9
6
|
import "@done-coding/cli-template";
|
|
10
7
|
import "@done-coding/cli-git";
|
|
11
|
-
import "node:child_process";
|
|
12
|
-
const f = g(import.meta.url), C = a.dirname(f), E = [
|
|
13
|
-
(o, r) => o.registerTool(
|
|
14
|
-
s.cliConfig.moduleName,
|
|
15
|
-
{
|
|
16
|
-
title: `创建项目工具 - ${s.name}`,
|
|
17
|
-
description: "根据用户提供的项目名称、模板地址和分支创建新项目",
|
|
18
|
-
inputSchema: r.object({
|
|
19
|
-
[n.PROJECT_NAME]: r.string().min(1, "项目名称不能为空").describe("项目名称"),
|
|
20
|
-
[n.TEMPLATE_GIT_PATH]: r.string().min(1, "模板仓库地址不能为空").describe("模板仓库地址"),
|
|
21
|
-
[n.TEMPLATE_GIT_BRANCH]: r.string().optional().describe("对应的 Git 分支名称"),
|
|
22
|
-
cwd: r.string().min(1, "创建项目的目录绝对路径不能为空").describe("创建项目的目录绝对路径")
|
|
23
|
-
})
|
|
24
|
-
},
|
|
25
|
-
async (e) => {
|
|
26
|
-
i.info(`当前运行目录: ${e.cwd}`);
|
|
27
|
-
try {
|
|
28
|
-
const t = {
|
|
29
|
-
...e,
|
|
30
|
-
skipTemplateCompile: !0,
|
|
31
|
-
openGitDetailOptimize: !1
|
|
32
|
-
}, m = a.resolve(C, "./cli.mjs");
|
|
33
|
-
return await l({
|
|
34
|
-
command: "node",
|
|
35
|
-
args: [m, ...p(t)],
|
|
36
|
-
cwd: e.cwd,
|
|
37
|
-
env: process.env
|
|
38
|
-
}), i.success("项目创建成功"), {
|
|
39
|
-
content: [
|
|
40
|
-
{
|
|
41
|
-
type: "text",
|
|
42
|
-
text: `✅ 项目 [${e[n.PROJECT_NAME]}] 创建成功!`
|
|
43
|
-
}
|
|
44
|
-
]
|
|
45
|
-
};
|
|
46
|
-
} catch (t) {
|
|
47
|
-
return i.error("项目创建失败", (t == null ? void 0 : t.message) || t), {
|
|
48
|
-
isError: !0,
|
|
49
|
-
content: [
|
|
50
|
-
{ type: "text", text: `❌ 创建失败: ${(t == null ? void 0 : t.message) || t}` }
|
|
51
|
-
]
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
)
|
|
56
|
-
], T = [
|
|
57
|
-
(o) => o.registerResource(
|
|
58
|
-
`${s.cliConfig.moduleName}/templates`,
|
|
59
|
-
`resource:///${s.cliConfig.moduleName}/templates`,
|
|
60
|
-
{
|
|
61
|
-
title: "可用项目模板列表",
|
|
62
|
-
description: "包含所有可用的项目模板信息、仓库地址及可选分支"
|
|
63
|
-
},
|
|
64
|
-
async (r) => {
|
|
65
|
-
try {
|
|
66
|
-
i.stage("获取可用项目模板列表");
|
|
67
|
-
const e = await c();
|
|
68
|
-
return i.success("获取可用项目模板列表成功"), {
|
|
69
|
-
contents: [
|
|
70
|
-
{
|
|
71
|
-
uri: r.href,
|
|
72
|
-
text: JSON.stringify(e, null, 2),
|
|
73
|
-
mimeType: "application/json"
|
|
74
|
-
}
|
|
75
|
-
]
|
|
76
|
-
};
|
|
77
|
-
} catch (e) {
|
|
78
|
-
return {
|
|
79
|
-
isError: !0,
|
|
80
|
-
contents: [
|
|
81
|
-
{
|
|
82
|
-
uri: r.href,
|
|
83
|
-
type: "text",
|
|
84
|
-
text: `❌ 获取可用项目模板列表失败: ${(e == null ? void 0 : e.message) || e}`
|
|
85
|
-
}
|
|
86
|
-
]
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
)
|
|
91
|
-
], h = [
|
|
92
|
-
(o) => o.registerPrompt(
|
|
93
|
-
`${s.cliConfig.moduleName}/create-project-assistant`,
|
|
94
|
-
{
|
|
95
|
-
title: "创建项目助手",
|
|
96
|
-
description: "基于自然语言诉求创建项目"
|
|
97
|
-
},
|
|
98
|
-
async () => ({
|
|
99
|
-
messages: [
|
|
100
|
-
{
|
|
101
|
-
role: "user",
|
|
102
|
-
content: {
|
|
103
|
-
type: "text",
|
|
104
|
-
text: `你是一个专业的项目初始化助手, 根据用户的自然语言诉求,从可用项目模板列表中挑选最匹配的选项来调用${s.cliConfig.moduleName}工具创建项目`
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
]
|
|
108
|
-
})
|
|
109
|
-
)
|
|
110
|
-
], $ = async () => {
|
|
111
|
-
u({
|
|
112
|
-
consoleLog: !1
|
|
113
|
-
}), await d({
|
|
114
|
-
toolRegisterList: E,
|
|
115
|
-
resourceRegisterList: T,
|
|
116
|
-
promptRegisterList: h,
|
|
117
|
-
name: s.name,
|
|
118
|
-
version: s.version
|
|
119
|
-
}).catch((o) => {
|
|
120
|
-
i.error("MCP 服务启动失败:", o), process.exit(1);
|
|
121
|
-
});
|
|
122
|
-
};
|
|
123
8
|
export {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
$ as setupMcpServer
|
|
9
|
+
s as FormNameEnum,
|
|
10
|
+
t as GitRemoteRepoAliasNameEnum,
|
|
11
|
+
d as SubcommandEnum,
|
|
12
|
+
c as commandCliInfo,
|
|
13
|
+
p as crateAsSubcommand,
|
|
14
|
+
u as createCommandCliInfo,
|
|
15
|
+
l as createHandler,
|
|
16
|
+
b as handler,
|
|
17
|
+
f as injectInfo
|
|
134
18
|
};
|
package/package.json
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-done-coding",
|
|
3
|
-
"version": "0.11.24-alpha.
|
|
3
|
+
"version": "0.11.24-alpha.7",
|
|
4
4
|
"description": "项目创建命令行工具",
|
|
5
5
|
"module": "es/index.mjs",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"types": "types/index.d.ts",
|
|
8
8
|
"bin": {
|
|
9
|
-
"create-done-coding": "es/cli.mjs"
|
|
10
|
-
"mcp-server": "es/mcp-server.mjs"
|
|
9
|
+
"create-done-coding": "es/cli.mjs"
|
|
11
10
|
},
|
|
12
11
|
"exports": {
|
|
13
12
|
".": {
|
|
@@ -38,7 +37,7 @@
|
|
|
38
37
|
"license": "MIT",
|
|
39
38
|
"sideEffects": false,
|
|
40
39
|
"devDependencies": {
|
|
41
|
-
"@done-coding/cli-inject": "0.5.22-alpha.
|
|
40
|
+
"@done-coding/cli-inject": "0.5.22-alpha.3",
|
|
42
41
|
"@types/node": "^18.0.0",
|
|
43
42
|
"@types/yargs": "^17.0.28",
|
|
44
43
|
"typescript": "^5.8.3",
|
|
@@ -46,13 +45,12 @@
|
|
|
46
45
|
"vite-plugin-dts": "^3.6.0"
|
|
47
46
|
},
|
|
48
47
|
"dependencies": {
|
|
49
|
-
"@done-coding/cli-git": "0.6.14-alpha.
|
|
50
|
-
"@done-coding/cli-template": "0.8.9-alpha.
|
|
51
|
-
"@done-coding/cli-utils": "0.8.3-alpha.
|
|
52
|
-
"@done-coding/mcp-utils": "0.0.2-alpha.2"
|
|
48
|
+
"@done-coding/cli-git": "0.6.14-alpha.3",
|
|
49
|
+
"@done-coding/cli-template": "0.8.9-alpha.3",
|
|
50
|
+
"@done-coding/cli-utils": "0.8.3-alpha.3"
|
|
53
51
|
},
|
|
54
52
|
"engines": {
|
|
55
53
|
"node": ">=18.0.0"
|
|
56
54
|
},
|
|
57
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "30a4e6c8721e6bcafa72d4e05b35b5ed5fc75c0d"
|
|
58
56
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -121,11 +121,10 @@ export declare const handler: (command: SubcommandEnum, argv: CliHandlerArgv<any
|
|
|
121
121
|
|
|
122
122
|
export declare const injectInfo: {
|
|
123
123
|
"name": "create-done-coding",
|
|
124
|
-
"version": "0.11.24-alpha.
|
|
124
|
+
"version": "0.11.24-alpha.7",
|
|
125
125
|
"description": "项目创建命令行工具",
|
|
126
126
|
"bin": {
|
|
127
|
-
"create-done-coding": "es/cli.mjs"
|
|
128
|
-
"mcp-server": "es/mcp-server.mjs"
|
|
127
|
+
"create-done-coding": "es/cli.mjs"
|
|
129
128
|
},
|
|
130
129
|
"cliConfig": {
|
|
131
130
|
"namespaceDir": ".done-coding",
|
|
@@ -145,9 +144,6 @@ export declare interface McpCreateToolParams extends McpCommonToolParams {
|
|
|
145
144
|
[FormNameEnum.TEMPLATE_GIT_BRANCH]?: string;
|
|
146
145
|
}
|
|
147
146
|
|
|
148
|
-
/** 启动 MCP 服务 */
|
|
149
|
-
export declare const setupMcpServer: () => Promise<void>;
|
|
150
|
-
|
|
151
147
|
export declare enum SubcommandEnum {
|
|
152
148
|
CREATE = "create"
|
|
153
149
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { McpToolRegisterItem, McpResourceRegisterItem, McpPromptRegisterItem } from "@done-coding/mcp-utils";
|
|
2
|
+
/** mcp服务 工具注册列表 */
|
|
3
|
+
export declare const toolRegisterList: McpToolRegisterItem[];
|
|
4
|
+
/** mcp服务 资源注册列表 */
|
|
5
|
+
export declare const resourceRegisterList: McpResourceRegisterItem[];
|
|
6
|
+
/** mcp服务 提示词注册列表 */
|
|
7
|
+
export declare const promptRegisterList: McpPromptRegisterItem[];
|
package/types/mcp-server.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {};
|
package/es/mcp-server.mjs
DELETED