fix(docs): regenerate 6.1.0 snapshots with depth-aware import rewriter

The previous import-path fixer only matched two-level relative paths
(`../../src/` and `../../data/`), missing files at deeper nesting in the
section tree. After the 6.1.0 cut for developer_docs, ~50 component MDX
files at depth 3 still referenced `../../../src/components/StorybookWrapper`
(should have been `../../../../src/...`), and the components Button page
referenced `../../../superset-frontend/...` (should have been
`../../../../superset-frontend/...`). The Docusaurus production build
failed with module-not-found errors as a result.

Replace the pattern-specific regex with a depth-aware walker that
- counts the file's nesting depth within the snapshot,
- bumps any relative import whose `../` count exceeds that depth (i.e.
  the import escapes the section root and so must compensate for the
  extra `version-X.X.X/` directory the snapshot lives under),
- skips fenced code blocks so documented sample imports (e.g. Playwright
  page-object examples in developer_docs/testing/e2e-testing.md) are not
  rewritten.

Re-cut all four sections under the new fixer. yarn build now passes
locally.
This commit is contained in:
Superset Dev
2026-05-04 08:53:25 -07:00
parent 752ebd47cb
commit 5a5a0e70fc
355 changed files with 3748 additions and 368 deletions

View File

@@ -22,7 +22,7 @@ sidebar_label: AutoComplete
under the License.
-->
import { StoryWithControls } from '../../../src/components/StorybookWrapper';
import { StoryWithControls } from '../../../../src/components/StorybookWrapper';
# AutoComplete

View File

@@ -22,7 +22,7 @@ sidebar_label: Avatar
under the License.
-->
import { StoryWithControls } from '../../../src/components/StorybookWrapper';
import { StoryWithControls } from '../../../../src/components/StorybookWrapper';
# Avatar

View File

@@ -22,7 +22,7 @@ sidebar_label: Badge
under the License.
-->
import { StoryWithControls } from '../../../src/components/StorybookWrapper';
import { StoryWithControls } from '../../../../src/components/StorybookWrapper';
# Badge

View File

@@ -22,7 +22,7 @@ sidebar_label: Breadcrumb
under the License.
-->
import { StoryWithControls } from '../../../src/components/StorybookWrapper';
import { StoryWithControls } from '../../../../src/components/StorybookWrapper';
# Breadcrumb

View File

@@ -22,7 +22,7 @@ sidebar_label: Button
under the License.
-->
import { StoryWithControls, ComponentGallery } from '../../../src/components/StorybookWrapper';
import { StoryWithControls, ComponentGallery } from '../../../../src/components/StorybookWrapper';
# Button

View File

@@ -22,7 +22,7 @@ sidebar_label: ButtonGroup
under the License.
-->
import { StoryWithControls } from '../../../src/components/StorybookWrapper';
import { StoryWithControls } from '../../../../src/components/StorybookWrapper';
# ButtonGroup

View File

@@ -22,7 +22,7 @@ sidebar_label: CachedLabel
under the License.
-->
import { StoryWithControls } from '../../../src/components/StorybookWrapper';
import { StoryWithControls } from '../../../../src/components/StorybookWrapper';
# CachedLabel

View File

@@ -22,7 +22,7 @@ sidebar_label: Card
under the License.
-->
import { StoryWithControls } from '../../../src/components/StorybookWrapper';
import { StoryWithControls } from '../../../../src/components/StorybookWrapper';
# Card

View File

@@ -22,7 +22,7 @@ sidebar_label: Checkbox
under the License.
-->
import { StoryWithControls } from '../../../src/components/StorybookWrapper';
import { StoryWithControls } from '../../../../src/components/StorybookWrapper';
# Checkbox

View File

@@ -22,7 +22,7 @@ sidebar_label: Collapse
under the License.
-->
import { StoryWithControls } from '../../../src/components/StorybookWrapper';
import { StoryWithControls } from '../../../../src/components/StorybookWrapper';
# Collapse

View File

@@ -22,7 +22,7 @@ sidebar_label: DatePicker
under the License.
-->
import { StoryWithControls } from '../../../src/components/StorybookWrapper';
import { StoryWithControls } from '../../../../src/components/StorybookWrapper';
# DatePicker

View File

@@ -22,7 +22,7 @@ sidebar_label: Divider
under the License.
-->
import { StoryWithControls } from '../../../src/components/StorybookWrapper';
import { StoryWithControls } from '../../../../src/components/StorybookWrapper';
# Divider

View File

