@ruan-cat/utils 4.16.0 → 4.17.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/dist/index.d.ts CHANGED
@@ -93,6 +93,19 @@ declare function executePromiseTasks(config: TasksConfig,
93
93
  */
94
94
  lastParams?: any): Promise<any>;
95
95
 
96
+ /**
97
+ * 判断目标项目是否是 monorepo 格式的项目
98
+ * @description
99
+ * 判别逻辑:
100
+ * 1. 目标项目同时存在 `pnpm-workspace.yaml` 文件
101
+ * 2. `pnpm-workspace.yaml` 提供了有效的 packages 匹配配置
102
+ * 3. 至少能匹配到一个 package.json 文件
103
+ *
104
+ * @returns {boolean} 是否是 monorepo 项目
105
+ * @throws {Error} 当 pnpm-workspace.yaml 格式错误时抛出错误
106
+ */
107
+ declare function isMonorepoProject(): boolean;
108
+
96
109
  /**
97
110
  * pnpm-workspace.yaml 文件的类型声明
98
111
  * @description
@@ -130,4 +143,4 @@ type Prettify<T> = {
130
143
  */
131
144
  type ToNumberLike<T extends number> = T | `${T}`;
132
145
 
133
- export { type BaseTask, type Condition, type Conditions, type ParallelTasks, type PnpmWorkspace, type Prettify, type PrintListParams, type PromiseTasksConfig, type QueueTasks, type SimpleAsyncTask, type SingleTasks, type Task, type TaskType, type TasksConfig, type ToNumberLike, definePromiseTasks, executePromiseTasks, generateSimpleAsyncTask, initFlag, isConditionsEvery, isConditionsSome, printFormat, printList, runPromiseByConcurrency, runPromiseByQueue, taskTypes };
146
+ export { type BaseTask, type Condition, type Conditions, type ParallelTasks, type PnpmWorkspace, type Prettify, type PrintListParams, type PromiseTasksConfig, type QueueTasks, type SimpleAsyncTask, type SingleTasks, type Task, type TaskType, type TasksConfig, type ToNumberLike, definePromiseTasks, executePromiseTasks, generateSimpleAsyncTask, initFlag, isConditionsEvery, isConditionsSome, isMonorepoProject, printFormat, printList, runPromiseByConcurrency, runPromiseByQueue, taskTypes };