Skip to content

Commit 6a9283c

Browse files
committed
Upgrade Storybook from v8 to v9
Breaking changes addressed: - Update storybook packages to v9.1.6 - Remove packages now consolidated into core storybook: - @storybook/addon-actions (now storybook/actions) - @storybook/addon-essentials (built-in) - @storybook/addon-interactions (built-in) - @storybook/blocks (now @storybook/addon-docs/blocks) - @storybook/components (now storybook/internal/components) - @storybook/manager-api (now storybook/manager-api) - @storybook/theming (now storybook/theming) - Add @storybook/addon-docs for MDX support - Update import paths to new package structure - Convert preset.ts from CommonJS to ESM - Update Overview.mdx to use @storybook/addon-docs/blocks
1 parent 8fcde39 commit 6a9283c

File tree

10 files changed

+338
-842
lines changed

10 files changed

+338
-842
lines changed

extensions/ql-vscode/.storybook/main.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@ import type { StorybookConfig } from "@storybook/react-vite";
33
const config: StorybookConfig = {
44
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
55
addons: [
6+
"@storybook/addon-docs",
67
"@storybook/addon-links",
7-
"@storybook/addon-essentials",
8-
"@storybook/addon-interactions",
98
"@storybook/addon-a11y",
109
"./vscode-theme-addon/preset.ts",
1110
],

extensions/ql-vscode/.storybook/manager.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { addons } from "@storybook/manager-api";
2-
import { themes } from "@storybook/theming";
1+
import { addons } from "storybook/manager-api";
2+
import { themes } from "storybook/theming";
33

44
addons.setConfig({
55
theme: themes.dark,

extensions/ql-vscode/.storybook/preview.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { Preview } from "@storybook/react";
2-
import { themes } from "@storybook/theming";
3-
import { action } from "@storybook/addon-actions";
2+
import { themes } from "storybook/theming";
3+
import { action } from "storybook/actions";
44

55
// Allow all stories/components to use Codicons
66
import "@vscode/codicons/dist/codicon.css";

extensions/ql-vscode/.storybook/vscode-theme-addon/ThemeSelector.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ import * as React from "react";
22
import type { FunctionComponent } from "react";
33
import { useCallback } from "react";
44

5-
import { useGlobals } from "@storybook/manager-api";
5+
import { useGlobals } from "storybook/manager-api";
66
import {
77
IconButton,
88
TooltipLinkList,
99
WithTooltip,
10-
} from "@storybook/components";
10+
} from "storybook/internal/components";
1111
import { DashboardIcon } from "@storybook/icons";
1212

1313
import { themeNames, VSCodeTheme } from "./theme";

extensions/ql-vscode/.storybook/vscode-theme-addon/manager.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as React from "react";
2-
import { addons } from "@storybook/manager-api";
2+
import { addons } from "storybook/manager-api";
33
import { Addon_TypesEnum } from "storybook/internal/types";
44
import { ThemeSelector } from "./ThemeSelector";
55

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
export function previewAnnotations(entry = []) {
2-
return [...entry, require.resolve("./preview.ts")];
1+
const previewPath = new URL("./preview.ts", import.meta.url).pathname;
2+
const managerPath = new URL("./manager.tsx", import.meta.url).pathname;
3+
4+
export function previewAnnotations(entry: string[] = []) {
5+
return [...entry, previewPath];
36
}
47

5-
export function managerEntries(entry = []) {
6-
return [...entry, require.resolve("./manager.tsx")];
8+
export function managerEntries(entry: string[] = []) {
9+
return [...entry, managerPath];
710
}

0 commit comments

Comments
 (0)