@monorepo-utils/package-utils
Advanced tools
@@ -10,2 +10,3 @@ "use strict"; | ||
| var fs = require("fs"); | ||
| var yaml = require("yaml"); | ||
| var loadPackage = function (packagePath) { | ||
@@ -66,2 +67,10 @@ var pkgJsonPath = path.join(packagePath, "package.json"); | ||
| } | ||
| var pnpmYamlPath = path.join(rootDirectory, "pnpm-workspace.yaml"); | ||
| if (fs.existsSync(pnpmYamlPath)) { | ||
| var contents = fs.readFileSync(pnpmYamlPath, "utf8"); | ||
| var pnpmConfig = yaml.parse(contents); | ||
| if ("packages" in pnpmConfig && Array.isArray(pnpmConfig.packages)) { | ||
| return (0, exports.findPackages)(pnpmConfig.packages, rootDirectory); | ||
| } | ||
| } | ||
| // Bail if we don't find any packages | ||
@@ -68,0 +77,0 @@ return []; |
+4
-3
| { | ||
| "name": "@monorepo-utils/package-utils", | ||
| "version": "2.8.1", | ||
| "version": "2.9.0", | ||
| "description": "Package utility for monorepo.", | ||
@@ -66,3 +66,4 @@ "keywords": [ | ||
| "load-json-file": "^6.2.0", | ||
| "upath": "^2.0.1" | ||
| "upath": "^2.0.1", | ||
| "yaml": "^2.1.3" | ||
| }, | ||
@@ -83,3 +84,3 @@ "devDependencies": { | ||
| }, | ||
| "gitHead": "1d2dedf099ee79cf02fd80feeb4d3ff22aa4eeba" | ||
| "gitHead": "77d7d3a5daf5a67dbc8de45017b8898100945b16" | ||
| } |
+11
-0
@@ -8,2 +8,3 @@ "use strict"; | ||
| import * as fs from "fs"; | ||
| import * as yaml from "yaml"; | ||
@@ -78,4 +79,14 @@ const loadPackage = (packagePath: string): object => { | ||
| const pnpmYamlPath = path.join(rootDirectory, "pnpm-workspace.yaml"); | ||
| if (fs.existsSync(pnpmYamlPath)) { | ||
| const contents = fs.readFileSync(pnpmYamlPath, "utf8"); | ||
| const pnpmConfig = yaml.parse(contents); | ||
| if ("packages" in pnpmConfig && Array.isArray(pnpmConfig.packages)) { | ||
| return findPackages(pnpmConfig.packages, rootDirectory); | ||
| } | ||
| } | ||
| // Bail if we don't find any packages | ||
| return []; | ||
| }; |
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
225367
0.56%259
7.47%4
33.33%+ Added
+ Added