cli: fix e2e package references

This commit is contained in:
Patrik Oldsberg
2020-08-05 18:08:48 +02:00
parent 7db913e36b
commit 5eba6dafa9
+8 -5
View File
@@ -184,12 +184,15 @@ async function overrideModuleResolutions(appDir, workspaceDir) {
for (const dir of ['packages', 'plugins']) {
const packageNames = await fs.readdir(resolvePath(workspaceDir, dir));
for (const name of packageNames) {
const pkgPath = joinPath('..', 'workspace', dir, name);
for (const pkgDir of packageNames) {
const pkgPath = joinPath('..', 'workspace', dir, pkgDir);
const { name } = await fs.readJson(
resolvePath(workspaceDir, dir, pkgDir, 'package.json'),
);
pkgJson.dependencies[`@backstage/${name}`] = `file:${pkgPath}`;
pkgJson.resolutions[`@backstage/${name}`] = `file:${pkgPath}`;
delete pkgJson.devDependencies[`@backstage/${name}`];
pkgJson.dependencies[name] = `file:${pkgPath}`;
pkgJson.resolutions[name] = `file:${pkgPath}`;
delete pkgJson.devDependencies[name];
}
}
fs.writeJson(pkgJsonPath, pkgJson, { spaces: 2 });