Skip to content

Commit 4df9a2d

Browse files
committed
feat: update storybook to v9
1 parent 950dd83 commit 4df9a2d

File tree

13 files changed

+1236
-7374
lines changed

13 files changed

+1236
-7374
lines changed

.storybook/main.js

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,19 @@
11
const path = require('path');
22
module.exports = {
3-
staticDirs: ["public"],
4-
stories: ["../src/**/*.stories.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
5-
addons: [
6-
"@storybook/addon-links",
7-
{
8-
name: "@storybook/addon-essentials",
9-
options: {
10-
backgrounds: false
11-
}
12-
},
13-
"@storybook/addon-a11y",
14-
"@storybook/addon-storysource"
15-
],
16-
framework: {
3+
staticDirs: ["public"],
4+
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
5+
addons: ["@storybook/addon-links", "@storybook/addon-a11y", '@storybook/addon-docs'],
6+
7+
framework: {
178
name: "@storybook/angular",
189
options: {}
1910
},
20-
core: {
11+
12+
core: {
2113
disableTelemetry: true
2214
},
23-
docs: {
24-
autodocs: true
25-
}
15+
16+
features: {
17+
backgrounds: false
18+
}
2619
};

.storybook/manager.js

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

44
addons.setConfig({
55
theme: create({

.storybook/preview.js

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,11 @@ import { breakpoints } from '@carbon/layout';
44
// Add compodoc
55
import { setCompodocJson } from "@storybook/addon-docs/angular";
66
import {
7-
classes,
8-
components,
9-
directives,
10-
interfaces,
11-
miscellaneous,
12-
pipes
7+
components
138
} from "../dist/docs/documentation.json";
149

10+
import docJson from "../dist/docs/documentation.json";
11+
1512
/**
1613
* Remove public properties from docs Json for each component.
1714
* This is to prevent properties like `onTouched = () => {...}` & `propagateChange = () => {}`
@@ -41,12 +38,8 @@ components = components.map(comp => ({
4138

4239
// Integrate compodoc documentation with storybook
4340
setCompodocJson({
44-
classes,
45-
components,
46-
directives,
47-
interfaces,
48-
miscellaneous,
49-
pipes
41+
...docJson,
42+
components
5043
});
5144

5245
// Set carbon viewports options
@@ -90,8 +83,14 @@ export const parameters = {
9083
},
9184
},
9285
},
86+
9387
controls: {
9488
expanded: true
89+
},
90+
91+
docs: {
92+
codePanel: true
9593
}
9694
};
9795

96+
export const tags = ["autodocs"];

eslint.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// For more info, see https://github.com/storybookjs/eslint-plugin-storybook#configuration-flat-config-format
2+
import storybook from "eslint-plugin-storybook";
3+
14
const eslint = require("@eslint/js");
25
const tseslint = require("typescript-eslint");
36
const angular = require("angular-eslint");

0 commit comments

Comments
 (0)