@ruan-cat/utils 4.0.0 → 4.1.1

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.
@@ -30,4 +30,33 @@ declare function clean(
30
30
  */
31
31
  targets?: string[]): Promise<void>;
32
32
 
33
- export { type PackageInfo, clean, defaultCleanTargets, getRuanCatPkgInfo };
33
+ /** 检查当前运行的根目录 是否存在 CHANGELOG.md 文件 */
34
+ declare function hasChangelogMd(): boolean;
35
+ /**
36
+ * 将 CHANGELOG.md 文件移动到指定要求的位置内
37
+ * @description
38
+ * 该函数相当于实现 `cpx CHANGELOG.md docs` 命令
39
+ */
40
+ declare function copyChangelogMd(/** 目标文件夹 */ target: string): void;
41
+
42
+ interface WriteYaml2mdParams<T = Record<string, any>> {
43
+ /** 目标md文件地址 */
44
+ mdPath: string;
45
+ /** 被插入到md头部的数据 */
46
+ data: T;
47
+ }
48
+ /**
49
+ * 将YAML数据写入到MD文件内
50
+ */
51
+ declare function writeYaml2md<T>(params: WriteYaml2mdParams<T>): void;
52
+
53
+ interface AddChangelog2docOptions<T = Record<string, any>> {
54
+ /** 目标文件夹 */
55
+ target: string;
56
+ /** 被插入到md头部的数据 */
57
+ data: T;
58
+ }
59
+ /** 将变更日志添加到指定的文档目录内 并提供参数 */
60
+ declare function addChangelog2doc<T>(options: AddChangelog2docOptions<T>): void;
61
+
62
+ export { type AddChangelog2docOptions, type PackageInfo, type WriteYaml2mdParams, addChangelog2doc, clean, copyChangelogMd, defaultCleanTargets, getRuanCatPkgInfo, hasChangelogMd, writeYaml2md };