Skip to content

Commit 2daf5a7

Browse files
authored
Merge pull request #2593 from Akshat55/storybook-v7
docs: Update to storybook v7
2 parents b7db36d + 7aa26e8 commit 2daf5a7

File tree

65 files changed

+27645
-40890
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+27645
-40890
lines changed

.storybook/main.js

Lines changed: 8 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
const path = require('path');
2-
32
module.exports = {
43
staticDirs: ["public"],
5-
stories: [
6-
"../src/**/*.stories.mdx",
7-
"../src/**/*.stories.@(js|jsx|ts|tsx)"
8-
],
4+
stories: ["../src/**/*.stories.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
95
addons: [
106
"@storybook/addon-links",
117
{
@@ -14,39 +10,16 @@ module.exports = {
1410
backgrounds: false
1511
}
1612
},
17-
{
18-
name: '@storybook/addon-storysource',
19-
options: {
20-
rule: {
21-
test: [/\.stories\.ts$/, /index\.ts$/],
22-
include: [path.resolve(__dirname, '../src')]
23-
},
24-
loaderOptions: {
25-
injectStoryParameters: true,
26-
prettierConfig: { printWidth: 80, singleQuote: false }
27-
}
28-
}
29-
},
3013
"@storybook/addon-a11y"
3114
],
32-
framework: "@storybook/angular",
15+
framework: {
16+
name: "@storybook/angular",
17+
options: {}
18+
},
3319
core: {
34-
builder: "webpack5",
3520
disableTelemetry: true
3621
},
37-
webpackFinal: async config => {
38-
config.module.rules.push({
39-
test: [/\.stories\.ts$/, /index\.ts$/],
40-
include: [path.resolve(__dirname, '../src')],
41-
use: [
42-
{
43-
loader: require.resolve('@storybook/source-loader'),
44-
options: { parser: 'typescript' }
45-
}
46-
],
47-
enforce: 'pre'
48-
});
49-
50-
return config;
22+
docs: {
23+
autodocs: true
5124
}
52-
}
25+
};

.storybook/preview.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,19 @@ components = components.map(comp => ({
2323
...input,
2424
// Storybook does not seem to display deprecated message currently
2525
// Bypassing this by updating rawdescription
26-
rawdescription: input.deprecated ? `**@Deprecatated**\n\n${input.deprecationMessage}` : input.rawdescription
26+
// Using `description` to display formatted code
27+
rawdescription: input.deprecated ? `**@Deprecatated**\n\n${input.deprecationMessage}` : input.description
2728
})),
2829
// Removes properties
2930
propertiesClass: [],
3031
outputsClass: comp.outputsClass.map((output) => ({
3132
...output,
3233
// Prevents control type appearing as `string`
33-
defaultValue: undefined
34+
defaultValue: undefined,
35+
// Storybook does not seem to display deprecated message currently
36+
// Bypassing this by updating rawdescription
37+
// Using `description` to display formatted code
38+
rawdescription: output.deprecated ? `**@Deprecatated**\n\n${output.deprecationMessage}` : output.description
3439
}))
3540
}));
3641

0 commit comments

Comments
 (0)