diff --git a/code/addons/viewport/src/shortcuts.ts b/code/addons/viewport/src/shortcuts.ts index 779726eb9e2..6e9b7302b1c 100644 --- a/code/addons/viewport/src/shortcuts.ts +++ b/code/addons/viewport/src/shortcuts.ts @@ -1,6 +1,11 @@ import type { API } from '@storybook/api'; import { ADDON_ID } from './constants'; +type State = { + selected: string; + isRotated: boolean; +}; + const getCurrentViewportIndex = (viewportsKeys: string[], current: string): number => viewportsKeys.indexOf(current); @@ -24,7 +29,7 @@ export const registerShortcuts = async (api: API, setState: any, viewportsKeys: defaultShortcut: ['shift', 'V'], actionName: 'previous', action: () => { - const { selected, isRotated } = api.getAddonState(ADDON_ID); + const { selected, isRotated } = api.getAddonState(ADDON_ID); setState({ selected: getPreviousViewport(viewportsKeys, selected), isRotated, @@ -37,7 +42,7 @@ export const registerShortcuts = async (api: API, setState: any, viewportsKeys: defaultShortcut: ['V'], actionName: 'next', action: () => { - const { selected, isRotated } = api.getAddonState(ADDON_ID); + const { selected, isRotated } = api.getAddonState(ADDON_ID); setState({ selected: getNextViewport(viewportsKeys, selected), isRotated, @@ -50,7 +55,7 @@ export const registerShortcuts = async (api: API, setState: any, viewportsKeys: defaultShortcut: ['alt', 'V'], actionName: 'reset', action: () => { - const { isRotated } = api.getAddonState(ADDON_ID); + const { isRotated } = api.getAddonState(ADDON_ID); setState({ selected: 'reset', isRotated, diff --git a/code/lib/store/src/args.ts b/code/lib/store/src/args.ts index 842c46c84f2..a119be4bfe8 100644 --- a/code/lib/store/src/args.ts +++ b/code/lib/store/src/args.ts @@ -152,7 +152,7 @@ export const deepDiff = (value: any, update: any): any => { }; export const NO_TARGET_NAME = ''; -export function groupArgsByTarget({ +export function groupArgsByTarget({ args, argTypes, }: StoryContext) { @@ -166,6 +166,8 @@ export function groupArgsByTarget({ return groupedArgs; } -export function noTargetArgs(context: StoryContext) { +export function noTargetArgs( + context: StoryContext +) { return groupArgsByTarget(context)[NO_TARGET_NAME]; } diff --git a/code/renderers/react/src/testing-api.ts b/code/renderers/react/src/testing-api.ts index c1213f837eb..3b148c15e08 100644 --- a/code/renderers/react/src/testing-api.ts +++ b/code/renderers/react/src/testing-api.ts @@ -80,7 +80,7 @@ const defaultProjectAnnotations: ProjectAnnotations = { * @param [projectAnnotations] - e.g. (import * as projectAnnotations from '../.storybook/preview') this can be applied automatically if you use `setProjectAnnotations` in your setup files. * @param [exportsName] - in case your story does not contain a name and you want it to have a name. */ -export function composeStory( +export function composeStory( story: Store_ComposedStory, componentAnnotations: Meta, projectAnnotations?: ProjectAnnotations, diff --git a/scripts/prepare/bundle.ts b/scripts/prepare/bundle.ts index 9689079b4c6..323b5fced4f 100755 --- a/scripts/prepare/bundle.ts +++ b/scripts/prepare/bundle.ts @@ -37,12 +37,12 @@ const run = async ({ cwd, flags }: { cwd: string; flags: string[] }) => { entries.map(async (file: string) => { console.log(`skipping generating types for ${file}`); const { name: entryName, dir } = path.parse(file); - + const pathName = join(process.cwd(), dir.replace('./src', 'dist'), `${entryName}.d.ts`); const srcName = join(process.cwd(), file); - + const rel = relative(dirname(pathName), dirname(srcName)); - + await fs.ensureFile(pathName); await fs.writeFile( pathName, @@ -54,7 +54,7 @@ const run = async ({ cwd, flags }: { cwd: string; flags: string[] }) => { }) ); } - + const tsConfigPath = join(cwd, 'tsconfig.json'); const tsConfigExists = await fs.pathExists(tsConfigPath); await Promise.all([