@done-coding/cli-publish 0.7.1-alpha.0 → 0.7.2-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/cli.mjs +1 -1
- package/es/{index-93ce7060.js → index-960a1b56.js} +1 -1
- package/es/index.mjs +1 -1
- package/package.json +4 -4
- package/types/cli.d.ts +1 -2
- package/types/index.d.ts +148 -3
- package/types/config/index.d.ts +0 -3
- package/types/handlers/alias.d.ts +0 -10
- package/types/handlers/exec.d.ts +0 -5
- package/types/handlers/index.d.ts +0 -8
- package/types/handlers/init.d.ts +0 -8
- package/types/injectInfo.json.d.ts +0 -11
- package/types/main.d.ts +0 -9
- package/types/types/index.d.ts +0 -124
- package/types/utils/index.d.ts +0 -1
- package/types/utils/path.d.ts +0 -6
package/es/cli.mjs
CHANGED
|
@@ -9,7 +9,7 @@ import T, { rmSync as Q } from "node:fs";
|
|
|
9
9
|
var E = /* @__PURE__ */ ((e) => (e.INIT = "init", e.EXEC = "exec", e.ALIAS = "alias", e))(E || {}), t = /* @__PURE__ */ ((e) => (e.MAJOR = "major", e.MINOR = "minor", e.PATCH = "patch", e.PREMAJOR = "premajor", e.PREMINOR = "preminor", e.PREPATCH = "prepatch", e.PRERELEASE = "prerelease", e))(t || {}), P = /* @__PURE__ */ ((e) => (e.LATEST = "latest", e.NEXT = "next", e.ALPHA = "alpha", e))(P || {}), l = /* @__PURE__ */ ((e) => (e.NPM = "npm", e.WEB = "web", e))(l || {});
|
|
10
10
|
const $ = {
|
|
11
11
|
name: "@done-coding/cli-publish",
|
|
12
|
-
version: "0.7.
|
|
12
|
+
version: "0.7.2-alpha.0",
|
|
13
13
|
description: "项目发布命令行工具",
|
|
14
14
|
cliConfig: {
|
|
15
15
|
namespaceDir: ".done-coding",
|
package/es/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { d as t, b as e, P as b, S as d, a as h, h as l } from "./index-
|
|
2
|
+
import { d as t, b as e, P as b, S as d, a as h, h as l } from "./index-960a1b56.js";
|
|
3
3
|
import "@done-coding/cli-utils";
|
|
4
4
|
import "node:os";
|
|
5
5
|
import "node:child_process";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@done-coding/cli-publish",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.2-alpha.0",
|
|
4
4
|
"description": "项目发布命令行工具",
|
|
5
5
|
"private": false,
|
|
6
6
|
"module": "es/index.mjs",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"license": "MIT",
|
|
41
41
|
"sideEffects": false,
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@done-coding/cli-inject": "^0.5.
|
|
43
|
+
"@done-coding/cli-inject": "^0.5.10-alpha.0",
|
|
44
44
|
"@types/node": "^18.0.0",
|
|
45
45
|
"@types/semver": "^7.5.3",
|
|
46
46
|
"@types/uuid": "^10.0.0",
|
|
@@ -54,9 +54,9 @@
|
|
|
54
54
|
"node": ">=18.0.0"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@done-coding/cli-utils": "^0.7.0",
|
|
57
|
+
"@done-coding/cli-utils": "^0.7.1-alpha.0",
|
|
58
58
|
"semver": "^7.5.4",
|
|
59
59
|
"uuid": "^11.1.0"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "3376f5fbbf8b87c791316e76df06028afd650e08"
|
|
62
62
|
}
|
package/types/cli.d.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export {};
|
|
1
|
+
export { }
|
package/types/index.d.ts
CHANGED
|
@@ -1,3 +1,148 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { CliHandlerArgv } from '@done-coding/cli-utils';
|
|
2
|
+
import { CommandModule } from 'yargs';
|
|
3
|
+
import type { GetGitLastCommitParams } from '@done-coding/cli-utils';
|
|
4
|
+
import type { InitConfigFileOptions } from '@done-coding/cli-utils';
|
|
5
|
+
import type { PackageJson } from '@done-coding/cli-utils';
|
|
6
|
+
import type { ReadConfigFileOptions } from '@done-coding/cli-utils';
|
|
7
|
+
|
|
8
|
+
export declare interface AliasOptions extends ReadConfigFileOptions {
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* 配置信息
|
|
13
|
+
*/
|
|
14
|
+
export declare interface ConfigInfo {
|
|
15
|
+
/** web发布配置 */
|
|
16
|
+
[PublishModeEnum.WEB]?: ConfigInfoWeb;
|
|
17
|
+
/** NPM发布配置 */
|
|
18
|
+
[PublishModeEnum.NPM]?: ConfigInfoNpm;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** 发布配置- npm模式 */
|
|
22
|
+
export declare interface ConfigInfoNpm extends GetGitLastCommitParams {
|
|
23
|
+
/** 别名信息 */
|
|
24
|
+
aliasInfo?: ConfigInfoNpmAliasInfo[];
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** 发布配置- npm模式-别名信息 */
|
|
28
|
+
export declare interface ConfigInfoNpmAliasInfo {
|
|
29
|
+
packageJson: Partial<Omit<PackageJson, "name">> & {
|
|
30
|
+
name: string;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** 发布配置- web模式 */
|
|
35
|
+
export declare interface ConfigInfoWeb extends GetGitLastCommitParams {
|
|
36
|
+
/**
|
|
37
|
+
* web构建命令
|
|
38
|
+
*/
|
|
39
|
+
build?: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** 作为子命令创建 */
|
|
43
|
+
export declare const crateAsSubcommand: () => CommandModule<{}, {}>;
|
|
44
|
+
|
|
45
|
+
export declare interface ExecOptions extends ReadConfigFileOptions {
|
|
46
|
+
/** 发布模式 */
|
|
47
|
+
mode: PublishModeEnum;
|
|
48
|
+
/**
|
|
49
|
+
* 发布类型
|
|
50
|
+
*/
|
|
51
|
+
type?: PublishVersionTypeEnum;
|
|
52
|
+
/** (发布成功后)是否推送至远程仓库 */
|
|
53
|
+
push: boolean;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export declare const handler: (command: SubcommandEnum, argv: CliHandlerArgv<any>) => Promise<void>;
|
|
57
|
+
|
|
58
|
+
export declare type InitOptions = InitConfigFileOptions;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* npm信息
|
|
62
|
+
*/
|
|
63
|
+
export declare interface NpmInfo {
|
|
64
|
+
/**
|
|
65
|
+
* 正式包名
|
|
66
|
+
*/
|
|
67
|
+
name: string;
|
|
68
|
+
/**
|
|
69
|
+
* 当前版本号
|
|
70
|
+
*/
|
|
71
|
+
version: string;
|
|
72
|
+
/**
|
|
73
|
+
* 标签
|
|
74
|
+
*/
|
|
75
|
+
tag: PublishTagEnum;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/** 发布模式 */
|
|
79
|
+
export declare enum PublishModeEnum {
|
|
80
|
+
/** npm发布模式 */
|
|
81
|
+
NPM = "npm",
|
|
82
|
+
/** web发布模式 */
|
|
83
|
+
WEB = "web"
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* 发布标签类型
|
|
88
|
+
*/
|
|
89
|
+
export declare enum PublishTagEnum {
|
|
90
|
+
/**
|
|
91
|
+
* 最新版本
|
|
92
|
+
*/
|
|
93
|
+
LATEST = "latest",
|
|
94
|
+
/**
|
|
95
|
+
* next版本
|
|
96
|
+
*/
|
|
97
|
+
NEXT = "next",
|
|
98
|
+
/**
|
|
99
|
+
* alpha版本
|
|
100
|
+
*/
|
|
101
|
+
ALPHA = "alpha"
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* 发布版本类型
|
|
106
|
+
*/
|
|
107
|
+
export declare enum PublishVersionTypeEnum {
|
|
108
|
+
/**
|
|
109
|
+
* 主版本号
|
|
110
|
+
*/
|
|
111
|
+
MAJOR = "major",
|
|
112
|
+
/**
|
|
113
|
+
* 次版本号
|
|
114
|
+
*/
|
|
115
|
+
MINOR = "minor",
|
|
116
|
+
/**
|
|
117
|
+
* 修订版本号
|
|
118
|
+
*/
|
|
119
|
+
PATCH = "patch",
|
|
120
|
+
/**
|
|
121
|
+
* 预发布版本号
|
|
122
|
+
*/
|
|
123
|
+
PREMAJOR = "premajor",
|
|
124
|
+
/**
|
|
125
|
+
* 预发布次版本号
|
|
126
|
+
*/
|
|
127
|
+
PREMINOR = "preminor",
|
|
128
|
+
/**
|
|
129
|
+
* 预发布修订版本号
|
|
130
|
+
*/
|
|
131
|
+
PREPATCH = "prepatch",
|
|
132
|
+
/**
|
|
133
|
+
* 预发布版本号
|
|
134
|
+
*/
|
|
135
|
+
PRERELEASE = "prerelease"
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/** 子命令枚举 */
|
|
139
|
+
export declare enum SubcommandEnum {
|
|
140
|
+
/** 初始化发布配置文件 */
|
|
141
|
+
INIT = "init",
|
|
142
|
+
/** 发布执行 */
|
|
143
|
+
EXEC = "exec",
|
|
144
|
+
/** 发布别名 */
|
|
145
|
+
ALIAS = "alias"
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export { }
|
package/types/config/index.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/// <reference types="yargs" />
|
|
2
|
-
import type { CliHandlerArgv, SubCliInfo } from "@done-coding/cli-utils";
|
|
3
|
-
import type { AliasOptions, ConfigInfo } from '../types';
|
|
4
|
-
/** 获取别名发布选项 */
|
|
5
|
-
export declare const getAliasOptions: () => Record<keyof import("@done-coding/cli-utils").ConfigFileCommonOptions, import("yargs").Options>;
|
|
6
|
-
/** 获取别名发布信息列表 */
|
|
7
|
-
export declare const getAliasInfoList: (configInfo: ConfigInfo) => import('../types').ConfigInfoNpmAliasInfo[] | undefined;
|
|
8
|
-
/** 别名发布命令处理器 */
|
|
9
|
-
export declare const aliasHandler: (argv: CliHandlerArgv<AliasOptions>) => Promise<void>;
|
|
10
|
-
export declare const aliasCommandCliInfo: SubCliInfo;
|
package/types/handlers/exec.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { ExecOptions } from '../types';
|
|
2
|
-
import type { CliHandlerArgv, CliInfo, SubCliInfo } from "@done-coding/cli-utils";
|
|
3
|
-
export declare const getExecOptions: () => CliInfo["options"];
|
|
4
|
-
export declare const execHandler: (argv: CliHandlerArgv<ExecOptions>) => Promise<undefined>;
|
|
5
|
-
export declare const execCommandCliInfo: SubCliInfo;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { initHandler, initCommandCliInfo } from "./init";
|
|
2
|
-
import { execHandler, execCommandCliInfo } from "./exec";
|
|
3
|
-
import { aliasHandler, aliasCommandCliInfo } from "./alias";
|
|
4
|
-
import { SubcommandEnum } from '../types';
|
|
5
|
-
import { type CliHandlerArgv, type CliInfo } from "@done-coding/cli-utils";
|
|
6
|
-
export { initHandler, initCommandCliInfo, execHandler, execCommandCliInfo, aliasHandler, aliasCommandCliInfo, };
|
|
7
|
-
export declare const handler: (command: SubcommandEnum, argv: CliHandlerArgv<any>) => Promise<void>;
|
|
8
|
-
export declare const commandCliInfo: Omit<CliInfo, "usage">;
|
package/types/handlers/init.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/// <reference types="yargs" />
|
|
2
|
-
import type { CliHandlerArgv, SubCliInfo } from "@done-coding/cli-utils";
|
|
3
|
-
import { type InitOptions } from '../types';
|
|
4
|
-
/** 获取初始化选项 */
|
|
5
|
-
export declare const getInitOptions: () => Record<keyof import("@done-coding/cli-utils").ConfigFileCommonOptions, import("yargs").Options>;
|
|
6
|
-
/** 初始化命令处理器 */
|
|
7
|
-
export declare const initHandler: (argv: CliHandlerArgv<InitOptions>) => Promise<void>;
|
|
8
|
-
export declare const initCommandCliInfo: SubCliInfo;
|
package/types/main.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
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<{}, {}>;
|
package/types/types/index.d.ts
DELETED
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import type { GetGitLastCommitParams, InitConfigFileOptions, PackageJson, ReadConfigFileOptions } from "@done-coding/cli-utils";
|
|
2
|
-
/** 子命令枚举 */
|
|
3
|
-
export declare enum SubcommandEnum {
|
|
4
|
-
/** 初始化发布配置文件 */
|
|
5
|
-
INIT = "init",
|
|
6
|
-
/** 发布执行 */
|
|
7
|
-
EXEC = "exec",
|
|
8
|
-
/** 发布别名 */
|
|
9
|
-
ALIAS = "alias"
|
|
10
|
-
}
|
|
11
|
-
export type InitOptions = InitConfigFileOptions;
|
|
12
|
-
/**
|
|
13
|
-
* 发布版本类型
|
|
14
|
-
*/
|
|
15
|
-
export declare enum PublishVersionTypeEnum {
|
|
16
|
-
/**
|
|
17
|
-
* 主版本号
|
|
18
|
-
*/
|
|
19
|
-
MAJOR = "major",
|
|
20
|
-
/**
|
|
21
|
-
* 次版本号
|
|
22
|
-
*/
|
|
23
|
-
MINOR = "minor",
|
|
24
|
-
/**
|
|
25
|
-
* 修订版本号
|
|
26
|
-
*/
|
|
27
|
-
PATCH = "patch",
|
|
28
|
-
/**
|
|
29
|
-
* 预发布版本号
|
|
30
|
-
*/
|
|
31
|
-
PREMAJOR = "premajor",
|
|
32
|
-
/**
|
|
33
|
-
* 预发布次版本号
|
|
34
|
-
*/
|
|
35
|
-
PREMINOR = "preminor",
|
|
36
|
-
/**
|
|
37
|
-
* 预发布修订版本号
|
|
38
|
-
*/
|
|
39
|
-
PREPATCH = "prepatch",
|
|
40
|
-
/**
|
|
41
|
-
* 预发布版本号
|
|
42
|
-
*/
|
|
43
|
-
PRERELEASE = "prerelease"
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* 发布标签类型
|
|
47
|
-
*/
|
|
48
|
-
export declare enum PublishTagEnum {
|
|
49
|
-
/**
|
|
50
|
-
* 最新版本
|
|
51
|
-
*/
|
|
52
|
-
LATEST = "latest",
|
|
53
|
-
/**
|
|
54
|
-
* next版本
|
|
55
|
-
*/
|
|
56
|
-
NEXT = "next",
|
|
57
|
-
/**
|
|
58
|
-
* alpha版本
|
|
59
|
-
*/
|
|
60
|
-
ALPHA = "alpha"
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* npm信息
|
|
64
|
-
*/
|
|
65
|
-
export interface NpmInfo {
|
|
66
|
-
/**
|
|
67
|
-
* 正式包名
|
|
68
|
-
*/
|
|
69
|
-
name: string;
|
|
70
|
-
/**
|
|
71
|
-
* 当前版本号
|
|
72
|
-
*/
|
|
73
|
-
version: string;
|
|
74
|
-
/**
|
|
75
|
-
* 标签
|
|
76
|
-
*/
|
|
77
|
-
tag: PublishTagEnum;
|
|
78
|
-
}
|
|
79
|
-
/** 发布模式 */
|
|
80
|
-
export declare enum PublishModeEnum {
|
|
81
|
-
/** npm发布模式 */
|
|
82
|
-
NPM = "npm",
|
|
83
|
-
/** web发布模式 */
|
|
84
|
-
WEB = "web"
|
|
85
|
-
}
|
|
86
|
-
/** 发布配置- web模式 */
|
|
87
|
-
export interface ConfigInfoWeb extends GetGitLastCommitParams {
|
|
88
|
-
/**
|
|
89
|
-
* web构建命令
|
|
90
|
-
*/
|
|
91
|
-
build?: string;
|
|
92
|
-
}
|
|
93
|
-
/** 发布配置- npm模式-别名信息 */
|
|
94
|
-
export interface ConfigInfoNpmAliasInfo {
|
|
95
|
-
packageJson: Partial<Omit<PackageJson, "name">> & {
|
|
96
|
-
name: string;
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
/** 发布配置- npm模式 */
|
|
100
|
-
export interface ConfigInfoNpm extends GetGitLastCommitParams {
|
|
101
|
-
/** 别名信息 */
|
|
102
|
-
aliasInfo?: ConfigInfoNpmAliasInfo[];
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* 配置信息
|
|
106
|
-
*/
|
|
107
|
-
export interface ConfigInfo {
|
|
108
|
-
/** web发布配置 */
|
|
109
|
-
[PublishModeEnum.WEB]?: ConfigInfoWeb;
|
|
110
|
-
/** NPM发布配置 */
|
|
111
|
-
[PublishModeEnum.NPM]?: ConfigInfoNpm;
|
|
112
|
-
}
|
|
113
|
-
export interface ExecOptions extends ReadConfigFileOptions {
|
|
114
|
-
/** 发布模式 */
|
|
115
|
-
mode: PublishModeEnum;
|
|
116
|
-
/**
|
|
117
|
-
* 发布类型
|
|
118
|
-
*/
|
|
119
|
-
type?: PublishVersionTypeEnum;
|
|
120
|
-
/** (发布成功后)是否推送至远程仓库 */
|
|
121
|
-
push: boolean;
|
|
122
|
-
}
|
|
123
|
-
export interface AliasOptions extends ReadConfigFileOptions {
|
|
124
|
-
}
|
package/types/utils/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./path";
|
package/types/utils/path.d.ts
DELETED