@nx/storybook
Version:
35 lines (34 loc) • 2.87 kB
TypeScript
import { Tree } from '@nx/devkit';
import { StorybookConfigureSchema } from '../schema';
import { UiFramework } from '../../../utils/models';
export declare function addStorybookTarget(tree: Tree, projectName: string, uiFramework: UiFramework, interactionTests: boolean): void;
export declare function addAngularStorybookTarget(tree: Tree, projectName: string, interactionTests: boolean): void;
export declare function addStaticTarget(tree: Tree, opts: StorybookConfigureSchema): Promise<void>;
export declare function createStorybookTsconfigFile(tree: Tree, projectRoot: string, uiFramework: UiFramework, isRootProject: boolean, mainDir: 'components' | 'src'): void;
export declare function editTsconfigBaseJson(tree: Tree): void;
export declare function configureTsProjectConfig(tree: Tree, schema: StorybookConfigureSchema): void;
export declare function configureTsSolutionConfig(tree: Tree, schema: StorybookConfigureSchema): void;
/**
* When adding storybook we need to inform ESLint
* of the additional tsconfig.json file which will be the only tsconfig
* which includes *.stories files.
*
* This is done within the eslint config file.
*/
export declare function updateLintConfig(tree: Tree, schema: StorybookConfigureSchema): void;
export declare function normalizeSchema(schema: StorybookConfigureSchema): StorybookConfigureSchema;
export declare function addStorybookToNamedInputs(tree: Tree): void;
export declare function addStorybookToTargetDefaults(tree: Tree, setCache?: boolean): void;
export declare function createProjectStorybookDir(tree: Tree, projectName: string, uiFramework: UiFramework, js: boolean, tsConfiguration: boolean, root: string, projectType: string, projectIsRootProjectInStandaloneWorkspace: boolean, interactionTests: boolean, mainDir?: string, isNextJs?: boolean, usesSwc?: boolean, usesVite?: boolean, viteConfigFilePath?: string, hasPlugin?: boolean, viteConfigFileName?: string, usesReactNative?: boolean): void;
export declare function getTsConfigPath(tree: Tree, projectName: string, path?: string): string;
export declare function addBuildStorybookToCacheableOperations(tree: Tree): void;
export declare function projectIsRootProjectInStandaloneWorkspace(projectRoot: string): boolean;
export declare function workspaceHasRootProject(tree: Tree): boolean;
export declare function rootFileIsTs(tree: Tree, rootFileName: string, tsConfiguration: boolean): boolean;
export declare function findViteConfig(tree: Tree, projectRoot: string): {
fullConfigPath: string | undefined;
viteConfigFileName: string | undefined;
};
export declare function findNextConfig(tree: Tree, projectRoot: string): string | undefined;
export declare function isUsingReactNative(projectName: string): boolean;
export declare function renameAndMoveOldTsConfig(projectRoot: string, pathToStorybookConfigFile: string, tree: Tree): void;