@peiyanlu/release 1.1.1 → 1.1.2
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/dist/cli.mjs +14 -14
- package/dist/index.d.mts +10 -3
- package/dist/index.mjs +10 -10
- package/package.json +3 -3
package/dist/cli.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { dim, green, red, rgb, underline, yellow } from "ansis";
|
|
|
5
5
|
import { program } from "commander";
|
|
6
6
|
import { createReadStream, createWriteStream, existsSync, readFileSync, statSync, writeFileSync } from "node:fs";
|
|
7
7
|
import { cancel, confirm, group, intro, isCancel, log, outro, select, tasks, text } from "@clack/prompts";
|
|
8
|
-
import { castArray, isFunction, isPlainObject, isUndefined, isZero,
|
|
8
|
+
import { castArray, isFunction, isPlainObject, isUndefined, isZero, mapObject } from "@peiyanlu/ts-utils";
|
|
9
9
|
import { publint } from "publint";
|
|
10
10
|
import { formatMessage } from "publint/utils";
|
|
11
11
|
import { inc, neq } from "semver";
|
|
@@ -553,12 +553,6 @@ const defaultTypes = [
|
|
|
553
553
|
effect: "hidden",
|
|
554
554
|
description: "持续集成配置"
|
|
555
555
|
},
|
|
556
|
-
{
|
|
557
|
-
type: "deps",
|
|
558
|
-
section: "📦 依赖更新",
|
|
559
|
-
effect: "changelog",
|
|
560
|
-
description: "依赖版本变更"
|
|
561
|
-
},
|
|
562
556
|
{
|
|
563
557
|
type: "security",
|
|
564
558
|
section: "🛡️ 安全修复",
|
|
@@ -584,16 +578,22 @@ const defaultTypes = [
|
|
|
584
578
|
description: "用户体验改进"
|
|
585
579
|
},
|
|
586
580
|
{
|
|
587
|
-
type: "
|
|
588
|
-
section: "
|
|
589
|
-
effect: "
|
|
590
|
-
description: "
|
|
581
|
+
type: "deps",
|
|
582
|
+
section: "📦 依赖更新",
|
|
583
|
+
effect: "changelog",
|
|
584
|
+
description: "依赖版本变更"
|
|
591
585
|
},
|
|
592
586
|
{
|
|
593
587
|
type: "tool",
|
|
594
588
|
section: "🛠️ 工具链",
|
|
595
589
|
effect: "hidden",
|
|
596
590
|
description: "工具链变更"
|
|
591
|
+
},
|
|
592
|
+
{
|
|
593
|
+
type: "config",
|
|
594
|
+
section: "⚙️ 配置",
|
|
595
|
+
effect: "hidden",
|
|
596
|
+
description: "配置文件更新"
|
|
597
597
|
}
|
|
598
598
|
];
|
|
599
599
|
//#endregion
|
|
@@ -986,14 +986,14 @@ var Action = class {
|
|
|
986
986
|
async createContext(cmdArgs, options, prepare = false) {
|
|
987
987
|
const { version: cVersion, name: cName } = readJsonFile(join(__dirname, "../package.json"));
|
|
988
988
|
const { otp, package: defPkg, releaseCount, ...others } = options;
|
|
989
|
-
const { showChangelog, showRelease, ci, dryRun, onlyChangelog } =
|
|
989
|
+
const { showChangelog, showRelease, ci, dryRun, onlyChangelog } = mapObject(others, (k, v) => [k, Boolean(v)]);
|
|
990
990
|
process.env["dryRun"] = String(dryRun);
|
|
991
991
|
const { configFile, config: local } = await resolveConfig(process.cwd());
|
|
992
992
|
const config = mergeConfig(createDefaultConfig(ci ? true : void 0), local);
|
|
993
993
|
info(MSG.INFO.TOOL(cName, cVersion));
|
|
994
994
|
info(MSG.INFO.CONFIG(configFile));
|
|
995
995
|
{
|
|
996
|
-
const { requireCleanWorkingTree, skipGit, skipNpm, skipGithub, isMonorepo, includeHidden } =
|
|
996
|
+
const { requireCleanWorkingTree, skipGit, skipNpm, skipGithub, isMonorepo, includeHidden } = mapObject(others, (k, v) => [k, Boolean(v)]);
|
|
997
997
|
const count = Number(releaseCount);
|
|
998
998
|
config.changelog.releaseCount = isNaN(count) ? 0 : count;
|
|
999
999
|
config.changelog.includeHidden = includeHidden;
|
|
@@ -1278,7 +1278,7 @@ program.command("init").description("Create a release configuration file").optio
|
|
|
1278
1278
|
if (add) gitAddSync([infile]);
|
|
1279
1279
|
console.log(`\n${content}`);
|
|
1280
1280
|
});
|
|
1281
|
-
program.addHelpText("afterAll", "\nThanks for using!");
|
|
1281
|
+
program.addHelpText("afterAll", "\nCASE: release -C -r0 --include-hidden --only-changelog\n\nThanks for using!");
|
|
1282
1282
|
program.parse(process.argv);
|
|
1283
1283
|
program.on("command:*", () => {
|
|
1284
1284
|
console.error(`\n${red`Error`} Invalid command: ${red`%s`}`, program.args.join(" "));
|
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import { DeepPartial, DeepRequired } from "@peiyanlu/ts-utils";
|
|
2
2
|
import { ConventionalChangelog } from "conventional-changelog";
|
|
3
|
-
import { CommitType } from "conventional-changelog-conventionalcommits";
|
|
3
|
+
import { CommitType as CommitType$1 } from "conventional-changelog-conventionalcommits";
|
|
4
4
|
import { log } from "@clack/prompts";
|
|
5
5
|
|
|
6
6
|
//#region src/types.d.ts
|
|
7
|
+
interface CommitType {
|
|
8
|
+
type: string;
|
|
9
|
+
section?: string;
|
|
10
|
+
effect?: 'bump' | 'changelog' | 'hidden';
|
|
11
|
+
scope?: string;
|
|
12
|
+
description?: string;
|
|
13
|
+
}
|
|
7
14
|
type Logger = typeof log;
|
|
8
15
|
type HookTiming = 'before' | 'after';
|
|
9
16
|
type HookAction = 'bump' | 'publish' | 'push' | 'release';
|
|
@@ -192,7 +199,7 @@ interface ParsePresetOptions {
|
|
|
192
199
|
/** 生成 CHANGELOG 时包含默认隐藏的 commit 类型 */
|
|
193
200
|
includeHidden?: boolean;
|
|
194
201
|
/** 对默认 commit types 进行转换 */
|
|
195
|
-
transformTypes?: (types: CommitType[]) => CommitType[];
|
|
202
|
+
transformTypes?: (types: CommitType$1[]) => CommitType$1[];
|
|
196
203
|
}
|
|
197
204
|
declare const createGenerator: (options: GenerateOptions & ParsePresetOptions) => Promise<ConventionalChangelog>;
|
|
198
205
|
declare const getChangelog: (options: GenerateOptions & ParsePresetOptions) => Promise<string>;
|
|
@@ -222,4 +229,4 @@ interface PublishTagOptions {
|
|
|
222
229
|
}
|
|
223
230
|
declare const publishTagToNpm: (options: PublishTagOptions) => Promise<void>;
|
|
224
231
|
//#endregion
|
|
225
|
-
export { type Logger, type UserConfig, createGenerator, defineConfig, generateChangelog, getChangelog, mergeConfig, publishTagToNpm };
|
|
232
|
+
export { type CommitType, type Logger, type UserConfig, createGenerator, defineConfig, generateChangelog, getChangelog, mergeConfig, publishTagToNpm };
|
package/dist/index.mjs
CHANGED
|
@@ -102,12 +102,6 @@ const defaultTypes = [
|
|
|
102
102
|
effect: "hidden",
|
|
103
103
|
description: "持续集成配置"
|
|
104
104
|
},
|
|
105
|
-
{
|
|
106
|
-
type: "deps",
|
|
107
|
-
section: "📦 依赖更新",
|
|
108
|
-
effect: "changelog",
|
|
109
|
-
description: "依赖版本变更"
|
|
110
|
-
},
|
|
111
105
|
{
|
|
112
106
|
type: "security",
|
|
113
107
|
section: "🛡️ 安全修复",
|
|
@@ -133,16 +127,22 @@ const defaultTypes = [
|
|
|
133
127
|
description: "用户体验改进"
|
|
134
128
|
},
|
|
135
129
|
{
|
|
136
|
-
type: "
|
|
137
|
-
section: "
|
|
138
|
-
effect: "
|
|
139
|
-
description: "
|
|
130
|
+
type: "deps",
|
|
131
|
+
section: "📦 依赖更新",
|
|
132
|
+
effect: "changelog",
|
|
133
|
+
description: "依赖版本变更"
|
|
140
134
|
},
|
|
141
135
|
{
|
|
142
136
|
type: "tool",
|
|
143
137
|
section: "🛠️ 工具链",
|
|
144
138
|
effect: "hidden",
|
|
145
139
|
description: "工具链变更"
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
type: "config",
|
|
143
|
+
section: "⚙️ 配置",
|
|
144
|
+
effect: "hidden",
|
|
145
|
+
description: "配置文件更新"
|
|
146
146
|
}
|
|
147
147
|
];
|
|
148
148
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@peiyanlu/release",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "Release project tool.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"@actions/github": "^9.1.1",
|
|
31
31
|
"@clack/prompts": "^1.5.0",
|
|
32
32
|
"@octokit/rest": "^22.0.1",
|
|
33
|
-
"@peiyanlu/cli-utils": "^0.0.
|
|
34
|
-
"@peiyanlu/ts-utils": "^0.0.
|
|
33
|
+
"@peiyanlu/cli-utils": "^0.0.13",
|
|
34
|
+
"@peiyanlu/ts-utils": "^0.0.9",
|
|
35
35
|
"ansis": "^4.3.1",
|
|
36
36
|
"commander": "^15.0.0",
|
|
37
37
|
"conventional-changelog": "^8.0.0",
|