Skip to content

Commit 2d35fbd

Browse files
committed
chore: update storybook to v9
1 parent 79f2106 commit 2d35fbd

File tree

6 files changed

+3307
-2804
lines changed

6 files changed

+3307
-2804
lines changed

.storybook/main.js

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
const path = require('path');
22
module.exports = {
3-
staticDirs: ["public"],
4-
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
5-
addons: ["@storybook/addon-links", {
6-
name: "@storybook/addon-essentials",
7-
options: {
8-
backgrounds: false
9-
}
10-
}, "@storybook/addon-a11y", "@storybook/addon-storysource"],
11-
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: {
128
name: "@storybook/angular",
139
options: {}
1410
},
15-
core: {
11+
12+
core: {
1613
disableTelemetry: true
1714
},
18-
docs: {}
15+
16+
docs: {},
17+
18+
features: {
19+
backgrounds: false
20+
}
1921
};

.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/manager-api';
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: 10 additions & 13 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,10 +83,14 @@ export const parameters = {
9083
},
9184
},
9285
},
86+
9387
controls: {
9488
expanded: true
89+
},
90+
91+
docs: {
92+
codePanel: true
9593
}
9694
};
9795

9896
export const tags = ["autodocs"];
99-

eslint.config.js

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

5-
module.exports = tseslint.config({
4+
import eslint from "@eslint/js";
5+
import tseslint from "typescript-eslint";
6+
import angular from "angular-eslint";
7+
8+
export default tseslint.config({
69
files: ["src/**/*.ts"],
710
extends: [
811
eslint.configs.recommended,
@@ -141,5 +144,6 @@ module.exports = tseslint.config({
141144
"@angular-eslint/template/role-has-required-aria": "warn",
142145
"@angular-eslint/template/alt-text": "warn"
143146
},
144-
}
147+
},
148+
storybook.configs['flat/recommended'],
145149
);

0 commit comments

Comments
 (0)