Pavan Kumar Sunkara 94a049c2f5 Revert "CHANGE the installBabel to only install babel-loader & RENAME to installBabelLoader"
This reverts commit aadd8f0e0baa90d40c523cc43aaa9a30ada788d8.
2018-08-22 18:14:34 +02:00

33 lines
1.2 KiB
JavaScript

import path from 'path';
import mergeDirs from 'merge-dirs';
import { getVersions, getPackageJson, writePackageJson, installBabel } from '../../lib/helpers';
export default async npmOptions => {
const [storybookVersion, actionsVersion, linksVersion, addonsVersion] = await getVersions(
npmOptions,
'@storybook/mithril',
'@storybook/addon-actions',
'@storybook/addon-links',
'@storybook/addons'
);
mergeDirs(path.resolve(__dirname, 'template/'), '.', 'overwrite');
const packageJson = getPackageJson();
packageJson.dependencies = packageJson.dependencies || {};
packageJson.devDependencies = packageJson.devDependencies || {};
packageJson.devDependencies['@storybook/addon-actions'] = actionsVersion;
packageJson.devDependencies['@storybook/addon-links'] = linksVersion;
packageJson.devDependencies['@storybook/addons'] = addonsVersion;
packageJson.devDependencies['@storybook/mithril'] = storybookVersion;
await installBabel(npmOptions, packageJson);
packageJson.scripts = packageJson.scripts || {};
packageJson.scripts.storybook = 'start-storybook -p 6006';
packageJson.scripts['build-storybook'] = 'build-storybook';
writePackageJson(packageJson);
};