mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-05 04:11:06 +08:00
Add necessary dev dependencies to Angular CLI
This commit is contained in:
parent
9eb0623d17
commit
2aa8970276
@ -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';
|
||||
|
Loading…
x
Reference in New Issue
Block a user