Add necessary dev dependencies to Angular CLI

This commit is contained in:
Michael Shilman 2017-12-26 16:56:34 -08:00
parent 9eb0623d17
commit 2aa8970276

View File

@ -1,15 +1,31 @@
import mergeDirs from 'merge-dirs';
import path from 'path';
import { getVersion, getPackageJson, writePackageJson } from '../../lib/helpers';
import { getVersions, getPackageJson, writePackageJson } from '../../lib/helpers';
export default async () => {
const version = await getVersion('@storybook/angular');
const [
storybookVersion,
notesVersion,
actionsVersion,
linksVersion,
lodashTypesVersion,
] = await getVersions(
'@storybook/angular',
'@storybook/addon-notes',
'@storybook/addon-actions',
'@storybook/addon-links',
'@types/lodash-es'
);
mergeDirs(path.resolve(__dirname, 'template'), '.', 'overwrite');
const packageJson = getPackageJson();
packageJson.devDependencies = packageJson.devDependencies || {};
packageJson.devDependencies['@storybook/angular'] = version;
packageJson.devDependencies['@storybook/angular'] = storybookVersion;
packageJson.devDependencies['@storybook/addon-notes'] = notesVersion;
packageJson.devDependencies['@storybook/addon-actions'] = actionsVersion;
packageJson.devDependencies['@storybook/addon-links'] = linksVersion;
packageJson.devDependencies['@types/lodash-es'] = lodashTypesVersion;
packageJson.scripts = packageJson.scripts || {};
packageJson.scripts.storybook = 'start-storybook -p 6006';