@embroider/shared-internals
Advanced tools
Comparing version
{ | ||
"name": "@embroider/shared-internals", | ||
"version": "0.42.3", | ||
"version": "0.43.0", | ||
"private": false, | ||
@@ -32,3 +32,2 @@ "description": "Utilities shared among the other embroider packages", | ||
"resolve-package-path": "^4.0.1", | ||
"pkg-up": "^3.1.0", | ||
"typescript-memoize": "^1.0.1", | ||
@@ -35,0 +34,0 @@ "fs-extra": "^9.1.0", |
@@ -10,3 +10,3 @@ declare type Filename = string; | ||
isParallelSafe: boolean; | ||
majorVersion: 6 | 7; | ||
majorVersion: 7; | ||
fileFilter: string; | ||
@@ -13,0 +13,0 @@ }; |
@@ -11,3 +11,2 @@ "use strict"; | ||
const path_1 = require("path"); | ||
const pkg_up_1 = require("pkg-up"); | ||
class PackageCache { | ||
@@ -64,3 +63,3 @@ constructor() { | ||
// at or above the file. | ||
for (let length = segments.length - 1; length >= 0; length--) { | ||
for (let length = segments.length; length >= 0; length--) { | ||
if (segments[length - 1] === 'node_modules') { | ||
@@ -71,11 +70,11 @@ // once we hit a node_modules, we're leaving the package we were in, so | ||
} | ||
let candidate = segments.slice(0, length).join(path_1.sep); | ||
let usedSegments = segments.slice(0, length); | ||
let candidate = usedSegments.join(path_1.sep); | ||
if (this.rootCache.has(candidate)) { | ||
return this.rootCache.get(candidate); | ||
} | ||
if (fs_1.existsSync([...usedSegments, 'package.json'].join(path_1.sep))) { | ||
return this.get(candidate); | ||
} | ||
} | ||
let packageJSONPath = pkg_up_1.sync({ cwd: filename }); | ||
if (packageJSONPath) { | ||
return this.get(path_1.dirname(packageJSONPath)); | ||
} | ||
} | ||
@@ -82,0 +81,0 @@ // register to be shared as the per-process package cache with the given name |
Sorry, the diff of this file is not supported yet
6
-14.29%44848
-0.12%712
-0.14%- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed