Skip to content

Commit d5159ae

Browse files
authored
V16: Upgrade Storybook from V8 to V9 (#19640)
* build(deps-dev): bump storybook from v8 to v9 * chore: run storybook v9 migrations * chore: updates import paths for storybook-webcomponents-vite (migration) * chore: migrates eslint for storybook config * fix: updates old link to composed storybook so we reference the latest production uui * chore: formats eslint config file * chore: changes import path to build mdx stories * chore: updates language list to reflect v16
1 parent 629635e commit d5159ae

File tree

155 files changed

+582
-1349
lines changed

Some content is hidden

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

155 files changed

+582
-1349
lines changed

src/Umbraco.Web.UI.Client/.storybook/main.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ import remarkGfm from 'remark-gfm';
44

55
const config: StorybookConfig = {
66
stories: ['../@(src|libs|apps|storybook)/**/*.mdx', '../@(src|libs|apps|storybook)/**/*.stories.@(js|jsx|ts|tsx)'],
7+
78
addons: [
89
getAbsolutePath('@storybook/addon-links'),
9-
getAbsolutePath('@storybook/addon-essentials'),
1010
getAbsolutePath('@storybook/addon-a11y'),
1111
{
12-
name: '@storybook/addon-docs',
12+
name: getAbsolutePath('@storybook/addon-docs'),
1313
options: {
1414
mdxPluginOptions: {
1515
mdxCompileOptions: {
@@ -19,10 +19,12 @@ const config: StorybookConfig = {
1919
},
2020
},
2121
],
22+
2223
framework: {
2324
name: getAbsolutePath('@storybook/web-components-vite'),
2425
options: {},
2526
},
27+
2628
staticDirs: [
2729
'../public-assets',
2830
'../public',
@@ -32,23 +34,24 @@ const config: StorybookConfig = {
3234
to: 'assets/icons',
3335
},
3436
],
37+
3538
typescript: {
3639
check: true,
3740
},
38-
docs: {
39-
autodocs: true
40-
},
41+
4142
managerHead(head, { configType }) {
4243
const base = process.env.VITE_BASE_PATH || '/';
4344
const injections = [
4445
`<base href="${base}" />`, // This decide how storybook's main frame visit stories
4546
];
4647
return configType === 'PRODUCTION' ? `${injections.join('')}${head}` : head;
4748
},
49+
4850
refs: {
4951
uui: {
5052
title: 'Umbraco UI Library',
51-
url: 'https://62189360eeb21b003ab2f4ad-vfnpsanjps.chromatic.com/',
53+
url: 'https://uui.umbraco.com/',
54+
expanded: false,
5255
},
5356
},
5457
};

src/Umbraco.Web.UI.Client/.storybook/manager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { addons } from '@storybook/manager-api';
1+
import { addons } from 'storybook/manager-api';
22

33
addons.setConfig({
44
enableShortcuts: false,

src/Umbraco.Web.UI.Client/.storybook/preview.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import 'element-internals-polyfill';
55
import '@umbraco-ui/uui';
66

77
import { html } from 'lit';
8-
import { setCustomElements } from '@storybook/web-components';
8+
import { setCustomElements } from '@storybook/web-components-vite';
99

1010
import { startMockServiceWorker } from '../src/mocks';
1111

src/Umbraco.Web.UI.Client/eslint.config.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1+
// For more info, see https://github.com/storybookjs/eslint-plugin-storybook#configuration-flat-config-format
2+
13
import js from '@eslint/js';
24
import globals from 'globals';
35
import importPlugin from 'eslint-plugin-import';
46
import localRules from 'eslint-plugin-local-rules';
7+
import storybook from 'eslint-plugin-storybook';
58
import wcPlugin from 'eslint-plugin-wc';
69
import litPlugin from 'eslint-plugin-lit';
710
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
@@ -13,8 +16,8 @@ export default [
1316
js.configs.recommended,
1417
...tseslint.configs.recommended,
1518
wcPlugin.configs['flat/recommended'],
16-
litPlugin.configs['flat/recommended'],
17-
jsdoc.configs['flat/recommended'], // We use the non typescript version to allow types to be defined in the jsdoc comments. This will allow js docs as an alternative to typescript types.
19+
litPlugin.configs['flat/recommended'], // We use the non typescript version to allow types to be defined in the jsdoc comments. This will allow js docs as an alternative to typescript types.
20+
jsdoc.configs['flat/recommended'],
1821
localRules.configs.all,
1922
eslintPluginPrettierRecommended,
2023

@@ -101,4 +104,5 @@ export default [
101104
},
102105
},
103106
},
107+
...storybook.configs['flat/recommended'],
104108
];

0 commit comments

Comments
 (0)