mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-04 16:51:09 +08:00
CLI: SVELTE template CSF refactor
This commit is contained in:
parent
e9472ff611
commit
ba61fb9bef
@ -1,14 +1,13 @@
|
||||
import path from 'path';
|
||||
import fse from 'fs-extra';
|
||||
import {
|
||||
getVersions,
|
||||
getPackageJson,
|
||||
writePackageJson,
|
||||
getBabelDependencies,
|
||||
installDependencies,
|
||||
copyTemplate,
|
||||
} from '../../lib/helpers';
|
||||
|
||||
export default async npmOptions => {
|
||||
export default async (npmOptions, { storyFormat = 'csf' }) => {
|
||||
const [
|
||||
storybookVersion,
|
||||
actionsVersion,
|
||||
@ -26,7 +25,7 @@ export default async npmOptions => {
|
||||
'svelte-loader'
|
||||
);
|
||||
|
||||
fse.copySync(path.resolve(__dirname, 'template/'), '.', { overwrite: true });
|
||||
copyTemplate(__dirname, storyFormat);
|
||||
|
||||
const packageJson = getPackageJson();
|
||||
|
||||
|
@ -183,7 +183,7 @@ const installStorybook = (projectType, options) => {
|
||||
.then(end);
|
||||
|
||||
case types.SVELTE:
|
||||
return svelteGenerator(npmOptions)
|
||||
return svelteGenerator(npmOptions, generatorOptions)
|
||||
.then(commandLog('Adding storybook support to your "Svelte" app'))
|
||||
.then(end);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user