@pnpm/find-workspace-dir
Advanced tools
Comparing version 4.0.1 to 4.0.2
@@ -6,2 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const fs_1 = __importDefault(require("fs")); | ||
const path_1 = __importDefault(require("path")); | ||
@@ -16,3 +17,3 @@ const error_1 = __importDefault(require("@pnpm/error")); | ||
? path_1.default.join(workspaceManifestDirEnvVar, 'pnpm-workspace.yaml') | ||
: await (0, find_up_1.default)([WORKSPACE_MANIFEST_FILENAME, 'pnpm-workspace.yml'], { cwd }); | ||
: await (0, find_up_1.default)([WORKSPACE_MANIFEST_FILENAME, 'pnpm-workspace.yml'], { cwd: await getRealPath(cwd) }); | ||
if (workspaceManifestLocation?.endsWith('.yml')) { | ||
@@ -24,2 +25,13 @@ throw new error_1.default('BAD_WORKSPACE_MANIFEST_NAME', `The workspace manifest file should be named "pnpm-workspace.yaml". File found: ${workspaceManifestLocation}`); | ||
exports.default = findWorkspaceDir; | ||
async function getRealPath(path) { | ||
return new Promise((resolve) => { | ||
// We need to resolve the real native path for case-insensitive file systems. | ||
// For example, we can access file as C:\Code\Project as well as c:\code\projects | ||
// Without this we can face a problem when try to install packages with -w flag, | ||
// when root dir is using c:\code\projects but packages were found by C:\Code\Project | ||
fs_1.default.realpath.native(path, function (err, resolvedPath) { | ||
resolve(err !== null ? path : resolvedPath); | ||
}); | ||
}); | ||
} | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@pnpm/find-workspace-dir", | ||
"version": "4.0.1", | ||
"version": "4.0.2", | ||
"description": "Finds the root of a pnpm workspace", | ||
@@ -12,3 +12,3 @@ "main": "lib/index.js", | ||
"engines": { | ||
"node": ">=14.19" | ||
"node": ">=14.6" | ||
}, | ||
@@ -31,3 +31,3 @@ "repository": "https://github.com/pnpm/pnpm/blob/main/packages/find-workspace-dir", | ||
"devDependencies": { | ||
"@pnpm/find-workspace-dir": "4.0.1" | ||
"@pnpm/find-workspace-dir": "4.0.2" | ||
}, | ||
@@ -34,0 +34,0 @@ "exports": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5601
34
4