@@ -22,7 +22,7 @@ sidebar_label: EditableTitle
under the License.
-->
import { StoryWithControls } from '../../../src/components/StorybookWrapper';
import { StoryWithControls } from '../../../../src/components/StorybookWrapper';
# EditableTitle

View File

@@ -22,7 +22,7 @@ sidebar_label: EmptyState
under the License.
-->
import { StoryWithControls, ComponentGallery } from '../../../src/components/StorybookWrapper';
import { StoryWithControls, ComponentGallery } from '../../../../src/components/StorybookWrapper';
# EmptyState

View File

@@ -22,7 +22,7 @@ sidebar_label: FaveStar
under the License.
-->
import { StoryWithControls } from '../../../src/components/StorybookWrapper';
import { StoryWithControls } from '../../../../src/components/StorybookWrapper';
# FaveStar

View File

@@ -22,7 +22,7 @@ sidebar_label: IconButton
under the License.
-->
import { StoryWithControls } from '../../../src/components/StorybookWrapper';
import { StoryWithControls } from '../../../../src/components/StorybookWrapper';
# IconButton

View File

@@ -22,7 +22,7 @@ sidebar_label: Icons
under the License.
-->
import { StoryWithControls } from '../../../src/components/StorybookWrapper';
import { StoryWithControls } from '../../../../src/components/StorybookWrapper';
# Icons

View File

@@ -22,7 +22,7 @@ sidebar_label: IconTooltip
under the License.
-->
import { StoryWithControls } from '../../../src/components/StorybookWrapper';
import { StoryWithControls } from '../../../../src/components/StorybookWrapper';
# IconTooltip

View File

@@ -22,7 +22,7 @@ sidebar_label: InfoTooltip
under the License.
-->
import { StoryWithControls } from '../../../src/components/StorybookWrapper';
import { StoryWithControls } from '../../../../src/components/StorybookWrapper';
# InfoTooltip

View File

@@ -22,7 +22,7 @@ sidebar_label: Input
under the License.
-->
import { StoryWithControls } from '../../../src/components/StorybookWrapper';
import { StoryWithControls } from '../../../../src/components/StorybookWrapper';
# Input

View File

@@ -22,7 +22,7 @@ sidebar_label: Label
under the License.
-->
import { StoryWithControls } from '../../../src/components/StorybookWrapper';
import { StoryWithControls } from '../../../../src/components/StorybookWrapper';
# Label

View File

@@ -22,7 +22,7 @@ sidebar_label: List
under the License.
-->
import { StoryWithControls } from '../../../src/components/StorybookWrapper';
import { StoryWithControls } from '../../../../src/components/StorybookWrapper';
# List

View File

@@ -22,7 +22,7 @@ sidebar_label: ListViewCard
under the License.
-->
import { StoryWithControls } from '../../../src/components/StorybookWrapper';
import { StoryWithControls } from '../../../../src/components/StorybookWrapper';
# ListViewCard

View File

@@ -22,7 +22,7 @@ sidebar_label: Loading
under the License.
-->
import { StoryWithControls } from '../../../src/components/StorybookWrapper';
import { StoryWithControls } from '../../../../src/components/StorybookWrapper';
# Loading

View File

@@ -22,7 +22,7 @@ sidebar_label: Menu
under the License.
-->
import { StoryWithControls } from '../../../src/components/StorybookWrapper';
import { StoryWithControls } from '../../../../src/components/StorybookWrapper';
# Menu

View File

@@ -22,7 +22,7 @@ sidebar_label: Modal
under the License.
-->
import { StoryWithControls } from '../../../src/components/StorybookWrapper';
import { StoryWithControls } from '../../../../src/components/StorybookWrapper';
# Modal

View File

@@ -22,7 +22,7 @@ sidebar_label: ModalTrigger
under the License.
-->
import { StoryWithControls } from '../../../src/components/StorybookWrapper';
import { StoryWithControls } from '../../../../src/components/StorybookWrapper';
# ModalTrigger

View File

@@ -22,7 +22,7 @@ sidebar_label: Popover
under the License.
-->
import { StoryWithControls } from '../../../src/components/StorybookWrapper';
import { StoryWithControls } from '../../../../src/components/StorybookWrapper';
# Popover

View File

@@ -22,7 +22,7 @@ sidebar_label: ProgressBar
under the License.
-->
import { StoryWithControls } from '../../../src/components/StorybookWrapper';
import { StoryWithControls } from '../../../../src/components/StorybookWrapper';
# ProgressBar

