Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit97cf2a1

Browse files
committed
setup storybook & components
1 parent826f2e7 commit97cf2a1

25 files changed

+4539
-151
lines changed

‎.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ node_modules
44

55
# output directory
66
build
7-
web-app/build
7+
web-app/build/
88
web-app/node_modules
99

‎src/typings/index.d.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
exportinterfaceTutorialLevel{
22
stageList:string[]
3-
content?:{
4-
title?:string
5-
text?:string
3+
content:{
4+
title:string
5+
text:string
66
}
77
}
88

99
exportinterfaceTutorialStage{
1010
stepList:string[]
11-
content?:{
12-
title?:string
13-
text?:string
11+
content:{
12+
title:string
13+
text:string
1414
}
1515
}
1616

‎web-app/.storybook/.babelrc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
// ...
3+
"plugins": [
4+
[
5+
"babel-plugin-import",
6+
{
7+
"libraryName":"@alifd/next",
8+
"style":true
9+
}
10+
]
11+
]
12+
}

‎web-app/.storybook/addons.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import'@storybook/addon-actions/register'
2+
import'@storybook/addon-links/register'
3+
import'@storybook/addon-knobs/register'
4+
import'@storybook/addon-notes/register'

‎web-app/.storybook/config.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import{configure}from'@storybook/react';
2+
// automatically import all files ending in *.stories.tsx
3+
constreq=require.context('../stories',true,/\.stories\.tsx$/);
4+
5+
functionloadStories(){
6+
req.keys().forEach(req);
7+
}
8+
9+
configure(loadStories,module);

‎web-app/.storybook/webpack.config.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
constpath=require('path')
2+
3+
// see typescript setup
4+
// https://storybook.js.org/docs/configurations/typescript-config/
5+
module.exports=({ config})=>{
6+
config.module.rules.push({
7+
test:/\.scss$/,
8+
use:['style-loader','css-loader','sass-loader'],
9+
include:path.resolve(__dirname,'../'),
10+
})
11+
config.module.rules.push({
12+
test:/\.(ts|tsx)$/,
13+
loader:require.resolve('babel-loader'),
14+
options:{
15+
presets:[['react-app',{flow:false,typescript:true}]],
16+
},
17+
})
18+
config.resolve.extensions.push('.ts','.tsx')
19+
returnconfig
20+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp