mirror of
https://github.com/storybookjs/storybook.git
synced 2025-03-21 05:02:39 +08:00
Don't hoist private packages
This commit is contained in:
parent
0712c1354d
commit
63fe6e9fa3
24
scripts/hoist-internals.js
Normal file → Executable file
24
scripts/hoist-internals.js
Normal file → Executable 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(
|
||||
|
Loading…
x
Reference in New Issue
Block a user