@monorepo-utils/package-utils
Advanced tools
+11
-0
@@ -6,2 +6,13 @@ # Change Log | ||
| # [2.7.0](https://github.com/azu/monorepo-utils/compare/v2.6.3...v2.7.0) (2021-10-20) | ||
| ### Features | ||
| * add --includesRoot flag ([#52](https://github.com/azu/monorepo-utils/issues/52)) ([fa0b3ce](https://github.com/azu/monorepo-utils/commit/fa0b3ce9c3819aa95d5bdc0e77d8533bbdbd88bc)) | ||
| ## 2.4.4 (2021-01-15) | ||
@@ -8,0 +19,0 @@ |
+16
-16
@@ -20,18 +20,18 @@ "use strict"; | ||
| .reduce(function (pkgDirs, pkgGlob) { | ||
| var target = path.join(rootDirectory, pkgGlob); | ||
| var filePathList = globby.hasMagic(pkgGlob) | ||
| ? globby.sync(target, { | ||
| onlyFiles: false, | ||
| }) | ||
| : [target]; | ||
| return pkgDirs.concat(filePathList); | ||
| }, []) | ||
| var target = path.join(rootDirectory, pkgGlob); | ||
| var filePathList = globby.hasMagic(pkgGlob) | ||
| ? globby.sync(target, { | ||
| onlyFiles: false, | ||
| }) | ||
| : [target]; | ||
| return pkgDirs.concat(filePathList); | ||
| }, []) | ||
| .map(function (location) { | ||
| return { location: location, packageJSON: loadPackage(location) }; | ||
| }) | ||
| return { location: location, packageJSON: loadPackage(location) }; | ||
| }) | ||
| .filter(function (res) { | ||
| return res.packageJSON && "name" in res.packageJSON; | ||
| }); | ||
| return res.packageJSON && "name" in res.packageJSON; | ||
| }); | ||
| }; | ||
| exports.getPackages = function (rootDirectory) { | ||
| var getPackages = function (rootDirectory) { | ||
| var lernaJsonPath = path.join(rootDirectory, "lerna.json"); | ||
@@ -58,4 +58,3 @@ // prefer to use yarn workspace instead of lerna.json | ||
| return findPackages(pkgJson.workspaces, rootDirectory); | ||
| } | ||
| else if (Array.isArray(pkgJson.workspaces.packages)) { | ||
| } else if (Array.isArray(pkgJson.workspaces.packages)) { | ||
| // "workspaces": { "packages": [] } | ||
@@ -69,2 +68,3 @@ return findPackages(pkgJson.workspaces.packages, rootDirectory); | ||
| }; | ||
| //# sourceMappingURL=get-packages.js.map | ||
| exports.getPackages = getPackages; | ||
| //# sourceMappingURL=get-packages.js.map |
+7
-2
@@ -5,3 +5,8 @@ "use strict"; | ||
| var get_packages_1 = require("./get-packages"); | ||
| Object.defineProperty(exports, "getPackages", { enumerable: true, get: function () { return get_packages_1.getPackages; } }); | ||
| //# sourceMappingURL=index.js.map | ||
| Object.defineProperty(exports, "getPackages", { | ||
| enumerable: true, | ||
| get: function () { | ||
| return get_packages_1.getPackages; | ||
| }, | ||
| }); | ||
| //# sourceMappingURL=index.js.map |
+14
-15
@@ -20,16 +20,16 @@ "use strict"; | ||
| .reduce(function (pkgDirs, pkgGlob) { | ||
| var target = path.join(rootDirectory, pkgGlob); | ||
| var filePathList = globby.hasMagic(pkgGlob) | ||
| ? globby.sync(target, { | ||
| onlyFiles: false, | ||
| }) | ||
| : [target]; | ||
| return pkgDirs.concat(filePathList); | ||
| }, []) | ||
| var target = path.join(rootDirectory, pkgGlob); | ||
| var filePathList = globby.hasMagic(pkgGlob) | ||
| ? globby.sync(target, { | ||
| onlyFiles: false, | ||
| }) | ||
| : [target]; | ||
| return pkgDirs.concat(filePathList); | ||
| }, []) | ||
| .map(function (location) { | ||
| return { location: location, packageJSON: loadPackage(location) }; | ||
| }) | ||
| return { location: location, packageJSON: loadPackage(location) }; | ||
| }) | ||
| .filter(function (res) { | ||
| return res.packageJSON && "name" in res.packageJSON; | ||
| }); | ||
| return res.packageJSON && "name" in res.packageJSON; | ||
| }); | ||
| }; | ||
@@ -58,4 +58,3 @@ exports.getPackages = function (rootDirectory) { | ||
| return findPackages(pkgJson.workspaces, rootDirectory); | ||
| } | ||
| else if (Array.isArray(pkgJson.workspaces.packages)) { | ||
| } else if (Array.isArray(pkgJson.workspaces.packages)) { | ||
| // "workspaces": { "packages": [] } | ||
@@ -69,2 +68,2 @@ return findPackages(pkgJson.workspaces.packages, rootDirectory); | ||
| }; | ||
| //# sourceMappingURL=get-packages.js.map | ||
| //# sourceMappingURL=get-packages.js.map |
+7
-2
@@ -5,3 +5,8 @@ "use strict"; | ||
| var get_packages_1 = require("./get-packages"); | ||
| Object.defineProperty(exports, "getPackages", { enumerable: true, get: function () { return get_packages_1.getPackages; } }); | ||
| //# sourceMappingURL=index.js.map | ||
| Object.defineProperty(exports, "getPackages", { | ||
| enumerable: true, | ||
| get: function () { | ||
| return get_packages_1.getPackages; | ||
| }, | ||
| }); | ||
| //# sourceMappingURL=index.js.map |
+3
-3
| { | ||
| "name": "@monorepo-utils/package-utils", | ||
| "version": "2.4.4", | ||
| "version": "2.7.0", | ||
| "description": "Package utility for monorepo.", | ||
@@ -77,3 +77,3 @@ "keywords": [ | ||
| "ts-jest": "^26.3.0", | ||
| "typescript": "^4.0.2" | ||
| "typescript": "^4.4.4" | ||
| }, | ||
@@ -83,3 +83,3 @@ "publishConfig": { | ||
| }, | ||
| "gitHead": "db707930b2c9f653fdc8677ad84f0b94bd8c0dc1" | ||
| "gitHead": "540cd9d4896a19eb17d0ea5bf0088473a9bcda45" | ||
| } |
Sorry, the diff of this file is not supported yet
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
228364
0.21%244
5.63%