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

Fixes broken storybook build #1317

Merged
merged 9 commits into from
May 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 4 additions & 0 deletions .github/workflows/ui-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,7 @@ jobs:
- name: Build OSS app
working-directory: ./src/ui/app
run: npm run build

- name: Build Storybook
working-directory: ./src/ui/common
run: npm run build-storybook
Copy link
Contributor

Choose a reason for hiding this comment

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

awesome!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hopefully we can catch these issues when they come up in the future.

18 changes: 9 additions & 9 deletions src/ui/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@
"@parcel/css": "^1.14.0",
"@types/react": "^18.0.27",
"@types/react-dom": "^18.0.10",
"@typescript-eslint/eslint-plugin": "^5.49.0",
"@typescript-eslint/parser": "^5.49.0",
"eslint": "^8.32.0",
"eslint-formatter-table": "^7.32.1",
"eslint-config-prettier": "^8.6.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.32.1",
"eslint-plugin-simple-import-sort": "^9.0.0",
"eslint-plugin-unused-imports": "^2.0.0",
"@typescript-eslint/eslint-plugin": "5.59.5",
"@typescript-eslint/parser": "5.59.5",
"eslint": "8.40.0",
"eslint-formatter-table": "7.32.1",
"eslint-config-prettier": "8.8.0",
"eslint-plugin-prettier": "4.2.1",
"eslint-plugin-react": "7.32.2",
"eslint-plugin-simple-import-sort": "10.0.0",
"eslint-plugin-unused-imports": "2.0.0",
"os-browserify": "^0.3.0",
"parcel": "^2.8.3",
"parcel-resolver-ignore": "2.1.3",
Expand Down
3 changes: 2 additions & 1 deletion src/ui/common/.babelrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"presets": [
"@babel/preset-react"
"@babel/preset-react",
"@babel/preset-typescript"
],
"plugins": [
"@emotion/babel-plugin"
Expand Down
15 changes: 8 additions & 7 deletions src/ui/common/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ module.exports = {
// Allows for the use of imports
ecmaFeatures: {
jsx: true // Allows for the parsing of JSX

}
},

settings: {
react: {
version: "detect" // Tells eslint-plugin-react to automatically detect the version of React to use

}
},
extends: ["plugin:react/recommended", "plugin:@typescript-eslint/recommended", "plugin:prettier/recommended"],

extends: ['plugin:react/recommended', 'plugin:@typescript-eslint/recommended', 'plugin:prettier/recommended', 'plugin:storybook/recommended'],
plugins: ['simple-import-sort', "unused-imports", "react-hooks"],
rules: {
// Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
Expand All @@ -31,7 +31,8 @@ module.exports = {
'no-unused-vars': 'off',
'unused-imports/no-unused-imports': 'error',
'react/jsx-child-element-spacing': 'off',
'react-hooks/rules-of-hooks': 'error', // Checks rules of Hooks
'react-hooks/exhaustive-deps': 'warn', // Checks effect dependencies
},
};
'react-hooks/rules-of-hooks': 'error',
// Checks rules of Hooks
'react-hooks/exhaustive-deps': 'warn' // Checks effect dependencies
}
};
42 changes: 17 additions & 25 deletions src/ui/common/.storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,22 @@
module.exports = {
module: {
rules: [
{
test: /\.(stories|story)\.mdx$/,
use: [
{
loader: require.resolve('@storybook/mdx2-csf/loader'),
options: {},
}
]
}
]
rules: [{
test: /\.(stories|story)\.mdx$/,
use: [{
loader: require.resolve('@storybook/mdx2-csf/loader'),
options: {}
}]
}]
},
stories: ["../src/**/*.stories.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
addons: [
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/addon-interactions",
],
framework: "@storybook/react",
addons: ["@storybook/addon-links", "@storybook/addon-essentials", "@storybook/addon-interactions", "@storybook/addon-mdx-gfm"],
framework: {
name: "@storybook/react-webpack5",
options: {}
},
features: {
previewMdx2: true
},
core: {
builder: "@storybook/builder-webpack5",
},
typescript: {
check: false,
checkOptions: {},
Expand All @@ -39,10 +31,10 @@ module.exports = {
// makes string and boolean types that can be undefined appear as inputs and switches
shouldRemoveUndefinedFromOptional: true,
// Filter out third-party props from node_modules except @mui packages
propFilter: (prop) =>
prop.parent
? !/node_modules\/(?!@mui)/.test(prop.parent.fileName)
: true,
},
propFilter: prop => prop.parent ? !/node_modules\/(?!@mui)/.test(prop.parent.fileName) : true
}
},
docs: {
autodocs: true
}
};
Loading