Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
xeho91 committed Oct 27, 2024
1 parent c1d6ac4 commit 92ca4db
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 167 deletions.
118 changes: 0 additions & 118 deletions src/Button.svelte

This file was deleted.

5 changes: 3 additions & 2 deletions src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ import { createRawSnippet, type ComponentProps, type Snippet } from 'svelte';
import type { Primitive } from 'type-fest';
import { describe, expectTypeOf, it } from 'vitest';

import StoryComponent from '#runtime/Story.svelte';
import { defineMeta, type Args, type StoryContext } from '#index';
import StoryComponent from './runtime/Story.svelte';

import { defineMeta, type Args, type StoryContext } from './index';
import type {
Meta,
StoryAnnotations,
Expand Down
47 changes: 0 additions & 47 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
// FIXME: Testing, remove before release
import { createRawSnippet, mount } from 'svelte';

import StoryComponent from './runtime/Story.svelte';
// TODO: Remove in next major release
import LegacyMetaComponent from './runtime/LegacyMeta.svelte';
// TODO: Remove in next major release
import LegacyStoryComponent from './runtime/LegacyStory.svelte';
// TODO: Remove in next major release
import LegacyTemplateComponent from './runtime/LegacyTemplate.svelte';
// FIXME: Testing, remove before release
import Button from './Button.svelte';

export { setTemplate } from './runtime/contexts/template.svelte';
import type {
Expand All @@ -26,48 +21,6 @@ export function defineMeta<const TCmp extends Cmp>(meta: MetaType<TCmp>) {
};
}

// FIXME: Testing, remove before release
const { Story } = defineMeta({
component: Button,
args: {
size: 'small',
},
});

// FIXME: Testing, remove before release
mount(Story, {
props: {
name: 'Primary',
args: {
size: 'small',
primary: true,
children: createRawSnippet(() => {
return {
render: () => 'Click me',
};
}),
},
play: (context) => {
context.args.size;
},
},
target: window.document,
});

// FIXME: Testing, remove before release
mount(Button, {
props: {
size: 'small',
primary: true,
children: createRawSnippet(() => {
return {
render: () => 'Click me',
};
}),
},
target: window.document,
});

export type Args<TStoryCmp> = TStoryCmp extends typeof StoryComponent<infer TCmp extends Cmp>
? NonNullable<StoryAnnotations<TCmp>['args']>
: never;
Expand Down

0 comments on commit 92ca4db

Please sign in to comment.