Skip to content

Commit 51be08e

Browse files
alex-pagechloerice
andauthored
Storybook version bump and clean up (#6792)
Co-authored-by: Chloe Rice <[email protected]>
1 parent 1e4998d commit 51be08e

File tree

8 files changed

+741
-1280
lines changed

8 files changed

+741
-1280
lines changed

.changeset/green-trees-beam.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@shopify/polaris': patch
3+
---
4+
5+
Bumped storybook versions and cleaned up main.js

polaris-for-figma/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@
1515
"@shopify/polaris": "^9.21.1",
1616
"antd": "^4.20.4",
1717
"lodash": "^4.17.15",
18-
"react": "^16.0.0",
19-
"react-dom": "^16.0.0",
18+
"react": "^17.0.2",
19+
"react-dom": "^17.0.2",
2020
"sass": "^1.32.8"
2121
},
2222
"devDependencies": {
2323
"@figma/plugin-typings": "^1.19.1",
24-
"@types/react": "^16.0.0",
25-
"@types/react-dom": "^16.0.0",
24+
"@types/react": "^17.0.2",
25+
"@types/react-dom": "^17.0.2",
2626
"@types/node": "^17.0.23",
2727
"babel-loader": "^8.2.3",
2828
"css-loader": "^3.4.2",

polaris-react/.storybook/main.js

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,13 @@ 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);
105

116
module.exports = {
127
core: {
138
builder: 'webpack5',
149
},
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},
1810
stories: ['../playground/stories.tsx', '../src/components/**/*/README.md'],
19-
addons: [
20-
{name: '@storybook/addon-essentials', options: {docs: enableDocs}},
21-
'@storybook/addon-a11y',
22-
],
11+
addons: ['@storybook/addon-a11y', '@storybook/addon-toolbars'],
2312
webpackFinal: (config) => {
2413
const isProduction = config.mode === 'production';
2514

@@ -74,15 +63,6 @@ module.exports = {
7463
},
7564
];
7665

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-
8666
config.module.rules = [
8767
// Strip out existing rules that apply to md files
8868
...config.module.rules.filter(

polaris-react/package.json

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,14 @@
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.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",
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",
9291
"@types/node": "^16.11.11",
93-
"@types/react": "^17.0.19",
94-
"@types/react-dom": "^17.0.9",
92+
"@types/react": "^17.0.2",
93+
"@types/react-dom": "^17.0.2",
9594
"ajv-cli": "^5.0.0",
9695
"babel-core": "7.0.0-bridge.0",
9796
"babel-loader": "^8.1.0",

polaris-react/src/components/Navigation/components/Item/tests/Item.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,7 @@ describe('<Nav.Item />', () => {
708708
<Item label="some label" disabled={false} />,
709709
);
710710

711-
const event: KeyboardEventInit & {keyCode: Key} = {
711+
const event = {
712712
keyCode: Key.Tab,
713713
};
714714

@@ -728,7 +728,7 @@ describe('<Nav.Item />', () => {
728728
<Item label="some label" disabled={false} url="https://shopify.com" />,
729729
);
730730

731-
const event: KeyboardEventInit & {keyCode: Key} = {
731+
const event = {
732732
keyCode: Key.Tab,
733733
};
734734

polaris-react/src/components/OptionList/components/Checkbox/tests/Checkbox.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ describe('<Checkbox />', () => {
3636
it('on keyUp adds a keyFocused class to the input', () => {
3737
const checkbox = mountWithApp(<Checkbox onChange={noop} />);
3838

39-
const event: KeyboardEventInit & {keyCode: Key} = {
39+
const event = {
4040
keyCode: Key.Space,
4141
};
4242
checkbox.find('input')!.trigger('onKeyUp', event);
@@ -48,7 +48,7 @@ describe('<Checkbox />', () => {
4848
it('removes the keyFocused class on blur', () => {
4949
const checkbox = mountWithApp(<Checkbox onChange={noop} />);
5050

51-
const event: KeyboardEventInit & {keyCode: Key} = {
51+
const event = {
5252
keyCode: Key.Space,
5353
};
5454

polaris.shopify.com/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
"glob": "^7.1.6",
3030
"next": "12.1.0",
3131
"prismjs": "^1.27.0",
32-
"react": "17.0.2",
33-
"react-dom": "17.0.2",
32+
"react": "^17.0.2",
33+
"react-dom": "^17.0.2",
3434
"react-markdown": "^8.0.2",
3535
"sass": "^1.49.9",
3636
"use-dark-mode": "^2.3.1",
@@ -41,7 +41,7 @@
4141
"@types/marked": "^4.0.3",
4242
"@types/node": "17.0.21",
4343
"@types/prismjs": "^1.26.0",
44-
"@types/react": "17.0.39",
44+
"@types/react": "*",
4545
"eslint": "8.10.0",
4646
"eslint-config-next": "12.1.0",
4747
"frontmatter": "^0.0.3",

0 commit comments

Comments
 (0)