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

feat(storybook): Co-habitating/Upgrading Storybooks to v7 (dependency madness ensues) #26907

Merged
merged 88 commits into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from 85 commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
5430bbf
chore(storybook): Upgrading to storybook 7
rusackas Jan 31, 2024
ee76eaa
lots of story tweaks... these might not work ¯\_(ツ)_/¯
rusackas Jan 31, 2024
135c9d9
Revert "lots of story tweaks... these might not work ¯\_(ツ)_/¯"
rusackas Feb 2, 2024
ef6e69d
core stories updated to remove knobs
rusackas Feb 2, 2024
8564de2
turning autodocs off... that sure doesn't work.
rusackas Feb 2, 2024
df1da2d
7.6.12... I mean why not?!
rusackas Feb 2, 2024
2f16a34
removing duplicate addon
rusackas Feb 2, 2024
1011f0b
New MDX loader... working better!
rusackas Feb 2, 2024
6ab7e2a
bumping remark-gfm
rusackas Feb 2, 2024
79b3a43
renaming story so it gets picked up properly by storybook
rusackas Feb 2, 2024
3e04314
Migrating stuff from the monorepo
rusackas Feb 2, 2024
df230d5
fixing path import for SB7 and allowing progressive migration of Stories
rusackas Feb 2, 2024
3c3cdaa
Fixing story sorting for SB7
rusackas Feb 2, 2024
9be4ec0
oops, missed a file... part of the superset-ui-demo bump to 7.6.12
rusackas Feb 2, 2024
e642fd9
fixing filename typo
rusackas Feb 2, 2024
de338d9
ChordChart
rusackas Feb 2, 2024
98f2a9d
CountryMap rename
rusackas Feb 2, 2024
326b52a
partially fixed country map... still getting a weird 404
rusackas Feb 2, 2024
24b635c
ugh... resetting country map
rusackas Feb 2, 2024
40e2386
passing args through ResizableChartDemo properly
rusackas Feb 2, 2024
9112805
fixing warning about multiple children
rusackas Feb 2, 2024
a527432
damned story updates now!
rusackas Feb 2, 2024
f23c6ae
Country map working better than ever!
rusackas Feb 2, 2024
c913121
lots o' linting
rusackas Feb 2, 2024
d48e977
allowing this ridiculous "license" through.
rusackas Feb 2, 2024
f8d1a9b
trying a big den-list string.
rusackas Feb 3, 2024
5046b92
nixing AGPL restriction...
rusackas Feb 3, 2024
aa060d7
removing deny list entirely.
rusackas Feb 3, 2024
8c69666
lots more linting (how were these not caught before!?)
rusackas Feb 3, 2024
9883426
removing migration log... not needed
rusackas Feb 3, 2024
9368867
gitignore future storybook migration logs
rusackas Feb 3, 2024
e399b76
Fixing a few easy-peasy plugins
rusackas Feb 4, 2024
367697b
More easy story conversions
rusackas Feb 4, 2024
9413a66
more working stories
rusackas Feb 4, 2024
a9312e1
Migrating area chart, fixing a bug
rusackas Feb 5, 2024
e9d2fa1
BoxPlot
rusackas Feb 5, 2024
2c7ac51
fixing nav issue
rusackas Feb 5, 2024
43147ac
fixing incorrect import
rusackas Feb 5, 2024
217a90b
area chart categorized correctly
rusackas Feb 5, 2024
0a9ddf1
"fixing" weird circular dependency problem
rusackas Feb 5, 2024
76aad08
Bubble Chart refactor
rusackas Feb 5, 2024
fa6f3ba
adding default form values back without the weird dependency issue.
rusackas Feb 5, 2024
b97ad4b
big number loading, but no trendline?
rusackas Feb 5, 2024
3c7aef6
lint
rusackas Feb 5, 2024
c6a1770
More stories enabled/ported
rusackas Feb 5, 2024
840464a
a few more charts, a few more bugfixes...
rusackas Feb 5, 2024
f755019
moving args/argTypes out of coutryMap
rusackas Feb 5, 2024
4649d28
Pie stories
rusackas Feb 6, 2024
3075135
Radar fixed
rusackas Feb 7, 2024
a1824b7
Sunburst fixed
rusackas Feb 7, 2024
9cf82c6
Series Chart fixed
rusackas Feb 7, 2024
34ceff4
Tree graph refactored
rusackas Feb 7, 2024
a952333
Treemap refactored
rusackas Feb 7, 2024
cb17c67
Waterfall ported
rusackas Feb 7, 2024
c935952
Waterfall needs default colors or it will crash.
rusackas Feb 7, 2024
3bf55dd
linting
rusackas Feb 8, 2024
9f17623
Connection story fixed
rusackas Feb 8, 2024
cb9301c
undoing superchart change
rusackas Feb 8, 2024
aaebf89
Pie story resizes properly finally!
rusackas Feb 8, 2024
7362aaa
linting
rusackas Feb 8, 2024
fb31be8
updated lockfile
rusackas Feb 8, 2024
9cd9d2a
so much linting...
rusackas Feb 8, 2024
63b41ab
last(?) story refactor
rusackas Feb 8, 2024
821fc62
refactorigng `.story` hoisting, killing knobs configs
rusackas Feb 8, 2024
9cfb54c
how did the linter not fix this?!
rusackas Feb 8, 2024
631757f
fixing some more little errors/depdencencies
rusackas Feb 8, 2024
c4bae7e
just a comma... nothing to see here.
rusackas Feb 8, 2024
59320b3
7.6.13 bump
rusackas Feb 8, 2024
b3844c5
7.6.13 bump part 2
rusackas Feb 8, 2024
df333b1
fixing all the resizeable width/height bugs
rusackas Feb 8, 2024
db2b277
adding @typescript-eslint/member-delimiter-style, re-linting
rusackas Feb 9, 2024
e17090b
getting rid of mdx. This commit is a bit of a hot mess.
rusackas Feb 10, 2024
c4df312
even more eslint fun
rusackas Feb 14, 2024
0c1ea82
removing a ts lilnter change since it's just the default
rusackas Feb 14, 2024
1f7229e
removing webpack debug mode
rusackas Feb 14, 2024
0f85049
bumping/fixing eslint-plugin-prettier, eslint-config-prettier
rusackas Feb 14, 2024
66c4f94
Looks like the precommit prettier is right, and npm prettier is wrong ?!
rusackas Feb 14, 2024
b9972c1
adding missing licenses
rusackas Feb 14, 2024
3e7b067
pre-commit prettier at 3.1.0
rusackas Feb 14, 2024
fe946d0
bumping npm prettier to match
rusackas Feb 14, 2024
8cb2b61
more bumpin!
rusackas Feb 14, 2024
94b50af
bumping eslint, ignoring new rules temporarily
rusackas Feb 14, 2024
887473e
restoring file from master
rusackas Feb 14, 2024
e5b2a6c
Merge branch 'master' into upgrade-to-storybook-7
rusackas Feb 14, 2024
c462bff
fixing problematic dependencies
rusackas Feb 14, 2024
3a1b55a
restoring license deny list
rusackas Feb 14, 2024
7c05e91
adding store2@2.14.2 licensing exception
rusackas Feb 14, 2024
1019a4d
comment about license
rusackas Feb 14, 2024
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
1 change: 0 additions & 1 deletion .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,3 @@ jobs:
fail-on-severity: critical
# compatible/incompatible licenses addressed here: https://www.apache.org/legal/resolved.html
# find SPDX identifiers here: https://spdx.org/licenses/
deny-licenses: MS-LPL, BUSL-1.1, QPL-1.0, Sleepycat, SSPL-1.0, CPOL-1.02, AGPL-3.0, GPL-1.0+, BSD-4-Clause-UC, NPL-1.0, NPL-1.1, JSON
rusackas marked this conversation as resolved.
Show resolved Hide resolved
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ superset/static/version_info.json
superset-frontend/**/esm/*
superset-frontend/**/lib/*
superset-frontend/**/storybook-static/*
superset-frontend/migration-storybook.log
yarn-error.log
*.map
*.min.js
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ repos:
- id: black
language_version: python3
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.4.1 # Use the sha or tag you want to point at
rev: v3.1.0 # Use the sha or tag you want to point at
hooks:
- id: prettier
args: ["--ignore-path=./superset-frontend/.prettierignore"]
Expand Down
63 changes: 61 additions & 2 deletions superset-frontend/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ module.exports = {
'prettier/react',
'plugin:react-hooks/recommended',
'plugin:react-prefer-function-component/recommended',
'plugin:storybook/recommended',
],
parser: '@babel/eslint-parser',
parserOptions: {
Expand All @@ -69,13 +70,13 @@ module.exports = {
},
},
plugins: [
'prettier',
'react',
'file-progress',
'lodash',
'theme-colors',
'translation-vars',
'react-prefer-function-component',
'prettier',
],
overrides: [
{
Expand All @@ -88,7 +89,7 @@ module.exports = {
'prettier/@typescript-eslint',
'prettier/react',
],
plugins: ['@typescript-eslint/eslint-plugin', 'prettier', 'react'],
plugins: ['@typescript-eslint/eslint-plugin', 'react', 'prettier'],
rules: {
'@typescript-eslint/ban-ts-ignore': 0,
'@typescript-eslint/ban-ts-comment': 0, // disabled temporarily
Expand Down Expand Up @@ -161,6 +162,28 @@ module.exports = {
'react/static-property-placement': 0, // re-enable up for discussion
'prettier/prettier': 'error',
'file-progress/activate': 1,
// delete me later: temporary rules to help with migration
Copy link
Member

Choose a reason for hiding this comment

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

Maybe add a TODO: prefix to make it discoverable by IDEs?

Suggested change
// delete me later: temporary rules to help with migration
// TODO: Delete me later. Temporary rules to help with migration.

Copy link
Member

Choose a reason for hiding this comment

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

'jsx-no-useless-fragment': 0,
'react/function-component-definition': [
0,
{
namedComponents: 'arrow-function',
},
],
'default-param-last': 0,
'react/no-unstable-nested-components': 0,
'react/jsx-no-useless-fragment': 0,
'react/no-unknown-property': 0,
'no-restricted-exports': 0,
'react/default-props-match-prop-types': 0,
'no-unsafe-optional-chaining': 0,
'react/state-in-constructor': 0,
'import/no-import-module-exports': 0,
'no-promise-executor-return': 0,
'prefer-regex-literals': 0,
'react/no-unused-class-component-methods': 0,
'import/no-relative-packages': 0,
'prefer-exponentiation-operator': 0,
},
settings: {
'import/resolver': {
Expand Down Expand Up @@ -203,6 +226,22 @@ module.exports = {
],
'no-only-tests/no-only-tests': 'error',
'max-classes-per-file': 0,
// temporary rules to help with migration - please re-enable!
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// temporary rules to help with migration - please re-enable!
// TODO: Temporary rules to help with migration - please re-enable!

'testing-library/await-async-queries': 0,
'testing-library/await-async-utils': 0,
'testing-library/no-await-sync-events': 0,
'testing-library/no-render-in-lifecycle': 0,
'testing-library/no-unnecessary-act': 0,
'testing-library/no-wait-for-multiple-assertions': 0,
'testing-library/prefer-screen-queries': 0,
'testing-library/await-async-events': 0,
'testing-library/no-node-access': 0,
'testing-library/no-wait-for-side-effects': 0,
'testing-library/prefer-presence-queries': 0,
'testing-library/render-result-naming-convention': 0,
'testing-library/no-container': 0,
'testing-library/prefer-find-by': 0,
'testing-library/no-manual-cleanup': 0,
},
},
{
Expand All @@ -222,6 +261,8 @@ module.exports = {
'theme-colors/no-literal-colors': 0,
'translation-vars/no-template-vars': 0,
'no-restricted-imports': 0,
'jest/no-alias-methods': 0,
'react/no-void-elements': 0,
},
},
],
Expand Down Expand Up @@ -310,6 +351,24 @@ module.exports = {
'react/static-property-placement': 0, // disabled temporarily
'react-prefer-function-component/react-prefer-function-component': 1,
'prettier/prettier': 'error',
// disabling some things that come with the eslint 7->8 upgrade. Will address these in a separate PR
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// disabling some things that come with the eslint 7->8 upgrade. Will address these in a separate PR
// TODO: Disabling some things that come with the eslint 7->8 upgrade. Will address these in a separate PR.

Copy link
Member

Choose a reason for hiding this comment

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

'jest/no-alias-methods': 0,
'react/no-unknown-property': 0,
'react/no-void-elements': 0,
'react/function-component-definition': [
0,
{
namedComponents: 'arrow-function',
},
],
'react/no-unstable-nested-components': 0,
'react/jsx-no-useless-fragment': 0,
'default-param-last': 0,
'no-import-assign': 0,
'import/no-relative-packages': 0,
'default-case-last': 0,
'no-promise-executor-return': 0,
'react/no-unused-class-component-methods': 0,
},
ignorePatterns,
};
33 changes: 24 additions & 9 deletions superset-frontend/.storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { dirname, join } from 'path';
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
Expand All @@ -20,21 +21,21 @@
const customConfig = require('../webpack.config.js');

module.exports = {
core: {
builder: 'webpack5',
},
stories: [
'../src/@(components|common|filters|explore|views|dashboard|features)/**/*.stories.@(tsx|jsx)',
'../src/@(components|common|filters|explore|views|dashboard|features)/**/*.*.@(mdx)',
'../packages/superset-ui-demo/storybook/stories/**/*.*.@(tsx|jsx)',
],

