dc-create 0.11.7-alpha.0

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/index.mjs ADDED
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env node
2
+ import { a as n, h as s } from "./index-4d284b70.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": "dc-create",
3
+ "version": "0.11.7-alpha.0",
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
+ "scripts": {},
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "https://gitee.com/justsosu/done-coding-cli.git",
23
+ "directory": "packages/create"
24
+ },
25
+ "publishConfig": {
26
+ "access": "public",
27
+ "registry": "https://registry.npmjs.org/"
28
+ },
29
+ "author": "JustSoSu",
30
+ "license": "MIT",
31
+ "sideEffects": false,
32
+ "devDependencies": {
33
+ "@types/node": "^18.0.0",
34
+ "@types/yargs": "^17.0.28",
35
+ "rimraf": "^6.0.1",
36
+ "typescript": "^5.2.2",
37
+ "vite": "^4.4.11",
38
+ "vite-plugin-dts": "^3.6.0"
39
+ },
40
+ "engines": {
41
+ "node": ">=18.0.0"
42
+ },
43
+ "dependencies": {
44
+ "@done-coding/cli-git": "^0.5.5-alpha.1",
45
+ "@done-coding/cli-inject": "^0.5.8-alpha.0",
46
+ "@done-coding/cli-template": "^0.7.8-alpha.1",
47
+ "@done-coding/cli-utils": "^0.6.0-alpha.0"
48
+ },
49
+ "gitHead": "5879161383e32e7bed351d71d3ef607d81dc021a"
50
+ }
package/types/cli.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
@@ -0,0 +1,3 @@
1
+ import type { CliHandlerArgv } from "@done-coding/cli-utils";
2
+ import type { Options } from "./types";
3
+ export declare const handler: (argv: CliHandlerArgv<Options>) => Promise<undefined>;
@@ -0,0 +1,3 @@
1
+ export { handler } from "./handler";
2
+ export { crateAsSubcommand } from "./main";
3
+ export * from './types';
@@ -0,0 +1,11 @@
1
+ declare const _default: {
2
+ "name": "create-done-coding",
3
+ "version": "0.11.7-alpha.0",
4
+ "description": "项目创建命令行工具",
5
+ "cliConfig": {
6
+ "namespaceDir": ".done-coding",
7
+ "moduleName": "create"
8
+ }
9
+ };
10
+
11
+ export default _default;
@@ -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,4 @@
1
+ /** 自定义模板路径 */
2
+ export declare const CUSTOM_TEMPLATE_NAME = "\u81EA\u5B9A\u4E49\u6A21\u7248\u8DEF\u5F84";
3
+ /** 某个公共仓库 */
4
+ export declare const SOMEONE_PUBLIC_REPO_NAME = "\u67D0\u4E2Agit\u5E73\u53F0\u7528\u6237\u4ED3\u5E93";
@@ -0,0 +1,2 @@
1
+ export * from "./const";
2
+ export * from "./question";
@@ -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>;