Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
ndelangen committed May 14, 2024
1 parent 4a76bbf commit 41a77c8
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 19 deletions.
5 changes: 4 additions & 1 deletion code/frameworks/html-vite/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import type { StorybookConfig as StorybookConfigBase, CompatibleString } from '@storybook/core/dist/types';
import type {
StorybookConfig as StorybookConfigBase,
CompatibleString,
} from '@storybook/core/dist/types';
import type { StorybookConfigVite, BuilderOptions } from '@storybook/builder-vite';

type FrameworkName = CompatibleString<'@storybook/html-vite'>;
Expand Down
5 changes: 4 additions & 1 deletion code/frameworks/web-components-vite/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import type { CompatibleString, StorybookConfig as StorybookConfigBase } from '@storybook/core/dist/types';
import type {
CompatibleString,
StorybookConfig as StorybookConfigBase,
} from '@storybook/core/dist/types';
import type { StorybookConfigVite, BuilderOptions } from '@storybook/builder-vite';

type FrameworkName = CompatibleString<'@storybook/web-components-vite'>;
Expand Down
4 changes: 2 additions & 2 deletions code/lib/core-server/src/utils/build-or-throw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ export async function buildOrThrow<T>(callback: () => Promise<T>): Promise<T> {
} catch (err: any) {
const builderErrors = err.errors as { text: string }[];
if (builderErrors) {
const inconsistentVersionsError = builderErrors.find(
(er) => er.text?.includes('No matching export')
const inconsistentVersionsError = builderErrors.find((er) =>
er.text?.includes('No matching export')
);

if (inconsistentVersionsError) {
Expand Down
9 changes: 4 additions & 5 deletions code/lib/manager-api/src/modules/whatsnew.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,10 @@ export const init: ModuleFn = ({ fullAPI, store, provider }) => {
function getLatestWhatsNewPost(): Promise<WhatsNewData> {
provider.channel?.emit(REQUEST_WHATS_NEW_DATA);

return new Promise(
(resolve) =>
provider.channel?.once(RESULT_WHATS_NEW_DATA, ({ data }: { data: WhatsNewData }) =>
resolve(data)
)
return new Promise((resolve) =>
provider.channel?.once(RESULT_WHATS_NEW_DATA, ({ data }: { data: WhatsNewData }) =>
resolve(data)
)
);
}

Expand Down
14 changes: 8 additions & 6 deletions code/renderers/svelte/src/public-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,19 @@ export type { Args, ArgTypes, Parameters, StrictArgs } from '@storybook/core/dis
*
* @see [Default export](https://storybook.js.org/docs/formats/component-story-format/#default-export)
*/
export type Meta<CmpOrArgs = Args> = CmpOrArgs extends SvelteComponent<infer Props>
? ComponentAnnotations<SvelteRenderer<CmpOrArgs>, Props>
: ComponentAnnotations<SvelteRenderer, CmpOrArgs>;
export type Meta<CmpOrArgs = Args> =
CmpOrArgs extends SvelteComponent<infer Props>
? ComponentAnnotations<SvelteRenderer<CmpOrArgs>, Props>
: ComponentAnnotations<SvelteRenderer, CmpOrArgs>;
/**
* Story function that represents a CSFv2 component example.
*
* @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
*/
export type StoryFn<TCmpOrArgs = Args> = TCmpOrArgs extends SvelteComponent<infer Props>
? AnnotatedStoryFn<SvelteRenderer, Props>
: AnnotatedStoryFn<SvelteRenderer, TCmpOrArgs>;
export type StoryFn<TCmpOrArgs = Args> =
TCmpOrArgs extends SvelteComponent<infer Props>
? AnnotatedStoryFn<SvelteRenderer, Props>
: AnnotatedStoryFn<SvelteRenderer, TCmpOrArgs>;

/**
* Story object that represents a CSFv3 component example.
Expand Down
9 changes: 5 additions & 4 deletions code/renderers/vue3/src/public-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,12 @@ type AllowNonFunctionSlots<Slots> = {

export type ComponentPropsAndSlots<C> = ComponentProps<C> & ExtractSlots<C>;

type ComponentPropsOrProps<TCmpOrArgs> = TCmpOrArgs extends Constructor<any>
? ComponentPropsAndSlots<TCmpOrArgs>
: TCmpOrArgs extends FunctionalComponent<any>
type ComponentPropsOrProps<TCmpOrArgs> =
TCmpOrArgs extends Constructor<any>
? ComponentPropsAndSlots<TCmpOrArgs>
: TCmpOrArgs;
: TCmpOrArgs extends FunctionalComponent<any>
? ComponentPropsAndSlots<TCmpOrArgs>
: TCmpOrArgs;

export type Decorator<TArgs = StrictArgs> = DecoratorFunction<VueRenderer, TArgs>;
export type Loader<TArgs = StrictArgs> = LoaderFunction<VueRenderer, TArgs>;
Expand Down

0 comments on commit 41a77c8

Please sign in to comment.