mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-09 00:19:13 +08:00
Fix lint
This commit is contained in:
parent
0c603ff666
commit
3006caa963
@ -2,7 +2,7 @@ import fs from 'fs';
|
||||
import { join } from 'path';
|
||||
import prompts from 'prompts';
|
||||
import { dedent } from 'ts-dedent';
|
||||
import { MissingAngularJsonError } from 'storybook/internal/server-errors';
|
||||
import { MissingAngularJsonError } from '@storybook/core/server-errors';
|
||||
import boxen from 'boxen';
|
||||
import { logger } from '@storybook/core/node-logger';
|
||||
|
||||
|
@ -122,7 +122,7 @@ describe('Helpers', () => {
|
||||
renderer: 'react',
|
||||
language,
|
||||
packageManager: packageManagerMock,
|
||||
assetsDir: normalizePath('create-storybook/rendererAssets/common'),
|
||||
commonAssetsDir: normalizePath('create-storybook/rendererAssets/common'),
|
||||
});
|
||||
|
||||
expect(fse.copy).toHaveBeenNthCalledWith(
|
||||
|
@ -127,7 +127,7 @@ type CopyTemplateFilesOptions = {
|
||||
packageManager: JsPackageManager;
|
||||
renderer: SupportedFrameworks | SupportedRenderers;
|
||||
language: SupportedLanguage;
|
||||
assetsDir?: string;
|
||||
commonAssetsDir?: string;
|
||||
destination?: string;
|
||||
};
|
||||
|
||||
@ -163,7 +163,7 @@ export async function copyTemplateFiles({
|
||||
renderer,
|
||||
language,
|
||||
destination,
|
||||
assetsDir,
|
||||
commonAssetsDir,
|
||||
}: CopyTemplateFilesOptions) {
|
||||
const languageFolderMapping: Record<SupportedLanguage | 'typescript', string> = {
|
||||
// keeping this for backwards compatibility in case community packages are using it
|
||||
@ -212,14 +212,14 @@ export async function copyTemplateFiles({
|
||||
};
|
||||
|
||||
const destinationPath = destination ?? (await targetPath());
|
||||
if (assetsDir) {
|
||||
await fse.copy(assetsDir, destinationPath, {
|
||||
if (commonAssetsDir) {
|
||||
await fse.copy(commonAssetsDir, destinationPath, {
|
||||
overwrite: true,
|
||||
});
|
||||
}
|
||||
await fse.copy(await templatePath(), destinationPath, { overwrite: true });
|
||||
|
||||
if (assetsDir) {
|
||||
if (commonAssetsDir) {
|
||||
const rendererType = frameworkToRenderer[renderer] || 'react';
|
||||
await adjustTemplate(join(destinationPath, 'Configure.mdx'), { renderer: rendererType });
|
||||
}
|
||||
|
@ -394,7 +394,7 @@ export async function baseGenerator(
|
||||
packageManager,
|
||||
language,
|
||||
destination: componentsDestinationPath,
|
||||
assetsDir: path.join(getCliDir(), 'rendererAssets', 'common'),
|
||||
commonAssetsDir: path.join(getCliDir(), 'rendererAssets', 'common'),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user