Skip to content
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

WIP: fix Storybook #587

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
migrate storybook to use main.ts
Signed-off-by: shmck <shawn.j.mckay@gmail.com>
  • Loading branch information
ShMcK committed Mar 24, 2022
commit cb54ae516546d35bb93d0a588db012ee404ce968
3 changes: 0 additions & 3 deletions web-app/.storybook/addons.ts

This file was deleted.

19 changes: 0 additions & 19 deletions web-app/.storybook/config.ts

This file was deleted.

19 changes: 19 additions & 0 deletions web-app/.storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// import '../src/styles/reset.css'

// setup acquireVsCodeApi mock
// @ts-ignore
global.acquireVsCodeApi = () => ({
postMessage(event) {
console.log('ERROR: VSCode did not load properly in CodeRoad extension', event)
},
})

module.exports = {
stories: ['../**/*.stories.js'],
addons: [
'@storybook/preset-create-react-app',
'@storybook/addon-actions',
'@storybook/addon-knobs',
'@storybook/addon-links',
],
}
8 changes: 7 additions & 1 deletion web-app/.storybook/webpack.config.js
Original file line number Diff line number Diff line change
@@ -15,7 +15,13 @@ module.exports = ({ config }) => {
})

config.plugins.push(new MiniCssExtractPlugin({ filename: '[name].css' }))
// config.plugins.push(['import', { libraryName: '@alifd/next', libraryDirectory: 'lib', style: true }])
// config.plugins.push([
// 'babel-plugin-import',
// {
// libraryName: '@alifd/next',
// style: true,
// },
// ])
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I worry some components may not work without @alifd/next and emotion support. But I may be wrong!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated my branch. I've also enabled the plugin. Seems to be working.


config.resolve.extensions.push('.ts', '.tsx')

10 changes: 5 additions & 5 deletions web-app/package.json
Original file line number Diff line number Diff line change
@@ -46,12 +46,12 @@
"devDependencies": {
"@babel/core": "7.14.0",
"@babel/helper-environment-visitor": "7.16.7",
"@storybook/addon-actions": "6.4.0",
"@storybook/addon-actions": "6.4.19",
"@storybook/addon-knobs": "6.4.0",
"@storybook/addon-links": "6.4.0",
"@storybook/addons": "6.4.0",
"@storybook/preset-create-react-app": "3.2.0",
"@storybook/react": "6.4.0",
"@storybook/addon-links": "6.4.19",
"@storybook/addons": "6.4.19",
"@storybook/preset-create-react-app": "4.1.0",
"@storybook/react": "6.4.19",
"@types/git-url-parse": "9.0.1",
"@types/graphql": "14.5.0",
"@types/highlight.js": "10.1.0",
Loading
Oops, something went wrong.