@embroider/shared-internals
Advanced tools
Comparing version 2.2.2-unstable.229045b to 2.2.2-unstable.db25d62
{ | ||
"name": "@embroider/shared-internals", | ||
"version": "2.2.2-unstable.229045b", | ||
"version": "2.2.2-unstable.db25d62", | ||
"private": false, | ||
@@ -5,0 +5,0 @@ "description": "Utilities shared among the other embroider packages", |
@@ -96,4 +96,4 @@ "use strict"; | ||
loadIndex() { | ||
let addonsDir = (0, path_1.resolve)((0, working_dir_1.locateEmbroiderWorkingDir)(this.appRoot), 'rewritten-packages'); | ||
let indexFile = (0, path_1.resolve)(addonsDir, 'index.json'); | ||
let workingDir = (0, working_dir_1.locateEmbroiderWorkingDir)(this.appRoot); | ||
let indexFile = (0, path_1.resolve)(workingDir, 'rewritten-packages', 'index.json'); | ||
if (!(0, fs_extra_1.existsSync)(indexFile)) { | ||
@@ -106,17 +106,8 @@ return { | ||
} | ||
// this directory is a bit special because RewrittenPackageCache needs to | ||
// exist before this dir has been produced. But the dir appears preemptively | ||
// in our index, and we don't want that to blow up during the realpath | ||
// below. | ||
(0, fs_extra_1.ensureDirSync)((0, path_1.resolve)(addonsDir, '..', 'rewritten-app')); | ||
workingDir = (0, fs_extra_1.realpathSync)(workingDir); | ||
let addonsDir = (0, path_1.resolve)(workingDir, 'rewritten-packages'); | ||
let { packages, extraResolutions } = (0, fs_extra_1.readJSONSync)(indexFile); | ||
return { | ||
oldToNew: new Map(Object.entries(packages).map(([oldRoot, newRoot]) => [ | ||
(0, fs_extra_1.realpathSync)((0, path_1.resolve)(addonsDir, oldRoot)), | ||
(0, fs_extra_1.realpathSync)((0, path_1.resolve)(addonsDir, newRoot)), | ||
])), | ||
newToOld: new Map(Object.entries(packages).map(([oldRoot, newRoot]) => [ | ||
(0, fs_extra_1.realpathSync)((0, path_1.resolve)(addonsDir, newRoot)), | ||
(0, fs_extra_1.realpathSync)((0, path_1.resolve)(addonsDir, oldRoot)), | ||
])), | ||
oldToNew: new Map(Object.entries(packages).map(([oldRoot, newRoot]) => [(0, path_1.resolve)(addonsDir, oldRoot), (0, path_1.resolve)(addonsDir, newRoot)])), | ||
newToOld: new Map(Object.entries(packages).map(([oldRoot, newRoot]) => [(0, path_1.resolve)(addonsDir, newRoot), (0, path_1.resolve)(addonsDir, oldRoot)])), | ||
extraResolutions: new Map(Object.entries(extraResolutions).map(([fromRoot, toRoots]) => [ | ||
@@ -123,0 +114,0 @@ (0, path_1.resolve)(addonsDir, fromRoot), |
Sorry, the diff of this file is not supported yet
132053
1361