addons: [
'@storybook/addon-essentials',
'@storybook/addon-links',
'storybook-addon-jsx',
'@storybook/addon-knobs',
'storybook-addon-paddings',
getAbsolutePath('@storybook/addon-essentials'),
getAbsolutePath('@storybook/addon-links'),
getAbsolutePath('storybook-addon-jsx'),
getAbsolutePath('@storybook/addon-controls'),
getAbsolutePath('@storybook/addon-mdx-gfm'),
],

staticDirs: ['../src/assets/images'],

webpackFinal: config => ({
...config,
module: {
Expand All @@ -47,7 +48,21 @@ module.exports = {
},
plugins: [...config.plugins, ...customConfig.plugins],
}),

typescript: {
reactDocgen: 'react-docgen-typescript',
},

framework: {
name: getAbsolutePath('@storybook/react-webpack5'),
options: {},
},

docs: {
autodocs: false,
},
};

function getAbsolutePath(value) {
return dirname(require.resolve(join(value, 'package.json')));
}
12 changes: 3 additions & 9 deletions superset-frontend/.storybook/preview.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@
* under the License.
*/
import React from 'react';
import { addDecorator } from '@storybook/react';
import { jsxDecorator } from 'storybook-addon-jsx';
import { addParameters } from '@storybook/react';
import WithPaddings from 'storybook-addon-paddings';
import { supersetTheme, ThemeProvider } from '@superset-ui/core';
import { combineReducers, createStore, applyMiddleware, compose } from 'redux';
import thunk from 'redux-thunk';
Expand Down Expand Up @@ -52,12 +49,9 @@ const providerDecorator = Story => (
</Provider>
);

addDecorator(jsxDecorator);
addDecorator(themeDecorator);
addDecorator(providerDecorator);
addDecorator(WithPaddings);
export const decorators = [jsxDecorator, themeDecorator, providerDecorator];

addParameters({
export const parameters = {
paddings: {
values: [
{ name: 'None', value: '0px' },
Expand Down Expand Up @@ -88,4 +82,4 @@ addParameters({
},
},
controls: { expanded: true, sort: 'alpha' },
});
};
Loading
Loading