@virmator/core 14.0.2 → 14.0.4
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/api/execute-command.js +21 -10
- package/package.json +10 -10
|
@@ -31,7 +31,11 @@ async function determinePackageType(cwdPackagePath, monoRepoRootPath, cwdPackage
|
|
|
31
31
|
(check.isArray(cwdPackageJson.workspaces)
|
|
32
32
|
? cwdPackageJson.workspaces.length
|
|
33
33
|
: cwdPackageJson.workspaces.packages?.length)) {
|
|
34
|
-
|
|
34
|
+
const monoRepoPackages = await getMonoRepoPackages(monoRepoRootPath);
|
|
35
|
+
return {
|
|
36
|
+
monoRepoPackages,
|
|
37
|
+
packageType: PackageType.MonoRoot,
|
|
38
|
+
};
|
|
35
39
|
}
|
|
36
40
|
else {
|
|
37
41
|
if (monoRepoRootPath !== cwdPackagePath) {
|
|
@@ -39,16 +43,25 @@ async function determinePackageType(cwdPackagePath, monoRepoRootPath, cwdPackage
|
|
|
39
43
|
if (parentPackages.flat().some((monoPackage) => {
|
|
40
44
|
return join(monoRepoRootPath, monoPackage.relativePath) === cwdPackagePath;
|
|
41
45
|
})) {
|
|
42
|
-
return
|
|
46
|
+
return {
|
|
47
|
+
packageType: PackageType.MonoPackage,
|
|
48
|
+
monoRepoPackages: parentPackages,
|
|
49
|
+
};
|
|
43
50
|
}
|
|
44
51
|
}
|
|
45
|
-
return
|
|
52
|
+
return {
|
|
53
|
+
monoRepoPackages: [],
|
|
54
|
+
packageType: PackageType.TopPackage,
|
|
55
|
+
};
|
|
46
56
|
}
|
|
47
57
|
}
|
|
48
58
|
catch (error) {
|
|
49
59
|
console.error(error);
|
|
50
60
|
/** Default to package package type. */
|
|
51
|
-
return
|
|
61
|
+
return {
|
|
62
|
+
monoRepoPackages: [],
|
|
63
|
+
packageType: PackageType.TopPackage,
|
|
64
|
+
};
|
|
52
65
|
}
|
|
53
66
|
}
|
|
54
67
|
async function getMonoRepoPackages(cwdPackagePath) {
|
|
@@ -73,14 +86,12 @@ async function getMonoRepoPackages(cwdPackagePath) {
|
|
|
73
86
|
}
|
|
74
87
|
async function getMonoRepoDetails(cwdPackagePath, cwdPackageJson) {
|
|
75
88
|
const monoRepoRootPath = await findMonoRepoDir(cwdPackagePath);
|
|
76
|
-
const packageType = await determinePackageType(cwdPackagePath, monoRepoRootPath, cwdPackageJson);
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
.flat()
|
|
80
|
-
.some(({ fullPath }) => fullPath === cwdPackagePath);
|
|
89
|
+
const { packageType, monoRepoPackages } = await determinePackageType(cwdPackagePath, monoRepoRootPath, cwdPackageJson);
|
|
90
|
+
const isPartOfMonoRepo = packageType === PackageType.MonoPackage &&
|
|
91
|
+
monoRepoPackages.flat().some(({ fullPath }) => fullPath === cwdPackagePath);
|
|
81
92
|
if (isPartOfMonoRepo || packageType === PackageType.MonoRoot) {
|
|
82
93
|
return {
|
|
83
|
-
monoRepoPackages,
|
|
94
|
+
monoRepoPackages: packageType === PackageType.MonoRoot ? monoRepoPackages : [],
|
|
84
95
|
monoRepoRootPath,
|
|
85
96
|
packageType,
|
|
86
97
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@virmator/core",
|
|
3
|
-
"version": "14.0.
|
|
3
|
+
"version": "14.0.4",
|
|
4
4
|
"description": "Shared core functionality for all virmator plugins and the virmator CLI.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"automation",
|
|
@@ -32,19 +32,19 @@
|
|
|
32
32
|
"test:update": "npm test update"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@augment-vir/assert": "^31.
|
|
36
|
-
"@augment-vir/common": "^31.
|
|
37
|
-
"@augment-vir/node": "^31.
|
|
38
|
-
"mono-vir": "^2.
|
|
39
|
-
"runstorm": "^0.6.
|
|
35
|
+
"@augment-vir/assert": "^31.36.0",
|
|
36
|
+
"@augment-vir/common": "^31.36.0",
|
|
37
|
+
"@augment-vir/node": "^31.36.0",
|
|
38
|
+
"mono-vir": "^2.3.0",
|
|
39
|
+
"runstorm": "^0.6.2",
|
|
40
40
|
"semver": "^7.7.2",
|
|
41
|
-
"type-fest": "^
|
|
41
|
+
"type-fest": "^5.0.0",
|
|
42
42
|
"typescript": "^5.9.2"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@augment-vir/test": "^31.
|
|
46
|
-
"@types/node": "^24.
|
|
47
|
-
"@types/semver": "^7.7.
|
|
45
|
+
"@augment-vir/test": "^31.36.0",
|
|
46
|
+
"@types/node": "^24.4.0",
|
|
47
|
+
"@types/semver": "^7.7.1",
|
|
48
48
|
"esbuild": "^0.25.9"
|
|
49
49
|
},
|
|
50
50
|
"engines": {
|