@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ruan-cat/utils",
3
- "version": "4.18.0",
3
+ "version": "4.20.0",
4
4
  "description": "阮喵喵工具集合。默认提供js文件,也直接提供ts文件。",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
@@ -67,8 +67,9 @@
67
67
  "@vueuse/integrations": "^13.9.0",
68
68
  "axios": "^1.13.2",
69
69
  "consola": "^3.4.2",
70
- "tinyglobby": "^0.2.15",
71
- "lodash-es": "^4.17.21"
70
+ "lodash-es": "^4.17.21",
71
+ "pnpm-workspace-yaml": "^1.4.3",
72
+ "tinyglobby": "^0.2.15"
72
73
  },
73
74
  "devDependencies": {
74
75
  "@antfu/utils": "^9.3.0",
package/src/index.ts CHANGED
@@ -2,7 +2,6 @@ export * from "./conditions";
2
2
  export * from "./print";
3
3
  export * from "./define-promise-tasks";
4
4
  export * from "./simple-promise-tools";
5
- export * from "./monorepo";
6
5
 
7
6
  export * from "./types/pnpm-workspace.yaml.shim";
8
7
  export * from "./types/Prettify";
@@ -3,7 +3,7 @@ import * as fs from "node:fs";
3
3
  import { globSync } from "tinyglobby";
4
4
  import { load } from "js-yaml";
5
5
  import { isUndefined } from "lodash-es";
6
- import type { PnpmWorkspace } from "./types/pnpm-workspace.yaml.shim";
6
+ import type { PnpmWorkspace } from "../types/pnpm-workspace.yaml.shim";
7
7
 
8
8
  /**
9
9
  * 路径转换工具
@@ -2,3 +2,6 @@ export * from "./tools";
2
2
 
3
3
  // 将绝大多数的工具函数 以cjs的方式导出
4
4
  export * from "../index";
5
+
6
+ // 导出 monorepo 相关工具函数(仅限 Node.js 环境)
7
+ export * from "../monorepo";
@@ -2,3 +2,6 @@ export * from "./ruan-cat-pkg-info";
2
2
 
3
3
  export * from "./scripts/clean";
4
4
  export * from "./yaml-to-md";
5
+
6
+ // 导出 monorepo 相关工具函数(仅限 Node.js 环境)
7
+ export * from "../monorepo";
@@ -1,22 +1,10 @@
1
+ import type { PnpmWorkspaceYamlSchema } from "pnpm-workspace-yaml";
2
+
1
3
  /**
2
4
  * pnpm-workspace.yaml 文件的类型声明
3
5
  * @description
4
- * 设计理由
5
- *
6
- * 主要是为了让该文件被解析后,能够有一个基础的类型声明
6
+ * 现在是 pnpm-workspace-yaml 提供的 `PnpmWorkspaceYamlSchema` 类型
7
7
  *
8
- * 按理说这个东西应该有别人封装好的类型的,肯定因为我没找到。
9
- *
10
- * 未来应该找到这样的类型声明库,直接复用别人的就好了,不要自己写了。
8
+ * @see https://github.com/antfu/pnpm-workspace-utils/blob/main/packages/pnpm-workspace-yaml/src/index.ts#L4
11
9
  */
12
- export interface PnpmWorkspace {
13
- /**
14
- * 包的匹配语法字符串
15
- *
16
- * @example
17
- * ["packages/**", "demos/**", "utils"]
18
- */
19
- packages?: string[];
20
-
21
- catalog?: string[];
22
- }
10
+ export type PnpmWorkspace = PnpmWorkspaceYamlSchema;