-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Svelte: Migrate @storybook/svelte to Typescript #8770
Merged
shilman
merged 8 commits into
storybookjs:next
from
aromanarguello:svelteTypescriptMigration
Nov 12, 2019
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
e7663a5
Migrate @storybook/svelte to Typescript
aromanarguello 243a732
fix types and addon version
aromanarguello d1ea47b
fix lock file
aromanarguello 796fef1
Update package.json
shilman 860ff33
update yarn file
aromanarguello 3d46f7b
changed index to typings, fixed import in options.ts
aromanarguello 945bc50
updated @storybook addon/core deps
aromanarguello 3c76269
update lockfile
aromanarguello File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { StoryFn } from '@storybook/addons'; | ||
|
||
export interface ShowErrorArgs { | ||
title: string; | ||
description: string; | ||
} | ||
|
||
export interface RenderMainArgs { | ||
storyFn: StoryFn<any>; | ||
selectedKind: string; | ||
selectedStory: string; | ||
showMain: () => void; | ||
showError: (args: ShowErrorArgs) => void; | ||
} | ||
|
||
export interface MountViewArgs { | ||
Component: any; | ||
target: any; | ||
props: MountProps; | ||
on: any; | ||
Wrapper: any; | ||
WrapperData: any; | ||
} | ||
|
||
interface MountProps { | ||
rounded: boolean; | ||
text: string; | ||
} | ||
|
||
interface WrapperData { | ||
innerStyle: string; | ||
style: string; | ||
} |
File renamed without changes.
4 changes: 3 additions & 1 deletion
4
...lte/src/server/framework-preset-svelte.js → ...lte/src/server/framework-preset-svelte.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
app/svelte/src/server/options.js → app/svelte/src/server/options.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
declare module '@storybook/core/*'; | ||
declare module 'global'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"extends": "../../tsconfig.json", | ||
"compilerOptions": { | ||
"rootDir": "./src", | ||
"types": ["webpack-env"], | ||
"resolveJsonModule": true | ||
}, | ||
"include": [ | ||
"src/**/*" | ||
], | ||
"exclude": [ | ||
"src/**/*.test.*" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -277,4 +277,4 @@ | |
] | ||
] | ||
} | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why?? @gaetanmaisse
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just saw your comment. Still this seems weird to me. Any references I can look at?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By setting
"rootDir": "./src"
we are telling TS compiler that all sources will be insrc
folder. Aspackage.json
is not insrc
it can not be imported directly (i.e. at compile time) without throwing:File '/Path/to/package.json' is not under 'rootDir' '/Path/To/App/src/'. 'rootDir' is expected to contain all source files.
require
will import the file at runtime so TS compiler will not try to load it and finally everyone is happy.