@ruan-cat/utils 4.18.0 → 4.20.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 +6 -30
- package/dist/index.js +0 -2632
- package/dist/index.js.map +1 -1
- package/dist/node-cjs/index.cjs +2 -2
- package/dist/node-cjs/index.cjs.map +1 -1
- package/dist/node-cjs/index.d.cts +17 -29
- package/dist/node-esm/index.d.ts +14 -1
- package/dist/node-esm/index.js +35 -2
- package/dist/node-esm/index.js.map +1 -1
- package/package.json +4 -3
- package/src/index.ts +0 -1
- package/src/{monorepo.ts → monorepo/index.ts} +1 -1
- package/src/node-cjs/index.ts +3 -0
- package/src/node-esm/index.ts +3 -0
- package/src/types/pnpm-workspace.yaml.shim.ts +5 -17
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { PnpmWorkspaceYamlSchema } from 'pnpm-workspace-yaml';
|
|
2
|
+
|
|
1
3
|
type Condition = (...args: unknown[]) => boolean;
|
|
2
4
|
/** @deprecated 没必要 */
|
|
3
5
|
type Conditions = Condition[];
|
|
@@ -93,40 +95,14 @@ declare function executePromiseTasks(config: TasksConfig,
|
|
|
93
95
|
*/
|
|
94
96
|
lastParams?: any): Promise<any>;
|
|
95
97
|
|
|
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
|
-
|
|
109
98
|
/**
|
|
110
99
|
* pnpm-workspace.yaml 文件的类型声明
|
|
111
100
|
* @description
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
* 主要是为了让该文件被解析后,能够有一个基础的类型声明
|
|
101
|
+
* 现在是 pnpm-workspace-yaml 提供的 `PnpmWorkspaceYamlSchema` 类型
|
|
115
102
|
*
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
-
* 未来应该找到这样的类型声明库,直接复用别人的就好了,不要自己写了。
|
|
103
|
+
* @see https://github.com/antfu/pnpm-workspace-utils/blob/main/packages/pnpm-workspace-yaml/src/index.ts#L4
|
|
119
104
|
*/
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
* 包的匹配语法字符串
|
|
123
|
-
*
|
|
124
|
-
* @example
|
|
125
|
-
* ["packages/**", "demos/**", "utils"]
|
|
126
|
-
*/
|
|
127
|
-
packages?: string[];
|
|
128
|
-
catalog?: string[];
|
|
129
|
-
}
|
|
105
|
+
type PnpmWorkspace = PnpmWorkspaceYamlSchema;
|
|
130
106
|
|
|
131
107
|
/**
|
|
132
108
|
* `Prettify` 帮助程序是一种实用程序类型,它采用对象类型并使悬停叠加更具可读性。
|
|
@@ -143,4 +119,4 @@ type Prettify<T> = {
|
|
|
143
119
|
*/
|
|
144
120
|
type ToNumberLike<T extends number> = T | `${T}`;
|
|
145
121
|
|
|
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,
|
|
122
|
+
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 };
|