Skip to content

Commit 98cfb4d

Browse files
authored
Revert storybook version bump and clean up (#6791)
* Revert "Fix a11y tests" This reverts commit 02663c0. * Revert "Bump storybook versions and clean up main.js (#6770)" This reverts commit 19f6b13.
1 parent 1833c30 commit 98cfb4d

File tree

4 files changed

+1214
-718
lines changed

4 files changed

+1214
-718
lines changed

.changeset/green-trees-beam.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

polaris-react/.storybook/main.js

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,24 @@ const path = require('path');
22
const spawn = require('child_process').spawn;
33
const CreateFileWebpack = require('create-file-webpack');
44
const postcssPlugins = require('../config/postcss-plugins');
5+
// Enabling docs means the preview panel takes an extra 2ish seconds to load
6+
// This usually isn't a big deal, except when we're running all of our stories
7+
// through our a11y tests, and a 2s delay over several hundred stories adds up.
8+
// This is an escape hatch to disable docs only wheile we're running a11y tests
9+
const enableDocs = !parseInt(process.env.STORYBOOK_DISABLE_DOCS || '0', 10);
510

611
module.exports = {
712
core: {
813
builder: 'webpack5',
914
},
15+
// Added to work around https://github.com/storybookjs/storybook/issues/15336
16+
// The line below can be removed in @storybook/react v6.5.0
17+
typescript: {reactDocgen: false},
1018
stories: ['../playground/stories.tsx', '../src/components/**/*/README.md'],
11-
addons: ['@storybook/addon-a11y', '@storybook/addon-toolbars'],
19+
addons: [
20+
{name: '@storybook/addon-essentials', options: {docs: enableDocs}},
21+
'@storybook/addon-a11y',
22+
],
1223
webpackFinal: (config) => {
1324
const isProduction = config.mode === 'production';
1425

@@ -63,6 +74,15 @@ module.exports = {
6374
},
6475
];
6576

77+
config.plugins.push(
78+
new CreateFileWebpack({
79+
path: './build-internal/storybook/static/services/',
80+
fileName: 'ping.html',
81+
content:
82+
'<!DOCTYPE html><html lang="en"><head></head><body>OK</body></html>',
83+
}),
84+
);
85+
6686
config.module.rules = [
6787
// Strip out existing rules that apply to md files
6888
...config.module.rules.filter(

polaris-react/package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,12 @@
8383
"@shopify/postcss-plugin": "^5.0.1",
8484
"@shopify/react-testing": "^3.2.4",
8585
"@shopify/storybook-a11y-test": "0.4.3",
86-
"@storybook/addon-a11y": "^6.5.9",
87-
"@storybook/addon-toolbars": "^6.5.9",
88-
"@storybook/builder-webpack5": "^6.5.9",
89-
"@storybook/manager-webpack5": "^6.5.9",
90-
"@storybook/react": "^6.5.9",
86+
"@storybook/addon-a11y": "^6.4.19",
87+
"@storybook/addon-console": "^1.2.3",
88+
"@storybook/addon-essentials": "^6.4.19",
89+
"@storybook/builder-webpack5": "^6.4.19",
90+
"@storybook/manager-webpack5": "^6.4.19",
91+
"@storybook/react": "^6.4.19",
9192
"@types/node": "^16.11.11",
9293
"@types/react": "^17.0.19",
9394
"@types/react-dom": "^17.0.9",

0 commit comments

Comments
 (0)