Skip to content

Commit

Permalink
Merge branch 'chore-types' into restore-template-component
Browse files Browse the repository at this point in the history
  • Loading branch information
xeho91 committed Aug 27, 2024
2 parents 79b48e7 + f0ef597 commit f4f0630
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 26 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
"@storybook/csf": "^0.1.11",
"@storybook/docs-tools": "^8.0.0",
"@storybook/node-logger": "^8.0.0",
"@storybook/types": "^8.0.0",
"dedent": "^1.5.3",
"es-toolkit": "^1.13.1",
"esrap": "^1.2.2",
Expand Down
12 changes: 0 additions & 12 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { PlayFunctionContext } from '@storybook/types';
import type { PlayFunctionContext } from 'storybook/internal/types';
import type { ComponentProps, Snippet } from 'svelte';
import type { EmptyObject, Primitive } from 'type-fest';
import { describe, expectTypeOf, it } from 'vitest';
Expand Down
10 changes: 5 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Args as BaseArgs } from '@storybook/types';
import type { Args as BaseArgs } from 'storybook/internal/types';
import type { EmptyObject } from 'type-fest';

import type {
Expand Down Expand Up @@ -31,13 +31,13 @@ export function defineMeta<

export type Args<TStoryCmp> =
TStoryCmp extends StoryCmp<infer _TOverrideArgs, infer TCmpOrArgs, infer TMeta>
? NonNullable<StoryAnnotations<TCmpOrArgs, TMeta>['args']>
: never;
? NonNullable<StoryAnnotations<TCmpOrArgs, TMeta>['args']>
: never;

export type StoryContext<TStoryCmp> =
TStoryCmp extends StoryCmp<infer _TOverrideArgs, infer TCmpOrArgs, infer TMeta>
? BaseStoryContext<TCmpOrArgs, TMeta>
: never;
? BaseStoryContext<TCmpOrArgs, TMeta>
: never;

// TODO: Remove in next major release
export {
Expand Down
2 changes: 1 addition & 1 deletion src/indexer/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { combineTags } from '@storybook/csf';
import type { IndexInput, Indexer } from '@storybook/types';
import type { IndexInput, Indexer } from 'storybook/internal/types';

import { parseForIndexer } from '#indexer/parser';
import {
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/Story.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
lang="ts"
generics="const TOverrideArgs extends Args, const TCmp extends Cmp, TMeta extends Meta<TCmp>"
>
import type { Args } from '@storybook/types';
import type { Args } from 'storybook/internal/types';
import type { Snippet } from 'svelte';
import { useStoriesExtractor } from '#runtime/contexts/extractor.svelte';
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/contexts/extractor.svelte.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Args } from '@storybook/types';
import type { Args } from 'storybook/internal/types';
import { getContext, hasContext, setContext, type ComponentProps } from 'svelte';

import { storyNameToExportName } from '#utils/identifier-utils';
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/contexts/renderer.svelte.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { getContext, hasContext, setContext } from 'svelte';

import type { Cmp, Meta, StoryAnnotations, StoryContext } from '#types';
import type { Args } from '@storybook/types';
import type { Args } from 'storybook/internal/types';

const CONTEXT_KEY = 'storybook-story-renderer-context';

Expand Down
2 changes: 1 addition & 1 deletion src/runtime/contexts/template.svelte.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Args } from '@storybook/types';
import type { Args } from 'storybook/internal/types';
import { getContext, hasContext, setContext, type ComponentProps } from 'svelte';

import type { Cmp, Meta, StoryCmp } from '#types';
Expand Down
2 changes: 1 addition & 1 deletion src/types.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { PlayFunctionContext } from '@storybook/types';
import type { PlayFunctionContext } from 'storybook/internal/types';
import type { Component, ComponentProps } from 'svelte';
import { describe, expectTypeOf, it } from 'vitest';

Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type {
StoryAnnotations as BaseStoryAnnotations,
StoryContext as BaseStoryContext,
WebRenderer,
} from '@storybook/types';
} from 'storybook/internal/types';
import type { Component, ComponentProps, Snippet } from 'svelte';
import type { Primitive, SetOptional, Simplify } from 'type-fest';

Expand Down

0 comments on commit f4f0630

Please sign in to comment.