dc-create 0.11.21 → 0.11.24
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 +216 -3
- package/es/cli.mjs +1 -2
- package/es/{index-20b1695c.js → index-16ca177d.js} +1663 -1581
- package/es/index.mjs +9 -8
- package/package.json +9 -10
- package/types/index.d.ts +90 -1
- package/types/mcp/server-config.d.ts +7 -0
- package/types/mcp/server.d.ts +2 -0
- package/types/mcp-config.d.ts +7 -0
- package/types/mcp-server.d.ts +1 -0
- package/types/mcp.d.ts +2 -0
- package/types/template.json.d.ts +156 -0
package/es/index.mjs
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
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-16ca177d.js";
|
|
3
3
|
import "@done-coding/cli-utils";
|
|
4
|
-
import "node:child_process";
|
|
5
4
|
import "node:fs";
|
|
6
5
|
import "node:path";
|
|
7
6
|
import "@done-coding/cli-template";
|
|
8
7
|
import "@done-coding/cli-git";
|
|
9
8
|
export {
|
|
10
|
-
s as
|
|
9
|
+
s as FormNameEnum,
|
|
10
|
+
t as GitRemoteRepoAliasNameEnum,
|
|
11
11
|
d as SubcommandEnum,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
b as handler
|
|
12
|
+
c as commandCliInfo,
|
|
13
|
+
p as crateAsSubcommand,
|
|
14
|
+
u as createCommandCliInfo,
|
|
15
|
+
l as createHandler,
|
|
16
|
+
b as handler,
|
|
17
|
+
f as injectInfo
|
|
17
18
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dc-create",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.24",
|
|
4
4
|
"description": "项目创建命令行工具",
|
|
5
5
|
"module": "es/index.mjs",
|
|
6
6
|
"type": "module",
|
|
@@ -30,22 +30,21 @@
|
|
|
30
30
|
"license": "MIT",
|
|
31
31
|
"sideEffects": false,
|
|
32
32
|
"devDependencies": {
|
|
33
|
+
"@done-coding/cli-inject": "0.5.22",
|
|
33
34
|
"@types/node": "^18.0.0",
|
|
34
35
|
"@types/yargs": "^17.0.28",
|
|
35
|
-
"
|
|
36
|
-
"typescript": "^5.2.2",
|
|
36
|
+
"typescript": "^5.8.3",
|
|
37
37
|
"vite": "^4.4.11",
|
|
38
38
|
"vite-plugin-dts": "^3.6.0"
|
|
39
39
|
},
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"@done-coding/cli-git": "0.6.14",
|
|
42
|
+
"@done-coding/cli-template": "0.8.9",
|
|
43
|
+
"@done-coding/cli-utils": "0.8.3"
|
|
44
|
+
},
|
|
40
45
|
"engines": {
|
|
41
46
|
"node": ">=18.0.0"
|
|
42
47
|
},
|
|
43
|
-
"
|
|
44
|
-
"@done-coding/cli-git": "0.6.11",
|
|
45
|
-
"@done-coding/cli-inject": "0.5.19",
|
|
46
|
-
"@done-coding/cli-template": "0.8.6",
|
|
47
|
-
"@done-coding/cli-utils": "0.8.0"
|
|
48
|
-
},
|
|
49
|
-
"gitHead": "e68f726aa899f75c4d294b11620f343c953a74c3",
|
|
48
|
+
"gitHead": "4893b466954ef5925151d8dfc8fc8aa558ce654c",
|
|
50
49
|
"scripts": {}
|
|
51
50
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CliHandlerArgv } from '@done-coding/cli-utils';
|
|
2
2
|
import { CliInfo } from '@done-coding/cli-utils';
|
|
3
3
|
import { CommandModule } from 'yargs';
|
|
4
|
+
import { McpCommonToolParams } from '@done-coding/mcp-utils';
|
|
4
5
|
import type { SubCliInfo } from '@done-coding/cli-utils';
|
|
5
6
|
|
|
6
7
|
export declare const commandCliInfo: Omit<CliInfo, "usage">;
|
|
@@ -18,9 +19,40 @@ export declare const createHandler: (argv: CliHandlerArgv<CreateOptions>) => Pro
|
|
|
18
19
|
|
|
19
20
|
export declare interface CreateOptions {
|
|
20
21
|
/** 项目名称 */
|
|
21
|
-
|
|
22
|
+
[FormNameEnum.PROJECT_NAME]?: string;
|
|
22
23
|
/** 是否仅仅(从done-coding系列项目列表中)克隆远程仓库 */
|
|
23
24
|
justCloneFromDoneCoding?: boolean;
|
|
25
|
+
/** 模板仓库地址 */
|
|
26
|
+
[FormNameEnum.TEMPLATE_GIT_PATH]?: string;
|
|
27
|
+
/** 模板仓库分支 -- 不传则是默认分支 */
|
|
28
|
+
[FormNameEnum.TEMPLATE_GIT_BRANCH]?: string;
|
|
29
|
+
/** 是否跳过模板编译(不跳过则会在克隆完成后进行模板编译)
|
|
30
|
+
* --
|
|
31
|
+
* 为MCP模式预留 设置为true则不会进行模板编译
|
|
32
|
+
*/
|
|
33
|
+
skipTemplateCompile?: boolean;
|
|
34
|
+
/** 开启git细节优化(设置为true则会在克隆完成后进行git细节优化)
|
|
35
|
+
* --
|
|
36
|
+
* 为MCP模式预留 设置为false则不会进行git细节优化
|
|
37
|
+
*/
|
|
38
|
+
openGitDetailOptimize?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* git细节优化:是否更改分支名
|
|
41
|
+
*/
|
|
42
|
+
[FormNameEnum.IS_CHANGE_BRANCH_NAME]?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* git细节优化:需要更改本地分支名时的更改值
|
|
45
|
+
*/
|
|
46
|
+
[FormNameEnum.LOCAL_BRANCH_NAME]?: string;
|
|
47
|
+
/** git细节优化:是否保存模板仓库git历史记录
|
|
48
|
+
*/
|
|
49
|
+
[FormNameEnum.IS_SAVE_GIT_HISTORY]?: boolean;
|
|
50
|
+
/** git细节优化:是否将http url转换为ssh url
|
|
51
|
+
*/
|
|
52
|
+
[FormNameEnum.IS_TRANS_HTTP_URL_TO_SSH_URL]?: boolean;
|
|
53
|
+
/** git细节优化:git提交信息
|
|
54
|
+
*/
|
|
55
|
+
[FormNameEnum.GIT_COMMIT_MESSAGE]?: string;
|
|
24
56
|
}
|
|
25
57
|
|
|
26
58
|
/** 创建模板-分支信息 */
|
|
@@ -45,6 +77,38 @@ export declare interface CreateTemplateChoiceItem {
|
|
|
45
77
|
instances?: string[];
|
|
46
78
|
}
|
|
47
79
|
|
|
80
|
+
/** 表单name枚举 */
|
|
81
|
+
export declare enum FormNameEnum {
|
|
82
|
+
/** 项目名称选择 */
|
|
83
|
+
PROJECT_NAME = "projectName",
|
|
84
|
+
/** 模板选择 */
|
|
85
|
+
TEMPLATE = "template",
|
|
86
|
+
/** 是否保留git记录 */
|
|
87
|
+
IS_SAVE_GIT_HISTORY = "saveGitHistory",
|
|
88
|
+
/** 转换为ssh url */
|
|
89
|
+
IS_TRANS_HTTP_URL_TO_SSH_URL = "isTransToSshUrl",
|
|
90
|
+
/** 是否移除同名目录 */
|
|
91
|
+
IS_REMOVE_SAME_NAME_DIR = "isRemove",
|
|
92
|
+
/** 是否更改分支名-当指定模板分支时(即本地是否需要重命名分支名) */
|
|
93
|
+
IS_CHANGE_BRANCH_NAME = "isChangeBranchName",
|
|
94
|
+
/** (如果要改分支名)本地分支名 */
|
|
95
|
+
LOCAL_BRANCH_NAME = "localBranchName",
|
|
96
|
+
/** 是否浅克隆 */
|
|
97
|
+
IS_SHALLOW_CLONE = "shallowClone",
|
|
98
|
+
/** 自定义模板路径 */
|
|
99
|
+
CUSTOM_GIT_URL_INPUT = "customUrl",
|
|
100
|
+
/** git的提交信息 */
|
|
101
|
+
GIT_COMMIT_MESSAGE = "gitCommitMessage",
|
|
102
|
+
/**
|
|
103
|
+
* 模板仓库地址
|
|
104
|
+
* ----
|
|
105
|
+
* 为mcp拓展所加
|
|
106
|
+
*/
|
|
107
|
+
TEMPLATE_GIT_PATH = "templateGitPath",
|
|
108
|
+
/** 模板仓库分支 */
|
|
109
|
+
TEMPLATE_GIT_BRANCH = "templateGitBranch"
|
|
110
|
+
}
|
|
111
|
+
|
|
48
112
|
/** 远程仓库别名枚举 */
|
|
49
113
|
export declare enum GitRemoteRepoAliasNameEnum {
|
|
50
114
|
/** 默认 */
|
|
@@ -55,6 +119,31 @@ export declare enum GitRemoteRepoAliasNameEnum {
|
|
|
55
119
|
|
|
56
120
|
export declare const handler: (command: SubcommandEnum, argv: CliHandlerArgv<any>) => Promise<undefined>;
|
|
57
121
|
|
|
122
|
+
export declare const injectInfo: {
|
|
123
|
+
"name": "create-done-coding",
|
|
124
|
+
"version": "0.11.24",
|
|
125
|
+
"description": "项目创建命令行工具",
|
|
126
|
+
"bin": {
|
|
127
|
+
"create-done-coding": "es/cli.mjs"
|
|
128
|
+
},
|
|
129
|
+
"cliConfig": {
|
|
130
|
+
"namespaceDir": ".done-coding",
|
|
131
|
+
"moduleName": "create"
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* mcp项目创建工具参数
|
|
137
|
+
*/
|
|
138
|
+
export declare interface McpCreateToolParams extends McpCommonToolParams {
|
|
139
|
+
/** 项目名称 */
|
|
140
|
+
[FormNameEnum.PROJECT_NAME]: string;
|
|
141
|
+
/** 模板仓库地址 */
|
|
142
|
+
[FormNameEnum.TEMPLATE_GIT_PATH]: string;
|
|
143
|
+
/** 模板仓库分支 */
|
|
144
|
+
[FormNameEnum.TEMPLATE_GIT_BRANCH]?: string;
|
|
145
|
+
}
|
|
146
|
+
|
|
58
147
|
export declare enum SubcommandEnum {
|
|
59
148
|
CREATE = "create"
|
|
60
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[];
|
|
@@ -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[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/types/mcp.d.ts
ADDED
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
"templateList": [
|
|
3
|
+
{
|
|
4
|
+
"name": "template-npm-common",
|
|
5
|
+
"description": "通用的npm工具包ts模板",
|
|
6
|
+
"url": "https://gitee.com/justsosu/template-npm-common.git",
|
|
7
|
+
"branch": [
|
|
8
|
+
{
|
|
9
|
+
"name": "template/standalone",
|
|
10
|
+
"description": "独立项目(自带工程化配置)"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"name": "template/workspace",
|
|
14
|
+
"description": "workspace项目(不带工程化配置)"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"name": "template-npm-node-common",
|
|
20
|
+
"description": "node环境运行通用的npm工具包ts模板",
|
|
21
|
+
"url": "https://gitee.com/justsosu/template-npm-node-common.git",
|
|
22
|
+
"branch": [
|
|
23
|
+
{
|
|
24
|
+
"name": "template/standalone",
|
|
25
|
+
"description": "独立项目(自带工程化配置)"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"name": "template/workspace",
|
|
29
|
+
"description": "workspace项目(不带工程化配置)"
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"name": "template-npm-node-cli",
|
|
35
|
+
"description": "node环境运行的npm cli工具包ts模板",
|
|
36
|
+
"url": "https://gitee.com/justsosu/template-npm-node-cli.git",
|
|
37
|
+
"branch": [
|
|
38
|
+
{
|
|
39
|
+
"name": "template/standalone",
|
|
40
|
+
"description": "独立项目(自带工程化配置)"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"name": "template/workspace",
|
|
44
|
+
"description": "workspace项目(不带工程化配置)"
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"name": "template-node-server",
|
|
50
|
+
"description": "node环境服务ts模板",
|
|
51
|
+
"url": "https://gitee.com/justsosu/template-node-server.git",
|
|
52
|
+
"branch": [
|
|
53
|
+
{
|
|
54
|
+
"name": "template/standalone",
|
|
55
|
+
"description": "独立项目(自带工程化配置)"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"name": "template/workspace",
|
|
59
|
+
"description": "workspace项目(不带工程化配置)"
|
|
60
|
+
}
|
|
61
|
+
]
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"name": "template-web-admin-vue3",
|
|
65
|
+
"description": "web后台管理系统vue3项目模板",
|
|
66
|
+
"instances": [],
|
|
67
|
+
"url": "https://gitee.com/justsosu/template-web-pc-vue3.git",
|
|
68
|
+
"branch": [
|
|
69
|
+
{
|
|
70
|
+
"name": "master",
|
|
71
|
+
"description": "后台管理系统项目-独立项目"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"name": "subpackage",
|
|
75
|
+
"description": "后台管理系统项目-lerna管理的monorepo子项目"
|
|
76
|
+
}
|
|
77
|
+
]
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"name": "template-web-mobile-vue3",
|
|
81
|
+
"description": "web移动端vue3项目",
|
|
82
|
+
"instances": [],
|
|
83
|
+
"url": "https://gitee.com/justsosu/template-web-m-vue3.git"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"name": "template-uni-mobile-vue3",
|
|
87
|
+
"description": "uni移动端vue3项目",
|
|
88
|
+
"instances": [],
|
|
89
|
+
"url": "https://gitee.com/justsosu/template-uni-m-vue3.git"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"name": "template-web-mobile-react",
|
|
93
|
+
"description": "web移动端react项目",
|
|
94
|
+
"instances": [],
|
|
95
|
+
"url": "https://gitee.com/justsosu/template-web-m-react.git"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"name": "template-node-express",
|
|
99
|
+
"description": "node express项目模板",
|
|
100
|
+
"instances": [],
|
|
101
|
+
"url": "https://gitee.com/justsosu/template-node-express.git"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"name": "template-monorepo",
|
|
105
|
+
"description": "lerna管理的monorepo项目模板",
|
|
106
|
+
"instances": [
|
|
107
|
+
"done-coding-request",
|
|
108
|
+
"done-coding-cli",
|
|
109
|
+
"done-coding-x"
|
|
110
|
+
],
|
|
111
|
+
"url": "https://gitee.com/justsosu/template-monorepo.git",
|
|
112
|
+
"branch": [
|
|
113
|
+
{
|
|
114
|
+
"name": "master",
|
|
115
|
+
"description": "lerna管理的通用monorepo项目"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"name": "components",
|
|
119
|
+
"description": "lerna管理的vue3 monorepo项目"
|
|
120
|
+
}
|
|
121
|
+
]
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"name": "template-web-site-vue3",
|
|
125
|
+
"description": "web网站vue3项目模板",
|
|
126
|
+
"instances": [],
|
|
127
|
+
"url": "https://gitee.com/justsosu/template-web-site-vue3.git"
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"name": "template-components-vue3",
|
|
131
|
+
"description": "vue3组件库项目模板",
|
|
132
|
+
"instances": [],
|
|
133
|
+
"url": "https://gitee.com/justsosu/template-components-vue3.git",
|
|
134
|
+
"branch": [
|
|
135
|
+
{
|
|
136
|
+
"name": "master",
|
|
137
|
+
"description": "vue3组件库项目-独立项目"
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"name": "subpackage",
|
|
141
|
+
"description": "vue3组件库项目-lerna管理的monorepo子项目"
|
|
142
|
+
}
|
|
143
|
+
]
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"name": "template-micro-app-vue3",
|
|
147
|
+
"description": "微前端框架(micro-app[京东])项目模板",
|
|
148
|
+
"instances": [],
|
|
149
|
+
"url": "https://gitee.com/justsosu/template-micro-app.git",
|
|
150
|
+
"branch": "vue3"
|
|
151
|
+
}
|
|
152
|
+
]
|
|
153
|
+
}
|
|
154
|
+
;
|
|
155
|
+
|
|
156
|
+
export default _default;
|