done-coding-create 0.11.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/README.md +7 -0
- package/es/cli.mjs +9 -0
- package/es/index-1bee1c57.js +4215 -0
- package/es/index.mjs +12 -0
- package/package.json +50 -0
- package/types/cli.d.ts +2 -0
- package/types/handler.d.ts +3 -0
- package/types/index.d.ts +3 -0
- package/types/injectInfo.json.d.ts +11 -0
- package/types/main.d.ts +9 -0
- package/types/types/index.d.ts +22 -0
- package/types/utils/const.d.ts +4 -0
- package/types/utils/index.d.ts +2 -0
- package/types/utils/question.d.ts +24 -0
package/es/index.mjs
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { a as n, h as s } from "./index-1bee1c57.js";
|
|
3
|
+
import "@done-coding/cli-utils";
|
|
4
|
+
import "node:child_process";
|
|
5
|
+
import "node:fs";
|
|
6
|
+
import "node:path";
|
|
7
|
+
import "@done-coding/cli-template";
|
|
8
|
+
import "@done-coding/cli-git";
|
|
9
|
+
export {
|
|
10
|
+
n as crateAsSubcommand,
|
|
11
|
+
s as handler
|
|
12
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "done-coding-create",
|
|
3
|
+
"version": "0.11.7",
|
|
4
|
+
"description": "项目创建命令行工具",
|
|
5
|
+
"module": "es/index.mjs",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"types": "types/index.d.ts",
|
|
8
|
+
"bin": "es/cli.mjs",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": "./es/index.mjs"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"es",
|
|
16
|
+
"lib",
|
|
17
|
+
"types"
|
|
18
|
+
],
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "https://gitee.com/justsosu/done-coding-cli.git",
|
|
22
|
+
"directory": "packages/create"
|
|
23
|
+
},
|
|
24
|
+
"publishConfig": {
|
|
25
|
+
"access": "public",
|
|
26
|
+
"registry": "https://registry.npmjs.org/"
|
|
27
|
+
},
|
|
28
|
+
"author": "JustSoSu",
|
|
29
|
+
"license": "MIT",
|
|
30
|
+
"sideEffects": false,
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@types/node": "^18.0.0",
|
|
33
|
+
"@types/yargs": "^17.0.28",
|
|
34
|
+
"rimraf": "^6.0.1",
|
|
35
|
+
"typescript": "^5.2.2",
|
|
36
|
+
"vite": "^4.4.11",
|
|
37
|
+
"vite-plugin-dts": "^3.6.0"
|
|
38
|
+
},
|
|
39
|
+
"engines": {
|
|
40
|
+
"node": ">=18.0.0"
|
|
41
|
+
},
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"@done-coding/cli-git": "^0.6.0",
|
|
44
|
+
"@done-coding/cli-inject": "^0.5.8",
|
|
45
|
+
"@done-coding/cli-template": "^0.7.8",
|
|
46
|
+
"@done-coding/cli-utils": "^0.7.0"
|
|
47
|
+
},
|
|
48
|
+
"gitHead": "b4fb4f2380a14f72597a1dbfd1bbce22287ef02f",
|
|
49
|
+
"scripts": {}
|
|
50
|
+
}
|
package/types/cli.d.ts
ADDED
package/types/index.d.ts
ADDED
package/types/main.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="yargs" />
|
|
2
|
+
/** 作为主命令创建 */
|
|
3
|
+
export declare const createCommand: () => Promise<void | {
|
|
4
|
+
[x: string]: unknown;
|
|
5
|
+
_: (string | number)[];
|
|
6
|
+
$0: string;
|
|
7
|
+
}>;
|
|
8
|
+
/** 作为子命令创建 */
|
|
9
|
+
export declare const crateAsSubcommand: () => import("yargs").CommandModule<{}, {}>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface Options {
|
|
2
|
+
/** 项目名称 */
|
|
3
|
+
projectName?: string;
|
|
4
|
+
/** 是否仅仅(从done-coding系列项目列表中)克隆远程仓库 */
|
|
5
|
+
justCloneFromDoneCoding?: boolean;
|
|
6
|
+
}
|
|
7
|
+
/** 模版选项 */
|
|
8
|
+
export interface CreateTemplateChoiceItem {
|
|
9
|
+
/** 模板名 */
|
|
10
|
+
name: string;
|
|
11
|
+
/** 仓库地址 */
|
|
12
|
+
url?: string;
|
|
13
|
+
/** 描述 */
|
|
14
|
+
description?: string;
|
|
15
|
+
/** 目标分支 */
|
|
16
|
+
branch?: string;
|
|
17
|
+
/** 应用实例 */
|
|
18
|
+
instances?: string[];
|
|
19
|
+
}
|
|
20
|
+
export interface CreateConfigJson {
|
|
21
|
+
templateList: CreateTemplateChoiceItem[];
|
|
22
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type PromptObject } from "@done-coding/cli-utils";
|
|
2
|
+
import type { CreateTemplateChoiceItem } from '../types';
|
|
3
|
+
/** 获取模版选项 */
|
|
4
|
+
export declare const getTemplateList: () => Promise<CreateTemplateChoiceItem[]>;
|
|
5
|
+
/** 模版选项 */
|
|
6
|
+
export declare const getTemplateChoices: () => Promise<CreateTemplateChoiceItem[]>;
|
|
7
|
+
export declare const projectNameForm: PromptObject<string>;
|
|
8
|
+
export declare const getTemplateForm: () => Promise<PromptObject<string>>;
|
|
9
|
+
export declare const saveGitHistoryForm: {
|
|
10
|
+
type: "confirm";
|
|
11
|
+
name: string;
|
|
12
|
+
message: string;
|
|
13
|
+
initial: boolean;
|
|
14
|
+
};
|
|
15
|
+
/** 获取删除目录的表单 */
|
|
16
|
+
export declare const getRemoveDirForm: (message?: string) => {
|
|
17
|
+
type: "confirm";
|
|
18
|
+
name: string;
|
|
19
|
+
message: string;
|
|
20
|
+
};
|
|
21
|
+
/** 自定义模板路径表单 */
|
|
22
|
+
export declare const customUrlForm: PromptObject<string>;
|
|
23
|
+
/** 获取git提交信息表单 */
|
|
24
|
+
export declare const getGitCommitMessageForm: (projectName: string) => PromptObject<string>;
|