@ruan-cat/utils 4.17.0 → 4.19.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 +1 -14
- package/dist/index.js +0 -2632
- package/dist/index.js.map +1 -1
- package/dist/node-cjs/index.cjs +5 -5
- package/dist/node-cjs/index.cjs.map +1 -1
- package/dist/node-cjs/index.d.cts +13 -13
- package/dist/node-esm/index.d.ts +14 -1
- package/dist/node-esm/index.js +36 -3
- package/dist/node-esm/index.js.map +1 -1
- package/package.json +2 -2
- package/src/index.ts +0 -1
- package/src/{monorepo.ts → monorepo/index.ts} +4 -4
- package/src/node-cjs/index.ts +3 -0
- package/src/node-esm/index.ts +3 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ruan-cat/utils",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.19.0",
|
|
4
4
|
"description": "阮喵喵工具集合。默认提供js文件,也直接提供ts文件。",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.ts",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"@vueuse/integrations": "^13.9.0",
|
|
68
68
|
"axios": "^1.13.2",
|
|
69
69
|
"consola": "^3.4.2",
|
|
70
|
-
"
|
|
70
|
+
"tinyglobby": "^0.2.15",
|
|
71
71
|
"lodash-es": "^4.17.21"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
package/src/index.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { join } from "node:path";
|
|
2
2
|
import * as fs from "node:fs";
|
|
3
|
-
import {
|
|
3
|
+
import { globSync } from "tinyglobby";
|
|
4
4
|
import { load } from "js-yaml";
|
|
5
5
|
import { isUndefined } from "lodash-es";
|
|
6
|
-
import type { PnpmWorkspace } from "
|
|
6
|
+
import type { PnpmWorkspace } from "../types/pnpm-workspace.yaml.shim";
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* 路径转换工具
|
|
@@ -55,8 +55,8 @@ export function isMonorepoProject(): boolean {
|
|
|
55
55
|
// 4. 检查是否至少能匹配到一个 package.json
|
|
56
56
|
for (const pkgPattern of pkgPatterns) {
|
|
57
57
|
const matchedPath = pathChange(join(process.cwd(), pkgPattern, "package.json"));
|
|
58
|
-
const matchedPaths =
|
|
59
|
-
ignore: "**/node_modules/**",
|
|
58
|
+
const matchedPaths = globSync(matchedPath, {
|
|
59
|
+
ignore: ["**/node_modules/**"],
|
|
60
60
|
});
|
|
61
61
|
|
|
62
62
|
// 只要有一个模式能匹配到文件,就认为是有效的 monorepo
|
package/src/node-cjs/index.ts
CHANGED