diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 4a80a9b3c61..e0ea7d3cb0a 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -101,16 +101,6 @@ updates: open-pull-requests-limit: 5 versioning-strategy: increase - - package-ecosystem: "npm" - directory: "/superset-frontend/plugins/legacy-plugin-chart-histogram/" - schedule: - interval: "daily" - labels: - - npm - - dependabot - open-pull-requests-limit: 5 - versioning-strategy: increase - - package-ecosystem: "npm" directory: "/superset-frontend/plugins/legacy-plugin-chart-partition/" schedule: @@ -211,16 +201,6 @@ updates: open-pull-requests-limit: 5 versioning-strategy: increase - - package-ecosystem: "npm" - directory: "/superset-frontend/plugins/legacy-plugin-chart-sankey/" - schedule: - interval: "daily" - labels: - - npm - - dependabot - open-pull-requests-limit: 5 - versioning-strategy: increase - - package-ecosystem: "npm" directory: "/superset-frontend/plugins/legacy-preset-chart-nvd3/" schedule: @@ -241,16 +221,6 @@ updates: open-pull-requests-limit: 5 versioning-strategy: increase - - package-ecosystem: "npm" - directory: "/superset-frontend/plugins/legacy-plugin-chart-event-flow/" - schedule: - interval: "daily" - labels: - - npm - - dependabot - open-pull-requests-limit: 5 - versioning-strategy: increase - - package-ecosystem: "npm" directory: "/superset-frontend/plugins/legacy-plugin-chart-paired-t-test/" schedule: @@ -261,16 +231,6 @@ updates: open-pull-requests-limit: 5 versioning-strategy: increase - - package-ecosystem: "npm" - directory: "/superset-frontend/plugins/legacy-plugin-chart-sankey-loop/" - schedule: - interval: "daily" - labels: - - npm - - dependabot - open-pull-requests-limit: 5 - versioning-strategy: increase - - package-ecosystem: "npm" directory: "/superset-frontend/plugins/plugin-chart-echarts/" schedule: @@ -282,7 +242,7 @@ updates: versioning-strategy: increase - package-ecosystem: "npm" - directory: "/superset-frontend/plugins/preset-chart-xy/" + directory: "/superset-frontend/plugins/plugin-chart-ag-grid-table/" schedule: interval: "daily" labels: @@ -292,7 +252,7 @@ updates: versioning-strategy: increase - package-ecosystem: "npm" - directory: "/superset-frontend/plugins/legacy-plugin-chart-heatmap/" + directory: "/superset-frontend/plugins/plugin-chart-cartodiagram/" schedule: interval: "daily" labels: @@ -311,16 +271,6 @@ updates: open-pull-requests-limit: 5 versioning-strategy: increase - - package-ecosystem: "npm" - directory: "/superset-frontend/plugins/legacy-plugin-chart-sunburst/" - schedule: - interval: "daily" - labels: - - npm - - dependabot - open-pull-requests-limit: 5 - versioning-strategy: increase - - package-ecosystem: "npm" directory: "/superset-frontend/plugins/plugin-chart-handlebars/" schedule: @@ -366,27 +316,6 @@ updates: open-pull-requests-limit: 5 versioning-strategy: increase - - package-ecosystem: "npm" - directory: "/superset-frontend/packages/superset-ui-demo/" - ignore: - # TODO: remove below entries until React >= 18.0.0 - - dependency-name: "@storybook*" - update-types: ["version-update:semver-major", "version-update:semver-minor"] - groups: - storybook: - applies-to: version-updates - patterns: - - "@storybook*" - update-types: - - "patch" - schedule: - interval: "daily" - labels: - - npm - - dependabot - open-pull-requests-limit: 5 - versioning-strategy: increase - - package-ecosystem: "npm" directory: "/superset-frontend/packages/superset-ui-switchboard/" schedule: diff --git a/.github/workflows/superset-frontend.yml b/.github/workflows/superset-frontend.yml index 651d7519f7b..f7953ad9fa8 100644 --- a/.github/workflows/superset-frontend.yml +++ b/.github/workflows/superset-frontend.yml @@ -163,11 +163,6 @@ jobs: docker run --rm $TAG bash -c \ "npm run plugins:build" - - name: Build Plugins Storybook - run: | - docker run --rm $TAG bash -c \ - "npm run plugins:build-storybook" - test-storybook: needs: frontend-build if: needs.frontend-build.outputs.should-run == 'true' diff --git a/superset-frontend/.eslintrc.js b/superset-frontend/.eslintrc.js index c71c2b072e6..a2c9b3ae5d7 100644 --- a/superset-frontend/.eslintrc.js +++ b/superset-frontend/.eslintrc.js @@ -318,7 +318,6 @@ module.exports = { files: ['packages/**/src/**/*.js', 'packages/**/src/**/*.jsx'], excludedFiles: [ 'packages/generator-superset/**/*', // Yeoman generator templates run via Node - 'packages/superset-ui-demo/.storybook/**/*', // Storybook config files 'packages/**/__mocks__/**/*', // Test mocks ], rules: { diff --git a/superset-frontend/.storybook/main.js b/superset-frontend/.storybook/main.js index 69484967983..19bef4da68d 100644 --- a/superset-frontend/.storybook/main.js +++ b/superset-frontend/.storybook/main.js @@ -23,8 +23,13 @@ const customConfig = require('../webpack.config.js'); // Filter out plugins that shouldn't be included in Storybook's static build // ReactRefreshWebpackPlugin adds Fast Refresh code that requires a dev server runtime, // which isn't available when serving the static storybook build +// ForkTsCheckerWebpackPlugin causes TypeScript project reference errors in Storybook context +const pluginsToExclude = [ + 'ReactRefreshWebpackPlugin', + 'ForkTsCheckerWebpackPlugin', +]; const filteredPlugins = customConfig.plugins.filter( - plugin => plugin.constructor.name !== 'ReactRefreshWebpackPlugin', + plugin => !pluginsToExclude.includes(plugin.constructor.name), ); // Deep clone and modify rules to disable React Fast Refresh and dev mode in SWC loader @@ -73,9 +78,9 @@ const disableDevModeInRules = rules => module.exports = { stories: [ - '../src/@(components|common|filters|explore|views|dashboard|features)/**/*.stories.@(tsx|jsx)', - '../packages/superset-ui-demo/storybook/stories/**/*.*.@(tsx|jsx)', - '../packages/superset-ui-core/src/components/**/*.stories.@(tsx|jsx)', + '../src/**/*.stories.tsx', + '../packages/superset-ui-core/src/**/*.stories.tsx', + '../plugins/*/src/**/*.stories.tsx', ], addons: [ @@ -102,6 +107,8 @@ module.exports = { ...customConfig.resolve?.alias, // Fix for Storybook 8.6.x with React 17 - resolve ESM module paths 'react-dom/test-utils': require.resolve('react-dom/test-utils'), + // Shared storybook utilities + '@storybook-shared': join(__dirname, 'shared'), }, }, plugins: [...config.plugins, ...filteredPlugins], diff --git a/superset-frontend/.storybook/preview.jsx b/superset-frontend/.storybook/preview.jsx index a6f9f7ce5cb..d216da26875 100644 --- a/superset-frontend/.storybook/preview.jsx +++ b/superset-frontend/.storybook/preview.jsx @@ -28,6 +28,27 @@ import { App, Layout, Space, Content } from 'antd'; import 'src/theme.ts'; import './storybook.css'; +// Set up bootstrap data for components that check HTML_SANITIZATION config +// (e.g., HandlebarsViewer). This allows