Don't hoist private packages

This commit is contained in:
Michael Shilman 2017-07-24 14:58:17 -07:00
parent 0712c1354d
commit 63fe6e9fa3

24
scripts/hoist-internals.js Normal file → Executable file
View File

@ -20,10 +20,7 @@ const passingLog = fn => i => {
fn(i);
return i;
};
const getPackageNameOfFolder = sourcePath =>
fse
.readJson(path.join(sourcePath, 'package.json'))
.then(json => json.name.replace('@storybook/', ''));
const getPackageOfFolder = sourcePath => fse.readJsonSync(path.join(sourcePath, 'package.json'));
const task = getLernaPackages()
.then(
@ -60,14 +57,17 @@ const task = getLernaPackages()
log.silly(prefix, 'found package path', item);
})
)
.map(sourcePath =>
getPackageNameOfFolder(sourcePath)
.then(
passingLog(packageName => {
log.silly(prefix, 'found package name', packageName);
})
)
.then(packageName => path.join(targetPath, packageName))
.map(sourcePath => ({
sourcePath,
packageJson: getPackageOfFolder(sourcePath),
}))
.filter(({ packageJson }) => !packageJson.private)
.map(({ sourcePath, packageJson }) =>
Promise.resolve(packageJson.name.replace('@storybook/', ''))
.then(packageName => {
log.silly(prefix, 'found package name', packageName);
return path.join(targetPath, packageName);
})
.then(localTargetPath =>
symlink(sourcePath, localTargetPath)
.then(