View File

@@ -22,7 +22,7 @@ sidebar_label: Radio
under the License.
-->
import { StoryWithControls } from '../../../src/components/StorybookWrapper';
import { StoryWithControls } from '../../../../src/components/StorybookWrapper';
# Radio

View File

@@ -22,7 +22,7 @@ sidebar_label: SafeMarkdown
under the License.
-->
import { StoryWithControls } from '../../../src/components/StorybookWrapper';
import { StoryWithControls } from '../../../../src/components/StorybookWrapper';
# SafeMarkdown

View File

@@ -22,7 +22,7 @@ sidebar_label: Select
under the License.
-->
import { StoryWithControls } from '../../../src/components/StorybookWrapper';
import { StoryWithControls } from '../../../../src/components/StorybookWrapper';
# Select

View File

@@ -22,7 +22,7 @@ sidebar_label: Skeleton
under the License.
-->
import { StoryWithControls } from '../../../src/components/StorybookWrapper';
import { StoryWithControls } from '../../../../src/components/StorybookWrapper';
# Skeleton

View File

@@ -22,7 +22,7 @@ sidebar_label: Slider
under the License.
-->
import { StoryWithControls } from '../../../src/components/StorybookWrapper';
import { StoryWithControls } from '../../../../src/components/StorybookWrapper';
# Slider

View File

@@ -22,7 +22,7 @@ sidebar_label: Steps
under the License.
-->
import { StoryWithControls } from '../../../src/components/StorybookWrapper';
import { StoryWithControls } from '../../../../src/components/StorybookWrapper';
# Steps

View File

@@ -22,7 +22,7 @@ sidebar_label: Switch
under the License.
-->
import { StoryWithControls } from '../../../src/components/StorybookWrapper';
import { StoryWithControls } from '../../../../src/components/StorybookWrapper';
# Switch

View File

@@ -22,7 +22,7 @@ sidebar_label: TableCollection
under the License.
-->
import { StoryWithControls } from '../../../src/components/StorybookWrapper';
import { StoryWithControls } from '../../../../src/components/StorybookWrapper';
# TableCollection

View File

@@ -22,7 +22,7 @@ sidebar_label: TableView
under the License.
-->
import { StoryWithControls } from '../../../src/components/StorybookWrapper';
import { StoryWithControls } from '../../../../src/components/StorybookWrapper';
# TableView

View File

@@ -22,7 +22,7 @@ sidebar_label: Tabs
under the License.
-->
import { StoryWithControls } from '../../../src/components/StorybookWrapper';
import { StoryWithControls } from '../../../../src/components/StorybookWrapper';
# Tabs

View File

@@ -22,7 +22,7 @@ sidebar_label: Timer
under the License.
-->
import { StoryWithControls } from '../../../src/components/StorybookWrapper';
import { StoryWithControls } from '../../../../src/components/StorybookWrapper';
# Timer

View File

@@ -22,7 +22,7 @@ sidebar_label: Tooltip
under the License.
-->
import { StoryWithControls } from '../../../src/components/StorybookWrapper';
import { StoryWithControls } from '../../../../src/components/StorybookWrapper';
# Tooltip

View File

@@ -22,7 +22,7 @@ sidebar_label: Tree
under the License.
-->
import { StoryWithControls } from '../../../src/components/StorybookWrapper';
import { StoryWithControls } from '../../../../src/components/StorybookWrapper';
# Tree

View File

@@ -22,7 +22,7 @@ sidebar_label: TreeSelect
under the License.
-->
import { StoryWithControls } from '../../../src/components/StorybookWrapper';
import { StoryWithControls } from '../../../../src/components/StorybookWrapper';
# TreeSelect

View File

@@ -22,7 +22,7 @@ sidebar_label: Typography
under the License.
-->
import { StoryWithControls } from '../../../src/components/StorybookWrapper';
import { StoryWithControls } from '../../../../src/components/StorybookWrapper';
# Typography

View File

@@ -22,7 +22,7 @@ sidebar_label: UnsavedChangesModal
under the License.
-->
import { StoryWithControls } from '../../../src/components/StorybookWrapper';
import { StoryWithControls } from '../../../../src/components/StorybookWrapper';
# UnsavedChangesModal

View File

@@ -22,7 +22,7 @@ sidebar_label: Upload
under the License.
-->
import { StoryWithControls } from '../../../src/components/StorybookWrapper';
import { StoryWithControls } from '../../../../src/components/StorybookWrapper';
# Upload