Skip to content

Setup #3

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

Merged
merged 23 commits into from
Jun 8, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
setup storybook & components
  • Loading branch information
ShMcK committed Jun 8, 2019
commit 97cf2a17780bc5f0784c6fc344459e571e5a7ff0
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ node_modules

# output directory
build
web-app/build
web-app/build/
web-app/node_modules

12 changes: 6 additions & 6 deletions src/typings/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
export interface TutorialLevel {
stageList: string[]
content?: {
title?: string
text?: string
content: {
title: string
text: string
}
}

export interface TutorialStage {
stepList: string[]
content?: {
title?: string
text?: string
content: {
title: string
text: string
}
}

Expand Down
12 changes: 12 additions & 0 deletions web-app/.storybook/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
// ...
"plugins": [
[
"babel-plugin-import",
{
"libraryName": "@alifd/next",
"style": true
}
]
]
}
4 changes: 4 additions & 0 deletions web-app/.storybook/addons.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import '@storybook/addon-actions/register'
import '@storybook/addon-links/register'
import '@storybook/addon-knobs/register'
import '@storybook/addon-notes/register'
9 changes: 9 additions & 0 deletions web-app/.storybook/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { configure } from '@storybook/react';
// automatically import all files ending in *.stories.tsx
const req = require.context('../stories', true, /\.stories\.tsx$/);

function loadStories() {
req.keys().forEach(req);
}

configure(loadStories, module);
20 changes: 20 additions & 0 deletions web-app/.storybook/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const path = require('path')

// see typescript setup
// https://storybook.js.org/docs/configurations/typescript-config/
module.exports = ({ config }) => {
config.module.rules.push({
test: /\.scss$/,
use: ['style-loader', 'css-loader', 'sass-loader'],
include: path.resolve(__dirname, '../'),
})
config.module.rules.push({
test: /\.(ts|tsx)$/,
loader: require.resolve('babel-loader'),
options: {
presets: [['react-app', { flow: false, typescript: true }]],
},
})
config.resolve.extensions.push('.ts', '.tsx')
return config
}
Loading