create-done-coding 0.11.24-alpha.4 → 0.11.24-alpha.6

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 CHANGED
@@ -1,9 +1,8 @@
1
1
  #!/usr/bin/env node
2
- import { c as m } from "./main-e22325b3.js";
2
+ import { c as m } from "./main-9f9ce081.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();
package/es/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { i as s, F as n, g as c } from "./main-e22325b3.js";
3
- import { G as S, S as j, e as G, a as M, b as I, h as O, d as H } from "./main-e22325b3.js";
2
+ import { i as r, F as n, g as m } from "./main-9f9ce081.js";
3
+ import { G as w, S, e as j, a as G, b as M, h as I, d as O } from "./main-9f9ce081.js";
4
4
  import { outputConsole as i, hijackChildProcess as l, params2cliParams as p, updateEnvConfig as u } from "@done-coding/cli-utils";
5
5
  import { createServer as d } from "@done-coding/mcp-utils";
6
6
  import { fileURLToPath as g } from "node:url";
@@ -8,18 +8,17 @@ import a from "node:path";
8
8
  import "node:fs";
9
9
  import "@done-coding/cli-template";
10
10
  import "@done-coding/cli-git";
11
- import "node:child_process";
12
11
  const f = g(import.meta.url), C = a.dirname(f), E = [
13
- (o, r) => o.registerTool(
14
- s.cliConfig.moduleName,
12
+ (o, s) => o.registerTool(
13
+ r.cliConfig.moduleName,
15
14
  {
16
- title: `创建项目工具 - ${s.name}`,
15
+ title: `创建项目工具 - ${r.name}`,
17
16
  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("创建项目的目录绝对路径")
17
+ inputSchema: s.object({
18
+ [n.PROJECT_NAME]: s.string().min(1, "项目名称不能为空").describe("项目名称"),
19
+ [n.TEMPLATE_GIT_PATH]: s.string().min(1, "模板仓库地址不能为空").describe("模板仓库地址"),
20
+ [n.TEMPLATE_GIT_BRANCH]: s.string().optional().describe("对应的 Git 分支名称"),
21
+ cwd: s.string().min(1, "创建项目的目录绝对路径不能为空").describe("创建项目的目录绝对路径")
23
22
  })
24
23
  },
25
24
  async (e) => {
@@ -29,10 +28,10 @@ const f = g(import.meta.url), C = a.dirname(f), E = [
29
28
  ...e,
30
29
  skipTemplateCompile: !0,
31
30
  openGitDetailOptimize: !1
32
- }, m = a.resolve(C, "./cli.mjs");
31
+ }, c = a.resolve(C, "./cli.mjs");
33
32
  return await l({
34
33
  command: "node",
35
- args: [m, ...p(t)],
34
+ args: [c, ...p(t)],
36
35
  cwd: e.cwd,
37
36
  env: process.env
38
37
  }), i.success("项目创建成功"), {
@@ -55,20 +54,20 @@ const f = g(import.meta.url), C = a.dirname(f), E = [
55
54
  )
56
55
  ], T = [
57
56
  (o) => o.registerResource(
58
- `${s.cliConfig.moduleName}/templates`,
59
- `resource:///${s.cliConfig.moduleName}/templates`,
57
+ `${r.cliConfig.moduleName}/templates`,
58
+ `resource:///${r.cliConfig.moduleName}/templates`,
60
59
  {
61
60
  title: "可用项目模板列表",
62
61
  description: "包含所有可用的项目模板信息、仓库地址及可选分支"
63
62
  },
64
- async (r) => {
63
+ async (s) => {
65
64
  try {
66
65
  i.stage("获取可用项目模板列表");
67
- const e = await c();
66
+ const e = await m();
68
67
  return i.success("获取可用项目模板列表成功"), {
69
68
  contents: [
70
69
  {
71
- uri: r.href,
70
+ uri: s.href,
72
71
  text: JSON.stringify(e, null, 2),
73
72
  mimeType: "application/json"
74
73
  }
@@ -79,7 +78,7 @@ const f = g(import.meta.url), C = a.dirname(f), E = [
79
78
  isError: !0,
80
79
  contents: [
81
80
  {
82
- uri: r.href,
81
+ uri: s.href,
83
82
  type: "text",
84
83
  text: `❌ 获取可用项目模板列表失败: ${(e == null ? void 0 : e.message) || e}`
85
84
  }
@@ -90,7 +89,7 @@ const f = g(import.meta.url), C = a.dirname(f), E = [
90
89
  )
91
90
  ], h = [
92
91
  (o) => o.registerPrompt(
93
- `${s.cliConfig.moduleName}/create-project-assistant`,
92
+ `${r.cliConfig.moduleName}/create-project-assistant`,
94
93
  {
95
94
  title: "创建项目助手",
96
95
  description: "基于自然语言诉求创建项目"
@@ -101,34 +100,34 @@ const f = g(import.meta.url), C = a.dirname(f), E = [
101
100
  role: "user",
102
101
  content: {
103
102
  type: "text",
104
- text: `你是一个专业的项目初始化助手, 根据用户的自然语言诉求,从可用项目模板列表中挑选最匹配的选项来调用${s.cliConfig.moduleName}工具创建项目`
103
+ text: `你是一个专业的项目初始化助手, 根据用户的自然语言诉求,从可用项目模板列表中挑选最匹配的选项来调用${r.cliConfig.moduleName}工具创建项目`
105
104
  }
106
105
  }
107
106
  ]
108
107
  })
109
108
  )
110
- ], $ = async () => {
109
+ ], L = async () => {
111
110
  u({
112
111
  consoleLog: !1
113
112
  }), await d({
114
113
  toolRegisterList: E,
115
114
  resourceRegisterList: T,
116
115
  promptRegisterList: h,
117
- name: s.name,
118
- version: s.version
116
+ name: r.name,
117
+ version: r.version
119
118
  }).catch((o) => {
120
119
  i.error("MCP 服务启动失败:", o), process.exit(1);
121
120
  });
122
121
  };
123
122
  export {
124
123
  n as FormNameEnum,
125
- S as GitRemoteRepoAliasNameEnum,
126
- j as SubcommandEnum,
127
- G as commandCliInfo,
128
- M as crateAsSubcommand,
129
- I as createCommandCliInfo,
130
- O as createHandler,
131
- H as handler,
132
- s as injectInfo,
133
- $ as setupMcpServer
124
+ w as GitRemoteRepoAliasNameEnum,
125
+ S as SubcommandEnum,
126
+ j as commandCliInfo,
127
+ G as crateAsSubcommand,
128
+ M as createCommandCliInfo,
129
+ I as createHandler,
130
+ O as handler,
131
+ r as injectInfo,
132
+ L as setupMcpServer
134
133
  };
@@ -1,13 +1,12 @@
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.4",
9
+ version: "0.11.24-alpha.6",
11
10
  description: "项目创建命令行工具",
12
11
  bin: {
13
12
  "create-done-coding": "es/cli.mjs",
@@ -3609,7 +3608,7 @@ const lp = 3e4, Kn = Math.random(), Ro = {
3609
3608
  }
3610
3609
  }), tn = {
3611
3610
  name: "@done-coding/cli-git",
3612
- version: "0.6.14-alpha.0",
3611
+ version: "0.6.14-alpha.2",
3613
3612
  description: "git跨平台操作命令行工具",
3614
3613
  bin: {
3615
3614
  "dc-git": "es/cli.mjs"
@@ -4288,7 +4287,7 @@ const Wp = async (e) => {
4288
4287
  $projectName: s
4289
4288
  }
4290
4289
  }), lt(g, { force: !0 }), _.stage("模板项目配置编译成功, 编译配置文件已删除"))), !e.openGitDetailOptimize)
4291
- return _.stage("移除克隆仓库的git控制"), await cn(a), process.exit(0);
4290
+ return _.stage("移除克隆仓库的git控制"), await cn(a), _.success("项目创建成功,移除克隆仓库的git控制成功"), process.exit(0);
4292
4291
  if (_.stage("项目初始化完成"), u) {
4293
4292
  const h = Be.resolve(a), m = Be.resolve(h, ".git");
4294
4293
  if (!un(m))
@@ -4348,7 +4347,7 @@ const Wp = async (e) => {
4348
4347
  options: zp(),
4349
4348
  // positionals: getPositionals(),
4350
4349
  handler: Co
4351
- }, sh = async (e, t) => {
4350
+ }, oh = async (e, t) => {
4352
4351
  switch (e) {
4353
4352
  case Qn.CREATE:
4354
4353
  default:
@@ -4365,10 +4364,10 @@ const Wp = async (e) => {
4365
4364
  } = ie, No = (e = !1) => {
4366
4365
  const t = `${e ? `${Yp} ` : ""}[projectName]`, n = `$0 ${t.trim()}`;
4367
4366
  return { command: t, usage: n };
4368
- }, ih = async () => Jo({
4367
+ }, sh = async () => Jo({
4369
4368
  ...Ao,
4370
4369
  ...No()
4371
- }), ah = () => At({
4370
+ }), ih = () => At({
4372
4371
  ...Ao,
4373
4372
  ...No(!0)
4374
4373
  });
@@ -4376,10 +4375,10 @@ export {
4376
4375
  O as F,
4377
4376
  Ie as G,
4378
4377
  Qn as S,
4379
- ah as a,
4378
+ ih as a,
4380
4379
  Vp as b,
4381
- ih as c,
4382
- sh as d,
4380
+ sh as c,
4381
+ oh as d,
4383
4382
  Ao as e,
4384
4383
  Yo as g,
4385
4384
  Co as h,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-done-coding",
3
- "version": "0.11.24-alpha.4",
3
+ "version": "0.11.24-alpha.6",
4
4
  "description": "项目创建命令行工具",
5
5
  "module": "es/index.mjs",
6
6
  "type": "module",
@@ -38,7 +38,7 @@
38
38
  "license": "MIT",
39
39
  "sideEffects": false,
40
40
  "devDependencies": {
41
- "@done-coding/cli-inject": "0.5.22-alpha.0",
41
+ "@done-coding/cli-inject": "0.5.22-alpha.2",
42
42
  "@types/node": "^18.0.0",
43
43
  "@types/yargs": "^17.0.28",
44
44
  "typescript": "^5.8.3",
@@ -46,13 +46,13 @@
46
46
  "vite-plugin-dts": "^3.6.0"
47
47
  },
48
48
  "dependencies": {
49
- "@done-coding/cli-git": "0.6.14-alpha.0",
50
- "@done-coding/cli-template": "0.8.9-alpha.0",
51
- "@done-coding/cli-utils": "0.8.3-alpha.0",
49
+ "@done-coding/cli-git": "0.6.14-alpha.2",
50
+ "@done-coding/cli-template": "0.8.9-alpha.2",
51
+ "@done-coding/cli-utils": "0.8.3-alpha.2",
52
52
  "@done-coding/mcp-utils": "0.0.2-alpha.2"
53
53
  },
54
54
  "engines": {
55
55
  "node": ">=18.0.0"
56
56
  },
57
- "gitHead": "9ef471070bc3f5010365ee288d3ef2a2a553ab02"
57
+ "gitHead": "57548a940adaa810d2d0c870df54d5013a86bfed"
58
58
  }
package/types/index.d.ts CHANGED
@@ -121,7 +121,7 @@ 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.4",
124
+ "version": "0.11.24-alpha.6",
125
125
  "description": "项目创建命令行工具",
126
126
  "bin": {
127
127
  "create-done-coding": "es/cli.mjs",