Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/green-trees-beam.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/polaris': patch
---

Bumped storybook versions and cleaned up main.js
8 changes: 4 additions & 4 deletions polaris-for-figma/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
"@shopify/polaris": "^9.21.1",
"antd": "^4.20.4",
"lodash": "^4.17.15",
"react": "^16.0.0",
"react-dom": "^16.0.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"sass": "^1.32.8"
},
"devDependencies": {
"@figma/plugin-typings": "^1.19.1",
"@types/react": "^16.0.0",
"@types/react-dom": "^16.0.0",
"@types/react": "^17.0.2",
"@types/react-dom": "^17.0.2",
"@types/node": "^17.0.23",
"babel-loader": "^8.2.3",
"css-loader": "^3.4.2",
Expand Down
22 changes: 1 addition & 21 deletions polaris-react/.storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,13 @@ const path = require('path');
const spawn = require('child_process').spawn;
const CreateFileWebpack = require('create-file-webpack');
const postcssPlugins = require('../config/postcss-plugins');
// Enabling docs means the preview panel takes an extra 2ish seconds to load
// This usually isn't a big deal, except when we're running all of our stories
// through our a11y tests, and a 2s delay over several hundred stories adds up.
// This is an escape hatch to disable docs only wheile we're running a11y tests
const enableDocs = !parseInt(process.env.STORYBOOK_DISABLE_DOCS || '0', 10);

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

Expand Down Expand Up @@ -74,15 +63,6 @@ module.exports = {
},
];

config.plugins.push(
new CreateFileWebpack({
path: './build-internal/storybook/static/services/',
fileName: 'ping.html',
content:
'<!DOCTYPE html><html lang="en"><head></head><body>OK</body></html>',
}),
);

config.module.rules = [
// Strip out existing rules that apply to md files
...config.module.rules.filter(
Expand Down
15 changes: 7 additions & 8 deletions polaris-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,14 @@
"@shopify/postcss-plugin": "^5.0.1",
"@shopify/react-testing": "^3.2.4",
"@shopify/storybook-a11y-test": "0.4.3",
"@storybook/addon-a11y": "^6.4.19",
"@storybook/addon-console": "^1.2.3",
"@storybook/addon-essentials": "^6.4.19",
"@storybook/builder-webpack5": "^6.4.19",
"@storybook/manager-webpack5": "^6.4.19",
"@storybook/react": "^6.4.19",
"@storybook/addon-a11y": "^6.5.9",
"@storybook/addon-toolbars": "^6.5.9",
"@storybook/builder-webpack5": "^6.5.9",
"@storybook/manager-webpack5": "^6.5.9",
"@storybook/react": "^6.5.9",
"@types/node": "^16.11.11",
"@types/react": "^17.0.19",
"@types/react-dom": "^17.0.9",
"@types/react": "^17.0.2",
"@types/react-dom": "^17.0.2",
"ajv-cli": "^5.0.0",
"babel-core": "7.0.0-bridge.0",
"babel-loader": "^8.1.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ describe('<Nav.Item />', () => {
<Item label="some label" disabled={false} />,
);

const event: KeyboardEventInit & {keyCode: Key} = {
const event = {
keyCode: Key.Tab,
};

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

const event: KeyboardEventInit & {keyCode: Key} = {
const event = {
keyCode: Key.Tab,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe('<Checkbox />', () => {
it('on keyUp adds a keyFocused class to the input', () => {
const checkbox = mountWithApp(<Checkbox onChange={noop} />);

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

const event: KeyboardEventInit & {keyCode: Key} = {
const event = {
keyCode: Key.Space,
};

Expand Down
6 changes: 3 additions & 3 deletions polaris.shopify.com/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
"glob": "^7.1.6",
"next": "12.1.0",
"prismjs": "^1.27.0",
"react": "17.0.2",
"react-dom": "17.0.2",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-markdown": "^8.0.2",
"sass": "^1.49.9",
"use-dark-mode": "^2.3.1",
Expand All @@ -41,7 +41,7 @@
"@types/marked": "^4.0.3",
"@types/node": "17.0.21",
"@types/prismjs": "^1.26.0",
"@types/react": "17.0.39",
"@types/react": "*",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The site cannot resolve the types without the "*"

"eslint": "8.10.0",
"eslint-config-next": "12.1.0",
"frontmatter": "^0.0.3",
Expand Down
Loading